From webhook-mailer at python.org Mon Oct 1 02:52:17 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 01 Oct 2018 06:52:17 -0000 Subject: [Python-checkins] Fix name of argument in docs for functools.reduce(). (#9634) Message-ID: https://github.com/python/cpython/commit/9df100286b35f1f9fa85976d573981f558805b3f commit: 9df100286b35f1f9fa85976d573981f558805b3f branch: master author: Brendan Jurd committer: Raymond Hettinger date: 2018-09-30T23:52:10-07:00 summary: Fix name of argument in docs for functools.reduce(). (#9634) files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 214d57334c8d..7d59ec9187df 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -280,14 +280,14 @@ The :mod:`functools` module defines the following functions: .. function:: reduce(function, iterable[, initializer]) - Apply *function* of two arguments cumulatively to the items of *sequence*, from - left to right, so as to reduce the sequence to a single value. For example, + Apply *function* of two arguments cumulatively to the items of *iterable*, from + left to right, so as to reduce the iterable to a single value. For example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates ``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and the right argument, *y*, is - the update value from the *sequence*. If the optional *initializer* is present, - it is placed before the items of the sequence in the calculation, and serves as - a default when the sequence is empty. If *initializer* is not given and - *sequence* contains only one item, the first item is returned. + the update value from the *iterable*. If the optional *initializer* is present, + it is placed before the items of the iterable in the calculation, and serves as + a default when the iterable is empty. If *initializer* is not given and + *iterable* contains only one item, the first item is returned. Roughly equivalent to:: From solipsis at pitrou.net Mon Oct 1 05:08:03 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 01 Oct 2018 09:08:03 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=5 Message-ID: <20181001090803.1.C90FC57959AC3FE3@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, 0, -7] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [1, -2, 2] memory blocks, sum=1 test_multiprocessing_spawn leaked [-2, 0, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog7hzU7M', '--timeout', '7200'] From webhook-mailer at python.org Mon Oct 1 06:03:27 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 01 Oct 2018 10:03:27 -0000 Subject: [Python-checkins] bpo-30156: Remove property_descr_get() optimization (GH-9541) Message-ID: https://github.com/python/cpython/commit/e972c13624c32d0efdceb08ff83917fb6b488525 commit: e972c13624c32d0efdceb08ff83917fb6b488525 branch: master author: Victor Stinner committer: GitHub date: 2018-10-01T03:03:22-07:00 summary: bpo-30156: Remove property_descr_get() optimization (GH-9541) property_descr_get() uses a "cached" tuple to optimize function calls. But this tuple can be discovered in debug mode with sys.getobjects(). Remove the optimization, it's not really worth it and it causes 3 different crashes last years. Microbenchmark: ./python -m perf timeit -v \ -s "from collections import namedtuple; P = namedtuple('P', 'x y'); p = P(1, 2)" \ --duplicate 1024 "p.x" Result: Mean +- std dev: [ref] 32.8 ns +- 0.8 ns -> [patch] 40.4 ns +- 1.3 ns: 1.23x slower (+23%) files: A Misc/NEWS.d/next/Core and Builtins/2018-09-24-17-51-15.bpo-30156.pH0j5j.rst M Objects/descrobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-24-17-51-15.bpo-30156.pH0j5j.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-24-17-51-15.bpo-30156.pH0j5j.rst new file mode 100644 index 000000000000..7086ff4e2d99 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-24-17-51-15.bpo-30156.pH0j5j.rst @@ -0,0 +1,4 @@ +The C function ``property_descr_get()`` uses a "cached" tuple to optimize +function calls. But this tuple can be discovered in debug mode with +:func:`sys.getobjects()`. Remove the optimization, it's not really worth it +and it causes 3 different crashes last years. diff --git a/Objects/descrobject.c b/Objects/descrobject.c index b1bee904ec86..82afa8c63f86 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1331,42 +1331,19 @@ property_dealloc(PyObject *self) static PyObject * property_descr_get(PyObject *self, PyObject *obj, PyObject *type) { - static PyObject * volatile cached_args = NULL; - PyObject *args; - PyObject *ret; - propertyobject *gs = (propertyobject *)self; - if (obj == NULL || obj == Py_None) { Py_INCREF(self); return self; } + + propertyobject *gs = (propertyobject *)self; if (gs->prop_get == NULL) { PyErr_SetString(PyExc_AttributeError, "unreadable attribute"); return NULL; } - args = cached_args; - cached_args = NULL; - if (!args) { - args = PyTuple_New(1); - if (!args) - return NULL; - _PyObject_GC_UNTRACK(args); - } - Py_INCREF(obj); - PyTuple_SET_ITEM(args, 0, obj); - ret = PyObject_Call(gs->prop_get, args, NULL); - if (cached_args == NULL && Py_REFCNT(args) == 1) { - assert(PyTuple_GET_SIZE(args) == 1); - assert(PyTuple_GET_ITEM(args, 0) == obj); - cached_args = args; - Py_DECREF(obj); - } - else { - assert(Py_REFCNT(args) >= 1); - _PyObject_GC_TRACK(args); - Py_DECREF(args); - } - return ret; + + PyObject *args[1] = {obj}; + return _PyObject_FastCall(gs->prop_get, args, 1); } static int From webhook-mailer at python.org Mon Oct 1 06:09:42 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Mon, 01 Oct 2018 10:09:42 -0000 Subject: [Python-checkins] bpo-34476: Document that asyncio.sleep() always suspends. (#9643) Message-ID: https://github.com/python/cpython/commit/cd602b8af2d14ff686261eeb18b80f718bb16550 commit: cd602b8af2d14ff686261eeb18b80f718bb16550 branch: master author: Hrvoje Nik?i? committer: Andrew Svetlov date: 2018-10-01T13:09:38+03:00 summary: bpo-34476: Document that asyncio.sleep() always suspends. (#9643) files: M Doc/library/asyncio-task.rst diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index d7102b807b60..ffeeb2d3bbb1 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -276,6 +276,9 @@ Sleeping If *result* is provided, it is returned to the caller when the coroutine completes. + ``sleep()`` always suspends the current task, allowing other tasks + to run. + The *loop* argument is deprecated and scheduled for removal in Python 3.10. From webhook-mailer at python.org Mon Oct 1 06:19:36 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Mon, 01 Oct 2018 10:19:36 -0000 Subject: [Python-checkins] bpo-34476: Document that asyncio.sleep() always suspends. (GH-9643) (#9654) Message-ID: https://github.com/python/cpython/commit/655608a1112e592cd6a9155ebe774dd285f561f3 commit: 655608a1112e592cd6a9155ebe774dd285f561f3 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Andrew Svetlov date: 2018-10-01T13:19:33+03:00 summary: bpo-34476: Document that asyncio.sleep() always suspends. (GH-9643) (#9654) (cherry picked from commit cd602b8af2d14ff686261eeb18b80f718bb16550) Co-authored-by: Hrvoje Nik?i? files: M Doc/library/asyncio-task.rst diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 198bd7d07a01..3168f478f3c0 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -270,6 +270,9 @@ Sleeping If *result* is provided, it is returned to the caller when the coroutine completes. + ``sleep()`` always suspends the current task, allowing other tasks + to run. + The *loop* argument is deprecated and scheduled for removal in Python 3.10. From webhook-mailer at python.org Mon Oct 1 08:10:44 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Mon, 01 Oct 2018 12:10:44 -0000 Subject: [Python-checkins] bpo-30167: Add test for module.__cached__ is None (GH-7617) Message-ID: https://github.com/python/cpython/commit/d4c76d960b8b286b75c933780416ace9cda682fd commit: d4c76d960b8b286b75c933780416ace9cda682fd branch: master author: INADA Naoki committer: GitHub date: 2018-10-01T21:10:37+09:00 summary: bpo-30167: Add test for module.__cached__ is None (GH-7617) files: M Lib/test/test_site.py diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index dc59e5917cfa..33a8f1a44ccc 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -389,6 +389,17 @@ def test_abs_paths(self): "expected absolute path, got {}" .format(os__cached__.decode('ascii'))) + def test_abs_paths_cached_None(self): + """Test for __cached__ is None. + + Regarding to PEP 3147, __cached__ can be None. + + See also: https://bugs.python.org/issue30167 + """ + sys.modules['test'].__cached__ = None + site.abs_paths() + self.assertIsNone(sys.modules['test'].__cached__) + def test_no_duplicate_paths(self): # No duplicate paths should exist in sys.path # Handled by removeduppaths() From webhook-mailer at python.org Mon Oct 1 20:34:50 2018 From: webhook-mailer at python.org (Ezio Melotti) Date: Tue, 02 Oct 2018 00:34:50 -0000 Subject: [Python-checkins] bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662) Message-ID: https://github.com/python/cpython/commit/30534cc7172f36092e0002bb7df482edc0d539ce commit: 30534cc7172f36092e0002bb7df482edc0d539ce branch: master author: Ezio Melotti committer: GitHub date: 2018-10-01T17:34:46-07:00 summary: bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662) files: M Doc/library/html.rst diff --git a/Doc/library/html.rst b/Doc/library/html.rst index d0706bcbc079..c2b01e14ea75 100644 --- a/Doc/library/html.rst +++ b/Doc/library/html.rst @@ -24,7 +24,7 @@ This module defines utilities to manipulate HTML. .. function:: unescape(s) Convert all named and numeric character references (e.g. ``>``, - ``>``, ``&x3e;``) in the string *s* to the corresponding unicode + ``>``, ``>``) in the string *s* to the corresponding Unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the :data:`list of HTML 5 named character references `. From webhook-mailer at python.org Mon Oct 1 20:43:58 2018 From: webhook-mailer at python.org (Ezio Melotti) Date: Tue, 02 Oct 2018 00:43:58 -0000 Subject: [Python-checkins] bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9663) Message-ID: https://github.com/python/cpython/commit/27d7f93f633f0163b96d0a95e312f0eb5615abfd commit: 27d7f93f633f0163b96d0a95e312f0eb5615abfd branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ezio Melotti date: 2018-10-01T17:43:54-07:00 summary: bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9663) (cherry picked from commit 30534cc7172f36092e0002bb7df482edc0d539ce) Co-authored-by: Ezio Melotti files: M Doc/library/html.rst diff --git a/Doc/library/html.rst b/Doc/library/html.rst index d0706bcbc079..c2b01e14ea75 100644 --- a/Doc/library/html.rst +++ b/Doc/library/html.rst @@ -24,7 +24,7 @@ This module defines utilities to manipulate HTML. .. function:: unescape(s) Convert all named and numeric character references (e.g. ``>``, - ``>``, ``&x3e;``) in the string *s* to the corresponding unicode + ``>``, ``>``) in the string *s* to the corresponding Unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the :data:`list of HTML 5 named character references `. From webhook-mailer at python.org Mon Oct 1 20:44:35 2018 From: webhook-mailer at python.org (Ezio Melotti) Date: Tue, 02 Oct 2018 00:44:35 -0000 Subject: [Python-checkins] bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9664) Message-ID: https://github.com/python/cpython/commit/56c102596f01ecbbe5cca6339d2ae16695b083ff commit: 56c102596f01ecbbe5cca6339d2ae16695b083ff branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ezio Melotti date: 2018-10-01T17:44:31-07:00 summary: bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9664) (cherry picked from commit 30534cc7172f36092e0002bb7df482edc0d539ce) Co-authored-by: Ezio Melotti files: M Doc/library/html.rst diff --git a/Doc/library/html.rst b/Doc/library/html.rst index d0706bcbc079..c2b01e14ea75 100644 --- a/Doc/library/html.rst +++ b/Doc/library/html.rst @@ -24,7 +24,7 @@ This module defines utilities to manipulate HTML. .. function:: unescape(s) Convert all named and numeric character references (e.g. ``>``, - ``>``, ``&x3e;``) in the string *s* to the corresponding unicode + ``>``, ``>``) in the string *s* to the corresponding Unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the :data:`list of HTML 5 named character references `. From webhook-mailer at python.org Tue Oct 2 00:54:43 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Tue, 02 Oct 2018 04:54:43 -0000 Subject: [Python-checkins] closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666) Message-ID: https://github.com/python/cpython/commit/cbda8fc5d76b10bcbb92d927537576c229143836 commit: cbda8fc5d76b10bcbb92d927537576c229143836 branch: master author: Benjamin Peterson committer: GitHub date: 2018-10-01T21:54:39-07:00 summary: closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666) files: M Lib/test/test_long.py M Python/formatter_unicode.c diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 7c883baebb41..5b860dd36bc0 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -700,6 +700,9 @@ def test__format__(self): self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, '_,d') self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, ',_d') + self.assertRaisesRegex(ValueError, "Cannot specify ',' with 's'", format, 3, ',s') + self.assertRaisesRegex(ValueError, "Cannot specify '_' with 's'", format, 3, '_s') + # ensure that only int and float type specifiers work for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] + [chr(x) for x in range(ord('A'), ord('Z')+1)]): diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 71e673d9f832..ba09cc67becf 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -28,16 +28,17 @@ unknown_presentation_type(Py_UCS4 presentation_type, } static void -invalid_comma_type(Py_UCS4 presentation_type) +invalid_thousands_separator_type(char specifier, Py_UCS4 presentation_type) { + assert(specifier == ',' || specifier == '_'); if (presentation_type > 32 && presentation_type < 128) PyErr_Format(PyExc_ValueError, - "Cannot specify ',' with '%c'.", - (char)presentation_type); + "Cannot specify '%c' with '%c'.", + specifier, (char)presentation_type); else PyErr_Format(PyExc_ValueError, - "Cannot specify ',' with '\\x%x'.", - (unsigned int)presentation_type); + "Cannot specify '%c' with '\\x%x'.", + specifier, (unsigned int)presentation_type); } static void @@ -117,8 +118,8 @@ is_sign_element(Py_UCS4 c) /* Locale type codes. LT_NO_LOCALE must be zero. */ enum LocaleType { LT_NO_LOCALE = 0, - LT_DEFAULT_LOCALE, - LT_UNDERSCORE_LOCALE, + LT_DEFAULT_LOCALE = ',', + LT_UNDERSCORE_LOCALE = '_', LT_UNDER_FOUR_LOCALE, LT_CURRENT_LOCALE }; @@ -314,7 +315,7 @@ parse_internal_render_format_spec(PyObject *format_spec, } /* fall through */ default: - invalid_comma_type(format->type); + invalid_thousands_separator_type(format->thousands_separators, format->type); return 0; } } From webhook-mailer at python.org Tue Oct 2 01:12:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 02 Oct 2018 05:12:06 -0000 Subject: [Python-checkins] closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666) Message-ID: https://github.com/python/cpython/commit/cd4dd9374d0fc65b070a61871801d306090f8375 commit: cd4dd9374d0fc65b070a61871801d306090f8375 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-01T22:12:02-07:00 summary: closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666) (cherry picked from commit cbda8fc5d76b10bcbb92d927537576c229143836) Co-authored-by: Benjamin Peterson files: M Lib/test/test_long.py M Python/formatter_unicode.c diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 8472889d48ba..b4a99e353c0b 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -699,6 +699,9 @@ def test__format__(self): self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, '_,d') self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, ',_d') + self.assertRaisesRegex(ValueError, "Cannot specify ',' with 's'", format, 3, ',s') + self.assertRaisesRegex(ValueError, "Cannot specify '_' with 's'", format, 3, '_s') + # ensure that only int and float type specifiers work for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] + [chr(x) for x in range(ord('A'), ord('Z')+1)]): diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 71e673d9f832..ba09cc67becf 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -28,16 +28,17 @@ unknown_presentation_type(Py_UCS4 presentation_type, } static void -invalid_comma_type(Py_UCS4 presentation_type) +invalid_thousands_separator_type(char specifier, Py_UCS4 presentation_type) { + assert(specifier == ',' || specifier == '_'); if (presentation_type > 32 && presentation_type < 128) PyErr_Format(PyExc_ValueError, - "Cannot specify ',' with '%c'.", - (char)presentation_type); + "Cannot specify '%c' with '%c'.", + specifier, (char)presentation_type); else PyErr_Format(PyExc_ValueError, - "Cannot specify ',' with '\\x%x'.", - (unsigned int)presentation_type); + "Cannot specify '%c' with '\\x%x'.", + specifier, (unsigned int)presentation_type); } static void @@ -117,8 +118,8 @@ is_sign_element(Py_UCS4 c) /* Locale type codes. LT_NO_LOCALE must be zero. */ enum LocaleType { LT_NO_LOCALE = 0, - LT_DEFAULT_LOCALE, - LT_UNDERSCORE_LOCALE, + LT_DEFAULT_LOCALE = ',', + LT_UNDERSCORE_LOCALE = '_', LT_UNDER_FOUR_LOCALE, LT_CURRENT_LOCALE }; @@ -314,7 +315,7 @@ parse_internal_render_format_spec(PyObject *format_spec, } /* fall through */ default: - invalid_comma_type(format->type); + invalid_thousands_separator_type(format->thousands_separators, format->type); return 0; } } From webhook-mailer at python.org Tue Oct 2 01:18:18 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 02 Oct 2018 05:18:18 -0000 Subject: [Python-checkins] closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666) Message-ID: https://github.com/python/cpython/commit/7455bf46a222780805fd0375328f5732e5bbb684 commit: 7455bf46a222780805fd0375328f5732e5bbb684 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-01T22:18:13-07:00 summary: closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666) (cherry picked from commit cbda8fc5d76b10bcbb92d927537576c229143836) Co-authored-by: Benjamin Peterson files: M Lib/test/test_long.py M Python/formatter_unicode.c diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 140ace18dd1e..6937284655cd 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -699,6 +699,9 @@ def test__format__(self): self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, '_,d') self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, ',_d') + self.assertRaisesRegex(ValueError, "Cannot specify ',' with 's'", format, 3, ',s') + self.assertRaisesRegex(ValueError, "Cannot specify '_' with 's'", format, 3, '_s') + # ensure that only int and float type specifiers work for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] + [chr(x) for x in range(ord('A'), ord('Z')+1)]): diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index d3ef650e6ce6..d6772c593877 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -28,16 +28,17 @@ unknown_presentation_type(Py_UCS4 presentation_type, } static void -invalid_comma_type(Py_UCS4 presentation_type) +invalid_thousands_separator_type(char specifier, Py_UCS4 presentation_type) { + assert(specifier == ',' || specifier == '_'); if (presentation_type > 32 && presentation_type < 128) PyErr_Format(PyExc_ValueError, - "Cannot specify ',' with '%c'.", - (char)presentation_type); + "Cannot specify '%c' with '%c'.", + specifier, (char)presentation_type); else PyErr_Format(PyExc_ValueError, - "Cannot specify ',' with '\\x%x'.", - (unsigned int)presentation_type); + "Cannot specify '%c' with '\\x%x'.", + specifier, (unsigned int)presentation_type); } static void @@ -117,8 +118,8 @@ is_sign_element(Py_UCS4 c) /* Locale type codes. LT_NO_LOCALE must be zero. */ enum LocaleType { LT_NO_LOCALE = 0, - LT_DEFAULT_LOCALE, - LT_UNDERSCORE_LOCALE, + LT_DEFAULT_LOCALE = ',', + LT_UNDERSCORE_LOCALE = '_', LT_UNDER_FOUR_LOCALE, LT_CURRENT_LOCALE }; @@ -314,7 +315,7 @@ parse_internal_render_format_spec(PyObject *format_spec, } /* fall through */ default: - invalid_comma_type(format->type); + invalid_thousands_separator_type(format->thousands_separators, format->type); return 0; } } From webhook-mailer at python.org Tue Oct 2 01:18:47 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Tue, 02 Oct 2018 05:18:47 -0000 Subject: [Python-checkins] Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) Message-ID: https://github.com/python/cpython/commit/be4e5b89204283a62e369439025f00362d0424f6 commit: be4e5b89204283a62e369439025f00362d0424f6 branch: master author: Benjamin Peterson committer: GitHub date: 2018-10-01T22:18:44-07:00 summary: Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index adea431ed48b..da8ce4082043 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -944,7 +944,7 @@ Test cases +---------------------------------------------------------+--------------------------------------+------------+ .. method:: assertRaises(exception, callable, *args, **kwds) - assertRaises(exception, msg=None) + assertRaises(exception, *, msg=None) Test that an exception is raised when *callable* is called with any positional or keyword arguments that are also passed to From webhook-mailer at python.org Tue Oct 2 01:19:59 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Tue, 02 Oct 2018 05:19:59 -0000 Subject: [Python-checkins] closes bpo-34862: Guard definition of convert_sched_param with POSIX_SPAWN_SETSCHEDULER. (GH-9658) Message-ID: https://github.com/python/cpython/commit/81574b80e92554adf75c13fa42415beb8be383cb commit: 81574b80e92554adf75c13fa42415beb8be383cb branch: master author: William Orr committer: Benjamin Peterson date: 2018-10-01T22:19:56-07:00 summary: closes bpo-34862: Guard definition of convert_sched_param with POSIX_SPAWN_SETSCHEDULER. (GH-9658) Fixes broken build on OpenBSD-current. files: M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 704c824e9e32..99a1be70c12a 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -2064,7 +2064,7 @@ os_sched_getscheduler(PyObject *module, PyObject *arg) #endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETSCHEDULER) */ -#if defined(HAVE_SCHED_H) && (defined(HAVE_SCHED_SETSCHEDULER) || defined(HAVE_SCHED_SETPARAM)) +#if defined(HAVE_SCHED_H) && (defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)) PyDoc_STRVAR(os_sched_param__doc__, "sched_param(sched_priority)\n" @@ -2096,7 +2096,7 @@ os_sched_param(PyTypeObject *type, PyObject *args, PyObject *kwargs) return return_value; } -#endif /* defined(HAVE_SCHED_H) && (defined(HAVE_SCHED_SETSCHEDULER) || defined(HAVE_SCHED_SETPARAM)) */ +#endif /* defined(HAVE_SCHED_H) && (defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)) */ #if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETSCHEDULER) @@ -6757,4 +6757,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=40cac0135f846202 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1603fddefffa1fb9 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c7223ab52055..23552bea4cae 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1942,7 +1942,7 @@ static PyTypeObject WaitidResultType; static int initialized; static PyTypeObject StatResultType; static PyTypeObject StatVFSResultType; -#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) +#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) static PyTypeObject SchedParamType; #endif static newfunc structseq_new; @@ -5160,8 +5160,10 @@ enum posix_spawn_file_actions_identifier { POSIX_SPAWN_DUP2 }; +#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) static int convert_sched_param(PyObject *param, struct sched_param *res); +#endif static int parse_posix_spawn_flags(PyObject *setpgroup, int resetids, PyObject *setsigmask, @@ -5925,7 +5927,7 @@ os_sched_getscheduler_impl(PyObject *module, pid_t pid) #endif /* HAVE_SCHED_SETSCHEDULER */ -#if defined(HAVE_SCHED_SETSCHEDULER) || defined(HAVE_SCHED_SETPARAM) +#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) /*[clinic input] class os.sched_param "PyObject *" "&SchedParamType" @@ -5986,7 +5988,7 @@ convert_sched_param(PyObject *param, struct sched_param *res) res->sched_priority = Py_SAFE_DOWNCAST(priority, long, int); return 1; } -#endif /* defined(HAVE_SCHED_SETSCHEDULER) || defined(HAVE_SCHED_SETPARAM) */ +#endif /* defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) */ #ifdef HAVE_SCHED_SETSCHEDULER @@ -13925,7 +13927,7 @@ INITFUNC(void) # endif #endif -#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) +#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) sched_param_desc.name = MODNAME ".sched_param"; if (PyStructSequence_InitType2(&SchedParamType, &sched_param_desc) < 0) return NULL; From webhook-mailer at python.org Tue Oct 2 01:32:05 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 02 Oct 2018 05:32:05 -0000 Subject: [Python-checkins] Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) Message-ID: https://github.com/python/cpython/commit/484c899a5bdfc0a90ea9f269836a5f67183cf496 commit: 484c899a5bdfc0a90ea9f269836a5f67183cf496 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-01T22:32:01-07:00 summary: Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) (cherry picked from commit be4e5b89204283a62e369439025f00362d0424f6) Co-authored-by: Benjamin Peterson files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index adea431ed48b..da8ce4082043 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -944,7 +944,7 @@ Test cases +---------------------------------------------------------+--------------------------------------+------------+ .. method:: assertRaises(exception, callable, *args, **kwds) - assertRaises(exception, msg=None) + assertRaises(exception, *, msg=None) Test that an exception is raised when *callable* is called with any positional or keyword arguments that are also passed to From webhook-mailer at python.org Tue Oct 2 01:34:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 02 Oct 2018 05:34:23 -0000 Subject: [Python-checkins] Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) Message-ID: https://github.com/python/cpython/commit/58376c6c97db692f06d0ea930d9b6f02e2c1ebe3 commit: 58376c6c97db692f06d0ea930d9b6f02e2c1ebe3 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-01T22:34:20-07:00 summary: Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) (cherry picked from commit be4e5b89204283a62e369439025f00362d0424f6) Co-authored-by: Benjamin Peterson files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 99b9ccb8dd8f..17deeddd37d1 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -925,7 +925,7 @@ Test cases +---------------------------------------------------------+--------------------------------------+------------+ .. method:: assertRaises(exception, callable, *args, **kwds) - assertRaises(exception, msg=None) + assertRaises(exception, *, msg=None) Test that an exception is raised when *callable* is called with any positional or keyword arguments that are also passed to From solipsis at pitrou.net Tue Oct 2 05:07:24 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 02 Oct 2018 09:07:24 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=14 Message-ID: <20181002090724.1.44BAF02656F0336E@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 0, 3] memory blocks, sum=3 test_collections leaked [0, 7, 0] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, -2, 2] memory blocks, sum=0 test_multiprocessing_forkserver leaked [2, 0, -2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/refloglI3idT', '--timeout', '7200'] From webhook-mailer at python.org Tue Oct 2 12:35:08 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Tue, 02 Oct 2018 16:35:08 -0000 Subject: [Python-checkins] Remove recent from logging cookbook (GH-9636) Message-ID: https://github.com/python/cpython/commit/11c4eaa99362f91c7faea88e31df3e46af020023 commit: 11c4eaa99362f91c7faea88e31df3e46af020023 branch: master author: Cheryl Sabella committer: Raymond Hettinger date: 2018-10-02T09:35:05-07:00 summary: Remove recent from logging cookbook (GH-9636) files: M Doc/howto/logging-cookbook.rst diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst index 285aff7937c3..83c2d49c6d2a 100644 --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -721,9 +721,8 @@ existing processes to perform this function.) includes a working socket receiver which can be used as a starting point for you to adapt in your own applications. -If you are using a recent version of Python which includes the -:mod:`multiprocessing` module, you could write your own handler which uses the -:class:`~multiprocessing.Lock` class from this module to serialize access to the +You could also write your own handler which uses the :class:`~multiprocessing.Lock` +class from the :mod:`multiprocessing` module to serialize access to the file from your processes. The existing :class:`FileHandler` and subclasses do not make use of :mod:`multiprocessing` at present, though they may do so in the future. Note that at present, the :mod:`multiprocessing` module does not provide From webhook-mailer at python.org Tue Oct 2 13:53:11 2018 From: webhook-mailer at python.org (Yury Selivanov) Date: Tue, 02 Oct 2018 17:53:11 -0000 Subject: [Python-checkins] bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661) Message-ID: https://github.com/python/cpython/commit/9012a0fb4c4ec1afef9efb9fdb0964554ea17983 commit: 9012a0fb4c4ec1afef9efb9fdb0964554ea17983 branch: master author: Yury Selivanov committer: GitHub date: 2018-10-02T13:53:06-04:00 summary: bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661) files: M Lib/test/test_asyncgen.py M Lib/test/test_asyncio/functional.py M Lib/test/test_asyncio/test_base_events.py M Lib/test/test_asyncio/test_buffered_proto.py M Lib/test/test_asyncio/test_events.py M Lib/test/test_asyncio/test_locks.py M Lib/test/test_asyncio/test_pep492.py M Lib/test/test_asyncio/test_queues.py M Lib/test/test_asyncio/test_selector_events.py M Lib/test/test_asyncio/test_sslproto.py M Lib/test/test_asyncio/test_streams.py M Lib/test/test_asyncio/test_subprocess.py M Lib/test/test_asyncio/test_tasks.py M Lib/test/test_asyncio/utils.py diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py index 9d60cb0e7e8f..71b0968c7944 100644 --- a/Lib/test/test_asyncgen.py +++ b/Lib/test/test_asyncgen.py @@ -395,9 +395,9 @@ def tearDown(self): def test_async_gen_asyncio_01(self): async def gen(): yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) return yield 3 @@ -407,7 +407,7 @@ def test_async_gen_asyncio_01(self): def test_async_gen_asyncio_02(self): async def gen(): yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 2 1 / 0 yield 3 @@ -421,7 +421,7 @@ def test_async_gen_asyncio_03(self): class Gen: async def __aiter__(self): yield 1 - await asyncio.sleep(0.01, loop=loop) + await asyncio.sleep(0.01) yield 2 res = loop.run_until_complete(self.to_list(Gen())) @@ -430,13 +430,13 @@ class Gen: def test_async_gen_asyncio_anext_04(self): async def foo(): yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) try: yield 2 yield 3 except ZeroDivisionError: yield 1000 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 4 async def run1(): @@ -587,7 +587,7 @@ def test_async_gen_asyncio_aclose_06(self): yield 1 1 / 0 finally: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 12 async def run(): @@ -610,8 +610,8 @@ def test_async_gen_asyncio_aclose_07(self): yield 1 1 / 0 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE += 1 DONE += 1000 @@ -637,8 +637,8 @@ def test_async_gen_asyncio_aclose_08(self): DONE += 1000 yield 2 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE += 1 DONE += 1000 @@ -647,7 +647,7 @@ def test_async_gen_asyncio_aclose_08(self): it = gen.__aiter__() self.assertEqual(await it.__anext__(), 1) t = self.loop.create_task(it.__anext__()) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) await gen.aclose() return t @@ -657,7 +657,7 @@ def test_async_gen_asyncio_aclose_08(self): # Silence ResourceWarnings fut.cancel() t.cancel() - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) def test_async_gen_asyncio_gc_aclose_09(self): DONE = 0 @@ -668,8 +668,8 @@ def test_async_gen_asyncio_gc_aclose_09(self): while True: yield 1 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -678,7 +678,7 @@ def test_async_gen_asyncio_gc_aclose_09(self): await g.__anext__() del g - await asyncio.sleep(0.1, loop=self.loop) + await asyncio.sleep(0.1) self.loop.run_until_complete(run()) self.assertEqual(DONE, 1) @@ -769,15 +769,15 @@ def sgen(): async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) v = yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield v * 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) return finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -799,20 +799,20 @@ def test_async_gen_asyncio_asend_02(self): DONE = 0 async def sleep_n_crash(delay): - await asyncio.sleep(delay, loop=self.loop) + await asyncio.sleep(delay) 1 / 0 async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) v = yield 1 await sleep_n_crash(0.01) DONE += 1000 yield v * 2 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -831,7 +831,7 @@ def test_async_gen_asyncio_asend_03(self): DONE = 0 async def sleep_n_crash(delay): - fut = asyncio.ensure_future(asyncio.sleep(delay, loop=self.loop), + fut = asyncio.ensure_future(asyncio.sleep(delay), loop=self.loop) self.loop.call_later(delay / 2, lambda: fut.cancel()) return await fut @@ -839,14 +839,14 @@ def test_async_gen_asyncio_asend_03(self): async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) v = yield 1 await sleep_n_crash(0.01) DONE += 1000 yield v * 2 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -885,18 +885,18 @@ def sgen(): async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) try: v = yield 1 except FooEr: v = 1000 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield v * 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) # return finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -921,7 +921,7 @@ class FooEr(Exception): pass async def sleep_n_crash(delay): - fut = asyncio.ensure_future(asyncio.sleep(delay, loop=self.loop), + fut = asyncio.ensure_future(asyncio.sleep(delay), loop=self.loop) self.loop.call_later(delay / 2, lambda: fut.cancel()) return await fut @@ -929,17 +929,17 @@ class FooEr(Exception): async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) try: v = yield 1 except FooEr: await sleep_n_crash(0.01) yield v * 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) # return finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -1038,10 +1038,10 @@ def test_async_gen_asyncio_shutdown_01(self): async def waiter(timeout): nonlocal finalized try: - await asyncio.sleep(timeout, loop=self.loop) + await asyncio.sleep(timeout) yield 1 finally: - await asyncio.sleep(0, loop=self.loop) + await asyncio.sleep(0) finalized += 1 async def wait(): @@ -1051,7 +1051,7 @@ def test_async_gen_asyncio_shutdown_01(self): t1 = self.loop.create_task(wait()) t2 = self.loop.create_task(wait()) - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) self.loop.run_until_complete(self.loop.shutdown_asyncgens()) self.assertEqual(finalized, 2) @@ -1059,7 +1059,7 @@ def test_async_gen_asyncio_shutdown_01(self): # Silence warnings t1.cancel() t2.cancel() - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) def test_async_gen_asyncio_shutdown_02(self): logged = 0 @@ -1073,7 +1073,7 @@ def logger(loop, context): async def waiter(timeout): try: - await asyncio.sleep(timeout, loop=self.loop) + await asyncio.sleep(timeout) yield 1 finally: 1 / 0 @@ -1083,7 +1083,7 @@ def logger(loop, context): pass t = self.loop.create_task(wait()) - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) self.loop.set_exception_handler(logger) self.loop.run_until_complete(self.loop.shutdown_asyncgens()) @@ -1092,12 +1092,12 @@ def logger(loop, context): # Silence warnings t.cancel() - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) def test_async_gen_expression_01(self): async def arange(n): for i in range(n): - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield i def make_arange(n): @@ -1112,7 +1112,7 @@ def make_arange(n): def test_async_gen_expression_02(self): async def wrap(n): - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) return n def make_arange(n): diff --git a/Lib/test/test_asyncio/functional.py b/Lib/test/test_asyncio/functional.py index 386cfcdb9814..6b5b3cc907cc 100644 --- a/Lib/test/test_asyncio/functional.py +++ b/Lib/test/test_asyncio/functional.py @@ -15,7 +15,7 @@ def new_loop(self): return asyncio.new_event_loop() def run_loop_briefly(self, *, delay=0.01): - self.loop.run_until_complete(asyncio.sleep(delay, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(delay)) def loop_exception_handler(self, loop, context): self.__unhandled_exceptions.append(context) diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 42244699372a..d15a9c6a8139 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -482,7 +482,7 @@ class ShowStopper(BaseException): pass async def foo(delay): - await asyncio.sleep(delay, loop=self.loop) + await asyncio.sleep(delay) def throw(): raise ShowStopper @@ -579,7 +579,7 @@ def test_default_exc_handler_coro(self): @asyncio.coroutine def zero_error_coro(): - yield from asyncio.sleep(0.01, loop=self.loop) + yield from asyncio.sleep(0.01) 1/0 # Test Future.__del__ diff --git a/Lib/test/test_asyncio/test_buffered_proto.py b/Lib/test/test_asyncio/test_buffered_proto.py index 5a5e198b58f7..f24e363ebfcf 100644 --- a/Lib/test/test_asyncio/test_buffered_proto.py +++ b/Lib/test/test_asyncio/test_buffered_proto.py @@ -64,7 +64,7 @@ def on_buf(buf): addr = srv.sockets[0].getsockname() self.loop.run_until_complete( - asyncio.wait_for(client(addr), 5, loop=self.loop)) + asyncio.wait_for(client(addr), 5)) srv.close() self.loop.run_until_complete(srv.wait_closed()) diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 708fb3273ddf..2a90cda92c9d 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -271,7 +271,7 @@ def coro2(): def test_run_until_complete(self): t0 = self.loop.time() - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) t1 = self.loop.time() self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0) @@ -279,7 +279,7 @@ def test_run_until_complete_stopped(self): async def cb(): self.loop.stop() - await asyncio.sleep(0.1, loop=self.loop) + await asyncio.sleep(0.1) task = cb() self.assertRaises(RuntimeError, self.loop.run_until_complete, task) @@ -1757,11 +1757,11 @@ def _run_once(): async def wait(): loop = self.loop - await asyncio.sleep(1e-2, loop=loop) - await asyncio.sleep(1e-4, loop=loop) - await asyncio.sleep(1e-6, loop=loop) - await asyncio.sleep(1e-8, loop=loop) - await asyncio.sleep(1e-10, loop=loop) + await asyncio.sleep(1e-2) + await asyncio.sleep(1e-4) + await asyncio.sleep(1e-6) + await asyncio.sleep(1e-8) + await asyncio.sleep(1e-10) self.loop.run_until_complete(wait()) # The ideal number of call is 12, but on some platforms, the selector diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py index 63bcb03a5371..b61cf743c3c5 100644 --- a/Lib/test/test_asyncio/test_locks.py +++ b/Lib/test/test_asyncio/test_locks.py @@ -81,13 +81,13 @@ def test_lock_by_with_statement(self): @asyncio.coroutine def test(lock): - yield from asyncio.sleep(0.01, loop=loop) + yield from asyncio.sleep(0.01) self.assertFalse(lock.locked()) with self.assertWarns(DeprecationWarning): with (yield from lock) as _lock: self.assertIs(_lock, None) self.assertTrue(lock.locked()) - yield from asyncio.sleep(0.01, loop=loop) + yield from asyncio.sleep(0.01) self.assertTrue(lock.locked()) self.assertFalse(lock.locked()) @@ -819,8 +819,7 @@ def test_timeout_in_block(self): condition = asyncio.Condition(loop=loop) async with condition: with self.assertRaises(asyncio.TimeoutError): - await asyncio.wait_for(condition.wait(), timeout=0.5, - loop=loop) + await asyncio.wait_for(condition.wait(), timeout=0.5) loop.run_until_complete(task_timeout()) diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py index 5edd36eb4c6b..95ed79185867 100644 --- a/Lib/test/test_asyncio/test_pep492.py +++ b/Lib/test/test_asyncio/test_pep492.py @@ -52,12 +52,12 @@ def test_context_manager_async_with(self): ] async def test(lock): - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) self.assertFalse(lock.locked()) async with lock as _lock: self.assertIs(_lock, None) self.assertTrue(lock.locked()) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) self.assertTrue(lock.locked()) self.assertFalse(lock.locked()) @@ -74,13 +74,13 @@ def test_context_manager_with_await(self): ] async def test(lock): - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) self.assertFalse(lock.locked()) with self.assertWarns(DeprecationWarning): with await lock as _lock: self.assertIs(_lock, None) self.assertTrue(lock.locked()) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) self.assertTrue(lock.locked()) self.assertFalse(lock.locked()) @@ -198,13 +198,13 @@ def test_task_print_stack(self): def test_double_await(self): async def afunc(): - await asyncio.sleep(0.1, loop=self.loop) + await asyncio.sleep(0.1) async def runner(): coro = afunc() t = asyncio.Task(coro, loop=self.loop) try: - await asyncio.sleep(0, loop=self.loop) + await asyncio.sleep(0) await coro finally: t.cancel() diff --git a/Lib/test/test_asyncio/test_queues.py b/Lib/test/test_asyncio/test_queues.py index eba66e790dcd..b0f0f9c8fdb7 100644 --- a/Lib/test/test_asyncio/test_queues.py +++ b/Lib/test/test_asyncio/test_queues.py @@ -45,7 +45,7 @@ def gen(): # Start a task that waits to get. asyncio.Task(q.get(), loop=loop) # Let it start waiting. - await asyncio.sleep(0.1, loop=loop) + await asyncio.sleep(0.1) self.assertTrue('_getters[1]' in fn(q)) # resume q.get coroutine to finish generator q.put_nowait(0) @@ -58,7 +58,7 @@ def gen(): # Start a task that waits to put. asyncio.Task(q.put(2), loop=loop) # Let it start waiting. - await asyncio.sleep(0.1, loop=loop) + await asyncio.sleep(0.1) self.assertTrue('_putters[1]' in fn(q)) # resume q.put coroutine to finish generator q.get_nowait() @@ -135,14 +135,14 @@ def gen(): async def test(): t = asyncio.Task(putter(), loop=loop) - await asyncio.sleep(0.01, loop=loop) + await asyncio.sleep(0.01) # The putter is blocked after putting two items. self.assertEqual([0, 1], have_been_put) self.assertEqual(0, q.get_nowait()) # Let the putter resume and put last item. - await asyncio.sleep(0.01, loop=loop) + await asyncio.sleep(0.01) self.assertEqual([0, 1, 2], have_been_put) self.assertEqual(1, q.get_nowait()) self.assertEqual(2, q.get_nowait()) @@ -234,11 +234,11 @@ def gen(): q = asyncio.Queue(loop=loop) async def queue_get(): - return await asyncio.wait_for(q.get(), 0.051, loop=loop) + return await asyncio.wait_for(q.get(), 0.051) async def test(): get_task = asyncio.Task(queue_get(), loop=loop) - await asyncio.sleep(0.01, loop=loop) # let the task start + await asyncio.sleep(0.01) # let the task start q.put_nowait(1) return await get_task @@ -297,7 +297,7 @@ def a_generator(): async def consumer(queue): try: - item = await asyncio.wait_for(queue.get(), 0.1, loop=self.loop) + item = await asyncio.wait_for(queue.get(), 0.1) except asyncio.TimeoutError: pass @@ -364,7 +364,7 @@ def gen(): reader = loop.create_task(q.get()) - loop.run_until_complete(asyncio.sleep(0.01, loop=loop)) + loop.run_until_complete(asyncio.sleep(0.01)) q.put_nowait(1) q.put_nowait(2) @@ -395,7 +395,7 @@ def gen(): reader2 = loop.create_task(q.get()) reader3 = loop.create_task(q.get()) - loop.run_until_complete(asyncio.sleep(0.01, loop=loop)) + loop.run_until_complete(asyncio.sleep(0.01)) q.put_nowait(1) q.put_nowait(2) @@ -424,7 +424,7 @@ def gen(): # putting a second item in the queue has to block (qsize=1) writer = loop.create_task(q.put(2)) - loop.run_until_complete(asyncio.sleep(0.01, loop=loop)) + loop.run_until_complete(asyncio.sleep(0.01)) value1 = q.get_nowait() self.assertEqual(value1, 1) @@ -512,7 +512,7 @@ def test_why_are_putters_waiting(self): await queue.put(item) async def getter(): - await asyncio.sleep(0, loop=self.loop) + await asyncio.sleep(0) num = queue.qsize() for _ in range(num): item = queue.get_nowait() @@ -537,7 +537,7 @@ def a_generator(): # Task waiting for space to put an item in the queue. put_task = loop.create_task(queue.put(1)) - loop.run_until_complete(asyncio.sleep(0.01, loop=loop)) + loop.run_until_complete(asyncio.sleep(0.01)) # Check that the putter is correctly removed from queue._putters when # the task is canceled. @@ -560,7 +560,7 @@ def gen(): # Task waiting for space to put a item in the queue. put_task = loop.create_task(queue.put(1)) - loop.run_until_complete(asyncio.sleep(0.01, loop=loop)) + loop.run_until_complete(asyncio.sleep(0.01)) # get_nowait() remove the future of put_task from queue._putters. queue.get_nowait() @@ -638,7 +638,7 @@ def test_task_done(self): running = False for i in range(len(tasks)): q.put_nowait(0) - self.loop.run_until_complete(asyncio.wait(tasks, loop=self.loop)) + self.loop.run_until_complete(asyncio.wait(tasks)) def test_join_empty_queue(self): q = self.q_class(loop=self.loop) diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index d380aa4138f8..811c1396f495 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -195,7 +195,7 @@ def test_sock_recv(self): self.loop._sock_recv = mock.Mock() f = self.loop.create_task(self.loop.sock_recv(sock, 1024)) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) self.assertEqual(self.loop._sock_recv.call_args[0][1:], (None, sock, 1024)) @@ -215,7 +215,7 @@ def test_sock_recv_reconnection(self): fut = self.loop.create_task( self.loop.sock_recv(sock, 1024)) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) callback = self.loop.add_reader.call_args[0][1] params = self.loop.add_reader.call_args[0][2:] @@ -226,7 +226,7 @@ def test_sock_recv_reconnection(self): sock.recv.side_effect = OSError(9) callback(*params) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) self.assertIsInstance(fut.exception(), OSError) self.assertEqual((10,), self.loop.remove_reader.call_args[0]) @@ -278,7 +278,7 @@ def test_sock_sendall(self): f = self.loop.create_task( self.loop.sock_sendall(sock, b'data')) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) self.assertEqual( (None, sock, b'data'), @@ -293,7 +293,7 @@ def test_sock_sendall_nodata(self): self.loop._sock_sendall = mock.Mock() f = self.loop.create_task(self.loop.sock_sendall(sock, b'')) - self.loop.run_until_complete(asyncio.sleep(0, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0)) self.assertTrue(f.done()) self.assertIsNone(f.result()) @@ -309,7 +309,7 @@ def test_sock_sendall_reconnection(self): self.loop.remove_writer = mock.Mock() fut = self.loop.create_task(self.loop.sock_sendall(sock, b'data')) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) callback = self.loop.add_writer.call_args[0][1] params = self.loop.add_writer.call_args[0][2:] @@ -320,7 +320,7 @@ def test_sock_sendall_reconnection(self): sock.send.side_effect = OSError(9) callback(*params) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) self.assertIsInstance(fut.exception(), OSError) self.assertEqual((10,), self.loop.remove_writer.call_args[0]) @@ -531,7 +531,7 @@ def test_sock_accept(self): self.loop._sock_accept = mock.Mock() f = self.loop.create_task(self.loop.sock_accept(sock)) - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) self.assertFalse(self.loop._sock_accept.call_args[0][1]) self.assertIs(self.loop._sock_accept.call_args[0][2], sock) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 818267138a4c..39b19dd8594b 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -252,7 +252,7 @@ def eof_received(self): self.on_eof.set_result(True) async def client(addr): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) on_data = self.loop.create_future() on_eof = self.loop.create_future() @@ -271,7 +271,7 @@ def eof_received(self): with self.tcp_server(serve, timeout=self.TIMEOUT) as srv: self.loop.run_until_complete( - asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10)) + asyncio.wait_for(client(srv.addr), timeout=10)) def test_start_tls_client_buf_proto_1(self): HELLO_MSG = b'1' * self.PAYLOAD_SIZE @@ -332,7 +332,7 @@ def eof_received(self): self.on_eof.set_result(True) async def client(addr): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) on_data1 = self.loop.create_future() on_data2 = self.loop.create_future() @@ -362,7 +362,7 @@ def eof_received(self): with self.tcp_server(serve, timeout=self.TIMEOUT) as srv: self.loop.run_until_complete( asyncio.wait_for(client(srv.addr), - loop=self.loop, timeout=self.TIMEOUT)) + timeout=self.TIMEOUT)) def test_start_tls_slow_client_cancel(self): HELLO_MSG = b'1' * self.PAYLOAD_SIZE @@ -403,7 +403,7 @@ def eof_received(self): self.on_eof.set_result(True) async def client(addr): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) on_data = self.loop.create_future() on_eof = self.loop.create_future() @@ -418,12 +418,11 @@ def eof_received(self): with self.assertRaises(asyncio.TimeoutError): await asyncio.wait_for( self.loop.start_tls(tr, proto, client_context), - 0.5, - loop=self.loop) + 0.5) with self.tcp_server(serve, timeout=self.TIMEOUT) as srv: self.loop.run_until_complete( - asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10)) + asyncio.wait_for(client(srv.addr), timeout=10)) def test_start_tls_server_1(self): HELLO_MSG = b'1' * self.PAYLOAD_SIZE @@ -496,7 +495,7 @@ def connection_lost(self, exc): timeout=self.TIMEOUT): await asyncio.wait_for( main(proto, on_con, on_eof, on_con_lost), - loop=self.loop, timeout=self.TIMEOUT) + timeout=self.TIMEOUT) server.close() await server.wait_closed() @@ -541,8 +540,7 @@ def server(sock): ssl=client_sslctx, server_hostname='', ssl_handshake_timeout=10.0), - 0.5, - loop=self.loop) + 0.5) with self.tcp_server(server, max_clients=1, diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index c529e5208c99..0141df729ce0 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -560,7 +560,7 @@ def set_err(): t1 = asyncio.Task(stream.readline(), loop=self.loop) t2 = asyncio.Task(set_err(), loop=self.loop) - self.loop.run_until_complete(asyncio.wait([t1, t2], loop=self.loop)) + self.loop.run_until_complete(asyncio.wait([t1, t2])) self.assertRaises(ValueError, t1.result) diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 2be311d97a93..a5bdb8eca517 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -126,7 +126,7 @@ def test_stdin_stdout(self): return (exitcode, data) task = run(b'some data') - task = asyncio.wait_for(task, 60.0, loop=self.loop) + task = asyncio.wait_for(task, 60.0) exitcode, stdout = self.loop.run_until_complete(task) self.assertEqual(exitcode, 0) self.assertEqual(stdout, b'some data') @@ -144,7 +144,7 @@ def test_communicate(self): return proc.returncode, stdout task = run(b'some data') - task = asyncio.wait_for(task, 60.0, loop=self.loop) + task = asyncio.wait_for(task, 60.0) exitcode, stdout = self.loop.run_until_complete(task) self.assertEqual(exitcode, 0) self.assertEqual(stdout, b'some data') @@ -233,7 +233,7 @@ def test_stdin_broken_pipe(self): proc, large_data = self.prepare_broken_pipe_test() async def write_stdin(proc, data): - await asyncio.sleep(0.5, loop=self.loop) + await asyncio.sleep(0.5) proc.stdin.write(data) await proc.stdin.drain() @@ -504,7 +504,7 @@ def test_read_stdout_after_process_exit(self): while True: data = await process.stdout.read(65536) if data: - await asyncio.sleep(0.3, loop=self.loop) + await asyncio.sleep(0.3) else: break diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index ea54706edc8e..eb6f2f5ecb18 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -45,7 +45,6 @@ def set_coroutine_debug(enabled): coroutines._DEBUG = old_debug - def format_coroutine(qualname, state, src, source_traceback, generator=False): if generator: state = '%s' % state @@ -472,7 +471,7 @@ def gen(): loop = self.new_test_loop(gen) async def task(): - await asyncio.sleep(10.0, loop=loop) + await asyncio.sleep(10.0) return 12 t = self.new_task(loop, task()) @@ -595,7 +594,7 @@ def test_cancel_current_task(self): t.cancel() self.assertTrue(t._must_cancel) # White-box test. # The sleep should be cancelled immediately. - await asyncio.sleep(100, loop=loop) + await asyncio.sleep(100) return 12 t = self.new_task(loop, task()) @@ -641,7 +640,7 @@ def gen(): async def task(): nonlocal x while x < 10: - await asyncio.sleep(0.1, loop=loop) + await asyncio.sleep(0.1) x += 1 if x == 2: loop.stop() @@ -677,7 +676,7 @@ def gen(): fut = self.new_future(loop) fut.set_result('done') - ret = loop.run_until_complete(asyncio.wait_for(fut, 0, loop=loop)) + ret = loop.run_until_complete(asyncio.wait_for(fut, 0)) self.assertEqual(ret, 'done') self.assertTrue(fut.done()) @@ -698,7 +697,7 @@ def foo(): foo_started = True with self.assertRaises(asyncio.TimeoutError): - loop.run_until_complete(asyncio.wait_for(foo(), 0, loop=loop)) + loop.run_until_complete(asyncio.wait_for(foo(), 0)) self.assertAlmostEqual(0, loop.time()) self.assertEqual(foo_started, False) @@ -720,7 +719,7 @@ def gen(): nonlocal foo_running foo_running = True try: - await asyncio.sleep(0.2, loop=loop) + await asyncio.sleep(0.2) finally: foo_running = False return 'done' @@ -728,8 +727,7 @@ def gen(): fut = self.new_task(loop, foo()) with self.assertRaises(asyncio.TimeoutError): - loop.run_until_complete(asyncio.wait_for( - fut, timeout, loop=loop)) + loop.run_until_complete(asyncio.wait_for(fut, timeout)) self.assertTrue(fut.done()) # it should have been cancelled due to the timeout self.assertTrue(fut.cancelled()) @@ -753,7 +751,7 @@ def gen(): nonlocal foo_running foo_running = True try: - await asyncio.sleep(0.2, loop=loop) + await asyncio.sleep(0.2) finally: foo_running = False return 'done' @@ -761,7 +759,7 @@ def gen(): fut = self.new_task(loop, foo()) with self.assertRaises(asyncio.TimeoutError): - loop.run_until_complete(asyncio.wait_for(fut, 0.1, loop=loop)) + loop.run_until_complete(asyncio.wait_for(fut, 0.1)) self.assertTrue(fut.done()) # it should have been cancelled due to the timeout self.assertTrue(fut.cancelled()) @@ -775,9 +773,7 @@ def test_wait_for_blocking(self): def coro(): return 'done' - res = loop.run_until_complete(asyncio.wait_for(coro(), - timeout=None, - loop=loop)) + res = loop.run_until_complete(asyncio.wait_for(coro(), timeout=None)) self.assertEqual(res, 'done') def test_wait_for_with_global_loop(self): @@ -792,7 +788,7 @@ def gen(): loop = self.new_test_loop(gen) async def foo(): - await asyncio.sleep(0.2, loop=loop) + await asyncio.sleep(0.2) return 'done' asyncio.set_event_loop(loop) @@ -817,7 +813,7 @@ def gen(): loop = self.new_test_loop(gen) fut = self.new_future(loop) - task = asyncio.wait_for(fut, timeout=0.2, loop=loop) + task = asyncio.wait_for(fut, timeout=0.2) loop.call_later(0.1, fut.set_result, "ok") res = loop.run_until_complete(task) self.assertEqual(res, "ok") @@ -832,14 +828,14 @@ def test_wait_for_waits_for_task_cancellation(self): async def inner(): nonlocal task_done try: - await asyncio.sleep(0.2, loop=loop) + await asyncio.sleep(0.2) finally: task_done = True inner_task = self.new_task(loop, inner()) with self.assertRaises(asyncio.TimeoutError): - await asyncio.wait_for(inner_task, timeout=0.1, loop=loop) + await asyncio.wait_for(inner_task, timeout=0.1) self.assertTrue(task_done) @@ -852,23 +848,23 @@ def test_wait_for_self_cancellation(self): async def foo(): async def inner(): try: - await asyncio.sleep(0.3, loop=loop) + await asyncio.sleep(0.3) except asyncio.CancelledError: try: - await asyncio.sleep(0.3, loop=loop) + await asyncio.sleep(0.3) except asyncio.CancelledError: - await asyncio.sleep(0.3, loop=loop) + await asyncio.sleep(0.3) return 42 inner_task = self.new_task(loop, inner()) - wait = asyncio.wait_for(inner_task, timeout=0.1, loop=loop) + wait = asyncio.wait_for(inner_task, timeout=0.1) # Test that wait_for itself is properly cancellable # even when the initial task holds up the initial cancellation. task = self.new_task(loop, wait) - await asyncio.sleep(0.2, loop=loop) + await asyncio.sleep(0.2) task.cancel() with self.assertRaises(asyncio.CancelledError): @@ -889,11 +885,11 @@ def gen(): loop = self.new_test_loop(gen) - a = self.new_task(loop, asyncio.sleep(0.1, loop=loop)) - b = self.new_task(loop, asyncio.sleep(0.15, loop=loop)) + a = self.new_task(loop, asyncio.sleep(0.1)) + b = self.new_task(loop, asyncio.sleep(0.15)) async def foo(): - done, pending = await asyncio.wait([b, a], loop=loop) + done, pending = await asyncio.wait([b, a]) self.assertEqual(done, set([a, b])) self.assertEqual(pending, set()) return 42 @@ -918,8 +914,8 @@ def gen(): loop = self.new_test_loop(gen) - a = self.new_task(loop, asyncio.sleep(0.01, loop=loop)) - b = self.new_task(loop, asyncio.sleep(0.015, loop=loop)) + a = self.new_task(loop, asyncio.sleep(0.01)) + b = self.new_task(loop, asyncio.sleep(0.015)) async def foo(): done, pending = await asyncio.wait([b, a]) @@ -942,7 +938,7 @@ def coro(s): task =self.new_task( self.loop, - asyncio.wait([c, c, coro('spam')], loop=self.loop)) + asyncio.wait([c, c, coro('spam')])) done, pending = self.loop.run_until_complete(task) @@ -952,11 +948,11 @@ def coro(s): def test_wait_errors(self): self.assertRaises( ValueError, self.loop.run_until_complete, - asyncio.wait(set(), loop=self.loop)) + asyncio.wait(set())) # -1 is an invalid return_when value - sleep_coro = asyncio.sleep(10.0, loop=self.loop) - wait_coro = asyncio.wait([sleep_coro], return_when=-1, loop=self.loop) + sleep_coro = asyncio.sleep(10.0) + wait_coro = asyncio.wait([sleep_coro], return_when=-1) self.assertRaises(ValueError, self.loop.run_until_complete, wait_coro) @@ -973,12 +969,11 @@ def gen(): loop = self.new_test_loop(gen) - a = self.new_task(loop, asyncio.sleep(10.0, loop=loop)) - b = self.new_task(loop, asyncio.sleep(0.1, loop=loop)) + a = self.new_task(loop, asyncio.sleep(10.0)) + b = self.new_task(loop, asyncio.sleep(0.1)) task = self.new_task( loop, - asyncio.wait([b, a], return_when=asyncio.FIRST_COMPLETED, - loop=loop)) + asyncio.wait([b, a], return_when=asyncio.FIRST_COMPLETED)) done, pending = loop.run_until_complete(task) self.assertEqual({b}, done) @@ -990,7 +985,7 @@ def gen(): # move forward to close generator loop.advance_time(10) - loop.run_until_complete(asyncio.wait([a, b], loop=loop)) + loop.run_until_complete(asyncio.wait([a, b])) def test_wait_really_done(self): # there is possibility that some tasks in the pending list @@ -1009,8 +1004,7 @@ def coro2(): b = self.new_task(self.loop, coro2()) task = self.new_task( self.loop, - asyncio.wait([b, a], return_when=asyncio.FIRST_COMPLETED, - loop=self.loop)) + asyncio.wait([b, a], return_when=asyncio.FIRST_COMPLETED)) done, pending = self.loop.run_until_complete(task) self.assertEqual({a, b}, done) @@ -1029,7 +1023,7 @@ def gen(): loop = self.new_test_loop(gen) # first_exception, task already has exception - a = self.new_task(loop, asyncio.sleep(10.0, loop=loop)) + a = self.new_task(loop, asyncio.sleep(10.0)) @asyncio.coroutine def exc(): @@ -1038,8 +1032,7 @@ def exc(): b = self.new_task(loop, exc()) task = self.new_task( loop, - asyncio.wait([b, a], return_when=asyncio.FIRST_EXCEPTION, - loop=loop)) + asyncio.wait([b, a], return_when=asyncio.FIRST_EXCEPTION)) done, pending = loop.run_until_complete(task) self.assertEqual({b}, done) @@ -1048,7 +1041,7 @@ def exc(): # move forward to close generator loop.advance_time(10) - loop.run_until_complete(asyncio.wait([a, b], loop=loop)) + loop.run_until_complete(asyncio.wait([a, b])) def test_wait_first_exception_in_wait(self): @@ -1062,15 +1055,14 @@ def gen(): loop = self.new_test_loop(gen) # first_exception, exception during waiting - a = self.new_task(loop, asyncio.sleep(10.0, loop=loop)) + a = self.new_task(loop, asyncio.sleep(10.0)) async def exc(): - await asyncio.sleep(0.01, loop=loop) + await asyncio.sleep(0.01) raise ZeroDivisionError('err') b = self.new_task(loop, exc()) - task = asyncio.wait([b, a], return_when=asyncio.FIRST_EXCEPTION, - loop=loop) + task = asyncio.wait([b, a], return_when=asyncio.FIRST_EXCEPTION) done, pending = loop.run_until_complete(task) self.assertEqual({b}, done) @@ -1079,7 +1071,7 @@ def gen(): # move forward to close generator loop.advance_time(10) - loop.run_until_complete(asyncio.wait([a, b], loop=loop)) + loop.run_until_complete(asyncio.wait([a, b])) def test_wait_with_exception(self): @@ -1092,17 +1084,17 @@ def gen(): loop = self.new_test_loop(gen) - a = self.new_task(loop, asyncio.sleep(0.1, loop=loop)) + a = self.new_task(loop, asyncio.sleep(0.1)) @asyncio.coroutine def sleeper(): - yield from asyncio.sleep(0.15, loop=loop) + yield from asyncio.sleep(0.15) raise ZeroDivisionError('really') b = self.new_task(loop, sleeper()) async def foo(): - done, pending = await asyncio.wait([b, a], loop=loop) + done, pending = await asyncio.wait([b, a]) self.assertEqual(len(done), 2) self.assertEqual(pending, set()) errors = set(f for f in done if f.exception() is not None) @@ -1127,12 +1119,11 @@ def gen(): loop = self.new_test_loop(gen) - a = self.new_task(loop, asyncio.sleep(0.1, loop=loop)) - b = self.new_task(loop, asyncio.sleep(0.15, loop=loop)) + a = self.new_task(loop, asyncio.sleep(0.1)) + b = self.new_task(loop, asyncio.sleep(0.15)) async def foo(): - done, pending = await asyncio.wait([b, a], timeout=0.11, - loop=loop) + done, pending = await asyncio.wait([b, a], timeout=0.11) self.assertEqual(done, set([a])) self.assertEqual(pending, set([b])) @@ -1141,7 +1132,7 @@ def gen(): # move forward to close generator loop.advance_time(10) - loop.run_until_complete(asyncio.wait([a, b], loop=loop)) + loop.run_until_complete(asyncio.wait([a, b])) def test_wait_concurrent_complete(self): @@ -1156,11 +1147,11 @@ def gen(): loop = self.new_test_loop(gen) - a = self.new_task(loop, asyncio.sleep(0.1, loop=loop)) - b = self.new_task(loop, asyncio.sleep(0.15, loop=loop)) + a = self.new_task(loop, asyncio.sleep(0.1)) + b = self.new_task(loop, asyncio.sleep(0.15)) done, pending = loop.run_until_complete( - asyncio.wait([b, a], timeout=0.1, loop=loop)) + asyncio.wait([b, a], timeout=0.1)) self.assertEqual(done, set([a])) self.assertEqual(pending, set([b])) @@ -1168,7 +1159,7 @@ def gen(): # move forward to close generator loop.advance_time(10) - loop.run_until_complete(asyncio.wait([a, b], loop=loop)) + loop.run_until_complete(asyncio.wait([a, b])) def test_as_completed(self): @@ -1187,7 +1178,7 @@ def gen(): @asyncio.coroutine def sleeper(dt, x): nonlocal time_shifted - yield from asyncio.sleep(dt, loop=loop) + yield from asyncio.sleep(dt) completed.add(x) if not time_shifted and 'a' in completed and 'b' in completed: time_shifted = True @@ -1225,8 +1216,8 @@ def gen(): loop = self.new_test_loop(gen) - a = loop.create_task(asyncio.sleep(0.1, 'a', loop=loop)) - b = loop.create_task(asyncio.sleep(0.15, 'b', loop=loop)) + a = loop.create_task(asyncio.sleep(0.1, 'a')) + b = loop.create_task(asyncio.sleep(0.15, 'b')) async def foo(): values = [] @@ -1249,7 +1240,7 @@ def gen(): # move forward to close generator loop.advance_time(10) - loop.run_until_complete(asyncio.wait([a, b], loop=loop)) + loop.run_until_complete(asyncio.wait([a, b])) def test_as_completed_with_unused_timeout(self): @@ -1260,7 +1251,7 @@ def gen(): loop = self.new_test_loop(gen) - a = asyncio.sleep(0.01, 'a', loop=loop) + a = asyncio.sleep(0.01, 'a') async def foo(): for f in asyncio.as_completed([a], timeout=1, loop=loop): @@ -1278,8 +1269,8 @@ def gen(): loop = self.new_test_loop(gen) - a = asyncio.sleep(0.05, 'a', loop=loop) - b = asyncio.sleep(0.10, 'b', loop=loop) + a = asyncio.sleep(0.05, 'a') + b = asyncio.sleep(0.10, 'b') fs = {a, b} futs = list(asyncio.as_completed(fs, loop=loop)) self.assertEqual(len(futs), 2) @@ -1303,12 +1294,12 @@ def gen(): loop = self.new_test_loop(gen) - a = asyncio.sleep(0.05, 'a', loop=loop) - b = asyncio.sleep(0.05, 'b', loop=loop) + a = asyncio.sleep(0.05, 'a') + b = asyncio.sleep(0.05, 'b') fs = {a, b} futs = list(asyncio.as_completed(fs, loop=loop)) self.assertEqual(len(futs), 2) - waiter = asyncio.wait(futs, loop=loop) + waiter = asyncio.wait(futs) done, pending = loop.run_until_complete(waiter) self.assertEqual(set(f.result() for f in done), {'a', 'b'}) @@ -1346,8 +1337,8 @@ def gen(): @asyncio.coroutine def sleeper(dt, arg): - yield from asyncio.sleep(dt/2, loop=loop) - res = yield from asyncio.sleep(dt/2, arg, loop=loop) + yield from asyncio.sleep(dt/2) + res = yield from asyncio.sleep(dt/2, arg) return res t = self.new_task(loop, sleeper(0.1, 'yeah')) @@ -1365,7 +1356,7 @@ def gen(): loop = self.new_test_loop(gen) - t = self.new_task(loop, asyncio.sleep(10.0, 'yeah', loop=loop)) + t = self.new_task(loop, asyncio.sleep(10.0, 'yeah')) handle = None orig_call_later = loop.call_later @@ -1397,7 +1388,7 @@ def gen(): @asyncio.coroutine def sleep(dt): - yield from asyncio.sleep(dt, loop=loop) + yield from asyncio.sleep(dt) @asyncio.coroutine def doit(): @@ -1502,7 +1493,7 @@ def gen(): @asyncio.coroutine def sleeper(): - yield from asyncio.sleep(10, loop=loop) + yield from asyncio.sleep(10) base_exc = BaseException() @@ -1663,8 +1654,7 @@ def test_current_task_with_interleaving_tasks(self): task1 = self.new_task(self.loop, coro1(self.loop)) task2 = self.new_task(self.loop, coro2(self.loop)) - self.loop.run_until_complete(asyncio.wait((task1, task2), - loop=self.loop)) + self.loop.run_until_complete(asyncio.wait((task1, task2))) self.assertIsNone(asyncio.current_task(loop=self.loop)) # Some thorough tests for cancellation propagation through @@ -1714,7 +1704,7 @@ def test_yield_wait_does_not_shield_cancel(self): async def outer(): nonlocal proof - d, p = await asyncio.wait([inner()], loop=self.loop) + d, p = await asyncio.wait([inner()]) proof += 100 f = asyncio.ensure_future(outer(), loop=self.loop) @@ -1827,15 +1817,15 @@ def test_wait_invalid_args(self): # wait() expects a list of futures, not a future instance self.assertRaises(TypeError, self.loop.run_until_complete, - asyncio.wait(fut, loop=self.loop)) + asyncio.wait(fut)) coro = coroutine_function() self.assertRaises(TypeError, self.loop.run_until_complete, - asyncio.wait(coro, loop=self.loop)) + asyncio.wait(coro)) coro.close() # wait() expects at least a future self.assertRaises(ValueError, self.loop.run_until_complete, - asyncio.wait([], loop=self.loop)) + asyncio.wait([])) def test_corowrapper_mocks_generator(self): @@ -2027,7 +2017,7 @@ def coro(): @asyncio.coroutine def runner(): task = self.new_task(loop, coro()) - yield from asyncio.sleep(0.05, loop=loop) + yield from asyncio.sleep(0.05) task.cancel() task = None @@ -2111,7 +2101,7 @@ def blocking_coroutine(): task = loop.create_task(blocking_coroutine()) - wait = loop.create_task(asyncio.wait_for(task, timeout, loop=loop)) + wait = loop.create_task(asyncio.wait_for(task, timeout)) loop.call_soon(wait.cancel) self.assertRaises(asyncio.CancelledError, @@ -2164,7 +2154,7 @@ def test_cancel_gather_2(self): time = 0 while True: time += 0.05 - await asyncio.gather(asyncio.sleep(0.05, loop=loop), + await asyncio.gather(asyncio.sleep(0.05), return_exceptions=True, loop=loop) if time > 1: @@ -2172,7 +2162,7 @@ def test_cancel_gather_2(self): async def main(): qwe = self.new_task(loop, test()) - await asyncio.sleep(0.2, loop=loop) + await asyncio.sleep(0.2) qwe.cancel() try: await qwe @@ -2305,7 +2295,7 @@ def test_context_1(self): cvar = contextvars.ContextVar('cvar', default='nope') async def sub(): - await asyncio.sleep(0.01, loop=loop) + await asyncio.sleep(0.01) self.assertEqual(cvar.get(), 'nope') cvar.set('something else') @@ -2346,7 +2336,7 @@ def fut_on_done(fut): for i in range(3): # Test that task passed its context to add_done_callback: cvar.set(f'yes{i}-{j}') - await asyncio.sleep(0.001, loop=loop) + await asyncio.sleep(0.001) self.assertEqual(cvar.get(), f'yes{i}-{j}') loop = asyncio.new_event_loop() @@ -2366,8 +2356,7 @@ def test_context_3(self): async def sub(num): for i in range(10): cvar.set(num + i) - await asyncio.sleep( - random.uniform(0.001, 0.05), loop=loop) + await asyncio.sleep(random.uniform(0.001, 0.05)) self.assertEqual(cvar.get(), num + i) async def main(): @@ -2452,7 +2441,7 @@ def test_set_result_causes_invalid_state(self): self.loop.call_exception_handler = exc_handler = mock.Mock() async def foo(): - await asyncio.sleep(0.1, loop=self.loop) + await asyncio.sleep(0.1) return 10 coro = foo() @@ -2479,7 +2468,7 @@ class MyExc(Exception): self.loop.call_exception_handler = exc_handler = mock.Mock() async def foo(): - await asyncio.sleep(0.1, loop=self.loop) + await asyncio.sleep(0.1) return 10 coro = foo() @@ -3103,7 +3092,7 @@ def setUp(self): @asyncio.coroutine def add(self, a, b, fail=False, cancel=False): """Wait 0.05 second and return a + b.""" - yield from asyncio.sleep(0.05, loop=self.loop) + yield from asyncio.sleep(0.05) if fail: raise RuntimeError("Fail!") if cancel: @@ -3213,7 +3202,7 @@ def inc_result(num): def coro(): self.loop.call_soon(inc_result, 1) self.assertEqual(result, 0) - num = yield from asyncio.sleep(0, loop=self.loop, result=10) + num = yield from asyncio.sleep(0, result=10) self.assertEqual(result, 1) # inc'ed by call_soon inc_result(num) # num should be 11 @@ -3221,7 +3210,7 @@ def coro(): self.assertEqual(result, 11) def test_loop_argument_is_deprecated(self): - # Remove test when loop argument is removed in Python 4.0 + # Remove test when loop argument is removed in Python 3.10 with self.assertWarns(DeprecationWarning): self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) @@ -3238,13 +3227,13 @@ def tearDown(self): super().tearDown() def test_loop_argument_is_deprecated_in_wait(self): - # Remove test when loop argument is removed in Python 4.0 + # Remove test when loop argument is removed in Python 3.10 with self.assertWarns(DeprecationWarning): self.loop.run_until_complete( asyncio.wait([coroutine_function()], loop=self.loop)) def test_loop_argument_is_deprecated_in_wait_for(self): - # Remove test when loop argument is removed in Python 4.0 + # Remove test when loop argument is removed in Python 3.10 with self.assertWarns(DeprecationWarning): self.loop.run_until_complete( asyncio.wait_for(coroutine_function(), 0.01, loop=self.loop)) @@ -3268,7 +3257,7 @@ def test_yield_from_awaitable(self): @asyncio.coroutine def coro(): - yield from asyncio.sleep(0, loop=self.loop) + yield from asyncio.sleep(0) return 'ok' result = self.loop.run_until_complete(coro()) @@ -3282,7 +3271,7 @@ def coro1(): @asyncio.coroutine def coro2(): - yield from asyncio.sleep(0, loop=self.loop) + yield from asyncio.sleep(0) return 'ok2' async def inner(): diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index e7438d40a441..f7dcf93dc8be 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -113,7 +113,7 @@ def run_until(loop, pred, timeout=30): timeout = deadline - time.time() if timeout <= 0: raise futures.TimeoutError() - loop.run_until_complete(tasks.sleep(0.001, loop=loop)) + loop.run_until_complete(tasks.sleep(0.001)) def run_once(loop): From webhook-mailer at python.org Tue Oct 2 17:01:28 2018 From: webhook-mailer at python.org (Antoine Pitrou) Date: Tue, 02 Oct 2018 21:01:28 -0000 Subject: [Python-checkins] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) Message-ID: https://github.com/python/cpython/commit/97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0 commit: 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0 branch: master author: tzickel committer: Antoine Pitrou date: 2018-10-02T23:01:23+02:00 summary: bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. files: A Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst M Lib/multiprocessing/pool.py M Lib/test/_test_multiprocessing.py diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index 3e9a0d6b4867..574b5db5afb6 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -149,8 +149,9 @@ class Pool(object): ''' _wrap_exception = True - def Process(self, *args, **kwds): - return self._ctx.Process(*args, **kwds) + @staticmethod + def Process(ctx, *args, **kwds): + return ctx.Process(*args, **kwds) def __init__(self, processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None): @@ -177,13 +178,15 @@ def __init__(self, processes=None, initializer=None, initargs=(), self._worker_handler = threading.Thread( target=Pool._handle_workers, - args=(self, ) + args=(self._cache, self._taskqueue, self._ctx, self.Process, + self._processes, self._pool, self._inqueue, self._outqueue, + self._initializer, self._initargs, self._maxtasksperchild, + self._wrap_exception) ) self._worker_handler.daemon = True self._worker_handler._state = RUN self._worker_handler.start() - self._task_handler = threading.Thread( target=Pool._handle_tasks, args=(self._taskqueue, self._quick_put, self._outqueue, @@ -209,43 +212,62 @@ def __init__(self, processes=None, initializer=None, initargs=(), exitpriority=15 ) - def _join_exited_workers(self): + @staticmethod + def _join_exited_workers(pool): """Cleanup after any worker processes which have exited due to reaching their specified lifetime. Returns True if any workers were cleaned up. """ cleaned = False - for i in reversed(range(len(self._pool))): - worker = self._pool[i] + for i in reversed(range(len(pool))): + worker = pool[i] if worker.exitcode is not None: # worker exited util.debug('cleaning up worker %d' % i) worker.join() cleaned = True - del self._pool[i] + del pool[i] return cleaned def _repopulate_pool(self): + return self._repopulate_pool_static(self._ctx, self.Process, + self._processes, + self._pool, self._inqueue, + self._outqueue, self._initializer, + self._initargs, + self._maxtasksperchild, + self._wrap_exception) + + @staticmethod + def _repopulate_pool_static(ctx, Process, processes, pool, inqueue, + outqueue, initializer, initargs, + maxtasksperchild, wrap_exception): """Bring the number of pool processes up to the specified number, for use after reaping workers which have exited. """ - for i in range(self._processes - len(self._pool)): - w = self.Process(target=worker, - args=(self._inqueue, self._outqueue, - self._initializer, - self._initargs, self._maxtasksperchild, - self._wrap_exception) - ) - self._pool.append(w) + for i in range(processes - len(pool)): + w = Process(ctx, target=worker, + args=(inqueue, outqueue, + initializer, + initargs, maxtasksperchild, + wrap_exception) + ) + pool.append(w) w.name = w.name.replace('Process', 'PoolWorker') w.daemon = True w.start() util.debug('added worker') - def _maintain_pool(self): + @staticmethod + def _maintain_pool(ctx, Process, processes, pool, inqueue, outqueue, + initializer, initargs, maxtasksperchild, + wrap_exception): """Clean up any exited workers and start replacements for them. """ - if self._join_exited_workers(): - self._repopulate_pool() + if Pool._join_exited_workers(pool): + Pool._repopulate_pool_static(ctx, Process, processes, pool, + inqueue, outqueue, initializer, + initargs, maxtasksperchild, + wrap_exception) def _setup_queues(self): self._inqueue = self._ctx.SimpleQueue() @@ -403,16 +425,20 @@ def _map_async(self, func, iterable, mapper, chunksize=None, callback=None, return result @staticmethod - def _handle_workers(pool): + def _handle_workers(cache, taskqueue, ctx, Process, processes, pool, + inqueue, outqueue, initializer, initargs, + maxtasksperchild, wrap_exception): thread = threading.current_thread() # Keep maintaining workers until the cache gets drained, unless the pool # is terminated. - while thread._state == RUN or (pool._cache and thread._state != TERMINATE): - pool._maintain_pool() + while thread._state == RUN or (cache and thread._state != TERMINATE): + Pool._maintain_pool(ctx, Process, processes, pool, inqueue, + outqueue, initializer, initargs, + maxtasksperchild, wrap_exception) time.sleep(0.1) # send sentinel to stop workers - pool._taskqueue.put(None) + taskqueue.put(None) util.debug('worker handler exiting') @staticmethod @@ -794,7 +820,7 @@ class ThreadPool(Pool): _wrap_exception = False @staticmethod - def Process(*args, **kwds): + def Process(ctx, *args, **kwds): from .dummy import Process return Process(*args, **kwds) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d728091bab1b..71f40a0c5a48 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2549,6 +2549,12 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + def test_del_pool(self): + p = self.Pool(1) + wr = weakref.ref(p) + del p + gc.collect() + self.assertIsNone(wr()) def raising(): raise KeyError("key") diff --git a/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst new file mode 100644 index 000000000000..d1c5a7721019 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst @@ -0,0 +1 @@ +Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. From webhook-mailer at python.org Tue Oct 2 17:17:09 2018 From: webhook-mailer at python.org (Antoine Pitrou) Date: Tue, 02 Oct 2018 21:17:09 -0000 Subject: [Python-checkins] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9676) Message-ID: https://github.com/python/cpython/commit/97f998a4dfd6db6d867f446daa62445d0782bf39 commit: 97f998a4dfd6db6d867f446daa62445d0782bf39 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Antoine Pitrou date: 2018-10-02T23:17:04+02:00 summary: bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9676) Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. (cherry picked from commit 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0) Co-authored-by: tzickel files: A Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst M Lib/multiprocessing/pool.py M Lib/test/_test_multiprocessing.py diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index 3e9a0d6b4867..574b5db5afb6 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -149,8 +149,9 @@ class Pool(object): ''' _wrap_exception = True - def Process(self, *args, **kwds): - return self._ctx.Process(*args, **kwds) + @staticmethod + def Process(ctx, *args, **kwds): + return ctx.Process(*args, **kwds) def __init__(self, processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None): @@ -177,13 +178,15 @@ def __init__(self, processes=None, initializer=None, initargs=(), self._worker_handler = threading.Thread( target=Pool._handle_workers, - args=(self, ) + args=(self._cache, self._taskqueue, self._ctx, self.Process, + self._processes, self._pool, self._inqueue, self._outqueue, + self._initializer, self._initargs, self._maxtasksperchild, + self._wrap_exception) ) self._worker_handler.daemon = True self._worker_handler._state = RUN self._worker_handler.start() - self._task_handler = threading.Thread( target=Pool._handle_tasks, args=(self._taskqueue, self._quick_put, self._outqueue, @@ -209,43 +212,62 @@ def __init__(self, processes=None, initializer=None, initargs=(), exitpriority=15 ) - def _join_exited_workers(self): + @staticmethod + def _join_exited_workers(pool): """Cleanup after any worker processes which have exited due to reaching their specified lifetime. Returns True if any workers were cleaned up. """ cleaned = False - for i in reversed(range(len(self._pool))): - worker = self._pool[i] + for i in reversed(range(len(pool))): + worker = pool[i] if worker.exitcode is not None: # worker exited util.debug('cleaning up worker %d' % i) worker.join() cleaned = True - del self._pool[i] + del pool[i] return cleaned def _repopulate_pool(self): + return self._repopulate_pool_static(self._ctx, self.Process, + self._processes, + self._pool, self._inqueue, + self._outqueue, self._initializer, + self._initargs, + self._maxtasksperchild, + self._wrap_exception) + + @staticmethod + def _repopulate_pool_static(ctx, Process, processes, pool, inqueue, + outqueue, initializer, initargs, + maxtasksperchild, wrap_exception): """Bring the number of pool processes up to the specified number, for use after reaping workers which have exited. """ - for i in range(self._processes - len(self._pool)): - w = self.Process(target=worker, - args=(self._inqueue, self._outqueue, - self._initializer, - self._initargs, self._maxtasksperchild, - self._wrap_exception) - ) - self._pool.append(w) + for i in range(processes - len(pool)): + w = Process(ctx, target=worker, + args=(inqueue, outqueue, + initializer, + initargs, maxtasksperchild, + wrap_exception) + ) + pool.append(w) w.name = w.name.replace('Process', 'PoolWorker') w.daemon = True w.start() util.debug('added worker') - def _maintain_pool(self): + @staticmethod + def _maintain_pool(ctx, Process, processes, pool, inqueue, outqueue, + initializer, initargs, maxtasksperchild, + wrap_exception): """Clean up any exited workers and start replacements for them. """ - if self._join_exited_workers(): - self._repopulate_pool() + if Pool._join_exited_workers(pool): + Pool._repopulate_pool_static(ctx, Process, processes, pool, + inqueue, outqueue, initializer, + initargs, maxtasksperchild, + wrap_exception) def _setup_queues(self): self._inqueue = self._ctx.SimpleQueue() @@ -403,16 +425,20 @@ def _map_async(self, func, iterable, mapper, chunksize=None, callback=None, return result @staticmethod - def _handle_workers(pool): + def _handle_workers(cache, taskqueue, ctx, Process, processes, pool, + inqueue, outqueue, initializer, initargs, + maxtasksperchild, wrap_exception): thread = threading.current_thread() # Keep maintaining workers until the cache gets drained, unless the pool # is terminated. - while thread._state == RUN or (pool._cache and thread._state != TERMINATE): - pool._maintain_pool() + while thread._state == RUN or (cache and thread._state != TERMINATE): + Pool._maintain_pool(ctx, Process, processes, pool, inqueue, + outqueue, initializer, initargs, + maxtasksperchild, wrap_exception) time.sleep(0.1) # send sentinel to stop workers - pool._taskqueue.put(None) + taskqueue.put(None) util.debug('worker handler exiting') @staticmethod @@ -794,7 +820,7 @@ class ThreadPool(Pool): _wrap_exception = False @staticmethod - def Process(*args, **kwds): + def Process(ctx, *args, **kwds): from .dummy import Process return Process(*args, **kwds) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 754a26f47067..6e416a9855da 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2551,6 +2551,12 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + def test_del_pool(self): + p = self.Pool(1) + wr = weakref.ref(p) + del p + gc.collect() + self.assertIsNone(wr()) def raising(): raise KeyError("key") diff --git a/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst new file mode 100644 index 000000000000..d1c5a7721019 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst @@ -0,0 +1 @@ +Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. From webhook-mailer at python.org Tue Oct 2 17:36:20 2018 From: webhook-mailer at python.org (Antoine Pitrou) Date: Tue, 02 Oct 2018 21:36:20 -0000 Subject: [Python-checkins] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9677) Message-ID: https://github.com/python/cpython/commit/07b96a95db78eff3557d1bfed1df9ebecc40815b commit: 07b96a95db78eff3557d1bfed1df9ebecc40815b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Antoine Pitrou date: 2018-10-02T23:36:15+02:00 summary: bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9677) Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. (cherry picked from commit 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0) Co-authored-by: tzickel files: A Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst M Lib/multiprocessing/pool.py M Lib/test/_test_multiprocessing.py diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index a545f3c1a189..32254d8ea6cf 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -147,8 +147,9 @@ class Pool(object): ''' _wrap_exception = True - def Process(self, *args, **kwds): - return self._ctx.Process(*args, **kwds) + @staticmethod + def Process(ctx, *args, **kwds): + return ctx.Process(*args, **kwds) def __init__(self, processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None): @@ -175,13 +176,15 @@ def __init__(self, processes=None, initializer=None, initargs=(), self._worker_handler = threading.Thread( target=Pool._handle_workers, - args=(self, ) + args=(self._cache, self._taskqueue, self._ctx, self.Process, + self._processes, self._pool, self._inqueue, self._outqueue, + self._initializer, self._initargs, self._maxtasksperchild, + self._wrap_exception) ) self._worker_handler.daemon = True self._worker_handler._state = RUN self._worker_handler.start() - self._task_handler = threading.Thread( target=Pool._handle_tasks, args=(self._taskqueue, self._quick_put, self._outqueue, @@ -207,43 +210,62 @@ def __init__(self, processes=None, initializer=None, initargs=(), exitpriority=15 ) - def _join_exited_workers(self): + @staticmethod + def _join_exited_workers(pool): """Cleanup after any worker processes which have exited due to reaching their specified lifetime. Returns True if any workers were cleaned up. """ cleaned = False - for i in reversed(range(len(self._pool))): - worker = self._pool[i] + for i in reversed(range(len(pool))): + worker = pool[i] if worker.exitcode is not None: # worker exited util.debug('cleaning up worker %d' % i) worker.join() cleaned = True - del self._pool[i] + del pool[i] return cleaned def _repopulate_pool(self): + return self._repopulate_pool_static(self._ctx, self.Process, + self._processes, + self._pool, self._inqueue, + self._outqueue, self._initializer, + self._initargs, + self._maxtasksperchild, + self._wrap_exception) + + @staticmethod + def _repopulate_pool_static(ctx, Process, processes, pool, inqueue, + outqueue, initializer, initargs, + maxtasksperchild, wrap_exception): """Bring the number of pool processes up to the specified number, for use after reaping workers which have exited. """ - for i in range(self._processes - len(self._pool)): - w = self.Process(target=worker, - args=(self._inqueue, self._outqueue, - self._initializer, - self._initargs, self._maxtasksperchild, - self._wrap_exception) - ) - self._pool.append(w) + for i in range(processes - len(pool)): + w = Process(ctx, target=worker, + args=(inqueue, outqueue, + initializer, + initargs, maxtasksperchild, + wrap_exception) + ) + pool.append(w) w.name = w.name.replace('Process', 'PoolWorker') w.daemon = True w.start() util.debug('added worker') - def _maintain_pool(self): + @staticmethod + def _maintain_pool(ctx, Process, processes, pool, inqueue, outqueue, + initializer, initargs, maxtasksperchild, + wrap_exception): """Clean up any exited workers and start replacements for them. """ - if self._join_exited_workers(): - self._repopulate_pool() + if Pool._join_exited_workers(pool): + Pool._repopulate_pool_static(ctx, Process, processes, pool, + inqueue, outqueue, initializer, + initargs, maxtasksperchild, + wrap_exception) def _setup_queues(self): self._inqueue = self._ctx.SimpleQueue() @@ -396,16 +418,20 @@ def _map_async(self, func, iterable, mapper, chunksize=None, callback=None, return result @staticmethod - def _handle_workers(pool): + def _handle_workers(cache, taskqueue, ctx, Process, processes, pool, + inqueue, outqueue, initializer, initargs, + maxtasksperchild, wrap_exception): thread = threading.current_thread() # Keep maintaining workers until the cache gets drained, unless the pool # is terminated. - while thread._state == RUN or (pool._cache and thread._state != TERMINATE): - pool._maintain_pool() + while thread._state == RUN or (cache and thread._state != TERMINATE): + Pool._maintain_pool(ctx, Process, processes, pool, inqueue, + outqueue, initializer, initargs, + maxtasksperchild, wrap_exception) time.sleep(0.1) # send sentinel to stop workers - pool._taskqueue.put(None) + taskqueue.put(None) util.debug('worker handler exiting') @staticmethod @@ -781,7 +807,7 @@ class ThreadPool(Pool): _wrap_exception = False @staticmethod - def Process(*args, **kwds): + def Process(ctx, *args, **kwds): from .dummy import Process return Process(*args, **kwds) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 9d4917076c94..6667f1178574 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2285,6 +2285,12 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + def test_del_pool(self): + p = self.Pool(1) + wr = weakref.ref(p) + del p + gc.collect() + self.assertIsNone(wr()) def raising(): raise KeyError("key") diff --git a/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst new file mode 100644 index 000000000000..d1c5a7721019 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst @@ -0,0 +1 @@ +Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. From webhook-mailer at python.org Wed Oct 3 00:38:45 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Wed, 03 Oct 2018 04:38:45 -0000 Subject: [Python-checkins] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) Message-ID: https://github.com/python/cpython/commit/e006b39a40e0cd6a90c68f1107853ea2ed0ed54d commit: e006b39a40e0cd6a90c68f1107853ea2ed0ed54d branch: master author: Benjamin Peterson committer: GitHub date: 2018-10-02T21:38:39-07:00 summary: Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) A follow up to be4e5b89204283a62e369439025f00362d0424f6. files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index da8ce4082043..83aee1b02621 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -984,7 +984,7 @@ Test cases .. method:: assertRaisesRegex(exception, regex, callable, *args, **kwds) - assertRaisesRegex(exception, regex, msg=None) + assertRaisesRegex(exception, regex, *, msg=None) Like :meth:`assertRaises` but also tests that *regex* matches on the string representation of the raised exception. *regex* may be @@ -1010,7 +1010,7 @@ Test cases .. method:: assertWarns(warning, callable, *args, **kwds) - assertWarns(warning, msg=None) + assertWarns(warning, *, msg=None) Test that a warning is triggered when *callable* is called with any positional or keyword arguments that are also passed to @@ -1051,7 +1051,7 @@ Test cases .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) - assertWarnsRegex(warning, regex, msg=None) + assertWarnsRegex(warning, regex, *, msg=None) Like :meth:`assertWarns` but also tests that *regex* matches on the message of the triggered warning. *regex* may be a regular expression From webhook-mailer at python.org Wed Oct 3 00:44:27 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 03 Oct 2018 04:44:27 -0000 Subject: [Python-checkins] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) Message-ID: https://github.com/python/cpython/commit/f1e8be70a635995e67230b7eb73b08c442d886f8 commit: f1e8be70a635995e67230b7eb73b08c442d886f8 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-02T21:44:18-07:00 summary: Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) A follow up to be4e5b89204283a62e369439025f00362d0424f6. (cherry picked from commit e006b39a40e0cd6a90c68f1107853ea2ed0ed54d) Co-authored-by: Benjamin Peterson files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 17deeddd37d1..dd85e9e33d9c 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -965,7 +965,7 @@ Test cases .. method:: assertRaisesRegex(exception, regex, callable, *args, **kwds) - assertRaisesRegex(exception, regex, msg=None) + assertRaisesRegex(exception, regex, *, msg=None) Like :meth:`assertRaises` but also tests that *regex* matches on the string representation of the raised exception. *regex* may be @@ -991,7 +991,7 @@ Test cases .. method:: assertWarns(warning, callable, *args, **kwds) - assertWarns(warning, msg=None) + assertWarns(warning, *, msg=None) Test that a warning is triggered when *callable* is called with any positional or keyword arguments that are also passed to @@ -1032,7 +1032,7 @@ Test cases .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) - assertWarnsRegex(warning, regex, msg=None) + assertWarnsRegex(warning, regex, *, msg=None) Like :meth:`assertWarns` but also tests that *regex* matches on the message of the triggered warning. *regex* may be a regular expression From webhook-mailer at python.org Wed Oct 3 02:01:35 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 03 Oct 2018 06:01:35 -0000 Subject: [Python-checkins] bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683) Message-ID: https://github.com/python/cpython/commit/96c593279400693226d5a560c420ae0fcf1731b9 commit: 96c593279400693226d5a560c420ae0fcf1731b9 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-03T09:01:30+03:00 summary: bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683) formatfloat() was not checking if PyBytes_FromStringAndSize() failed, which could lead to a null pointer dereference in _PyBytes_FormatEx(). files: A Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst M Objects/bytesobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst new file mode 100644 index 000000000000..5775a219a273 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst @@ -0,0 +1,2 @@ +Fix a possible null pointer dereference in bytesobject.c. Patch by Zackery +Spytz. diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index fb344c1896ad..d51d1ba023c3 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -448,7 +448,7 @@ formatfloat(PyObject *v, int flags, int prec, int type, result = PyBytes_FromStringAndSize(p, len); PyMem_Free(p); *p_result = result; - return str; + return result != NULL ? str : NULL; } static PyObject * From webhook-mailer at python.org Wed Oct 3 02:33:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 03 Oct 2018 06:33:46 -0000 Subject: [Python-checkins] bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683) Message-ID: https://github.com/python/cpython/commit/063755c20184e80f587d522600536d1ba70a5f7e commit: 063755c20184e80f587d522600536d1ba70a5f7e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-02T23:33:42-07:00 summary: bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683) formatfloat() was not checking if PyBytes_FromStringAndSize() failed, which could lead to a null pointer dereference in _PyBytes_FormatEx(). (cherry picked from commit 96c593279400693226d5a560c420ae0fcf1731b9) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst M Objects/bytesobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst new file mode 100644 index 000000000000..5775a219a273 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst @@ -0,0 +1,2 @@ +Fix a possible null pointer dereference in bytesobject.c. Patch by Zackery +Spytz. diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 82a75457708b..32ff5afe3e02 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -448,7 +448,7 @@ formatfloat(PyObject *v, int flags, int prec, int type, result = PyBytes_FromStringAndSize(p, len); PyMem_Free(p); *p_result = result; - return str; + return result != NULL ? str : NULL; } static PyObject * From webhook-mailer at python.org Wed Oct 3 02:34:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 03 Oct 2018 06:34:08 -0000 Subject: [Python-checkins] bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683) Message-ID: https://github.com/python/cpython/commit/6580e52b64cb207f03a1bf86a18f088b081c10f4 commit: 6580e52b64cb207f03a1bf86a18f088b081c10f4 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-02T23:34:05-07:00 summary: bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683) formatfloat() was not checking if PyBytes_FromStringAndSize() failed, which could lead to a null pointer dereference in _PyBytes_FormatEx(). (cherry picked from commit 96c593279400693226d5a560c420ae0fcf1731b9) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst M Objects/bytesobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst new file mode 100644 index 000000000000..5775a219a273 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-02-22-55-11.bpo-34879.7VNH2a.rst @@ -0,0 +1,2 @@ +Fix a possible null pointer dereference in bytesobject.c. Patch by Zackery +Spytz. diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 26e59d1073c1..04ebe0b701e6 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -446,7 +446,7 @@ formatfloat(PyObject *v, int flags, int prec, int type, result = PyBytes_FromStringAndSize(p, len); PyMem_Free(p); *p_result = result; - return str; + return result != NULL ? str : NULL; } static PyObject * From solipsis at pitrou.net Wed Oct 3 05:13:32 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 03 Oct 2018 09:13:32 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181003091332.1.6FF29D13EFCED9E4@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, -1, 1] memory blocks, sum=2 test_multiprocessing_spawn leaked [-2, 2, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogJxETRi', '--timeout', '7200'] From webhook-mailer at python.org Wed Oct 3 07:50:12 2018 From: webhook-mailer at python.org (Antoine Pitrou) Date: Wed, 03 Oct 2018 11:50:12 -0000 Subject: [Python-checkins] [2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686) Message-ID: https://github.com/python/cpython/commit/4a7dd30f5810e8861a3834159a222ab32d5c97d0 commit: 4a7dd30f5810e8861a3834159a222ab32d5c97d0 branch: 2.7 author: tzickel committer: Antoine Pitrou date: 2018-10-03T13:50:04+02:00 summary: [2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686) Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. files: A Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst M Lib/multiprocessing/pool.py M Lib/test/test_multiprocessing.py diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index a47cd0f58a05..489c7d67cf34 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -162,7 +162,9 @@ def __init__(self, processes=None, initializer=None, initargs=(), self._worker_handler = threading.Thread( target=Pool._handle_workers, - args=(self, ) + args=(self._cache, self._processes, self._pool, self.Process, + self._inqueue, self._outqueue, self._initializer, + self._initargs, self._maxtasksperchild, self._taskqueue) ) self._worker_handler.daemon = True self._worker_handler._state = RUN @@ -194,42 +196,56 @@ def __init__(self, processes=None, initializer=None, initargs=(), exitpriority=15 ) - def _join_exited_workers(self): + @staticmethod + def _join_exited_workers(pool): """Cleanup after any worker processes which have exited due to reaching their specified lifetime. Returns True if any workers were cleaned up. """ cleaned = False - for i in reversed(range(len(self._pool))): - worker = self._pool[i] + for i in reversed(range(len(pool))): + worker = pool[i] if worker.exitcode is not None: # worker exited debug('cleaning up worker %d' % i) worker.join() cleaned = True - del self._pool[i] + del pool[i] return cleaned def _repopulate_pool(self): + return self._repopulate_pool_static(self._processes, self._pool, + self.Process, self._inqueue, + self._outqueue, self._initializer, + self._initargs, + self._maxtasksperchild) + + @staticmethod + def _repopulate_pool_static(processes, pool, Process, inqueue, outqueue, + initializer, initargs, maxtasksperchild): """Bring the number of pool processes up to the specified number, for use after reaping workers which have exited. """ - for i in range(self._processes - len(self._pool)): - w = self.Process(target=worker, - args=(self._inqueue, self._outqueue, - self._initializer, - self._initargs, self._maxtasksperchild) - ) - self._pool.append(w) + for i in range(processes - len(pool)): + w = Process(target=worker, + args=(inqueue, outqueue, + initializer, + initargs, maxtasksperchild) + ) + pool.append(w) w.name = w.name.replace('Process', 'PoolWorker') w.daemon = True w.start() debug('added worker') - def _maintain_pool(self): + @staticmethod + def _maintain_pool(processes, pool, Process, inqueue, outqueue, + initializer, initargs, maxtasksperchild): """Clean up any exited workers and start replacements for them. """ - if self._join_exited_workers(): - self._repopulate_pool() + if Pool._join_exited_workers(pool): + Pool._repopulate_pool_static(processes, pool, Process, inqueue, + outqueue, initializer, initargs, + maxtasksperchild) def _setup_queues(self): from .queues import SimpleQueue @@ -319,16 +335,18 @@ def map_async(self, func, iterable, chunksize=None, callback=None): return result @staticmethod - def _handle_workers(pool): + def _handle_workers(cache, processes, pool, Process, inqueue, outqueue, + initializer, initargs, maxtasksperchild, taskqueue): thread = threading.current_thread() # Keep maintaining workers until the cache gets drained, unless the pool # is terminated. - while thread._state == RUN or (pool._cache and thread._state != TERMINATE): - pool._maintain_pool() + while thread._state == RUN or (cache and thread._state != TERMINATE): + Pool._maintain_pool(processes, pool, Process, inqueue, outqueue, + initializer, initargs, maxtasksperchild) time.sleep(0.1) # send sentinel to stop workers - pool._taskqueue.put(None) + taskqueue.put(None) debug('worker handler exiting') @staticmethod diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index ff299feed894..d3192181e5ad 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -1359,6 +1359,13 @@ def test_release_task_refs(self): # they were released too. self.assertEqual(CountedObject.n_instances, 0) + def test_del_pool(self): + p = self.Pool(1) + wr = weakref.ref(p) + del p + gc.collect() + self.assertIsNone(wr()) + def unpickleable_result(): return lambda: 42 diff --git a/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst new file mode 100644 index 000000000000..d1c5a7721019 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-26-10-31-52.bpo-34172.8ovLNi.rst @@ -0,0 +1 @@ +Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. From webhook-mailer at python.org Wed Oct 3 10:30:38 2018 From: webhook-mailer at python.org (Yury Selivanov) Date: Wed, 03 Oct 2018 14:30:38 -0000 Subject: [Python-checkins] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) Message-ID: https://github.com/python/cpython/commit/0c797a6aca1c293e530e18c5e9fa02c670a9a4ed commit: 0c797a6aca1c293e530e18c5e9fa02c670a9a4ed branch: master author: Elvis Pranskevichus committer: Yury Selivanov date: 2018-10-03T10:30:31-04:00 summary: bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) The C implementation of asyncio.Task currently fails to perform the cancellation cleanup correctly in the following scenario. async def task1(): async def task2(): await task3 # task3 is never cancelled asyncio.current_task().cancel() await asyncio.create_task(task2()) The actuall error is a hardcoded call to `future_cancel()` instead of calling the `cancel()` method of a future-like object. Thanks to Vladimir Matveev for noticing the code discrepancy and to Yury Selivanov for coming up with a pathological scenario. files: A Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst M Lib/test/test_asyncio/test_tasks.py M Modules/_asynciomodule.c diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index eb6f2f5ecb18..0fe767630f1a 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -622,6 +622,42 @@ def task(): self.assertFalse(t._must_cancel) # White-box test. self.assertFalse(t.cancel()) + def test_cancel_awaited_task(self): + # This tests for a relatively rare condition when + # a task cancellation is requested for a task which is not + # currently blocked, such as a task cancelling itself. + # In this situation we must ensure that whatever next future + # or task the cancelled task blocks on is cancelled correctly + # as well. See also bpo-34872. + loop = asyncio.new_event_loop() + self.addCleanup(lambda: loop.close()) + + task = nested_task = None + fut = self.new_future(loop) + + async def nested(): + await fut + + async def coro(): + nonlocal nested_task + # Create a sub-task and wait for it to run. + nested_task = self.new_task(loop, nested()) + await asyncio.sleep(0) + + # Request the current task to be cancelled. + task.cancel() + # Block on the nested task, which should be immediately + # cancelled. + await nested_task + + task = self.new_task(loop, coro()) + with self.assertRaises(asyncio.CancelledError): + loop.run_until_complete(task) + + self.assertTrue(task.cancelled()) + self.assertTrue(nested_task.cancelled()) + self.assertTrue(fut.cancelled()) + def test_stop_while_run_in_complete(self): def gen(): diff --git a/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst b/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst new file mode 100644 index 000000000000..cd027102d012 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst @@ -0,0 +1 @@ +Fix self-cancellation in C implementation of asyncio.Task diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 6bf0fd6b0c94..eb503fb38c12 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2713,14 +2713,19 @@ task_step_impl(TaskObj *task, PyObject *exc) if (task->task_must_cancel) { PyObject *r; - r = future_cancel(fut); + int is_true; + r = _PyObject_CallMethodId(fut, &PyId_cancel, NULL); if (r == NULL) { return NULL; } - if (r == Py_True) { + is_true = PyObject_IsTrue(r); + Py_DECREF(r); + if (is_true < 0) { + return NULL; + } + else if (is_true) { task->task_must_cancel = 0; } - Py_DECREF(r); } Py_RETURN_NONE; From webhook-mailer at python.org Wed Oct 3 11:28:52 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 03 Oct 2018 15:28:52 -0000 Subject: [Python-checkins] [3.6] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) (GH-9690) Message-ID: https://github.com/python/cpython/commit/166773df0ce6c852130f524029fa2e62b37b89cb commit: 166773df0ce6c852130f524029fa2e62b37b89cb branch: 3.6 author: Elvis Pranskevichus committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-03T08:28:44-07:00 summary: [3.6] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) (GH-9690) The C implementation of asyncio.Task currently fails to perform the cancellation cleanup correctly in the following scenario. async def task1(): async def task2(): await task3 # task3 is never cancelled asyncio.current_task().cancel() await asyncio.create_task(task2()) The actuall error is a hardcoded call to `future_cancel()` instead of calling the `cancel()` method of a future-like object. Thanks to Vladimir Matveev for noticing the code discrepancy and to Yury Selivanov for coming up with a pathological scenario. (cherry picked from commit 548ce9dedd2e90945970671d441436a6a91608ab) https://bugs.python.org/issue34872 files: A Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst M Lib/test/test_asyncio/test_tasks.py M Modules/_asynciomodule.c diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index e8ec09efd4ad..084846bace3b 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -621,6 +621,42 @@ def task(): self.assertFalse(t._must_cancel) # White-box test. self.assertFalse(t.cancel()) + def test_cancel_awaited_task(self): + # This tests for a relatively rare condition when + # a task cancellation is requested for a task which is not + # currently blocked, such as a task cancelling itself. + # In this situation we must ensure that whatever next future + # or task the cancelled task blocks on is cancelled correctly + # as well. See also bpo-34872. + loop = asyncio.new_event_loop() + self.addCleanup(lambda: loop.close()) + + task = nested_task = None + fut = self.new_future(loop) + + async def nested(): + await fut + + async def coro(): + nonlocal nested_task + # Create a sub-task and wait for it to run. + nested_task = self.new_task(loop, nested()) + await asyncio.sleep(0) + + # Request the current task to be cancelled. + task.cancel() + # Block on the nested task, which should be immediately + # cancelled. + await nested_task + + task = self.new_task(loop, coro()) + with self.assertRaises(asyncio.CancelledError): + loop.run_until_complete(task) + + self.assertTrue(task.cancelled()) + self.assertTrue(nested_task.cancelled()) + self.assertTrue(fut.cancelled()) + def test_stop_while_run_in_complete(self): def gen(): diff --git a/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst b/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst new file mode 100644 index 000000000000..cd027102d012 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst @@ -0,0 +1 @@ +Fix self-cancellation in C implementation of asyncio.Task diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 6ad3d726f5ce..cbd6fe3c4455 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2121,14 +2121,19 @@ task_step_impl(TaskObj *task, PyObject *exc) if (task->task_must_cancel) { PyObject *r; - r = future_cancel(fut); + int is_true; + r = _PyObject_CallMethodId(fut, &PyId_cancel, NULL); if (r == NULL) { return NULL; } - if (r == Py_True) { + is_true = PyObject_IsTrue(r); + Py_DECREF(r); + if (is_true < 0) { + return NULL; + } + else if (is_true) { task->task_must_cancel = 0; } - Py_DECREF(r); } Py_RETURN_NONE; From webhook-mailer at python.org Wed Oct 3 11:49:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 03 Oct 2018 15:49:06 -0000 Subject: [Python-checkins] [3.7] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) (GH-9691) Message-ID: https://github.com/python/cpython/commit/a67bd53d3f80ac9c518b5426aa35459bd373b2b3 commit: a67bd53d3f80ac9c518b5426aa35459bd373b2b3 branch: 3.7 author: Elvis Pranskevichus committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-03T08:49:00-07:00 summary: [3.7] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679) (GH-9691) The C implementation of asyncio.Task currently fails to perform the cancellation cleanup correctly in the following scenario. async def task1(): async def task2(): await task3 # task3 is never cancelled asyncio.current_task().cancel() await asyncio.create_task(task2()) The actuall error is a hardcoded call to `future_cancel()` instead of calling the `cancel()` method of a future-like object. Thanks to Vladimir Matveev for noticing the code discrepancy and to Yury Selivanov for coming up with a pathological scenario.. (cherry picked from commit 548ce9dedd2e90945970671d441436a6a91608ab) Co-authored-by: Elvis Pranskevichus https://bugs.python.org/issue34872 files: A Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst M Lib/test/test_asyncio/test_tasks.py M Modules/_asynciomodule.c diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 67df3c0f48fd..12c6ef4f619e 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -590,6 +590,42 @@ def task(): self.assertFalse(t._must_cancel) # White-box test. self.assertFalse(t.cancel()) + def test_cancel_awaited_task(self): + # This tests for a relatively rare condition when + # a task cancellation is requested for a task which is not + # currently blocked, such as a task cancelling itself. + # In this situation we must ensure that whatever next future + # or task the cancelled task blocks on is cancelled correctly + # as well. See also bpo-34872. + loop = asyncio.new_event_loop() + self.addCleanup(lambda: loop.close()) + + task = nested_task = None + fut = self.new_future(loop) + + async def nested(): + await fut + + async def coro(): + nonlocal nested_task + # Create a sub-task and wait for it to run. + nested_task = self.new_task(loop, nested()) + await asyncio.sleep(0) + + # Request the current task to be cancelled. + task.cancel() + # Block on the nested task, which should be immediately + # cancelled. + await nested_task + + task = self.new_task(loop, coro()) + with self.assertRaises(asyncio.CancelledError): + loop.run_until_complete(task) + + self.assertTrue(task.cancelled()) + self.assertTrue(nested_task.cancelled()) + self.assertTrue(fut.cancelled()) + def test_stop_while_run_in_complete(self): def gen(): diff --git a/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst b/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst new file mode 100644 index 000000000000..cd027102d012 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-02-19-36-34.bpo-34872.yWZRhI.rst @@ -0,0 +1 @@ +Fix self-cancellation in C implementation of asyncio.Task diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 0c161fb2bc7d..9f7500a40ad1 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2662,14 +2662,19 @@ task_step_impl(TaskObj *task, PyObject *exc) if (task->task_must_cancel) { PyObject *r; - r = future_cancel(fut); + int is_true; + r = _PyObject_CallMethodId(fut, &PyId_cancel, NULL); if (r == NULL) { return NULL; } - if (r == Py_True) { + is_true = PyObject_IsTrue(r); + Py_DECREF(r); + if (is_true < 0) { + return NULL; + } + else if (is_true) { task->task_must_cancel = 0; } - Py_DECREF(r); } Py_RETURN_NONE; From webhook-mailer at python.org Wed Oct 3 22:23:29 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Thu, 04 Oct 2018 02:23:29 -0000 Subject: [Python-checkins] closes bpo-34869: Remove LDLAST. (GH-9667) Message-ID: https://github.com/python/cpython/commit/65ed12cb7caba6ef4eb0ba18cbede5eab4e1c7a5 commit: 65ed12cb7caba6ef4eb0ba18cbede5eab4e1c7a5 branch: master author: Benjamin Peterson committer: GitHub date: 2018-10-03T19:23:24-07:00 summary: closes bpo-34869: Remove LDLAST. (GH-9667) files: M Makefile.pre.in M configure M configure.ac diff --git a/Makefile.pre.in b/Makefile.pre.in index d2e7377e98d5..333ab9b38240 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -98,7 +98,6 @@ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS) PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) NO_AS_NEEDED= @NO_AS_NEEDED@ -LDLAST= @LDLAST@ SGI_ABI= @SGI_ABI@ CCSHARED= @CCSHARED@ LINKFORSHARED= @LINKFORSHARED@ @@ -568,7 +567,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c # Build the interpreter $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) - $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) platform: $(BUILDPYTHON) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform @@ -623,21 +622,21 @@ $(LIBRARY): $(LIBRARY_OBJS) libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ $(LN) -f $(INSTSONAME) $@; \ else \ - $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ fi libpython3.so: libpython$(LDVERSION).so $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) - $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) + $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) # Copy up the gdb python hooks into a position where they can be automatically # loaded by gdb during Lib/test/test_gdb.py @@ -677,7 +676,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) if test -n "$(DLLLIBRARY)"; then \ $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ - $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \ + $(LIBS) $(MODLIBS) $(SYSLIBS); \ else true; \ fi @@ -699,7 +698,7 @@ Makefile Modules/config.c: Makefile.pre \ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) - $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) ############################################################################ # Importlib @@ -707,7 +706,7 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) - $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) .PHONY: regen-importlib regen-importlib: Programs/_freeze_importlib diff --git a/configure b/configure index 9d2c4e4ad7e6..2f45c17852e5 100755 --- a/configure +++ b/configure @@ -649,7 +649,6 @@ DTRACE_OBJS DTRACE_HEADERS DFLAGS DTRACE -LDLAST TCLTK_LIBS TCLTK_INCLUDES LIBFFI_INCLUDEDIR @@ -10292,8 +10291,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dbmliborder" >&5 $as_echo "$with_dbmliborder" >&6; } - - # Templates for things AC_DEFINEd more than once. # For a single AC_DEFINE, no template is needed. diff --git a/configure.ac b/configure.ac index 2235a13d1160..f1b47dbf4f82 100644 --- a/configure.ac +++ b/configure.ac @@ -2955,8 +2955,6 @@ else fi]) AC_MSG_RESULT($with_dbmliborder) -AC_SUBST(LDLAST) - # Templates for things AC_DEFINEd more than once. # For a single AC_DEFINE, no template is needed. AH_TEMPLATE(_REENTRANT, From webhook-mailer at python.org Thu Oct 4 03:41:32 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 04 Oct 2018 07:41:32 -0000 Subject: [Python-checkins] bpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420) Message-ID: https://github.com/python/cpython/commit/b2953fa3dda5898fcb0029792d9229f150e6e2cb commit: b2953fa3dda5898fcb0029792d9229f150e6e2cb branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-04T10:41:27+03:00 summary: bpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420) Use tp_members and tp_getset instead. files: M Modules/_elementtree.c diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index bba687388797..bd7702ea6970 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3685,30 +3685,25 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self, Py_RETURN_NONE; } -static PyObject* -xmlparser_getattro(XMLParserObject* self, PyObject* nameobj) -{ - if (PyUnicode_Check(nameobj)) { - PyObject* res; - if (_PyUnicode_EqualToASCIIString(nameobj, "entity")) - res = self->entity; - else if (_PyUnicode_EqualToASCIIString(nameobj, "target")) - res = self->target; - else if (_PyUnicode_EqualToASCIIString(nameobj, "version")) { - return PyUnicode_FromFormat( - "Expat %d.%d.%d", XML_MAJOR_VERSION, - XML_MINOR_VERSION, XML_MICRO_VERSION); - } - else - goto generic; +static PyMemberDef xmlparser_members[] = { + {"entity", T_OBJECT, offsetof(XMLParserObject, entity), READONLY, NULL}, + {"target", T_OBJECT, offsetof(XMLParserObject, target), READONLY, NULL}, + {NULL} +}; - Py_INCREF(res); - return res; - } - generic: - return PyObject_GenericGetAttr((PyObject*) self, nameobj); +static PyObject* +xmlparser_version_getter(XMLParserObject *self, void *closure) +{ + return PyUnicode_FromFormat( + "Expat %d.%d.%d", XML_MAJOR_VERSION, + XML_MINOR_VERSION, XML_MICRO_VERSION); } +static PyGetSetDef xmlparser_getsetlist[] = { + {"version", (getter)xmlparser_version_getter, NULL, NULL}, + {NULL}, +}; + #include "clinic/_elementtree.c.h" static PyMethodDef element_methods[] = { @@ -3890,7 +3885,7 @@ static PyTypeObject XMLParser_Type = { 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ - (getattrofunc)xmlparser_getattro, /* tp_getattro */ + 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, @@ -3903,8 +3898,8 @@ static PyTypeObject XMLParser_Type = { 0, /* tp_iter */ 0, /* tp_iternext */ xmlparser_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ + xmlparser_members, /* tp_members */ + xmlparser_getsetlist, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ From webhook-mailer at python.org Thu Oct 4 03:42:09 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 04 Oct 2018 07:42:09 -0000 Subject: [Python-checkins] bpo-34740: Get rid of tp_getattro in ossaudiodev.oss_audio_device. (GH-9421) Message-ID: https://github.com/python/cpython/commit/5f5a7781c8bf7bcc476d3e05d980711be3920724 commit: 5f5a7781c8bf7bcc476d3e05d980711be3920724 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-04T10:42:06+03:00 summary: bpo-34740: Get rid of tp_getattro in ossaudiodev.oss_audio_device. (GH-9421) Use tp_members and tp_getset instead. files: M Modules/ossaudiodev.c diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c index 150a14eb388a..2222148c8516 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -921,46 +921,43 @@ static PyMethodDef oss_mixer_methods[] = { { NULL, NULL} }; +static PyMemberDef oss_members[] = { + {"name", T_STRING, offsetof(oss_audio_t, devicename), READONLY, NULL}, + {NULL} +}; + static PyObject * -oss_getattro(oss_audio_t *self, PyObject *nameobj) +oss_closed_getter(oss_audio_t *self, void *closure) { - const char *name = ""; - PyObject * rval = NULL; - - if (PyUnicode_Check(nameobj)) { - name = PyUnicode_AsUTF8(nameobj); - if (name == NULL) - return NULL; - } + return PyBool_FromLong(self->fd == -1); +} - if (strcmp(name, "closed") == 0) { - rval = (self->fd == -1) ? Py_True : Py_False; - Py_INCREF(rval); - } - else if (strcmp(name, "name") == 0) { - rval = PyUnicode_FromString(self->devicename); - } - else if (strcmp(name, "mode") == 0) { - /* No need for a "default" in this switch: from newossobject(), - self->mode can only be one of these three values. */ - switch(self->mode) { - case O_RDONLY: - rval = PyUnicode_FromString("r"); - break; - case O_RDWR: - rval = PyUnicode_FromString("rw"); - break; - case O_WRONLY: - rval = PyUnicode_FromString("w"); - break; - } - } - else { - rval = PyObject_GenericGetAttr((PyObject *)self, nameobj); +static PyObject * +oss_mode_getter(oss_audio_t *self, void *closure) +{ + switch(self->mode) { + case O_RDONLY: + return PyUnicode_FromString("r"); + break; + case O_RDWR: + return PyUnicode_FromString("rw"); + break; + case O_WRONLY: + return PyUnicode_FromString("w"); + break; + default: + /* From newossobject(), self->mode can only be one + of these three values. */ + Py_UNREACHABLE(); } - return rval; } +static PyGetSetDef oss_getsetlist[] = { + {"closed", (getter)oss_closed_getter, (setter)NULL, NULL}, + {"mode", (getter)oss_mode_getter, (setter)NULL, NULL}, + {NULL}, +}; + static PyTypeObject OSSAudioType = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "ossaudiodev.oss_audio_device", /*tp_name*/ @@ -979,7 +976,7 @@ static PyTypeObject OSSAudioType = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - (getattrofunc)oss_getattro, /*tp_getattro*/ + 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ @@ -991,6 +988,8 @@ static PyTypeObject OSSAudioType = { 0, /*tp_iter*/ 0, /*tp_iternext*/ oss_methods, /*tp_methods*/ + oss_members, /*tp_members*/ + oss_getsetlist, /*tp_getset*/ }; static PyTypeObject OSSMixerType = { From solipsis at pitrou.net Thu Oct 4 05:08:50 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 04 Oct 2018 09:08:50 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=14 Message-ID: <20181004090850.1.D451D012C65F8B6F@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, 0, 0] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, -2, 2] memory blocks, sum=0 test_multiprocessing_forkserver leaked [2, 0, 0] memory blocks, sum=2 test_multiprocessing_spawn leaked [0, -1, 2] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogYSeDQ7', '--timeout', '7200'] From webhook-mailer at python.org Thu Oct 4 09:15:05 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 04 Oct 2018 13:15:05 -0000 Subject: [Python-checkins] bpo-34871: Fix two typos in test_inspect.py (GH-9698) Message-ID: https://github.com/python/cpython/commit/c57eb9a336391dc22aa29e9db592fa06d7fb7101 commit: c57eb9a336391dc22aa29e9db592fa06d7fb7101 branch: master author: Chih-Hsuan Yen committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-04T06:15:00-07:00 summary: bpo-34871: Fix two typos in test_inspect.py (GH-9698) `arg` is misspelled as `agr`. I noticed this when playing with https://bugs.python.org/issue34871 https://bugs.python.org/issue34871 files: M Lib/test/test_inspect.py diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index e523dd40636c..134b0cd0b735 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -851,7 +851,7 @@ def test_getfullargspec_builtin_methods(self): @cpython_only @unittest.skipIf(MISSING_C_DOCSTRINGS, "Signature information for builtins requires docstrings") - def test_getfullagrspec_builtin_func(self): + def test_getfullargspec_builtin_func(self): import _testcapi builtin = _testcapi.docstring_with_signature_with_defaults spec = inspect.getfullargspec(builtin) @@ -860,7 +860,7 @@ def test_getfullagrspec_builtin_func(self): @cpython_only @unittest.skipIf(MISSING_C_DOCSTRINGS, "Signature information for builtins requires docstrings") - def test_getfullagrspec_builtin_func_no_signature(self): + def test_getfullargspec_builtin_func_no_signature(self): import _testcapi builtin = _testcapi.docstring_no_signature with self.assertRaises(TypeError): From webhook-mailer at python.org Thu Oct 4 12:47:14 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 04 Oct 2018 16:47:14 -0000 Subject: [Python-checkins] bpo-34871: inspect: Don't pollute sys.modules (GH-9696) Message-ID: https://github.com/python/cpython/commit/6f85b826b527e240551613aeec3118a5469e3a33 commit: 6f85b826b527e240551613aeec3118a5469e3a33 branch: master author: INADA Naoki committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-04T09:47:09-07:00 summary: bpo-34871: inspect: Don't pollute sys.modules (GH-9696) https://bugs.python.org/issue34871 files: A Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst M Lib/inspect.py diff --git a/Lib/inspect.py b/Lib/inspect.py index 5b7f526939b6..857892bc8144 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1988,7 +1988,7 @@ def _signature_fromstr(cls, obj, s, skip_bound_arg=True): module = sys.modules.get(module_name, None) if module: module_dict = module.__dict__ - sys_module_dict = sys.modules + sys_module_dict = sys.modules.copy() def parse_name(node): assert isinstance(node, ast.arg) diff --git a/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst b/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst new file mode 100644 index 000000000000..8cff15671ce5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst @@ -0,0 +1,2 @@ +Fix inspect module polluted ``sys.modules`` when parsing +``__text_signature__`` of callable. From webhook-mailer at python.org Thu Oct 4 15:26:34 2018 From: webhook-mailer at python.org (Yury Selivanov) Date: Thu, 04 Oct 2018 19:26:34 -0000 Subject: [Python-checkins] bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (GH-9702) Message-ID: https://github.com/python/cpython/commit/70a083bc46aea84e3b3ffca2c10c295917a98fec commit: 70a083bc46aea84e3b3ffca2c10c295917a98fec branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Yury Selivanov date: 2018-10-04T15:26:27-04:00 summary: bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (GH-9702) https://bugs.python.org/issue34871 (cherry picked from commit 6f85b826b527e240551613aeec3118a5469e3a33) Co-authored-by: INADA Naoki files: A Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst M Lib/inspect.py diff --git a/Lib/inspect.py b/Lib/inspect.py index 227f6b8a63bd..dd3b784a607e 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1973,7 +1973,7 @@ def _signature_fromstr(cls, obj, s, skip_bound_arg=True): module = sys.modules.get(module_name, None) if module: module_dict = module.__dict__ - sys_module_dict = sys.modules + sys_module_dict = sys.modules.copy() def parse_name(node): assert isinstance(node, ast.arg) diff --git a/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst b/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst new file mode 100644 index 000000000000..8cff15671ce5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst @@ -0,0 +1,2 @@ +Fix inspect module polluted ``sys.modules`` when parsing +``__text_signature__`` of callable. From webhook-mailer at python.org Thu Oct 4 15:26:37 2018 From: webhook-mailer at python.org (Yury Selivanov) Date: Thu, 04 Oct 2018 19:26:37 -0000 Subject: [Python-checkins] bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (#9701) Message-ID: https://github.com/python/cpython/commit/476c294f260ebe1b44157a168c3dfa4a43724ce3 commit: 476c294f260ebe1b44157a168c3dfa4a43724ce3 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Yury Selivanov date: 2018-10-04T15:26:33-04:00 summary: bpo-34871: inspect: Don't pollute sys.modules (GH-9696) (#9701) https://bugs.python.org/issue34871 (cherry picked from commit 6f85b826b527e240551613aeec3118a5469e3a33) Co-authored-by: INADA Naoki files: A Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst M Lib/inspect.py diff --git a/Lib/inspect.py b/Lib/inspect.py index 4482b8ea29d5..b5d583ccfd1b 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1988,7 +1988,7 @@ def _signature_fromstr(cls, obj, s, skip_bound_arg=True): module = sys.modules.get(module_name, None) if module: module_dict = module.__dict__ - sys_module_dict = sys.modules + sys_module_dict = sys.modules.copy() def parse_name(node): assert isinstance(node, ast.arg) diff --git a/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst b/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst new file mode 100644 index 000000000000..8cff15671ce5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-18-46-54.bpo-34871.t3X-dB.rst @@ -0,0 +1,2 @@ +Fix inspect module polluted ``sys.modules`` when parsing +``__text_signature__`` of callable. From webhook-mailer at python.org Fri Oct 5 03:00:53 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Fri, 05 Oct 2018 07:00:53 -0000 Subject: [Python-checkins] Fix a typo ssl.py docstring (GH-9697) Message-ID: https://github.com/python/cpython/commit/fc7d1b3b6a2be7061c000245bb1faa438e42f5d8 commit: fc7d1b3b6a2be7061c000245bb1faa438e42f5d8 branch: master author: Matt Eaton committer: Andrew Svetlov date: 2018-10-05T10:00:45+03:00 summary: Fix a typo ssl.py docstring (GH-9697) files: M Lib/ssl.py diff --git a/Lib/ssl.py b/Lib/ssl.py index c7b493250558..8f6d402209b1 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -640,7 +640,7 @@ class SSLObject: When compared to ``SSLSocket``, this object lacks the following features: - * Any form of network IO incluging methods such as ``recv`` and ``send``. + * Any form of network IO, including methods such as ``recv`` and ``send``. * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery. """ def __init__(self, *args, **kwargs): From webhook-mailer at python.org Fri Oct 5 03:33:14 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Fri, 05 Oct 2018 07:33:14 -0000 Subject: [Python-checkins] Fix a typo ssl.py docstring (GH-9697) (#9710) Message-ID: https://github.com/python/cpython/commit/77bd6062ba9f7767c28bb9962b16951efbf57586 commit: 77bd6062ba9f7767c28bb9962b16951efbf57586 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Andrew Svetlov date: 2018-10-05T10:33:10+03:00 summary: Fix a typo ssl.py docstring (GH-9697) (#9710) (cherry picked from commit fc7d1b3b6a2be7061c000245bb1faa438e42f5d8) Co-authored-by: Matt Eaton files: M Lib/ssl.py diff --git a/Lib/ssl.py b/Lib/ssl.py index 4130cc7d1a27..cd216a15cda8 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -576,7 +576,7 @@ class SSLObject: When compared to ``SSLSocket``, this object lacks the following features: - * Any form of network IO incluging methods such as ``recv`` and ``send``. + * Any form of network IO, including methods such as ``recv`` and ``send``. * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery. """ From webhook-mailer at python.org Fri Oct 5 03:33:39 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Fri, 05 Oct 2018 07:33:39 -0000 Subject: [Python-checkins] Fix a typo ssl.py docstring (GH-9697) (GH-9709) Message-ID: https://github.com/python/cpython/commit/23fd846feba59977633e19dcca8a520dc4b01383 commit: 23fd846feba59977633e19dcca8a520dc4b01383 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Andrew Svetlov date: 2018-10-05T10:33:36+03:00 summary: Fix a typo ssl.py docstring (GH-9697) (GH-9709) (cherry picked from commit fc7d1b3b6a2be7061c000245bb1faa438e42f5d8) Co-authored-by: Matt Eaton files: M Lib/ssl.py diff --git a/Lib/ssl.py b/Lib/ssl.py index 2f21937b8ec2..38aa38907e15 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -640,7 +640,7 @@ class SSLObject: When compared to ``SSLSocket``, this object lacks the following features: - * Any form of network IO incluging methods such as ``recv`` and ``send``. + * Any form of network IO, including methods such as ``recv`` and ``send``. * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery. """ def __init__(self, *args, **kwargs): From solipsis at pitrou.net Fri Oct 5 05:05:53 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 05 Oct 2018 09:05:53 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=11 Message-ID: <20181005090553.1.FF98AD7DE1088F1D@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [-2, 1, -1] memory blocks, sum=-2 test_multiprocessing_spawn leaked [2, 0, 0] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogNg6heN', '--timeout', '7200'] From webhook-mailer at python.org Fri Oct 5 07:38:55 2018 From: webhook-mailer at python.org (INADA Naoki) Date: Fri, 05 Oct 2018 11:38:55 -0000 Subject: [Python-checkins] bpo-28441: Ensure `.exe` suffix in `sys.executable` on MinGW and Cygwin (GH-4348) Message-ID: https://github.com/python/cpython/commit/7a7693e9cb12e5571c76331db56a28eef9acb6e0 commit: 7a7693e9cb12e5571c76331db56a28eef9acb6e0 branch: master author: E. M. Bray committer: INADA Naoki date: 2018-10-05T20:38:50+09:00 summary: bpo-28441: Ensure `.exe` suffix in `sys.executable` on MinGW and Cygwin (GH-4348) This is needed to even the run the test suite on buildbots for affected platforms; e.g.: ``` ./python.exe ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2 /home/embray/src/python/test-worker/3.x.test-worker/build/python -u -W default -bb -E -W error::BytesWarning -m test -r -w -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2 Traceback (most recent call last): File "./Tools/scripts/run_tests.py", line 56, in main(sys.argv[1:]) File "./Tools/scripts/run_tests.py", line 52, in main os.execv(sys.executable, args) PermissionError: [Errno 13] Permission denied make: *** [Makefile:1073: buildbottest] Error 1 ``` files: A Misc/NEWS.d/next/Library/2018-10-04-15-53-14.bpo-28441.2sQENe.rst M Modules/getpath.c diff --git a/Misc/NEWS.d/next/Library/2018-10-04-15-53-14.bpo-28441.2sQENe.rst b/Misc/NEWS.d/next/Library/2018-10-04-15-53-14.bpo-28441.2sQENe.rst new file mode 100644 index 000000000000..45143c2a54ac --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-15-53-14.bpo-28441.2sQENe.rst @@ -0,0 +1,3 @@ +On Cygwin and MinGW, ensure that ``sys.executable`` always includes the full +filename in the path, including the ``.exe`` suffix (unless it is a symbolic +link). diff --git a/Modules/getpath.c b/Modules/getpath.c index 041cb14b4b9c..521bc6e35ed3 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -296,6 +296,41 @@ absolutize(wchar_t *path) } +#if defined(__CYGWIN__) || defined(__MINGW32__) +/* add_exe_suffix requires that progpath be allocated at least + MAXPATHLEN + 1 bytes. +*/ + +#ifndef EXE_SUFFIX +#define EXE_SUFFIX L".exe" +#endif + +static void +add_exe_suffix(wchar_t *progpath) +{ + /* Check for already have an executable suffix */ + size_t n = wcslen(progpath); + size_t s = wcslen(EXE_SUFFIX); + if (wcsncasecmp(EXE_SUFFIX, progpath+n-s, s) != 0) { + if (n + s > MAXPATHLEN) { + Py_FatalError("progpath overflow in getpath.c's add_exe_suffix()"); + } + /* Save original path for revert */ + wchar_t orig[MAXPATHLEN+1]; + wcsncpy(orig, progpath, MAXPATHLEN); + + wcsncpy(progpath+n, EXE_SUFFIX, s); + progpath[n+s] = '\0'; + + if (!isxfile(progpath)) { + /* Path that added suffix is invalid */ + wcsncpy(progpath, orig, MAXPATHLEN); + } + } +} +#endif + + /* search_for_prefix requires that argv0_path be no more than MAXPATHLEN bytes long. */ @@ -605,6 +640,16 @@ calculate_program_full_path(const _PyCoreConfig *core_config, if (program_full_path[0] != SEP && program_full_path[0] != '\0') { absolutize(program_full_path); } +#if defined(__CYGWIN__) || defined(__MINGW32__) + /* For these platforms it is necessary to ensure that the .exe suffix + * is appended to the filename, otherwise there is potential for + * sys.executable to return the name of a directory under the same + * path (bpo-28441). + */ + if (program_full_path[0] != '\0') { + add_exe_suffix(program_full_path); + } +#endif config->program_full_path = _PyMem_RawWcsdup(program_full_path); if (config->program_full_path == NULL) { From webhook-mailer at python.org Fri Oct 5 10:17:21 2018 From: webhook-mailer at python.org (Julien Palard) Date: Fri, 05 Oct 2018 14:17:21 -0000 Subject: [Python-checkins] bpo-34906: Doc: Fix typos (GH-9712) Message-ID: https://github.com/python/cpython/commit/07fbbfde1b300369b4f8d1cfb80045fbb23b7091 commit: 07fbbfde1b300369b4f8d1cfb80045fbb23b7091 branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-05T16:17:18+02:00 summary: bpo-34906: Doc: Fix typos (GH-9712) files: M Doc/library/dis.rst M Doc/library/ssl.rst M Doc/library/zipapp.rst M Doc/whatsnew/3.6.rst M Lib/bdb.py M Modules/_ssl.c diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index fe9979db0eaa..060d4bb6997a 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -149,7 +149,7 @@ operation is being performed, so the intermediate analysis object isn't useful: .. function:: dis(x=None, *, file=None, depth=None) Disassemble the *x* object. *x* can denote either a module, a class, a - method, a function, a generator, an asynchronous generator, a couroutine, + method, a function, a generator, an asynchronous generator, a coroutine, a code object, a string of source code or a byte sequence of raw bytecode. For a module, it disassembles all functions. For a class, it disassembles all methods (including class and static methods). For a code object or diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index a8cbe236d866..9dadc58b650c 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -2658,7 +2658,7 @@ of TLS/SSL. Some new TLS 1.3 features are not yet available. - TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 cipher suites are enabled by default. The method :meth:`SSLContext.set_ciphers` cannot enable or disable any TLS 1.3 - ciphers yet, but :meth:`SSLContext.get_cipers` returns them. + ciphers yet, but :meth:`SSLContext.get_ciphers` returns them. - Session tickets are no longer sent as part of the initial handshake and are handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are not compatible with TLS 1.3. diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst index 1c45b75955da..728315251e08 100644 --- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -195,7 +195,7 @@ Pack up a directory into an archive, and run it. $ python myapp.pyz -The same can be done using the :func:`create_archive` functon:: +The same can be done using the :func:`create_archive` function:: >>> import zipapp >>> zipapp.create_archive('myapp.pyz', 'myapp') diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index d5358b3efeae..fec7c620d3b8 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -1623,7 +1623,7 @@ a class variable and should not be set on instances of that class. `_.) A new :const:`~typing.TYPE_CHECKING` constant that is assumed to be -``True`` by the static type chekers, but is ``False`` at runtime. +``True`` by the static type checkers, but is ``False`` at runtime. (Contributed by Guido van Rossum in `Github #230 `_.) diff --git a/Lib/bdb.py b/Lib/bdb.py index 880ff5daf995..25c6260c47c7 100644 --- a/Lib/bdb.py +++ b/Lib/bdb.py @@ -74,7 +74,7 @@ def trace_dispatch(self, frame, event, arg): return: A function or other code block is about to return. exception: An exception has occurred. c_call: A C function is about to be called. - c_return: A C functon has returned. + c_return: A C function has returned. c_exception: A C function has raised an exception. For the Python events, specialized functions (see the dispatch_*() diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 99d4ecceaf01..96bdac44917e 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -273,7 +273,7 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s) #error "Py_SSL_DEFAULT_CIPHERS 0 needs Py_SSL_DEFAULT_CIPHER_STRING" #endif #elif PY_SSL_DEFAULT_CIPHERS == 1 -/* Python custom selection of sensible ciper suites +/* Python custom selection of sensible cipher suites * DEFAULT: OpenSSL's default cipher list. Since 1.0.2 the list is in sensible order. * !aNULL:!eNULL: really no NULL ciphers * !MD5:!3DES:!DES:!RC4:!IDEA:!SEED: no weak or broken algorithms on old OpenSSL versions. From webhook-mailer at python.org Fri Oct 5 10:35:21 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 05 Oct 2018 14:35:21 -0000 Subject: [Python-checkins] bpo-34906: Doc: Fix typos (GH-9712) Message-ID: https://github.com/python/cpython/commit/b3c4a050b7b9a07caeeb9ad74af1d3a750000422 commit: b3c4a050b7b9a07caeeb9ad74af1d3a750000422 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-05T07:35:18-07:00 summary: bpo-34906: Doc: Fix typos (GH-9712) (cherry picked from commit 07fbbfde1b300369b4f8d1cfb80045fbb23b7091) Co-authored-by: St?phane Wirtel files: M Doc/library/dis.rst M Doc/library/ssl.rst M Doc/library/zipapp.rst M Doc/whatsnew/3.6.rst M Lib/bdb.py M Modules/_ssl.c diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 4f84e5b637bf..6bbef3844de5 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -149,7 +149,7 @@ operation is being performed, so the intermediate analysis object isn't useful: .. function:: dis(x=None, *, file=None, depth=None) Disassemble the *x* object. *x* can denote either a module, a class, a - method, a function, a generator, an asynchronous generator, a couroutine, + method, a function, a generator, an asynchronous generator, a coroutine, a code object, a string of source code or a byte sequence of raw bytecode. For a module, it disassembles all functions. For a class, it disassembles all methods (including class and static methods). For a code object or diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index dd2fccc2e4bc..911b28d02346 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -2658,7 +2658,7 @@ of TLS/SSL. Some new TLS 1.3 features are not yet available. - TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 cipher suites are enabled by default. The method :meth:`SSLContext.set_ciphers` cannot enable or disable any TLS 1.3 - ciphers yet, but :meth:`SSLContext.get_cipers` returns them. + ciphers yet, but :meth:`SSLContext.get_ciphers` returns them. - Session tickets are no longer sent as part of the initial handshake and are handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are not compatible with TLS 1.3. diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst index 1c45b75955da..728315251e08 100644 --- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -195,7 +195,7 @@ Pack up a directory into an archive, and run it. $ python myapp.pyz -The same can be done using the :func:`create_archive` functon:: +The same can be done using the :func:`create_archive` function:: >>> import zipapp >>> zipapp.create_archive('myapp.pyz', 'myapp') diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index d5358b3efeae..fec7c620d3b8 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -1623,7 +1623,7 @@ a class variable and should not be set on instances of that class. `_.) A new :const:`~typing.TYPE_CHECKING` constant that is assumed to be -``True`` by the static type chekers, but is ``False`` at runtime. +``True`` by the static type checkers, but is ``False`` at runtime. (Contributed by Guido van Rossum in `Github #230 `_.) diff --git a/Lib/bdb.py b/Lib/bdb.py index 880ff5daf995..25c6260c47c7 100644 --- a/Lib/bdb.py +++ b/Lib/bdb.py @@ -74,7 +74,7 @@ def trace_dispatch(self, frame, event, arg): return: A function or other code block is about to return. exception: An exception has occurred. c_call: A C function is about to be called. - c_return: A C functon has returned. + c_return: A C function has returned. c_exception: A C function has raised an exception. For the Python events, specialized functions (see the dispatch_*() diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 3c9d46e43d94..4253e2a77201 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -273,7 +273,7 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s) #error "Py_SSL_DEFAULT_CIPHERS 0 needs Py_SSL_DEFAULT_CIPHER_STRING" #endif #elif PY_SSL_DEFAULT_CIPHERS == 1 -/* Python custom selection of sensible ciper suites +/* Python custom selection of sensible cipher suites * DEFAULT: OpenSSL's default cipher list. Since 1.0.2 the list is in sensible order. * !aNULL:!eNULL: really no NULL ciphers * !MD5:!3DES:!DES:!RC4:!IDEA:!SEED: no weak or broken algorithms on old OpenSSL versions. From webhook-mailer at python.org Fri Oct 5 11:24:16 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 05 Oct 2018 15:24:16 -0000 Subject: [Python-checkins] bpo-34825: Add more entries to os to pathlib reference table (GH-9608) Message-ID: https://github.com/python/cpython/commit/6f9c55d1c0bb399911ded00bb6b3e6f43a514ea2 commit: 6f9c55d1c0bb399911ded00bb6b3e6f43a514ea2 branch: master author: Xtreak committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-05T08:24:11-07:00 summary: bpo-34825: Add more entries to os to pathlib reference table (GH-9608) The added functions are as below : | os module | Pathlib | | ------------- | ------------- | | os.chmod | Path.chmod | | os.mkdir | Path.mkdir | | os.rename | Path.rename | | os.replace | Path.replace | | os.rmdir | Path.rmdir | | os.remove, os.unlink | Path.unlink | | os.path.samefile | Path.samefile | Thanks https://bugs.python.org/issue34825 files: M Doc/library/pathlib.rst diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index fc193000ba69..6aebe970194a 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1095,23 +1095,30 @@ Below is a table mapping various :mod:`os` functions to their corresponding overlapping use-cases, their semantics differ enough to warrant not considering them equivalent. -============================ ============================== -os and os.path pathlib -============================ ============================== -:func:`os.path.abspath` :meth:`Path.resolve` -:func:`os.getcwd` :func:`Path.cwd` -:func:`os.path.exists` :meth:`Path.exists` -:func:`os.path.expanduser` :meth:`Path.expanduser` and - :meth:`Path.home` -:func:`os.path.isdir` :meth:`Path.is_dir` -:func:`os.path.isfile` :meth:`Path.is_file` -:func:`os.path.islink` :meth:`Path.is_symlink` -:func:`os.stat` :meth:`Path.stat`, - :meth:`Path.owner`, - :meth:`Path.group` -:func:`os.path.isabs` :meth:`PurePath.is_absolute` -:func:`os.path.join` :func:`PurePath.joinpath` -:func:`os.path.basename` :data:`PurePath.name` -:func:`os.path.dirname` :data:`PurePath.parent` -:func:`os.path.splitext` :data:`PurePath.suffix` -============================ ============================== +==================================== ============================== +os and os.path pathlib +==================================== ============================== +:func:`os.path.abspath` :meth:`Path.resolve` +:func:`os.chmod` :meth:`Path.chmod` +:func:`os.mkdir` :meth:`Path.mkdir` +:func:`os.rename` :meth:`Path.rename` +:func:`os.replace` :meth:`Path.replace` +:func:`os.rmdir` :meth:`Path.rmdir` +:func:`os.remove`, :func:`os.unlink` :meth:`Path.unlink` +:func:`os.getcwd` :func:`Path.cwd` +:func:`os.path.exists` :meth:`Path.exists` +:func:`os.path.expanduser` :meth:`Path.expanduser` and + :meth:`Path.home` +:func:`os.path.isdir` :meth:`Path.is_dir` +:func:`os.path.isfile` :meth:`Path.is_file` +:func:`os.path.islink` :meth:`Path.is_symlink` +:func:`os.stat` :meth:`Path.stat`, + :meth:`Path.owner`, + :meth:`Path.group` +:func:`os.path.isabs` :meth:`PurePath.is_absolute` +:func:`os.path.join` :func:`PurePath.joinpath` +:func:`os.path.basename` :data:`PurePath.name` +:func:`os.path.dirname` :data:`PurePath.parent` +:func:`os.path.samefile` :meth:`Path.samefile` +:func:`os.path.splitext` :data:`PurePath.suffix` +==================================== ============================== From webhook-mailer at python.org Fri Oct 5 12:06:20 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Fri, 05 Oct 2018 16:06:20 -0000 Subject: [Python-checkins] bpo-34825: Add more entries to os to pathlib reference table (GH-9608) (#9717) Message-ID: https://github.com/python/cpython/commit/29c40c73143fee3612147959779b6927cd1be7e1 commit: 29c40c73143fee3612147959779b6927cd1be7e1 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Andrew Svetlov date: 2018-10-05T19:06:17+03:00 summary: bpo-34825: Add more entries to os to pathlib reference table (GH-9608) (#9717) The added functions are as below : | os module | Pathlib | | ------------- | ------------- | | os.chmod | Path.chmod | | os.mkdir | Path.mkdir | | os.rename | Path.rename | | os.replace | Path.replace | | os.rmdir | Path.rmdir | | os.remove, os.unlink | Path.unlink | | os.path.samefile | Path.samefile | Thanks https://bugs.python.org/issue34825 (cherry picked from commit 6f9c55d1c0bb399911ded00bb6b3e6f43a514ea2) Co-authored-by: Xtreak files: M Doc/library/pathlib.rst diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index ec604f681593..b4ae293d14b8 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1085,23 +1085,30 @@ Below is a table mapping various :mod:`os` functions to their corresponding overlapping use-cases, their semantics differ enough to warrant not considering them equivalent. -============================ ============================== -os and os.path pathlib -============================ ============================== -:func:`os.path.abspath` :meth:`Path.resolve` -:func:`os.getcwd` :func:`Path.cwd` -:func:`os.path.exists` :meth:`Path.exists` -:func:`os.path.expanduser` :meth:`Path.expanduser` and - :meth:`Path.home` -:func:`os.path.isdir` :meth:`Path.is_dir` -:func:`os.path.isfile` :meth:`Path.is_file` -:func:`os.path.islink` :meth:`Path.is_symlink` -:func:`os.stat` :meth:`Path.stat`, - :meth:`Path.owner`, - :meth:`Path.group` -:func:`os.path.isabs` :meth:`PurePath.is_absolute` -:func:`os.path.join` :func:`PurePath.joinpath` -:func:`os.path.basename` :data:`PurePath.name` -:func:`os.path.dirname` :data:`PurePath.parent` -:func:`os.path.splitext` :data:`PurePath.suffix` -============================ ============================== +==================================== ============================== +os and os.path pathlib +==================================== ============================== +:func:`os.path.abspath` :meth:`Path.resolve` +:func:`os.chmod` :meth:`Path.chmod` +:func:`os.mkdir` :meth:`Path.mkdir` +:func:`os.rename` :meth:`Path.rename` +:func:`os.replace` :meth:`Path.replace` +:func:`os.rmdir` :meth:`Path.rmdir` +:func:`os.remove`, :func:`os.unlink` :meth:`Path.unlink` +:func:`os.getcwd` :func:`Path.cwd` +:func:`os.path.exists` :meth:`Path.exists` +:func:`os.path.expanduser` :meth:`Path.expanduser` and + :meth:`Path.home` +:func:`os.path.isdir` :meth:`Path.is_dir` +:func:`os.path.isfile` :meth:`Path.is_file` +:func:`os.path.islink` :meth:`Path.is_symlink` +:func:`os.stat` :meth:`Path.stat`, + :meth:`Path.owner`, + :meth:`Path.group` +:func:`os.path.isabs` :meth:`PurePath.is_absolute` +:func:`os.path.join` :func:`PurePath.joinpath` +:func:`os.path.basename` :data:`PurePath.name` +:func:`os.path.dirname` :data:`PurePath.parent` +:func:`os.path.samefile` :meth:`Path.samefile` +:func:`os.path.splitext` :data:`PurePath.suffix` +==================================== ============================== From webhook-mailer at python.org Fri Oct 5 13:53:48 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 17:53:48 -0000 Subject: [Python-checkins] Simplify flags checks in sre_compile.py. (GH-9718) Message-ID: https://github.com/python/cpython/commit/491974735c51141019ae4ef0492e63a8eb716636 commit: 491974735c51141019ae4ef0492e63a8eb716636 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-05T20:53:45+03:00 summary: Simplify flags checks in sre_compile.py. (GH-9718) Flags SRE_FLAG_UNICODE and SRE_FLAG_ASCII are mutually exclusive. files: M Lib/sre_compile.py diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py index 36670427db76..c6398bfb83a5 100644 --- a/Lib/sre_compile.py +++ b/Lib/sre_compile.py @@ -80,7 +80,7 @@ def _compile(code, pattern, flags): tolower = None fixes = None if flags & SRE_FLAG_IGNORECASE and not flags & SRE_FLAG_LOCALE: - if flags & SRE_FLAG_UNICODE and not flags & SRE_FLAG_ASCII: + if flags & SRE_FLAG_UNICODE: iscased = _sre.unicode_iscased tolower = _sre.unicode_tolower fixes = _ignorecase_fixes @@ -196,7 +196,7 @@ def _compile(code, pattern, flags): av = AT_MULTILINE.get(av, av) if flags & SRE_FLAG_LOCALE: av = AT_LOCALE.get(av, av) - elif (flags & SRE_FLAG_UNICODE) and not (flags & SRE_FLAG_ASCII): + elif flags & SRE_FLAG_UNICODE: av = AT_UNICODE.get(av, av) emit(av) elif op is BRANCH: @@ -217,7 +217,7 @@ def _compile(code, pattern, flags): emit(op) if flags & SRE_FLAG_LOCALE: av = CH_LOCALE[av] - elif (flags & SRE_FLAG_UNICODE) and not (flags & SRE_FLAG_ASCII): + elif flags & SRE_FLAG_UNICODE: av = CH_UNICODE[av] emit(av) elif op is GROUPREF: @@ -265,7 +265,7 @@ def _compile_charset(charset, flags, code): elif op is CATEGORY: if flags & SRE_FLAG_LOCALE: emit(CH_LOCALE[av]) - elif (flags & SRE_FLAG_UNICODE) and not (flags & SRE_FLAG_ASCII): + elif flags & SRE_FLAG_UNICODE: emit(CH_UNICODE[av]) else: emit(av) @@ -453,7 +453,7 @@ def _generate_overlap_table(prefix): def _get_iscased(flags): if not flags & SRE_FLAG_IGNORECASE: return None - elif flags & SRE_FLAG_UNICODE and not flags & SRE_FLAG_ASCII: + elif flags & SRE_FLAG_UNICODE: return _sre.unicode_iscased else: return _sre.ascii_iscased From webhook-mailer at python.org Fri Oct 5 14:05:52 2018 From: webhook-mailer at python.org (Steve Dower) Date: Fri, 05 Oct 2018 18:05:52 -0000 Subject: [Python-checkins] bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719) Message-ID: https://github.com/python/cpython/commit/4313a293dae579f3406aa94508ff3803a79b0344 commit: 4313a293dae579f3406aa94508ff3803a79b0344 branch: master author: Steve Dower committer: GitHub date: 2018-10-05T11:05:47-07:00 summary: bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719) files: M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index f56254e38024..49a7bb6232aa 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -116,7 +116,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: vs2017-win2017 + vmImage: vs2017-win2016 strategy: matrix: diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 653f55b69b13..2d7fba9cf328 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -64,7 +64,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: vs2017-win2017 + vmImage: vs2017-win2016 strategy: matrix: From webhook-mailer at python.org Fri Oct 5 14:10:01 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 18:10:01 -0000 Subject: [Python-checkins] Use assertEqual() instead of assertEquals(). (GH-9721) Message-ID: https://github.com/python/cpython/commit/4642d5f59828e774585e9895b538b24d71b9df8e commit: 4642d5f59828e774585e9895b538b24d71b9df8e branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-05T21:09:56+03:00 summary: Use assertEqual() instead of assertEquals(). (GH-9721) Fixes warnings in tests added in bpo-32117 and bpo-34603. files: M Lib/ctypes/test/test_win32.py M Lib/test/test_grammar.py diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py index ee722704a35d..a2941f3fe078 100644 --- a/Lib/ctypes/test/test_win32.py +++ b/Lib/ctypes/test/test_win32.py @@ -68,7 +68,7 @@ class S(Structure): for i, f in enumerate(fields): value = getattr(res, f[0]) expected = bytes([ord('a') + i]) - self.assertEquals(value, expected) + self.assertEqual(value, expected) diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 462e77a0be55..9dd42b4f5dab 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -989,7 +989,7 @@ def g(): f((yield from ())) def g(): f((yield from ()), 1) # Do not require parenthesis for tuple unpacking def g(): rest = 4, 5, 6; yield 1, 2, 3, *rest - self.assertEquals(list(g()), [(1, 2, 3, 4, 5, 6)]) + self.assertEqual(list(g()), [(1, 2, 3, 4, 5, 6)]) check_syntax_error(self, "def g(): f(yield 1)") check_syntax_error(self, "def g(): f(yield 1, 1)") check_syntax_error(self, "def g(): f(yield from ())") From webhook-mailer at python.org Fri Oct 5 14:20:08 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 18:20:08 -0000 Subject: [Python-checkins] Fix a compiler warning added in bpo-34872. (GH-9722) Message-ID: https://github.com/python/cpython/commit/addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3 commit: addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-05T21:20:02+03:00 summary: Fix a compiler warning added in bpo-34872. (GH-9722) files: M Modules/_asynciomodule.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index eb503fb38c12..88986718905e 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2714,7 +2714,7 @@ task_step_impl(TaskObj *task, PyObject *exc) if (task->task_must_cancel) { PyObject *r; int is_true; - r = _PyObject_CallMethodId(fut, &PyId_cancel, NULL); + r = _PyObject_CallMethodId(result, &PyId_cancel, NULL); if (r == NULL) { return NULL; } From webhook-mailer at python.org Fri Oct 5 14:27:49 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 05 Oct 2018 18:27:49 -0000 Subject: [Python-checkins] bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719) Message-ID: https://github.com/python/cpython/commit/b57f800b351328a67b4a11a1864d39c6b9b8d39f commit: b57f800b351328a67b4a11a1864d39c6b9b8d39f branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-05T11:27:44-07:00 summary: bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719) (cherry picked from commit 4313a293dae579f3406aa94508ff3803a79b0344) Co-authored-by: Steve Dower files: M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index f56254e38024..49a7bb6232aa 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -116,7 +116,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: vs2017-win2017 + vmImage: vs2017-win2016 strategy: matrix: diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 653f55b69b13..2d7fba9cf328 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -64,7 +64,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: vs2017-win2017 + vmImage: vs2017-win2016 strategy: matrix: From webhook-mailer at python.org Fri Oct 5 14:32:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 05 Oct 2018 18:32:23 -0000 Subject: [Python-checkins] bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719) Message-ID: https://github.com/python/cpython/commit/467360eeb24525e330d653826f21f30f47481d08 commit: 467360eeb24525e330d653826f21f30f47481d08 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-05T11:32:18-07:00 summary: bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719) (cherry picked from commit 4313a293dae579f3406aa94508ff3803a79b0344) Co-authored-by: Steve Dower files: M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index f56254e38024..49a7bb6232aa 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -116,7 +116,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: vs2017-win2017 + vmImage: vs2017-win2016 strategy: matrix: diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 653f55b69b13..2d7fba9cf328 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -64,7 +64,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: vs2017-win2017 + vmImage: vs2017-win2016 strategy: matrix: From webhook-mailer at python.org Fri Oct 5 14:46:29 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 18:46:29 -0000 Subject: [Python-checkins] Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725) Message-ID: https://github.com/python/cpython/commit/6bffe50f5fff8e8a40ae32c3e9c408622a15caf6 commit: 6bffe50f5fff8e8a40ae32c3e9c408622a15caf6 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-05T21:46:24+03:00 summary: Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725) Fixes warnings in test added in bpo-34603. (cherry picked from commit 4642d5f59828e774585e9895b538b24d71b9df8e) files: M Lib/ctypes/test/test_win32.py diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py index ee722704a35d..a2941f3fe078 100644 --- a/Lib/ctypes/test/test_win32.py +++ b/Lib/ctypes/test/test_win32.py @@ -68,7 +68,7 @@ class S(Structure): for i, f in enumerate(fields): value = getattr(res, f[0]) expected = bytes([ord('a') + i]) - self.assertEquals(value, expected) + self.assertEqual(value, expected) From webhook-mailer at python.org Fri Oct 5 14:58:22 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 18:58:22 -0000 Subject: [Python-checkins] [3.7] Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726) Message-ID: https://github.com/python/cpython/commit/d9212200fe8ddb55d73b8231869cfbb32635ba92 commit: d9212200fe8ddb55d73b8231869cfbb32635ba92 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-05T21:58:15+03:00 summary: [3.7] Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726) (cherry picked from commit addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3) files: M Modules/_asynciomodule.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 9f7500a40ad1..809879ac77d3 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2663,7 +2663,7 @@ task_step_impl(TaskObj *task, PyObject *exc) if (task->task_must_cancel) { PyObject *r; int is_true; - r = _PyObject_CallMethodId(fut, &PyId_cancel, NULL); + r = _PyObject_CallMethodId(result, &PyId_cancel, NULL); if (r == NULL) { return NULL; } From webhook-mailer at python.org Fri Oct 5 15:11:26 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 19:11:26 -0000 Subject: [Python-checkins] Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725) (GH-9727) Message-ID: https://github.com/python/cpython/commit/d02490a9a9c238ed7ded1120877fdfdce16364a3 commit: d02490a9a9c238ed7ded1120877fdfdce16364a3 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Serhiy Storchaka date: 2018-10-05T22:11:21+03:00 summary: Use assertEqual() instead of assertEquals(). (GH-9721) (GH-9725) (GH-9727) Fixes warnings in test added in bpo-34603. (cherry picked from commit 4642d5f59828e774585e9895b538b24d71b9df8e) (cherry picked from commit 6bffe50f5fff8e8a40ae32c3e9c408622a15caf6) files: M Lib/ctypes/test/test_win32.py diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py index ee722704a35d..a2941f3fe078 100644 --- a/Lib/ctypes/test/test_win32.py +++ b/Lib/ctypes/test/test_win32.py @@ -68,7 +68,7 @@ class S(Structure): for i, f in enumerate(fields): value = getattr(res, f[0]) expected = bytes([ord('a') + i]) - self.assertEquals(value, expected) + self.assertEqual(value, expected) From webhook-mailer at python.org Fri Oct 5 15:15:39 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 19:15:39 -0000 Subject: [Python-checkins] Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726) (GH-9728) Message-ID: https://github.com/python/cpython/commit/dd0670f12b159eff5336d6011f046e1ccac495e1 commit: dd0670f12b159eff5336d6011f046e1ccac495e1 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Serhiy Storchaka date: 2018-10-05T22:15:36+03:00 summary: Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726) (GH-9728) (cherry picked from commit addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3) (cherry picked from commit d9212200fe8ddb55d73b8231869cfbb32635ba92) files: M Modules/_asynciomodule.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index cbd6fe3c4455..2a6c16da85b4 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2122,7 +2122,7 @@ task_step_impl(TaskObj *task, PyObject *exc) if (task->task_must_cancel) { PyObject *r; int is_true; - r = _PyObject_CallMethodId(fut, &PyId_cancel, NULL); + r = _PyObject_CallMethodId(result, &PyId_cancel, NULL); if (r == NULL) { return NULL; } From webhook-mailer at python.org Fri Oct 5 17:02:28 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 05 Oct 2018 21:02:28 -0000 Subject: [Python-checkins] bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705) Message-ID: https://github.com/python/cpython/commit/7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c commit: 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-06T00:02:23+03:00 summary: bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705) The _PyLong_FromByteArray() call in int_from_bytes_impl() was unchecked. files: M Objects/longobject.c diff --git a/Objects/longobject.c b/Objects/longobject.c index afe30bc0532a..ae3a98cc791c 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5403,7 +5403,7 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj, little_endian, is_signed); Py_DECREF(bytes); - if (type != &PyLong_Type) { + if (long_obj != NULL && type != &PyLong_Type) { Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type, long_obj, NULL)); } From webhook-mailer at python.org Fri Oct 5 17:24:30 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 05 Oct 2018 21:24:30 -0000 Subject: [Python-checkins] bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705) Message-ID: https://github.com/python/cpython/commit/526929be39e139a7d89f4c363d79c28566f30d71 commit: 526929be39e139a7d89f4c363d79c28566f30d71 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-05T14:24:25-07:00 summary: bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705) The _PyLong_FromByteArray() call in int_from_bytes_impl() was unchecked. (cherry picked from commit 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c) Co-authored-by: Zackery Spytz files: M Objects/longobject.c diff --git a/Objects/longobject.c b/Objects/longobject.c index c3c0949189d8..3864cec97a0a 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5302,7 +5302,7 @@ long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds) little_endian, is_signed); Py_DECREF(bytes); - if (type != &PyLong_Type) { + if (long_obj != NULL && type != &PyLong_Type) { Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type, long_obj, NULL)); } From webhook-mailer at python.org Fri Oct 5 17:29:00 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 05 Oct 2018 21:29:00 -0000 Subject: [Python-checkins] bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705) Message-ID: https://github.com/python/cpython/commit/1596fea0a329e1f5e4cce0135724881ca5f1d341 commit: 1596fea0a329e1f5e4cce0135724881ca5f1d341 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-05T14:28:56-07:00 summary: bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705) The _PyLong_FromByteArray() call in int_from_bytes_impl() was unchecked. (cherry picked from commit 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c) Co-authored-by: Zackery Spytz files: M Objects/longobject.c diff --git a/Objects/longobject.c b/Objects/longobject.c index 269d6cdea590..59c7efbfee2e 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5270,7 +5270,7 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj, little_endian, is_signed); Py_DECREF(bytes); - if (type != &PyLong_Type) { + if (long_obj != NULL && type != &PyLong_Type) { Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type, long_obj, NULL)); } From webhook-mailer at python.org Fri Oct 5 18:57:06 2018 From: webhook-mailer at python.org (Alexander Belopolsky) Date: Fri, 05 Oct 2018 22:57:06 -0000 Subject: [Python-checkins] bpo-34158: Documentation UTC offset update (GH-8377) Message-ID: https://github.com/python/cpython/commit/92878829c31ab2fc71c60555ce87a5f6cbc876f0 commit: 92878829c31ab2fc71c60555ce87a5f6cbc876f0 branch: master author: Christophe Nanteuil <35002064+christopheNan at users.noreply.github.com> committer: Alexander Belopolsky date: 2018-10-05T18:57:02-04:00 summary: bpo-34158: Documentation UTC offset update (GH-8377) * Documentation of UTC offset update Since changes in the UTC offset that allows sub-minute offsets, the documentation needs update: - "%z" format code documentation update Karthikeyan Singaravelan commented on bugs.python.org: Added as part of 018d353c1c8c87767d2335cd884017c2ce12e045 and a fix regarding duplicate words for that part was added at bac2d5ba30339298db7d4caa9c8cd31d807cf081. Relevant format string at https://github.com/python/cpython/pull/2896/files#diff-25e2d173c84057d069b7890450714eddR214. Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/files#diff-acc40bec51c7de832de3361db3edae52R309. Table at https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior could also be updated with microseconds being optional in the second column %z | UTC offset in the form ?HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030 - isoformat documentation update According to me, needs confirmation: Relevant format string at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714eddR176 Relevant test case at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714edd * From Martin Panter: some style improvment; >From @pganssle: using f for fractional part of seconds in all file. files: M Doc/library/datetime.rst diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 22582476cf95..7a276b139f5e 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -841,7 +841,7 @@ Other constructors, all class methods: Return a :class:`datetime` corresponding to a *date_string* in one of the formats emitted by :meth:`date.isoformat` and :meth:`datetime.isoformat`. Specifically, this function supports strings in the format(s) - ``YYYY-MM-DD[*HH[:MM[:SS[.mmm[mmm]]]][+HH:MM[:SS[.ffffff]]]]``, + ``YYYY-MM-DD[*HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]]``, where ``*`` can match any single character. .. caution:: @@ -1215,13 +1215,13 @@ Instance methods: .. method:: datetime.isoformat(sep='T', timespec='auto') Return a string representing the date and time in ISO 8601 format, - YYYY-MM-DDTHH:MM:SS.mmmmmm or, if :attr:`microsecond` is 0, + YYYY-MM-DDTHH:MM:SS.ffffff or, if :attr:`microsecond` is 0, YYYY-MM-DDTHH:MM:SS - If :meth:`utcoffset` does not return ``None``, a 6-character string is - appended, giving the UTC offset in (signed) hours and minutes: - YYYY-MM-DDTHH:MM:SS.mmmmmm+HH:MM or, if :attr:`microsecond` is 0 - YYYY-MM-DDTHH:MM:SS+HH:MM + If :meth:`utcoffset` does not return ``None``, a string is + appended, giving the UTC offset: + YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]] or, if :attr:`microsecond` + is 0 YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]. The optional argument *sep* (default ``'T'``) is a one-character separator, placed between the date and time portions of the result. For example, @@ -1245,7 +1245,7 @@ Instance methods: in HH:MM:SS format. - ``'milliseconds'``: Include full time, but truncate fractional second part to milliseconds. HH:MM:SS.sss format. - - ``'microseconds'``: Include full time in HH:MM:SS.mmmmmm format. + - ``'microseconds'``: Include full time in HH:MM:SS.ffffff format. .. note:: @@ -1522,7 +1522,7 @@ Other constructor: Return a :class:`time` corresponding to a *time_string* in one of the formats emitted by :meth:`time.isoformat`. Specifically, this function supports - strings in the format(s) ``HH[:MM[:SS[.mmm[mmm]]]][+HH:MM[:SS[.ffffff]]]``. + strings in the format(s) ``HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]``. .. caution:: @@ -1548,10 +1548,10 @@ Instance methods: .. method:: time.isoformat(timespec='auto') - Return a string representing the time in ISO 8601 format, HH:MM:SS.mmmmmm or, if + Return a string representing the time in ISO 8601 format, HH:MM:SS.ffffff or, if :attr:`microsecond` is 0, HH:MM:SS If :meth:`utcoffset` does not return ``None``, a - 6-character string is appended, giving the UTC offset in (signed) hours and - minutes: HH:MM:SS.mmmmmm+HH:MM or, if self.microsecond is 0, HH:MM:SS+HH:MM + string is appended, giving the UTC offset: HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]] + or, if self.microsecond is 0, HH:MM:SS+HH:MM[:SS[.ffffff]]. The optional argument *timespec* specifies the number of additional components of the time to include (the default is ``'auto'``). @@ -1565,7 +1565,7 @@ Instance methods: in HH:MM:SS format. - ``'milliseconds'``: Include full time, but truncate fractional second part to milliseconds. HH:MM:SS.sss format. - - ``'microseconds'``: Include full time in HH:MM:SS.mmmmmm format. + - ``'microseconds'``: Include full time in HH:MM:SS.ffffff format. .. note:: @@ -2091,9 +2091,10 @@ format codes. | | number, zero-padded on the | 999999 | | | | left. | | | +-----------+--------------------------------+------------------------+-------+ -| ``%z`` | UTC offset in the form | (empty), +0000, -0400, | \(6) | -| | ?HHMM[SS] (empty string if the | +1030 | | -| | object is naive). | | | +| ``%z`` | UTC offset in the form | (empty), +0000, | \(6) | +| | ?HHMM[SS[.ffffff]] (empty | -0400, +1030, | | +| | string if the object is | +063415, | | +| | naive). | -030712.345216 | | +-----------+--------------------------------+------------------------+-------+ | ``%Z`` | Time zone name (empty string | (empty), UTC, EST, CST | | | | if the object is naive). | | | @@ -2206,12 +2207,12 @@ Notes: ``%z`` :meth:`utcoffset` is transformed into a string of the form - ?HHMM[SS[.uuuuuu]], where HH is a 2-digit string giving the number of UTC - offset hours, and MM is a 2-digit string giving the number of UTC offset + ?HHMM[SS[.ffffff]], where HH is a 2-digit string giving the number of UTC + offset hours, MM is a 2-digit string giving the number of UTC offset minutes, SS is a 2-digit string giving the number of UTC offset - seconds and uuuuuu is a 2-digit string giving the number of UTC - offset microseconds. The uuuuuu part is omitted when the offset is a - whole number of minutes and both the uuuuuu and the SS parts are omitted + seconds and ffffff is a 6-digit string giving the number of UTC + offset microseconds. The ffffff part is omitted when the offset is a + whole number of seconds and both the ffffff and the SS part is omitted when the offset is a whole number of minutes. For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``. From webhook-mailer at python.org Fri Oct 5 22:18:44 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 06 Oct 2018 02:18:44 -0000 Subject: [Python-checkins] bpo-34565: Change a PC/launcher.c comment to accurately describe valid major versions. (GH-9037) (GH-9065) Message-ID: https://github.com/python/cpython/commit/28dd737c46d50f4952c61651426c69cc43991bfa commit: 28dd737c46d50f4952c61651426c69cc43991bfa branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-05T22:18:41-04:00 summary: bpo-34565: Change a PC/launcher.c comment to accurately describe valid major versions. (GH-9037) (GH-9065) (cherry picked from commit 3876af4f7c2ef87db6d2d83efc229955968926dd) Co-authored-by: Brendan Gerrity files: M PC/launcher.c diff --git a/PC/launcher.c b/PC/launcher.c index 4a61975b3ccf..eb3433ab53fe 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1051,7 +1051,7 @@ static BOOL validate_version(wchar_t * p) { /* - Version information should start with one of 2 or 3, + Version information should start with the major version, Optionally followed by a period and a minor version, Optionally followed by a minus and one of 32 or 64. Valid examples: @@ -1068,7 +1068,7 @@ validate_version(wchar_t * p) */ BOOL result = (p != NULL); /* Default to False if null pointer. */ - result = result && iswdigit(*p); /* Result = False if fist string element is not a digit. */ + result = result && iswdigit(*p); /* Result = False if first string element is not a digit. */ while (result && iswdigit(*p)) /* Require a major version */ ++p; /* Skip all leading digit(s) */ From webhook-mailer at python.org Fri Oct 5 22:29:20 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 06 Oct 2018 02:29:20 -0000 Subject: [Python-checkins] Clarify that AsyncExitStack works with coroutine functions (GH-9405) (GH-9408) Message-ID: https://github.com/python/cpython/commit/414d58f7450f04a12676aefbc650599930aeaca9 commit: 414d58f7450f04a12676aefbc650599930aeaca9 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-05T22:29:17-04:00 summary: Clarify that AsyncExitStack works with coroutine functions (GH-9405) (GH-9408) The docs were ambiguous about whether you pass in a coroutine function or a coroutine object, e.g. is it: aestack.push_async_exit(some_async_func) or aestack.push_async_exit(some_async_func()) (It's the first one.) (cherry picked from commit a3c88ef12c7b8993912750b56a1e095652fe47c0) Co-authored-by: Nathaniel J. Smith files: M Doc/library/contextlib.rst diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst index 7dc5b2989f9c..930c97358e08 100644 --- a/Doc/library/contextlib.rst +++ b/Doc/library/contextlib.rst @@ -471,11 +471,11 @@ Functions and classes provided: .. method:: push_async_exit(exit) Similar to :meth:`push` but expects either an asynchronous context manager - or a coroutine. + or a coroutine function. .. method:: push_async_callback(callback, *args, **kwds) - Similar to :meth:`callback` but expects a coroutine. + Similar to :meth:`callback` but expects a coroutine function. .. method:: aclose() From webhook-mailer at python.org Fri Oct 5 22:37:18 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 06 Oct 2018 02:37:18 -0000 Subject: [Python-checkins] Fix markup for xml.sax in 3.7.rst (GH-9604) Message-ID: https://github.com/python/cpython/commit/b38ff71501a8653fdc4aff7dee78680008185ab7 commit: b38ff71501a8653fdc4aff7dee78680008185ab7 branch: 3.7 author: Andr?s Delfino committer: Ned Deily date: 2018-10-05T22:37:14-04:00 summary: Fix markup for xml.sax in 3.7.rst (GH-9604) files: M Doc/whatsnew/3.7.rst diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 87a3ddbf1ecf..4b6fe8a7c944 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1586,7 +1586,7 @@ xml --- As mitigation against DTD and external entity retrieval, the -:mod:`xml.dom.minidom` and mod:`xml.sax` modules no longer process +:mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external entities by default. (Contributed by Christian Heimes in :issue:`17239`.) From webhook-mailer at python.org Fri Oct 5 22:39:50 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 06 Oct 2018 02:39:50 -0000 Subject: [Python-checkins] [3.7] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) (GH-9681) Message-ID: https://github.com/python/cpython/commit/2fcaaaca520670123224b6e84068f5e453c04f07 commit: 2fcaaaca520670123224b6e84068f5e453c04f07 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-05T22:39:47-04:00 summary: [3.7] Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680) (GH-9681) A follow up to be4e5b89204283a62e369439025f00362d0424f6. (cherry picked from commit e006b39a40e0cd6a90c68f1107853ea2ed0ed54d) Co-authored-by: Benjamin Peterson files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index da8ce4082043..83aee1b02621 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -984,7 +984,7 @@ Test cases .. method:: assertRaisesRegex(exception, regex, callable, *args, **kwds) - assertRaisesRegex(exception, regex, msg=None) + assertRaisesRegex(exception, regex, *, msg=None) Like :meth:`assertRaises` but also tests that *regex* matches on the string representation of the raised exception. *regex* may be @@ -1010,7 +1010,7 @@ Test cases .. method:: assertWarns(warning, callable, *args, **kwds) - assertWarns(warning, msg=None) + assertWarns(warning, *, msg=None) Test that a warning is triggered when *callable* is called with any positional or keyword arguments that are also passed to @@ -1051,7 +1051,7 @@ Test cases .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) - assertWarnsRegex(warning, regex, msg=None) + assertWarnsRegex(warning, regex, *, msg=None) Like :meth:`assertWarns` but also tests that *regex* matches on the message of the triggered warning. *regex* may be a regular expression From webhook-mailer at python.org Fri Oct 5 22:44:28 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 06 Oct 2018 02:44:28 -0000 Subject: [Python-checkins] [3.7] bpo-34158: Documentation UTC offset update (GH-8377) (GH-9732) Message-ID: https://github.com/python/cpython/commit/0991b9bb94036e0f271d223c8db7d81980c76736 commit: 0991b9bb94036e0f271d223c8db7d81980c76736 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-05T22:44:23-04:00 summary: [3.7] bpo-34158: Documentation UTC offset update (GH-8377) (GH-9732) * Documentation of UTC offset update Since changes in the UTC offset that allows sub-minute offsets, the documentation needs update: - "%z" format code documentation update Karthikeyan Singaravelan commented on bugs.python.org: Added as part of 018d353c1c8c87767d2335cd884017c2ce12e045 and a fix regarding duplicate words for that part was added at bac2d5ba30339298db7d4caa9c8cd31d807cf081. Relevant format string at https://github.com/python/cpython/pull/2896/filesGH-diff-25e2d173c84057d069b7890450714eddR214. Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/filesGH-diff-acc40bec51c7de832de3361db3edae52R309. Table at https://docs.python.org/3.7/library/datetime.htmlGH-strftime-and-strptime-behavior could also be updated with microseconds being optional in the second column %z | UTC offset in the form ?HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030 - isoformat documentation update According to me, needs confirmation: Relevant format string at https://github.com/python/cpython/pull/4699/filesGH-diff-25e2d173c84057d069b7890450714eddR176 Relevant test case at https://github.com/python/cpython/pull/4699/filesGH-diff-25e2d173c84057d069b7890450714edd * From Martin Panter: some style improvment; >From @pganssle: using f for fractional part of seconds in all file. (cherry picked from commit 92878829c31ab2fc71c60555ce87a5f6cbc876f0) Co-authored-by: Christophe Nanteuil <35002064+christopheNan at users.noreply.github.com> files: M Doc/library/datetime.rst diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 22582476cf95..7a276b139f5e 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -841,7 +841,7 @@ Other constructors, all class methods: Return a :class:`datetime` corresponding to a *date_string* in one of the formats emitted by :meth:`date.isoformat` and :meth:`datetime.isoformat`. Specifically, this function supports strings in the format(s) - ``YYYY-MM-DD[*HH[:MM[:SS[.mmm[mmm]]]][+HH:MM[:SS[.ffffff]]]]``, + ``YYYY-MM-DD[*HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]]``, where ``*`` can match any single character. .. caution:: @@ -1215,13 +1215,13 @@ Instance methods: .. method:: datetime.isoformat(sep='T', timespec='auto') Return a string representing the date and time in ISO 8601 format, - YYYY-MM-DDTHH:MM:SS.mmmmmm or, if :attr:`microsecond` is 0, + YYYY-MM-DDTHH:MM:SS.ffffff or, if :attr:`microsecond` is 0, YYYY-MM-DDTHH:MM:SS - If :meth:`utcoffset` does not return ``None``, a 6-character string is - appended, giving the UTC offset in (signed) hours and minutes: - YYYY-MM-DDTHH:MM:SS.mmmmmm+HH:MM or, if :attr:`microsecond` is 0 - YYYY-MM-DDTHH:MM:SS+HH:MM + If :meth:`utcoffset` does not return ``None``, a string is + appended, giving the UTC offset: + YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]] or, if :attr:`microsecond` + is 0 YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]. The optional argument *sep* (default ``'T'``) is a one-character separator, placed between the date and time portions of the result. For example, @@ -1245,7 +1245,7 @@ Instance methods: in HH:MM:SS format. - ``'milliseconds'``: Include full time, but truncate fractional second part to milliseconds. HH:MM:SS.sss format. - - ``'microseconds'``: Include full time in HH:MM:SS.mmmmmm format. + - ``'microseconds'``: Include full time in HH:MM:SS.ffffff format. .. note:: @@ -1522,7 +1522,7 @@ Other constructor: Return a :class:`time` corresponding to a *time_string* in one of the formats emitted by :meth:`time.isoformat`. Specifically, this function supports - strings in the format(s) ``HH[:MM[:SS[.mmm[mmm]]]][+HH:MM[:SS[.ffffff]]]``. + strings in the format(s) ``HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]``. .. caution:: @@ -1548,10 +1548,10 @@ Instance methods: .. method:: time.isoformat(timespec='auto') - Return a string representing the time in ISO 8601 format, HH:MM:SS.mmmmmm or, if + Return a string representing the time in ISO 8601 format, HH:MM:SS.ffffff or, if :attr:`microsecond` is 0, HH:MM:SS If :meth:`utcoffset` does not return ``None``, a - 6-character string is appended, giving the UTC offset in (signed) hours and - minutes: HH:MM:SS.mmmmmm+HH:MM or, if self.microsecond is 0, HH:MM:SS+HH:MM + string is appended, giving the UTC offset: HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]] + or, if self.microsecond is 0, HH:MM:SS+HH:MM[:SS[.ffffff]]. The optional argument *timespec* specifies the number of additional components of the time to include (the default is ``'auto'``). @@ -1565,7 +1565,7 @@ Instance methods: in HH:MM:SS format. - ``'milliseconds'``: Include full time, but truncate fractional second part to milliseconds. HH:MM:SS.sss format. - - ``'microseconds'``: Include full time in HH:MM:SS.mmmmmm format. + - ``'microseconds'``: Include full time in HH:MM:SS.ffffff format. .. note:: @@ -2091,9 +2091,10 @@ format codes. | | number, zero-padded on the | 999999 | | | | left. | | | +-----------+--------------------------------+------------------------+-------+ -| ``%z`` | UTC offset in the form | (empty), +0000, -0400, | \(6) | -| | ?HHMM[SS] (empty string if the | +1030 | | -| | object is naive). | | | +| ``%z`` | UTC offset in the form | (empty), +0000, | \(6) | +| | ?HHMM[SS[.ffffff]] (empty | -0400, +1030, | | +| | string if the object is | +063415, | | +| | naive). | -030712.345216 | | +-----------+--------------------------------+------------------------+-------+ | ``%Z`` | Time zone name (empty string | (empty), UTC, EST, CST | | | | if the object is naive). | | | @@ -2206,12 +2207,12 @@ Notes: ``%z`` :meth:`utcoffset` is transformed into a string of the form - ?HHMM[SS[.uuuuuu]], where HH is a 2-digit string giving the number of UTC - offset hours, and MM is a 2-digit string giving the number of UTC offset + ?HHMM[SS[.ffffff]], where HH is a 2-digit string giving the number of UTC + offset hours, MM is a 2-digit string giving the number of UTC offset minutes, SS is a 2-digit string giving the number of UTC offset - seconds and uuuuuu is a 2-digit string giving the number of UTC - offset microseconds. The uuuuuu part is omitted when the offset is a - whole number of minutes and both the uuuuuu and the SS parts are omitted + seconds and ffffff is a 6-digit string giving the number of UTC + offset microseconds. The ffffff part is omitted when the offset is a + whole number of seconds and both the ffffff and the SS part is omitted when the offset is a whole number of minutes. For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``. From webhook-mailer at python.org Fri Oct 5 23:10:08 2018 From: webhook-mailer at python.org (Ethan Furman) Date: Sat, 06 Oct 2018 03:10:08 -0000 Subject: [Python-checkins] [3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert (GH-9034) (GH-9229) Message-ID: https://github.com/python/cpython/commit/22e86fbbca04d251233fc07515885d2b67945094 commit: 22e86fbbca04d251233fc07515885d2b67945094 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ethan Furman date: 2018-10-05T20:10:04-07:00 summary: [3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert (GH-9034) (GH-9229) * Fix Enum._convert shadowing members named _convert Co-authored-by: orlnub123 files: A Misc/NEWS.d/next/Library/2018-09-02-13-33-35.bpo-34282.ztyXH8.rst M Lib/enum.py M Lib/test/test_enum.py diff --git a/Lib/enum.py b/Lib/enum.py index 112523e998f7..8405fa965d06 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -155,9 +155,11 @@ def __new__(metacls, cls, bases, classdict): enum_class._member_map_ = OrderedDict() # name->value map enum_class._member_type_ = member_type - # save attributes from super classes so we know if we can take - # the shortcut of storing members in the class dict - base_attributes = {a for b in enum_class.mro() for a in b.__dict__} + # save DynamicClassAttribute attributes from super classes so we know + # if we can take the shortcut of storing members in the class dict + dynamic_attributes = {k for c in enum_class.mro() + for k, v in c.__dict__.items() + if isinstance(v, DynamicClassAttribute)} # Reverse value->name map for hashable values. enum_class._value2member_map_ = {} @@ -217,7 +219,7 @@ def __new__(metacls, cls, bases, classdict): enum_class._member_names_.append(member_name) # performance boost for any member that would not shadow # a DynamicClassAttribute - if member_name not in base_attributes: + if member_name not in dynamic_attributes: setattr(enum_class, member_name, enum_member) # now add to _member_map_ enum_class._member_map_[member_name] = enum_member diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index eaea8ee3abdf..3cecee691626 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1506,6 +1506,23 @@ class MoreColor(Color): yellow = 6 self.assertEqual(MoreColor.magenta.hex(), '5 hexlified!') + def test_subclass_duplicate_name(self): + class Base(Enum): + def test(self): + pass + class Test(Base): + test = 1 + self.assertIs(type(Test.test), Test) + + def test_subclass_duplicate_name_dynamic(self): + from types import DynamicClassAttribute + class Base(Enum): + @DynamicClassAttribute + def test(self): + return 'dynamic' + class Test(Base): + test = 1 + self.assertEqual(Test.test.test, 'dynamic') def test_no_duplicates(self): class UniqueEnum(Enum): diff --git a/Misc/NEWS.d/next/Library/2018-09-02-13-33-35.bpo-34282.ztyXH8.rst b/Misc/NEWS.d/next/Library/2018-09-02-13-33-35.bpo-34282.ztyXH8.rst new file mode 100644 index 000000000000..c1e606ab0ce5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-02-13-33-35.bpo-34282.ztyXH8.rst @@ -0,0 +1 @@ +Fix enum members getting shadowed by parent attributes. From webhook-mailer at python.org Sat Oct 6 02:29:39 2018 From: webhook-mailer at python.org (Ethan Furman) Date: Sat, 06 Oct 2018 06:29:39 -0000 Subject: [Python-checkins] bpo-34909: keep searching mixins until base class is found (GH-9737) Message-ID: https://github.com/python/cpython/commit/cd45385ffad8910293e5659cfe7ab036e70613b7 commit: cd45385ffad8910293e5659cfe7ab036e70613b7 branch: master author: Ethan Furman committer: GitHub date: 2018-10-05T23:29:36-07:00 summary: bpo-34909: keep searching mixins until base class is found (GH-9737) files: M Lib/enum.py M Lib/test/test_enum.py diff --git a/Lib/enum.py b/Lib/enum.py index 0ccb30d428e4..fec1aed9b25c 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -486,7 +486,7 @@ def _find_data_type(bases): if base is object: continue elif '__new__' in base.__dict__: - if issubclass(base, Enum) and not hasattr(base, '__new_member__'): + if issubclass(base, Enum): continue return base @@ -499,7 +499,6 @@ def _find_data_type(bases): member_type = _find_data_type(bases) or object if first_enum._member_names_: raise TypeError("Cannot extend enumerations") - return member_type, first_enum @staticmethod @@ -545,7 +544,6 @@ def _find_new_(classdict, member_type, first_enum): use_args = False else: use_args = True - return __new__, save_new, use_args diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index aadc11fcc49c..216f7d5c2830 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1842,6 +1842,27 @@ class ReformedColor(StrMixin, IntEnum, SomeEnum, AnotherEnum): self.assertEqual(ConfusedColor.RED.social(), "what's up?") self.assertTrue(issubclass(ReformedColor, int)) + def test_multiple_inherited_mixin(self): + class StrEnum(str, Enum): + def __new__(cls, *args, **kwargs): + for a in args: + if not isinstance(a, str): + raise TypeError("Enumeration '%s' (%s) is not" + " a string" % (a, type(a).__name__)) + return str.__new__(cls, *args, **kwargs) + @unique + class Decision1(StrEnum): + REVERT = "REVERT" + REVERT_ALL = "REVERT_ALL" + RETRY = "RETRY" + class MyEnum(StrEnum): + pass + @unique + class Decision2(MyEnum): + REVERT = "REVERT" + REVERT_ALL = "REVERT_ALL" + RETRY = "RETRY" + class TestOrder(unittest.TestCase): From webhook-mailer at python.org Sat Oct 6 02:44:29 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 06 Oct 2018 06:44:29 -0000 Subject: [Python-checkins] bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733) Message-ID: https://github.com/python/cpython/commit/ae62f015240c9162773341a9922794e6b960779d commit: ae62f015240c9162773341a9922794e6b960779d branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-06T09:44:25+03:00 summary: bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733) files: A Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst M Objects/object.c diff --git a/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst b/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst new file mode 100644 index 000000000000..eff4755d8d5e --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst @@ -0,0 +1,2 @@ +Ensure that :c:func:`PyObject_Print` always returns ``-1`` on error. Patch +by Zackery Spytz. diff --git a/Objects/object.c b/Objects/object.c index 607f047d147d..ab1baa70d434 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -375,8 +375,9 @@ PyObject_Print(PyObject *op, FILE *fp, int flags) else if (PyUnicode_Check(s)) { PyObject *t; t = PyUnicode_AsEncodedString(s, "utf-8", "backslashreplace"); - if (t == NULL) - ret = 0; + if (t == NULL) { + ret = -1; + } else { fwrite(PyBytes_AS_STRING(t), 1, PyBytes_GET_SIZE(t), fp); From webhook-mailer at python.org Sat Oct 6 03:06:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 06 Oct 2018 07:06:58 -0000 Subject: [Python-checkins] bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733) Message-ID: https://github.com/python/cpython/commit/177254c96f9258a62e3e571c2aee0b642070a374 commit: 177254c96f9258a62e3e571c2aee0b642070a374 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-06T00:06:53-07:00 summary: bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733) (cherry picked from commit ae62f015240c9162773341a9922794e6b960779d) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst M Objects/object.c diff --git a/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst b/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst new file mode 100644 index 000000000000..eff4755d8d5e --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst @@ -0,0 +1,2 @@ +Ensure that :c:func:`PyObject_Print` always returns ``-1`` on error. Patch +by Zackery Spytz. diff --git a/Objects/object.c b/Objects/object.c index defff5579699..fdd41a61681f 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -387,8 +387,9 @@ PyObject_Print(PyObject *op, FILE *fp, int flags) else if (PyUnicode_Check(s)) { PyObject *t; t = PyUnicode_AsEncodedString(s, "utf-8", "backslashreplace"); - if (t == NULL) - ret = 0; + if (t == NULL) { + ret = -1; + } else { fwrite(PyBytes_AS_STRING(t), 1, PyBytes_GET_SIZE(t), fp); From webhook-mailer at python.org Sat Oct 6 03:07:15 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 06 Oct 2018 07:07:15 -0000 Subject: [Python-checkins] bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733) Message-ID: https://github.com/python/cpython/commit/49fb49d6f57661f2a7601f1d759163866f707fed commit: 49fb49d6f57661f2a7601f1d759163866f707fed branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-06T00:07:12-07:00 summary: bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733) (cherry picked from commit ae62f015240c9162773341a9922794e6b960779d) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst M Objects/object.c diff --git a/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst b/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst new file mode 100644 index 000000000000..eff4755d8d5e --- /dev/null +++ b/Misc/NEWS.d/next/C API/2018-10-05-17-06-49.bpo-34910.tSFrls.rst @@ -0,0 +1,2 @@ +Ensure that :c:func:`PyObject_Print` always returns ``-1`` on error. Patch +by Zackery Spytz. diff --git a/Objects/object.c b/Objects/object.c index 220aa90bf59c..5535b7ee7eca 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -376,8 +376,9 @@ PyObject_Print(PyObject *op, FILE *fp, int flags) else if (PyUnicode_Check(s)) { PyObject *t; t = PyUnicode_AsEncodedString(s, "utf-8", "backslashreplace"); - if (t == NULL) - ret = 0; + if (t == NULL) { + ret = -1; + } else { fwrite(PyBytes_AS_STRING(t), 1, PyBytes_GET_SIZE(t), fp); From webhook-mailer at python.org Sat Oct 6 03:43:24 2018 From: webhook-mailer at python.org (Ethan Furman) Date: Sat, 06 Oct 2018 07:43:24 -0000 Subject: [Python-checkins] bpo-34909: keep searching mixins until base class is found (GH-9737) (GH-9738) Message-ID: https://github.com/python/cpython/commit/453b3b0e87cb16345c276b9064a4480ce3794a74 commit: 453b3b0e87cb16345c276b9064a4480ce3794a74 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ethan Furman date: 2018-10-06T00:43:20-07:00 summary: bpo-34909: keep searching mixins until base class is found (GH-9737) (GH-9738) (cherry picked from commit cd45385ffad8910293e5659cfe7ab036e70613b7) files: M Lib/enum.py M Lib/test/test_enum.py diff --git a/Lib/enum.py b/Lib/enum.py index 4e8a56818b3c..87f36911144a 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -455,7 +455,7 @@ def _find_data_type(bases): if base is object: continue elif '__new__' in base.__dict__: - if issubclass(base, Enum) and not hasattr(base, '__new_member__'): + if issubclass(base, Enum): continue return base @@ -468,7 +468,6 @@ def _find_data_type(bases): member_type = _find_data_type(bases) or object if first_enum._member_names_: raise TypeError("Cannot extend enumerations") - return member_type, first_enum @staticmethod @@ -514,7 +513,6 @@ def _find_new_(classdict, member_type, first_enum): use_args = False else: use_args = True - return __new__, save_new, use_args diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 6c147d7ca6e1..60eabbe3d487 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1813,6 +1813,27 @@ class ReformedColor(StrMixin, IntEnum, SomeEnum, AnotherEnum): self.assertEqual(ConfusedColor.RED.social(), "what's up?") self.assertTrue(issubclass(ReformedColor, int)) + def test_multiple_inherited_mixin(self): + class StrEnum(str, Enum): + def __new__(cls, *args, **kwargs): + for a in args: + if not isinstance(a, str): + raise TypeError("Enumeration '%s' (%s) is not" + " a string" % (a, type(a).__name__)) + return str.__new__(cls, *args, **kwargs) + @unique + class Decision1(StrEnum): + REVERT = "REVERT" + REVERT_ALL = "REVERT_ALL" + RETRY = "RETRY" + class MyEnum(StrEnum): + pass + @unique + class Decision2(MyEnum): + REVERT = "REVERT" + REVERT_ALL = "REVERT_ALL" + RETRY = "RETRY" + class TestOrder(unittest.TestCase): From solipsis at pitrou.net Sat Oct 6 05:05:59 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 06 Oct 2018 09:05:59 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181006090559.1.D86160DB8495966F@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogo_p_kO', '--timeout', '7200'] From webhook-mailer at python.org Sat Oct 6 10:35:58 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sat, 06 Oct 2018 14:35:58 -0000 Subject: [Python-checkins] bpo-34906: Doc: Fix typos (2) (GH-9735) Message-ID: https://github.com/python/cpython/commit/683281f536981da395575b5a07d6761118259fd2 commit: 683281f536981da395575b5a07d6761118259fd2 branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-06T16:35:53+02:00 summary: bpo-34906: Doc: Fix typos (2) (GH-9735) Fix typos files: M Doc/whatsnew/3.3.rst M Doc/whatsnew/3.5.rst M Doc/whatsnew/3.7.rst M Lib/idlelib/NEWS.txt M Misc/HISTORY M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.0a2.rst M Misc/NEWS.d/3.5.0a3.rst M Misc/NEWS.d/3.5.0a4.rst M Misc/NEWS.d/3.5.1rc1.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.5.4rc1.rst M Misc/NEWS.d/3.6.0a1.rst M Misc/NEWS.d/3.6.0a2.rst M Misc/NEWS.d/3.6.0a3.rst M Misc/NEWS.d/3.6.0a4.rst M Misc/NEWS.d/3.6.0b1.rst M Misc/NEWS.d/3.6.2rc2.rst M Misc/NEWS.d/3.6.3rc1.rst M Misc/NEWS.d/3.6.4rc1.rst M Misc/NEWS.d/3.6.6rc1.rst M Misc/NEWS.d/3.7.0a1.rst M Misc/NEWS.d/3.7.0a3.rst M Misc/NEWS.d/3.7.0b2.rst M Misc/NEWS.d/3.7.0b3.rst M Misc/NEWS.d/3.7.0b5.rst M Misc/NEWS.d/next/Core and Builtins/2018-09-13-12-21-08.bpo-34651.v-bUeV.rst M Misc/NEWS.d/next/Documentation/2018-01-25-13-58-49.bpo-30607.4dXxiq.rst M Misc/NEWS.d/next/Documentation/2018-05-13-14-44-30.bpo-33487.iLDzFb.rst M Misc/NEWS.d/next/Library/2017-12-06-10-10-10.bpo-32221.ideco_.rst M Misc/NEWS.d/next/Library/2018-03-06-20-30-20.bpo-32999.lgFXWl.rst M Misc/NEWS.d/next/Library/2018-05-18-21-50-47.bpo-33570.7CZy4t.rst M Misc/NEWS.d/next/Library/2018-06-29-00-31-36.bpo-14117.3nvDuR.rst M Misc/NEWS.d/next/Library/2018-09-30-08-08-14.bpo-34849.NXK9Ff.rst M Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst M Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst M Modules/_ctypes/libffi_msvc/win32.c diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 0575ac9e6818..8862b37e0628 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -303,7 +303,7 @@ The launcher can also be used explicitly from the command line as the ``py`` application. Running ``py`` follows the same version selection rules as implicitly launching scripts, but a more specific version can be selected by passing appropriate arguments (such as ``-3`` to request Python 3 when -Python 2 is also installed, or ``-2.6`` to specifclly request an earlier +Python 2 is also installed, or ``-2.6`` to specifically request an earlier Python version when a more recent version is installed). In addition to the launcher, the Windows installer now includes an @@ -2386,7 +2386,7 @@ Porting Python code finder, you will need to remove keys paired with values of ``None`` **and** :class:`imp.NullImporter` to be backwards-compatible. This will lead to extra overhead on older versions of Python that re-insert ``None`` into - :attr:`sys.path_importer_cache` where it repesents the use of implicit + :attr:`sys.path_importer_cache` where it represents the use of implicit finders, but semantically it should not change anything. * :class:`importlib.abc.Finder` no longer specifies a `find_module()` abstract diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index d3aed84d250e..4eddf841dcbe 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -2471,7 +2471,7 @@ Changes in the Python API parameter to help control the ``opt-`` tag. Because of this, the *debug_override* parameter of the function is now deprecated. `.pyo` files are also no longer supported as a file argument to the Python interpreter and - thus serve no purpose when distributed on their own (i.e. sourcless code + thus serve no purpose when distributed on their own (i.e. sourceless code distribution). Due to the fact that the magic number for bytecode has changed in Python 3.5, all old `.pyo` files from previous versions of Python are invalid regardless of this PEP. diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 32704593410d..ea460b74025e 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1355,7 +1355,7 @@ feature. Instances must be created with :class:`~ssl.SSLContext` methods OpenSSL 1.1 APIs for setting the minimum and maximum TLS protocol version are available as :attr:`SSLContext.minimum_version ` and :attr:`SSLContext.maximum_version `. -Supported protocols are indicated by serveral new flags, such as +Supported protocols are indicated by several new flags, such as :data:`~ssl.HAS_TLSv1_1`. (Contributed by Christian Heimes in :issue:`32609`.) @@ -2023,7 +2023,7 @@ Use :mod:`threading` instead. socket ------ -The silent argument value trunctation in :func:`socket.htons` and +The silent argument value truncation in :func:`socket.htons` and :func:`socket.ntohs` has been deprecated. In future versions of Python, if the passed argument is larger than 16 bits, an exception will be raised. (Contributed by Oren Milman in :issue:`28332`.) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 5b4e4f8c953b..f59095cda261 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -222,7 +222,7 @@ To see the example in action, enable it on options extensions tab. bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. bpo-31414: Fix tk entry box tests by deleting first. Adding to an int entry is not the same as deleting and inserting @@ -460,7 +460,7 @@ Released on 2016-12-23 -w option but without -jn. Fix warning from test_config. - Issue #27621: Put query response validation error messages in the query - box itself instead of in a separate massagebox. Redo tests to match. + box itself instead of in a separate messagebox. Redo tests to match. Add Mac OSX refinements. Original patch by Mark Roseman. - Issue #27620: Escape key now closes Query box as cancelled. @@ -526,7 +526,7 @@ Released on 2016-12-23 - Issue #27239: idlelib.macosx.isXyzTk functions initialize as needed. -- Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx. +- Issue #27262: move Aqua unbinding code, which enable context menus, to macosx. - Issue #24759: Make clear in idlelib.idle_test.__init__ that the directory is a private implementation of test.test_idle and tool for maintainers. diff --git a/Misc/HISTORY b/Misc/HISTORY index d4a1b16a7c04..f4b756cf0a46 100644 --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -629,7 +629,7 @@ Library - Issue #21560: An attempt to write a data of wrong type no longer cause GzipFile corruption. Original patch by Wolfgang Maier. -- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes. +- Issue #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. - Issue #23539: If body is None, http.client.HTTPConnection.request now sets Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from @@ -677,7 +677,7 @@ Library - Issue #23521: Corrected pure python implementation of timedelta division. * Eliminated OverflowError from timedelta * float for some floats; - * Corrected rounding in timedlta true division. + * Corrected rounding in timedelta true division. - Issue #21619: Popen objects no longer leave a zombie after exit in the with statement if the pipe was broken. Patch by Martin Panter. @@ -966,7 +966,7 @@ Core and Builtins returned NotImplemented. Original patch by Martin Panter. - Issue #23321: Fixed a crash in str.decode() when error handler returned - replacment string longer than mailformed input data. + replacement string longer than malformed input data. - Issue #23048: Fix jumping out of an infinite while loop in the pdb. @@ -1042,7 +1042,7 @@ Library - Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" as they are written in the standard. -- Issue #23063: In the disutils' check command, fix parsing of reST with code or +- Issue #23063: In the distutils' check command, fix parsing of reST with code or code-block directives. - Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal @@ -9956,7 +9956,7 @@ Library ensure that it will be found regardless of the shell PATH. This ensures that multiprocessing.cpu_count works on default installs of MacOSX. -- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is +- Issue #11501: distutils.archive_utils.make_zipfile no longer fails if zlib is not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart. diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index f5e1e5ae05d2..7eb8326a012f 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -75,8 +75,8 @@ NotImplemented. Original patch by Martin Panter. .. nonce: HQelge .. section: Core and Builtins -Fixed a crash in str.decode() when error handler returned replacment string -longer than mailformed input data. +Fixed a crash in str.decode() when error handler returned replacement string +longer than malformed input data. .. @@ -998,7 +998,7 @@ written in the standard. .. nonce: 9-UJRs .. section: Library -In the disutils' check command, fix parsing of reST with code or code-block +In the distutils' check command, fix parsing of reST with code or code-block directives. .. @@ -2877,7 +2877,7 @@ closed socket. repr(socket.socket) already works fine. .. nonce: nkBNci .. section: Library -Reprs of most Python implemened classes now contain actual class name +Reprs of most Python implemented classes now contain actual class name instead of hardcoded one. .. @@ -3036,7 +3036,7 @@ by Phil Elson. os.read() now uses a :c:func:`Py_ssize_t` type instead of :c:type:`int` for the size to support reading more than 2 GB at once. On Windows, the size is -truncted to INT_MAX. As any call to os.read(), the OS may read less bytes +truncated to INT_MAX. As any call to os.read(), the OS may read less bytes than the number of requested bytes. .. diff --git a/Misc/NEWS.d/3.5.0a2.rst b/Misc/NEWS.d/3.5.0a2.rst index 80bf9e8e556a..b16acdb3822d 100644 --- a/Misc/NEWS.d/3.5.0a2.rst +++ b/Misc/NEWS.d/3.5.0a2.rst @@ -114,7 +114,7 @@ Lawrence. Corrected pure python implementation of timedelta division. Eliminated OverflowError from ``timedelta * float`` for some floats; -Corrected rounding in timedlta true division. +Corrected rounding in timedelta true division. .. diff --git a/Misc/NEWS.d/3.5.0a3.rst b/Misc/NEWS.d/3.5.0a3.rst index 2c62799dab67..0e5d7c599d32 100644 --- a/Misc/NEWS.d/3.5.0a3.rst +++ b/Misc/NEWS.d/3.5.0a3.rst @@ -239,7 +239,7 @@ Added support for writing ZIP files to unseekable streams. .. nonce: pX2qrx .. section: Library -Increase impalib's MAXLINE to accommodate modern mailbox sizes. +Increase imaplib's MAXLINE to accommodate modern mailbox sizes. .. diff --git a/Misc/NEWS.d/3.5.0a4.rst b/Misc/NEWS.d/3.5.0a4.rst index 9b162bb5f86a..eb63a834f07f 100644 --- a/Misc/NEWS.d/3.5.0a4.rst +++ b/Misc/NEWS.d/3.5.0a4.rst @@ -482,7 +482,7 @@ sqlite3.Row now supports slice indexing. .. nonce: 89RHm- .. section: Library -Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambigious reverse +Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambiguous reverse mappings. Added many new mappings. Import mapping is no longer applied to modules already mapped with full name mapping. diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst index bb2d84a01099..efefaa14fdaa 100644 --- a/Misc/NEWS.d/3.5.1rc1.rst +++ b/Misc/NEWS.d/3.5.1rc1.rst @@ -191,7 +191,7 @@ comprehensions correspond to the opening brace. Hide the private _Py_atomic_xxx symbols from the public Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() becomes an alias to -PyThreadState_Get() to avoid ABI incompatibilies. +PyThreadState_Get() to avoid ABI incompatibilities. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 6a07020c0ac4..3d513b3b9af8 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -1366,7 +1366,7 @@ fileinput now uses sys.stdin as-is if it does not have a buffer attribute .. nonce: AtHkWA .. section: Library -Copying the lru_cache() wrapper object now always works, independedly from +Copying the lru_cache() wrapper object now always works, independently from the type of the wrapped object (by returning the original object unchanged). .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index 99b4675ed5e0..bca43c8f708f 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -1036,7 +1036,7 @@ attack (CVE-2016-2183). .. nonce: WI70Tc .. section: Library -Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL +Add ChaCha20 Poly1305 to ssl module's default cipher list. (Required OpenSSL 1.1.0 or LibreSSL). .. diff --git a/Misc/NEWS.d/3.5.4rc1.rst b/Misc/NEWS.d/3.5.4rc1.rst index 5678ff247d0d..0eb85d1d7cfe 100644 --- a/Misc/NEWS.d/3.5.4rc1.rst +++ b/Misc/NEWS.d/3.5.4rc1.rst @@ -36,7 +36,7 @@ already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). .. diff --git a/Misc/NEWS.d/3.6.0a1.rst b/Misc/NEWS.d/3.6.0a1.rst index 62bfd4e2ef55..254d36166450 100644 --- a/Misc/NEWS.d/3.6.0a1.rst +++ b/Misc/NEWS.d/3.6.0a1.rst @@ -2684,7 +2684,7 @@ pickletools.dis() now outputs implicit memo index for the MEMOIZE opcode. .. nonce: ebqGy- .. section: Library -Add an optional newline paramer to binascii.b2a_base64(). base64.b64encode() +Add an optional newline parameter to binascii.b2a_base64(). base64.b64encode() uses it to avoid a memory copy. .. @@ -3938,4 +3938,4 @@ programming bugs. ValueError is now raised instead of TypeError on buffer overflow in parsing "es#" and "et#" format units. SystemError is now raised instead of -TypeError on programmical error in parsing format string. +TypeError on programmatical error in parsing format string. diff --git a/Misc/NEWS.d/3.6.0a2.rst b/Misc/NEWS.d/3.6.0a2.rst index 46387a5c0b15..9e7326bc5c2e 100644 --- a/Misc/NEWS.d/3.6.0a2.rst +++ b/Misc/NEWS.d/3.6.0a2.rst @@ -126,7 +126,7 @@ work at runtime anyway. .. nonce: ffzxpX .. section: Library -Generated names for Tkinter widgets are now more meanful and recognizirable. +Generated names for Tkinter widgets are now more meaningful and recognizable. .. @@ -516,7 +516,7 @@ are added to cover changes. IDLE requires tk 8.5 and availability ttk widgets. Delete now unneeded tk version tests and code for older versions. Add test for IDLE syntax -colorizoer. +colorizer. .. @@ -534,7 +534,7 @@ idlelib.macosx.isXyzTk functions initialize as needed. .. nonce: t7ckly .. section: IDLE -move Aqua unbinding code, which enable context menus, to maxosx. +move Aqua unbinding code, which enable context menus, to macosx. .. diff --git a/Misc/NEWS.d/3.6.0a3.rst b/Misc/NEWS.d/3.6.0a3.rst index 251e6aa0e128..2ca258038bb8 100644 --- a/Misc/NEWS.d/3.6.0a3.rst +++ b/Misc/NEWS.d/3.6.0a3.rst @@ -476,7 +476,7 @@ Update Windows builds to use OpenSSL 1.0.2h. Rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install the -platform specifc _sysconfigdata module into the platform directory and +platform specific _sysconfigdata module into the platform directory and rename it to include the ABIFLAGS. .. diff --git a/Misc/NEWS.d/3.6.0a4.rst b/Misc/NEWS.d/3.6.0a4.rst index 07e20e46fdf3..0be9c8219777 100644 --- a/Misc/NEWS.d/3.6.0a4.rst +++ b/Misc/NEWS.d/3.6.0a4.rst @@ -487,7 +487,7 @@ without -jn. Fix warning from test_config. .. section: IDLE Put query response validation error messages in the query box itself instead -of in a separate massagebox. Redo tests to match. Add Mac OSX refinements. +of in a separate messagebox. Redo tests to match. Add Mac OSX refinements. Original patch by Mark Roseman. .. diff --git a/Misc/NEWS.d/3.6.0b1.rst b/Misc/NEWS.d/3.6.0b1.rst index 476059f1d4a7..f151557dcc2c 100644 --- a/Misc/NEWS.d/3.6.0b1.rst +++ b/Misc/NEWS.d/3.6.0b1.rst @@ -958,7 +958,7 @@ attack (CVE-2016-2183). .. nonce: WI70Tc .. section: Library -Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL +Add ChaCha20 Poly1305 to ssl module's default cipher list. (Required OpenSSL 1.1.0 or LibreSSL). .. diff --git a/Misc/NEWS.d/3.6.2rc2.rst b/Misc/NEWS.d/3.6.2rc2.rst index 45be03eb5fa4..8c6545f6dbbe 100644 --- a/Misc/NEWS.d/3.6.2rc2.rst +++ b/Misc/NEWS.d/3.6.2rc2.rst @@ -36,4 +36,4 @@ Python already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). diff --git a/Misc/NEWS.d/3.6.3rc1.rst b/Misc/NEWS.d/3.6.3rc1.rst index 2fc3c08579b5..ca812c63eed9 100644 --- a/Misc/NEWS.d/3.6.3rc1.rst +++ b/Misc/NEWS.d/3.6.3rc1.rst @@ -517,7 +517,7 @@ LF. Patch by Dong-hee Na. .. section: Library multiprocessing.Queue.get() with a timeout now polls its reader in -non-blocking mode if it succeeded to aquire the lock but the acquire took +non-blocking mode if it succeeded to acquire the lock but the acquire took longer than the timeout. .. @@ -818,7 +818,7 @@ IDLE - make tests pass with zzdummy extension disabled by default. Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. .. @@ -837,7 +837,7 @@ not the same as deleting and inserting because int('') will fail. .. nonce: 50Jp_Q .. section: IDLE -Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. +Rearrange IDLE configdialog GenPage into Window, Editor, and Help sections. .. diff --git a/Misc/NEWS.d/3.6.4rc1.rst b/Misc/NEWS.d/3.6.4rc1.rst index c91cc62159fd..ff7110f88b23 100644 --- a/Misc/NEWS.d/3.6.4rc1.rst +++ b/Misc/NEWS.d/3.6.4rc1.rst @@ -758,7 +758,7 @@ interruptions. If it crashes, restart it when necessary. .. nonce: 91mhWm .. section: Documentation -Added asyncio.BaseEventLoop.connect_accepted_socket versionaddded marker. +Added asyncio.BaseEventLoop.connect_accepted_socket versionadded marker. .. @@ -974,7 +974,7 @@ Cheryl Sabella. .. nonce: VuSA_e .. section: IDLE -IDLE -- Restrict shell prompt manipulaton to the shell. Editor and output +IDLE -- Restrict shell prompt manipulation to the shell. Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed. diff --git a/Misc/NEWS.d/3.6.6rc1.rst b/Misc/NEWS.d/3.6.6rc1.rst index 85428d8245e1..f6038768bd40 100644 --- a/Misc/NEWS.d/3.6.6rc1.rst +++ b/Misc/NEWS.d/3.6.6rc1.rst @@ -861,7 +861,7 @@ Fix pystackv and pystack gdbinit macros. .. nonce: dL5x7C .. section: Tools/Demos -Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable automatic backup creation (files with ``~`` suffix). .. diff --git a/Misc/NEWS.d/3.7.0a1.rst b/Misc/NEWS.d/3.7.0a1.rst index 2f4e75045310..0c13bf022e60 100644 --- a/Misc/NEWS.d/3.7.0a1.rst +++ b/Misc/NEWS.d/3.7.0a1.rst @@ -65,7 +65,7 @@ already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). .. @@ -3406,7 +3406,7 @@ Patch by Nikolay Kim. .. nonce: 4f5gbp .. section: Library -urrlib.parse.quote is now based on RFC 3986 and hence includes '~' in the +urllib.parse.quote is now based on RFC 3986 and hence includes '~' in the set of characters that is not quoted by default. Patch by Christian Theune and Ratnadeep Debnath. @@ -5711,7 +5711,7 @@ IDLE - make tests pass with zzdummy extension disabled by default. Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. .. @@ -5730,7 +5730,7 @@ not the same as deleting and inserting because int('') will fail. .. nonce: 50Jp_Q .. section: IDLE -Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. +Rearrange IDLE configdialog GenPage into Window, Editor, and Help sections. .. diff --git a/Misc/NEWS.d/3.7.0a3.rst b/Misc/NEWS.d/3.7.0a3.rst index f8ab97c553ef..176441e2b0e7 100644 --- a/Misc/NEWS.d/3.7.0a3.rst +++ b/Misc/NEWS.d/3.7.0a3.rst @@ -636,7 +636,7 @@ if closing the file from another thread. Formally deprecated aifc.openfp, sunau.openfp, and wave.openfp. Since change 7bc817d5ba917528e8bd07ec461c635291e7b06a in 1993, openfp in each of the -three modules had been pointing to that module's open funciton as a matter +three modules had been pointing to that module's open function as a matter of backwards compatibility, though it had been both untested and undocumented. @@ -809,7 +809,7 @@ Fixed building the curses module on NetBSD. .. nonce: bjhre9 .. section: Library -added required constants to subprocess module for setting priotity on +added required constants to subprocess module for setting priority on windows .. @@ -1217,7 +1217,7 @@ Add HTTP/2 status code 421 (Misdirected Request) to .. nonce: 91mhWm .. section: Documentation -Added asyncio.BaseEventLoop.connect_accepted_socket versionaddded marker. +Added asyncio.BaseEventLoop.connect_accepted_socket versionadded marker. .. @@ -1494,7 +1494,7 @@ Cheryl Sabella. .. nonce: VuSA_e .. section: IDLE -IDLE -- Restrict shell prompt manipulaton to the shell. Editor and output +IDLE -- Restrict shell prompt manipulation to the shell. Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed. diff --git a/Misc/NEWS.d/3.7.0b2.rst b/Misc/NEWS.d/3.7.0b2.rst index 7d137128b5b3..10d00a5033a4 100644 --- a/Misc/NEWS.d/3.7.0b2.rst +++ b/Misc/NEWS.d/3.7.0b2.rst @@ -399,7 +399,7 @@ Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D Moore. .. nonce: ideco_ .. section: Library -Various functions returning tuple containig IPv6 addresses now omit +Various functions returning tuple containing IPv6 addresses now omit ``%scope`` part since the same information is already encoded in *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` when it receives multicast packet since useless resolving of network interface name diff --git a/Misc/NEWS.d/3.7.0b3.rst b/Misc/NEWS.d/3.7.0b3.rst index fc5492c36c48..547fb50f5ecf 100644 --- a/Misc/NEWS.d/3.7.0b3.rst +++ b/Misc/NEWS.d/3.7.0b3.rst @@ -295,7 +295,7 @@ only 1 bit left for addresses. .. nonce: lgFXWl .. section: Library -Fix C implemetation of ``ABC.__subclasscheck__(cls, subclass)`` crashed when +Fix C implementation of ``ABC.__subclasscheck__(cls, subclass)`` crashed when ``subclass`` is not a type object. .. @@ -517,7 +517,7 @@ Simplify and rename StringTranslatePseudoMapping in pyparse. .. nonce: dL5x7C .. section: Tools/Demos -Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable automatic backup creation (files with ``~`` suffix). .. diff --git a/Misc/NEWS.d/3.7.0b5.rst b/Misc/NEWS.d/3.7.0b5.rst index b420496cedd2..4fe3ed59fc9b 100644 --- a/Misc/NEWS.d/3.7.0b5.rst +++ b/Misc/NEWS.d/3.7.0b5.rst @@ -244,7 +244,7 @@ Based on patch by c-fos. .. section: Library Change TLS 1.3 cipher suite settings for compatibility with OpenSSL -1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by +1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers enabled by default. .. diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-13-12-21-08.bpo-34651.v-bUeV.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-13-12-21-08.bpo-34651.v-bUeV.rst index a3f0132fc1d6..6f71bc30eb6f 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2018-09-13-12-21-08.bpo-34651.v-bUeV.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-13-12-21-08.bpo-34651.v-bUeV.rst @@ -1,3 +1,3 @@ Only allow the main interpreter to fork. The avoids the possibility of -affecting the main interprerter, which is critical to operation of the +affecting the main interpreter, which is critical to operation of the runtime. diff --git a/Misc/NEWS.d/next/Documentation/2018-01-25-13-58-49.bpo-30607.4dXxiq.rst b/Misc/NEWS.d/next/Documentation/2018-01-25-13-58-49.bpo-30607.4dXxiq.rst index 8ff3b7887810..85e6303fe443 100644 --- a/Misc/NEWS.d/next/Documentation/2018-01-25-13-58-49.bpo-30607.4dXxiq.rst +++ b/Misc/NEWS.d/next/Documentation/2018-01-25-13-58-49.bpo-30607.4dXxiq.rst @@ -1,2 +1,2 @@ Use the externalized ``python-docs-theme`` package when building the -documenation. +documentation. diff --git a/Misc/NEWS.d/next/Documentation/2018-05-13-14-44-30.bpo-33487.iLDzFb.rst b/Misc/NEWS.d/next/Documentation/2018-05-13-14-44-30.bpo-33487.iLDzFb.rst index 0439d983d1bc..3a2ac64dded8 100644 --- a/Misc/NEWS.d/next/Documentation/2018-05-13-14-44-30.bpo-33487.iLDzFb.rst +++ b/Misc/NEWS.d/next/Documentation/2018-05-13-14-44-30.bpo-33487.iLDzFb.rst @@ -1,3 +1,3 @@ BZ2file now emit a DeprecationWarning when buffering=None is passed, the -deprecation message and documentation also now explicitely state it is +deprecation message and documentation also now explicitly state it is deprecated since 3.0. diff --git a/Misc/NEWS.d/next/Library/2017-12-06-10-10-10.bpo-32221.ideco_.rst b/Misc/NEWS.d/next/Library/2017-12-06-10-10-10.bpo-32221.ideco_.rst index a88dcf48e02b..b45bb1b5417c 100644 --- a/Misc/NEWS.d/next/Library/2017-12-06-10-10-10.bpo-32221.ideco_.rst +++ b/Misc/NEWS.d/next/Library/2017-12-06-10-10-10.bpo-32221.ideco_.rst @@ -1,4 +1,4 @@ -Various functions returning tuple containig IPv6 addresses now omit ``%scope`` +Various functions returning tuple containing IPv6 addresses now omit ``%scope`` part since the same information is already encoded in *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` when it receives multicast packet since useless resolving of network interface name is omitted. diff --git a/Misc/NEWS.d/next/Library/2018-03-06-20-30-20.bpo-32999.lgFXWl.rst b/Misc/NEWS.d/next/Library/2018-03-06-20-30-20.bpo-32999.lgFXWl.rst index 45e75f939310..e2e3dedbea84 100644 --- a/Misc/NEWS.d/next/Library/2018-03-06-20-30-20.bpo-32999.lgFXWl.rst +++ b/Misc/NEWS.d/next/Library/2018-03-06-20-30-20.bpo-32999.lgFXWl.rst @@ -1,2 +1,2 @@ -Fix C implemetation of ``ABC.__subclasscheck__(cls, subclass)`` crashed when +Fix C implementation of ``ABC.__subclasscheck__(cls, subclass)`` crashed when ``subclass`` is not a type object. diff --git a/Misc/NEWS.d/next/Library/2018-05-18-21-50-47.bpo-33570.7CZy4t.rst b/Misc/NEWS.d/next/Library/2018-05-18-21-50-47.bpo-33570.7CZy4t.rst index bd719a47e8f8..1c43cb3f9d9f 100644 --- a/Misc/NEWS.d/next/Library/2018-05-18-21-50-47.bpo-33570.7CZy4t.rst +++ b/Misc/NEWS.d/next/Library/2018-05-18-21-50-47.bpo-33570.7CZy4t.rst @@ -1,3 +1,3 @@ Change TLS 1.3 cipher suite settings for compatibility with OpenSSL -1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by +1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers enabled by default. diff --git a/Misc/NEWS.d/next/Library/2018-06-29-00-31-36.bpo-14117.3nvDuR.rst b/Misc/NEWS.d/next/Library/2018-06-29-00-31-36.bpo-14117.3nvDuR.rst index eee55f24c811..13cabd4a43c4 100644 --- a/Misc/NEWS.d/next/Library/2018-06-29-00-31-36.bpo-14117.3nvDuR.rst +++ b/Misc/NEWS.d/next/Library/2018-06-29-00-31-36.bpo-14117.3nvDuR.rst @@ -1,3 +1,3 @@ Make minor tweaks to turtledemo. The 'wikipedia' example is now 'rosette', -decribing what it draws. The 'penrose' print output is reduced. The'1024' +describing what it draws. The 'penrose' print output is reduced. The'1024' output of 'tree' is eliminated. diff --git a/Misc/NEWS.d/next/Library/2018-09-30-08-08-14.bpo-34849.NXK9Ff.rst b/Misc/NEWS.d/next/Library/2018-09-30-08-08-14.bpo-34849.NXK9Ff.rst index 6f5321ce4cf7..b92e2f05749b 100644 --- a/Misc/NEWS.d/next/Library/2018-09-30-08-08-14.bpo-34849.NXK9Ff.rst +++ b/Misc/NEWS.d/next/Library/2018-09-30-08-08-14.bpo-34849.NXK9Ff.rst @@ -1,3 +1,3 @@ -Don't log wating for ``selector.select`` in asyncio loop iteration. The +Don't log waiting for ``selector.select`` in asyncio loop iteration. The waiting is pretty normal for any asyncio program, logging its time just adds a noise to logs without any useful information provided. diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst b/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst index e003e1d84fd0..ef069fcbb4e8 100644 --- a/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst +++ b/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst @@ -1,2 +1,2 @@ -Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable automatic backup creation (files with ``~`` suffix). diff --git a/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst b/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst index a59efc737f53..a35251a149bb 100644 --- a/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst +++ b/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst @@ -1,3 +1,3 @@ -Fix bug where :meth:`datetime.fromtimestamp` erronously throws an +Fix bug where :meth:`datetime.fromtimestamp` erroneously throws an :exc:`OSError` on Windows for values between 0 and 86400. Patch by Ammar Askar. diff --git a/Modules/_ctypes/libffi_msvc/win32.c b/Modules/_ctypes/libffi_msvc/win32.c index d1149a85eb42..f44a5fe3697c 100644 --- a/Modules/_ctypes/libffi_msvc/win32.c +++ b/Modules/_ctypes/libffi_msvc/win32.c @@ -90,7 +90,7 @@ ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ // If the return value pointer is NULL, assume no return value. /* - Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, + Intel asm is weird. We have to explicitly specify 'DWORD PTR' in the next instruction, otherwise only one BYTE will be compared (instead of a DWORD)! */ cmp DWORD PTR [ebp + 24], 0 From webhook-mailer at python.org Sat Oct 6 13:41:50 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 06 Oct 2018 17:41:50 -0000 Subject: [Python-checkins] bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) Message-ID: https://github.com/python/cpython/commit/365ad2ead5bbaf7a3b18648ffa36e819559d3f75 commit: 365ad2ead5bbaf7a3b18648ffa36e819559d3f75 branch: master author: Zackery Spytz committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-06T10:41:45-07:00 summary: bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) On failure, _PyBytes_Resize() will deallocate the bytes object and set "result" to NULL. https://bugs.python.org/issue34824 files: A Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst M Modules/_ssl.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst new file mode 100644 index 000000000000..fe95b8973c09 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst @@ -0,0 +1,2 @@ +Fix a possible null pointer dereference in Modules/_ssl.c. Patch by Zackery +Spytz. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 96bdac44917e..93498f475609 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4710,12 +4710,17 @@ _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len) return result; nbytes = BIO_read(self->bio, PyBytes_AS_STRING(result), len); - /* There should never be any short reads but check anyway. */ - if ((nbytes < len) && (_PyBytes_Resize(&result, len) < 0)) { + if (nbytes < 0) { Py_DECREF(result); + _setSSLError(NULL, 0, __FILE__, __LINE__); return NULL; } + /* There should never be any short reads but check anyway. */ + if (nbytes < len) { + _PyBytes_Resize(&result, nbytes); + } + return result; } From webhook-mailer at python.org Sat Oct 6 15:48:42 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 06 Oct 2018 19:48:42 -0000 Subject: [Python-checkins] Correct grammar mistake in re.rst. (GH-9745) Message-ID: https://github.com/python/cpython/commit/7dfbd4967121ef6ecabe3fd53a430fd949f405fd commit: 7dfbd4967121ef6ecabe3fd53a430fd949f405fd branch: master author: Andr?s Delfino committer: Serhiy Storchaka date: 2018-10-06T22:48:30+03:00 summary: Correct grammar mistake in re.rst. (GH-9745) files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 75119a0a35f3..e90840d9acc1 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -204,7 +204,7 @@ The special characters are: Standard #18`_ might be added in the future. This would change the syntax, so to facilitate this change a :exc:`FutureWarning` will be raised in ambiguous cases for the time being. - That include sets starting with a literal ``'['`` or containing literal + That includes sets starting with a literal ``'['`` or containing literal character sequences ``'--'``, ``'&&'``, ``'~~'``, and ``'||'``. To avoid a warning escape them with a backslash. From webhook-mailer at python.org Sat Oct 6 15:56:49 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 06 Oct 2018 19:56:49 -0000 Subject: [Python-checkins] Correct grammar mistake in re.rst. (GH-9745) Message-ID: https://github.com/python/cpython/commit/4322b8dd0fa4a9d14a54a50e4aedf40777d9a029 commit: 4322b8dd0fa4a9d14a54a50e4aedf40777d9a029 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-06T12:56:45-07:00 summary: Correct grammar mistake in re.rst. (GH-9745) (cherry picked from commit 7dfbd4967121ef6ecabe3fd53a430fd949f405fd) Co-authored-by: Andr?s Delfino files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 8228d9129960..cc3516acfae7 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -204,7 +204,7 @@ The special characters are: Standard #18`_ might be added in the future. This would change the syntax, so to facilitate this change a :exc:`FutureWarning` will be raised in ambiguous cases for the time being. - That include sets starting with a literal ``'['`` or containing literal + That includes sets starting with a literal ``'['`` or containing literal character sequences ``'--'``, ``'&&'``, ``'~~'``, and ``'||'``. To avoid a warning escape them with a backslash. From webhook-mailer at python.org Sun Oct 7 00:33:43 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sun, 07 Oct 2018 04:33:43 -0000 Subject: [Python-checkins] bpo-34334: Don't log traceback twice in QueueHandler (GH-9537) (GH-9581) Message-ID: https://github.com/python/cpython/commit/1a2189353f744f79a43511707c090c3807a4978e commit: 1a2189353f744f79a43511707c090c3807a4978e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-07T00:33:37-04:00 summary: bpo-34334: Don't log traceback twice in QueueHandler (GH-9537) (GH-9581) (cherry picked from commit d345bb4d9b6e16c681cd8a4e1fff94ecd6b0bb09) Co-authored-by: Cheryl Sabella files: A Misc/NEWS.d/next/Library/2018-09-25-08-42-34.bpo-34334.rSPBW9.rst M Doc/library/logging.handlers.rst M Lib/logging/handlers.py M Lib/test/test_logging.py diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst index bdf16a8177e9..dee9a84e3337 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -973,9 +973,9 @@ possible, while any potentially slow operations (such as sending an email via Prepares a record for queuing. The object returned by this method is enqueued. - The base implementation formats the record to merge the message - and arguments, and removes unpickleable items from the record - in-place. + The base implementation formats the record to merge the message, + arguments, and exception information, if present. It also + removes unpickleable items from the record in-place. You might want to override this method if you want to convert the record to a dict or JSON string, or send a modified copy diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 974c089d40ec..e213e438c31a 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1374,13 +1374,14 @@ def prepare(self, record): # (if there's exception data), and also returns the formatted # message. We can then use this to replace the original # msg + args, as these might be unpickleable. We also zap the - # exc_info attribute, as it's no longer needed and, if not None, - # will typically not be pickleable. + # exc_info and exc_text attributes, as they are no longer + # needed and, if not None, will typically not be pickleable. msg = self.format(record) record.message = msg record.msg = msg record.args = None record.exc_info = None + record.exc_text = None return record def emit(self, record): diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 13f49f6cc305..5d5eba735745 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -3278,6 +3278,21 @@ def test_queue_listener(self): self.assertFalse(handler.matches(levelno=logging.WARNING, message='4')) self.assertFalse(handler.matches(levelno=logging.ERROR, message='5')) self.assertTrue(handler.matches(levelno=logging.CRITICAL, message='6')) + handler.close() + + @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'), + 'logging.handlers.QueueListener required for this test') + def test_queue_listener_with_StreamHandler(self): + # Test that traceback only appends once (bpo-34334). + listener = logging.handlers.QueueListener(self.queue, self.root_hdlr) + listener.start() + try: + 1 / 0 + except ZeroDivisionError as e: + exc = e + self.que_logger.exception(self.next_message(), exc_info=exc) + listener.stop() + self.assertEqual(self.stream.getvalue().strip().count('Traceback'), 1) if hasattr(logging.handlers, 'QueueListener'): import multiprocessing diff --git a/Misc/NEWS.d/next/Library/2018-09-25-08-42-34.bpo-34334.rSPBW9.rst b/Misc/NEWS.d/next/Library/2018-09-25-08-42-34.bpo-34334.rSPBW9.rst new file mode 100644 index 000000000000..137a4f78f420 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-25-08-42-34.bpo-34334.rSPBW9.rst @@ -0,0 +1,2 @@ +In :class:`QueueHandler`, clear `exc_text` from :class:`LogRecord` to +prevent traceback from being written twice. From webhook-mailer at python.org Sun Oct 7 03:10:11 2018 From: webhook-mailer at python.org (Gregory P. Smith) Date: Sun, 07 Oct 2018 07:10:11 -0000 Subject: [Python-checkins] bpo-6721: Hold logging locks across fork() (GH-4071) (#9291) Message-ID: https://github.com/python/cpython/commit/3b699932e5ac3e76031bbb6d700fbea07492641d commit: 3b699932e5ac3e76031bbb6d700fbea07492641d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Gregory P. Smith date: 2018-10-07T00:09:59-07:00 summary: bpo-6721: Hold logging locks across fork() (GH-4071) (#9291) bpo-6721: When os.fork() was called while another thread holds a logging lock, the child process may deadlock when it tries to log. This fixes that by acquiring all logging locks before fork and releasing them afterwards. A regression test that fails before this change is included. Within the new unittest itself: There is a small _potential_ due to mixing of fork and a thread in the child process if the parent's thread happened to hold a non-reentrant library call lock (malloc?) when the os.fork() happens. buildbots and time will tell if this actually manifests itself in this test or not. :/ A functionality test that avoids that would be a challenge. An alternate test that isn't trying to produce the deadlock itself but just checking that the release and acquire calls are made would be the next best alternative if so. (cherry picked from commit 19003841e965bbf56fd06824d6093620c1b66f9e) Co-authored-by: Gregory P. Smith [Google] files: A Misc/NEWS.d/next/Library/2018-09-13-10-09-19.bpo-6721.ZUL_F3.rst M Lib/logging/__init__.py M Lib/test/test_logging.py diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 53780cd6005c..3ad2cc38f61e 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -225,6 +225,55 @@ def _releaseLock(): if _lock: _lock.release() + +# Prevent a held logging lock from blocking a child from logging. + +if not hasattr(os, 'register_at_fork'): # Windows and friends. + def _register_at_fork_acquire_release(instance): + pass # no-op when os.register_at_fork does not exist. +else: # The os.register_at_fork API exists + os.register_at_fork(before=_acquireLock, + after_in_child=_releaseLock, + after_in_parent=_releaseLock) + + # A collection of instances with acquire and release methods (logging.Handler) + # to be called before and after fork. The weakref avoids us keeping discarded + # Handler instances alive forever in case an odd program creates and destroys + # many over its lifetime. + _at_fork_acquire_release_weakset = weakref.WeakSet() + + + def _register_at_fork_acquire_release(instance): + # We put the instance itself in a single WeakSet as we MUST have only + # one atomic weak ref. used by both before and after atfork calls to + # guarantee matched pairs of acquire and release calls. + _at_fork_acquire_release_weakset.add(instance) + + + def _at_fork_weak_calls(method_name): + for instance in _at_fork_acquire_release_weakset: + method = getattr(instance, method_name) + try: + method() + except Exception as err: + # Similar to what PyErr_WriteUnraisable does. + print("Ignoring exception from logging atfork", instance, + method_name, "method:", err, file=sys.stderr) + + + def _before_at_fork_weak_calls(): + _at_fork_weak_calls('acquire') + + + def _after_at_fork_weak_calls(): + _at_fork_weak_calls('release') + + + os.register_at_fork(before=_before_at_fork_weak_calls, + after_in_child=_after_at_fork_weak_calls, + after_in_parent=_after_at_fork_weak_calls) + + #--------------------------------------------------------------------------- # The logging record #--------------------------------------------------------------------------- @@ -795,6 +844,7 @@ def createLock(self): Acquire a thread lock for serializing access to the underlying I/O. """ self.lock = threading.RLock() + _register_at_fork_acquire_release(self) def acquire(self): """ diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 5d5eba735745..1ea2967f5b4a 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -35,6 +35,7 @@ import queue import random import re +import signal import socket import struct import sys @@ -666,6 +667,72 @@ def remove_loop(fname, tries): if os.path.exists(fn): os.unlink(fn) + # The implementation relies on os.register_at_fork existing, but we test + # based on os.fork existing because that is what users and this test use. + # This helps ensure that when fork exists (the important concept) that the + # register_at_fork mechanism is also present and used. + @unittest.skipIf(not hasattr(os, 'fork'), 'Test requires os.fork().') + def test_post_fork_child_no_deadlock(self): + """Ensure forked child logging locks are not held; bpo-6721.""" + refed_h = logging.Handler() + refed_h.name = 'because we need at least one for this test' + self.assertGreater(len(logging._handlers), 0) + + locks_held__ready_to_fork = threading.Event() + fork_happened__release_locks_and_end_thread = threading.Event() + + def lock_holder_thread_fn(): + logging._acquireLock() + try: + refed_h.acquire() + try: + # Tell the main thread to do the fork. + locks_held__ready_to_fork.set() + + # If the deadlock bug exists, the fork will happen + # without dealing with the locks we hold, deadlocking + # the child. + + # Wait for a successful fork or an unreasonable amount of + # time before releasing our locks. To avoid a timing based + # test we'd need communication from os.fork() as to when it + # has actually happened. Given this is a regression test + # for a fixed issue, potentially less reliably detecting + # regression via timing is acceptable for simplicity. + # The test will always take at least this long. :( + fork_happened__release_locks_and_end_thread.wait(0.5) + finally: + refed_h.release() + finally: + logging._releaseLock() + + lock_holder_thread = threading.Thread( + target=lock_holder_thread_fn, + name='test_post_fork_child_no_deadlock lock holder') + lock_holder_thread.start() + + locks_held__ready_to_fork.wait() + pid = os.fork() + if pid == 0: # Child. + logging.error(r'Child process did not deadlock. \o/') + os._exit(0) + else: # Parent. + fork_happened__release_locks_and_end_thread.set() + lock_holder_thread.join() + start_time = time.monotonic() + while True: + waited_pid, status = os.waitpid(pid, os.WNOHANG) + if waited_pid == pid: + break # child process exited. + if time.monotonic() - start_time > 7: + break # so long? implies child deadlock. + time.sleep(0.05) + if waited_pid != pid: + os.kill(pid, signal.SIGKILL) + waited_pid, status = os.waitpid(pid, 0) + self.fail("child process deadlocked.") + self.assertEqual(status, 0, msg="child process error") + class BadStream(object): def write(self, data): diff --git a/Misc/NEWS.d/next/Library/2018-09-13-10-09-19.bpo-6721.ZUL_F3.rst b/Misc/NEWS.d/next/Library/2018-09-13-10-09-19.bpo-6721.ZUL_F3.rst new file mode 100644 index 000000000000..073a441db679 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-13-10-09-19.bpo-6721.ZUL_F3.rst @@ -0,0 +1,2 @@ +Acquire the logging module's commonly used internal locks while fork()ing to +avoid deadlocks in the child process. From solipsis at pitrou.net Sun Oct 7 05:09:28 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 07 Oct 2018 09:09:28 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=5 Message-ID: <20181007090928.1.1CC31E4D61D725ED@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 1] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogGlVeGO', '--timeout', '7200'] From webhook-mailer at python.org Sun Oct 7 12:12:42 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 07 Oct 2018 16:12:42 -0000 Subject: [Python-checkins] bpo-34901: add isolated (-I) flag to sys.flags (GH-9708) Message-ID: https://github.com/python/cpython/commit/656d52dbfde3223cd2a3525d652b6cccb02fa991 commit: 656d52dbfde3223cd2a3525d652b6cccb02fa991 branch: master author: Danish Prakash committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-07T09:12:31-07:00 summary: bpo-34901: add isolated (-I) flag to sys.flags (GH-9708) https://bugs.python.org/issue34901 files: M Doc/library/sys.rst diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 9b10738c64e4..cd43e541f13e 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -345,6 +345,7 @@ always available. :const:`debug` :option:`-d` :const:`inspect` :option:`-i` :const:`interactive` :option:`-i` + :const:`isolated` :option:`-I` :const:`optimize` :option:`-O` or :option:`-OO` :const:`dont_write_bytecode` :option:`-B` :const:`no_user_site` :option:`-s` @@ -367,6 +368,9 @@ always available. .. versionchanged:: 3.3 Removed obsolete ``division_warning`` attribute. + .. versionchanged:: 3.4 + Added ``isolated`` attribute for :option:`-I` ``isolated`` flag. + .. versionchanged:: 3.7 Added ``dev_mode`` attribute for the new :option:`-X` ``dev`` flag and ``utf8_mode`` attribute for the new :option:`-X` ``utf8`` flag. From webhook-mailer at python.org Sun Oct 7 12:18:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 07 Oct 2018 16:18:23 -0000 Subject: [Python-checkins] bpo-34901: add isolated (-I) flag to sys.flags (GH-9708) Message-ID: https://github.com/python/cpython/commit/c59e75ccf0ea8d882738214e0385f41eed51e3c7 commit: c59e75ccf0ea8d882738214e0385f41eed51e3c7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-07T09:18:20-07:00 summary: bpo-34901: add isolated (-I) flag to sys.flags (GH-9708) https://bugs.python.org/issue34901 (cherry picked from commit 656d52dbfde3223cd2a3525d652b6cccb02fa991) Co-authored-by: Danish Prakash files: M Doc/library/sys.rst diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 6e0097ef1f8b..a04d957447a8 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -325,6 +325,7 @@ always available. :const:`debug` :option:`-d` :const:`inspect` :option:`-i` :const:`interactive` :option:`-i` + :const:`isolated` :option:`-I` :const:`optimize` :option:`-O` or :option:`-OO` :const:`dont_write_bytecode` :option:`-B` :const:`no_user_site` :option:`-s` @@ -347,6 +348,9 @@ always available. .. versionchanged:: 3.3 Removed obsolete ``division_warning`` attribute. + .. versionchanged:: 3.4 + Added ``isolated`` attribute for :option:`-I` ``isolated`` flag. + .. versionchanged:: 3.7 Added ``dev_mode`` attribute for the new :option:`-X` ``dev`` flag and ``utf8_mode`` attribute for the new :option:`-X` ``utf8`` flag. From webhook-mailer at python.org Mon Oct 8 02:53:37 2018 From: webhook-mailer at python.org (Carol Willing) Date: Mon, 08 Oct 2018 06:53:37 -0000 Subject: [Python-checkins] bpo-33014: Clarify str.isidentifier docstring (GH-6088) Message-ID: https://github.com/python/cpython/commit/ffc5a14d00db984c8e72c7b67da8a493e17e2c14 commit: ffc5a14d00db984c8e72c7b67da8a493e17e2c14 branch: master author: Sanyam Khurana <8039608+CuriousLearner at users.noreply.github.com> committer: Carol Willing date: 2018-10-08T12:23:32+05:30 summary: bpo-33014: Clarify str.isidentifier docstring (GH-6088) * bpo-33014: Clarify str.isidentifier docstring * bpo-33014: Add code example in isidentifier documentation files: M Doc/library/stdtypes.rst M Objects/clinic/unicodeobject.c.h M Objects/unicodeobject.c diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 5a133e32fced..d0d5c6157290 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1700,8 +1700,19 @@ expression support in the :mod:`re` module). Return true if the string is a valid identifier according to the language definition, section :ref:`identifiers`. - Use :func:`keyword.iskeyword` to test for reserved identifiers such as - :keyword:`def` and :keyword:`class`. + Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved + identifier, such as :keyword:`def` and :keyword:`class`. + + Example: + :: + + >>> from keyword import iskeyword + + >>> 'hello'.isidentifier(), iskeyword('hello') + True, False + >>> 'def'.isidentifier(), iskeyword('def') + True, True + .. method:: str.islower() diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 8072516a8a36..cf5f13c6939e 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -381,8 +381,8 @@ PyDoc_STRVAR(unicode_isidentifier__doc__, "\n" "Return True if the string is a valid Python identifier, False otherwise.\n" "\n" -"Use keyword.iskeyword() to test for reserved identifiers such as \"def\" and\n" -"\"class\"."); +"Call keyword.iskeyword(s) to test whether string s is a reserved identifier,\n" +"such as \"def\" or \"class"); #define UNICODE_ISIDENTIFIER_METHODDEF \ {"isidentifier", (PyCFunction)unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__}, @@ -951,4 +951,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=561c88c912b8fe3b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c9476bf19f13c286 input=a9049054013a1b77]*/ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a797f838eb41..16dd3d19e805 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -12100,13 +12100,13 @@ str.isidentifier as unicode_isidentifier Return True if the string is a valid Python identifier, False otherwise. -Use keyword.iskeyword() to test for reserved identifiers such as "def" and -"class". +Call keyword.iskeyword(s) to test whether string s is a reserved identifier, +such as "def" or "class [clinic start generated code]*/ static PyObject * unicode_isidentifier_impl(PyObject *self) -/*[clinic end generated code: output=fe585a9666572905 input=916b0a3c9f57e919]*/ +/*[clinic end generated code: output=fe585a9666572905 input=2fb643aafbcf0e1c]*/ { return PyBool_FromLong(PyUnicode_IsIdentifier(self)); } From solipsis at pitrou.net Mon Oct 8 05:08:18 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 08 Oct 2018 09:08:18 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=-2 Message-ID: <20181008090818.1.6061F93C23F56F2E@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogezdAGv', '--timeout', '7200'] From webhook-mailer at python.org Mon Oct 8 06:44:52 2018 From: webhook-mailer at python.org (Carol Willing) Date: Mon, 08 Oct 2018 10:44:52 -0000 Subject: [Python-checkins] Add missing closing quote and trailing period in str.isidentifier() docstring (GH-9756) Message-ID: https://github.com/python/cpython/commit/fc8205cb4b87edd1c19e1bcc26deaa1570f87988 commit: fc8205cb4b87edd1c19e1bcc26deaa1570f87988 branch: master author: Emanuele Gaifas committer: Carol Willing date: 2018-10-08T16:14:47+05:30 summary: Add missing closing quote and trailing period in str.isidentifier() docstring (GH-9756) This rectifies commit ffc5a14d00db984c8e72c7b67da8a493e17e2c14. files: M Objects/clinic/unicodeobject.c.h M Objects/unicodeobject.c diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index cf5f13c6939e..21937802d293 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -382,7 +382,7 @@ PyDoc_STRVAR(unicode_isidentifier__doc__, "Return True if the string is a valid Python identifier, False otherwise.\n" "\n" "Call keyword.iskeyword(s) to test whether string s is a reserved identifier,\n" -"such as \"def\" or \"class"); +"such as \"def\" or \"class\"."); #define UNICODE_ISIDENTIFIER_METHODDEF \ {"isidentifier", (PyCFunction)unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__}, @@ -951,4 +951,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=c9476bf19f13c286 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8bcd992b25733bcc input=a9049054013a1b77]*/ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 16dd3d19e805..db9b25e29b50 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -12101,12 +12101,12 @@ str.isidentifier as unicode_isidentifier Return True if the string is a valid Python identifier, False otherwise. Call keyword.iskeyword(s) to test whether string s is a reserved identifier, -such as "def" or "class +such as "def" or "class". [clinic start generated code]*/ static PyObject * unicode_isidentifier_impl(PyObject *self) -/*[clinic end generated code: output=fe585a9666572905 input=2fb643aafbcf0e1c]*/ +/*[clinic end generated code: output=fe585a9666572905 input=2d807a104f21c0c5]*/ { return PyBool_FromLong(PyUnicode_IsIdentifier(self)); } From webhook-mailer at python.org Mon Oct 8 11:02:47 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 08 Oct 2018 15:02:47 -0000 Subject: [Python-checkins] bpo-34925: Optimize common case for bisect() argument parsing (#9753) Message-ID: https://github.com/python/cpython/commit/de2e448414530689f2e60e84fd78bdfebb772898 commit: de2e448414530689f2e60e84fd78bdfebb772898 branch: master author: Raymond Hettinger committer: GitHub date: 2018-10-08T08:02:41-07:00 summary: bpo-34925: Optimize common case for bisect() argument parsing (#9753) files: A Misc/NEWS.d/next/Library/2018-10-07-20-37-02.bpo-34925.KlkZ-Y.rst M Modules/_bisectmodule.c diff --git a/Misc/NEWS.d/next/Library/2018-10-07-20-37-02.bpo-34925.KlkZ-Y.rst b/Misc/NEWS.d/next/Library/2018-10-07-20-37-02.bpo-34925.KlkZ-Y.rst new file mode 100644 index 000000000000..b7853684a959 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-07-20-37-02.bpo-34925.KlkZ-Y.rst @@ -0,0 +1 @@ +25% speedup in argument parsing for the functions in the bisect module. diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c index 831e10aa6078..7dd73f94750b 100644 --- a/Modules/_bisectmodule.c +++ b/Modules/_bisectmodule.c @@ -8,7 +8,7 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru). _Py_IDENTIFIER(insert); -static Py_ssize_t +static inline Py_ssize_t internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi) { PyObject *litem; @@ -53,9 +53,15 @@ bisect_right(PyObject *self, PyObject *args, PyObject *kw) Py_ssize_t index; static char *keywords[] = {"a", "x", "lo", "hi", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:bisect_right", - keywords, &list, &item, &lo, &hi)) - return NULL; + if (kw == NULL && PyTuple_GET_SIZE(args) == 2) { + list = PyTuple_GET_ITEM(args, 0); + item = PyTuple_GET_ITEM(args, 1); + } + else { + if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:bisect_right", + keywords, &list, &item, &lo, &hi)) + return NULL; + } index = internal_bisect_right(list, item, lo, hi); if (index < 0) return NULL; @@ -83,16 +89,23 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw) Py_ssize_t index; static char *keywords[] = {"a", "x", "lo", "hi", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:insort_right", - keywords, &list, &item, &lo, &hi)) - return NULL; + if (kw == NULL && PyTuple_GET_SIZE(args) == 2) { + list = PyTuple_GET_ITEM(args, 0); + item = PyTuple_GET_ITEM(args, 1); + } + else { + if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:insort_right", + keywords, &list, &item, &lo, &hi)) + return NULL; + } index = internal_bisect_right(list, item, lo, hi); if (index < 0) return NULL; if (PyList_CheckExact(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; - } else { + } + else { result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item); if (result == NULL) return NULL; @@ -112,7 +125,7 @@ If x is already in a, insert it to the right of the rightmost x.\n\ Optional args lo (default 0) and hi (default len(a)) bound the\n\ slice of a to be searched.\n"); -static Py_ssize_t +static inline Py_ssize_t internal_bisect_left(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi) { PyObject *litem; @@ -157,9 +170,15 @@ bisect_left(PyObject *self, PyObject *args, PyObject *kw) Py_ssize_t index; static char *keywords[] = {"a", "x", "lo", "hi", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:bisect_left", - keywords, &list, &item, &lo, &hi)) - return NULL; + if (kw == NULL && PyTuple_GET_SIZE(args) == 2) { + list = PyTuple_GET_ITEM(args, 0); + item = PyTuple_GET_ITEM(args, 1); + } + else { + if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:bisect_left", + keywords, &list, &item, &lo, &hi)) + return NULL; + } index = internal_bisect_left(list, item, lo, hi); if (index < 0) return NULL; @@ -187,9 +206,14 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw) Py_ssize_t index; static char *keywords[] = {"a", "x", "lo", "hi", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:insort_left", - keywords, &list, &item, &lo, &hi)) - return NULL; + if (kw == NULL && PyTuple_GET_SIZE(args) == 2) { + list = PyTuple_GET_ITEM(args, 0); + item = PyTuple_GET_ITEM(args, 1); + } else { + if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|nn:insort_left", + keywords, &list, &item, &lo, &hi)) + return NULL; + } index = internal_bisect_left(list, item, lo, hi); if (index < 0) return NULL; From webhook-mailer at python.org Mon Oct 8 11:14:19 2018 From: webhook-mailer at python.org (Carol Willing) Date: Mon, 08 Oct 2018 15:14:19 -0000 Subject: [Python-checkins] Use double quote instead of backtick to clarify Ellipsis constant (GH-9754) Message-ID: https://github.com/python/cpython/commit/a8d5e2f255f1a20fc8af7dc16a7cb708e014952a commit: a8d5e2f255f1a20fc8af7dc16a7cb708e014952a branch: master author: Xtreak committer: Carol Willing date: 2018-10-08T20:44:16+05:30 summary: Use double quote instead of backtick to clarify Ellipsis constant (GH-9754) files: M Doc/library/constants.rst diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index 78f161963698..a698ff8d5a5b 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -53,8 +53,8 @@ A small number of constants live in the built-in namespace. They are: .. data:: Ellipsis - The same as ``...``. Special value used mostly in conjunction with extended - slicing syntax for user-defined container data types. + The same as the ellipsis literal "...". Special value used mostly in conjunction + with extended slicing syntax for user-defined container data types. .. data:: __debug__ @@ -96,4 +96,3 @@ should not be used in programs. Object that when printed, prints the message "Type license() to see the full license text", and when called, displays the full license text in a pager-like fashion (one screen at a time). - From webhook-mailer at python.org Mon Oct 8 12:29:34 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 08 Oct 2018 16:29:34 -0000 Subject: [Python-checkins] bpo-34829: Add missing selection_ methods to the Tkinter Spinbox. (GH-9617) Message-ID: https://github.com/python/cpython/commit/af5658ae93b0a87ab4420a7dc30a07fa5a83e252 commit: af5658ae93b0a87ab4420a7dc30a07fa5a83e252 branch: master author: Juliette Monsel committer: Serhiy Storchaka date: 2018-10-08T19:29:24+03:00 summary: bpo-34829: Add missing selection_ methods to the Tkinter Spinbox. (GH-9617) Implement the methods selection_from(), selection_range(), selection_present() and selection_to() for Tkinter Spinbox. files: A Misc/NEWS.d/next/Library/2018-10-08-16-04-36.bpo-34829.B7v7D0.rst M Doc/whatsnew/3.8.rst M Lib/tkinter/__init__.py M Lib/tkinter/test/test_tkinter/test_widgets.py M Misc/ACKS diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a146249178f4..d9c3f1bd7dd6 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -167,6 +167,16 @@ Added :attr:`SSLContext.post_handshake_auth` to enable and post-handshake authentication. (Contributed by Christian Heimes in :issue:`34670`.) +tkinter +------- + +Added methods :meth:`~tkinter.Spinbox.selection_from`, +:meth:`~tkinter.Spinbox.selection_present`, +:meth:`~tkinter.Spinbox.selection_range` and +:meth:`~tkinter.Spinbox.selection_to` +in the :class:`tkinter.Spinbox` class. +(Contributed by Juliette Monsel in :issue:`34829`.) + venv ---- diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index ff85f837d1d5..25f1ff41e4ee 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -3770,6 +3770,24 @@ def selection_element(self, element=None): """ return self.selection("element", element) + def selection_from(self, index): + """Set the fixed end of a selection to INDEX.""" + self.selection('from', index) + + def selection_present(self): + """Return True if there are characters selected in the spinbox, False + otherwise.""" + return self.tk.getboolean( + self.tk.call(self._w, 'selection', 'present')) + + def selection_range(self, start, end): + """Set the selection from START to END (not included).""" + self.selection('range', start, end) + + def selection_to(self, index): + """Set the variable end of a selection to INDEX.""" + self.selection('to', index) + ########################################################################### class LabelFrame(Widget): diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index e4c9d337ba7d..c068a9de2d77 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -377,6 +377,31 @@ def test_validatecommand(self): self.checkCommandParam(widget, 'validatecommand') self.checkCommandParam(widget, 'vcmd') + def test_selection_methods(self): + widget = self.create() + widget.insert(0, '12345') + self.assertFalse(widget.selection_present()) + widget.selection_range(0, 'end') + self.assertEqual(widget.selection_get(), '12345') + self.assertTrue(widget.selection_present()) + widget.selection_from(1) + widget.selection_to(2) + self.assertEqual(widget.selection_get(), '2') + widget.selection_range(3, 4) + self.assertEqual(widget.selection_get(), '4') + widget.selection_clear() + self.assertFalse(widget.selection_present()) + widget.selection_range(0, 'end') + widget.selection_adjust(4) + self.assertEqual(widget.selection_get(), '1234') + widget.selection_adjust(1) + self.assertEqual(widget.selection_get(), '234') + widget.selection_adjust(5) + self.assertEqual(widget.selection_get(), '2345') + widget.selection_adjust(0) + self.assertEqual(widget.selection_get(), '12345') + widget.selection_adjust(0) + @add_standard_options(StandardOptionsTests) class SpinboxTest(EntryTest, unittest.TestCase): @@ -474,6 +499,31 @@ def test_bbox(self): self.assertRaises(TypeError, widget.bbox) self.assertRaises(TypeError, widget.bbox, 0, 1) + def test_selection_methods(self): + widget = self.create() + widget.insert(0, '12345') + self.assertFalse(widget.selection_present()) + widget.selection_range(0, 'end') + self.assertEqual(widget.selection_get(), '12345') + self.assertTrue(widget.selection_present()) + widget.selection_from(1) + widget.selection_to(2) + self.assertEqual(widget.selection_get(), '2') + widget.selection_range(3, 4) + self.assertEqual(widget.selection_get(), '4') + widget.selection_clear() + self.assertFalse(widget.selection_present()) + widget.selection_range(0, 'end') + widget.selection_adjust(4) + self.assertEqual(widget.selection_get(), '1234') + widget.selection_adjust(1) + self.assertEqual(widget.selection_get(), '234') + widget.selection_adjust(5) + self.assertEqual(widget.selection_get(), '2345') + widget.selection_adjust(0) + self.assertEqual(widget.selection_get(), '12345') + widget.selection_adjust(0) + @add_standard_options(StandardOptionsTests) class TextTest(AbstractWidgetTest, unittest.TestCase): diff --git a/Misc/ACKS b/Misc/ACKS index 272130f4e643..5014584b7bc0 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1094,6 +1094,7 @@ Tim Mitchell Zubin Mithra Florian Mladitsch Doug Moen +Juliette Monsel The Dragon De Monsyne Bastien Montagne Skip Montanaro diff --git a/Misc/NEWS.d/next/Library/2018-10-08-16-04-36.bpo-34829.B7v7D0.rst b/Misc/NEWS.d/next/Library/2018-10-08-16-04-36.bpo-34829.B7v7D0.rst new file mode 100644 index 000000000000..e74b56b83611 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-08-16-04-36.bpo-34829.B7v7D0.rst @@ -0,0 +1,3 @@ +Add methods ``selection_from``, ``selection_range``, ``selection_present`` +and ``selection_to`` to the ``tkinter.Spinbox`` for consistency with the +``tkinter.Entry`` widget. Patch by Juliette Monsel. From webhook-mailer at python.org Mon Oct 8 14:49:36 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Mon, 08 Oct 2018 18:49:36 -0000 Subject: [Python-checkins] bpo-34911: Added support for secure websocket cookies (GH-9734) Message-ID: https://github.com/python/cpython/commit/4c339970570d07916bee6ade51f4e9781d51627a commit: 4c339970570d07916bee6ade51f4e9781d51627a branch: master author: Paul Bailey committer: Andrew Svetlov date: 2018-10-08T21:49:29+03:00 summary: bpo-34911: Added support for secure websocket cookies (GH-9734) files: A Misc/NEWS.d/next/Library/2018-10-08-15-22-02.bpo-34911.hCy0Fv.rst M Doc/library/http.cookiejar.rst M Lib/http/cookiejar.py M Lib/test/test_http_cookiejar.py diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst index d8da6683a3a5..4c8be2917b22 100644 --- a/Doc/library/http.cookiejar.rst +++ b/Doc/library/http.cookiejar.rst @@ -78,14 +78,16 @@ The following classes are provided: from / returned to the server. -.. class:: DefaultCookiePolicy( blocked_domains=None, allowed_domains=None, netscape=True, rfc2965=False, rfc2109_as_netscape=None, hide_cookie2=False, strict_domain=False, strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, strict_ns_domain=DefaultCookiePolicy.DomainLiberal, strict_ns_set_initial_dollar=False, strict_ns_set_path=False ) +.. class:: DefaultCookiePolicy( blocked_domains=None, allowed_domains=None, netscape=True, rfc2965=False, rfc2109_as_netscape=None, hide_cookie2=False, strict_domain=False, strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, strict_ns_domain=DefaultCookiePolicy.DomainLiberal, strict_ns_set_initial_dollar=False, strict_ns_set_path=False, secure_protocols=("https", "wss") ) Constructor arguments should be passed as keyword arguments only. *blocked_domains* is a sequence of domain names that we never accept cookies from, nor return cookies to. *allowed_domains* if not :const:`None`, this is a - sequence of the only domains for which we accept and return cookies. For all - other arguments, see the documentation for :class:`CookiePolicy` and - :class:`DefaultCookiePolicy` objects. + sequence of the only domains for which we accept and return cookies. + *secure_protocols* is a sequence of protocols for which secure cookies can be + added to. By default *https* and *wss* (secure websocket) are considered + secure protocols. For all other arguments, see the documentation for + :class:`CookiePolicy` and :class:`DefaultCookiePolicy` objects. :class:`DefaultCookiePolicy` implements the standard accept / reject rules for Netscape and :rfc:`2965` cookies. By default, :rfc:`2109` cookies (ie. cookies diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index e0f1032b2816..0ba8200f325a 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -878,6 +878,7 @@ def __init__(self, strict_ns_domain=DomainLiberal, strict_ns_set_initial_dollar=False, strict_ns_set_path=False, + secure_protocols=("https", "wss") ): """Constructor arguments should be passed as keyword arguments only.""" self.netscape = netscape @@ -890,6 +891,7 @@ def __init__(self, self.strict_ns_domain = strict_ns_domain self.strict_ns_set_initial_dollar = strict_ns_set_initial_dollar self.strict_ns_set_path = strict_ns_set_path + self.secure_protocols = secure_protocols if blocked_domains is not None: self._blocked_domains = tuple(blocked_domains) @@ -1116,7 +1118,7 @@ def return_ok_verifiability(self, cookie, request): return True def return_ok_secure(self, cookie, request): - if cookie.secure and request.type != "https": + if cookie.secure and request.type not in self.secure_protocols: _debug(" secure cookie with non-secure request") return False return True diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 6fee4df10a40..968725901f22 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -984,6 +984,61 @@ def test_secure(self): c._cookies["www.acme.com"]["/"]["foo2"].secure, "secure cookie registered non-secure") + def test_secure_block(self): + pol = DefaultCookiePolicy() + c = CookieJar(policy=pol) + + headers = ["Set-Cookie: session=narf; secure; path=/"] + req = urllib.request.Request("https://www.acme.com/") + res = FakeResponse(headers, "https://www.acme.com/") + c.extract_cookies(res, req) + self.assertEqual(len(c), 1) + + req = urllib.request.Request("https://www.acme.com/") + c.add_cookie_header(req) + self.assertTrue(req.has_header("Cookie")) + + req = urllib.request.Request("http://www.acme.com/") + c.add_cookie_header(req) + self.assertFalse(req.has_header("Cookie")) + + # secure websocket protocol + req = urllib.request.Request("wss://www.acme.com/") + c.add_cookie_header(req) + self.assertTrue(req.has_header("Cookie")) + + # non-secure websocket protocol + req = urllib.request.Request("ws://www.acme.com/") + c.add_cookie_header(req) + self.assertFalse(req.has_header("Cookie")) + + def test_custom_secure_protocols(self): + pol = DefaultCookiePolicy(secure_protocols=["foos"]) + c = CookieJar(policy=pol) + + headers = ["Set-Cookie: session=narf; secure; path=/"] + req = urllib.request.Request("https://www.acme.com/") + res = FakeResponse(headers, "https://www.acme.com/") + c.extract_cookies(res, req) + self.assertEqual(len(c), 1) + + # test https removed from secure protocol list + req = urllib.request.Request("https://www.acme.com/") + c.add_cookie_header(req) + self.assertFalse(req.has_header("Cookie")) + + req = urllib.request.Request("http://www.acme.com/") + c.add_cookie_header(req) + self.assertFalse(req.has_header("Cookie")) + + req = urllib.request.Request("foos://www.acme.com/") + c.add_cookie_header(req) + self.assertTrue(req.has_header("Cookie")) + + req = urllib.request.Request("foo://www.acme.com/") + c.add_cookie_header(req) + self.assertFalse(req.has_header("Cookie")) + def test_quote_cookie_value(self): c = CookieJar(policy=DefaultCookiePolicy(rfc2965=True)) interact_2965(c, "http://www.acme.com/", r'foo=\b"a"r; Version=1') diff --git a/Misc/NEWS.d/next/Library/2018-10-08-15-22-02.bpo-34911.hCy0Fv.rst b/Misc/NEWS.d/next/Library/2018-10-08-15-22-02.bpo-34911.hCy0Fv.rst new file mode 100644 index 000000000000..d3509475306b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-08-15-22-02.bpo-34911.hCy0Fv.rst @@ -0,0 +1,3 @@ +Added *secure_protocols* argument to *http.cookiejar.DefaultCookiePolicy* to +allow for tweaking of protocols and also to add support by default for +*wss*, the secure websocket protocol. From webhook-mailer at python.org Mon Oct 8 14:50:21 2018 From: webhook-mailer at python.org (Ivan Levkivskyi) Date: Mon, 08 Oct 2018 18:50:21 -0000 Subject: [Python-checkins] bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) Message-ID: https://github.com/python/cpython/commit/5eea0ad50c32d38909ff4e29309e2cc3c6ccb2c0 commit: 5eea0ad50c32d38909ff4e29309e2cc3c6ccb2c0 branch: master author: Noah Wood <26890744+JohnnyHobo at users.noreply.github.com> committer: Ivan Levkivskyi date: 2018-10-08T20:50:16+02:00 summary: bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) files: M Lib/typing.py diff --git a/Lib/typing.py b/Lib/typing.py index 445a42492b6b..cfcbb3b76328 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -130,7 +130,7 @@ 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 is not Any or + if (isinstance(arg, _SpecialForm) and arg not in (Any, NoReturn) or arg in (Generic, _Protocol)): raise TypeError(f"Plain {arg} is not valid as type argument") if isinstance(arg, (type, TypeVar, ForwardRef)): From webhook-mailer at python.org Mon Oct 8 16:04:59 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Mon, 08 Oct 2018 20:04:59 -0000 Subject: [Python-checkins] bpo-31715 Add mimetype for extension .mjs (#3908) Message-ID: https://github.com/python/cpython/commit/0854b92cd25613269d21de3cb5239379ddc0f2fb commit: 0854b92cd25613269d21de3cb5239379ddc0f2fb branch: master author: Bradley Meck committer: Andrew Svetlov date: 2018-10-08T23:04:55+03:00 summary: bpo-31715 Add mimetype for extension .mjs (#3908) files: A Misc/NEWS.d/next/Library/2018-08-15-16-22-30.bpo-31715.Iw8jS8.rst M Lib/mimetypes.py diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index f25872102b8c..d5006fa4d316 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -448,6 +448,7 @@ def _default_mime_types(): '.mht' : 'message/rfc822', '.mhtml' : 'message/rfc822', '.mif' : 'application/x-mif', + '.mjs' : 'application/javascript', '.mov' : 'video/quicktime', '.movie' : 'video/x-sgi-movie', '.mp2' : 'audio/mpeg', diff --git a/Misc/NEWS.d/next/Library/2018-08-15-16-22-30.bpo-31715.Iw8jS8.rst b/Misc/NEWS.d/next/Library/2018-08-15-16-22-30.bpo-31715.Iw8jS8.rst new file mode 100644 index 000000000000..eacba28f9fd9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-08-15-16-22-30.bpo-31715.Iw8jS8.rst @@ -0,0 +1 @@ +Associate ``.mjs`` file extension with ``application/javascript`` MIME Type. From webhook-mailer at python.org Mon Oct 8 16:06:21 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Mon, 08 Oct 2018 20:06:21 -0000 Subject: [Python-checkins] Extract tests for sock_*() functions into a separate file (GH-9761) Message-ID: https://github.com/python/cpython/commit/60d230c78f1e46832fded8b3a8ee604aafa5cc11 commit: 60d230c78f1e46832fded8b3a8ee604aafa5cc11 branch: master author: Andrew Svetlov committer: GitHub date: 2018-10-08T23:06:18+03:00 summary: Extract tests for sock_*() functions into a separate file (GH-9761) files: A Lib/test/test_asyncio/test_sock_lowlevel.py 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 2a90cda92c9d..607c1955ac58 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -419,108 +419,6 @@ def writer(data): r.close() self.assertEqual(read, data) - def _basetest_sock_client_ops(self, httpd, sock): - if not isinstance(self.loop, proactor_events.BaseProactorEventLoop): - # in debug mode, socket operations must fail - # if the socket is not in blocking mode - self.loop.set_debug(True) - sock.setblocking(True) - with self.assertRaises(ValueError): - self.loop.run_until_complete( - self.loop.sock_connect(sock, httpd.address)) - with self.assertRaises(ValueError): - self.loop.run_until_complete( - self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) - with self.assertRaises(ValueError): - self.loop.run_until_complete( - self.loop.sock_recv(sock, 1024)) - with self.assertRaises(ValueError): - self.loop.run_until_complete( - self.loop.sock_recv_into(sock, bytearray())) - with self.assertRaises(ValueError): - self.loop.run_until_complete( - self.loop.sock_accept(sock)) - - # test in non-blocking mode - sock.setblocking(False) - self.loop.run_until_complete( - self.loop.sock_connect(sock, httpd.address)) - self.loop.run_until_complete( - self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) - data = self.loop.run_until_complete( - self.loop.sock_recv(sock, 1024)) - # consume data - self.loop.run_until_complete( - self.loop.sock_recv(sock, 1024)) - sock.close() - self.assertTrue(data.startswith(b'HTTP/1.0 200 OK')) - - def _basetest_sock_recv_into(self, httpd, sock): - # same as _basetest_sock_client_ops, but using sock_recv_into - sock.setblocking(False) - self.loop.run_until_complete( - self.loop.sock_connect(sock, httpd.address)) - self.loop.run_until_complete( - self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) - data = bytearray(1024) - with memoryview(data) as buf: - nbytes = self.loop.run_until_complete( - self.loop.sock_recv_into(sock, buf[:1024])) - # consume data - self.loop.run_until_complete( - self.loop.sock_recv_into(sock, buf[nbytes:])) - sock.close() - self.assertTrue(data.startswith(b'HTTP/1.0 200 OK')) - - def test_sock_client_ops(self): - with test_utils.run_test_server() as httpd: - sock = socket.socket() - self._basetest_sock_client_ops(httpd, sock) - sock = socket.socket() - self._basetest_sock_recv_into(httpd, sock) - - @support.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) - self._basetest_sock_client_ops(httpd, sock) - sock = socket.socket(socket.AF_UNIX) - self._basetest_sock_recv_into(httpd, sock) - - def test_sock_client_fail(self): - # Make sure that we will get an unused port - address = None - try: - s = socket.socket() - s.bind(('127.0.0.1', 0)) - address = s.getsockname() - finally: - s.close() - - sock = socket.socket() - sock.setblocking(False) - with self.assertRaises(ConnectionRefusedError): - self.loop.run_until_complete( - self.loop.sock_connect(sock, address)) - sock.close() - - def test_sock_accept(self): - listener = socket.socket() - listener.setblocking(False) - listener.bind(('127.0.0.1', 0)) - listener.listen(1) - client = socket.socket() - client.connect(listener.getsockname()) - - f = self.loop.sock_accept(listener) - conn, addr = self.loop.run_until_complete(f) - self.assertEqual(conn.gettimeout(), 0) - self.assertEqual(addr, client.getsockname()) - self.assertEqual(client.getpeername(), listener.getsockname()) - client.close() - conn.close() - listener.close() - @unittest.skipUnless(hasattr(signal, 'SIGKILL'), 'No SIGKILL') def test_add_signal_handler(self): caught = 0 @@ -626,34 +524,6 @@ def test_create_unix_connection(self): lambda: MyProto(loop=self.loop), httpd.address) self._basetest_create_connection(conn_fut, check_sockname) - def test_create_connection_sock(self): - with test_utils.run_test_server() as httpd: - sock = None - infos = self.loop.run_until_complete( - self.loop.getaddrinfo( - *httpd.address, type=socket.SOCK_STREAM)) - for family, type, proto, cname, address in infos: - try: - sock = socket.socket(family=family, type=type, proto=proto) - sock.setblocking(False) - self.loop.run_until_complete( - self.loop.sock_connect(sock, address)) - except: - pass - else: - break - else: - assert False, 'Can not create socket.' - - f = self.loop.create_connection( - lambda: MyProto(loop=self.loop), sock=sock) - tr, pr = self.loop.run_until_complete(f) - self.assertIsInstance(tr, asyncio.Transport) - self.assertIsInstance(pr, asyncio.Protocol) - self.loop.run_until_complete(pr.done) - self.assertGreater(pr.nbytes, 0) - tr.close() - def check_ssl_extra_info(self, client, check_sockname=True, peername=None, peercert={}): if check_sockname: diff --git a/Lib/test/test_asyncio/test_sock_lowlevel.py b/Lib/test/test_asyncio/test_sock_lowlevel.py new file mode 100644 index 000000000000..8d1661524c27 --- /dev/null +++ b/Lib/test/test_asyncio/test_sock_lowlevel.py @@ -0,0 +1,238 @@ +import socket +import asyncio +import sys +from asyncio import proactor_events +from test.test_asyncio import utils as test_utils +from test import support + + +class MyProto(asyncio.Protocol): + connected = None + done = None + + def __init__(self, loop=None): + self.transport = None + self.state = 'INITIAL' + self.nbytes = 0 + if loop is not None: + self.connected = asyncio.Future(loop=loop) + self.done = asyncio.Future(loop=loop) + + def connection_made(self, transport): + self.transport = transport + assert self.state == 'INITIAL', self.state + self.state = 'CONNECTED' + if self.connected: + self.connected.set_result(None) + transport.write(b'GET / HTTP/1.0\r\nHost: example.com\r\n\r\n') + + def data_received(self, data): + assert self.state == 'CONNECTED', self.state + self.nbytes += len(data) + + def eof_received(self): + assert self.state == 'CONNECTED', self.state + self.state = 'EOF' + + def connection_lost(self, exc): + assert self.state in ('CONNECTED', 'EOF'), self.state + self.state = 'CLOSED' + if self.done: + self.done.set_result(None) + + +class BaseSockTestsMixin: + + def create_event_loop(self): + raise NotImplementedError + + def setUp(self): + self.loop = self.create_event_loop() + self.set_event_loop(self.loop) + super().setUp() + + def tearDown(self): + # just in case if we have transport close callbacks + if not self.loop.is_closed(): + test_utils.run_briefly(self.loop) + + self.doCleanups() + support.gc_collect() + super().tearDown() + + def _basetest_sock_client_ops(self, httpd, sock): + if not isinstance(self.loop, proactor_events.BaseProactorEventLoop): + # in debug mode, socket operations must fail + # if the socket is not in blocking mode + self.loop.set_debug(True) + sock.setblocking(True) + with self.assertRaises(ValueError): + self.loop.run_until_complete( + self.loop.sock_connect(sock, httpd.address)) + with self.assertRaises(ValueError): + self.loop.run_until_complete( + self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) + with self.assertRaises(ValueError): + self.loop.run_until_complete( + self.loop.sock_recv(sock, 1024)) + with self.assertRaises(ValueError): + self.loop.run_until_complete( + self.loop.sock_recv_into(sock, bytearray())) + with self.assertRaises(ValueError): + self.loop.run_until_complete( + self.loop.sock_accept(sock)) + + # test in non-blocking mode + sock.setblocking(False) + self.loop.run_until_complete( + self.loop.sock_connect(sock, httpd.address)) + self.loop.run_until_complete( + self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) + data = self.loop.run_until_complete( + self.loop.sock_recv(sock, 1024)) + # consume data + self.loop.run_until_complete( + self.loop.sock_recv(sock, 1024)) + sock.close() + self.assertTrue(data.startswith(b'HTTP/1.0 200 OK')) + + def _basetest_sock_recv_into(self, httpd, sock): + # same as _basetest_sock_client_ops, but using sock_recv_into + sock.setblocking(False) + self.loop.run_until_complete( + self.loop.sock_connect(sock, httpd.address)) + self.loop.run_until_complete( + self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) + data = bytearray(1024) + with memoryview(data) as buf: + nbytes = self.loop.run_until_complete( + self.loop.sock_recv_into(sock, buf[:1024])) + # consume data + self.loop.run_until_complete( + self.loop.sock_recv_into(sock, buf[nbytes:])) + sock.close() + self.assertTrue(data.startswith(b'HTTP/1.0 200 OK')) + + def test_sock_client_ops(self): + with test_utils.run_test_server() as httpd: + sock = socket.socket() + self._basetest_sock_client_ops(httpd, sock) + sock = socket.socket() + self._basetest_sock_recv_into(httpd, sock) + + @support.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) + self._basetest_sock_client_ops(httpd, sock) + sock = socket.socket(socket.AF_UNIX) + self._basetest_sock_recv_into(httpd, sock) + + def test_sock_client_fail(self): + # Make sure that we will get an unused port + address = None + try: + s = socket.socket() + s.bind(('127.0.0.1', 0)) + address = s.getsockname() + finally: + s.close() + + sock = socket.socket() + sock.setblocking(False) + with self.assertRaises(ConnectionRefusedError): + self.loop.run_until_complete( + self.loop.sock_connect(sock, address)) + sock.close() + + def test_sock_accept(self): + listener = socket.socket() + listener.setblocking(False) + listener.bind(('127.0.0.1', 0)) + listener.listen(1) + client = socket.socket() + client.connect(listener.getsockname()) + + f = self.loop.sock_accept(listener) + conn, addr = self.loop.run_until_complete(f) + self.assertEqual(conn.gettimeout(), 0) + self.assertEqual(addr, client.getsockname()) + self.assertEqual(client.getpeername(), listener.getsockname()) + client.close() + conn.close() + listener.close() + + def test_create_connection_sock(self): + with test_utils.run_test_server() as httpd: + sock = None + infos = self.loop.run_until_complete( + self.loop.getaddrinfo( + *httpd.address, type=socket.SOCK_STREAM)) + for family, type, proto, cname, address in infos: + try: + sock = socket.socket(family=family, type=type, proto=proto) + sock.setblocking(False) + self.loop.run_until_complete( + self.loop.sock_connect(sock, address)) + except BaseException: + pass + else: + break + else: + assert False, 'Can not create socket.' + + f = self.loop.create_connection( + lambda: MyProto(loop=self.loop), sock=sock) + tr, pr = self.loop.run_until_complete(f) + self.assertIsInstance(tr, asyncio.Transport) + self.assertIsInstance(pr, asyncio.Protocol) + self.loop.run_until_complete(pr.done) + self.assertGreater(pr.nbytes, 0) + tr.close() + + +if sys.platform == 'win32': + + class SelectEventLoopTests(BaseSockTestsMixin, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop() + + class ProactorEventLoopTests(BaseSockTestsMixin, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.ProactorEventLoop() + +else: + import selectors + + if hasattr(selectors, 'KqueueSelector'): + class KqueueEventLoopTests(BaseSockTestsMixin, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop( + selectors.KqueueSelector()) + + if hasattr(selectors, 'EpollSelector'): + class EPollEventLoopTests(BaseSockTestsMixin, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.EpollSelector()) + + if hasattr(selectors, 'PollSelector'): + class PollEventLoopTests(BaseSockTestsMixin, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.PollSelector()) + + # Should always exist. + class SelectEventLoopTests(BaseSockTestsMixin, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.SelectSelector()) From webhook-mailer at python.org Mon Oct 8 17:21:03 2018 From: webhook-mailer at python.org (Steve Dower) Date: Mon, 08 Oct 2018 21:21:03 -0000 Subject: [Python-checkins] bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758) Message-ID: https://github.com/python/cpython/commit/6261ae9b01fb8429b779169f8de37ff567c144e8 commit: 6261ae9b01fb8429b779169f8de37ff567c144e8 branch: master author: animalize committer: Steve Dower date: 2018-10-08T14:20:54-07:00 summary: bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758) Let .chm document display non-ASCII characters properly Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual effect on some MBCS Windows systems. files: A Doc/tools/extensions/escape4chm.py A Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst M Doc/conf.py diff --git a/Doc/conf.py b/Doc/conf.py index d8efce035c9c..7f720ce3832d 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -14,7 +14,7 @@ # --------------------- extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest', - 'pyspecific', 'c_annotations'] + 'pyspecific', 'c_annotations', 'escape4chm'] # General substitutions. project = 'Python' diff --git a/Doc/tools/extensions/escape4chm.py b/Doc/tools/extensions/escape4chm.py new file mode 100644 index 000000000000..6f2e35725b37 --- /dev/null +++ b/Doc/tools/extensions/escape4chm.py @@ -0,0 +1,39 @@ +""" +Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual +effect on some MBCS Windows systems. + +https://bugs.python.org/issue32174 +""" + +import re +from html.entities import codepoint2name + +# escape the characters which codepoint > 0x7F +def _process(string): + def escape(matchobj): + codepoint = ord(matchobj.group(0)) + + name = codepoint2name.get(codepoint) + if name is None: + return '&#%d;' % codepoint + else: + return '&%s;' % name + + return re.sub(r'[^\x00-\x7F]', escape, string) + +def escape_for_chm(app, pagename, templatename, context, doctree): + # only works for .chm output + if not hasattr(app.builder, 'name') or app.builder.name != 'htmlhelp': + return + + # escape the `body` part to 7-bit ASCII + body = context.get('body') + if body is not None: + context['body'] = _process(body) + +def setup(app): + # `html-page-context` event emitted when the HTML builder has + # created a context dictionary to render a template with. + app.connect('html-page-context', escape_for_chm) + + return {'version': '1.0', 'parallel_read_safe': True} diff --git a/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst b/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst new file mode 100644 index 000000000000..a11a4b3eb087 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst @@ -0,0 +1,2 @@ +chm document displays non-ASCII charaters properly on some MBCS Windows +systems. From webhook-mailer at python.org Mon Oct 8 17:26:49 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 08 Oct 2018 21:26:49 -0000 Subject: [Python-checkins] bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758) Message-ID: https://github.com/python/cpython/commit/64bcedce8d61e1daa9ff7980cc07988574049b1f commit: 64bcedce8d61e1daa9ff7980cc07988574049b1f branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-08T14:26:44-07:00 summary: bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758) Let .chm document display non-ASCII characters properly Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual effect on some MBCS Windows systems. (cherry picked from commit 6261ae9b01fb8429b779169f8de37ff567c144e8) Co-authored-by: animalize files: A Doc/tools/extensions/escape4chm.py A Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst M Doc/conf.py diff --git a/Doc/conf.py b/Doc/conf.py index 43826ec01f46..e2758bcd00b5 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -13,7 +13,7 @@ # --------------------- extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest', - 'pyspecific', 'c_annotations'] + 'pyspecific', 'c_annotations', 'escape4chm'] # General substitutions. project = 'Python' diff --git a/Doc/tools/extensions/escape4chm.py b/Doc/tools/extensions/escape4chm.py new file mode 100644 index 000000000000..6f2e35725b37 --- /dev/null +++ b/Doc/tools/extensions/escape4chm.py @@ -0,0 +1,39 @@ +""" +Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual +effect on some MBCS Windows systems. + +https://bugs.python.org/issue32174 +""" + +import re +from html.entities import codepoint2name + +# escape the characters which codepoint > 0x7F +def _process(string): + def escape(matchobj): + codepoint = ord(matchobj.group(0)) + + name = codepoint2name.get(codepoint) + if name is None: + return '&#%d;' % codepoint + else: + return '&%s;' % name + + return re.sub(r'[^\x00-\x7F]', escape, string) + +def escape_for_chm(app, pagename, templatename, context, doctree): + # only works for .chm output + if not hasattr(app.builder, 'name') or app.builder.name != 'htmlhelp': + return + + # escape the `body` part to 7-bit ASCII + body = context.get('body') + if body is not None: + context['body'] = _process(body) + +def setup(app): + # `html-page-context` event emitted when the HTML builder has + # created a context dictionary to render a template with. + app.connect('html-page-context', escape_for_chm) + + return {'version': '1.0', 'parallel_read_safe': True} diff --git a/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst b/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst new file mode 100644 index 000000000000..a11a4b3eb087 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst @@ -0,0 +1,2 @@ +chm document displays non-ASCII charaters properly on some MBCS Windows +systems. From webhook-mailer at python.org Mon Oct 8 17:26:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 08 Oct 2018 21:26:58 -0000 Subject: [Python-checkins] bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758) Message-ID: https://github.com/python/cpython/commit/c4c86fad8024dc91af8d785c33187c092b4e49d9 commit: c4c86fad8024dc91af8d785c33187c092b4e49d9 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-08T14:26:55-07:00 summary: bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758) Let .chm document display non-ASCII characters properly Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual effect on some MBCS Windows systems. (cherry picked from commit 6261ae9b01fb8429b779169f8de37ff567c144e8) Co-authored-by: animalize files: A Doc/tools/extensions/escape4chm.py A Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst M Doc/conf.py diff --git a/Doc/conf.py b/Doc/conf.py index 19a2f7d67ff8..b7bb5a09c50a 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -14,7 +14,7 @@ # --------------------- extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest', - 'pyspecific', 'c_annotations'] + 'pyspecific', 'c_annotations', 'escape4chm'] # General substitutions. project = 'Python' diff --git a/Doc/tools/extensions/escape4chm.py b/Doc/tools/extensions/escape4chm.py new file mode 100644 index 000000000000..6f2e35725b37 --- /dev/null +++ b/Doc/tools/extensions/escape4chm.py @@ -0,0 +1,39 @@ +""" +Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual +effect on some MBCS Windows systems. + +https://bugs.python.org/issue32174 +""" + +import re +from html.entities import codepoint2name + +# escape the characters which codepoint > 0x7F +def _process(string): + def escape(matchobj): + codepoint = ord(matchobj.group(0)) + + name = codepoint2name.get(codepoint) + if name is None: + return '&#%d;' % codepoint + else: + return '&%s;' % name + + return re.sub(r'[^\x00-\x7F]', escape, string) + +def escape_for_chm(app, pagename, templatename, context, doctree): + # only works for .chm output + if not hasattr(app.builder, 'name') or app.builder.name != 'htmlhelp': + return + + # escape the `body` part to 7-bit ASCII + body = context.get('body') + if body is not None: + context['body'] = _process(body) + +def setup(app): + # `html-page-context` event emitted when the HTML builder has + # created a context dictionary to render a template with. + app.connect('html-page-context', escape_for_chm) + + return {'version': '1.0', 'parallel_read_safe': True} diff --git a/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst b/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst new file mode 100644 index 000000000000..a11a4b3eb087 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-08-19-15-28.bpo-32174.YO9CYm.rst @@ -0,0 +1,2 @@ +chm document displays non-ASCII charaters properly on some MBCS Windows +systems. From webhook-mailer at python.org Tue Oct 9 00:44:05 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Tue, 09 Oct 2018 04:44:05 -0000 Subject: [Python-checkins] bpo-34758: add .wasm to recognized file extensions in mimetypes module (GH-9464) Message-ID: https://github.com/python/cpython/commit/199a280af540e3194405eb250ca1a8d487f6a4f7 commit: 199a280af540e3194405eb250ca1a8d487f6a4f7 branch: master author: travisoneill committer: Andrew Svetlov date: 2018-10-09T07:43:58+03:00 summary: bpo-34758: add .wasm to recognized file extensions in mimetypes module (GH-9464) files: A Misc/NEWS.d/next/Library/2018-09-26-14-09-34.bpo-34758.bRBfAi.rst M Lib/mimetypes.py diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index d5006fa4d316..bc647115b18e 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -515,6 +515,7 @@ def _default_mime_types(): '.txt' : 'text/plain', '.ustar' : 'application/x-ustar', '.vcf' : 'text/x-vcard', + '.wasm' : 'application/wasm', '.wav' : 'audio/x-wav', '.webm' : 'video/webm', '.wiz' : 'application/msword', diff --git a/Misc/NEWS.d/next/Library/2018-09-26-14-09-34.bpo-34758.bRBfAi.rst b/Misc/NEWS.d/next/Library/2018-09-26-14-09-34.bpo-34758.bRBfAi.rst new file mode 100644 index 000000000000..82e38aa6e158 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-26-14-09-34.bpo-34758.bRBfAi.rst @@ -0,0 +1,2 @@ +Add .wasm -> application/wasm to list of recognized file types and content +type headers From webhook-mailer at python.org Tue Oct 9 00:53:01 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Tue, 09 Oct 2018 04:53:01 -0000 Subject: [Python-checkins] Extract sendfile tests into a separate test file (#9757) Message-ID: https://github.com/python/cpython/commit/2b2758d0b30f4ed7d37319d6c18552eccbc8e7b7 commit: 2b2758d0b30f4ed7d37319d6c18552eccbc8e7b7 branch: master author: Andrew Svetlov committer: GitHub date: 2018-10-09T07:52:57+03:00 summary: Extract sendfile tests into a separate test file (#9757) files: A Lib/test/test_asyncio/test_sendfile.py 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 607c1955ac58..b76cfb75cce2 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -15,7 +15,6 @@ ssl = None import subprocess import sys -import tempfile import threading import time import errno @@ -1987,461 +1986,15 @@ def test_subprocess_shell_invalid_args(self): self.loop.run_until_complete(connect(shell=False)) -class SendfileBase: - - DATA = b"SendfileBaseData" * (1024 * 8) # 128 KiB - - # Reduce socket buffer size to test on relative small data sets. - BUF_SIZE = 4 * 1024 # 4 KiB - - @classmethod - def setUpClass(cls): - with open(support.TESTFN, 'wb') as fp: - fp.write(cls.DATA) - super().setUpClass() - - @classmethod - def tearDownClass(cls): - support.unlink(support.TESTFN) - super().tearDownClass() - - def setUp(self): - self.file = open(support.TESTFN, 'rb') - self.addCleanup(self.file.close) - super().setUp() - - def run_loop(self, coro): - return self.loop.run_until_complete(coro) - - -class SockSendfileMixin(SendfileBase): - - class MyProto(asyncio.Protocol): - - def __init__(self, loop): - self.started = False - self.closed = False - self.data = bytearray() - self.fut = loop.create_future() - self.transport = None - - def connection_made(self, transport): - self.started = True - self.transport = transport - - def data_received(self, data): - self.data.extend(data) - - def connection_lost(self, exc): - self.closed = True - self.fut.set_result(None) - - async def wait_closed(self): - await self.fut - - @classmethod - def setUpClass(cls): - cls.__old_bufsize = constants.SENDFILE_FALLBACK_READBUFFER_SIZE - constants.SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 16 - super().setUpClass() - - @classmethod - def tearDownClass(cls): - constants.SENDFILE_FALLBACK_READBUFFER_SIZE = cls.__old_bufsize - super().tearDownClass() - - def make_socket(self, cleanup=True): - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.setblocking(False) - if cleanup: - self.addCleanup(sock.close) - return sock - - def reduce_receive_buffer_size(self, sock): - # Reduce receive socket buffer size to test on relative - # small data sets. - sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, self.BUF_SIZE) - - def reduce_send_buffer_size(self, sock, transport=None): - # Reduce send socket buffer size to test on relative small data sets. - - # On macOS, SO_SNDBUF is reset by connect(). So this method - # should be called after the socket is connected. - sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.BUF_SIZE) - - if transport is not None: - transport.set_write_buffer_limits(high=self.BUF_SIZE) - - def prepare_socksendfile(self): - proto = self.MyProto(self.loop) - port = support.find_unused_port() - srv_sock = self.make_socket(cleanup=False) - srv_sock.bind((support.HOST, port)) - server = self.run_loop(self.loop.create_server( - lambda: proto, sock=srv_sock)) - self.reduce_receive_buffer_size(srv_sock) - - sock = self.make_socket() - self.run_loop(self.loop.sock_connect(sock, ('127.0.0.1', port))) - self.reduce_send_buffer_size(sock) - - def cleanup(): - if proto.transport is not None: - # can be None if the task was cancelled before - # connection_made callback - proto.transport.close() - self.run_loop(proto.wait_closed()) - - server.close() - self.run_loop(server.wait_closed()) - - self.addCleanup(cleanup) - - return sock, proto - - def test_sock_sendfile_success(self): - sock, proto = self.prepare_socksendfile() - ret = self.run_loop(self.loop.sock_sendfile(sock, self.file)) - sock.close() - self.run_loop(proto.wait_closed()) - - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(proto.data, self.DATA) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sock_sendfile_with_offset_and_count(self): - sock, proto = self.prepare_socksendfile() - ret = self.run_loop(self.loop.sock_sendfile(sock, self.file, - 1000, 2000)) - sock.close() - self.run_loop(proto.wait_closed()) - - self.assertEqual(proto.data, self.DATA[1000:3000]) - self.assertEqual(self.file.tell(), 3000) - self.assertEqual(ret, 2000) - - def test_sock_sendfile_zero_size(self): - sock, proto = self.prepare_socksendfile() - with tempfile.TemporaryFile() as f: - ret = self.run_loop(self.loop.sock_sendfile(sock, f, - 0, None)) - sock.close() - self.run_loop(proto.wait_closed()) - - self.assertEqual(ret, 0) - self.assertEqual(self.file.tell(), 0) - - def test_sock_sendfile_mix_with_regular_send(self): - buf = b"mix_regular_send" * (4 * 1024) # 64 KiB - sock, proto = self.prepare_socksendfile() - self.run_loop(self.loop.sock_sendall(sock, buf)) - ret = self.run_loop(self.loop.sock_sendfile(sock, self.file)) - self.run_loop(self.loop.sock_sendall(sock, buf)) - sock.close() - self.run_loop(proto.wait_closed()) - - self.assertEqual(ret, len(self.DATA)) - expected = buf + self.DATA + buf - self.assertEqual(proto.data, expected) - self.assertEqual(self.file.tell(), len(self.DATA)) - - -class SendfileMixin(SendfileBase): - - class MySendfileProto(MyBaseProto): - - def __init__(self, loop=None, close_after=0): - super().__init__(loop) - self.data = bytearray() - self.close_after = close_after - - def data_received(self, data): - self.data.extend(data) - super().data_received(data) - if self.close_after and self.nbytes >= self.close_after: - self.transport.close() - - - # 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() - srv_proto = self.MySendfileProto(loop=self.loop, - close_after=close_after) - if is_ssl: - if not ssl: - self.skipTest("No ssl module") - srv_ctx = test_utils.simple_server_sslcontext() - cli_ctx = test_utils.simple_client_sslcontext() - else: - srv_ctx = None - cli_ctx = None - srv_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - srv_sock.bind((support.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 - else: - server_hostname = None - cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - cli_sock.connect((support.HOST, port)) - - cli_proto = self.MySendfileProto(loop=self.loop) - tr, pr = self.run_loop(self.loop.create_connection( - lambda: cli_proto, sock=cli_sock, - ssl=cli_ctx, server_hostname=server_hostname)) - self.reduce_send_buffer_size(cli_sock, transport=tr) - - def cleanup(): - srv_proto.transport.close() - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.run_loop(cli_proto.done) - - server.close() - self.run_loop(server.wait_closed()) - - self.addCleanup(cleanup) - return srv_proto, cli_proto - - @unittest.skipIf(sys.platform == 'win32', "UDP sockets are not supported") - def test_sendfile_not_supported(self): - tr, pr = self.run_loop( - self.loop.create_datagram_endpoint( - lambda: MyDatagramProto(loop=self.loop), - family=socket.AF_INET)) - try: - with self.assertRaisesRegex(RuntimeError, "not supported"): - self.run_loop( - self.loop.sendfile(tr, self.file)) - self.assertEqual(0, self.file.tell()) - finally: - # don't use self.addCleanup because it produces resource warning - tr.close() - - def test_sendfile(self): - srv_proto, cli_proto = self.prepare_sendfile() - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.nbytes, len(self.DATA)) - self.assertEqual(srv_proto.data, self.DATA) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_force_fallback(self): - srv_proto, cli_proto = self.prepare_sendfile() - - def sendfile_native(transp, file, offset, count): - # to raise SendfileNotAvailableError - return base_events.BaseEventLoop._sendfile_native( - self.loop, transp, file, offset, count) - - self.loop._sendfile_native = sendfile_native - - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.nbytes, len(self.DATA)) - self.assertEqual(srv_proto.data, self.DATA) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_force_unsupported_native(self): - if sys.platform == 'win32': - if isinstance(self.loop, asyncio.ProactorEventLoop): - self.skipTest("Fails on proactor event loop") - srv_proto, cli_proto = self.prepare_sendfile() - - def sendfile_native(transp, file, offset, count): - # to raise SendfileNotAvailableError - return base_events.BaseEventLoop._sendfile_native( - self.loop, transp, file, offset, count) - - self.loop._sendfile_native = sendfile_native - - with self.assertRaisesRegex(asyncio.SendfileNotAvailableError, - "not supported"): - self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file, - fallback=False)) - - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(srv_proto.nbytes, 0) - self.assertEqual(self.file.tell(), 0) - - def test_sendfile_ssl(self): - srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True) - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.nbytes, len(self.DATA)) - self.assertEqual(srv_proto.data, self.DATA) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_for_closing_transp(self): - srv_proto, cli_proto = self.prepare_sendfile() - cli_proto.transport.close() - with self.assertRaisesRegex(RuntimeError, "is closing"): - self.run_loop(self.loop.sendfile(cli_proto.transport, self.file)) - self.run_loop(srv_proto.done) - self.assertEqual(srv_proto.nbytes, 0) - self.assertEqual(self.file.tell(), 0) - - def test_sendfile_pre_and_post_data(self): - srv_proto, cli_proto = self.prepare_sendfile() - PREFIX = b'PREFIX__' * 1024 # 8 KiB - SUFFIX = b'--SUFFIX' * 1024 # 8 KiB - cli_proto.transport.write(PREFIX) - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - cli_proto.transport.write(SUFFIX) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.data, PREFIX + self.DATA + SUFFIX) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_ssl_pre_and_post_data(self): - srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True) - PREFIX = b'zxcvbnm' * 1024 - SUFFIX = b'0987654321' * 1024 - cli_proto.transport.write(PREFIX) - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - cli_proto.transport.write(SUFFIX) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.data, PREFIX + self.DATA + SUFFIX) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_partial(self): - srv_proto, cli_proto = self.prepare_sendfile() - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file, 1000, 100)) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, 100) - self.assertEqual(srv_proto.nbytes, 100) - self.assertEqual(srv_proto.data, self.DATA[1000:1100]) - self.assertEqual(self.file.tell(), 1100) - - def test_sendfile_ssl_partial(self): - srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True) - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file, 1000, 100)) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, 100) - self.assertEqual(srv_proto.nbytes, 100) - self.assertEqual(srv_proto.data, self.DATA[1000:1100]) - self.assertEqual(self.file.tell(), 1100) - - def test_sendfile_close_peer_after_receiving(self): - srv_proto, cli_proto = self.prepare_sendfile( - close_after=len(self.DATA)) - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - cli_proto.transport.close() - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.nbytes, len(self.DATA)) - self.assertEqual(srv_proto.data, self.DATA) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_ssl_close_peer_after_receiving(self): - srv_proto, cli_proto = self.prepare_sendfile( - is_ssl=True, close_after=len(self.DATA)) - ret = self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - self.run_loop(srv_proto.done) - self.assertEqual(ret, len(self.DATA)) - self.assertEqual(srv_proto.nbytes, len(self.DATA)) - self.assertEqual(srv_proto.data, self.DATA) - self.assertEqual(self.file.tell(), len(self.DATA)) - - def test_sendfile_close_peer_in_the_middle_of_receiving(self): - srv_proto, cli_proto = self.prepare_sendfile(close_after=1024) - with self.assertRaises(ConnectionError): - self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - self.run_loop(srv_proto.done) - - self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA), - srv_proto.nbytes) - self.assertTrue(1024 <= self.file.tell() < len(self.DATA), - self.file.tell()) - self.assertTrue(cli_proto.transport.is_closing()) - - def test_sendfile_fallback_close_peer_in_the_middle_of_receiving(self): - - def sendfile_native(transp, file, offset, count): - # to raise SendfileNotAvailableError - return base_events.BaseEventLoop._sendfile_native( - self.loop, transp, file, offset, count) - - self.loop._sendfile_native = sendfile_native - - srv_proto, cli_proto = self.prepare_sendfile(close_after=1024) - with self.assertRaises(ConnectionError): - self.run_loop( - self.loop.sendfile(cli_proto.transport, self.file)) - self.run_loop(srv_proto.done) - - self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA), - srv_proto.nbytes) - self.assertTrue(1024 <= self.file.tell() < len(self.DATA), - self.file.tell()) - - @unittest.skipIf(not hasattr(os, 'sendfile'), - "Don't have native sendfile support") - def test_sendfile_prevents_bare_write(self): - srv_proto, cli_proto = self.prepare_sendfile() - fut = self.loop.create_future() - - async def coro(): - fut.set_result(None) - return await self.loop.sendfile(cli_proto.transport, self.file) - - t = self.loop.create_task(coro()) - self.run_loop(fut) - with self.assertRaisesRegex(RuntimeError, - "sendfile is in progress"): - cli_proto.transport.write(b'data') - ret = self.run_loop(t) - self.assertEqual(ret, len(self.DATA)) - - def test_sendfile_no_fallback_for_fallback_transport(self): - transport = mock.Mock() - transport.is_closing.side_effect = lambda: False - transport._sendfile_compatible = constants._SendfileMode.FALLBACK - with self.assertRaisesRegex(RuntimeError, 'fallback is disabled'): - self.loop.run_until_complete( - self.loop.sendfile(transport, None, fallback=False)) - - if sys.platform == 'win32': class SelectEventLoopTests(EventLoopTestsMixin, - SendfileMixin, - SockSendfileMixin, test_utils.TestCase): def create_event_loop(self): return asyncio.SelectorEventLoop() class ProactorEventLoopTests(EventLoopTestsMixin, - SendfileMixin, - SockSendfileMixin, SubprocessTestsMixin, test_utils.TestCase): @@ -2469,9 +2022,7 @@ def test_remove_fds_after_closing(self): else: import selectors - class UnixEventLoopTestsMixin(EventLoopTestsMixin, - SendfileMixin, - SockSendfileMixin): + class UnixEventLoopTestsMixin(EventLoopTestsMixin): def setUp(self): super().setUp() watcher = asyncio.SafeChildWatcher() diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py new file mode 100644 index 000000000000..26e44a3348a5 --- /dev/null +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -0,0 +1,550 @@ +"""Tests for sendfile functionality.""" + +import asyncio +import os +import socket +import sys +import tempfile +import unittest +from asyncio import base_events +from asyncio import constants +from unittest import mock +from test import support +from test.test_asyncio import utils as test_utils + +try: + import ssl +except ImportError: + ssl = None + + +class MySendfileProto(asyncio.Protocol): + + def __init__(self, loop=None, close_after=0): + self.transport = None + self.state = 'INITIAL' + self.nbytes = 0 + if loop is not None: + self.connected = loop.create_future() + self.done = loop.create_future() + self.data = bytearray() + self.close_after = close_after + + def connection_made(self, transport): + self.transport = transport + assert self.state == 'INITIAL', self.state + self.state = 'CONNECTED' + if self.connected: + self.connected.set_result(None) + + def eof_received(self): + assert self.state == 'CONNECTED', self.state + self.state = 'EOF' + + def connection_lost(self, exc): + assert self.state in ('CONNECTED', 'EOF'), self.state + self.state = 'CLOSED' + if self.done: + self.done.set_result(None) + + def data_received(self, data): + assert self.state == 'CONNECTED', self.state + self.nbytes += len(data) + self.data.extend(data) + super().data_received(data) + if self.close_after and self.nbytes >= self.close_after: + self.transport.close() + + +class MyProto(asyncio.Protocol): + + def __init__(self, loop): + self.started = False + self.closed = False + self.data = bytearray() + self.fut = loop.create_future() + self.transport = None + + def connection_made(self, transport): + self.started = True + self.transport = transport + + def data_received(self, data): + self.data.extend(data) + + def connection_lost(self, exc): + self.closed = True + self.fut.set_result(None) + + async def wait_closed(self): + await self.fut + + +class SendfileBase: + + DATA = b"SendfileBaseData" * (1024 * 8) # 128 KiB + + # Reduce socket buffer size to test on relative small data sets. + BUF_SIZE = 4 * 1024 # 4 KiB + + def create_event_loop(self): + raise NotImplementedError + + @classmethod + def setUpClass(cls): + with open(support.TESTFN, 'wb') as fp: + fp.write(cls.DATA) + super().setUpClass() + + @classmethod + def tearDownClass(cls): + support.unlink(support.TESTFN) + super().tearDownClass() + + def setUp(self): + self.file = open(support.TESTFN, 'rb') + self.addCleanup(self.file.close) + self.loop = self.create_event_loop() + self.set_event_loop(self.loop) + super().setUp() + + def tearDown(self): + # just in case if we have transport close callbacks + if not self.loop.is_closed(): + test_utils.run_briefly(self.loop) + + self.doCleanups() + support.gc_collect() + super().tearDown() + + def run_loop(self, coro): + return self.loop.run_until_complete(coro) + + +class SockSendfileMixin(SendfileBase): + + @classmethod + def setUpClass(cls): + cls.__old_bufsize = constants.SENDFILE_FALLBACK_READBUFFER_SIZE + constants.SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 16 + super().setUpClass() + + @classmethod + def tearDownClass(cls): + constants.SENDFILE_FALLBACK_READBUFFER_SIZE = cls.__old_bufsize + super().tearDownClass() + + def make_socket(self, cleanup=True): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.setblocking(False) + if cleanup: + self.addCleanup(sock.close) + return sock + + def reduce_receive_buffer_size(self, sock): + # Reduce receive socket buffer size to test on relative + # small data sets. + sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, self.BUF_SIZE) + + def reduce_send_buffer_size(self, sock, transport=None): + # Reduce send socket buffer size to test on relative small data sets. + + # On macOS, SO_SNDBUF is reset by connect(). So this method + # should be called after the socket is connected. + sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.BUF_SIZE) + + if transport is not None: + transport.set_write_buffer_limits(high=self.BUF_SIZE) + + def prepare_socksendfile(self): + proto = MyProto(self.loop) + port = support.find_unused_port() + srv_sock = self.make_socket(cleanup=False) + srv_sock.bind((support.HOST, port)) + server = self.run_loop(self.loop.create_server( + lambda: proto, sock=srv_sock)) + self.reduce_receive_buffer_size(srv_sock) + + sock = self.make_socket() + self.run_loop(self.loop.sock_connect(sock, ('127.0.0.1', port))) + self.reduce_send_buffer_size(sock) + + def cleanup(): + if proto.transport is not None: + # can be None if the task was cancelled before + # connection_made callback + proto.transport.close() + self.run_loop(proto.wait_closed()) + + server.close() + self.run_loop(server.wait_closed()) + + self.addCleanup(cleanup) + + return sock, proto + + def test_sock_sendfile_success(self): + sock, proto = self.prepare_socksendfile() + ret = self.run_loop(self.loop.sock_sendfile(sock, self.file)) + sock.close() + self.run_loop(proto.wait_closed()) + + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(proto.data, self.DATA) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sock_sendfile_with_offset_and_count(self): + sock, proto = self.prepare_socksendfile() + ret = self.run_loop(self.loop.sock_sendfile(sock, self.file, + 1000, 2000)) + sock.close() + self.run_loop(proto.wait_closed()) + + self.assertEqual(proto.data, self.DATA[1000:3000]) + self.assertEqual(self.file.tell(), 3000) + self.assertEqual(ret, 2000) + + def test_sock_sendfile_zero_size(self): + sock, proto = self.prepare_socksendfile() + with tempfile.TemporaryFile() as f: + ret = self.run_loop(self.loop.sock_sendfile(sock, f, + 0, None)) + sock.close() + self.run_loop(proto.wait_closed()) + + self.assertEqual(ret, 0) + self.assertEqual(self.file.tell(), 0) + + def test_sock_sendfile_mix_with_regular_send(self): + buf = b"mix_regular_send" * (4 * 1024) # 64 KiB + sock, proto = self.prepare_socksendfile() + self.run_loop(self.loop.sock_sendall(sock, buf)) + ret = self.run_loop(self.loop.sock_sendfile(sock, self.file)) + self.run_loop(self.loop.sock_sendall(sock, buf)) + sock.close() + self.run_loop(proto.wait_closed()) + + self.assertEqual(ret, len(self.DATA)) + expected = buf + self.DATA + buf + self.assertEqual(proto.data, expected) + self.assertEqual(self.file.tell(), len(self.DATA)) + + +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() + srv_proto = MySendfileProto(loop=self.loop, + close_after=close_after) + if is_ssl: + if not ssl: + self.skipTest("No ssl module") + srv_ctx = test_utils.simple_server_sslcontext() + cli_ctx = test_utils.simple_client_sslcontext() + else: + srv_ctx = None + cli_ctx = None + srv_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + srv_sock.bind((support.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 + else: + server_hostname = None + cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + cli_sock.connect((support.HOST, port)) + + cli_proto = MySendfileProto(loop=self.loop) + tr, pr = self.run_loop(self.loop.create_connection( + lambda: cli_proto, sock=cli_sock, + ssl=cli_ctx, server_hostname=server_hostname)) + self.reduce_send_buffer_size(cli_sock, transport=tr) + + def cleanup(): + srv_proto.transport.close() + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.run_loop(cli_proto.done) + + server.close() + self.run_loop(server.wait_closed()) + + self.addCleanup(cleanup) + return srv_proto, cli_proto + + @unittest.skipIf(sys.platform == 'win32', "UDP sockets are not supported") + def test_sendfile_not_supported(self): + tr, pr = self.run_loop( + self.loop.create_datagram_endpoint( + asyncio.DatagramProtocol, + family=socket.AF_INET)) + try: + with self.assertRaisesRegex(RuntimeError, "not supported"): + self.run_loop( + self.loop.sendfile(tr, self.file)) + self.assertEqual(0, self.file.tell()) + finally: + # don't use self.addCleanup because it produces resource warning + tr.close() + + def test_sendfile(self): + srv_proto, cli_proto = self.prepare_sendfile() + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.nbytes, len(self.DATA)) + self.assertEqual(srv_proto.data, self.DATA) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_force_fallback(self): + srv_proto, cli_proto = self.prepare_sendfile() + + def sendfile_native(transp, file, offset, count): + # to raise SendfileNotAvailableError + return base_events.BaseEventLoop._sendfile_native( + self.loop, transp, file, offset, count) + + self.loop._sendfile_native = sendfile_native + + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.nbytes, len(self.DATA)) + self.assertEqual(srv_proto.data, self.DATA) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_force_unsupported_native(self): + if sys.platform == 'win32': + if isinstance(self.loop, asyncio.ProactorEventLoop): + self.skipTest("Fails on proactor event loop") + srv_proto, cli_proto = self.prepare_sendfile() + + def sendfile_native(transp, file, offset, count): + # to raise SendfileNotAvailableError + return base_events.BaseEventLoop._sendfile_native( + self.loop, transp, file, offset, count) + + self.loop._sendfile_native = sendfile_native + + with self.assertRaisesRegex(asyncio.SendfileNotAvailableError, + "not supported"): + self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file, + fallback=False)) + + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(srv_proto.nbytes, 0) + self.assertEqual(self.file.tell(), 0) + + def test_sendfile_ssl(self): + srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True) + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.nbytes, len(self.DATA)) + self.assertEqual(srv_proto.data, self.DATA) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_for_closing_transp(self): + srv_proto, cli_proto = self.prepare_sendfile() + cli_proto.transport.close() + with self.assertRaisesRegex(RuntimeError, "is closing"): + self.run_loop(self.loop.sendfile(cli_proto.transport, self.file)) + self.run_loop(srv_proto.done) + self.assertEqual(srv_proto.nbytes, 0) + self.assertEqual(self.file.tell(), 0) + + def test_sendfile_pre_and_post_data(self): + srv_proto, cli_proto = self.prepare_sendfile() + PREFIX = b'PREFIX__' * 1024 # 8 KiB + SUFFIX = b'--SUFFIX' * 1024 # 8 KiB + cli_proto.transport.write(PREFIX) + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + cli_proto.transport.write(SUFFIX) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.data, PREFIX + self.DATA + SUFFIX) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_ssl_pre_and_post_data(self): + srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True) + PREFIX = b'zxcvbnm' * 1024 + SUFFIX = b'0987654321' * 1024 + cli_proto.transport.write(PREFIX) + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + cli_proto.transport.write(SUFFIX) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.data, PREFIX + self.DATA + SUFFIX) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_partial(self): + srv_proto, cli_proto = self.prepare_sendfile() + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file, 1000, 100)) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, 100) + self.assertEqual(srv_proto.nbytes, 100) + self.assertEqual(srv_proto.data, self.DATA[1000:1100]) + self.assertEqual(self.file.tell(), 1100) + + def test_sendfile_ssl_partial(self): + srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True) + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file, 1000, 100)) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, 100) + self.assertEqual(srv_proto.nbytes, 100) + self.assertEqual(srv_proto.data, self.DATA[1000:1100]) + self.assertEqual(self.file.tell(), 1100) + + def test_sendfile_close_peer_after_receiving(self): + srv_proto, cli_proto = self.prepare_sendfile( + close_after=len(self.DATA)) + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + cli_proto.transport.close() + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.nbytes, len(self.DATA)) + self.assertEqual(srv_proto.data, self.DATA) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_ssl_close_peer_after_receiving(self): + srv_proto, cli_proto = self.prepare_sendfile( + is_ssl=True, close_after=len(self.DATA)) + ret = self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + self.run_loop(srv_proto.done) + self.assertEqual(ret, len(self.DATA)) + self.assertEqual(srv_proto.nbytes, len(self.DATA)) + self.assertEqual(srv_proto.data, self.DATA) + self.assertEqual(self.file.tell(), len(self.DATA)) + + def test_sendfile_close_peer_in_the_middle_of_receiving(self): + srv_proto, cli_proto = self.prepare_sendfile(close_after=1024) + with self.assertRaises(ConnectionError): + self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + self.run_loop(srv_proto.done) + + self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA), + srv_proto.nbytes) + self.assertTrue(1024 <= self.file.tell() < len(self.DATA), + self.file.tell()) + self.assertTrue(cli_proto.transport.is_closing()) + + def test_sendfile_fallback_close_peer_in_the_middle_of_receiving(self): + + def sendfile_native(transp, file, offset, count): + # to raise SendfileNotAvailableError + return base_events.BaseEventLoop._sendfile_native( + self.loop, transp, file, offset, count) + + self.loop._sendfile_native = sendfile_native + + srv_proto, cli_proto = self.prepare_sendfile(close_after=1024) + with self.assertRaises(ConnectionError): + self.run_loop( + self.loop.sendfile(cli_proto.transport, self.file)) + self.run_loop(srv_proto.done) + + self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA), + srv_proto.nbytes) + self.assertTrue(1024 <= self.file.tell() < len(self.DATA), + self.file.tell()) + + @unittest.skipIf(not hasattr(os, 'sendfile'), + "Don't have native sendfile support") + def test_sendfile_prevents_bare_write(self): + srv_proto, cli_proto = self.prepare_sendfile() + fut = self.loop.create_future() + + async def coro(): + fut.set_result(None) + return await self.loop.sendfile(cli_proto.transport, self.file) + + t = self.loop.create_task(coro()) + self.run_loop(fut) + with self.assertRaisesRegex(RuntimeError, + "sendfile is in progress"): + cli_proto.transport.write(b'data') + ret = self.run_loop(t) + self.assertEqual(ret, len(self.DATA)) + + def test_sendfile_no_fallback_for_fallback_transport(self): + transport = mock.Mock() + transport.is_closing.side_effect = lambda: False + transport._sendfile_compatible = constants._SendfileMode.FALLBACK + with self.assertRaisesRegex(RuntimeError, 'fallback is disabled'): + self.loop.run_until_complete( + self.loop.sendfile(transport, None, fallback=False)) + + +class SendfileTestsBase(SendfileMixin, SockSendfileMixin): + pass + + +if sys.platform == 'win32': + + class SelectEventLoopTests(SendfileTestsBase, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop() + + class ProactorEventLoopTests(SendfileTestsBase, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.ProactorEventLoop() + +else: + import selectors + + if hasattr(selectors, 'KqueueSelector'): + class KqueueEventLoopTests(SendfileTestsBase, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop( + selectors.KqueueSelector()) + + if hasattr(selectors, 'EpollSelector'): + class EPollEventLoopTests(SendfileTestsBase, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.EpollSelector()) + + if hasattr(selectors, 'PollSelector'): + class PollEventLoopTests(SendfileTestsBase, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.PollSelector()) + + # Should always exist. + class SelectEventLoopTests(SendfileTestsBase, + test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.SelectSelector()) From solipsis at pitrou.net Tue Oct 9 05:08:11 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 09 Oct 2018 09:08:11 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=9 Message-ID: <20181009090811.1.7148405AF3E6878F@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 0, 3] memory blocks, sum=3 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, 2, 0] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogeqSzOc', '--timeout', '7200'] From webhook-mailer at python.org Tue Oct 9 10:32:00 2018 From: webhook-mailer at python.org (Giampaolo Rodola) Date: Tue, 09 Oct 2018 14:32:00 -0000 Subject: [Python-checkins] bpo-32680 add default "sock" on SMTP objects (#5345) Message-ID: https://github.com/python/cpython/commit/7b313971805ca9b53f181f7b97e5376d0b89dc06 commit: 7b313971805ca9b53f181f7b97e5376d0b89dc06 branch: master author: Romuald Brunet committer: Giampaolo Rodola date: 2018-10-09T16:31:55+02:00 summary: bpo-32680 add default "sock" on SMTP objects (#5345) By default the smtplib.SMTP objects did not have a sock attribute, it was only created during connect() files: A Misc/NEWS.d/next/Library/2018-10-09-14-25-36.bpo-32680.z2FbOp.rst M Lib/smtplib.py M Lib/test/test_smtplib.py diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 5e1bc0b198ed..acfc3586e1c0 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -216,6 +216,8 @@ class SMTP: method called 'sendmail' that will do an entire mail transaction. """ debuglevel = 0 + + sock = None file = None helo_resp = None ehlo_msg = "ehlo" @@ -344,7 +346,7 @@ def send(self, s): """Send `s' to the server.""" if self.debuglevel > 0: self._print_debug('send:', repr(s)) - if hasattr(self, 'sock') and self.sock: + if self.sock: if isinstance(s, str): # send is used by the 'data' command, where command_encoding # should not be used, but 'data' needs to convert the string to diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 0c863ed7e203..07d760bd01fd 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -602,6 +602,13 @@ def testNonnumericPort(self): self.assertRaises(OSError, smtplib.SMTP, "localhost:bogus") + def testSockAttributeExists(self): + # check that sock attribute is present outside of a connect() call + # (regression test, the previous behavior raised an + # AttributeError: 'SMTP' object has no attribute 'sock') + with smtplib.SMTP() as smtp: + self.assertIsNone(smtp.sock) + class DefaultArgumentsTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-09-14-25-36.bpo-32680.z2FbOp.rst b/Misc/NEWS.d/next/Library/2018-10-09-14-25-36.bpo-32680.z2FbOp.rst new file mode 100644 index 000000000000..afe16b627c8f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-14-25-36.bpo-32680.z2FbOp.rst @@ -0,0 +1 @@ +:class:`smtplib.SMTP` objects now always have a `sock` attribute present From webhook-mailer at python.org Tue Oct 9 10:54:10 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 09 Oct 2018 14:54:10 -0000 Subject: [Python-checkins] bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) Message-ID: https://github.com/python/cpython/commit/79d21331e605fdc941f947621846b8563485aab6 commit: 79d21331e605fdc941f947621846b8563485aab6 branch: master author: Victor Stinner committer: GitHub date: 2018-10-09T16:54:04+02:00 summary: bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) When Python is built with the intel control-flow protection flags, -mcet -fcf-protection, gdb is not able to read the stack without actually jumping inside the function. This means an extra 'next' command is required to make the $pc (program counter) enter the function and make the stack of the function exposed to gdb. Co-Authored-By: Marcel Plch (cherry picked from commit 9b7c74ca32d1bec7128d550a9ab1b2ddc7046287) files: A Misc/NEWS.d/next/Tests/2018-05-10-16-59-15.bpo-32962.S-rcIN.rst M Lib/test/test_gdb.py diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 93a2c7dd5758..0f950b232533 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -54,6 +54,23 @@ def get_gdb_version(): PYTHONHASHSEED = '123' + +def cet_protection(): + cflags = sysconfig.get_config_var('CFLAGS') + if not cflags: + return False + flags = cflags.split() + # True if "-mcet -fcf-protection" options are found, but false + # if "-fcf-protection=none" or "-fcf-protection=return" is found. + return (('-mcet' in flags) + and any((flag.startswith('-fcf-protection') + and not flag.endswith(("=none", "=return"))) + for flag in flags)) + +# Control-flow enforcement technology +CET_PROTECTION = cet_protection() + + def run_gdb(*args, **env_vars): """Runs gdb in --batch mode with the additional arguments given by *args. @@ -162,6 +179,12 @@ def get_stack_trace(self, source=None, script=None, commands += ['set print entry-values no'] if cmds_after_breakpoint: + if CET_PROTECTION: + # bpo-32962: When Python is compiled with -mcet + # -fcf-protection, function arguments are unusable before + # running the first instruction of the function entry point. + # The 'next' command makes the required first step. + commands += ['next'] commands += cmds_after_breakpoint else: commands += ['backtrace'] @@ -869,9 +892,17 @@ def __init__(self): id("first break point") l = MyList() ''') + cmds_after_breakpoint = ['break wrapper_call', 'continue'] + if CET_PROTECTION: + # bpo-32962: same case as in get_stack_trace(): + # we need an additional 'next' command in order to read + # arguments of the innermost function of the call stack. + cmds_after_breakpoint.append('next') + cmds_after_breakpoint.append('py-bt') + # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, - cmds_after_breakpoint=['break wrapper_call', 'continue', 'py-bt']) + cmds_after_breakpoint=cmds_after_breakpoint) self.assertRegex(gdb_output, r" https://github.com/python/cpython/commit/25bfb1aa75c8358becdab11142954c8ee9c3607f commit: 25bfb1aa75c8358becdab11142954c8ee9c3607f branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-09T08:20:38-07:00 summary: bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) When Python is built with the intel control-flow protection flags, -mcet -fcf-protection, gdb is not able to read the stack without actually jumping inside the function. This means an extra 'next' command is required to make the $pc (program counter) enter the function and make the stack of the function exposed to gdb. Co-Authored-By: Marcel Plch (cherry picked from commit 9b7c74ca32d1bec7128d550a9ab1b2ddc7046287) (cherry picked from commit 79d21331e605fdc941f947621846b8563485aab6) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2018-05-10-16-59-15.bpo-32962.S-rcIN.rst M Lib/test/test_gdb.py diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index bedec1fb493a..b33d007acbdf 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -60,6 +60,23 @@ def get_gdb_version(): PYTHONHASHSEED = '123' + +def cet_protection(): + cflags = sysconfig.get_config_var('CFLAGS') + if not cflags: + return False + flags = cflags.split() + # True if "-mcet -fcf-protection" options are found, but false + # if "-fcf-protection=none" or "-fcf-protection=return" is found. + return (('-mcet' in flags) + and any((flag.startswith('-fcf-protection') + and not flag.endswith(("=none", "=return"))) + for flag in flags)) + +# Control-flow enforcement technology +CET_PROTECTION = cet_protection() + + def run_gdb(*args, **env_vars): """Runs gdb in --batch mode with the additional arguments given by *args. @@ -168,6 +185,12 @@ def get_stack_trace(self, source=None, script=None, commands += ['set print entry-values no'] if cmds_after_breakpoint: + if CET_PROTECTION: + # bpo-32962: When Python is compiled with -mcet + # -fcf-protection, function arguments are unusable before + # running the first instruction of the function entry point. + # The 'next' command makes the required first step. + commands += ['next'] commands += cmds_after_breakpoint else: commands += ['backtrace'] @@ -868,9 +891,17 @@ def __init__(self): id("first break point") l = MyList() ''') + cmds_after_breakpoint = ['break wrapper_call', 'continue'] + if CET_PROTECTION: + # bpo-32962: same case as in get_stack_trace(): + # we need an additional 'next' command in order to read + # arguments of the innermost function of the call stack. + cmds_after_breakpoint.append('next') + cmds_after_breakpoint.append('py-bt') + # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, - cmds_after_breakpoint=['break wrapper_call', 'continue', 'py-bt']) + cmds_after_breakpoint=cmds_after_breakpoint) self.assertRegex(gdb_output, r" https://github.com/python/cpython/commit/0ce31d340b264a550a3c574e1d6913f4affd4669 commit: 0ce31d340b264a550a3c574e1d6913f4affd4669 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-09T08:21:17-07:00 summary: bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) When Python is built with the intel control-flow protection flags, -mcet -fcf-protection, gdb is not able to read the stack without actually jumping inside the function. This means an extra 'next' command is required to make the $pc (program counter) enter the function and make the stack of the function exposed to gdb. Co-Authored-By: Marcel Plch (cherry picked from commit 9b7c74ca32d1bec7128d550a9ab1b2ddc7046287) (cherry picked from commit 79d21331e605fdc941f947621846b8563485aab6) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2018-05-10-16-59-15.bpo-32962.S-rcIN.rst M Lib/test/test_gdb.py diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 93a2c7dd5758..0f950b232533 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -54,6 +54,23 @@ def get_gdb_version(): PYTHONHASHSEED = '123' + +def cet_protection(): + cflags = sysconfig.get_config_var('CFLAGS') + if not cflags: + return False + flags = cflags.split() + # True if "-mcet -fcf-protection" options are found, but false + # if "-fcf-protection=none" or "-fcf-protection=return" is found. + return (('-mcet' in flags) + and any((flag.startswith('-fcf-protection') + and not flag.endswith(("=none", "=return"))) + for flag in flags)) + +# Control-flow enforcement technology +CET_PROTECTION = cet_protection() + + def run_gdb(*args, **env_vars): """Runs gdb in --batch mode with the additional arguments given by *args. @@ -162,6 +179,12 @@ def get_stack_trace(self, source=None, script=None, commands += ['set print entry-values no'] if cmds_after_breakpoint: + if CET_PROTECTION: + # bpo-32962: When Python is compiled with -mcet + # -fcf-protection, function arguments are unusable before + # running the first instruction of the function entry point. + # The 'next' command makes the required first step. + commands += ['next'] commands += cmds_after_breakpoint else: commands += ['backtrace'] @@ -869,9 +892,17 @@ def __init__(self): id("first break point") l = MyList() ''') + cmds_after_breakpoint = ['break wrapper_call', 'continue'] + if CET_PROTECTION: + # bpo-32962: same case as in get_stack_trace(): + # we need an additional 'next' command in order to read + # arguments of the innermost function of the call stack. + cmds_after_breakpoint.append('next') + cmds_after_breakpoint.append('py-bt') + # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, - cmds_after_breakpoint=['break wrapper_call', 'continue', 'py-bt']) + cmds_after_breakpoint=cmds_after_breakpoint) self.assertRegex(gdb_output, r" https://github.com/python/cpython/commit/c880ffe7d2ce2fedb1831918c8a36e3623e0fb76 commit: c880ffe7d2ce2fedb1831918c8a36e3623e0fb76 branch: master author: twisteroid ambassador committer: Yury Selivanov date: 2018-10-09T11:30:21-04:00 summary: bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716) files: A Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst M Lib/asyncio/base_events.py M Lib/test/test_asyncio/test_base_events.py diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 780a06192dcf..3726c556d4f0 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -477,10 +477,7 @@ def _check_closed(self): def _asyncgen_finalizer_hook(self, agen): self._asyncgens.discard(agen) if not self.is_closed(): - self.create_task(agen.aclose()) - # Wake up the loop if the finalizer was called from - # a different thread. - self._write_to_self() + self.call_soon_threadsafe(self.create_task, agen.aclose()) def _asyncgen_firstiter_hook(self, agen): if self._asyncgens_shutdown_called: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index d15a9c6a8139..6d544d1eda86 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -926,6 +926,74 @@ def test_run_forever_pre_stopped(self): self.loop.run_forever() self.loop._selector.select.assert_called_once_with(0) + async def leave_unfinalized_asyncgen(self): + # Create an async generator, iterate it partially, and leave it + # to be garbage collected. + # Used in async generator finalization tests. + # Depends on implementation details of garbage collector. Changes + # in gc may break this function. + status = {'started': False, + 'stopped': False, + 'finalized': False} + + async def agen(): + status['started'] = True + try: + for item in ['ZERO', 'ONE', 'TWO', 'THREE', 'FOUR']: + yield item + finally: + status['finalized'] = True + + ag = agen() + ai = ag.__aiter__() + + async def iter_one(): + try: + item = await ai.__anext__() + except StopAsyncIteration: + return + if item == 'THREE': + status['stopped'] = True + return + asyncio.create_task(iter_one()) + + asyncio.create_task(iter_one()) + return status + + def test_asyncgen_finalization_by_gc(self): + # Async generators should be finalized when garbage collected. + self.loop._process_events = mock.Mock() + self.loop._write_to_self = mock.Mock() + with support.disable_gc(): + status = self.loop.run_until_complete(self.leave_unfinalized_asyncgen()) + while not status['stopped']: + test_utils.run_briefly(self.loop) + self.assertTrue(status['started']) + self.assertTrue(status['stopped']) + self.assertFalse(status['finalized']) + support.gc_collect() + test_utils.run_briefly(self.loop) + self.assertTrue(status['finalized']) + + def test_asyncgen_finalization_by_gc_in_other_thread(self): + # Python issue 34769: If garbage collector runs in another + # thread, async generators will not finalize in debug + # mode. + self.loop._process_events = mock.Mock() + self.loop._write_to_self = mock.Mock() + self.loop.set_debug(True) + with support.disable_gc(): + status = self.loop.run_until_complete(self.leave_unfinalized_asyncgen()) + while not status['stopped']: + test_utils.run_briefly(self.loop) + self.assertTrue(status['started']) + self.assertTrue(status['stopped']) + self.assertFalse(status['finalized']) + self.loop.run_until_complete( + self.loop.run_in_executor(None, support.gc_collect)) + test_utils.run_briefly(self.loop) + self.assertTrue(status['finalized']) + class MyProto(asyncio.Protocol): done = None diff --git a/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst b/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst new file mode 100644 index 000000000000..fc034c962ea2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst @@ -0,0 +1,2 @@ +Fix for async generators not finalizing when event loop is in debug mode and +garbage collector runs in another thread. From webhook-mailer at python.org Tue Oct 9 12:03:40 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 09 Oct 2018 16:03:40 -0000 Subject: [Python-checkins] bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716) Message-ID: https://github.com/python/cpython/commit/41e5ec377b36aa951ac095839d2f74f66ee1e665 commit: 41e5ec377b36aa951ac095839d2f74f66ee1e665 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-09T09:03:35-07:00 summary: bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716) (cherry picked from commit c880ffe7d2ce2fedb1831918c8a36e3623e0fb76) Co-authored-by: twisteroid ambassador files: A Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst M Lib/asyncio/base_events.py M Lib/test/test_asyncio/test_base_events.py diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index a79e123e5113..b3b07554ec19 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -471,10 +471,7 @@ def _check_closed(self): def _asyncgen_finalizer_hook(self, agen): self._asyncgens.discard(agen) if not self.is_closed(): - self.create_task(agen.aclose()) - # Wake up the loop if the finalizer was called from - # a different thread. - self._write_to_self() + self.call_soon_threadsafe(self.create_task, agen.aclose()) def _asyncgen_firstiter_hook(self, agen): if self._asyncgens_shutdown_called: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 8733ac0f566c..59d321e1c691 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -907,6 +907,74 @@ def test_run_forever_pre_stopped(self): self.loop.run_forever() self.loop._selector.select.assert_called_once_with(0) + async def leave_unfinalized_asyncgen(self): + # Create an async generator, iterate it partially, and leave it + # to be garbage collected. + # Used in async generator finalization tests. + # Depends on implementation details of garbage collector. Changes + # in gc may break this function. + status = {'started': False, + 'stopped': False, + 'finalized': False} + + async def agen(): + status['started'] = True + try: + for item in ['ZERO', 'ONE', 'TWO', 'THREE', 'FOUR']: + yield item + finally: + status['finalized'] = True + + ag = agen() + ai = ag.__aiter__() + + async def iter_one(): + try: + item = await ai.__anext__() + except StopAsyncIteration: + return + if item == 'THREE': + status['stopped'] = True + return + asyncio.create_task(iter_one()) + + asyncio.create_task(iter_one()) + return status + + def test_asyncgen_finalization_by_gc(self): + # Async generators should be finalized when garbage collected. + self.loop._process_events = mock.Mock() + self.loop._write_to_self = mock.Mock() + with support.disable_gc(): + status = self.loop.run_until_complete(self.leave_unfinalized_asyncgen()) + while not status['stopped']: + test_utils.run_briefly(self.loop) + self.assertTrue(status['started']) + self.assertTrue(status['stopped']) + self.assertFalse(status['finalized']) + support.gc_collect() + test_utils.run_briefly(self.loop) + self.assertTrue(status['finalized']) + + def test_asyncgen_finalization_by_gc_in_other_thread(self): + # Python issue 34769: If garbage collector runs in another + # thread, async generators will not finalize in debug + # mode. + self.loop._process_events = mock.Mock() + self.loop._write_to_self = mock.Mock() + self.loop.set_debug(True) + with support.disable_gc(): + status = self.loop.run_until_complete(self.leave_unfinalized_asyncgen()) + while not status['stopped']: + test_utils.run_briefly(self.loop) + self.assertTrue(status['started']) + self.assertTrue(status['stopped']) + self.assertFalse(status['finalized']) + self.loop.run_until_complete( + self.loop.run_in_executor(None, support.gc_collect)) + test_utils.run_briefly(self.loop) + self.assertTrue(status['finalized']) + class MyProto(asyncio.Protocol): done = None diff --git a/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst b/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst new file mode 100644 index 000000000000..fc034c962ea2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst @@ -0,0 +1,2 @@ +Fix for async generators not finalizing when event loop is in debug mode and +garbage collector runs in another thread. From webhook-mailer at python.org Tue Oct 9 17:16:47 2018 From: webhook-mailer at python.org (Julien Palard) Date: Tue, 09 Oct 2018 21:16:47 -0000 Subject: [Python-checkins] bpo-23596: Add unit tests for the command line for the gzip module (GH-9775) Message-ID: https://github.com/python/cpython/commit/84eec1199583bcb034e43337bcb8e2b876ebd269 commit: 84eec1199583bcb034e43337bcb8e2b876ebd269 branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-09T23:16:43+02:00 summary: bpo-23596: Add unit tests for the command line for the gzip module (GH-9775) Add unit tests for the command line for the gzip module files: M Lib/test/test_gzip.py diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 295d4d4a8fdf..b072ce4682c0 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -1,14 +1,19 @@ """Test script for the gzip module. """ -import unittest -from test import support -from test.support import bigmemtest, _4G +import array +import functools +import io import os import pathlib -import io import struct -import array +import sys +import unittest +from subprocess import PIPE, Popen +from test import support +from test.support import _4G, bigmemtest +from test.support.script_helper import assert_python_ok + gzip = support.import_module('gzip') data1 = b""" int length=DEFAULTALLOC, err = Z_OK; @@ -24,6 +29,9 @@ """ +TEMPDIR = os.path.abspath(support.TESTFN) + '-gzdir' + + class UnseekableIO(io.BytesIO): def seekable(self): return False @@ -665,8 +673,87 @@ def test_newline(self): with gzip.open(self.filename, "rt", newline="\r") as f: self.assertEqual(f.readlines(), [uncompressed]) + +def create_and_remove_directory(directory): + def decorator(function): + @functools.wraps(function) + def wrapper(*args, **kwargs): + os.makedirs(directory) + try: + return function(*args, **kwargs) + finally: + support.rmtree(directory) + return wrapper + return decorator + + +class TestCommandLine(unittest.TestCase): + data = b'This is a simple test with gzip' + + def test_decompress_stdin_stdout(self): + with io.BytesIO() as bytes_io: + with gzip.GzipFile(fileobj=bytes_io, mode='wb') as gzip_file: + gzip_file.write(self.data) + + args = sys.executable, '-m', 'gzip', '-d' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(bytes_io.getvalue()) + + self.assertEqual(err, b'') + self.assertEqual(out, self.data) + + @create_and_remove_directory(TEMPDIR) + def test_decompress_infile_outfile(self): + gzipname = os.path.join(TEMPDIR, 'testgzip.gz') + self.assertFalse(os.path.exists(gzipname)) + + with gzip.open(gzipname, mode='wb') as fp: + fp.write(self.data) + rc, out, err = assert_python_ok('-m', 'gzip', '-d', gzipname) + + with open(os.path.join(TEMPDIR, "testgzip"), "rb") as gunziped: + self.assertEqual(gunziped.read(), self.data) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(rc, 0) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + + def test_decompress_infile_outfile_error(self): + rc, out, err = assert_python_ok('-m', 'gzip', '-d', 'thisisatest.out') + self.assertIn(b"filename doesn't end in .gz:", out) + self.assertEqual(rc, 0) + self.assertEqual(err, b'') + + @create_and_remove_directory(TEMPDIR) + def test_compress_stdin_outfile(self): + args = sys.executable, '-m', 'gzip' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(self.data) + + self.assertEqual(err, b'') + self.assertEqual(out[:2], b"\x1f\x8b") + + @create_and_remove_directory(TEMPDIR) + def test_compress_infile_outfile(self): + local_testgzip = os.path.join(TEMPDIR, 'testgzip') + gzipname = local_testgzip + '.gz' + self.assertFalse(os.path.exists(gzipname)) + + with open(local_testgzip, 'wb') as fp: + fp.write(self.data) + + rc, out, err = assert_python_ok('-m', 'gzip', local_testgzip) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(rc, 0) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + + def test_main(verbose=None): - support.run_unittest(TestGzip, TestOpen) + support.run_unittest(TestGzip, TestOpen, TestCommandLine) + if __name__ == "__main__": test_main(verbose=True) From webhook-mailer at python.org Tue Oct 9 17:42:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 09 Oct 2018 21:42:31 -0000 Subject: [Python-checkins] bpo-23596: Add unit tests for the command line for the gzip module (GH-9775) Message-ID: https://github.com/python/cpython/commit/482dc9445d834f1d03c501b45fafd422b6eb8c9c commit: 482dc9445d834f1d03c501b45fafd422b6eb8c9c branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-09T14:42:26-07:00 summary: bpo-23596: Add unit tests for the command line for the gzip module (GH-9775) Add unit tests for the command line for the gzip module (cherry picked from commit 84eec1199583bcb034e43337bcb8e2b876ebd269) Co-authored-by: St?phane Wirtel files: M Lib/test/test_gzip.py diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 295d4d4a8fdf..b072ce4682c0 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -1,14 +1,19 @@ """Test script for the gzip module. """ -import unittest -from test import support -from test.support import bigmemtest, _4G +import array +import functools +import io import os import pathlib -import io import struct -import array +import sys +import unittest +from subprocess import PIPE, Popen +from test import support +from test.support import _4G, bigmemtest +from test.support.script_helper import assert_python_ok + gzip = support.import_module('gzip') data1 = b""" int length=DEFAULTALLOC, err = Z_OK; @@ -24,6 +29,9 @@ """ +TEMPDIR = os.path.abspath(support.TESTFN) + '-gzdir' + + class UnseekableIO(io.BytesIO): def seekable(self): return False @@ -665,8 +673,87 @@ def test_newline(self): with gzip.open(self.filename, "rt", newline="\r") as f: self.assertEqual(f.readlines(), [uncompressed]) + +def create_and_remove_directory(directory): + def decorator(function): + @functools.wraps(function) + def wrapper(*args, **kwargs): + os.makedirs(directory) + try: + return function(*args, **kwargs) + finally: + support.rmtree(directory) + return wrapper + return decorator + + +class TestCommandLine(unittest.TestCase): + data = b'This is a simple test with gzip' + + def test_decompress_stdin_stdout(self): + with io.BytesIO() as bytes_io: + with gzip.GzipFile(fileobj=bytes_io, mode='wb') as gzip_file: + gzip_file.write(self.data) + + args = sys.executable, '-m', 'gzip', '-d' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(bytes_io.getvalue()) + + self.assertEqual(err, b'') + self.assertEqual(out, self.data) + + @create_and_remove_directory(TEMPDIR) + def test_decompress_infile_outfile(self): + gzipname = os.path.join(TEMPDIR, 'testgzip.gz') + self.assertFalse(os.path.exists(gzipname)) + + with gzip.open(gzipname, mode='wb') as fp: + fp.write(self.data) + rc, out, err = assert_python_ok('-m', 'gzip', '-d', gzipname) + + with open(os.path.join(TEMPDIR, "testgzip"), "rb") as gunziped: + self.assertEqual(gunziped.read(), self.data) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(rc, 0) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + + def test_decompress_infile_outfile_error(self): + rc, out, err = assert_python_ok('-m', 'gzip', '-d', 'thisisatest.out') + self.assertIn(b"filename doesn't end in .gz:", out) + self.assertEqual(rc, 0) + self.assertEqual(err, b'') + + @create_and_remove_directory(TEMPDIR) + def test_compress_stdin_outfile(self): + args = sys.executable, '-m', 'gzip' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(self.data) + + self.assertEqual(err, b'') + self.assertEqual(out[:2], b"\x1f\x8b") + + @create_and_remove_directory(TEMPDIR) + def test_compress_infile_outfile(self): + local_testgzip = os.path.join(TEMPDIR, 'testgzip') + gzipname = local_testgzip + '.gz' + self.assertFalse(os.path.exists(gzipname)) + + with open(local_testgzip, 'wb') as fp: + fp.write(self.data) + + rc, out, err = assert_python_ok('-m', 'gzip', local_testgzip) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(rc, 0) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + + def test_main(verbose=None): - support.run_unittest(TestGzip, TestOpen) + support.run_unittest(TestGzip, TestOpen, TestCommandLine) + if __name__ == "__main__": test_main(verbose=True) From webhook-mailer at python.org Tue Oct 9 17:43:01 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 09 Oct 2018 21:43:01 -0000 Subject: [Python-checkins] bpo-23596: Add unit tests for the command line for the gzip module (GH-9775) Message-ID: https://github.com/python/cpython/commit/8e23ba021f45df67edd2926a3e3daf6a2a1f0ed8 commit: 8e23ba021f45df67edd2926a3e3daf6a2a1f0ed8 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-09T14:42:58-07:00 summary: bpo-23596: Add unit tests for the command line for the gzip module (GH-9775) Add unit tests for the command line for the gzip module (cherry picked from commit 84eec1199583bcb034e43337bcb8e2b876ebd269) Co-authored-by: St?phane Wirtel files: M Lib/test/test_gzip.py diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 295d4d4a8fdf..b072ce4682c0 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -1,14 +1,19 @@ """Test script for the gzip module. """ -import unittest -from test import support -from test.support import bigmemtest, _4G +import array +import functools +import io import os import pathlib -import io import struct -import array +import sys +import unittest +from subprocess import PIPE, Popen +from test import support +from test.support import _4G, bigmemtest +from test.support.script_helper import assert_python_ok + gzip = support.import_module('gzip') data1 = b""" int length=DEFAULTALLOC, err = Z_OK; @@ -24,6 +29,9 @@ """ +TEMPDIR = os.path.abspath(support.TESTFN) + '-gzdir' + + class UnseekableIO(io.BytesIO): def seekable(self): return False @@ -665,8 +673,87 @@ def test_newline(self): with gzip.open(self.filename, "rt", newline="\r") as f: self.assertEqual(f.readlines(), [uncompressed]) + +def create_and_remove_directory(directory): + def decorator(function): + @functools.wraps(function) + def wrapper(*args, **kwargs): + os.makedirs(directory) + try: + return function(*args, **kwargs) + finally: + support.rmtree(directory) + return wrapper + return decorator + + +class TestCommandLine(unittest.TestCase): + data = b'This is a simple test with gzip' + + def test_decompress_stdin_stdout(self): + with io.BytesIO() as bytes_io: + with gzip.GzipFile(fileobj=bytes_io, mode='wb') as gzip_file: + gzip_file.write(self.data) + + args = sys.executable, '-m', 'gzip', '-d' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(bytes_io.getvalue()) + + self.assertEqual(err, b'') + self.assertEqual(out, self.data) + + @create_and_remove_directory(TEMPDIR) + def test_decompress_infile_outfile(self): + gzipname = os.path.join(TEMPDIR, 'testgzip.gz') + self.assertFalse(os.path.exists(gzipname)) + + with gzip.open(gzipname, mode='wb') as fp: + fp.write(self.data) + rc, out, err = assert_python_ok('-m', 'gzip', '-d', gzipname) + + with open(os.path.join(TEMPDIR, "testgzip"), "rb") as gunziped: + self.assertEqual(gunziped.read(), self.data) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(rc, 0) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + + def test_decompress_infile_outfile_error(self): + rc, out, err = assert_python_ok('-m', 'gzip', '-d', 'thisisatest.out') + self.assertIn(b"filename doesn't end in .gz:", out) + self.assertEqual(rc, 0) + self.assertEqual(err, b'') + + @create_and_remove_directory(TEMPDIR) + def test_compress_stdin_outfile(self): + args = sys.executable, '-m', 'gzip' + with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: + out, err = proc.communicate(self.data) + + self.assertEqual(err, b'') + self.assertEqual(out[:2], b"\x1f\x8b") + + @create_and_remove_directory(TEMPDIR) + def test_compress_infile_outfile(self): + local_testgzip = os.path.join(TEMPDIR, 'testgzip') + gzipname = local_testgzip + '.gz' + self.assertFalse(os.path.exists(gzipname)) + + with open(local_testgzip, 'wb') as fp: + fp.write(self.data) + + rc, out, err = assert_python_ok('-m', 'gzip', local_testgzip) + + self.assertTrue(os.path.exists(gzipname)) + self.assertEqual(rc, 0) + self.assertEqual(out, b'') + self.assertEqual(err, b'') + + def test_main(verbose=None): - support.run_unittest(TestGzip, TestOpen) + support.run_unittest(TestGzip, TestOpen, TestCommandLine) + if __name__ == "__main__": test_main(verbose=True) From webhook-mailer at python.org Tue Oct 9 18:41:43 2018 From: webhook-mailer at python.org (Julien Palard) Date: Tue, 09 Oct 2018 22:41:43 -0000 Subject: [Python-checkins] bpo-23596: Use argparse for the command line of gzip (GH-9781) Message-ID: https://github.com/python/cpython/commit/e8bbc52debfd1b28517946d65db257e6b6d92e29 commit: e8bbc52debfd1b28517946d65db257e6b6d92e29 branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-10T00:41:33+02:00 summary: bpo-23596: Use argparse for the command line of gzip (GH-9781) Co-authored-by: Antony Lee files: A Misc/NEWS.d/next/Tests/2018-10-09-23-51-07.bpo-23596.rdnert.rst M Lib/gzip.py diff --git a/Lib/gzip.py b/Lib/gzip.py index ddc7bda1fecb..a34d01ae36e1 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -532,18 +532,17 @@ def decompress(data): return f.read() -def _test(): - # Act like gzip; with -d, act like gunzip. - # The input file is not deleted, however, nor are any other gzip - # options or features supported. - args = sys.argv[1:] - decompress = args and args[0] == "-d" - if decompress: - args = args[1:] - if not args: - args = ["-"] - for arg in args: - if decompress: +def main(): + from argparse import ArgumentParser + parser = ArgumentParser(description= + "A simple command line interface for the gzip module: act like gzip, " + "but do not delete the input file.") + parser.add_argument("-d", "--decompress", action="store_true", + help="act like gunzip instead of gzip") + parser.add_argument("args", nargs="*", default=["-"], metavar='file') + args = parser.parse_args() + for arg in args.args: + if args.decompress: if arg == "-": f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer) g = sys.stdout.buffer @@ -571,4 +570,4 @@ def _test(): f.close() if __name__ == '__main__': - _test() + main() diff --git a/Misc/NEWS.d/next/Tests/2018-10-09-23-51-07.bpo-23596.rdnert.rst b/Misc/NEWS.d/next/Tests/2018-10-09-23-51-07.bpo-23596.rdnert.rst new file mode 100644 index 000000000000..ef71720c56fb --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-10-09-23-51-07.bpo-23596.rdnert.rst @@ -0,0 +1 @@ +Use argparse for the command line of the gzip module. Patch by Antony Lee From webhook-mailer at python.org Wed Oct 10 02:28:32 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 10 Oct 2018 06:28:32 -0000 Subject: [Python-checkins] bpo-34913: Document gzip command line interface (GH-9782) Message-ID: https://github.com/python/cpython/commit/7c817e620be9013466d4dd008a2f1dbffcf7517e commit: 7c817e620be9013466d4dd008a2f1dbffcf7517e branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-10T08:28:26+02:00 summary: bpo-34913: Document gzip command line interface (GH-9782) files: A Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst M Doc/library/gzip.rst diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index 9c6b72237177..b52dd1a11aa9 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -211,3 +211,38 @@ Example of how to GZIP compress a binary string:: The basic data compression module needed to support the :program:`gzip` file format. +Command Line Interface +---------------------- + +The :mod:`gzip` module provides a simple command line interface to compress or +decompress files. + +Once executed the :mod:`gzip` module keeps the input file(s). + +.. versionchanged:: 3.8 + + Add a new command line interface with a usage. + +Command line options +^^^^^^^^^^^^^^^^^^^^ + +.. cmdoption:: file + + .. code-block:: shell-session + + $ python -m gzip file + + If *file* is not specified, read from :attr:`sys.stdin`. + +.. cmdoption:: -d, --decompress + + Decompress the given file + + .. code-block:: shell-session + + $ python -m gzip -d file.gz + +.. cmdoption:: -h, --help + + Show the help message. + diff --git a/Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst b/Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst new file mode 100644 index 000000000000..e8a11761477c --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst @@ -0,0 +1 @@ +Add documentation about the new command line interface of the gzip module. From webhook-mailer at python.org Wed Oct 10 02:43:13 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 10 Oct 2018 06:43:13 -0000 Subject: [Python-checkins] Convert code of conduct to markdown for Github (GH-9776) Message-ID: https://github.com/python/cpython/commit/d0bb5d73cb2a44044cc314bc2cb68407b27eddb6 commit: d0bb5d73cb2a44044cc314bc2cb68407b27eddb6 branch: master author: Ammar Askar committer: Julien Palard date: 2018-10-10T08:43:08+02:00 summary: Convert code of conduct to markdown for Github (GH-9776) files: A CODE_OF_CONDUCT.md D CODE_OF_CONDUCT.rst diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..ed15b520548c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,12 @@ +# Code of Conduct + +Please note that all interactions on +[Python Software Foundation](https://www.python.org/psf-landing/)-supported +infrastructure is [covered](https://www.python.org/psf/records/board/minutes/2014-01-06/#management-of-the-psfs-web-properties>) +by the [PSF Code of Conduct](https://www.python.org/psf/codeofconduct/), +which includes all infrastructure used in the development of Python itself +(e.g. mailing lists, issue trackers, GitHub, etc.). + +In general this means everyone is expected to be open, considerate, and +respectful of others no matter what their position is within the project. + diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst deleted file mode 100644 index 28de97ced168..000000000000 --- a/CODE_OF_CONDUCT.rst +++ /dev/null @@ -1,14 +0,0 @@ -Code of Conduct -=============== - -Please note that all interactions on -`Python Software Foundation `__-supported -infrastructure is `covered -`__ -by the `PSF Code of Conduct `__, -which includes all infrastructure used in the development of Python itself -(e.g. mailing lists, issue trackers, GitHub, etc.). - -In general this means everyone is expected to be open, considerate, and -respectful of others no matter what their position is within the project. - From webhook-mailer at python.org Wed Oct 10 03:40:23 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 10 Oct 2018 07:40:23 -0000 Subject: [Python-checkins] bpo-33613: Fix test_semaphore_tracker signal tests when using -Werror (GH-9778) Message-ID: https://github.com/python/cpython/commit/3058b7d85697f95573fa042d6b9e4d6e2a9e739c commit: 3058b7d85697f95573fa042d6b9e4d6e2a9e739c branch: master author: Pablo Galindo committer: GitHub date: 2018-10-10T08:40:14+01:00 summary: bpo-33613: Fix test_semaphore_tracker signal tests when using -Werror (GH-9778) Tests involving sending signals to the semaphore_tracker will not fail anymore due to the fact that running the test suite with -Werror propagates warnings as errors. Fix a missing assertion when the semaphore_tracker is expected to die. files: M Lib/test/_test_multiprocessing.py diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 71f40a0c5a48..814aae8fa375 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -4548,7 +4548,8 @@ def check_semaphore_tracker_death(self, signum, should_die): if pid is not None: os.kill(pid, signal.SIGKILL) os.waitpid(pid, 0) - with warnings.catch_warnings(record=True) as all_warn: + with warnings.catch_warnings(): + warnings.simplefilter("ignore") _semaphore_tracker.ensure_running() pid = _semaphore_tracker._pid @@ -4557,6 +4558,7 @@ def check_semaphore_tracker_death(self, signum, should_die): ctx = multiprocessing.get_context("spawn") with warnings.catch_warnings(record=True) as all_warn: + warnings.simplefilter("always") sem = ctx.Semaphore() sem.acquire() sem.release() @@ -4569,7 +4571,7 @@ def check_semaphore_tracker_death(self, signum, should_die): if should_die: self.assertEqual(len(all_warn), 1) the_warn = all_warn[0] - issubclass(the_warn.category, UserWarning) + self.assertTrue(issubclass(the_warn.category, UserWarning)) self.assertTrue("semaphore_tracker: process died" in str(the_warn.message)) else: From solipsis at pitrou.net Wed Oct 10 05:14:17 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 10 Oct 2018 09:14:17 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=7 Message-ID: <20181010091417.1.AA91B3CE17962A65@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 3, 0] memory blocks, sum=3 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogUOpP0A', '--timeout', '7200'] From webhook-mailer at python.org Wed Oct 10 06:54:07 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 10 Oct 2018 10:54:07 -0000 Subject: [Python-checkins] bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) (GH-9788) Message-ID: https://github.com/python/cpython/commit/b274f1ce5c62dd517338b8323fb9eb5aaa09c7cd commit: b274f1ce5c62dd517338b8323fb9eb5aaa09c7cd branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-10-10T12:54:04+02:00 summary: bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) (GH-9788) When Python is built with the intel control-flow protection flags, -mcet -fcf-protection, gdb is not able to read the stack without actually jumping inside the function. This means an extra 'next' command is required to make the $pc (program counter) enter the function and make the stack of the function exposed to gdb. test_gdb: get_gdb_repr() now uses the "backtrace 1" command after breakpoint, as in the master branch. Co-Authored-By: Marcel Plch (cherry picked from commit 9b7c74ca32d1bec7128d550a9ab1b2ddc7046287) (cherry picked from commit 79d21331e605fdc941f947621846b8563485aab6) files: A Misc/NEWS.d/next/Tests/2018-05-10-16-59-15.bpo-32962.S-rcIN.rst M Lib/test/test_gdb.py diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index c45fd45735cd..118dbbf0d9ef 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -58,6 +58,23 @@ def get_gdb_version(): checkout_hook_path = os.path.join(os.path.dirname(sys.executable), 'python-gdb.py') + +def cet_protection(): + cflags = sysconfig.get_config_var('CFLAGS') + if not cflags: + return False + flags = cflags.split() + # True if "-mcet -fcf-protection" options are found, but false + # if "-fcf-protection=none" or "-fcf-protection=return" is found. + return (('-mcet' in flags) + and any((flag.startswith('-fcf-protection') + and not flag.endswith(("=none", "=return"))) + for flag in flags)) + +# Control-flow enforcement technology +CET_PROTECTION = cet_protection() + + def run_gdb(*args, **env_vars): """Runs gdb in batch mode with the additional arguments given by *args. @@ -171,6 +188,12 @@ def get_stack_trace(self, source=None, script=None, commands += ['set print entry-values no'] if cmds_after_breakpoint: + if CET_PROTECTION: + # bpo-32962: When Python is compiled with -mcet + # -fcf-protection, function arguments are unusable before + # running the first instruction of the function entry point. + # The 'next' command makes the required first step. + commands += ['next'] commands += cmds_after_breakpoint else: commands += ['backtrace'] @@ -241,6 +264,11 @@ def get_gdb_repr(self, source, # # For a nested structure, the first time we hit the breakpoint will # give us the top-level structure + + # NOTE: avoid decoding too much of the traceback as some + # undecodable characters may lurk there in optimized mode + # (issue #19743). + cmds_after_breakpoint = cmds_after_breakpoint or ["backtrace 1"] gdb_output = self.get_stack_trace(source, breakpoint='PyObject_Print', cmds_after_breakpoint=cmds_after_breakpoint, import_site=import_site) @@ -886,9 +914,17 @@ def __init__(self): print("first break point") l = MyList() ''') + cmds_after_breakpoint = ['break wrapper_call', 'continue'] + if CET_PROTECTION: + # bpo-32962: same case as in get_stack_trace(): + # we need an additional 'next' command in order to read + # arguments of the innermost function of the call stack. + cmds_after_breakpoint.append('next') + cmds_after_breakpoint.append('py-bt') + # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, - cmds_after_breakpoint=['break wrapper_call', 'continue', 'py-bt']) + cmds_after_breakpoint=cmds_after_breakpoint) self.assertRegexpMatches(gdb_output, r" https://github.com/python/cpython/commit/a4910c2498b15555d6ad61d5ae34ba991d61d6a3 commit: a4910c2498b15555d6ad61d5ae34ba991d61d6a3 branch: 3.7 author: St?phane Wirtel committer: Julien Palard date: 2018-10-10T15:39:17+02:00 summary: [3.7] bpo-34906: Doc: Fix typos (2) (GH-9735) (cherry picked from commit 683281f536981da395575b5a07d6761118259fd2) files: M Doc/whatsnew/3.3.rst M Doc/whatsnew/3.5.rst M Doc/whatsnew/3.7.rst M Lib/idlelib/NEWS.txt M Misc/HISTORY M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.0a2.rst M Misc/NEWS.d/3.5.0a3.rst M Misc/NEWS.d/3.5.0a4.rst M Misc/NEWS.d/3.5.1rc1.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.5.4rc1.rst M Misc/NEWS.d/3.6.0a1.rst M Misc/NEWS.d/3.6.0a2.rst M Misc/NEWS.d/3.6.0a3.rst M Misc/NEWS.d/3.6.0a4.rst M Misc/NEWS.d/3.6.0b1.rst M Misc/NEWS.d/3.6.2rc2.rst M Misc/NEWS.d/3.6.3rc1.rst M Misc/NEWS.d/3.6.4rc1.rst M Misc/NEWS.d/3.6.6rc1.rst M Misc/NEWS.d/3.7.0a1.rst M Misc/NEWS.d/3.7.0a3.rst M Misc/NEWS.d/3.7.0b2.rst M Misc/NEWS.d/3.7.0b3.rst M Misc/NEWS.d/3.7.0b5.rst M Modules/_ctypes/libffi_msvc/win32.c diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 0575ac9e6818..8862b37e0628 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -303,7 +303,7 @@ The launcher can also be used explicitly from the command line as the ``py`` application. Running ``py`` follows the same version selection rules as implicitly launching scripts, but a more specific version can be selected by passing appropriate arguments (such as ``-3`` to request Python 3 when -Python 2 is also installed, or ``-2.6`` to specifclly request an earlier +Python 2 is also installed, or ``-2.6`` to specifically request an earlier Python version when a more recent version is installed). In addition to the launcher, the Windows installer now includes an @@ -2386,7 +2386,7 @@ Porting Python code finder, you will need to remove keys paired with values of ``None`` **and** :class:`imp.NullImporter` to be backwards-compatible. This will lead to extra overhead on older versions of Python that re-insert ``None`` into - :attr:`sys.path_importer_cache` where it repesents the use of implicit + :attr:`sys.path_importer_cache` where it represents the use of implicit finders, but semantically it should not change anything. * :class:`importlib.abc.Finder` no longer specifies a `find_module()` abstract diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index d3aed84d250e..4eddf841dcbe 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -2471,7 +2471,7 @@ Changes in the Python API parameter to help control the ``opt-`` tag. Because of this, the *debug_override* parameter of the function is now deprecated. `.pyo` files are also no longer supported as a file argument to the Python interpreter and - thus serve no purpose when distributed on their own (i.e. sourcless code + thus serve no purpose when distributed on their own (i.e. sourceless code distribution). Due to the fact that the magic number for bytecode has changed in Python 3.5, all old `.pyo` files from previous versions of Python are invalid regardless of this PEP. diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 4b6fe8a7c944..9cc79325460e 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1355,7 +1355,7 @@ feature. Instances must be created with :class:`~ssl.SSLContext` methods OpenSSL 1.1 APIs for setting the minimum and maximum TLS protocol version are available as :attr:`SSLContext.minimum_version ` and :attr:`SSLContext.maximum_version `. -Supported protocols are indicated by serveral new flags, such as +Supported protocols are indicated by several new flags, such as :data:`~ssl.HAS_TLSv1_1`. (Contributed by Christian Heimes in :issue:`32609`.) @@ -2036,7 +2036,7 @@ Use :mod:`threading` instead. socket ------ -The silent argument value trunctation in :func:`socket.htons` and +The silent argument value truncation in :func:`socket.htons` and :func:`socket.ntohs` has been deprecated. In future versions of Python, if the passed argument is larger than 16 bits, an exception will be raised. (Contributed by Oren Milman in :issue:`28332`.) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 3bfe01fa4fbb..133807c447b9 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -222,7 +222,7 @@ To see the example in action, enable it on options extensions tab. bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. bpo-31414: Fix tk entry box tests by deleting first. Adding to an int entry is not the same as deleting and inserting @@ -460,7 +460,7 @@ Released on 2016-12-23 -w option but without -jn. Fix warning from test_config. - Issue #27621: Put query response validation error messages in the query - box itself instead of in a separate massagebox. Redo tests to match. + box itself instead of in a separate messagebox. Redo tests to match. Add Mac OSX refinements. Original patch by Mark Roseman. - Issue #27620: Escape key now closes Query box as cancelled. @@ -526,7 +526,7 @@ Released on 2016-12-23 - Issue #27239: idlelib.macosx.isXyzTk functions initialize as needed. -- Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx. +- Issue #27262: move Aqua unbinding code, which enable context menus, to macosx. - Issue #24759: Make clear in idlelib.idle_test.__init__ that the directory is a private implementation of test.test_idle and tool for maintainers. diff --git a/Misc/HISTORY b/Misc/HISTORY index d4a1b16a7c04..f4b756cf0a46 100644 --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -629,7 +629,7 @@ Library - Issue #21560: An attempt to write a data of wrong type no longer cause GzipFile corruption. Original patch by Wolfgang Maier. -- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes. +- Issue #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. - Issue #23539: If body is None, http.client.HTTPConnection.request now sets Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from @@ -677,7 +677,7 @@ Library - Issue #23521: Corrected pure python implementation of timedelta division. * Eliminated OverflowError from timedelta * float for some floats; - * Corrected rounding in timedlta true division. + * Corrected rounding in timedelta true division. - Issue #21619: Popen objects no longer leave a zombie after exit in the with statement if the pipe was broken. Patch by Martin Panter. @@ -966,7 +966,7 @@ Core and Builtins returned NotImplemented. Original patch by Martin Panter. - Issue #23321: Fixed a crash in str.decode() when error handler returned - replacment string longer than mailformed input data. + replacement string longer than malformed input data. - Issue #23048: Fix jumping out of an infinite while loop in the pdb. @@ -1042,7 +1042,7 @@ Library - Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" as they are written in the standard. -- Issue #23063: In the disutils' check command, fix parsing of reST with code or +- Issue #23063: In the distutils' check command, fix parsing of reST with code or code-block directives. - Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal @@ -9956,7 +9956,7 @@ Library ensure that it will be found regardless of the shell PATH. This ensures that multiprocessing.cpu_count works on default installs of MacOSX. -- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is +- Issue #11501: distutils.archive_utils.make_zipfile no longer fails if zlib is not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart. diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index f5e1e5ae05d2..7eb8326a012f 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -75,8 +75,8 @@ NotImplemented. Original patch by Martin Panter. .. nonce: HQelge .. section: Core and Builtins -Fixed a crash in str.decode() when error handler returned replacment string -longer than mailformed input data. +Fixed a crash in str.decode() when error handler returned replacement string +longer than malformed input data. .. @@ -998,7 +998,7 @@ written in the standard. .. nonce: 9-UJRs .. section: Library -In the disutils' check command, fix parsing of reST with code or code-block +In the distutils' check command, fix parsing of reST with code or code-block directives. .. @@ -2877,7 +2877,7 @@ closed socket. repr(socket.socket) already works fine. .. nonce: nkBNci .. section: Library -Reprs of most Python implemened classes now contain actual class name +Reprs of most Python implemented classes now contain actual class name instead of hardcoded one. .. @@ -3036,7 +3036,7 @@ by Phil Elson. os.read() now uses a :c:func:`Py_ssize_t` type instead of :c:type:`int` for the size to support reading more than 2 GB at once. On Windows, the size is -truncted to INT_MAX. As any call to os.read(), the OS may read less bytes +truncated to INT_MAX. As any call to os.read(), the OS may read less bytes than the number of requested bytes. .. diff --git a/Misc/NEWS.d/3.5.0a2.rst b/Misc/NEWS.d/3.5.0a2.rst index 80bf9e8e556a..b16acdb3822d 100644 --- a/Misc/NEWS.d/3.5.0a2.rst +++ b/Misc/NEWS.d/3.5.0a2.rst @@ -114,7 +114,7 @@ Lawrence. Corrected pure python implementation of timedelta division. Eliminated OverflowError from ``timedelta * float`` for some floats; -Corrected rounding in timedlta true division. +Corrected rounding in timedelta true division. .. diff --git a/Misc/NEWS.d/3.5.0a3.rst b/Misc/NEWS.d/3.5.0a3.rst index 2c62799dab67..0e5d7c599d32 100644 --- a/Misc/NEWS.d/3.5.0a3.rst +++ b/Misc/NEWS.d/3.5.0a3.rst @@ -239,7 +239,7 @@ Added support for writing ZIP files to unseekable streams. .. nonce: pX2qrx .. section: Library -Increase impalib's MAXLINE to accommodate modern mailbox sizes. +Increase imaplib's MAXLINE to accommodate modern mailbox sizes. .. diff --git a/Misc/NEWS.d/3.5.0a4.rst b/Misc/NEWS.d/3.5.0a4.rst index 9b162bb5f86a..eb63a834f07f 100644 --- a/Misc/NEWS.d/3.5.0a4.rst +++ b/Misc/NEWS.d/3.5.0a4.rst @@ -482,7 +482,7 @@ sqlite3.Row now supports slice indexing. .. nonce: 89RHm- .. section: Library -Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambigious reverse +Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambiguous reverse mappings. Added many new mappings. Import mapping is no longer applied to modules already mapped with full name mapping. diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst index bb2d84a01099..efefaa14fdaa 100644 --- a/Misc/NEWS.d/3.5.1rc1.rst +++ b/Misc/NEWS.d/3.5.1rc1.rst @@ -191,7 +191,7 @@ comprehensions correspond to the opening brace. Hide the private _Py_atomic_xxx symbols from the public Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() becomes an alias to -PyThreadState_Get() to avoid ABI incompatibilies. +PyThreadState_Get() to avoid ABI incompatibilities. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 6a07020c0ac4..3d513b3b9af8 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -1366,7 +1366,7 @@ fileinput now uses sys.stdin as-is if it does not have a buffer attribute .. nonce: AtHkWA .. section: Library -Copying the lru_cache() wrapper object now always works, independedly from +Copying the lru_cache() wrapper object now always works, independently from the type of the wrapped object (by returning the original object unchanged). .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index 99b4675ed5e0..bca43c8f708f 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -1036,7 +1036,7 @@ attack (CVE-2016-2183). .. nonce: WI70Tc .. section: Library -Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL +Add ChaCha20 Poly1305 to ssl module's default cipher list. (Required OpenSSL 1.1.0 or LibreSSL). .. diff --git a/Misc/NEWS.d/3.5.4rc1.rst b/Misc/NEWS.d/3.5.4rc1.rst index 5678ff247d0d..0eb85d1d7cfe 100644 --- a/Misc/NEWS.d/3.5.4rc1.rst +++ b/Misc/NEWS.d/3.5.4rc1.rst @@ -36,7 +36,7 @@ already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). .. diff --git a/Misc/NEWS.d/3.6.0a1.rst b/Misc/NEWS.d/3.6.0a1.rst index 62bfd4e2ef55..254d36166450 100644 --- a/Misc/NEWS.d/3.6.0a1.rst +++ b/Misc/NEWS.d/3.6.0a1.rst @@ -2684,7 +2684,7 @@ pickletools.dis() now outputs implicit memo index for the MEMOIZE opcode. .. nonce: ebqGy- .. section: Library -Add an optional newline paramer to binascii.b2a_base64(). base64.b64encode() +Add an optional newline parameter to binascii.b2a_base64(). base64.b64encode() uses it to avoid a memory copy. .. @@ -3938,4 +3938,4 @@ programming bugs. ValueError is now raised instead of TypeError on buffer overflow in parsing "es#" and "et#" format units. SystemError is now raised instead of -TypeError on programmical error in parsing format string. +TypeError on programmatical error in parsing format string. diff --git a/Misc/NEWS.d/3.6.0a2.rst b/Misc/NEWS.d/3.6.0a2.rst index 46387a5c0b15..9e7326bc5c2e 100644 --- a/Misc/NEWS.d/3.6.0a2.rst +++ b/Misc/NEWS.d/3.6.0a2.rst @@ -126,7 +126,7 @@ work at runtime anyway. .. nonce: ffzxpX .. section: Library -Generated names for Tkinter widgets are now more meanful and recognizirable. +Generated names for Tkinter widgets are now more meaningful and recognizable. .. @@ -516,7 +516,7 @@ are added to cover changes. IDLE requires tk 8.5 and availability ttk widgets. Delete now unneeded tk version tests and code for older versions. Add test for IDLE syntax -colorizoer. +colorizer. .. @@ -534,7 +534,7 @@ idlelib.macosx.isXyzTk functions initialize as needed. .. nonce: t7ckly .. section: IDLE -move Aqua unbinding code, which enable context menus, to maxosx. +move Aqua unbinding code, which enable context menus, to macosx. .. diff --git a/Misc/NEWS.d/3.6.0a3.rst b/Misc/NEWS.d/3.6.0a3.rst index 251e6aa0e128..2ca258038bb8 100644 --- a/Misc/NEWS.d/3.6.0a3.rst +++ b/Misc/NEWS.d/3.6.0a3.rst @@ -476,7 +476,7 @@ Update Windows builds to use OpenSSL 1.0.2h. Rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install the -platform specifc _sysconfigdata module into the platform directory and +platform specific _sysconfigdata module into the platform directory and rename it to include the ABIFLAGS. .. diff --git a/Misc/NEWS.d/3.6.0a4.rst b/Misc/NEWS.d/3.6.0a4.rst index 07e20e46fdf3..0be9c8219777 100644 --- a/Misc/NEWS.d/3.6.0a4.rst +++ b/Misc/NEWS.d/3.6.0a4.rst @@ -487,7 +487,7 @@ without -jn. Fix warning from test_config. .. section: IDLE Put query response validation error messages in the query box itself instead -of in a separate massagebox. Redo tests to match. Add Mac OSX refinements. +of in a separate messagebox. Redo tests to match. Add Mac OSX refinements. Original patch by Mark Roseman. .. diff --git a/Misc/NEWS.d/3.6.0b1.rst b/Misc/NEWS.d/3.6.0b1.rst index 476059f1d4a7..f151557dcc2c 100644 --- a/Misc/NEWS.d/3.6.0b1.rst +++ b/Misc/NEWS.d/3.6.0b1.rst @@ -958,7 +958,7 @@ attack (CVE-2016-2183). .. nonce: WI70Tc .. section: Library -Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL +Add ChaCha20 Poly1305 to ssl module's default cipher list. (Required OpenSSL 1.1.0 or LibreSSL). .. diff --git a/Misc/NEWS.d/3.6.2rc2.rst b/Misc/NEWS.d/3.6.2rc2.rst index 45be03eb5fa4..8c6545f6dbbe 100644 --- a/Misc/NEWS.d/3.6.2rc2.rst +++ b/Misc/NEWS.d/3.6.2rc2.rst @@ -36,4 +36,4 @@ Python already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). diff --git a/Misc/NEWS.d/3.6.3rc1.rst b/Misc/NEWS.d/3.6.3rc1.rst index 2fc3c08579b5..ca812c63eed9 100644 --- a/Misc/NEWS.d/3.6.3rc1.rst +++ b/Misc/NEWS.d/3.6.3rc1.rst @@ -517,7 +517,7 @@ LF. Patch by Dong-hee Na. .. section: Library multiprocessing.Queue.get() with a timeout now polls its reader in -non-blocking mode if it succeeded to aquire the lock but the acquire took +non-blocking mode if it succeeded to acquire the lock but the acquire took longer than the timeout. .. @@ -818,7 +818,7 @@ IDLE - make tests pass with zzdummy extension disabled by default. Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. .. @@ -837,7 +837,7 @@ not the same as deleting and inserting because int('') will fail. .. nonce: 50Jp_Q .. section: IDLE -Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. +Rearrange IDLE configdialog GenPage into Window, Editor, and Help sections. .. diff --git a/Misc/NEWS.d/3.6.4rc1.rst b/Misc/NEWS.d/3.6.4rc1.rst index c91cc62159fd..ff7110f88b23 100644 --- a/Misc/NEWS.d/3.6.4rc1.rst +++ b/Misc/NEWS.d/3.6.4rc1.rst @@ -758,7 +758,7 @@ interruptions. If it crashes, restart it when necessary. .. nonce: 91mhWm .. section: Documentation -Added asyncio.BaseEventLoop.connect_accepted_socket versionaddded marker. +Added asyncio.BaseEventLoop.connect_accepted_socket versionadded marker. .. @@ -974,7 +974,7 @@ Cheryl Sabella. .. nonce: VuSA_e .. section: IDLE -IDLE -- Restrict shell prompt manipulaton to the shell. Editor and output +IDLE -- Restrict shell prompt manipulation to the shell. Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed. diff --git a/Misc/NEWS.d/3.6.6rc1.rst b/Misc/NEWS.d/3.6.6rc1.rst index 85428d8245e1..f6038768bd40 100644 --- a/Misc/NEWS.d/3.6.6rc1.rst +++ b/Misc/NEWS.d/3.6.6rc1.rst @@ -861,7 +861,7 @@ Fix pystackv and pystack gdbinit macros. .. nonce: dL5x7C .. section: Tools/Demos -Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable automatic backup creation (files with ``~`` suffix). .. diff --git a/Misc/NEWS.d/3.7.0a1.rst b/Misc/NEWS.d/3.7.0a1.rst index 2f4e75045310..0c13bf022e60 100644 --- a/Misc/NEWS.d/3.7.0a1.rst +++ b/Misc/NEWS.d/3.7.0a1.rst @@ -65,7 +65,7 @@ already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). .. @@ -3406,7 +3406,7 @@ Patch by Nikolay Kim. .. nonce: 4f5gbp .. section: Library -urrlib.parse.quote is now based on RFC 3986 and hence includes '~' in the +urllib.parse.quote is now based on RFC 3986 and hence includes '~' in the set of characters that is not quoted by default. Patch by Christian Theune and Ratnadeep Debnath. @@ -5711,7 +5711,7 @@ IDLE - make tests pass with zzdummy extension disabled by default. Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. .. @@ -5730,7 +5730,7 @@ not the same as deleting and inserting because int('') will fail. .. nonce: 50Jp_Q .. section: IDLE -Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. +Rearrange IDLE configdialog GenPage into Window, Editor, and Help sections. .. diff --git a/Misc/NEWS.d/3.7.0a3.rst b/Misc/NEWS.d/3.7.0a3.rst index f8ab97c553ef..176441e2b0e7 100644 --- a/Misc/NEWS.d/3.7.0a3.rst +++ b/Misc/NEWS.d/3.7.0a3.rst @@ -636,7 +636,7 @@ if closing the file from another thread. Formally deprecated aifc.openfp, sunau.openfp, and wave.openfp. Since change 7bc817d5ba917528e8bd07ec461c635291e7b06a in 1993, openfp in each of the -three modules had been pointing to that module's open funciton as a matter +three modules had been pointing to that module's open function as a matter of backwards compatibility, though it had been both untested and undocumented. @@ -809,7 +809,7 @@ Fixed building the curses module on NetBSD. .. nonce: bjhre9 .. section: Library -added required constants to subprocess module for setting priotity on +added required constants to subprocess module for setting priority on windows .. @@ -1217,7 +1217,7 @@ Add HTTP/2 status code 421 (Misdirected Request) to .. nonce: 91mhWm .. section: Documentation -Added asyncio.BaseEventLoop.connect_accepted_socket versionaddded marker. +Added asyncio.BaseEventLoop.connect_accepted_socket versionadded marker. .. @@ -1494,7 +1494,7 @@ Cheryl Sabella. .. nonce: VuSA_e .. section: IDLE -IDLE -- Restrict shell prompt manipulaton to the shell. Editor and output +IDLE -- Restrict shell prompt manipulation to the shell. Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed. diff --git a/Misc/NEWS.d/3.7.0b2.rst b/Misc/NEWS.d/3.7.0b2.rst index 7d137128b5b3..10d00a5033a4 100644 --- a/Misc/NEWS.d/3.7.0b2.rst +++ b/Misc/NEWS.d/3.7.0b2.rst @@ -399,7 +399,7 @@ Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D Moore. .. nonce: ideco_ .. section: Library -Various functions returning tuple containig IPv6 addresses now omit +Various functions returning tuple containing IPv6 addresses now omit ``%scope`` part since the same information is already encoded in *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom` when it receives multicast packet since useless resolving of network interface name diff --git a/Misc/NEWS.d/3.7.0b3.rst b/Misc/NEWS.d/3.7.0b3.rst index fc5492c36c48..547fb50f5ecf 100644 --- a/Misc/NEWS.d/3.7.0b3.rst +++ b/Misc/NEWS.d/3.7.0b3.rst @@ -295,7 +295,7 @@ only 1 bit left for addresses. .. nonce: lgFXWl .. section: Library -Fix C implemetation of ``ABC.__subclasscheck__(cls, subclass)`` crashed when +Fix C implementation of ``ABC.__subclasscheck__(cls, subclass)`` crashed when ``subclass`` is not a type object. .. @@ -517,7 +517,7 @@ Simplify and rename StringTranslatePseudoMapping in pyparse. .. nonce: dL5x7C .. section: Tools/Demos -Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable automatic backup creation (files with ``~`` suffix). .. diff --git a/Misc/NEWS.d/3.7.0b5.rst b/Misc/NEWS.d/3.7.0b5.rst index b420496cedd2..4fe3ed59fc9b 100644 --- a/Misc/NEWS.d/3.7.0b5.rst +++ b/Misc/NEWS.d/3.7.0b5.rst @@ -244,7 +244,7 @@ Based on patch by c-fos. .. section: Library Change TLS 1.3 cipher suite settings for compatibility with OpenSSL -1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by +1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers enabled by default. .. diff --git a/Modules/_ctypes/libffi_msvc/win32.c b/Modules/_ctypes/libffi_msvc/win32.c index d1149a85eb42..f44a5fe3697c 100644 --- a/Modules/_ctypes/libffi_msvc/win32.c +++ b/Modules/_ctypes/libffi_msvc/win32.c @@ -90,7 +90,7 @@ ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ // If the return value pointer is NULL, assume no return value. /* - Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, + Intel asm is weird. We have to explicitly specify 'DWORD PTR' in the next instruction, otherwise only one BYTE will be compared (instead of a DWORD)! */ cmp DWORD PTR [ebp + 24], 0 From webhook-mailer at python.org Wed Oct 10 09:39:38 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 10 Oct 2018 13:39:38 -0000 Subject: [Python-checkins] [3.6] bpo-34906: Doc: Fix typos (2) (GH-9735) Message-ID: https://github.com/python/cpython/commit/e7ebf1453beb1a40e65630897fa1e35a3c2d3ec1 commit: e7ebf1453beb1a40e65630897fa1e35a3c2d3ec1 branch: 3.6 author: St?phane Wirtel committer: Julien Palard date: 2018-10-10T15:39:34+02:00 summary: [3.6] bpo-34906: Doc: Fix typos (2) (GH-9735) (cherry picked from commit 683281f536981da395575b5a07d6761118259fd2) files: M Doc/whatsnew/3.3.rst M Doc/whatsnew/3.5.rst M Lib/idlelib/NEWS.txt M Misc/HISTORY M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.0a2.rst M Misc/NEWS.d/3.5.0a3.rst M Misc/NEWS.d/3.5.0a4.rst M Misc/NEWS.d/3.5.1rc1.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.6.0a1.rst M Misc/NEWS.d/3.6.0a2.rst M Misc/NEWS.d/3.6.0a3.rst M Misc/NEWS.d/3.6.0a4.rst M Misc/NEWS.d/3.6.0b1.rst M Misc/NEWS.d/3.6.2rc2.rst M Misc/NEWS.d/3.6.3rc1.rst M Misc/NEWS.d/3.6.4rc1.rst M Misc/NEWS.d/3.6.6rc1.rst M Modules/_ctypes/libffi_msvc/win32.c diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 80422557536e..79b349072cf5 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -303,7 +303,7 @@ The launcher can also be used explicitly from the command line as the ``py`` application. Running ``py`` follows the same version selection rules as implicitly launching scripts, but a more specific version can be selected by passing appropriate arguments (such as ``-3`` to request Python 3 when -Python 2 is also installed, or ``-2.6`` to specifclly request an earlier +Python 2 is also installed, or ``-2.6`` to specifically request an earlier Python version when a more recent version is installed). In addition to the launcher, the Windows installer now includes an @@ -2386,7 +2386,7 @@ Porting Python code finder, you will need to remove keys paired with values of ``None`` **and** :class:`imp.NullImporter` to be backwards-compatible. This will lead to extra overhead on older versions of Python that re-insert ``None`` into - :attr:`sys.path_importer_cache` where it repesents the use of implicit + :attr:`sys.path_importer_cache` where it represents the use of implicit finders, but semantically it should not change anything. * :class:`importlib.abc.Finder` no longer specifies a `find_module()` abstract diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 96f86e6c6142..dc6a3eadb538 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -2471,7 +2471,7 @@ Changes in the Python API parameter to help control the ``opt-`` tag. Because of this, the *debug_override* parameter of the function is now deprecated. `.pyo` files are also no longer supported as a file argument to the Python interpreter and - thus serve no purpose when distributed on their own (i.e. sourcless code + thus serve no purpose when distributed on their own (i.e. sourceless code distribution). Due to the fact that the magic number for bytecode has changed in Python 3.5, all old `.pyo` files from previous versions of Python are invalid regardless of this PEP. diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 84880cc45b29..8ecd85a9ceb6 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -240,7 +240,7 @@ To see the example in action, enable it on options extensions tab. bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. bpo-31414: Fix tk entry box tests by deleting first. Adding to an int entry is not the same as deleting and inserting @@ -488,7 +488,7 @@ Released on 2016-12-23 -w option but without -jn. Fix warning from test_config. - Issue #27621: Put query response validation error messages in the query - box itself instead of in a separate massagebox. Redo tests to match. + box itself instead of in a separate messagebox. Redo tests to match. Add Mac OSX refinements. Original patch by Mark Roseman. - Issue #27620: Escape key now closes Query box as cancelled. @@ -554,7 +554,7 @@ Released on 2016-12-23 - Issue #27239: idlelib.macosx.isXyzTk functions initialize as needed. -- Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx. +- Issue #27262: move Aqua unbinding code, which enable context menus, to macosx. - Issue #24759: Make clear in idlelib.idle_test.__init__ that the directory is a private implementation of test.test_idle and tool for maintainers. diff --git a/Misc/HISTORY b/Misc/HISTORY index 4ce431f660e1..76d7b950a232 100644 --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -629,7 +629,7 @@ Library - Issue #21560: An attempt to write a data of wrong type no longer cause GzipFile corruption. Original patch by Wolfgang Maier. -- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes. +- Issue #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. - Issue #23539: If body is None, http.client.HTTPConnection.request now sets Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from @@ -677,7 +677,7 @@ Library - Issue #23521: Corrected pure python implementation of timedelta division. * Eliminated OverflowError from timedelta * float for some floats; - * Corrected rounding in timedlta true division. + * Corrected rounding in timedelta true division. - Issue #21619: Popen objects no longer leave a zombie after exit in the with statement if the pipe was broken. Patch by Martin Panter. @@ -966,7 +966,7 @@ Core and Builtins returned NotImplemented. Original patch by Martin Panter. - Issue #23321: Fixed a crash in str.decode() when error handler returned - replacment string longer than mailformed input data. + replacement string longer than malformed input data. - Issue #23048: Fix jumping out of an infinite while loop in the pdb. @@ -1042,7 +1042,7 @@ Library - Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" as they are written in the standard. -- Issue #23063: In the disutils' check command, fix parsing of reST with code or +- Issue #23063: In the distutils' check command, fix parsing of reST with code or code-block directives. - Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal @@ -9956,7 +9956,7 @@ Library ensure that it will be found regardless of the shell PATH. This ensures that multiprocessing.cpu_count works on default installs of MacOSX. -- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is +- Issue #11501: distutils.archive_utils.make_zipfile no longer fails if zlib is not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart. diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index 92ca7cab2270..8cab0e96bb82 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -75,8 +75,8 @@ NotImplemented. Original patch by Martin Panter. .. nonce: HQelge .. section: Core and Builtins -Fixed a crash in str.decode() when error handler returned replacment string -longer than mailformed input data. +Fixed a crash in str.decode() when error handler returned replacement string +longer than malformed input data. .. @@ -998,7 +998,7 @@ written in the standard. .. nonce: 9-UJRs .. section: Library -In the disutils' check command, fix parsing of reST with code or code-block +In the distutils' check command, fix parsing of reST with code or code-block directives. .. @@ -2877,7 +2877,7 @@ closed socket. repr(socket.socket) already works fine. .. nonce: nkBNci .. section: Library -Reprs of most Python implemened classes now contain actual class name +Reprs of most Python implemented classes now contain actual class name instead of hardcoded one. .. @@ -3036,7 +3036,7 @@ by Phil Elson. os.read() now uses a :c:func:`Py_ssize_t` type instead of :c:type:`int` for the size to support reading more than 2 GB at once. On Windows, the size is -truncted to INT_MAX. As any call to os.read(), the OS may read less bytes +truncated to INT_MAX. As any call to os.read(), the OS may read less bytes than the number of requested bytes. .. diff --git a/Misc/NEWS.d/3.5.0a2.rst b/Misc/NEWS.d/3.5.0a2.rst index d66e4cbdeb58..b3db311af923 100644 --- a/Misc/NEWS.d/3.5.0a2.rst +++ b/Misc/NEWS.d/3.5.0a2.rst @@ -114,7 +114,7 @@ Lawrence. Corrected pure python implementation of timedelta division. Eliminated OverflowError from ``timedelta * float`` for some floats; -Corrected rounding in timedlta true division. +Corrected rounding in timedelta true division. .. diff --git a/Misc/NEWS.d/3.5.0a3.rst b/Misc/NEWS.d/3.5.0a3.rst index 9e2d3e85b1c9..1ef375b577f1 100644 --- a/Misc/NEWS.d/3.5.0a3.rst +++ b/Misc/NEWS.d/3.5.0a3.rst @@ -239,7 +239,7 @@ Added support for writing ZIP files to unseekable streams. .. nonce: pX2qrx .. section: Library -Increase impalib's MAXLINE to accommodate modern mailbox sizes. +Increase imaplib's MAXLINE to accommodate modern mailbox sizes. .. diff --git a/Misc/NEWS.d/3.5.0a4.rst b/Misc/NEWS.d/3.5.0a4.rst index 0707cf6a4c8f..21fd8c8f8cc7 100644 --- a/Misc/NEWS.d/3.5.0a4.rst +++ b/Misc/NEWS.d/3.5.0a4.rst @@ -482,7 +482,7 @@ sqlite3.Row now supports slice indexing. .. nonce: 89RHm- .. section: Library -Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambigious reverse +Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambiguous reverse mappings. Added many new mappings. Import mapping is no longer applied to modules already mapped with full name mapping. diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst index 93d0dbc1e7bb..b72940f53de4 100644 --- a/Misc/NEWS.d/3.5.1rc1.rst +++ b/Misc/NEWS.d/3.5.1rc1.rst @@ -191,7 +191,7 @@ comprehensions correspond to the opening brace. Hide the private _Py_atomic_xxx symbols from the public Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() becomes an alias to -PyThreadState_Get() to avoid ABI incompatibilies. +PyThreadState_Get() to avoid ABI incompatibilities. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 97385b57aac7..2c9d81d994b8 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -1366,7 +1366,7 @@ fileinput now uses sys.stdin as-is if it does not have a buffer attribute .. nonce: AtHkWA .. section: Library -Copying the lru_cache() wrapper object now always works, independedly from +Copying the lru_cache() wrapper object now always works, independently from the type of the wrapped object (by returning the original object unchanged). .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index 4fd1ed07d945..728612d8913f 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -1036,7 +1036,7 @@ attack (CVE-2016-2183). .. nonce: WI70Tc .. section: Library -Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL +Add ChaCha20 Poly1305 to ssl module's default cipher list. (Required OpenSSL 1.1.0 or LibreSSL). .. diff --git a/Misc/NEWS.d/3.6.0a1.rst b/Misc/NEWS.d/3.6.0a1.rst index 62bfd4e2ef55..254d36166450 100644 --- a/Misc/NEWS.d/3.6.0a1.rst +++ b/Misc/NEWS.d/3.6.0a1.rst @@ -2684,7 +2684,7 @@ pickletools.dis() now outputs implicit memo index for the MEMOIZE opcode. .. nonce: ebqGy- .. section: Library -Add an optional newline paramer to binascii.b2a_base64(). base64.b64encode() +Add an optional newline parameter to binascii.b2a_base64(). base64.b64encode() uses it to avoid a memory copy. .. @@ -3938,4 +3938,4 @@ programming bugs. ValueError is now raised instead of TypeError on buffer overflow in parsing "es#" and "et#" format units. SystemError is now raised instead of -TypeError on programmical error in parsing format string. +TypeError on programmatical error in parsing format string. diff --git a/Misc/NEWS.d/3.6.0a2.rst b/Misc/NEWS.d/3.6.0a2.rst index 46387a5c0b15..9e7326bc5c2e 100644 --- a/Misc/NEWS.d/3.6.0a2.rst +++ b/Misc/NEWS.d/3.6.0a2.rst @@ -126,7 +126,7 @@ work at runtime anyway. .. nonce: ffzxpX .. section: Library -Generated names for Tkinter widgets are now more meanful and recognizirable. +Generated names for Tkinter widgets are now more meaningful and recognizable. .. @@ -516,7 +516,7 @@ are added to cover changes. IDLE requires tk 8.5 and availability ttk widgets. Delete now unneeded tk version tests and code for older versions. Add test for IDLE syntax -colorizoer. +colorizer. .. @@ -534,7 +534,7 @@ idlelib.macosx.isXyzTk functions initialize as needed. .. nonce: t7ckly .. section: IDLE -move Aqua unbinding code, which enable context menus, to maxosx. +move Aqua unbinding code, which enable context menus, to macosx. .. diff --git a/Misc/NEWS.d/3.6.0a3.rst b/Misc/NEWS.d/3.6.0a3.rst index 251e6aa0e128..2ca258038bb8 100644 --- a/Misc/NEWS.d/3.6.0a3.rst +++ b/Misc/NEWS.d/3.6.0a3.rst @@ -476,7 +476,7 @@ Update Windows builds to use OpenSSL 1.0.2h. Rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install the -platform specifc _sysconfigdata module into the platform directory and +platform specific _sysconfigdata module into the platform directory and rename it to include the ABIFLAGS. .. diff --git a/Misc/NEWS.d/3.6.0a4.rst b/Misc/NEWS.d/3.6.0a4.rst index 07e20e46fdf3..0be9c8219777 100644 --- a/Misc/NEWS.d/3.6.0a4.rst +++ b/Misc/NEWS.d/3.6.0a4.rst @@ -487,7 +487,7 @@ without -jn. Fix warning from test_config. .. section: IDLE Put query response validation error messages in the query box itself instead -of in a separate massagebox. Redo tests to match. Add Mac OSX refinements. +of in a separate messagebox. Redo tests to match. Add Mac OSX refinements. Original patch by Mark Roseman. .. diff --git a/Misc/NEWS.d/3.6.0b1.rst b/Misc/NEWS.d/3.6.0b1.rst index 476059f1d4a7..f151557dcc2c 100644 --- a/Misc/NEWS.d/3.6.0b1.rst +++ b/Misc/NEWS.d/3.6.0b1.rst @@ -958,7 +958,7 @@ attack (CVE-2016-2183). .. nonce: WI70Tc .. section: Library -Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL +Add ChaCha20 Poly1305 to ssl module's default cipher list. (Required OpenSSL 1.1.0 or LibreSSL). .. diff --git a/Misc/NEWS.d/3.6.2rc2.rst b/Misc/NEWS.d/3.6.2rc2.rst index 45be03eb5fa4..8c6545f6dbbe 100644 --- a/Misc/NEWS.d/3.6.2rc2.rst +++ b/Misc/NEWS.d/3.6.2rc2.rst @@ -36,4 +36,4 @@ Python already gets entropy from the OS to set the expat secret using Fix urllib.parse.splithost() to correctly parse fragments. For example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an -authentification (``login at host``). +authentication (``login at host``). diff --git a/Misc/NEWS.d/3.6.3rc1.rst b/Misc/NEWS.d/3.6.3rc1.rst index 2fc3c08579b5..ca812c63eed9 100644 --- a/Misc/NEWS.d/3.6.3rc1.rst +++ b/Misc/NEWS.d/3.6.3rc1.rst @@ -517,7 +517,7 @@ LF. Patch by Dong-hee Na. .. section: Library multiprocessing.Queue.get() with a timeout now polls its reader in -non-blocking mode if it succeeded to aquire the lock but the acquire took +non-blocking mode if it succeeded to acquire the lock but the acquire took longer than the timeout. .. @@ -818,7 +818,7 @@ IDLE - make tests pass with zzdummy extension disabled by default. Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live -interaction and experimentatin with tkinter applications much easier. +interaction and experimentation with tkinter applications much easier. .. @@ -837,7 +837,7 @@ not the same as deleting and inserting because int('') will fail. .. nonce: 50Jp_Q .. section: IDLE -Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. +Rearrange IDLE configdialog GenPage into Window, Editor, and Help sections. .. diff --git a/Misc/NEWS.d/3.6.4rc1.rst b/Misc/NEWS.d/3.6.4rc1.rst index c91cc62159fd..ff7110f88b23 100644 --- a/Misc/NEWS.d/3.6.4rc1.rst +++ b/Misc/NEWS.d/3.6.4rc1.rst @@ -758,7 +758,7 @@ interruptions. If it crashes, restart it when necessary. .. nonce: 91mhWm .. section: Documentation -Added asyncio.BaseEventLoop.connect_accepted_socket versionaddded marker. +Added asyncio.BaseEventLoop.connect_accepted_socket versionadded marker. .. @@ -974,7 +974,7 @@ Cheryl Sabella. .. nonce: VuSA_e .. section: IDLE -IDLE -- Restrict shell prompt manipulaton to the shell. Editor and output +IDLE -- Restrict shell prompt manipulation to the shell. Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed. diff --git a/Misc/NEWS.d/3.6.6rc1.rst b/Misc/NEWS.d/3.6.6rc1.rst index 85428d8245e1..f6038768bd40 100644 --- a/Misc/NEWS.d/3.6.6rc1.rst +++ b/Misc/NEWS.d/3.6.6rc1.rst @@ -861,7 +861,7 @@ Fix pystackv and pystack gdbinit macros. .. nonce: dL5x7C .. section: Tools/Demos -Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable automatic backup creation (files with ``~`` suffix). .. diff --git a/Modules/_ctypes/libffi_msvc/win32.c b/Modules/_ctypes/libffi_msvc/win32.c index d1149a85eb42..f44a5fe3697c 100644 --- a/Modules/_ctypes/libffi_msvc/win32.c +++ b/Modules/_ctypes/libffi_msvc/win32.c @@ -90,7 +90,7 @@ ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ // If the return value pointer is NULL, assume no return value. /* - Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, + Intel asm is weird. We have to explicitly specify 'DWORD PTR' in the next instruction, otherwise only one BYTE will be compared (instead of a DWORD)! */ cmp DWORD PTR [ebp + 24], 0 From webhook-mailer at python.org Wed Oct 10 10:46:55 2018 From: webhook-mailer at python.org (Antoine Pitrou) Date: Wed, 10 Oct 2018 14:46:55 -0000 Subject: [Python-checkins] bpo-34926: Make mimetypes.guess_type accept os.PathLike objects (GH-9777) Message-ID: https://github.com/python/cpython/commit/7e18deef652a9d413d5dbd19d61073ba7eb5460e commit: 7e18deef652a9d413d5dbd19d61073ba7eb5460e branch: master author: Mayank Asthana committer: Antoine Pitrou date: 2018-10-10T16:46:44+02:00 summary: bpo-34926: Make mimetypes.guess_type accept os.PathLike objects (GH-9777) :meth:`mimetypes.MimeTypes.guess_type` now accepts :term:`path-like object` in addition to url strings. files: A Misc/NEWS.d/next/Library/2018-10-10-00-22-57.bpo-34926.CA0rqd.rst M Doc/library/mimetypes.rst M Lib/mimetypes.py M Lib/test/test_mimetypes.py diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 67b7a7178534..973014abba59 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -30,8 +30,10 @@ the information :func:`init` sets up. .. index:: pair: MIME; headers - Guess the type of a file based on its filename or URL, given by *url*. The - return value is a tuple ``(type, encoding)`` where *type* is ``None`` if the + Guess the type of a file based on its filename, path or URL, given by *url*. + URL can be a string or a :term:`path-like object`. + + The return value is a tuple ``(type, encoding)`` where *type* is ``None`` if the type can't be guessed (missing or unknown suffix) or a string of the form ``'type/subtype'``, usable for a MIME :mailheader:`content-type` header. @@ -49,6 +51,9 @@ the information :func:`init` sets up. *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized. + .. versionchanged:: 3.8 + Added support for url being a :term:`path-like object`. + .. function:: guess_all_extensions(type, strict=True) diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index bc647115b18e..8861b75362db 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -95,7 +95,7 @@ def add_type(self, type, ext, strict=True): exts.append(ext) def guess_type(self, url, strict=True): - """Guess the type of a file based on its URL. + """Guess the type of a file which is either a URL or a path-like object. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string @@ -113,6 +113,7 @@ def guess_type(self, url, strict=True): Optional `strict' argument when False adds a bunch of commonly found, but non-standard types. """ + url = os.fspath(url) scheme, url = urllib.parse._splittype(url) if scheme == 'data': # syntax of data URLs: diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 4e2c9089b573..554d3d5cead5 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -1,6 +1,7 @@ import io import locale import mimetypes +import pathlib import sys import unittest @@ -77,6 +78,29 @@ def test_encoding(self): strict=True) self.assertEqual(exts, ['.g3', '.g\xb3']) + def test_path_like_ob(self): + filename = "LICENSE.txt" + filepath = pathlib.Path(filename) + filepath_with_abs_dir = pathlib.Path('/dir/'+filename) + filepath_relative = pathlib.Path('../dir/'+filename) + path_dir = pathlib.Path('./') + + expected = self.db.guess_type(filename) + + self.assertEqual(self.db.guess_type(filepath), expected) + self.assertEqual(self.db.guess_type( + filepath_with_abs_dir), expected) + self.assertEqual(self.db.guess_type(filepath_relative), expected) + self.assertEqual(self.db.guess_type(path_dir), (None, None)) + + def test_keywords_args_api(self): + self.assertEqual(self.db.guess_type( + url="foo.html", strict=True), ("text/html", None)) + self.assertEqual(self.db.guess_all_extensions( + type='image/jpg', strict=True), []) + self.assertEqual(self.db.guess_extension( + type='image/jpg', strict=False), '.jpg') + @unittest.skipUnless(sys.platform.startswith("win"), "Windows only") class Win32MimeTypesTestCase(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-10-00-22-57.bpo-34926.CA0rqd.rst b/Misc/NEWS.d/next/Library/2018-10-10-00-22-57.bpo-34926.CA0rqd.rst new file mode 100644 index 000000000000..5b009cb87747 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-10-00-22-57.bpo-34926.CA0rqd.rst @@ -0,0 +1,2 @@ +:meth:`mimetypes.MimeTypes.guess_type` now accepts :term:`path-like object` in addition to url strings. +Patch by Mayank Asthana. From webhook-mailer at python.org Wed Oct 10 12:43:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 10 Oct 2018 16:43:20 -0000 Subject: [Python-checkins] bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) Message-ID: https://github.com/python/cpython/commit/a6b3ec5b6d4f6387820fccc570eea08b9615620d commit: a6b3ec5b6d4f6387820fccc570eea08b9615620d branch: master author: Elvis Pranskevichus committer: Victor Stinner date: 2018-10-10T18:43:14+02:00 summary: bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in 3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides *invalidation_mode*, even if it was passed as an explicit argument to ``py_compile.compile()`` or ``compileall``. An environment variable should *never* override an explicit argument to a library function. That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH`` environment variable is set. This changes ``py_compile.compile()`` to only look at ``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified. I also made various relevant tests run with explicit control over the value of ``SOURCE_DATE_EPOCH``. While looking at this, I noticed that ``zipimport`` does not work with hash-based .pycs _at all_, though I left the fixes for subsequent commits. files: A Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst M Doc/library/compileall.rst M Doc/library/py_compile.rst M Lib/compileall.py M Lib/py_compile.py M Lib/test/test_compileall.py M Lib/test/test_importlib/source/test_file_loader.py M Lib/test/test_py_compile.py diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 22d1c6bfa416..2d6c52b656bd 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -85,13 +85,16 @@ compile Python sources. .. cmdoption:: --invalidation-mode [timestamp|checked-hash|unchecked-hash] - Control how the generated pycs will be invalidated at runtime. The default - setting, ``timestamp``, means that ``.pyc`` files with the source timestamp + Control how the generated byte-code files are invalidated at runtime. + The ``timestamp`` value, means that ``.pyc`` files with the source timestamp and size embedded will be generated. The ``checked-hash`` and ``unchecked-hash`` values cause hash-based pycs to be generated. Hash-based pycs embed a hash of the source file contents rather than a timestamp. See - :ref:`pyc-invalidation` for more information on how Python validates bytecode - cache files at runtime. + :ref:`pyc-invalidation` for more information on how Python validates + bytecode cache files at runtime. + The default is ``timestamp`` if the :envvar:`SOURCE_DATE_EPOCH` environment + variable is not set, and ``checked-hash`` if the ``SOURCE_DATE_EPOCH`` + environment variable is set. .. versionchanged:: 3.2 Added the ``-i``, ``-b`` and ``-h`` options. diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst index d720e0105057..8cb5a4d546c8 100644 --- a/Doc/library/py_compile.rst +++ b/Doc/library/py_compile.rst @@ -54,10 +54,10 @@ byte-code cache files in the directory containing the source code. level of the current interpreter. *invalidation_mode* should be a member of the :class:`PycInvalidationMode` - enum and controls how the generated ``.pyc`` files are invalidated at - runtime. If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, - *invalidation_mode* will be forced to - :attr:`PycInvalidationMode.CHECKED_HASH`. + enum and controls how the generated bytecode cache is invalidated at + runtime. The default is :attr:`PycInvalidationMode.CHECKED_HASH` if + the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, otherwise + the default is :attr:`PycInvalidationMode.TIMESTAMP`. .. versionchanged:: 3.2 Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous @@ -77,6 +77,11 @@ byte-code cache files in the directory containing the source code. *invalidation_mode* will be forced to :attr:`PycInvalidationMode.CHECKED_HASH`. + .. versionchanged:: 3.7.2 + The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer + overrides the value of the *invalidation_mode* argument, and determines + its default value instead. + .. class:: PycInvalidationMode diff --git a/Lib/compileall.py b/Lib/compileall.py index 72592126d74c..7be23a67c054 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -53,7 +53,7 @@ def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0): def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, workers=1, - invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): @@ -96,7 +96,7 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, - invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile one file. Arguments (only fullname is required): @@ -182,7 +182,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0, legacy=False, optimize=-1, - invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile all module on sys.path. Arguments (all optional): @@ -255,9 +255,12 @@ def main(): type=int, help='Run compileall concurrently') invalidation_modes = [mode.name.lower().replace('_', '-') for mode in py_compile.PycInvalidationMode] - parser.add_argument('--invalidation-mode', default='timestamp', + parser.add_argument('--invalidation-mode', choices=sorted(invalidation_modes), - help='How the pycs will be invalidated at runtime') + help=('set .pyc invalidation mode; defaults to ' + '"checked-hash" if the SOURCE_DATE_EPOCH ' + 'environment variable is set, and ' + '"timestamp" otherwise.')) args = parser.parse_args() compile_dests = args.compile_dest @@ -286,8 +289,11 @@ def main(): if args.workers is not None: args.workers = args.workers or None - ivl_mode = args.invalidation_mode.replace('-', '_').upper() - invalidation_mode = py_compile.PycInvalidationMode[ivl_mode] + if args.invalidation_mode: + ivl_mode = args.invalidation_mode.replace('-', '_').upper() + invalidation_mode = py_compile.PycInvalidationMode[ivl_mode] + else: + invalidation_mode = None success = True try: diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 16dc0a011ffa..8e9dd57a5440 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -69,8 +69,15 @@ class PycInvalidationMode(enum.Enum): UNCHECKED_HASH = 3 +def _get_default_invalidation_mode(): + if os.environ.get('SOURCE_DATE_EPOCH'): + return PycInvalidationMode.CHECKED_HASH + else: + return PycInvalidationMode.TIMESTAMP + + def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, - invalidation_mode=PycInvalidationMode.TIMESTAMP): + invalidation_mode=None): """Byte-compile one Python source file to Python bytecode. :param file: The source file name. @@ -112,8 +119,8 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, the resulting file would be regular and thus not the same type of file as it was previously. """ - if os.environ.get('SOURCE_DATE_EPOCH'): - invalidation_mode = PycInvalidationMode.CHECKED_HASH + if invalidation_mode is None: + invalidation_mode = _get_default_invalidation_mode() if cfile is None: if optimize >= 0: optimization = optimize if optimize >= 1 else '' diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 38d7b996c7c2..bf2a2c4f0ab1 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -22,7 +22,11 @@ from test import support from test.support import script_helper -class CompileallTests(unittest.TestCase): +from .test_py_compile import without_source_date_epoch +from .test_py_compile import SourceDateEpochTestMeta + + +class CompileallTestsBase: def setUp(self): self.directory = tempfile.mkdtemp() @@ -46,7 +50,7 @@ def add_bad_source_file(self): with open(self.bad_source_path, 'w') as file: file.write('x (\n') - def data(self): + def timestamp_metadata(self): with open(self.bc_path, 'rb') as file: data = file.read(12) mtime = int(os.stat(self.source_path).st_mtime) @@ -57,16 +61,18 @@ def data(self): def recreation_check(self, metadata): """Check that compileall recreates bytecode when the new metadata is used.""" + if os.environ.get('SOURCE_DATE_EPOCH'): + raise unittest.SkipTest('SOURCE_DATE_EPOCH is set') py_compile.compile(self.source_path) - self.assertEqual(*self.data()) + self.assertEqual(*self.timestamp_metadata()) with open(self.bc_path, 'rb') as file: bc = file.read()[len(metadata):] with open(self.bc_path, 'wb') as file: file.write(metadata) file.write(bc) - self.assertNotEqual(*self.data()) + self.assertNotEqual(*self.timestamp_metadata()) compileall.compile_dir(self.directory, force=False, quiet=True) - self.assertTrue(*self.data()) + self.assertTrue(*self.timestamp_metadata()) def test_mtime(self): # Test a change in mtime leads to a new .pyc. @@ -189,6 +195,21 @@ def test_compile_missing_multiprocessing(self, compile_file_mock): compileall.compile_dir(self.directory, quiet=True, workers=5) self.assertTrue(compile_file_mock.called) + +class CompileallTestsWithSourceEpoch(CompileallTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + +class CompileallTestsWithoutSourceEpoch(CompileallTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=False): + pass + + class EncodingTest(unittest.TestCase): """Issue 6716: compileall should escape source code when printing errors to stdout.""" @@ -212,7 +233,7 @@ def test_error(self): sys.stdout = orig_stdout -class CommandLineTests(unittest.TestCase): +class CommandLineTestsBase: """Test compileall's CLI.""" @classmethod @@ -285,6 +306,7 @@ def test_no_args_compiles_path(self): self.assertNotCompiled(self.initfn) self.assertNotCompiled(self.barfn) + @without_source_date_epoch # timestamp invalidation test def test_no_args_respects_force_flag(self): self._skip_if_sys_path_not_writable() bazfn = script_helper.make_script(self.directory, 'baz', '') @@ -353,6 +375,7 @@ def test_multiple_runs(self): self.assertTrue(os.path.exists(self.pkgdir_cachedir)) self.assertFalse(os.path.exists(cachecachedir)) + @without_source_date_epoch # timestamp invalidation test def test_force(self): self.assertRunOK('-q', self.pkgdir) pycpath = importlib.util.cache_from_source(self.barfn) @@ -556,5 +579,20 @@ def test_workers_available_cores(self, compile_dir): self.assertEqual(compile_dir.call_args[-1]['workers'], None) +class CommmandLineTestsWithSourceEpoch(CommandLineTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + +class CommmandLineTestsNoSourceEpoch(CommandLineTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=False): + pass + + + if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py index c70c5eb34ae3..3ffb2aa1e60a 100644 --- a/Lib/test/test_importlib/source/test_file_loader.py +++ b/Lib/test/test_importlib/source/test_file_loader.py @@ -19,6 +19,9 @@ from test.support import make_legacy_pyc, unload +from test.test_py_compile import without_source_date_epoch +from test.test_py_compile import SourceDateEpochTestMeta + class SimpleTest(abc.LoaderTests): @@ -359,6 +362,17 @@ def test_overiden_unchecked_hash_based_pyc(self): abc=importlib_abc, util=importlib_util) +class SourceDateEpochTestMeta(SourceDateEpochTestMeta, + type(Source_SimpleTest)): + pass + + +class SourceDateEpoch_SimpleTest(Source_SimpleTest, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + class BadBytecodeTest: def import_(self, file, module_name): @@ -617,6 +631,7 @@ def test_bad_marshal(self): # [bad timestamp] @util.writes_bytecode_files + @without_source_date_epoch def test_old_timestamp(self): # When the timestamp is older than the source, bytecode should be # regenerated. diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 8fc0b3308c91..f86abe26f97a 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -1,3 +1,4 @@ +import functools import importlib.util import os import py_compile @@ -10,7 +11,44 @@ from test import support -class PyCompileTests(unittest.TestCase): +def without_source_date_epoch(fxn): + """Runs function with SOURCE_DATE_EPOCH unset.""" + @functools.wraps(fxn) + def wrapper(*args, **kwargs): + with support.EnvironmentVarGuard() as env: + env.unset('SOURCE_DATE_EPOCH') + return fxn(*args, **kwargs) + return wrapper + + +def with_source_date_epoch(fxn): + """Runs function with SOURCE_DATE_EPOCH set.""" + @functools.wraps(fxn) + def wrapper(*args, **kwargs): + with support.EnvironmentVarGuard() as env: + env['SOURCE_DATE_EPOCH'] = '123456789' + return fxn(*args, **kwargs) + return wrapper + + +# Run tests with SOURCE_DATE_EPOCH set or unset explicitly. +class SourceDateEpochTestMeta(type(unittest.TestCase)): + def __new__(mcls, name, bases, dct, *, source_date_epoch): + cls = super().__new__(mcls, name, bases, dct) + + for attr in dir(cls): + if attr.startswith('test_'): + meth = getattr(cls, attr) + if source_date_epoch: + wrapper = with_source_date_epoch(meth) + else: + wrapper = without_source_date_epoch(meth) + setattr(cls, attr, wrapper) + + return cls + + +class PyCompileTestsBase: def setUp(self): self.directory = tempfile.mkdtemp() @@ -99,16 +137,18 @@ def test_bad_coding(self): importlib.util.cache_from_source(bad_coding))) def test_source_date_epoch(self): - testtime = 123456789 - with support.EnvironmentVarGuard() as env: - env["SOURCE_DATE_EPOCH"] = str(testtime) - py_compile.compile(self.source_path, self.pyc_path) + py_compile.compile(self.source_path, self.pyc_path) self.assertTrue(os.path.exists(self.pyc_path)) self.assertFalse(os.path.exists(self.cache_path)) with open(self.pyc_path, 'rb') as fp: flags = importlib._bootstrap_external._classify_pyc( fp.read(), 'test', {}) - self.assertEqual(flags, 0b11) + if os.environ.get('SOURCE_DATE_EPOCH'): + expected_flags = 0b11 + else: + expected_flags = 0b00 + + self.assertEqual(flags, expected_flags) @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O') def test_double_dot_no_clobber(self): @@ -153,5 +193,19 @@ def test_invalidation_mode(self): self.assertEqual(flags, 0b1) +class PyCompileTestsWithSourceEpoch(PyCompileTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=True): + pass + + +class PyCompileTestsWithoutSourceEpoch(PyCompileTestsBase, + unittest.TestCase, + metaclass=SourceDateEpochTestMeta, + source_date_epoch=False): + pass + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst b/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst new file mode 100644 index 000000000000..efebb84304bf --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst @@ -0,0 +1,3 @@ +The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer overrides the +value of the *invalidation_mode* argument to :func:`py_compile.compile`, and +determines its default value instead. From webhook-mailer at python.org Wed Oct 10 13:26:06 2018 From: webhook-mailer at python.org (Yury Selivanov) Date: Wed, 10 Oct 2018 17:26:06 -0000 Subject: [Python-checkins] [3.6] bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716) (GH-9792) Message-ID: https://github.com/python/cpython/commit/a14dda5df62369d01db6c7519e73aae71d0e7cfe commit: a14dda5df62369d01db6c7519e73aae71d0e7cfe branch: 3.6 author: twisteroid ambassador committer: Yury Selivanov date: 2018-10-10T13:25:58-04:00 summary: [3.6] bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716) (GH-9792) files: A Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst M Lib/asyncio/base_events.py M Lib/test/test_asyncio/test_base_events.py diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 30ac5924d06b..accd669250cb 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -368,10 +368,7 @@ def _check_closed(self): def _asyncgen_finalizer_hook(self, agen): self._asyncgens.discard(agen) if not self.is_closed(): - self.create_task(agen.aclose()) - # Wake up the loop if the finalizer was called from - # a different thread. - self._write_to_self() + self.call_soon_threadsafe(self.create_task, agen.aclose()) def _asyncgen_firstiter_hook(self, agen): if self._asyncgens_shutdown_called: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index dd61bf0fe59a..09f71f2f3900 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -915,6 +915,74 @@ def test_run_forever_pre_stopped(self): self.loop.run_forever() self.loop._selector.select.assert_called_once_with(0) + async def leave_unfinalized_asyncgen(self): + # Create an async generator, iterate it partially, and leave it + # to be garbage collected. + # Used in async generator finalization tests. + # Depends on implementation details of garbage collector. Changes + # in gc may break this function. + status = {'started': False, + 'stopped': False, + 'finalized': False} + + async def agen(): + status['started'] = True + try: + for item in ['ZERO', 'ONE', 'TWO', 'THREE', 'FOUR']: + yield item + finally: + status['finalized'] = True + + ag = agen() + ai = ag.__aiter__() + + async def iter_one(): + try: + item = await ai.__anext__() + except StopAsyncIteration: + return + if item == 'THREE': + status['stopped'] = True + return + self.loop.create_task(iter_one()) + + self.loop.create_task(iter_one()) + return status + + def test_asyncgen_finalization_by_gc(self): + # Async generators should be finalized when garbage collected. + self.loop._process_events = mock.Mock() + self.loop._write_to_self = mock.Mock() + with support.disable_gc(): + status = self.loop.run_until_complete(self.leave_unfinalized_asyncgen()) + while not status['stopped']: + test_utils.run_briefly(self.loop) + self.assertTrue(status['started']) + self.assertTrue(status['stopped']) + self.assertFalse(status['finalized']) + support.gc_collect() + test_utils.run_briefly(self.loop) + self.assertTrue(status['finalized']) + + def test_asyncgen_finalization_by_gc_in_other_thread(self): + # Python issue 34769: If garbage collector runs in another + # thread, async generators will not finalize in debug + # mode. + self.loop._process_events = mock.Mock() + self.loop._write_to_self = mock.Mock() + self.loop.set_debug(True) + with support.disable_gc(): + status = self.loop.run_until_complete(self.leave_unfinalized_asyncgen()) + while not status['stopped']: + test_utils.run_briefly(self.loop) + self.assertTrue(status['started']) + self.assertTrue(status['stopped']) + self.assertFalse(status['finalized']) + self.loop.run_until_complete( + self.loop.run_in_executor(None, support.gc_collect)) + test_utils.run_briefly(self.loop) + self.assertTrue(status['finalized']) + class MyProto(asyncio.Protocol): done = None diff --git a/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst b/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst new file mode 100644 index 000000000000..fc034c962ea2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-11-01-16.bpo-34769.cSkkZt.rst @@ -0,0 +1,2 @@ +Fix for async generators not finalizing when event loop is in debug mode and +garbage collector runs in another thread. From webhook-mailer at python.org Wed Oct 10 22:43:44 2018 From: webhook-mailer at python.org (Senthil Kumaran) Date: Thu, 11 Oct 2018 02:43:44 -0000 Subject: [Python-checkins] bpo-34576 warn users on security for http.server (#9720) Message-ID: https://github.com/python/cpython/commit/1d26c72e6a9c5b28b27c158f2f196217707dbb0f commit: 1d26c72e6a9c5b28b27c158f2f196217707dbb0f branch: master author: Felipe Rodrigues committer: Senthil Kumaran date: 2018-10-10T19:43:40-07:00 summary: bpo-34576 warn users on security for http.server (#9720) It was proposed to add an warning for http.server regarding security issues. The wording was provided at bpo-26005 by @orsenthil files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 0bd7f778cec0..0b93c62288b1 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -16,6 +16,14 @@ This module defines classes for implementing HTTP servers (Web servers). +Security Considerations +----------------------- + +http.server is meant for demo purposes and does not implement the stringent +security checks needed of real HTTP server. We do not recommend +using this module directly in production. + + One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. It creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:: From webhook-mailer at python.org Wed Oct 10 23:31:33 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 11 Oct 2018 03:31:33 -0000 Subject: [Python-checkins] bpo-34576 warn users on security for http.server (GH-9720) Message-ID: https://github.com/python/cpython/commit/3baee3b39765f5e8ec616b2b71b731b140486394 commit: 3baee3b39765f5e8ec616b2b71b731b140486394 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-10T20:31:27-07:00 summary: bpo-34576 warn users on security for http.server (GH-9720) It was proposed to add an warning for http.server regarding security issues. The wording was provided at bpo-26005 by @orsenthil (cherry picked from commit 1d26c72e6a9c5b28b27c158f2f196217707dbb0f) Co-authored-by: Felipe Rodrigues files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index b29020bc7ca5..ab5d568f01aa 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -16,6 +16,14 @@ This module defines classes for implementing HTTP servers (Web servers). +Security Considerations +----------------------- + +http.server is meant for demo purposes and does not implement the stringent +security checks needed of real HTTP server. We do not recommend +using this module directly in production. + + One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. It creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:: From webhook-mailer at python.org Wed Oct 10 23:37:31 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Thu, 11 Oct 2018 03:37:31 -0000 Subject: [Python-checkins] Micro-optimize list index range checks (GH-9784) Message-ID: https://github.com/python/cpython/commit/f1aa8aed4a8ce9753ffa8713e7d3461663e0624d commit: f1aa8aed4a8ce9753ffa8713e7d3461663e0624d branch: master author: Raymond Hettinger committer: GitHub date: 2018-10-10T20:37:28-07:00 summary: Micro-optimize list index range checks (GH-9784) files: M Objects/listobject.c diff --git a/Objects/listobject.c b/Objects/listobject.c index 3d4a187f6929..fa26444f847f 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -208,6 +208,19 @@ PyList_Size(PyObject *op) return Py_SIZE(op); } +static inline int +valid_index(Py_ssize_t i, Py_ssize_t limit) +{ + /* The cast to size_t lets us use just a single comparison + to check whether i is in the range: 0 <= i < limit. + + See: Section 14.2 "Bounds Checking" in the Agner Fog + optimization manual found at: + https://www.agner.org/optimize/optimizing_cpp.pdf + */ + return (size_t) i < (size_t) limit; +} + static PyObject *indexerr = NULL; PyObject * @@ -217,7 +230,7 @@ PyList_GetItem(PyObject *op, Py_ssize_t i) PyErr_BadInternalCall(); return NULL; } - if (i < 0 || i >= Py_SIZE(op)) { + if (!valid_index(i, Py_SIZE(op))) { if (indexerr == NULL) { indexerr = PyUnicode_FromString( "list index out of range"); @@ -240,7 +253,7 @@ PyList_SetItem(PyObject *op, Py_ssize_t i, PyErr_BadInternalCall(); return -1; } - if (i < 0 || i >= Py_SIZE(op)) { + if (!valid_index(i, Py_SIZE(op))) { Py_XDECREF(newitem); PyErr_SetString(PyExc_IndexError, "list assignment index out of range"); @@ -426,7 +439,7 @@ list_contains(PyListObject *a, PyObject *el) static PyObject * list_item(PyListObject *a, Py_ssize_t i) { - if (i < 0 || i >= Py_SIZE(a)) { + if (!valid_index(i, Py_SIZE(a))) { if (indexerr == NULL) { indexerr = PyUnicode_FromString( "list index out of range"); @@ -749,7 +762,7 @@ list_inplace_repeat(PyListObject *self, Py_ssize_t n) static int list_ass_item(PyListObject *a, Py_ssize_t i, PyObject *v) { - if (i < 0 || i >= Py_SIZE(a)) { + if (!valid_index(i, Py_SIZE(a))) { PyErr_SetString(PyExc_IndexError, "list assignment index out of range"); return -1; @@ -996,7 +1009,7 @@ list_pop_impl(PyListObject *self, Py_ssize_t index) } if (index < 0) index += Py_SIZE(self); - if (index < 0 || index >= Py_SIZE(self)) { + if (!valid_index(index, Py_SIZE(self))) { PyErr_SetString(PyExc_IndexError, "pop index out of range"); return NULL; } From webhook-mailer at python.org Wed Oct 10 23:55:37 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 11 Oct 2018 03:55:37 -0000 Subject: [Python-checkins] bpo-34576 warn users on security for http.server (GH-9720) Message-ID: https://github.com/python/cpython/commit/57038bcb24407abbbb46e6d278d0ab4b6ad25bbf commit: 57038bcb24407abbbb46e6d278d0ab4b6ad25bbf branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-10T20:55:34-07:00 summary: bpo-34576 warn users on security for http.server (GH-9720) It was proposed to add an warning for http.server regarding security issues. The wording was provided at bpo-26005 by @orsenthil (cherry picked from commit 1d26c72e6a9c5b28b27c158f2f196217707dbb0f) Co-authored-by: Felipe Rodrigues files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 0bd7f778cec0..0b93c62288b1 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -16,6 +16,14 @@ This module defines classes for implementing HTTP servers (Web servers). +Security Considerations +----------------------- + +http.server is meant for demo purposes and does not implement the stringent +security checks needed of real HTTP server. We do not recommend +using this module directly in production. + + One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. It creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:: From webhook-mailer at python.org Thu Oct 11 00:41:07 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 11 Oct 2018 04:41:07 -0000 Subject: [Python-checkins] bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) Message-ID: https://github.com/python/cpython/commit/9b8c2e767643256202bb11456ba8665593b9a500 commit: 9b8c2e767643256202bb11456ba8665593b9a500 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-11T07:41:00+03:00 summary: bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) for the SHAKE algorithm in the hashlib module. files: A Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst M Lib/test/test_hashlib.py M Modules/_sha3/sha3module.c diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index c8a873f1e01f..f83f73a0cc45 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -230,6 +230,19 @@ def test_hexdigest(self): self.assertIsInstance(h.digest(), bytes) self.assertEqual(hexstr(h.digest()), h.hexdigest()) + def test_digest_length_overflow(self): + # See issue #34922 + large_sizes = (2**29, 2**32-10, 2**32+10, 2**61, 2**64-10, 2**64+10) + for cons in self.hash_constructors: + h = cons() + if h.name not in self.shakes: + continue + for digest in h.digest, h.hexdigest: + self.assertRaises(ValueError, digest, -10) + for length in large_sizes: + with self.assertRaises((ValueError, OverflowError)): + digest(length) + def test_name_attribute(self): for cons in self.hash_constructors: h = cons() diff --git a/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst b/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst new file mode 100644 index 000000000000..646388688399 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst @@ -0,0 +1,3 @@ +Fixed integer overflow in the :meth:`~hashlib.shake.digest()` and +:meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm +in the :mod:`hashlib` module. diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index 46c1ff153852..b737363d7172 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -589,6 +589,10 @@ _SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex) int res; PyObject *result = NULL; + if (digestlen >= (1 << 29)) { + PyErr_SetString(PyExc_ValueError, "length is too large"); + return NULL; + } /* ExtractLane needs at least SHA3_MAX_DIGESTSIZE + SHA3_LANESIZE and * SHA3_LANESIZE extra space. */ From webhook-mailer at python.org Thu Oct 11 00:56:11 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 11 Oct 2018 04:56:11 -0000 Subject: [Python-checkins] [3.6] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) (GH-8581) (GH-9657) Message-ID: https://github.com/python/cpython/commit/f543e18708efb04ed3a0b78c8dc31fbb1404ac7d commit: f543e18708efb04ed3a0b78c8dc31fbb1404ac7d branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-10-11T07:56:06+03:00 summary: [3.6] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) (GH-8581) (GH-9657) * help(hashlib) didn't work because of incorrect module name in blake2b and blake2s classes. * Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly accepted keyword argument "string" for binary data, but documented as accepting the "data" keyword argument. Now this parameter is positional-only. * Keyword-only parameters in blake2b() and blake2s() were not documented as keyword-only. * Default value for some parameters of blake2b() and blake2s() was None, which is not acceptable value. * The length argument for shake_*.digest() was wrapped out to 32 bits. * The argument for shake_128.digest() and shake_128.hexdigest() was not positional-only as intended. * TypeError messages for incorrect arguments in all constructors sha3_*(), shake_*() and keccak_*() incorrectly referred to sha3_224. Also made the following enhancements: * More accurately specified input and result types for strings, bytes and bytes-like objects. * Unified positional parameter names for update() and constructors. * Improved formatting. (cherry picked from commit f1d36d8efaecd5c84cb35e35119b283f37d83c40) (cherry picked from commit 47957dab94a4efa2fee61c9a8193f78300950769) files: A Misc/NEWS.d/next/Library/2018-07-20-09-11-05.bpo-33729.sO6iTb.rst M Doc/library/hashlib.rst M Lib/hashlib.py M Lib/test/test_hashlib.py M Modules/_blake2/blake2b_impl.c M Modules/_blake2/blake2s_impl.c M Modules/_blake2/clinic/blake2b_impl.c.h M Modules/_blake2/clinic/blake2s_impl.c.h M Modules/_hashopenssl.c M Modules/_sha3/clinic/sha3module.c.h M Modules/_sha3/sha3module.c diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index 47c3db2595cf..b4f517635233 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -101,7 +101,7 @@ More condensed: .. function:: new(name[, data]) - Is a generic constructor that takes the string name of the desired + Is a generic constructor that takes the string *name* of the desired algorithm as its first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer. The named constructors are much faster than :func:`new` @@ -162,10 +162,10 @@ A hash object has the following attributes: A hash object has the following methods: -.. method:: hash.update(arg) +.. method:: hash.update(data) - Update the hash object with the object *arg*, which must be interpretable as - a buffer of bytes. Repeated calls are equivalent to a single call with the + Update the hash object with the :term:`bytes-like object`. + Repeated calls are equivalent to a single call with the concatenation of all the arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``. @@ -206,7 +206,7 @@ by the SHAKE algorithm. .. method:: shake.digest(length) Return the digest of the data passed to the :meth:`update` method so far. - This is a bytes object of size ``length`` which may contain bytes in + This is a bytes object of size *length* which may contain bytes in the whole range from 0 to 255. @@ -262,9 +262,10 @@ include a `salt `_. The function provides scrypt password-based key derivation function as defined in :rfc:`7914`. - *password* and *salt* must be bytes-like objects. Applications and - libraries should limit *password* to a sensible length (e.g. 1024). *salt* - should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`. + *password* and *salt* must be :term:`bytes-like objects + `. Applications and libraries should limit *password* + to a sensible length (e.g. 1024). *salt* should be about 16 or more + bytes from a proper source, e.g. :func:`os.urandom`. *n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MB). @@ -305,11 +306,11 @@ Creating hash objects New hash objects are created by calling constructor functions: -.. function:: blake2b(data=b'', digest_size=64, key=b'', salt=b'', \ +.. function:: blake2b(data=b'', *, digest_size=64, key=b'', salt=b'', \ person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, \ node_depth=0, inner_size=0, last_node=False) -.. function:: blake2s(data=b'', digest_size=32, key=b'', salt=b'', \ +.. function:: blake2s(data=b'', *, digest_size=32, key=b'', salt=b'', \ person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, \ node_depth=0, inner_size=0, last_node=False) @@ -317,8 +318,8 @@ New hash objects are created by calling constructor functions: These functions return the corresponding hash objects for calculating BLAKE2b or BLAKE2s. They optionally take these general parameters: -* *data*: initial chunk of data to hash, which must be interpretable as buffer - of bytes. +* *data*: initial chunk of data to hash, which must be + :term:`bytes-like object`. It can be passed only as positional argument. * *digest_size*: size of output digest in bytes. @@ -427,7 +428,7 @@ object, and, finally, get the digest out of the object by calling As a shortcut, you can pass the first chunk of data to update directly to the -constructor as the first argument (or as *data* keyword argument): +constructor as the positional argument: >>> from hashlib import blake2b >>> blake2b(b'Hello world').hexdigest() diff --git a/Lib/hashlib.py b/Lib/hashlib.py index 053a7add4593..98d2d7981a38 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -25,18 +25,18 @@ sha384 and sha512 will be slow on 32 bit platforms. Hash objects have these methods: - - update(arg): Update the hash object with the bytes in arg. Repeated calls - are equivalent to a single call with the concatenation of all - the arguments. - - digest(): Return the digest of the bytes passed to the update() method - so far. - - hexdigest(): Like digest() except the digest is returned as a unicode - object of double length, containing only hexadecimal digits. - - copy(): Return a copy (clone) of the hash object. This can be used to - efficiently compute the digests of strings that share a common - initial substring. - -For example, to obtain the digest of the string 'Nobody inspects the + - update(data): Update the hash object with the bytes in data. Repeated calls + are equivalent to a single call with the concatenation of all + the arguments. + - digest(): Return the digest of the bytes passed to the update() method + so far as a bytes object. + - hexdigest(): Like digest() except the digest is returned as a string + of double length, containing only hexadecimal digits. + - copy(): Return a copy (clone) of the hash object. This can be used to + efficiently compute the digests of datas that share a common + initial substring. + +For example, to obtain the digest of the byte string 'Nobody inspects the spammish repetition': >>> import hashlib @@ -130,14 +130,15 @@ def __get_openssl_constructor(name): def __py_new(name, data=b'', **kwargs): """new(name, data=b'', **kwargs) - Return a new hashing object using the - named algorithm; optionally initialized with data (which must be bytes). + named algorithm; optionally initialized with data (which must be + a bytes-like object). """ return __get_builtin_constructor(name)(data, **kwargs) def __hash_new(name, data=b'', **kwargs): """new(name, data=b'') - Return a new hashing object using the named algorithm; - optionally initialized with data (which must be bytes). + optionally initialized with data (which must be a bytes-like object). """ if name in {'blake2b', 'blake2s'}: # Prefer our blake2 implementation. diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 220b5febc2fe..995fe60a076c 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -571,8 +571,12 @@ def check_blake2(self, constructor, salt_size, person_size, key_size, self.assertRaises(OverflowError, constructor, node_offset=-1) self.assertRaises(OverflowError, constructor, node_offset=max_offset+1) + self.assertRaises(TypeError, constructor, data=b'') + self.assertRaises(TypeError, constructor, string=b'') + self.assertRaises(TypeError, constructor, '') + constructor( - string=b'', + b'', key=b'', salt=b'', person=b'', diff --git a/Misc/NEWS.d/next/Library/2018-07-20-09-11-05.bpo-33729.sO6iTb.rst b/Misc/NEWS.d/next/Library/2018-07-20-09-11-05.bpo-33729.sO6iTb.rst new file mode 100644 index 000000000000..c4718722ad7c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-20-09-11-05.bpo-33729.sO6iTb.rst @@ -0,0 +1 @@ +Fixed issues with arguments parsing in :mod:`hashlib`. diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c index 9e6f72e67f49..418c0184006d 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -49,10 +49,10 @@ typedef struct { #include "clinic/blake2b_impl.c.h" /*[clinic input] -module _blake2b -class _blake2b.blake2b "BLAKE2bObject *" "&PyBlake2_BLAKE2bType" +module _blake2 +class _blake2.blake2b "BLAKE2bObject *" "&PyBlake2_BLAKE2bType" [clinic start generated code]*/ -/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6893358c6622aecf]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d47b0527b39c673f]*/ static BLAKE2bObject * @@ -70,17 +70,18 @@ new_BLAKE2bObject(PyTypeObject *type) /*[clinic input] @classmethod -_blake2b.blake2b.__new__ as py_blake2b_new - string as data: object = NULL +_blake2.blake2b.__new__ as py_blake2b_new + data: object(c_default="NULL") = b'' + / * - digest_size: int(c_default="BLAKE2B_OUTBYTES") = _blake2b.blake2b.MAX_DIGEST_SIZE - key: Py_buffer = None - salt: Py_buffer = None - person: Py_buffer = None + digest_size: int(c_default="BLAKE2B_OUTBYTES") = _blake2.blake2b.MAX_DIGEST_SIZE + key: Py_buffer(c_default="NULL", py_default="b''") = None + salt: Py_buffer(c_default="NULL", py_default="b''") = None + person: Py_buffer(c_default="NULL", py_default="b''") = None fanout: int = 1 depth: int = 1 - leaf_size as leaf_size_obj: object = NULL - node_offset as node_offset_obj: object = NULL + leaf_size as leaf_size_obj: object(c_default="NULL") = 0 + node_offset as node_offset_obj: object(c_default="NULL") = 0 node_depth: int = 0 inner_size: int = 0 last_node: bool = False @@ -94,7 +95,7 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size, int fanout, int depth, PyObject *leaf_size_obj, PyObject *node_offset_obj, int node_depth, int inner_size, int last_node) -/*[clinic end generated code: output=7506d8d890e5f13b input=e41548dfa0866031]*/ +/*[clinic end generated code: output=7506d8d890e5f13b input=aca35b33c5612b4b]*/ { BLAKE2bObject *self = NULL; Py_buffer buf; @@ -256,14 +257,14 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size, } /*[clinic input] -_blake2b.blake2b.copy +_blake2.blake2b.copy Return a copy of the hash object. [clinic start generated code]*/ static PyObject * -_blake2b_blake2b_copy_impl(BLAKE2bObject *self) -/*[clinic end generated code: output=c89cd33550ab1543 input=4c9c319f18f10747]*/ +_blake2_blake2b_copy_impl(BLAKE2bObject *self) +/*[clinic end generated code: output=ff6acee5f93656ae input=e383c2d199fd8a2e]*/ { BLAKE2bObject *cpy; @@ -278,21 +279,21 @@ _blake2b_blake2b_copy_impl(BLAKE2bObject *self) } /*[clinic input] -_blake2b.blake2b.update +_blake2.blake2b.update - obj: object + data: object / -Update this hash object's state with the provided string. +Update this hash object's state with the provided bytes-like object. [clinic start generated code]*/ static PyObject * -_blake2b_blake2b_update(BLAKE2bObject *self, PyObject *obj) -/*[clinic end generated code: output=a888f07c4cddbe94 input=3ecb8c13ee4260f2]*/ +_blake2_blake2b_update(BLAKE2bObject *self, PyObject *data) +/*[clinic end generated code: output=010dfcbe22654359 input=ffc4aa6a6a225d31]*/ { Py_buffer buf; - GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + GET_BUFFER_VIEW_OR_ERROUT(data, &buf); #ifdef WITH_THREAD if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) @@ -317,14 +318,14 @@ _blake2b_blake2b_update(BLAKE2bObject *self, PyObject *obj) } /*[clinic input] -_blake2b.blake2b.digest +_blake2.blake2b.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * -_blake2b_blake2b_digest_impl(BLAKE2bObject *self) -/*[clinic end generated code: output=b13a79360d984740 input=ac2fa462ebb1b9c7]*/ +_blake2_blake2b_digest_impl(BLAKE2bObject *self) +/*[clinic end generated code: output=a5864660f4bfc61a input=7d21659e9c5fff02]*/ { uint8_t digest[BLAKE2B_OUTBYTES]; blake2b_state state_cpy; @@ -338,14 +339,14 @@ _blake2b_blake2b_digest_impl(BLAKE2bObject *self) } /*[clinic input] -_blake2b.blake2b.hexdigest +_blake2.blake2b.hexdigest Return the digest value as a string of hexadecimal digits. [clinic start generated code]*/ static PyObject * -_blake2b_blake2b_hexdigest_impl(BLAKE2bObject *self) -/*[clinic end generated code: output=6a503611715b24bd input=d58f0b2f37812e33]*/ +_blake2_blake2b_hexdigest_impl(BLAKE2bObject *self) +/*[clinic end generated code: output=b5598a87d8794a60 input=76930f6946351f56]*/ { uint8_t digest[BLAKE2B_OUTBYTES]; blake2b_state state_cpy; @@ -359,10 +360,10 @@ _blake2b_blake2b_hexdigest_impl(BLAKE2bObject *self) static PyMethodDef py_blake2b_methods[] = { - _BLAKE2B_BLAKE2B_COPY_METHODDEF - _BLAKE2B_BLAKE2B_DIGEST_METHODDEF - _BLAKE2B_BLAKE2B_HEXDIGEST_METHODDEF - _BLAKE2B_BLAKE2B_UPDATE_METHODDEF + _BLAKE2_BLAKE2B_COPY_METHODDEF + _BLAKE2_BLAKE2B_DIGEST_METHODDEF + _BLAKE2_BLAKE2B_HEXDIGEST_METHODDEF + _BLAKE2_BLAKE2B_UPDATE_METHODDEF {NULL, NULL} }; diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c index 0743fdf2084c..24e529b6596a 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -49,10 +49,10 @@ typedef struct { #include "clinic/blake2s_impl.c.h" /*[clinic input] -module _blake2s -class _blake2s.blake2s "BLAKE2sObject *" "&PyBlake2_BLAKE2sType" +module _blake2 +class _blake2.blake2s "BLAKE2sObject *" "&PyBlake2_BLAKE2sType" [clinic start generated code]*/ -/*[clinic end generated code: output=da39a3ee5e6b4b0d input=edbfcf7557a685a7]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4b79d7ffe07286ce]*/ static BLAKE2sObject * @@ -70,17 +70,18 @@ new_BLAKE2sObject(PyTypeObject *type) /*[clinic input] @classmethod -_blake2s.blake2s.__new__ as py_blake2s_new - string as data: object = NULL +_blake2.blake2s.__new__ as py_blake2s_new + data: object(c_default="NULL") = b'' + / * - digest_size: int(c_default="BLAKE2S_OUTBYTES") = _blake2s.blake2s.MAX_DIGEST_SIZE - key: Py_buffer = None - salt: Py_buffer = None - person: Py_buffer = None + digest_size: int(c_default="BLAKE2S_OUTBYTES") = _blake2.blake2s.MAX_DIGEST_SIZE + key: Py_buffer(c_default="NULL", py_default="b''") = None + salt: Py_buffer(c_default="NULL", py_default="b''") = None + person: Py_buffer(c_default="NULL", py_default="b''") = None fanout: int = 1 depth: int = 1 - leaf_size as leaf_size_obj: object = NULL - node_offset as node_offset_obj: object = NULL + leaf_size as leaf_size_obj: object(c_default="NULL") = 0 + node_offset as node_offset_obj: object(c_default="NULL") = 0 node_depth: int = 0 inner_size: int = 0 last_node: bool = False @@ -94,7 +95,7 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size, int fanout, int depth, PyObject *leaf_size_obj, PyObject *node_offset_obj, int node_depth, int inner_size, int last_node) -/*[clinic end generated code: output=fe060b258a8cbfc6 input=458cfdcb3d0d47ff]*/ +/*[clinic end generated code: output=fe060b258a8cbfc6 input=3abfaabe7f5f62cc]*/ { BLAKE2sObject *self = NULL; Py_buffer buf; @@ -256,14 +257,14 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size, } /*[clinic input] -_blake2s.blake2s.copy +_blake2.blake2s.copy Return a copy of the hash object. [clinic start generated code]*/ static PyObject * -_blake2s_blake2s_copy_impl(BLAKE2sObject *self) -/*[clinic end generated code: output=6c5bada404b7aed7 input=c8858e887ae4a07a]*/ +_blake2_blake2s_copy_impl(BLAKE2sObject *self) +/*[clinic end generated code: output=5b90131c4eae275e input=0b9d44942f0fe4b2]*/ { BLAKE2sObject *cpy; @@ -278,21 +279,21 @@ _blake2s_blake2s_copy_impl(BLAKE2sObject *self) } /*[clinic input] -_blake2s.blake2s.update +_blake2.blake2s.update - obj: object + data: object / -Update this hash object's state with the provided string. +Update this hash object's state with the provided bytes-like object. [clinic start generated code]*/ static PyObject * -_blake2s_blake2s_update(BLAKE2sObject *self, PyObject *obj) -/*[clinic end generated code: output=fe8438a1d3cede87 input=47a408b9a3cc05c5]*/ +_blake2_blake2s_update(BLAKE2sObject *self, PyObject *data) +/*[clinic end generated code: output=757dc087fec37815 input=97500db2f9de4aaa]*/ { Py_buffer buf; - GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + GET_BUFFER_VIEW_OR_ERROUT(data, &buf); #ifdef WITH_THREAD if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) @@ -317,14 +318,14 @@ _blake2s_blake2s_update(BLAKE2sObject *self, PyObject *obj) } /*[clinic input] -_blake2s.blake2s.digest +_blake2.blake2s.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * -_blake2s_blake2s_digest_impl(BLAKE2sObject *self) -/*[clinic end generated code: output=80e81a48c6f79cf9 input=feb9a220135bdeba]*/ +_blake2_blake2s_digest_impl(BLAKE2sObject *self) +/*[clinic end generated code: output=40c566ca4bc6bc51 input=f41e0b8d6d937454]*/ { uint8_t digest[BLAKE2S_OUTBYTES]; blake2s_state state_cpy; @@ -338,14 +339,14 @@ _blake2s_blake2s_digest_impl(BLAKE2sObject *self) } /*[clinic input] -_blake2s.blake2s.hexdigest +_blake2.blake2s.hexdigest Return the digest value as a string of hexadecimal digits. [clinic start generated code]*/ static PyObject * -_blake2s_blake2s_hexdigest_impl(BLAKE2sObject *self) -/*[clinic end generated code: output=db6c5028c0a3c2e5 input=4e4877b8bd7aea91]*/ +_blake2_blake2s_hexdigest_impl(BLAKE2sObject *self) +/*[clinic end generated code: output=15153eb5e59c52eb input=c77a1321567e8952]*/ { uint8_t digest[BLAKE2S_OUTBYTES]; blake2s_state state_cpy; @@ -359,10 +360,10 @@ _blake2s_blake2s_hexdigest_impl(BLAKE2sObject *self) static PyMethodDef py_blake2s_methods[] = { - _BLAKE2S_BLAKE2S_COPY_METHODDEF - _BLAKE2S_BLAKE2S_DIGEST_METHODDEF - _BLAKE2S_BLAKE2S_HEXDIGEST_METHODDEF - _BLAKE2S_BLAKE2S_UPDATE_METHODDEF + _BLAKE2_BLAKE2S_COPY_METHODDEF + _BLAKE2_BLAKE2S_DIGEST_METHODDEF + _BLAKE2_BLAKE2S_HEXDIGEST_METHODDEF + _BLAKE2_BLAKE2S_UPDATE_METHODDEF {NULL, NULL} }; diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index 71c073aa36c6..9b2965eb6b31 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -3,10 +3,9 @@ preserve [clinic start generated code]*/ PyDoc_STRVAR(py_blake2b_new__doc__, -"blake2b(string=None, *, digest_size=_blake2b.blake2b.MAX_DIGEST_SIZE,\n" -" key=None, salt=None, person=None, fanout=1, depth=1,\n" -" leaf_size=None, node_offset=None, node_depth=0, inner_size=0,\n" -" last_node=False)\n" +"blake2b(data=b\'\', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,\n" +" key=b\'\', salt=b\'\', person=b\'\', fanout=1, depth=1, leaf_size=0,\n" +" node_offset=0, node_depth=0, inner_size=0, last_node=False)\n" "--\n" "\n" "Return a new BLAKE2b hash object."); @@ -22,7 +21,7 @@ static PyObject * py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"string", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", NULL}; + static const char * const _keywords[] = {"", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", NULL}; static _PyArg_Parser _parser = {"|O$iy*y*y*iiOOiip:blake2b", _keywords, 0}; PyObject *data = NULL; int digest_size = BLAKE2B_OUTBYTES; @@ -60,66 +59,66 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) return return_value; } -PyDoc_STRVAR(_blake2b_blake2b_copy__doc__, +PyDoc_STRVAR(_blake2_blake2b_copy__doc__, "copy($self, /)\n" "--\n" "\n" "Return a copy of the hash object."); -#define _BLAKE2B_BLAKE2B_COPY_METHODDEF \ - {"copy", (PyCFunction)_blake2b_blake2b_copy, METH_NOARGS, _blake2b_blake2b_copy__doc__}, +#define _BLAKE2_BLAKE2B_COPY_METHODDEF \ + {"copy", (PyCFunction)_blake2_blake2b_copy, METH_NOARGS, _blake2_blake2b_copy__doc__}, static PyObject * -_blake2b_blake2b_copy_impl(BLAKE2bObject *self); +_blake2_blake2b_copy_impl(BLAKE2bObject *self); static PyObject * -_blake2b_blake2b_copy(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) +_blake2_blake2b_copy(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2b_blake2b_copy_impl(self); + return _blake2_blake2b_copy_impl(self); } -PyDoc_STRVAR(_blake2b_blake2b_update__doc__, -"update($self, obj, /)\n" +PyDoc_STRVAR(_blake2_blake2b_update__doc__, +"update($self, data, /)\n" "--\n" "\n" -"Update this hash object\'s state with the provided string."); +"Update this hash object\'s state with the provided bytes-like object."); -#define _BLAKE2B_BLAKE2B_UPDATE_METHODDEF \ - {"update", (PyCFunction)_blake2b_blake2b_update, METH_O, _blake2b_blake2b_update__doc__}, +#define _BLAKE2_BLAKE2B_UPDATE_METHODDEF \ + {"update", (PyCFunction)_blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__}, -PyDoc_STRVAR(_blake2b_blake2b_digest__doc__, +PyDoc_STRVAR(_blake2_blake2b_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); -#define _BLAKE2B_BLAKE2B_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_blake2b_blake2b_digest, METH_NOARGS, _blake2b_blake2b_digest__doc__}, +#define _BLAKE2_BLAKE2B_DIGEST_METHODDEF \ + {"digest", (PyCFunction)_blake2_blake2b_digest, METH_NOARGS, _blake2_blake2b_digest__doc__}, static PyObject * -_blake2b_blake2b_digest_impl(BLAKE2bObject *self); +_blake2_blake2b_digest_impl(BLAKE2bObject *self); static PyObject * -_blake2b_blake2b_digest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) +_blake2_blake2b_digest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2b_blake2b_digest_impl(self); + return _blake2_blake2b_digest_impl(self); } -PyDoc_STRVAR(_blake2b_blake2b_hexdigest__doc__, +PyDoc_STRVAR(_blake2_blake2b_hexdigest__doc__, "hexdigest($self, /)\n" "--\n" "\n" "Return the digest value as a string of hexadecimal digits."); -#define _BLAKE2B_BLAKE2B_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_blake2b_blake2b_hexdigest, METH_NOARGS, _blake2b_blake2b_hexdigest__doc__}, +#define _BLAKE2_BLAKE2B_HEXDIGEST_METHODDEF \ + {"hexdigest", (PyCFunction)_blake2_blake2b_hexdigest, METH_NOARGS, _blake2_blake2b_hexdigest__doc__}, static PyObject * -_blake2b_blake2b_hexdigest_impl(BLAKE2bObject *self); +_blake2_blake2b_hexdigest_impl(BLAKE2bObject *self); static PyObject * -_blake2b_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) +_blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2b_blake2b_hexdigest_impl(self); + return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=535a54852c98e51c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0eb559f418fc0a21 input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index ca908d393b5b..42b87b7099df 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -3,10 +3,9 @@ preserve [clinic start generated code]*/ PyDoc_STRVAR(py_blake2s_new__doc__, -"blake2s(string=None, *, digest_size=_blake2s.blake2s.MAX_DIGEST_SIZE,\n" -" key=None, salt=None, person=None, fanout=1, depth=1,\n" -" leaf_size=None, node_offset=None, node_depth=0, inner_size=0,\n" -" last_node=False)\n" +"blake2s(data=b\'\', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,\n" +" key=b\'\', salt=b\'\', person=b\'\', fanout=1, depth=1, leaf_size=0,\n" +" node_offset=0, node_depth=0, inner_size=0, last_node=False)\n" "--\n" "\n" "Return a new BLAKE2s hash object."); @@ -22,7 +21,7 @@ static PyObject * py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"string", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", NULL}; + static const char * const _keywords[] = {"", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", NULL}; static _PyArg_Parser _parser = {"|O$iy*y*y*iiOOiip:blake2s", _keywords, 0}; PyObject *data = NULL; int digest_size = BLAKE2S_OUTBYTES; @@ -60,66 +59,66 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) return return_value; } -PyDoc_STRVAR(_blake2s_blake2s_copy__doc__, +PyDoc_STRVAR(_blake2_blake2s_copy__doc__, "copy($self, /)\n" "--\n" "\n" "Return a copy of the hash object."); -#define _BLAKE2S_BLAKE2S_COPY_METHODDEF \ - {"copy", (PyCFunction)_blake2s_blake2s_copy, METH_NOARGS, _blake2s_blake2s_copy__doc__}, +#define _BLAKE2_BLAKE2S_COPY_METHODDEF \ + {"copy", (PyCFunction)_blake2_blake2s_copy, METH_NOARGS, _blake2_blake2s_copy__doc__}, static PyObject * -_blake2s_blake2s_copy_impl(BLAKE2sObject *self); +_blake2_blake2s_copy_impl(BLAKE2sObject *self); static PyObject * -_blake2s_blake2s_copy(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) +_blake2_blake2s_copy(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2s_blake2s_copy_impl(self); + return _blake2_blake2s_copy_impl(self); } -PyDoc_STRVAR(_blake2s_blake2s_update__doc__, -"update($self, obj, /)\n" +PyDoc_STRVAR(_blake2_blake2s_update__doc__, +"update($self, data, /)\n" "--\n" "\n" -"Update this hash object\'s state with the provided string."); +"Update this hash object\'s state with the provided bytes-like object."); -#define _BLAKE2S_BLAKE2S_UPDATE_METHODDEF \ - {"update", (PyCFunction)_blake2s_blake2s_update, METH_O, _blake2s_blake2s_update__doc__}, +#define _BLAKE2_BLAKE2S_UPDATE_METHODDEF \ + {"update", (PyCFunction)_blake2_blake2s_update, METH_O, _blake2_blake2s_update__doc__}, -PyDoc_STRVAR(_blake2s_blake2s_digest__doc__, +PyDoc_STRVAR(_blake2_blake2s_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); -#define _BLAKE2S_BLAKE2S_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_blake2s_blake2s_digest, METH_NOARGS, _blake2s_blake2s_digest__doc__}, +#define _BLAKE2_BLAKE2S_DIGEST_METHODDEF \ + {"digest", (PyCFunction)_blake2_blake2s_digest, METH_NOARGS, _blake2_blake2s_digest__doc__}, static PyObject * -_blake2s_blake2s_digest_impl(BLAKE2sObject *self); +_blake2_blake2s_digest_impl(BLAKE2sObject *self); static PyObject * -_blake2s_blake2s_digest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) +_blake2_blake2s_digest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2s_blake2s_digest_impl(self); + return _blake2_blake2s_digest_impl(self); } -PyDoc_STRVAR(_blake2s_blake2s_hexdigest__doc__, +PyDoc_STRVAR(_blake2_blake2s_hexdigest__doc__, "hexdigest($self, /)\n" "--\n" "\n" "Return the digest value as a string of hexadecimal digits."); -#define _BLAKE2S_BLAKE2S_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_blake2s_blake2s_hexdigest, METH_NOARGS, _blake2s_blake2s_hexdigest__doc__}, +#define _BLAKE2_BLAKE2S_HEXDIGEST_METHODDEF \ + {"hexdigest", (PyCFunction)_blake2_blake2s_hexdigest, METH_NOARGS, _blake2_blake2s_hexdigest__doc__}, static PyObject * -_blake2s_blake2s_hexdigest_impl(BLAKE2sObject *self); +_blake2_blake2s_hexdigest_impl(BLAKE2sObject *self); static PyObject * -_blake2s_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) +_blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2s_blake2s_hexdigest_impl(self); + return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=535ea7903f9ccf76 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=13d4b08ea9ee2d62 input=a9049054013a1b77]*/ diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 8f6185ccb73b..9e3a28689608 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -740,6 +740,10 @@ pbkdf2_hmac(PyObject *self, PyObject *args, PyObject *kwdict) #if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_SCRYPT) && !defined(LIBRESSL_VERSION_NUMBER) #define PY_SCRYPT 1 +/* XXX: Parameters salt, n, r and p should be required keyword-only parameters. + They are optional in the Argument Clinic declaration only due to a + limitation of PyArg_ParseTupleAndKeywords. */ + /*[clinic input] _hashlib.scrypt diff --git a/Modules/_sha3/clinic/sha3module.c.h b/Modules/_sha3/clinic/sha3module.c.h index 7688e7de29f9..35f11abca0fc 100644 --- a/Modules/_sha3/clinic/sha3module.c.h +++ b/Modules/_sha3/clinic/sha3module.c.h @@ -2,33 +2,6 @@ preserve [clinic start generated code]*/ -PyDoc_STRVAR(py_sha3_new__doc__, -"sha3_224(string=None)\n" -"--\n" -"\n" -"Return a new SHA3 hash object with a hashbit length of 28 bytes."); - -static PyObject * -py_sha3_new_impl(PyTypeObject *type, PyObject *data); - -static PyObject * -py_sha3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"string", NULL}; - static _PyArg_Parser _parser = {"|O:sha3_224", _keywords, 0}; - PyObject *data = NULL; - - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, - &data)) { - goto exit; - } - return_value = py_sha3_new_impl(type, data); - -exit: - return return_value; -} - PyDoc_STRVAR(_sha3_sha3_224_copy__doc__, "copy($self, /)\n" "--\n" @@ -51,7 +24,7 @@ PyDoc_STRVAR(_sha3_sha3_224_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define _SHA3_SHA3_224_DIGEST_METHODDEF \ {"digest", (PyCFunction)_sha3_sha3_224_digest, METH_NOARGS, _sha3_sha3_224_digest__doc__}, @@ -84,71 +57,29 @@ _sha3_sha3_224_hexdigest(SHA3object *self, PyObject *Py_UNUSED(ignored)) } PyDoc_STRVAR(_sha3_sha3_224_update__doc__, -"update($self, obj, /)\n" +"update($self, data, /)\n" "--\n" "\n" -"Update this hash object\'s state with the provided string."); +"Update this hash object\'s state with the provided bytes-like object."); #define _SHA3_SHA3_224_UPDATE_METHODDEF \ {"update", (PyCFunction)_sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__}, PyDoc_STRVAR(_sha3_shake_128_digest__doc__, -"digest($self, /, length)\n" +"digest($self, length, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define _SHA3_SHAKE_128_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_sha3_shake_128_digest, METH_FASTCALL, _sha3_shake_128_digest__doc__}, - -static PyObject * -_sha3_shake_128_digest_impl(SHA3object *self, unsigned long length); - -static PyObject * -_sha3_shake_128_digest(SHA3object *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"length", NULL}; - static _PyArg_Parser _parser = {"k:digest", _keywords, 0}; - unsigned long length; - - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, - &length)) { - goto exit; - } - return_value = _sha3_shake_128_digest_impl(self, length); - -exit: - return return_value; -} + {"digest", (PyCFunction)_sha3_shake_128_digest, METH_O, _sha3_shake_128_digest__doc__}, PyDoc_STRVAR(_sha3_shake_128_hexdigest__doc__, -"hexdigest($self, /, length)\n" +"hexdigest($self, length, /)\n" "--\n" "\n" "Return the digest value as a string of hexadecimal digits."); #define _SHA3_SHAKE_128_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_sha3_shake_128_hexdigest, METH_FASTCALL, _sha3_shake_128_hexdigest__doc__}, - -static PyObject * -_sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length); - -static PyObject * -_sha3_shake_128_hexdigest(SHA3object *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"length", NULL}; - static _PyArg_Parser _parser = {"k:hexdigest", _keywords, 0}; - unsigned long length; - - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, - &length)) { - goto exit; - } - return_value = _sha3_shake_128_hexdigest_impl(self, length); - -exit: - return return_value; -} -/*[clinic end generated code: output=9888beab45136a56 input=a9049054013a1b77]*/ + {"hexdigest", (PyCFunction)_sha3_shake_128_hexdigest, METH_O, _sha3_shake_128_hexdigest__doc__}, +/*[clinic end generated code: output=826b6b5a7c3406eb input=a9049054013a1b77]*/ diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index e8504de16154..8d880d0e7026 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -174,21 +174,20 @@ newSHA3object(PyTypeObject *type) } -/*[clinic input] - at classmethod -_sha3.sha3_224.__new__ as py_sha3_new - string as data: object = NULL - -Return a new SHA3 hash object with a hashbit length of 28 bytes. -[clinic start generated code]*/ - static PyObject * -py_sha3_new_impl(PyTypeObject *type, PyObject *data) -/*[clinic end generated code: output=8d5c34279e69bf09 input=d7c582b950a858b6]*/ +py_sha3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { SHA3object *self = NULL; Py_buffer buf = {NULL, NULL}; HashReturn res; + PyObject *data = NULL; + + if (!_PyArg_NoKeywords(type->tp_name, kwargs)) { + return NULL; + } + if (!PyArg_UnpackTuple(args, type->tp_name, 0, 1, &data)) { + return NULL; + } self = newSHA3object(type); if (self == NULL) { @@ -302,12 +301,12 @@ _sha3_sha3_224_copy_impl(SHA3object *self) /*[clinic input] _sha3.sha3_224.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * _sha3_sha3_224_digest_impl(SHA3object *self) -/*[clinic end generated code: output=fd531842e20b2d5b input=a5807917d219b30e]*/ +/*[clinic end generated code: output=fd531842e20b2d5b input=5b2a659536bbd248]*/ { unsigned char digest[SHA3_MAX_DIGESTSIZE + SHA3_LANESIZE]; SHA3_state temp; @@ -357,20 +356,20 @@ _sha3_sha3_224_hexdigest_impl(SHA3object *self) /*[clinic input] _sha3.sha3_224.update - obj: object + data: object / -Update this hash object's state with the provided string. +Update this hash object's state with the provided bytes-like object. [clinic start generated code]*/ static PyObject * -_sha3_sha3_224_update(SHA3object *self, PyObject *obj) -/*[clinic end generated code: output=06721d55b483e0af input=be44bf0d1c279791]*/ +_sha3_sha3_224_update(SHA3object *self, PyObject *data) +/*[clinic end generated code: output=d3223352286ed357 input=a887f54dcc4ae227]*/ { Py_buffer buf; HashReturn res; - GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + GET_BUFFER_VIEW_OR_ERROUT(data, &buf); /* add new data, the function takes the length in bits not bytes */ #ifdef WITH_THREAD @@ -544,44 +543,49 @@ static PyGetSetDef SHA3_getseters[] = { py_sha3_new, /* tp_new */ \ } +PyDoc_STRVAR(sha3_224__doc__, +"sha3_224([data]) -> SHA3 object\n\ +\n\ +Return a new SHA3 hash object with a hashbit length of 28 bytes."); + PyDoc_STRVAR(sha3_256__doc__, -"sha3_256([string]) -> SHA3 object\n\ +"sha3_256([data]) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 32 bytes."); PyDoc_STRVAR(sha3_384__doc__, -"sha3_384([string]) -> SHA3 object\n\ +"sha3_384([data]) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 48 bytes."); PyDoc_STRVAR(sha3_512__doc__, -"sha3_512([string]) -> SHA3 object\n\ +"sha3_512([data]) -> SHA3 object\n\ \n\ Return a new SHA3 hash object with a hashbit length of 64 bytes."); -SHA3_TYPE(SHA3_224type, "_sha3.sha3_224", py_sha3_new__doc__, SHA3_methods); +SHA3_TYPE(SHA3_224type, "_sha3.sha3_224", sha3_224__doc__, SHA3_methods); SHA3_TYPE(SHA3_256type, "_sha3.sha3_256", sha3_256__doc__, SHA3_methods); SHA3_TYPE(SHA3_384type, "_sha3.sha3_384", sha3_384__doc__, SHA3_methods); SHA3_TYPE(SHA3_512type, "_sha3.sha3_512", sha3_512__doc__, SHA3_methods); #ifdef PY_WITH_KECCAK PyDoc_STRVAR(keccak_224__doc__, -"keccak_224([string]) -> Keccak object\n\ +"keccak_224([data]) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 28 bytes."); PyDoc_STRVAR(keccak_256__doc__, -"keccak_256([string]) -> Keccak object\n\ +"keccak_256([data]) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 32 bytes."); PyDoc_STRVAR(keccak_384__doc__, -"keccak_384([string]) -> Keccak object\n\ +"keccak_384([data]) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 48 bytes."); PyDoc_STRVAR(keccak_512__doc__, -"keccak_512([string]) -> Keccak object\n\ +"keccak_512([data]) -> Keccak object\n\ \n\ Return a new Keccak hash object with a hashbit length of 64 bytes."); @@ -593,13 +597,19 @@ SHA3_TYPE(Keccak_512type, "_sha3.keccak_512", keccak_512__doc__, SHA3_methods); static PyObject * -_SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex) +_SHAKE_digest(SHA3object *self, PyObject *digestlen_obj, int hex) { + unsigned long digestlen; unsigned char *digest = NULL; SHA3_state temp; int res; PyObject *result = NULL; + digestlen = PyLong_AsUnsignedLong(digestlen_obj); + if (digestlen == (unsigned long) -1 && PyErr_Occurred()) { + return NULL; + } + /* ExtractLane needs at least SHA3_MAX_DIGESTSIZE + SHA3_LANESIZE and * SHA3_LANESIZE extra space. */ @@ -639,15 +649,15 @@ _SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex) /*[clinic input] _sha3.shake_128.digest - length: unsigned_long(bitwise=True) - \ + length: object + / -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * -_sha3_shake_128_digest_impl(SHA3object *self, unsigned long length) -/*[clinic end generated code: output=2313605e2f87bb8f input=608c8ca80ae9d115]*/ +_sha3_shake_128_digest(SHA3object *self, PyObject *length) +/*[clinic end generated code: output=eaa80b6299142396 input=c579eb109f6227d2]*/ { return _SHAKE_digest(self, length, 0); } @@ -656,15 +666,15 @@ _sha3_shake_128_digest_impl(SHA3object *self, unsigned long length) /*[clinic input] _sha3.shake_128.hexdigest - length: unsigned_long(bitwise=True) - \ + length: object + / Return the digest value as a string of hexadecimal digits. [clinic start generated code]*/ static PyObject * -_sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length) -/*[clinic end generated code: output=bf8e2f1e490944a8 input=64e56b4760db4573]*/ +_sha3_shake_128_hexdigest(SHA3object *self, PyObject *length) +/*[clinic end generated code: output=4752f90e53c8bf2a input=a82694ea83865f5a]*/ { return _SHAKE_digest(self, length, 1); } @@ -679,12 +689,12 @@ static PyMethodDef SHAKE_methods[] = { }; PyDoc_STRVAR(shake_128__doc__, -"shake_128([string]) -> SHAKE object\n\ +"shake_128([data]) -> SHAKE object\n\ \n\ Return a new SHAKE hash object."); PyDoc_STRVAR(shake_256__doc__, -"shake_256([string]) -> SHAKE object\n\ +"shake_256([data]) -> SHAKE object\n\ \n\ Return a new SHAKE hash object."); From webhook-mailer at python.org Thu Oct 11 01:05:39 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 11 Oct 2018 05:05:39 -0000 Subject: [Python-checkins] Fix a possible decref of a borrowed reference in symtable.c. (GH-9786) Message-ID: https://github.com/python/cpython/commit/fc439d20de32b0ebccca79a96e31f83b85ec4eaf commit: fc439d20de32b0ebccca79a96e31f83b85ec4eaf branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-11T08:05:35+03:00 summary: Fix a possible decref of a borrowed reference in symtable.c. (GH-9786) files: M Python/symtable.c diff --git a/Python/symtable.c b/Python/symtable.c index 16b706b36338..d74f26fbe35a 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -625,8 +625,10 @@ update_symbols(PyObject *symbols, PyObject *scopes, return 0; itr = PyObject_GetIter(free); - if (!itr) - goto error; + if (itr == NULL) { + Py_DECREF(v_free); + return 0; + } while ((name = PyIter_Next(itr))) { v = PyDict_GetItem(symbols, name); From webhook-mailer at python.org Thu Oct 11 01:06:39 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 11 Oct 2018 05:06:39 -0000 Subject: [Python-checkins] [3.7] bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) (GH-9798) Message-ID: https://github.com/python/cpython/commit/8b040e55395b37bdb8fd4ec85a270cfc9ec95307 commit: 8b040e55395b37bdb8fd4ec85a270cfc9ec95307 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-11T08:06:36+03:00 summary: [3.7] bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) (GH-9798) for the SHAKE algorithm in the hashlib module. (cherry picked from commit 9b8c2e767643256202bb11456ba8665593b9a500) files: A Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst M Lib/test/test_hashlib.py M Modules/_sha3/sha3module.c diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 5b7f4082ae04..fc0649d670d2 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -230,6 +230,20 @@ def test_hexdigest(self): self.assertIsInstance(h.digest(), bytes) self.assertEqual(hexstr(h.digest()), h.hexdigest()) + def test_digest_length_overflow(self): + # See issue #34922 + large_sizes = (2**29, 2**32-10, 2**32+10, 2**61, 2**64-10, 2**64+10) + for cons in self.hash_constructors: + h = cons() + if h.name not in self.shakes: + continue + for digest in h.digest, h.hexdigest: + with self.assertRaises((ValueError, OverflowError)): + digest(-10) + for length in large_sizes: + with self.assertRaises((ValueError, OverflowError)): + digest(length) + def test_name_attribute(self): for cons in self.hash_constructors: h = cons() diff --git a/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst b/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst new file mode 100644 index 000000000000..646388688399 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst @@ -0,0 +1,3 @@ +Fixed integer overflow in the :meth:`~hashlib.shake.digest()` and +:meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm +in the :mod:`hashlib` module. diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index d879e9243c6e..9b07cf0bfdb6 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -594,7 +594,10 @@ _SHAKE_digest(SHA3object *self, PyObject *digestlen_obj, int hex) if (digestlen == (unsigned long) -1 && PyErr_Occurred()) { return NULL; } - + if (digestlen >= (1 << 29)) { + PyErr_SetString(PyExc_ValueError, "length is too large"); + return NULL; + } /* ExtractLane needs at least SHA3_MAX_DIGESTSIZE + SHA3_LANESIZE and * SHA3_LANESIZE extra space. */ From webhook-mailer at python.org Thu Oct 11 01:24:20 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 11 Oct 2018 05:24:20 -0000 Subject: [Python-checkins] Fix a possible decref of a borrowed reference in symtable.c. (GH-9786) Message-ID: https://github.com/python/cpython/commit/1c2cb516e49ceb56f76e90645e67e8df4e5df01a commit: 1c2cb516e49ceb56f76e90645e67e8df4e5df01a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-10T22:24:14-07:00 summary: Fix a possible decref of a borrowed reference in symtable.c. (GH-9786) (cherry picked from commit fc439d20de32b0ebccca79a96e31f83b85ec4eaf) Co-authored-by: Zackery Spytz files: M Python/symtable.c diff --git a/Python/symtable.c b/Python/symtable.c index 1c328a996140..81eea95f4907 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -625,8 +625,10 @@ update_symbols(PyObject *symbols, PyObject *scopes, return 0; itr = PyObject_GetIter(free); - if (!itr) - goto error; + if (itr == NULL) { + Py_DECREF(v_free); + return 0; + } while ((name = PyIter_Next(itr))) { v = PyDict_GetItem(symbols, name); From webhook-mailer at python.org Thu Oct 11 01:28:12 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 11 Oct 2018 05:28:12 -0000 Subject: [Python-checkins] Fix a possible decref of a borrowed reference in symtable.c. (GH-9786) Message-ID: https://github.com/python/cpython/commit/1a23abed1340c44e0296d9963487443f63aea225 commit: 1a23abed1340c44e0296d9963487443f63aea225 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-10T22:28:08-07:00 summary: Fix a possible decref of a borrowed reference in symtable.c. (GH-9786) (cherry picked from commit fc439d20de32b0ebccca79a96e31f83b85ec4eaf) Co-authored-by: Zackery Spytz files: M Python/symtable.c diff --git a/Python/symtable.c b/Python/symtable.c index 6165cfe162ea..90b07efa0334 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -628,8 +628,10 @@ update_symbols(PyObject *symbols, PyObject *scopes, return 0; itr = PyObject_GetIter(free); - if (!itr) - goto error; + if (itr == NULL) { + Py_DECREF(v_free); + return 0; + } while ((name = PyIter_Next(itr))) { v = PyDict_GetItem(symbols, name); From webhook-mailer at python.org Thu Oct 11 01:37:41 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 11 Oct 2018 05:37:41 -0000 Subject: [Python-checkins] [3.6] bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) (GH-9798) (GH-9801) Message-ID: https://github.com/python/cpython/commit/69e6ad6cdfa28a7b8e7b8780b07dfcdbfb0e7030 commit: 69e6ad6cdfa28a7b8e7b8780b07dfcdbfb0e7030 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Serhiy Storchaka date: 2018-10-11T08:37:37+03:00 summary: [3.6] bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751) (GH-9798) (GH-9801) for the SHAKE algorithm in the hashlib module. (cherry picked from commit 9b8c2e767643256202bb11456ba8665593b9a500) (cherry picked from commit 8b040e55395b37bdb8fd4ec85a270cfc9ec95307) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst M Lib/test/test_hashlib.py M Modules/_sha3/sha3module.c diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 995fe60a076c..9711856853de 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -233,6 +233,20 @@ def test_hexdigest(self): self.assertIsInstance(h.digest(), bytes) self.assertEqual(hexstr(h.digest()), h.hexdigest()) + def test_digest_length_overflow(self): + # See issue #34922 + large_sizes = (2**29, 2**32-10, 2**32+10, 2**61, 2**64-10, 2**64+10) + for cons in self.hash_constructors: + h = cons() + if h.name not in self.shakes: + continue + for digest in h.digest, h.hexdigest: + with self.assertRaises((ValueError, OverflowError)): + digest(-10) + for length in large_sizes: + with self.assertRaises((ValueError, OverflowError)): + digest(length) + def test_name_attribute(self): for cons in self.hash_constructors: h = cons() diff --git a/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst b/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst new file mode 100644 index 000000000000..646388688399 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-07-21-18-52.bpo-34922.37IdsA.rst @@ -0,0 +1,3 @@ +Fixed integer overflow in the :meth:`~hashlib.shake.digest()` and +:meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm +in the :mod:`hashlib` module. diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index 8d880d0e7026..2c2b2dbc5c7d 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -609,7 +609,10 @@ _SHAKE_digest(SHA3object *self, PyObject *digestlen_obj, int hex) if (digestlen == (unsigned long) -1 && PyErr_Occurred()) { return NULL; } - + if (digestlen >= (1 << 29)) { + PyErr_SetString(PyExc_ValueError, "length is too large"); + return NULL; + } /* ExtractLane needs at least SHA3_MAX_DIGESTSIZE + SHA3_LANESIZE and * SHA3_LANESIZE extra space. */ From webhook-mailer at python.org Fri Oct 12 01:54:08 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 12 Oct 2018 05:54:08 -0000 Subject: [Python-checkins] Fix an incorrect check in compiler_try_except(). (GH-9810) Message-ID: https://github.com/python/cpython/commit/53ebf4b0709f431b7262aa5daccef7eafde7383e commit: 53ebf4b0709f431b7262aa5daccef7eafde7383e branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-12T08:54:03+03:00 summary: Fix an incorrect check in compiler_try_except(). (GH-9810) files: M Python/compile.c diff --git a/Python/compile.c b/Python/compile.c index 096b762f36bb..78b7baf3235f 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2738,8 +2738,9 @@ compiler_try_except(struct compiler *c, stmt_ty s) cleanup_end = compiler_new_block(c); cleanup_body = compiler_new_block(c); - if (!(cleanup_end || cleanup_body)) + if (cleanup_end == NULL || cleanup_body == NULL) { return 0; + } compiler_nameop(c, handler->v.ExceptHandler.name, Store); ADDOP(c, POP_TOP); From webhook-mailer at python.org Fri Oct 12 03:19:24 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 07:19:24 -0000 Subject: [Python-checkins] Fix an incorrect check in compiler_try_except(). (GH-9810) Message-ID: https://github.com/python/cpython/commit/72927d0d1787809b4b25e5086c5a9167bdb807bb commit: 72927d0d1787809b4b25e5086c5a9167bdb807bb branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T00:19:20-07:00 summary: Fix an incorrect check in compiler_try_except(). (GH-9810) (cherry picked from commit 53ebf4b0709f431b7262aa5daccef7eafde7383e) Co-authored-by: Zackery Spytz files: M Python/compile.c diff --git a/Python/compile.c b/Python/compile.c index b459096c6f00..3564ca2b904f 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2670,8 +2670,9 @@ compiler_try_except(struct compiler *c, stmt_ty s) cleanup_end = compiler_new_block(c); cleanup_body = compiler_new_block(c); - if (!(cleanup_end || cleanup_body)) + if (cleanup_end == NULL || cleanup_body == NULL) { return 0; + } compiler_nameop(c, handler->v.ExceptHandler.name, Store); ADDOP(c, POP_TOP); From webhook-mailer at python.org Fri Oct 12 03:19:42 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 07:19:42 -0000 Subject: [Python-checkins] Fix an incorrect check in compiler_try_except(). (GH-9810) Message-ID: https://github.com/python/cpython/commit/f39defe11a4ed688489c7827a8b69752af29391a commit: f39defe11a4ed688489c7827a8b69752af29391a branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T00:19:38-07:00 summary: Fix an incorrect check in compiler_try_except(). (GH-9810) (cherry picked from commit 53ebf4b0709f431b7262aa5daccef7eafde7383e) Co-authored-by: Zackery Spytz files: M Python/compile.c diff --git a/Python/compile.c b/Python/compile.c index c1df7e8d9824..fac1c5bfdca3 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2492,8 +2492,9 @@ compiler_try_except(struct compiler *c, stmt_ty s) cleanup_end = compiler_new_block(c); cleanup_body = compiler_new_block(c); - if (!(cleanup_end || cleanup_body)) + if (cleanup_end == NULL || cleanup_body == NULL) { return 0; + } compiler_nameop(c, handler->v.ExceptHandler.name, Store); ADDOP(c, POP_TOP); From webhook-mailer at python.org Fri Oct 12 03:51:15 2018 From: webhook-mailer at python.org (Julien Palard) Date: Fri, 12 Oct 2018 07:51:15 -0000 Subject: [Python-checkins] bpo-34962: make doctest in Doc/ now passes, and is enforced in CI (GH-9806) Message-ID: https://github.com/python/cpython/commit/859c068e52a31e13e2b9bb6a3f861fa8c290cb0e commit: 859c068e52a31e13e2b9bb6a3f861fa8c290cb0e branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-12T09:51:05+02:00 summary: bpo-34962: make doctest in Doc/ now passes, and is enforced in CI (GH-9806) files: A Misc/NEWS.d/next/Tests/2018-10-11-22-34-27.bpo-34962.0PLBi8.rst M .travis.yml M Doc/conf.py M Doc/distutils/examples.rst M Doc/library/multiprocessing.rst M Doc/library/re.rst M Doc/library/turtle.rst M Doc/library/unittest.mock-examples.rst M Doc/library/unittest.mock.rst diff --git a/.travis.yml b/.travis.yml index d1a6da70e508..19be17e2f25e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,8 +53,8 @@ matrix: - cd Doc # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures. # (Updating the version is fine as long as no warnings are raised by doing so.) - # The theme used by the docs is stored seperately, so we need to install that as well. - - python -m pip install sphinx~=1.6.1 blurb python-docs-theme + # The theme used by the docs is stored separately, so we need to install that as well. + - python -m pip install sphinx blurb python-docs-theme script: - make check suspicious html SPHINXOPTS="-q -W -j4" - os: osx @@ -155,8 +155,14 @@ script: # Check that all symbols exported by libpython start with "Py" or "_Py" - make smelly # `-r -w` implicitly provided through `make buildbottest`. - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then XVFB_RUN=xvfb-run; fi; $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu" - + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + XVFB_RUN=xvfb-run; + fi + $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu" + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + $XVFB_RUN make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest + fi notifications: email: false webhooks: diff --git a/Doc/conf.py b/Doc/conf.py index 7f720ce3832d..6060ac176c95 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -16,6 +16,13 @@ extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest', 'pyspecific', 'c_annotations', 'escape4chm'] + +doctest_global_setup = ''' +try: + import _tkinter +except ImportError: + _tkinter = None +''' # General substitutions. project = 'Python' copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y') diff --git a/Doc/distutils/examples.rst b/Doc/distutils/examples.rst index 4e2761d8a7d0..f81e06b5e605 100644 --- a/Doc/distutils/examples.rst +++ b/Doc/distutils/examples.rst @@ -1,4 +1,4 @@ -.. _examples: +.. _distutils_examples: ******** Examples diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index a7d26f9b4554..8402370d98f6 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -621,18 +621,19 @@ The :mod:`multiprocessing` package mostly replicates the API of the Example usage of some of the methods of :class:`Process`: .. doctest:: + :options: +ELLIPSIS >>> import multiprocessing, time, signal >>> p = multiprocessing.Process(target=time.sleep, args=(1000,)) >>> print(p, p.is_alive()) - False + False >>> p.start() >>> print(p, p.is_alive()) - True + True >>> p.terminate() >>> time.sleep(0.1) >>> print(p, p.is_alive()) - False + False >>> p.exitcode == -signal.SIGTERM True diff --git a/Doc/library/re.rst b/Doc/library/re.rst index e90840d9acc1..67f85705169b 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1234,9 +1234,7 @@ Checking for a Pair ^^^^^^^^^^^^^^^^^^^ In this example, we'll use the following helper function to display match -objects a little more gracefully: - -.. testcode:: +objects a little more gracefully:: def displaymatch(match): if match is None: @@ -1269,10 +1267,9 @@ To match this with a regular expression, one could use backreferences as such:: "" To find out what card the pair consists of, one could use the -:meth:`~Match.group` method of the match object in the following manner: - -.. doctest:: +:meth:`~Match.group` method of the match object in the following manner:: + >>> pair = re.compile(r".*(.).*\1") >>> pair.match("717ak").group(1) '7' @@ -1377,7 +1374,9 @@ easily read and modified by Python as demonstrated in the following example that creates a phonebook. First, here is the input. Normally it may come from a file, here we are using -triple-quoted string syntax:: +triple-quoted string syntax + +.. doctest:: >>> text = """Ross McFluff: 834.345.1254 155 Elm Street ... diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 595a244342c4..83903648b427 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -250,6 +250,7 @@ Turtle motion turtle is headed. .. doctest:: + :skipif: _tkinter is None >>> turtle.position() (0.00,0.00) @@ -276,6 +277,7 @@ Turtle motion >>> turtle.goto(0, 0) .. doctest:: + :skipif: _tkinter is None >>> turtle.position() (0.00,0.00) @@ -294,11 +296,13 @@ Turtle motion orientation depends on the turtle mode, see :func:`mode`. .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.setheading(22) .. doctest:: + :skipif: _tkinter is None >>> turtle.heading() 22.0 @@ -317,11 +321,13 @@ Turtle motion orientation depends on the turtle mode, see :func:`mode`. .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.setheading(22) .. doctest:: + :skipif: _tkinter is None >>> turtle.heading() 22.0 @@ -344,11 +350,13 @@ Turtle motion not change the turtle's orientation. .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.goto(0, 0) .. doctest:: + :skipif: _tkinter is None >>> tp = turtle.pos() >>> tp @@ -372,11 +380,13 @@ Turtle motion unchanged. .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.goto(0, 240) .. doctest:: + :skipif: _tkinter is None >>> turtle.position() (0.00,240.00) @@ -392,11 +402,13 @@ Turtle motion Set the turtle's second coordinate to *y*, leave first coordinate unchanged. .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.goto(0, 40) .. doctest:: + :skipif: _tkinter is None >>> turtle.position() (0.00,40.00) @@ -423,6 +435,7 @@ Turtle motion =================== ==================== .. doctest:: + :skipif: _tkinter is None >>> turtle.setheading(90) >>> turtle.heading() @@ -435,12 +448,14 @@ Turtle motion its start-orientation (which depends on the mode, see :func:`mode`). .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.setheading(90) >>> turtle.goto(0, -10) .. doctest:: + :skipif: _tkinter is None >>> turtle.heading() 90.0 @@ -472,6 +487,7 @@ Turtle motion calculated automatically. May be used to draw regular polygons. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.position() @@ -500,6 +516,7 @@ Turtle motion .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.dot() @@ -517,6 +534,7 @@ Turtle motion it by calling ``clearstamp(stamp_id)``. .. doctest:: + :skipif: _tkinter is None >>> turtle.color("blue") >>> turtle.stamp() @@ -532,6 +550,7 @@ Turtle motion Delete stamp with given *stampid*. .. doctest:: + :skipif: _tkinter is None >>> turtle.position() (150.00,-0.00) @@ -576,6 +595,7 @@ Turtle motion undo actions is determined by the size of the undobuffer. .. doctest:: + :skipif: _tkinter is None >>> for i in range(4): ... turtle.fd(50); turtle.lt(80) @@ -608,6 +628,7 @@ Turtle motion turtle turn instantly. .. doctest:: + :skipif: _tkinter is None >>> turtle.speed() 3 @@ -628,6 +649,7 @@ Tell Turtle's state Return the turtle's current location (x,y) (as a :class:`Vec2D` vector). .. doctest:: + :skipif: _tkinter is None >>> turtle.pos() (440.00,-0.00) @@ -643,6 +665,7 @@ Tell Turtle's state orientation which depends on the mode - "standard"/"world" or "logo"). .. doctest:: + :skipif: _tkinter is None >>> turtle.goto(10, 10) >>> turtle.towards(0,0) @@ -654,6 +677,7 @@ Tell Turtle's state Return the turtle's x coordinate. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.left(50) @@ -669,6 +693,7 @@ Tell Turtle's state Return the turtle's y coordinate. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.left(60) @@ -685,6 +710,7 @@ Tell Turtle's state :func:`mode`). .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.left(67) @@ -701,6 +727,7 @@ Tell Turtle's state other turtle, in turtle step units. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.distance(30,40) @@ -724,6 +751,7 @@ Settings for measurement Default value is 360 degrees. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.left(90) @@ -746,6 +774,7 @@ Settings for measurement ``degrees(2*math.pi)``. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.left(90) @@ -756,6 +785,7 @@ Settings for measurement 1.5707963267948966 .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.degrees(360) @@ -791,6 +821,7 @@ Drawing state thickness. If no argument is given, the current pensize is returned. .. doctest:: + :skipif: _tkinter is None >>> turtle.pensize() 1 @@ -822,6 +853,7 @@ Drawing state attributes in one statement. .. doctest:: + :skipif: _tkinter is None :options: +NORMALIZE_WHITESPACE >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) @@ -844,6 +876,7 @@ Drawing state Return ``True`` if pen is down, ``False`` if it's up. .. doctest:: + :skipif: _tkinter is None >>> turtle.penup() >>> turtle.isdown() @@ -884,6 +917,7 @@ Color control newly set pencolor. .. doctest:: + :skipif: _tkinter is None >>> colormode() 1.0 @@ -932,6 +966,7 @@ Color control with the newly set fillcolor. .. doctest:: + :skipif: _tkinter is None >>> turtle.fillcolor("violet") >>> turtle.fillcolor() @@ -970,6 +1005,7 @@ Color control with the newly set colors. .. doctest:: + :skipif: _tkinter is None >>> turtle.color("red", "green") >>> turtle.color() @@ -986,6 +1022,7 @@ Filling ~~~~~~~ .. doctest:: + :skipif: _tkinter is None :hide: >>> turtle.home() @@ -995,6 +1032,7 @@ Filling Return fillstate (``True`` if filling, ``False`` else). .. doctest:: + :skipif: _tkinter is None >>> turtle.begin_fill() >>> if turtle.filling(): @@ -1014,6 +1052,7 @@ Filling Fill the shape drawn after the last call to :func:`begin_fill`. .. doctest:: + :skipif: _tkinter is None >>> turtle.color("black", "red") >>> turtle.begin_fill() @@ -1030,6 +1069,7 @@ More drawing control variables to the default values. .. doctest:: + :skipif: _tkinter is None >>> turtle.goto(0,-22) >>> turtle.left(100) @@ -1080,6 +1120,7 @@ Visibility drawing observably. .. doctest:: + :skipif: _tkinter is None >>> turtle.hideturtle() @@ -1090,6 +1131,7 @@ Visibility Make the turtle visible. .. doctest:: + :skipif: _tkinter is None >>> turtle.showturtle() @@ -1120,6 +1162,7 @@ Appearance deal with shapes see Screen method :func:`register_shape`. .. doctest:: + :skipif: _tkinter is None >>> turtle.shape() 'classic' @@ -1145,6 +1188,7 @@ Appearance resizemode("user") is called by :func:`shapesize` when used with arguments. .. doctest:: + :skipif: _tkinter is None >>> turtle.resizemode() 'noresize' @@ -1168,6 +1212,7 @@ Appearance of the shapes's outline. .. doctest:: + :skipif: _tkinter is None >>> turtle.shapesize() (1.0, 1.0, 1) @@ -1192,6 +1237,7 @@ Appearance heading of the turtle are sheared. .. doctest:: + :skipif: _tkinter is None >>> turtle.shape("circle") >>> turtle.shapesize(5,2) @@ -1208,6 +1254,7 @@ Appearance change the turtle's heading (direction of movement). .. doctest:: + :skipif: _tkinter is None >>> turtle.reset() >>> turtle.shape("circle") @@ -1227,6 +1274,7 @@ Appearance (direction of movement). .. doctest:: + :skipif: _tkinter is None >>> turtle.reset() >>> turtle.shape("circle") @@ -1252,6 +1300,7 @@ Appearance turtle (its direction of movement). .. doctest:: + :skipif: _tkinter is None >>> turtle.reset() >>> turtle.shape("circle") @@ -1280,6 +1329,7 @@ Appearance given matrix. .. doctest:: + :skipif: _tkinter is None >>> turtle = Turtle() >>> turtle.shape("square") @@ -1295,6 +1345,7 @@ Appearance can be used to define a new shape or components of a compound shape. .. doctest:: + :skipif: _tkinter is None >>> turtle.shape("square") >>> turtle.shapetransform(4, -1, 0, 2) @@ -1318,6 +1369,7 @@ Using events procedural way: .. doctest:: + :skipif: _tkinter is None >>> def turn(x, y): ... left(180) @@ -1338,6 +1390,7 @@ Using events ``None``, existing bindings are removed. .. doctest:: + :skipif: _tkinter is None >>> class MyTurtle(Turtle): ... def glow(self,x,y): @@ -1365,6 +1418,7 @@ Using events mouse-click event on that turtle. .. doctest:: + :skipif: _tkinter is None >>> turtle.ondrag(turtle.goto) @@ -1392,6 +1446,7 @@ Special Turtle methods Return the last recorded polygon. .. doctest:: + :skipif: _tkinter is None >>> turtle.home() >>> turtle.begin_poly() @@ -1411,6 +1466,7 @@ Special Turtle methods turtle properties. .. doctest:: + :skipif: _tkinter is None >>> mick = Turtle() >>> joe = mick.clone() @@ -1423,6 +1479,7 @@ Special Turtle methods return the "anonymous turtle": .. doctest:: + :skipif: _tkinter is None >>> pet = getturtle() >>> pet.fd(50) @@ -1436,6 +1493,7 @@ Special Turtle methods TurtleScreen methods can then be called for that object. .. doctest:: + :skipif: _tkinter is None >>> ts = turtle.getscreen() >>> ts @@ -1453,6 +1511,7 @@ Special Turtle methods ``None``, the undobuffer is disabled. .. doctest:: + :skipif: _tkinter is None >>> turtle.setundobuffer(42) @@ -1462,6 +1521,7 @@ Special Turtle methods Return number of entries in the undobuffer. .. doctest:: + :skipif: _tkinter is None >>> while undobufferentries(): ... undo() @@ -1484,6 +1544,7 @@ below: For example: .. doctest:: + :skipif: _tkinter is None >>> s = Shape("compound") >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) @@ -1494,6 +1555,7 @@ below: 3. Now add the Shape to the Screen's shapelist and use it: .. doctest:: + :skipif: _tkinter is None >>> register_shape("myshape", s) >>> shape("myshape") @@ -1513,6 +1575,7 @@ Most of the examples in this section refer to a TurtleScreen instance called ``screen``. .. doctest:: + :skipif: _tkinter is None :hide: >>> screen = Screen() @@ -1529,6 +1592,7 @@ Window control Set or return background color of the TurtleScreen. .. doctest:: + :skipif: _tkinter is None >>> screen.bgcolor("orange") >>> screen.bgcolor() @@ -1614,6 +1678,7 @@ Window control distorted. .. doctest:: + :skipif: _tkinter is None >>> screen.reset() >>> screen.setworldcoordinates(-50,-7.5,50,7.5) @@ -1624,6 +1689,7 @@ Window control ... left(45); fd(2) # a regular octagon .. doctest:: + :skipif: _tkinter is None :hide: >>> screen.reset() @@ -1645,6 +1711,7 @@ Animation control Optional argument: .. doctest:: + :skipif: _tkinter is None >>> screen.delay() 10 @@ -1666,6 +1733,7 @@ Animation control :func:`delay`). .. doctest:: + :skipif: _tkinter is None >>> screen.tracer(8, 25) >>> dist = 2 @@ -1702,6 +1770,7 @@ Using screen events must have the focus. (See method :func:`listen`.) .. doctest:: + :skipif: _tkinter is None >>> def f(): ... fd(50) @@ -1722,6 +1791,7 @@ Using screen events must have focus. (See method :func:`listen`.) .. doctest:: + :skipif: _tkinter is None >>> def f(): ... fd(50) @@ -1746,6 +1816,7 @@ Using screen events named turtle: .. doctest:: + :skipif: _tkinter is None >>> screen.onclick(turtle.goto) # Subsequently clicking into the TurtleScreen will >>> # make the turtle move to the clicked point. @@ -1765,6 +1836,7 @@ Using screen events Install a timer that calls *fun* after *t* milliseconds. .. doctest:: + :skipif: _tkinter is None >>> running = True >>> def f(): @@ -1846,6 +1918,7 @@ Settings and special methods ============ ========================= =================== .. doctest:: + :skipif: _tkinter is None >>> mode("logo") # resets turtle heading to north >>> mode() @@ -1860,6 +1933,7 @@ Settings and special methods values of color triples have to be in the range 0..\ *cmode*. .. doctest:: + :skipif: _tkinter is None >>> screen.colormode(1) >>> turtle.pencolor(240, 160, 80) @@ -1880,6 +1954,7 @@ Settings and special methods do with a Tkinter Canvas. .. doctest:: + :skipif: _tkinter is None >>> cv = screen.getcanvas() >>> cv @@ -1891,6 +1966,7 @@ Settings and special methods Return a list of names of all currently available turtle shapes. .. doctest:: + :skipif: _tkinter is None >>> screen.getshapes() ['arrow', 'blank', 'circle', ..., 'turtle'] @@ -1914,6 +1990,7 @@ Settings and special methods coordinates: Install the corresponding polygon shape. .. doctest:: + :skipif: _tkinter is None >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) @@ -1929,6 +2006,7 @@ Settings and special methods Return the list of turtles on the screen. .. doctest:: + :skipif: _tkinter is None >>> for turtle in screen.turtles(): ... turtle.color("red") @@ -1990,6 +2068,7 @@ Methods specific to Screen, not inherited from TurtleScreen center window vertically .. doctest:: + :skipif: _tkinter is None >>> screen.setup (width=200, height=200, startx=0, starty=0) >>> # sets window to 200x200 pixels, in upper left of screen @@ -2005,6 +2084,7 @@ Methods specific to Screen, not inherited from TurtleScreen Set title of turtle window to *titlestring*. .. doctest:: + :skipif: _tkinter is None >>> screen.title("Welcome to the turtle zoo!") @@ -2075,6 +2155,7 @@ Public classes Example: .. doctest:: + :skipif: _tkinter is None >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) >>> s = Shape("compound") @@ -2421,6 +2502,7 @@ Changes since Python 3.0 .. doctest:: + :skipif: _tkinter is None :hide: >>> for turtle in turtles(): diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index 65dee7c0eb2d..60db4c2ba4da 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -9,6 +9,19 @@ .. _getting-started: + +.. testsetup:: + + import unittest + from unittest.mock import Mock, MagicMock, patch, call, sentinel + + class SomeClass: + attribute = 'this is a doctest' + + @staticmethod + def static_method(): + pass + Using Mock ---------- @@ -99,7 +112,7 @@ by looking at the return value of the mocked class. In the example below we have a function ``some_function`` that instantiates ``Foo`` and calls a method on it. The call to :func:`patch` replaces the class ``Foo`` with a mock. The ``Foo`` instance is the result of calling the mock, so it is configured -by modifying the mock :attr:`~Mock.return_value`. +by modifying the mock :attr:`~Mock.return_value`. :: >>> def some_function(): ... instance = module.Foo() @@ -321,7 +334,7 @@ whatever) to be replaced with. 'patch.object' takes an object and the name of the attribute you would like patched, plus optionally the value to patch it with. -``patch.object``: +``patch.object``:: >>> original = SomeClass.attribute >>> @patch.object(SomeClass, 'attribute', sentinel.attribute) @@ -348,7 +361,7 @@ instead of :func:`patch.object`: >>> mock.assert_called_with('filename', 'r') >>> assert handle == sentinel.file_handle, "incorrect file handle returned" -The module name can be 'dotted', in the form ``package.module`` if needed: +The module name can be 'dotted', in the form ``package.module`` if needed:: >>> @patch('package.module.ClassName.attribute', sentinel.attribute) ... def test(): @@ -380,7 +393,7 @@ passed into the test function / method: ... >>> MyTest('test_something').test_something() -You can stack up multiple patch decorators using this pattern: +You can stack up multiple patch decorators using this pattern:: >>> class MyTest(unittest.TestCase): ... @patch('package.module.ClassName1') @@ -485,7 +498,7 @@ response object for it. To set the response as the return value for that final mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response We can do that in a slightly nicer way using the :meth:`~Mock.configure_mock` -method to directly set the return value for us: +method to directly set the return value for us:: >>> something = Something() >>> mock_response = Mock(spec=open) @@ -494,7 +507,7 @@ method to directly set the return value for us: >>> mock_backend.configure_mock(**config) With these we monkey patch the "mock backend" in place and can make the real -call: +call:: >>> something.backend = mock_backend >>> something.method() @@ -502,7 +515,7 @@ call: Using :attr:`~Mock.mock_calls` we can check the chained call with a single assert. A chained call is several calls in one line of code, so there will be several entries in ``mock_calls``. We can use :meth:`call.call_list` to create -this list of calls for us: +this list of calls for us:: >>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() >>> call_list = chained.call_list() @@ -525,7 +538,7 @@ The :func:`patch decorator ` is used here to mock out the ``date`` class in the module under test. The :attr:`side_effect` attribute on the mock date class is then set to a lambda function that returns a real date. When the mock date class is called a real date will be -constructed and returned by ``side_effect``. +constructed and returned by ``side_effect``. :: >>> from datetime import date >>> with patch('mymodule.date') as mock_date: @@ -534,7 +547,6 @@ constructed and returned by ``side_effect``. ... ... assert mymodule.date.today() == date(2010, 10, 8) ... assert mymodule.date(2009, 6, 8) == date(2009, 6, 8) - ... Note that we don't patch :class:`datetime.date` globally, we patch ``date`` in the module that *uses* it. See :ref:`where to patch `. @@ -600,10 +612,10 @@ is to apply the patch decorators to every method. This can feel like unnecessary repetition. For Python 2.6 or more recent you can use :func:`patch` (in all its various forms) as a class decorator. This applies the patches to all test methods on the class. A test method is identified by methods whose names start -with ``test``: +with ``test``:: >>> @patch('mymodule.SomeClass') - ... class MyTest(TestCase): + ... class MyTest(unittest.TestCase): ... ... def test_one(self, MockSomeClass): ... self.assertIs(mymodule.SomeClass, MockSomeClass) @@ -621,8 +633,9 @@ with ``test``: An alternative way of managing patches is to use the :ref:`start-and-stop`. These allow you to move the patching into your ``setUp`` and ``tearDown`` methods. +:: - >>> class MyTest(TestCase): + >>> class MyTest(unittest.TestCase): ... def setUp(self): ... self.patcher = patch('mymodule.foo') ... self.mock_foo = self.patcher.start() @@ -638,9 +651,9 @@ These allow you to move the patching into your ``setUp`` and ``tearDown`` method If you use this technique you must ensure that the patching is "undone" by calling ``stop``. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. -:meth:`unittest.TestCase.addCleanup` makes this easier: +:meth:`unittest.TestCase.addCleanup` makes this easier:: - >>> class MyTest(TestCase): + >>> class MyTest(unittest.TestCase): ... def setUp(self): ... patcher = patch('mymodule.foo') ... self.addCleanup(patcher.stop) @@ -753,7 +766,7 @@ defined in 'mymodule':: val.clear() When we try to test that ``grob`` calls ``frob`` with the correct argument look -what happens: +what happens:: >>> with patch('mymodule.frob') as mock_frob: ... val = {6} @@ -777,7 +790,7 @@ functionality. If you provide a ``side_effect`` function for a mock then opportunity to copy the arguments and store them for later assertions. In this example I'm using *another* mock to store the arguments so that I can use the mock methods for doing the assertion. Again a helper function sets this up for -me. +me. :: >>> from copy import deepcopy >>> from unittest.mock import Mock, patch, DEFAULT @@ -854,9 +867,9 @@ Nesting Patches Using patch as a context manager is nice, but if you do multiple patches you can end up with nested with statements indenting further and further to the -right: +right:: - >>> class MyTest(TestCase): + >>> class MyTest(unittest.TestCase): ... ... def test_foo(self): ... with patch('mymodule.Foo') as mock_foo: @@ -873,9 +886,9 @@ right: With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can achieve the same effect without the nested indentation. A simple helper method, ``create_patch``, puts the patch in place and returns the created mock -for us: +for us:: - >>> class MyTest(TestCase): + >>> class MyTest(unittest.TestCase): ... ... def create_patch(self, name): ... patcher = patch(name) @@ -969,7 +982,7 @@ mock methods and attributes: >>> mock.__setitem__.call_args_list [call('b', 'fish'), call('d', 'eggs')] >>> my_dict - {'a': 1, 'c': 3, 'b': 'fish', 'd': 'eggs'} + {'a': 1, 'b': 'fish', 'c': 3, 'd': 'eggs'} Mock subclasses and their attributes @@ -1064,6 +1077,7 @@ previously will be restored safely. Here's an example that mocks out the 'fooble' module. + >>> import sys >>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... import fooble @@ -1132,7 +1146,7 @@ the ``mock_calls`` attribute on the manager mock: If ``patch`` is creating, and putting in place, your mocks then you can attach them to a manager mock using the :meth:`~Mock.attach_mock` method. After -attaching calls will be recorded in ``mock_calls`` of the manager. +attaching calls will be recorded in ``mock_calls`` of the manager. :: >>> manager = MagicMock() >>> with patch('mymodule.Class1') as MockClass1: @@ -1141,14 +1155,13 @@ attaching calls will be recorded in ``mock_calls`` of the manager. ... manager.attach_mock(MockClass2, 'MockClass2') ... MockClass1().foo() ... MockClass2().bar() - ... >>> manager.mock_calls [call.MockClass1(), - call.MockClass1().foo(), - call.MockClass2(), - call.MockClass2().bar()] + call.MockClass1().foo(), + call.MockClass2(), + call.MockClass2().bar()] If many calls have been made, but you're only interested in a particular sequence of them then an alternative is to use the diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 06009e4a0971..edafca0c674e 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -41,6 +41,22 @@ available as `mock on PyPI `_. Quick Guide ----------- +.. testsetup:: + + class ProductionClass: + def method(self, a, b, c): + pass + + class SomeClass: + @staticmethod + def static_method(args): + return args + + @classmethod + def class_method(cls, args): + return args + + :class:`Mock` and :class:`MagicMock` objects create all attributes and methods as you access them and store details of how they have been used. You can configure them, to specify return values or limit what attributes are @@ -80,7 +96,7 @@ that don't exist on the spec will fail with an :exc:`AttributeError`. The :func:`patch` decorator / context manager makes it easy to mock classes or objects in a module under test. The object you specify will be replaced with a -mock (or other object) during the test and restored when the test ends: +mock (or other object) during the test and restored when the test ends:: >>> from unittest.mock import patch >>> @patch('module.ClassName2') @@ -183,6 +199,12 @@ the ``__call__`` method. The Mock Class -------------- +.. testsetup:: + + import unittest + from unittest.mock import sentinel, DEFAULT, ANY + from unittest.mock import patch, call, Mock, MagicMock, PropertyMock + from unittest.mock import mock_open :class:`Mock` is a flexible mock object intended to replace the use of stubs and test doubles throughout your code. Mocks are callable and create attributes as @@ -774,7 +796,7 @@ apply to method calls on the mock object. so you can specify a return value when it is fetched. Fetching a :class:`PropertyMock` instance from an object calls the mock, with - no args. Setting it calls the mock with the value being set. + no args. Setting it calls the mock with the value being set. :: >>> class Foo: ... @property @@ -1001,7 +1023,7 @@ the "parenting" if for some reason you don't want it to happen. Mocks created for you by :func:`patch` are automatically given names. To attach mocks that have names to a parent you use the :meth:`~Mock.attach_mock` -method: +method:: >>> thing1 = object() >>> thing2 = object() @@ -1117,7 +1139,7 @@ patch available for alternate use-cases. :func:`patch` as function decorator, creating the mock for you and passing it into -the decorated function: +the decorated function:: >>> @patch('__main__.SomeClass') ... def function(normal_argument, mock_class): @@ -1135,7 +1157,7 @@ If the class is instantiated multiple times you could use can set the *return_value* to be anything you want. To configure return values on methods of *instances* on the patched class -you must do this on the :attr:`return_value`. For example: +you must do this on the :attr:`return_value`. For example:: >>> class Class: ... def method(self): @@ -1149,7 +1171,7 @@ you must do this on the :attr:`return_value`. For example: ... If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, then the -return value of the created mock will have the same spec. +return value of the created mock will have the same spec. :: >>> Original = Class >>> patcher = patch('__main__.Class', spec=True) @@ -1160,7 +1182,7 @@ return value of the created mock will have the same spec. The *new_callable* argument is useful where you want to use an alternative class to the default :class:`MagicMock` for the created mock. For example, if -you wanted a :class:`NonCallableMock` to be used: +you wanted a :class:`NonCallableMock` to be used:: >>> thing = object() >>> with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: @@ -1171,7 +1193,7 @@ you wanted a :class:`NonCallableMock` to be used: ... TypeError: 'NonCallableMock' object is not callable -Another use case might be to replace an object with an :class:`io.StringIO` instance: +Another use case might be to replace an object with an :class:`io.StringIO` instance:: >>> from io import StringIO >>> def foo(): @@ -1187,7 +1209,7 @@ Another use case might be to replace an object with an :class:`io.StringIO` inst When :func:`patch` is creating a mock for you, it is common that the first thing you need to do is to configure the mock. Some of that configuration can be done in the call to patch. Any arbitrary keywords you pass into the call will be -used to set attributes on the created mock: +used to set attributes on the created mock:: >>> patcher = patch('__main__.thing', first='one', second='two') >>> mock_thing = patcher.start() @@ -1200,7 +1222,7 @@ As well as attributes on the created mock attributes, like the :attr:`~Mock.return_value` and :attr:`~Mock.side_effect`, of child mocks can also be configured. These aren't syntactically valid to pass in directly as keyword arguments, but a dictionary with these as keys can still be expanded -into a :func:`patch` call using ``**``: +into a :func:`patch` call using ``**``:: >>> config = {'method.return_value': 3, 'other.side_effect': KeyError} >>> patcher = patch('__main__.thing', **config) @@ -1359,7 +1381,7 @@ patch.multiple If you want :func:`patch.multiple` to create mocks for you, then you can use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a decorator -then the created mocks are passed into the decorated function by keyword. +then the created mocks are passed into the decorated function by keyword. :: >>> thing = object() >>> other = object() @@ -1372,7 +1394,7 @@ then the created mocks are passed into the decorated function by keyword. >>> test_function() :func:`patch.multiple` can be nested with other ``patch`` decorators, but put arguments -passed by keyword *after* any of the standard arguments created by :func:`patch`: +passed by keyword *after* any of the standard arguments created by :func:`patch`:: >>> @patch('sys.exit') ... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) @@ -1384,7 +1406,7 @@ passed by keyword *after* any of the standard arguments created by :func:`patch` >>> test_function() If :func:`patch.multiple` is used as a context manager, the value returned by the -context manger is a dictionary where created mocks are keyed by name: +context manger is a dictionary where created mocks are keyed by name:: >>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: ... assert 'other' in repr(values['other']) @@ -1408,7 +1430,7 @@ normal and keep a reference to the returned ``patcher`` object. You can then call :meth:`start` to put the patch in place and :meth:`stop` to undo it. If you are using :func:`patch` to create a mock for you then it will be returned by -the call to ``patcher.start``. +the call to ``patcher.start``. :: >>> patcher = patch('package.module.ClassName') >>> from package import module @@ -1422,9 +1444,9 @@ the call to ``patcher.start``. A typical use case for this might be for doing multiple patches in the ``setUp`` -method of a :class:`TestCase`: +method of a :class:`TestCase`:: - >>> class MyTest(TestCase): + >>> class MyTest(unittest.TestCase): ... def setUp(self): ... self.patcher1 = patch('package.module.Class1') ... self.patcher2 = patch('package.module.Class2') @@ -1446,9 +1468,9 @@ method of a :class:`TestCase`: If you use this technique you must ensure that the patching is "undone" by calling ``stop``. This can be fiddlier than you might think, because if an exception is raised in the ``setUp`` then ``tearDown`` is not called. - :meth:`unittest.TestCase.addCleanup` makes this easier: + :meth:`unittest.TestCase.addCleanup` makes this easier:: - >>> class MyTest(TestCase): + >>> class MyTest(unittest.TestCase): ... def setUp(self): ... patcher = patch('package.module.Class') ... self.MockClass = patcher.start() @@ -1474,7 +1496,7 @@ It is also possible to stop all patches which have been started by using patch builtins ~~~~~~~~~~~~~~ You can patch any builtins within a module. The following example patches -builtin :func:`ord`: +builtin :func:`ord`:: >>> @patch('__main__.ord') ... def test(mock_ord): @@ -1494,7 +1516,7 @@ start with ``'test'`` as being test methods. This is the same way that the :class:`unittest.TestLoader` finds test methods by default. It is possible that you want to use a different prefix for your tests. You can -inform the patchers of the different prefix by setting ``patch.TEST_PREFIX``: +inform the patchers of the different prefix by setting ``patch.TEST_PREFIX``:: >>> patch.TEST_PREFIX = 'foo' >>> value = 3 @@ -1931,7 +1953,7 @@ arguments are a dictionary: >>> args (1, 2, 3) >>> kwargs - {'arg2': 'two', 'arg': 'one'} + {'arg': 'one', 'arg2': 'two'} >>> args is kall[0] True >>> kwargs is kall[1] @@ -1947,7 +1969,7 @@ arguments are a dictionary: >>> args (4, 5, 6) >>> kwargs - {'arg2': 'three', 'arg': 'two'} + {'arg': 'two', 'arg2': 'three'} >>> name is m.mock_calls[0][0] True @@ -2027,11 +2049,17 @@ If the mock was created with a *spec* (or *autospec* of course) then all the attributes from the original are shown, even if they haven't been accessed yet: +.. doctest:: + :options: +ELLIPSIS,+NORMALIZE_WHITESPACE + >>> dir(Mock()) ['assert_any_call', + 'assert_called', + 'assert_called_once', 'assert_called_once_with', 'assert_called_with', 'assert_has_calls', + 'assert_not_called', 'attach_mock', ... >>> from urllib import request @@ -2048,6 +2076,9 @@ filtered from the result of calling :func:`dir` on a :class:`Mock`. If you disli behaviour you can switch it off by setting the module level switch :data:`FILTER_DIR`: +.. doctest:: + :options: +ELLIPSIS,+NORMALIZE_WHITESPACE + >>> from unittest import mock >>> mock.FILTER_DIR = False >>> dir(mock.Mock()) @@ -2110,7 +2141,7 @@ The issue is that even if you mock out the call to :func:`open` it is the :meth:`__exit__` called). Mocking context managers with a :class:`MagicMock` is common enough and fiddly -enough that a helper function is useful. +enough that a helper function is useful. :: >>> m = mock_open() >>> with patch('__main__.open', m): @@ -2126,7 +2157,7 @@ enough that a helper function is useful. >>> handle = m() >>> handle.write.assert_called_once_with('some stuff') -And for reading files: +And for reading files:: >>> with patch('__main__.open', mock_open(read_data='bibble')) as m: ... with open('foo') as h: @@ -2219,7 +2250,7 @@ accessed) you can use it with very complex or deeply nested objects (like modules that import modules that import modules) without a big performance hit. -Here's an example of it in use: +Here's an example of it in use:: >>> from urllib import request >>> patcher = patch('__main__.request', autospec=True) @@ -2231,7 +2262,7 @@ Here's an example of it in use: You can see that :class:`request.Request` has a spec. :class:`request.Request` takes two arguments in the constructor (one of which is *self*). Here's what happens if -we try to call it incorrectly: +we try to call it incorrectly:: >>> req = request.Request() Traceback (most recent call last): @@ -2239,7 +2270,7 @@ we try to call it incorrectly: TypeError: () takes at least 2 arguments (1 given) The spec also applies to instantiated classes (i.e. the return value of -specced mocks): +specced mocks):: >>> req = request.Request('foo') >>> req @@ -2247,7 +2278,7 @@ specced mocks): :class:`Request` objects are not callable, so the return value of instantiating our mocked out :class:`request.Request` is a non-callable mock. With the spec in place -any typos in our asserts will raise the correct error: +any typos in our asserts will raise the correct error:: >>> req.add_header('spam', 'eggs') @@ -2281,7 +2312,7 @@ objects so that introspection is safe [#]_. A more serious problem is that it is common for instance attributes to be created in the :meth:`__init__` method and not to exist on the class at all. *autospec* can't know about any dynamically created attributes and restricts -the api to visible attributes. +the api to visible attributes. :: >>> class Something: ... def __init__(self): @@ -2299,7 +2330,7 @@ There are a few different ways of resolving this problem. The easiest, but not necessarily the least annoying, way is to simply set the required attributes on the mock after creation. Just because *autospec* doesn't allow you to fetch attributes that don't exist on the spec it doesn't prevent you -setting them: +setting them:: >>> with patch('__main__.Something', autospec=True): ... thing = Something() @@ -2350,7 +2381,7 @@ spec rather than the class. The other is to create a subclass of the production class and add the defaults to the subclass without affecting the production class. Both of these require you to use an alternative object as the spec. Thankfully :func:`patch` supports this - you can simply pass the -alternative object as the *autospec* argument: +alternative object as the *autospec* argument:: >>> class Something: ... def __init__(self): @@ -2372,6 +2403,11 @@ alternative object as the *autospec* argument: Sealing mocks ~~~~~~~~~~~~~ + +.. testsetup:: + + from unittest.mock import seal + .. function:: seal(mock) Seal will disable the creation of mock children by preventing getting or setting @@ -2379,7 +2415,7 @@ Sealing mocks If a mock instance is assigned to an attribute instead of being dynamically created it won't be considered in the sealing chain. This allows one to prevent seal from - fixing part of the mock object. + fixing part of the mock object. :: >>> mock = Mock() >>> mock.submock.attribute1 = 2 diff --git a/Misc/NEWS.d/next/Tests/2018-10-11-22-34-27.bpo-34962.0PLBi8.rst b/Misc/NEWS.d/next/Tests/2018-10-11-22-34-27.bpo-34962.0PLBi8.rst new file mode 100644 index 000000000000..0d0f6a1ff77e --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-10-11-22-34-27.bpo-34962.0PLBi8.rst @@ -0,0 +1 @@ +make docstest in Doc now passes., and is enforced in CI From webhook-mailer at python.org Fri Oct 12 04:21:11 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 12 Oct 2018 08:21:11 -0000 Subject: [Python-checkins] bpo-34940: Fix the error handling in _check_for_legacy_statements(). (GH-9764) Message-ID: https://github.com/python/cpython/commit/a4b48f194a131bad6fe1fcfb1f90ae2029304735 commit: a4b48f194a131bad6fe1fcfb1f90ae2029304735 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-12T11:20:59+03:00 summary: bpo-34940: Fix the error handling in _check_for_legacy_statements(). (GH-9764) files: M Objects/exceptions.c diff --git a/Objects/exceptions.c b/Objects/exceptions.c index bb50c1c36964..6aa3d8f8e19c 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2906,7 +2906,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) */ static PyObject *print_prefix = NULL; static PyObject *exec_prefix = NULL; - Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text); + Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text), match; int kind = PyUnicode_KIND(self->text); void *data = PyUnicode_DATA(self->text); @@ -2929,9 +2929,12 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) return -1; } } - if (PyUnicode_Tailmatch(self->text, print_prefix, - start, text_len, -1)) { - + match = PyUnicode_Tailmatch(self->text, print_prefix, + start, text_len, -1); + if (match == -1) { + return -1; + } + if (match) { return _set_legacy_print_statement_msg(self, start); } @@ -2942,10 +2945,17 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) return -1; } } - if (PyUnicode_Tailmatch(self->text, exec_prefix, - start, text_len, -1)) { - Py_XSETREF(self->msg, - PyUnicode_FromString("Missing parentheses in call to 'exec'")); + match = PyUnicode_Tailmatch(self->text, exec_prefix, start, text_len, -1); + if (match == -1) { + return -1; + } + if (match) { + PyObject *msg = PyUnicode_FromString("Missing parentheses in call " + "to 'exec'"); + if (msg == NULL) { + return -1; + } + Py_XSETREF(self->msg, msg); return 1; } /* Fall back to the default error message */ From webhook-mailer at python.org Fri Oct 12 04:31:27 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 12 Oct 2018 08:31:27 -0000 Subject: [Python-checkins] bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052) Message-ID: https://github.com/python/cpython/commit/65d2f8c044bf597685ba72f66cbcc6b3f7a3ee9c commit: 65d2f8c044bf597685ba72f66cbcc6b3f7a3ee9c branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-12T11:31:21+03:00 summary: bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052) files: M Lib/test/test_threading.py diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index db70dfa95df0..8160a5af0064 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -546,6 +546,7 @@ def f(): self.assertEqual(err, b"") self.assertEqual(data, "Thread-1\nTrue\nTrue\n") + @requires_type_collecting def test_main_thread_during_shutdown(self): # bpo-31516: current_thread() should still point to the main thread # at shutdown From webhook-mailer at python.org Fri Oct 12 04:49:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 08:49:11 -0000 Subject: [Python-checkins] bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052) Message-ID: https://github.com/python/cpython/commit/c327a5499fa823f627366c17e20687065fd70449 commit: c327a5499fa823f627366c17e20687065fd70449 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T01:49:07-07:00 summary: bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052) (cherry picked from commit 65d2f8c044bf597685ba72f66cbcc6b3f7a3ee9c) Co-authored-by: Zackery Spytz files: M Lib/test/test_threading.py diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index db70dfa95df0..8160a5af0064 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -546,6 +546,7 @@ def f(): self.assertEqual(err, b"") self.assertEqual(data, "Thread-1\nTrue\nTrue\n") + @requires_type_collecting def test_main_thread_during_shutdown(self): # bpo-31516: current_thread() should still point to the main thread # at shutdown From webhook-mailer at python.org Fri Oct 12 04:54:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 08:54:23 -0000 Subject: [Python-checkins] bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052) Message-ID: https://github.com/python/cpython/commit/d918e98056b7ef8d90d71805531cec3e67b5450e commit: d918e98056b7ef8d90d71805531cec3e67b5450e branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T01:54:18-07:00 summary: bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052) (cherry picked from commit 65d2f8c044bf597685ba72f66cbcc6b3f7a3ee9c) Co-authored-by: Zackery Spytz files: M Lib/test/test_threading.py diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 43ef22b24d49..ad54272761fd 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -544,6 +544,7 @@ def f(): self.assertEqual(err, b"") self.assertEqual(data, "Thread-1\nTrue\nTrue\n") + @requires_type_collecting def test_main_thread_during_shutdown(self): # bpo-31516: current_thread() should still point to the main thread # at shutdown From solipsis at pitrou.net Fri Oct 12 05:10:06 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 12 Oct 2018 09:10:06 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=2 Message-ID: <20181012091006.1.6490A94E849F3C2E@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [0, -2, 0] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/refloghQflBb', '--timeout', '7200'] From webhook-mailer at python.org Fri Oct 12 05:16:54 2018 From: webhook-mailer at python.org (Tal Einat) Date: Fri, 12 Oct 2018 09:16:54 -0000 Subject: [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) Message-ID: https://github.com/python/cpython/commit/4505f65ae7807f2420ed14d4f060e7cd5c4039d3 commit: 4505f65ae7807f2420ed14d4f060e7cd5c4039d3 branch: master author: Gus Goulart committer: Tal Einat date: 2018-10-12T12:16:43+03:00 summary: bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) files: M Doc/faq/general.rst diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst index 9d3e199fca6b..90fd69e72960 100644 --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -306,17 +306,19 @@ usually around 18 months between major releases. The developers issue "bugfix" releases of older versions, so the stability of existing releases gradually improves. Bugfix releases, indicated by a third -component of the version number (e.g. 2.5.3, 2.6.2), are managed for stability; +component of the version number (e.g. 3.5.3, 3.6.2), are managed for stability; only fixes for known problems are included in a bugfix release, and it's guaranteed that interfaces will remain the same throughout a series of bugfix releases. The latest stable releases can always be found on the `Python download page -`_. There are two recommended production-ready -versions at this point in time, because at the moment there are two branches of -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since -currently there is more third party software available for Python 2 than for -Python 3. Python 2 code will generally not run unchanged in Python 3. +`_. There are two production-ready version +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. +Although Python 2.x is still widely used, `it will not be +maintained after January 1, 2020 `_. +Python 2.x was known for having more third-party libraries available, however, +by the time of this writing, most of the widely used libraries support Python 3.x, +and some are even dropping the Python 2.x support. How many people are using Python? From webhook-mailer at python.org Fri Oct 12 06:36:07 2018 From: webhook-mailer at python.org (Berker Peksag) Date: Fri, 12 Oct 2018 10:36:07 -0000 Subject: [Python-checkins] bpo-34900: Make TestCase.debug() work with subtests (GH-9707) Message-ID: https://github.com/python/cpython/commit/da2bf9f66d0c95b988c5d87646d168f65499b316 commit: da2bf9f66d0c95b988c5d87646d168f65499b316 branch: master author: Bruno Oliveira committer: Berker Peksag date: 2018-10-12T13:35:55+03:00 summary: bpo-34900: Make TestCase.debug() work with subtests (GH-9707) files: A Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst M Lib/unittest/case.py M Lib/unittest/test/test_case.py diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 1faa6b641f2d..2579c30474b5 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -514,7 +514,7 @@ def subTest(self, msg=_subtest_msg_sentinel, **params): case as failed but resumes execution at the end of the enclosed block, allowing further test code to be executed. """ - if not self._outcome.result_supports_subtests: + if self._outcome is None or not self._outcome.result_supports_subtests: yield return parent = self._subtest diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index baabddd06f41..687fe5b65f10 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -425,6 +425,20 @@ def test_c(self): expected = ['a1', 'a2', 'b1'] self.assertEqual(events, expected) + def test_subtests_debug(self): + # Test debug() with a test that uses subTest() (bpo-34900) + events = [] + + class Foo(unittest.TestCase): + def test_a(self): + events.append('test case') + with self.subTest(): + events.append('subtest 1') + + Foo('test_a').debug() + + self.assertEqual(events, ['test case', 'subtest 1']) + # "This class attribute gives the exception raised by the test() method. # If a test framework needs to use a specialized exception, possibly to # carry additional information, it must subclass this exception in diff --git a/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst b/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst new file mode 100644 index 000000000000..20e3a0e2d5a1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst @@ -0,0 +1,2 @@ +Fixed :meth:`unittest.TestCase.debug` when used to call test methods with +subtests. Patch by Bruno Oliveira. From webhook-mailer at python.org Fri Oct 12 07:07:06 2018 From: webhook-mailer at python.org (Berker Peksag) Date: Fri, 12 Oct 2018 11:07:06 -0000 Subject: [Python-checkins] bpo-34900: Make TestCase.debug() work with subtests (GH-9707) Message-ID: https://github.com/python/cpython/commit/7a98e302c37781f9c6448a28bc70bff18b7e2862 commit: 7a98e302c37781f9c6448a28bc70bff18b7e2862 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Berker Peksag date: 2018-10-12T14:07:01+03:00 summary: bpo-34900: Make TestCase.debug() work with subtests (GH-9707) (cherry picked from commit da2bf9f66d0c95b988c5d87646d168f65499b316) Co-authored-by: Bruno Oliveira files: A Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst M Lib/unittest/case.py M Lib/unittest/test/test_case.py diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index c0170d182573..758924d80113 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -519,7 +519,7 @@ def subTest(self, msg=_subtest_msg_sentinel, **params): case as failed but resumes execution at the end of the enclosed block, allowing further test code to be executed. """ - if not self._outcome.result_supports_subtests: + if self._outcome is None or not self._outcome.result_supports_subtests: yield return parent = self._subtest diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index 6b3439781c9d..6d58201ea814 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -425,6 +425,20 @@ def test_c(self): expected = ['a1', 'a2', 'b1'] self.assertEqual(events, expected) + def test_subtests_debug(self): + # Test debug() with a test that uses subTest() (bpo-34900) + events = [] + + class Foo(unittest.TestCase): + def test_a(self): + events.append('test case') + with self.subTest(): + events.append('subtest 1') + + Foo('test_a').debug() + + self.assertEqual(events, ['test case', 'subtest 1']) + # "This class attribute gives the exception raised by the test() method. # If a test framework needs to use a specialized exception, possibly to # carry additional information, it must subclass this exception in diff --git a/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst b/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst new file mode 100644 index 000000000000..20e3a0e2d5a1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst @@ -0,0 +1,2 @@ +Fixed :meth:`unittest.TestCase.debug` when used to call test methods with +subtests. Patch by Bruno Oliveira. From webhook-mailer at python.org Fri Oct 12 07:07:48 2018 From: webhook-mailer at python.org (Berker Peksag) Date: Fri, 12 Oct 2018 11:07:48 -0000 Subject: [Python-checkins] bpo-34900: Make TestCase.debug() work with subtests (GH-9707) Message-ID: https://github.com/python/cpython/commit/c1fe49c01f3850aaa32a7d75e47f90eb5c5f7efe commit: c1fe49c01f3850aaa32a7d75e47f90eb5c5f7efe branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Berker Peksag date: 2018-10-12T14:07:44+03:00 summary: bpo-34900: Make TestCase.debug() work with subtests (GH-9707) (cherry picked from commit da2bf9f66d0c95b988c5d87646d168f65499b316) Co-authored-by: Bruno Oliveira files: A Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst M Lib/unittest/case.py M Lib/unittest/test/test_case.py diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index c3634ec997f8..402fa47f285a 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -509,7 +509,7 @@ def subTest(self, msg=_subtest_msg_sentinel, **params): case as failed but resumes execution at the end of the enclosed block, allowing further test code to be executed. """ - if not self._outcome.result_supports_subtests: + if self._outcome is None or not self._outcome.result_supports_subtests: yield return parent = self._subtest diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index b84959150542..04da9d0cec7b 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -425,6 +425,20 @@ def test_c(self): expected = ['a1', 'a2', 'b1'] self.assertEqual(events, expected) + def test_subtests_debug(self): + # Test debug() with a test that uses subTest() (bpo-34900) + events = [] + + class Foo(unittest.TestCase): + def test_a(self): + events.append('test case') + with self.subTest(): + events.append('subtest 1') + + Foo('test_a').debug() + + self.assertEqual(events, ['test case', 'subtest 1']) + # "This class attribute gives the exception raised by the test() method. # If a test framework needs to use a specialized exception, possibly to # carry additional information, it must subclass this exception in diff --git a/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst b/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst new file mode 100644 index 000000000000..20e3a0e2d5a1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-05-05-55-53.bpo-34900.8RNiFu.rst @@ -0,0 +1,2 @@ +Fixed :meth:`unittest.TestCase.debug` when used to call test methods with +subtests. Patch by Bruno Oliveira. From webhook-mailer at python.org Fri Oct 12 08:06:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 12:06:11 -0000 Subject: [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) Message-ID: https://github.com/python/cpython/commit/d4ed8809ddfaa23fe5edf2987c03afc32f5576c0 commit: d4ed8809ddfaa23fe5edf2987c03afc32f5576c0 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T05:06:07-07:00 summary: bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) (cherry picked from commit 4505f65ae7807f2420ed14d4f060e7cd5c4039d3) Co-authored-by: Gus Goulart files: M Doc/faq/general.rst diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst index 9d3e199fca6b..90fd69e72960 100644 --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -306,17 +306,19 @@ usually around 18 months between major releases. The developers issue "bugfix" releases of older versions, so the stability of existing releases gradually improves. Bugfix releases, indicated by a third -component of the version number (e.g. 2.5.3, 2.6.2), are managed for stability; +component of the version number (e.g. 3.5.3, 3.6.2), are managed for stability; only fixes for known problems are included in a bugfix release, and it's guaranteed that interfaces will remain the same throughout a series of bugfix releases. The latest stable releases can always be found on the `Python download page -`_. There are two recommended production-ready -versions at this point in time, because at the moment there are two branches of -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since -currently there is more third party software available for Python 2 than for -Python 3. Python 2 code will generally not run unchanged in Python 3. +`_. There are two production-ready version +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. +Although Python 2.x is still widely used, `it will not be +maintained after January 1, 2020 `_. +Python 2.x was known for having more third-party libraries available, however, +by the time of this writing, most of the widely used libraries support Python 3.x, +and some are even dropping the Python 2.x support. How many people are using Python? From webhook-mailer at python.org Fri Oct 12 08:06:15 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 12:06:15 -0000 Subject: [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) Message-ID: https://github.com/python/cpython/commit/86cfac47cf736fae90a617959288ccade18fd07e commit: 86cfac47cf736fae90a617959288ccade18fd07e branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T05:06:12-07:00 summary: bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) (cherry picked from commit 4505f65ae7807f2420ed14d4f060e7cd5c4039d3) Co-authored-by: Gus Goulart files: M Doc/faq/general.rst diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst index 4e842f5366ef..9ec90e802ef6 100644 --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -306,17 +306,19 @@ usually around 18 months between major releases. The developers issue "bugfix" releases of older versions, so the stability of existing releases gradually improves. Bugfix releases, indicated by a third -component of the version number (e.g. 2.5.3, 2.6.2), are managed for stability; +component of the version number (e.g. 3.5.3, 3.6.2), are managed for stability; only fixes for known problems are included in a bugfix release, and it's guaranteed that interfaces will remain the same throughout a series of bugfix releases. The latest stable releases can always be found on the `Python download page -`_. There are two recommended production-ready -versions at this point in time, because at the moment there are two branches of -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since -currently there is more third party software available for Python 2 than for -Python 3. Python 2 code will generally not run unchanged in Python 3. +`_. There are two production-ready version +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. +Although Python 2.x is still widely used, `it will not be +maintained after January 1, 2020 `_. +Python 2.x was known for having more third-party libraries available, however, +by the time of this writing, most of the widely used libraries support Python 3.x, +and some are even dropping the Python 2.x support. How many people are using Python? From webhook-mailer at python.org Fri Oct 12 08:06:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 12 Oct 2018 12:06:19 -0000 Subject: [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) Message-ID: https://github.com/python/cpython/commit/6198976ec807cf3b658e902fd63db88a3ac99b8c commit: 6198976ec807cf3b658e902fd63db88a3ac99b8c branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-12T05:06:16-07:00 summary: bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) (cherry picked from commit 4505f65ae7807f2420ed14d4f060e7cd5c4039d3) Co-authored-by: Gus Goulart files: M Doc/faq/general.rst diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst index eb1bd16b4b8b..887dea74f5f1 100644 --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -306,17 +306,19 @@ usually around 18 months between major releases. The developers issue "bugfix" releases of older versions, so the stability of existing releases gradually improves. Bugfix releases, indicated by a third -component of the version number (e.g. 2.5.3, 2.6.2), are managed for stability; +component of the version number (e.g. 3.5.3, 3.6.2), are managed for stability; only fixes for known problems are included in a bugfix release, and it's guaranteed that interfaces will remain the same throughout a series of bugfix releases. The latest stable releases can always be found on the `Python download page -`_. There are two recommended production-ready -versions at this point in time, because at the moment there are two branches of -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since -currently there is more third party software available for Python 2 than for -Python 3. Python 2 code will generally not run unchanged in Python 3. +`_. There are two production-ready version +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. +Although Python 2.x is still widely used, `it will not be +maintained after January 1, 2020 `_. +Python 2.x was known for having more third-party libraries available, however, +by the time of this writing, most of the widely used libraries support Python 3.x, +and some are even dropping the Python 2.x support. How many people are using Python? From eric at trueblade.com Fri Oct 12 07:32:31 2018 From: eric at trueblade.com (Eric V. Smith) Date: Fri, 12 Oct 2018 07:32:31 -0400 Subject: [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) In-Reply-To: <42Wj0P517lzFrcx@mail.python.org> References: <42Wj0P517lzFrcx@mail.python.org> Message-ID: <125297d6-545f-3052-0900-9df2072f0057@trueblade.com> On 10/12/2018 5:17 AM, Tal Einat wrote: > The latest stable releases can always be found on the `Python download page > -`_. There are two recommended production-ready > -versions at this point in time, because at the moment there are two branches of > -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since > -currently there is more third party software available for Python 2 than for > -Python 3. Python 2 code will generally not run unchanged in Python 3. > +`_. There are two production-ready version > +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. This should be "time", not "times". I'd fix it, but I'm unsure if this is being backported or not, and I don't want to mess up any merges before they're done. I do think this should backported to 3.7, 3.6, and 2.7. > +Although Python 2.x is still widely used, `it will not be > +maintained after January 1, 2020 `_. > +Python 2.x was known for having more third-party libraries available, however, > +by the time of this writing, most of the widely used libraries support Python 3.x, Should probably be "at the time of this writing". > +and some are even dropping the Python 2.x support. And this would read better as "are even dropping support for Python 2.x". Eric From webhook-mailer at python.org Fri Oct 12 10:55:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 12 Oct 2018 14:55:25 -0000 Subject: [Python-checkins] bpo-11233: Create availability directive for documentation (GH-9692) Message-ID: https://github.com/python/cpython/commit/2d6097d027e0dd3debbabc702aa9c98d94ba32a3 commit: 2d6097d027e0dd3debbabc702aa9c98d94ba32a3 branch: master author: Cheryl Sabella committer: Victor Stinner date: 2018-10-12T16:55:20+02:00 summary: bpo-11233: Create availability directive for documentation (GH-9692) Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl files: A Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst M Doc/c-api/exceptions.rst M Doc/c-api/init.rst M Doc/library/_thread.rst M Doc/library/asyncio-eventloop.rst M Doc/library/asyncio-policy.rst M Doc/library/asyncio-stream.rst M Doc/library/asyncore.rst M Doc/library/codecs.rst M Doc/library/hashlib.rst M Doc/library/intro.rst M Doc/library/mimetypes.rst M Doc/library/os.path.rst M Doc/library/os.rst M Doc/library/resource.rst M Doc/library/select.rst M Doc/library/shutil.rst M Doc/library/signal.rst M Doc/library/socket.rst M Doc/library/ssl.rst M Doc/library/subprocess.rst M Doc/library/sys.rst M Doc/library/threading.rst M Doc/library/time.rst M Doc/tools/extensions/pyspecific.py M Doc/tools/rstlint.py M Doc/using/cmdline.rst diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 2bc1bd876a2f..dd1e026cb071 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -186,34 +186,42 @@ NULL pointer for use in a ``return`` statement. then it constructs a tuple object whose first item is the *ierr* value and whose second item is the corresponding error message (gotten from :c:func:`FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError, - object)``. This function always returns *NULL*. Availability: Windows. + object)``. This function always returns *NULL*. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr) Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter - specifying the exception type to be raised. Availability: Windows. + specifying the exception type to be raised. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename) Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the filename is given as a C string. *filename* is decoded from the filesystem - encoding (:func:`os.fsdecode`). Availability: Windows. + encoding (:func:`os.fsdecode`). + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename) Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an additional parameter specifying the exception type to be raised. - Availability: Windows. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObjects(PyObject *type, int ierr, PyObject *filename, PyObject *filename2) Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but accepts a second filename object. - Availability: Windows. + + .. availability:: Windows. .. versionadded:: 3.4 @@ -221,7 +229,9 @@ NULL pointer for use in a ``return`` statement. .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename) Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional - parameter specifying the exception type to be raised. Availability: Windows. + parameter specifying the exception type to be raised. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path) diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index e51a2555f6ad..6b5290a7ebbb 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -156,7 +156,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. See :pep:`529` for more details. - Availability: Windows. + .. availability:: Windows. .. c:var:: Py_LegacyWindowsStdioFlag @@ -168,7 +168,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. See :pep:`528` for more details. - Availability: Windows. + .. availability:: Windows. .. c:var:: Py_NoSiteFlag diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst index 67cb70944f4d..acffabf24bad 100644 --- a/Doc/library/_thread.rst +++ b/Doc/library/_thread.rst @@ -101,7 +101,8 @@ This module defines the following constants and functions: memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information). - Availability: Windows, systems with POSIX threads. + + .. availability:: Windows, systems with POSIX threads. .. data:: TIMEOUT_MAX diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 76c8ce9943ef..96f5e0b38a9f 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -510,7 +510,7 @@ Opening network connections See the documentation of the :meth:`loop.create_connection` method for information about arguments to this method. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -630,7 +630,7 @@ Creating network servers See the documentation of the :meth:`loop.create_server` method for information about arguments to this method. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -979,7 +979,7 @@ Unix signals Return ``True`` if the signal handler was removed, or ``False`` if no handler was set for the given signal. -Availability: Unix. + .. availability:: Unix. .. seealso:: @@ -1423,14 +1423,14 @@ on all platforms. asyncio.set_event_loop(loop) - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. class:: ProactorEventLoop An event loop for Windows that uses "I/O Completion Ports" (IOCP). - Availability: Windows. + .. availability:: Windows. .. seealso:: diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index 560f8b3135e1..82c83822d4d3 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -107,7 +107,7 @@ asyncio ships with the following built-in policies: An alternative event loop policy that uses the :class:`SelectorEventLoop` event loop implementation. - Availability: Windows. + .. availability:: Windows. .. class:: WindowsProactorEventLoopPolicy @@ -115,7 +115,7 @@ asyncio ships with the following built-in policies: An alternative event loop policy that uses the :class:`ProactorEventLoop` event loop implementation. - Availability: Windows. + .. availability:: Windows. Process Watchers diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst index 60aae16c6d4f..e686a6a1c4cd 100644 --- a/Doc/library/asyncio-stream.rst +++ b/Doc/library/asyncio-stream.rst @@ -114,7 +114,7 @@ and work with streams: See also the documentation of :meth:`loop.create_unix_connection`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -136,7 +136,7 @@ and work with streams: See also the documentation of :meth:`loop.create_unix_server`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index 11d36163e44a..a86518ebff27 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -273,14 +273,18 @@ any that have been added to the map during asynchronous service) is closed. with an optional map argument and wraps it for use with the :c:func:`poll` or :c:func:`loop` functions. If provided a file object or anything with a :c:func:`fileno` method, that method will be called and passed to the - :class:`file_wrapper` constructor. Availability: UNIX. + :class:`file_wrapper` constructor. + + .. availability:: Unix. .. class:: file_wrapper() A file_wrapper takes an integer file descriptor and calls :func:`os.dup` to duplicate the handle so that the original handle may be closed independently of the file_wrapper. This class implements sufficient methods to emulate a - socket for use by the :class:`file_dispatcher` class. Availability: UNIX. + socket for use by the :class:`file_dispatcher` class. + + .. availability:: Unix. .. _asyncore-example-1: diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 24008a0b3f00..b9c04c241a8b 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1471,7 +1471,7 @@ functions can be used directly if desired. Encode operand according to the ANSI codepage (CP_ACP). -Availability: Windows only. +.. availability:: Windows only. .. versionchanged:: 3.3 Support any error handler. diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index 4a8d7058c68f..a16c7cd4d7cd 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -271,7 +271,7 @@ include a `salt `_. factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). *dklen* is the length of the derived key. - Availability: OpenSSL 1.1+ + .. availability:: OpenSSL 1.1+. .. versionadded:: 3.6 diff --git a/Doc/library/intro.rst b/Doc/library/intro.rst index e3283cac9947..8567e4d1d089 100644 --- a/Doc/library/intro.rst +++ b/Doc/library/intro.rst @@ -47,3 +47,16 @@ this material. Let the show begin! + +.. _availability: + +Notes on availability +===================== + +* An "Availability: Unix" note means that this function is commonly found on + Unix systems. It does not make any claims about its existence on a specific + operating system. + +* If not separately noted, all functions that claim "Availability: Unix" are + supported on Mac OS X, which builds on a Unix core. + diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 973014abba59..5728407cb34c 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -260,7 +260,9 @@ than one MIME-type database; it provides an interface similar to the one of the .. method:: MimeTypes.read_windows_registry(strict=True) - Load MIME type information from the Windows registry. Availability: Windows. + Load MIME type information from the Windows registry. + + .. availability:: Windows. If *strict* is ``True``, information will be added to the list of standard types, else to the list of non-standard types. diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 5a0b178b9d04..f68fe61c0c2c 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -93,7 +93,7 @@ the :mod:`glob` module.) pathnames, or if *paths* is empty. Unlike :func:`commonprefix`, this returns a valid path. - Availability: Unix, Windows + .. availability:: Unix, Windows. .. versionadded:: 3.5 @@ -357,7 +357,7 @@ the :mod:`glob` module.) *start* defaults to :attr:`os.curdir`. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -369,7 +369,7 @@ the :mod:`glob` module.) This is determined by the device number and i-node number and raises an exception if an :func:`os.stat` call on either pathname fails. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added Windows support. @@ -385,7 +385,7 @@ the :mod:`glob` module.) Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added Windows support. @@ -401,7 +401,7 @@ the :mod:`glob` module.) :func:`os.lstat`, or :func:`os.stat`. This function implements the underlying comparison used by :func:`samefile` and :func:`sameopenfile`. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.4 Added Windows support. diff --git a/Doc/library/os.rst b/Doc/library/os.rst index bc8d5a8abbf3..75d473c00d5c 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -32,15 +32,6 @@ Notes on the availability of these functions: objects, and result in an object of the same type, if a path or file name is returned. -* An "Availability: Unix" note means that this function is commonly found on - Unix systems. It does not make any claims about its existence on a specific - operating system. - -* If not separately noted, all functions that claim "Availability: Unix" are - supported on Mac OS X, which builds on a Unix core. - -.. Availability notes get their own line and occur at the end of the function -.. documentation. .. note:: @@ -105,7 +96,7 @@ process and user. Return the filename corresponding to the controlling terminal of the process. - Availability: Unix. + .. availability:: Unix. .. data:: environ @@ -235,7 +226,7 @@ process and user. and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you would like to use a different encoding. - Availability: most flavors of Unix, Windows. + .. availability:: most flavors of Unix, Windows. .. function:: getenvb(key, default=None) @@ -246,7 +237,7 @@ process and user. :func:`getenvb` is only available if :data:`supports_bytes_environ` is True. - Availability: most flavors of Unix. + .. availability:: most flavors of Unix. .. versionadded:: 3.2 @@ -267,7 +258,7 @@ process and user. Return the effective group id of the current process. This corresponds to the "set id" bit on the file being executed in the current process. - Availability: Unix. + .. availability:: Unix. .. function:: geteuid() @@ -276,7 +267,7 @@ process and user. Return the current process's effective user id. - Availability: Unix. + .. availability:: Unix. .. function:: getgid() @@ -285,7 +276,7 @@ process and user. Return the real group id of the current process. - Availability: Unix. + .. availability:: Unix. .. function:: getgrouplist(user, group) @@ -294,7 +285,7 @@ process and user. list, it is included; typically, *group* is specified as the group ID field from the password record for *user*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -303,7 +294,7 @@ process and user. Return list of supplemental group ids associated with the current process. - Availability: Unix. + .. availability:: Unix. .. note:: @@ -331,7 +322,7 @@ process and user. falls back to ``pwd.getpwuid(os.getuid())[0]`` to get the login name of the current real user id. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: getpgid(pid) @@ -339,7 +330,7 @@ process and user. Return the process group id of the process with process id *pid*. If *pid* is 0, the process group id of the current process is returned. - Availability: Unix. + .. availability:: Unix. .. function:: getpgrp() @@ -347,7 +338,7 @@ process and user. Return the id of the current process group. - Availability: Unix. + .. availability:: Unix. .. function:: getpid() @@ -365,7 +356,7 @@ process and user. the id returned is the one of the init process (1), on Windows it is still the same id, which may be already reused by another process. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added support for Windows. @@ -383,7 +374,7 @@ process and user. (respectively) the calling process, the process group of the calling process, or the real user ID of the calling process. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -394,7 +385,7 @@ process and user. Parameters for the :func:`getpriority` and :func:`setpriority` functions. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -404,7 +395,7 @@ process and user. Return a tuple (ruid, euid, suid) denoting the current process's real, effective, and saved user ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -414,7 +405,7 @@ process and user. Return a tuple (rgid, egid, sgid) denoting the current process's real, effective, and saved group ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -425,7 +416,7 @@ process and user. Return the current process's real user id. - Availability: Unix. + .. availability:: Unix. .. function:: initgroups(username, gid) @@ -434,7 +425,7 @@ process and user. the groups of which the specified username is a member, plus the specified group id. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -447,7 +438,7 @@ process and user. changes to the environment affect subprocesses started with :func:`os.system`, :func:`popen` or :func:`fork` and :func:`execv`. - Availability: most flavors of Unix, Windows. + .. availability:: most flavors of Unix, Windows. .. note:: @@ -464,21 +455,21 @@ process and user. Set the current process's effective group id. - Availability: Unix. + .. availability:: Unix. .. function:: seteuid(euid) Set the current process's effective user id. - Availability: Unix. + .. availability:: Unix. .. function:: setgid(gid) Set the current process' group id. - Availability: Unix. + .. availability:: Unix. .. function:: setgroups(groups) @@ -487,7 +478,7 @@ process and user. *groups*. *groups* must be a sequence, and each element must be an integer identifying a group. This operation is typically available only to the superuser. - Availability: Unix. + .. availability:: Unix. .. note:: On Mac OS X, the length of *groups* may not exceed the system-defined maximum number of effective group ids, typically 16. @@ -499,7 +490,7 @@ process and user. Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on which version is implemented (if any). See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setpgid(pid, pgrp) @@ -508,7 +499,7 @@ process and user. process with id *pid* to the process group with id *pgrp*. See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setpriority(which, who, priority) @@ -525,7 +516,7 @@ process and user. *priority* is a value in the range -20 to 19. The default priority is 0; lower priorities cause more favorable scheduling. - Availability: Unix + .. availability:: Unix. .. versionadded:: 3.3 @@ -534,14 +525,14 @@ process and user. Set the current process's real and effective group ids. - Availability: Unix. + .. availability:: Unix. .. function:: setresgid(rgid, egid, sgid) Set the current process's real, effective, and saved group ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -550,7 +541,7 @@ process and user. Set the current process's real, effective, and saved user ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -559,21 +550,21 @@ process and user. Set the current process's real and effective user ids. - Availability: Unix. + .. availability:: Unix. .. function:: getsid(pid) Call the system call :c:func:`getsid`. See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setsid() Call the system call :c:func:`setsid`. See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setuid(uid) @@ -582,7 +573,7 @@ process and user. Set the current process's user id. - Availability: Unix. + .. availability:: Unix. .. placed in this section since it relates to errno.... a little weak @@ -631,7 +622,7 @@ process and user. :func:`socket.gethostname` or even ``socket.gethostbyaddr(socket.gethostname())``. - Availability: recent flavors of Unix. + .. availability:: recent flavors of Unix. .. versionchanged:: 3.3 Return type changed from a tuple to a tuple-like object @@ -651,7 +642,7 @@ process and user. calls to :func:`unsetenv` don't update ``os.environ``, so it is actually preferable to delete items of ``os.environ``. - Availability: most flavors of Unix, Windows. + .. availability:: most flavors of Unix, Windows. .. _os-newstreams: @@ -754,7 +745,7 @@ as internal buffering of data. docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, this is equivalent to ``os.chmod(fd, mode)``. - Availability: Unix. + .. availability:: Unix. .. function:: fchown(fd, uid, gid) @@ -764,7 +755,7 @@ as internal buffering of data. :func:`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``. - Availability: Unix. + .. availability:: Unix. .. function:: fdatasync(fd) @@ -772,7 +763,7 @@ as internal buffering of data. Force write of file with filedescriptor *fd* to disk. Does not force update of metadata. - Availability: Unix. + .. availability:: Unix. .. note:: This function is not available on MacOS. @@ -795,7 +786,7 @@ as internal buffering of data. As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``. - Availability: Unix. + .. availability:: Unix. .. function:: fstat(fd) @@ -816,7 +807,7 @@ as internal buffering of data. file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is equivalent to ``os.statvfs(fd)``. - Availability: Unix. + .. availability:: Unix. .. function:: fsync(fd) @@ -828,7 +819,7 @@ as internal buffering of data. ``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal buffers associated with *f* are written to disk. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: ftruncate(fd, length) @@ -837,7 +828,7 @@ as internal buffering of data. most *length* bytes in size. As of Python 3.3, this is equivalent to ``os.truncate(fd, length)``. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.5 Added support for Windows @@ -849,7 +840,7 @@ as internal buffering of data. See also :func:`set_blocking` and :meth:`socket.socket.setblocking`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.5 @@ -867,7 +858,7 @@ as internal buffering of data. :data:`F_ULOCK` or :data:`F_TEST`. *len* specifies the section of the file to lock. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -879,7 +870,7 @@ as internal buffering of data. Flags that specify what action :func:`lockf` will take. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1011,7 +1002,7 @@ or `the MSDN `_ on Windo descriptors are :ref:`non-inheritable `. For a (slightly) more portable approach, use the :mod:`pty` module. - Availability: some flavors of Unix. + .. availability:: some flavors of Unix. .. versionchanged:: 3.4 The new file descriptors are now non-inheritable. @@ -1023,7 +1014,7 @@ or `the MSDN `_ on Windo reading and writing, respectively. The new file descriptor is :ref:`non-inheritable `. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.4 The new file descriptors are now non-inheritable. @@ -1037,7 +1028,7 @@ or `the MSDN `_ on Windo Return a pair of file descriptors ``(r, w)`` usable for reading and writing, respectively. - Availability: some flavors of Unix. + .. availability:: some flavors of Unix. .. versionadded:: 3.3 @@ -1047,7 +1038,7 @@ or `the MSDN `_ on Windo Ensures that enough disk space is allocated for the file specified by *fd* starting from *offset* and continuing for *len* bytes. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1062,7 +1053,7 @@ or `the MSDN `_ on Windo :data:`POSIX_FADV_RANDOM`, :data:`POSIX_FADV_NOREUSE`, :data:`POSIX_FADV_WILLNEED` or :data:`POSIX_FADV_DONTNEED`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1077,7 +1068,7 @@ or `the MSDN `_ on Windo Flags that can be used in *advice* in :func:`posix_fadvise` that specify the access pattern that is likely to be used. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1090,7 +1081,7 @@ or `the MSDN `_ on Windo Return a bytestring containing the bytes read. If the end of the file referred to by *fd* has been reached, an empty bytes object is returned. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1116,8 +1107,8 @@ or `the MSDN `_ on Windo Combine the functionality of :func:`os.readv` and :func:`os.pread`. - Availability: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, - OpenBSD 2.7 and newer. Using flags requires Linux 4.6 or newer. + .. availability:: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, + OpenBSD 2.7 and newer. Using flags requires Linux 4.6 or newer. .. versionadded:: 3.7 @@ -1132,7 +1123,7 @@ or `the MSDN `_ on Windo If no bytes were read, it will return ``-1`` and set errno to :data:`errno.EAGAIN`. - Availability: Linux 4.14 and newer. + .. availability:: Linux 4.14 and newer. .. versionadded:: 3.7 @@ -1146,7 +1137,7 @@ or `the MSDN `_ on Windo Currently, on Linux, this feature is usable only on a file descriptor opened using the :data:`O_DIRECT` flag. - Availability: Linux 4.6 and newer. + .. availability:: Linux 4.6 and newer. .. versionadded:: 3.7 @@ -1158,7 +1149,7 @@ or `the MSDN `_ on Windo Return the number of bytes actually written. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1184,8 +1175,8 @@ or `the MSDN `_ on Windo Combine the functionality of :func:`os.writev` and :func:`os.pwrite`. - Availability: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, - OpenBSD 2.7 and newer. Using flags requires Linux 4.7 or newer. + .. availability:: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, + OpenBSD 2.7 and newer. Using flags requires Linux 4.7 or newer. .. versionadded:: 3.7 @@ -1195,7 +1186,7 @@ or `the MSDN `_ on Windo Provide a per-write equivalent of the :data:`O_DSYNC` ``open(2)`` flag. This flag effect applies only to the data range written by the system call. - Availability: Linux 4.7 and newer. + .. availability:: Linux 4.7 and newer. .. versionadded:: 3.7 @@ -1205,7 +1196,7 @@ or `the MSDN `_ on Windo Provide a per-write equivalent of the :data:`O_SYNC` ``open(2)`` flag. This flag effect applies only to the data range written by the system call. - Availability: Linux 4.7 and newer. + .. availability:: Linux 4.7 and newer. .. versionadded:: 3.7 @@ -1257,7 +1248,7 @@ or `the MSDN `_ on Windo Cross-platform applications should not use *headers*, *trailers* and *flags* arguments. - Availability: Unix. + .. availability:: Unix. .. note:: @@ -1274,7 +1265,7 @@ or `the MSDN `_ on Windo See also :func:`get_blocking` and :meth:`socket.socket.setblocking`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.5 @@ -1286,7 +1277,7 @@ or `the MSDN `_ on Windo Parameters to the :func:`sendfile` function, if the implementation supports them. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1304,7 +1295,7 @@ or `the MSDN `_ on Windo The operating system may set a limit (:func:`sysconf` value ``'SC_IOV_MAX'``) on the number of buffers that can be used. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1314,7 +1305,7 @@ or `the MSDN `_ on Windo Return the process group associated with the terminal given by *fd* (an open file descriptor as returned by :func:`os.open`). - Availability: Unix. + .. availability:: Unix. .. function:: tcsetpgrp(fd, pg) @@ -1322,7 +1313,7 @@ or `the MSDN `_ on Windo Set the process group associated with the terminal given by *fd* (an open file descriptor as returned by :func:`os.open`) to *pg*. - Availability: Unix. + .. availability:: Unix. .. function:: ttyname(fd) @@ -1331,7 +1322,7 @@ or `the MSDN `_ on Windo file descriptor *fd*. If *fd* is not associated with a terminal device, an exception is raised. - Availability: Unix. + .. availability:: Unix. .. function:: write(fd, str) @@ -1366,7 +1357,7 @@ or `the MSDN `_ on Windo The operating system may set a limit (:func:`sysconf` value ``'SC_IOV_MAX'``) on the number of buffers that can be used. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1393,7 +1384,7 @@ Querying the size of a terminal should normally be used, ``os.get_terminal_size`` is the low-level implementation. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. class:: terminal_size @@ -1442,13 +1433,13 @@ streams are closed, and inheritable handles are only inherited if the Get the "inheritable" flag of the specified handle (a boolean). - Availability: Windows. + .. availability:: Windows. .. function:: set_handle_inheritable(handle, inheritable) Set the "inheritable" flag of the specified handle. - Availability: Windows. + .. availability:: Windows. .. _os-file-dir: @@ -1603,7 +1594,7 @@ features: This function can support :ref:`not following symlinks `. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 The *follow_symlinks* argument. @@ -1668,7 +1659,7 @@ features: See :func:`shutil.chown` for a higher-level function that accepts names in addition to numeric ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 Added support for specifying an open file descriptor for *path*, @@ -1682,7 +1673,7 @@ features: Change the root directory of the current process to *path*. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1694,7 +1685,7 @@ features: descriptor *fd*. The descriptor must refer to an opened directory, not an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``. - Availability: Unix. + .. availability:: Unix. .. function:: getcwd() @@ -1713,7 +1704,7 @@ features: not follow symbolic links. As of Python 3.3, this is equivalent to ``os.chflags(path, flags, follow_symlinks=False)``. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1726,7 +1717,7 @@ features: for possible values of *mode*. As of Python 3.3, this is equivalent to ``os.chmod(path, mode, follow_symlinks=False)``. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1737,7 +1728,7 @@ features: function will not follow symbolic links. As of Python 3.3, this is equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1751,7 +1742,7 @@ features: supply :ref:`paths relative to directory descriptors `, and :ref:`not following symlinks `. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added Windows support. @@ -1909,7 +1900,7 @@ features: FIFO for reading, and the client opens it for writing. Note that :func:`mkfifo` doesn't open the FIFO --- it just creates the rendezvous point. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 The *dir_fd* argument. @@ -1931,7 +1922,7 @@ features: This function can also support :ref:`paths relative to directory descriptors `. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 The *dir_fd* argument. @@ -1975,7 +1966,7 @@ features: This function can support :ref:`specifying a file descriptor `. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1987,7 +1978,7 @@ features: the integer values defined for those names by the host operating system. This can be used to determine the set of names known to the system. - Availability: Unix. + .. availability:: Unix. .. function:: readlink(path, *, dir_fd=None) @@ -2005,7 +1996,7 @@ features: This function can also support :ref:`paths relative to directory descriptors `. - Availability: Unix, Windows + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added support for Windows 6.0 (Vista) symbolic links. @@ -2596,7 +2587,7 @@ features: This function can support :ref:`specifying a file descriptor `. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.2 The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added. @@ -2726,7 +2717,7 @@ features: :exc:`OSError` is raised when the function is called by an unprivileged user. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added support for Windows 6.0 (Vista) symbolic links. @@ -2743,7 +2734,7 @@ features: Force write of everything to disk. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -2755,7 +2746,7 @@ features: This function can support :ref:`specifying a file descriptor `. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionadded:: 3.3 @@ -2962,7 +2953,7 @@ features: for name in dirs: os.rmdir(name, dir_fd=rootfd) - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3139,7 +3130,7 @@ to be ignored. you can check whether or not it is available using :data:`os.supports_fd`. If it is unavailable, using it will raise a :exc:`NotImplementedError`. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionadded:: 3.3 Added support for specifying an open file descriptor for *path* @@ -3173,7 +3164,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means no error occurred. - Availability: Unix. + .. availability:: Unix. .. data:: EX_USAGE @@ -3181,49 +3172,49 @@ written in Python, such as a mail server's external command delivery program. Exit code that means the command was used incorrectly, such as when the wrong number of arguments are given. - Availability: Unix. + .. availability:: Unix. .. data:: EX_DATAERR Exit code that means the input data was incorrect. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOINPUT Exit code that means an input file did not exist or was not readable. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOUSER Exit code that means a specified user did not exist. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOHOST Exit code that means a specified host did not exist. - Availability: Unix. + .. availability:: Unix. .. data:: EX_UNAVAILABLE Exit code that means that a required service is unavailable. - Availability: Unix. + .. availability:: Unix. .. data:: EX_SOFTWARE Exit code that means an internal software error was detected. - Availability: Unix. + .. availability:: Unix. .. data:: EX_OSERR @@ -3231,7 +3222,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means an operating system error was detected, such as the inability to fork or create a pipe. - Availability: Unix. + .. availability:: Unix. .. data:: EX_OSFILE @@ -3239,21 +3230,21 @@ written in Python, such as a mail server's external command delivery program. Exit code that means some system file did not exist, could not be opened, or had some other kind of error. - Availability: Unix. + .. availability:: Unix. .. data:: EX_CANTCREAT Exit code that means a user specified output file could not be created. - Availability: Unix. + .. availability:: Unix. .. data:: EX_IOERR Exit code that means that an error occurred while doing I/O on some file. - Availability: Unix. + .. availability:: Unix. .. data:: EX_TEMPFAIL @@ -3262,7 +3253,7 @@ written in Python, such as a mail server's external command delivery program. that may not really be an error, such as a network connection that couldn't be made during a retryable operation. - Availability: Unix. + .. availability:: Unix. .. data:: EX_PROTOCOL @@ -3270,7 +3261,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means that a protocol exchange was illegal, invalid, or not understood. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOPERM @@ -3278,21 +3269,21 @@ written in Python, such as a mail server's external command delivery program. Exit code that means that there were insufficient permissions to perform the operation (but not intended for file system problems). - Availability: Unix. + .. availability:: Unix. .. data:: EX_CONFIG Exit code that means that some kind of configuration error occurred. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOTFOUND Exit code that means something like "an entry was not found". - Availability: Unix. + .. availability:: Unix. .. function:: fork() @@ -3307,7 +3298,7 @@ written in Python, such as a mail server's external command delivery program. See :mod:`ssl` for applications that use the SSL module with fork(). - Availability: Unix. + .. availability:: Unix. .. function:: forkpty() @@ -3318,7 +3309,7 @@ written in Python, such as a mail server's external command delivery program. master end of the pseudo-terminal. For a more portable approach, use the :mod:`pty` module. If an error occurs :exc:`OSError` is raised. - Availability: some flavors of Unix. + .. availability:: some flavors of Unix. .. function:: kill(pid, sig) @@ -3352,14 +3343,14 @@ written in Python, such as a mail server's external command delivery program. Send the signal *sig* to the process group *pgid*. - Availability: Unix. + .. availability:: Unix. .. function:: nice(increment) Add *increment* to the process's "niceness". Return the new niceness. - Availability: Unix. + .. availability:: Unix. .. function:: plock(op) @@ -3367,7 +3358,7 @@ written in Python, such as a mail server's external command delivery program. Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked. - Availability: Unix. + .. availability:: Unix. .. function:: popen(cmd, mode='r', buffering=-1) @@ -3496,7 +3487,7 @@ written in Python, such as a mail server's external command delivery program. There is no way to unregister a function. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -3560,10 +3551,10 @@ written in Python, such as a mail server's external command delivery program. L = ['cp', 'index.html', '/dev/null'] os.spawnvpe(os.P_WAIT, 'cp', L, os.environ) - Availability: Unix, Windows. :func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` - and :func:`spawnvpe` are not available on Windows. :func:`spawnle` and - :func:`spawnve` are not thread-safe on Windows; we advise you to use the - :mod:`subprocess` module instead. + .. availability:: Unix, Windows. :func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` + and :func:`spawnvpe` are not available on Windows. :func:`spawnle` and + :func:`spawnve` are not thread-safe on Windows; we advise you to use the + :mod:`subprocess` module instead. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -3577,7 +3568,7 @@ written in Python, such as a mail server's external command delivery program. will return as soon as the new process has been created, with the process id as the return value. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. data:: P_WAIT @@ -3588,7 +3579,7 @@ written in Python, such as a mail server's external command delivery program. of the process the run is successful, or ``-signal`` if a signal kills the process. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. data:: P_DETACH @@ -3600,7 +3591,7 @@ written in Python, such as a mail server's external command delivery program. console of the calling process. If :const:`P_OVERLAY` is used, the current process will be replaced; the :func:`spawn\* ` function will not return. - Availability: Windows. + .. availability:: Windows. .. function:: startfile(path[, operation]) @@ -3629,7 +3620,7 @@ written in Python, such as a mail server's external command delivery program. function is not resolved until this function is first called. If the function cannot be resolved, :exc:`NotImplementedError` will be raised. - Availability: Windows. + .. availability:: Windows. .. function:: system(command) @@ -3656,7 +3647,7 @@ 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. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: times() @@ -3679,7 +3670,7 @@ written in Python, such as a mail server's external command delivery program. On Windows, only :attr:`user` and :attr:`system` are known; the other attributes are zero. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.3 Return type changed from a tuple to a tuple-like object @@ -3694,7 +3685,7 @@ 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. - Availability: Unix. + .. availability:: Unix. .. function:: waitid(idtype, id, options) @@ -3709,7 +3700,7 @@ written in Python, such as a mail server's external command delivery program. :attr:`si_code` or ``None`` if :data:`WNOHANG` is specified and there are no children in a waitable state. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3720,7 +3711,7 @@ written in Python, such as a mail server's external command delivery program. These are the possible values for *idtype* in :func:`waitid`. They affect how *id* is interpreted. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3731,7 +3722,7 @@ written in Python, such as a mail server's external command delivery program. Flags that can be used in *options* in :func:`waitid` that specify what child signal to wait for. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3744,7 +3735,7 @@ written in Python, such as a mail server's external command delivery program. These are the possible values for :attr:`si_code` in the result returned by :func:`waitid`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3791,7 +3782,7 @@ written in Python, such as a mail server's external command delivery program. option argument is the same as that provided to :func:`waitpid` and :func:`wait4`. - Availability: Unix. + .. availability:: Unix. .. function:: wait4(pid, options) @@ -3802,7 +3793,7 @@ 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`. - Availability: Unix. + .. availability:: Unix. .. data:: WNOHANG @@ -3810,7 +3801,7 @@ written in Python, such as a mail server's external command delivery program. The option for :func:`waitpid` to return immediately if no child process status is available immediately. The function returns ``(0, 0)`` in this case. - Availability: Unix. + .. availability:: Unix. .. data:: WCONTINUED @@ -3818,7 +3809,7 @@ written in Python, such as a mail server's external command delivery program. This option causes child processes to be reported if they have been continued from a job control stop since their status was last reported. - Availability: some Unix systems. + .. availability:: some Unix systems. .. data:: WUNTRACED @@ -3826,7 +3817,7 @@ written in Python, such as a mail server's external command delivery program. This option causes child processes to be reported if they have been stopped but their current state has not been reported since they were stopped. - Availability: Unix. + .. availability:: Unix. The following functions take a process status code as returned by @@ -3838,7 +3829,7 @@ used to determine the disposition of a process. Return ``True`` if a core dump was generated for the process, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFCONTINUED(status) @@ -3846,7 +3837,7 @@ used to determine the disposition of a process. Return ``True`` if the process has been continued from a job control stop, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFSTOPPED(status) @@ -3854,7 +3845,7 @@ used to determine the disposition of a process. Return ``True`` if the process has been stopped, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFSIGNALED(status) @@ -3862,7 +3853,7 @@ used to determine the disposition of a process. Return ``True`` if the process exited due to a signal, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFEXITED(status) @@ -3870,7 +3861,7 @@ used to determine the disposition of a process. Return ``True`` if the process exited using the :manpage:`exit(2)` system call, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WEXITSTATUS(status) @@ -3878,21 +3869,21 @@ used to determine the disposition of a process. If ``WIFEXITED(status)`` is true, return the integer parameter to the :manpage:`exit(2)` system call. Otherwise, the return value is meaningless. - Availability: Unix. + .. availability:: Unix. .. function:: WSTOPSIG(status) Return the signal which caused the process to stop. - Availability: Unix. + .. availability:: Unix. .. function:: WTERMSIG(status) Return the signal which caused the process to exit. - Availability: Unix. + .. availability:: Unix. Interface to the scheduler @@ -4038,7 +4029,7 @@ Miscellaneous System Information included in ``confstr_names``, an :exc:`OSError` is raised with :const:`errno.EINVAL` for the error number. - Availability: Unix. + .. availability:: Unix. .. data:: confstr_names @@ -4047,7 +4038,7 @@ Miscellaneous System Information defined for those names by the host operating system. This can be used to determine the set of names known to the system. - Availability: Unix. + .. availability:: Unix. .. function:: cpu_count() @@ -4068,7 +4059,7 @@ Miscellaneous System Information 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was unobtainable. - Availability: Unix. + .. availability:: Unix. .. function:: sysconf(name) @@ -4078,7 +4069,7 @@ Miscellaneous System Information the *name* parameter for :func:`confstr` apply here as well; the dictionary that provides information on the known names is given by ``sysconf_names``. - Availability: Unix. + .. availability:: Unix. .. data:: sysconf_names @@ -4087,7 +4078,7 @@ Miscellaneous System Information defined for those names by the host operating system. This can be used to determine the set of names known to the system. - Availability: Unix. + .. availability:: Unix. The following data values are used to support path manipulation operations. These are defined for all platforms. @@ -4199,7 +4190,7 @@ Random numbers See also the `Linux getrandom() manual page `_. - Availability: Linux 3.17 and newer. + .. availability:: Linux 3.17 and newer. .. versionadded:: 3.6 diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst index bdfe5f6d4594..bd49c87f1d78 100644 --- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -92,7 +92,7 @@ this module for those platforms. :exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for the process. - Availability: Linux 2.6.36 or later with glibc 2.13 or later + .. availability:: Linux 2.6.36 or later with glibc 2.13 or later. .. versionadded:: 3.4 @@ -178,7 +178,7 @@ platform. The number of bytes that can be allocated for POSIX message queues. - Availability: Linux 2.6.8 or later. + .. availability:: Linux 2.6.8 or later. .. versionadded:: 3.4 @@ -187,7 +187,7 @@ platform. The ceiling for the process's nice level (calculated as 20 - rlim_cur). - Availability: Linux 2.6.12 or later. + .. availability:: Linux 2.6.12 or later. .. versionadded:: 3.4 @@ -196,7 +196,7 @@ platform. The ceiling of the real-time priority. - Availability: Linux 2.6.12 or later. + .. availability:: Linux 2.6.12 or later. .. versionadded:: 3.4 @@ -206,7 +206,7 @@ platform. The time limit (in microseconds) on CPU time that a process can spend under real-time scheduling without making a blocking syscall. - Availability: Linux 2.6.25 or later. + .. availability:: Linux 2.6.25 or later. .. versionadded:: 3.4 @@ -215,7 +215,7 @@ platform. The number of signals which the process may queue. - Availability: Linux 2.6.8 or later. + .. availability:: Linux 2.6.8 or later. .. versionadded:: 3.4 @@ -225,7 +225,7 @@ platform. This limits the amount of network memory, and hence the amount of mbufs, that this user may hold at any time. - Availability: FreeBSD 9 or later. + .. availability:: FreeBSD 9 or later. .. versionadded:: 3.4 @@ -236,7 +236,7 @@ platform. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. Please see :manpage:`tuning(7)` for a complete description of this sysctl. - Availability: FreeBSD 9 or later. + .. availability:: FreeBSD 9 or later. .. versionadded:: 3.4 @@ -244,7 +244,7 @@ platform. The maximum number of pseudo-terminals created by this user id. - Availability: FreeBSD 9 or later. + .. availability:: FreeBSD 9 or later. .. versionadded:: 3.4 diff --git a/Doc/library/select.rst b/Doc/library/select.rst index 8feedaa4770c..f5b25db774f6 100644 --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -171,7 +171,9 @@ The module defines the following: :func:`poll` or another interface in this module. This doesn't apply to other kind of file-like objects such as sockets. - This value is guaranteed by POSIX to be at least 512. Availability: Unix. + This value is guaranteed by POSIX to be at least 512. + + .. availability:: Unix .. versionadded:: 3.2 diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index d8826277a46c..6b4ce14b5da1 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -351,7 +351,7 @@ Directory and files operations .. versionchanged:: 3.8 On Windows, *path* can now be a file or directory. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: chown(path, user=None, group=None) @@ -362,7 +362,7 @@ Directory and files operations See also :func:`os.chown`, the underlying function. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index bf07559c3d27..5c48c88f08df 100644 --- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -106,7 +106,7 @@ The variables defined in the :mod:`signal` module are: The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal can only be used with :func:`os.kill`. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.2 @@ -116,7 +116,7 @@ The variables defined in the :mod:`signal` module are: The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This signal can only be used with :func:`os.kill`. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.2 @@ -193,7 +193,9 @@ The :mod:`signal` module defines the following functions: then the number of seconds before any previously set alarm was to have been delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is canceled. If the return value is zero, no alarm is currently scheduled. (See - the Unix man page :manpage:`alarm(2)`.) Availability: Unix. + the Unix man page :manpage:`alarm(2)`.) + + .. availability:: Unix. .. function:: getsignal(signalnum) @@ -252,8 +254,8 @@ The :mod:`signal` module defines the following functions: If *signalnum* is 0, then no signal is sent, but error checking is still performed; this can be used to check if the target thread is still running. - Availability: Unix (see the man page :manpage:`pthread_kill(3)` for further - information). + .. availability:: Unix (see the man page :manpage:`pthread_kill(3)` for further + information). See also :func:`os.kill`. @@ -283,8 +285,8 @@ The :mod:`signal` module defines the following functions: For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the signal mask of the calling thread. - Availability: Unix. See the man page :manpage:`sigprocmask(3)` and - :manpage:`pthread_sigmask(3)` for further information. + .. availability:: Unix. See the man page :manpage:`sigprocmask(3)` and + :manpage:`pthread_sigmask(3)` for further information. See also :func:`pause`, :func:`sigpending` and :func:`sigwait`. @@ -309,13 +311,16 @@ The :mod:`signal` module defines the following functions: The old values are returned as a tuple: (delay, interval). Attempting to pass an invalid interval timer will cause an - :exc:`ItimerError`. Availability: Unix. + :exc:`ItimerError`. + + .. availability:: Unix. .. function:: getitimer(which) Returns current value of a given interval timer specified by *which*. - Availability: Unix. + + .. availability:: Unix. .. function:: set_wakeup_fd(fd, *, warn_on_full_buffer=True) @@ -365,8 +370,10 @@ The :mod:`signal` module defines the following functions: Change system call restart behaviour: if *flag* is :const:`False`, system calls will be restarted when interrupted by signal *signalnum*, otherwise - system calls will be interrupted. Returns nothing. Availability: Unix (see - the man page :manpage:`siginterrupt(3)` for further information). + system calls will be interrupted. Returns nothing. + + .. availability:: Unix (see the man page :manpage:`siginterrupt(3)` + for further information). Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling @@ -405,8 +412,8 @@ The :mod:`signal` module defines the following functions: thread (i.e., the signals which have been raised while blocked). Return the set of the pending signals. - Availability: Unix (see the man page :manpage:`sigpending(2)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigpending(2)` for further + information). See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`. @@ -419,8 +426,8 @@ The :mod:`signal` module defines the following functions: signals specified in the signal set *sigset*. The function accepts the signal (removes it from the pending list of signals), and returns the signal number. - Availability: Unix (see the man page :manpage:`sigwait(3)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigwait(3)` for further + information). See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:`sigwaitinfo` and :func:`sigtimedwait`. @@ -444,8 +451,8 @@ The :mod:`signal` module defines the following functions: :attr:`si_errno`, :attr:`si_pid`, :attr:`si_uid`, :attr:`si_status`, :attr:`si_band`. - Availability: Unix (see the man page :manpage:`sigwaitinfo(2)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigwaitinfo(2)` for further + information). See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`. @@ -463,8 +470,8 @@ The :mod:`signal` module defines the following functions: specifying a timeout. If *timeout* is specified as :const:`0`, a poll is performed. Returns :const:`None` if a timeout occurs. - Availability: Unix (see the man page :manpage:`sigtimedwait(2)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigtimedwait(2)` for further + information). See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`. diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index bfb315f1875a..d466884d6135 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -161,7 +161,7 @@ created. Socket addresses are represented as follows: - *feat* and *mask* are unsigned 32bit integers. - Availability Linux 2.6.38, some algorithm types require more recent Kernels. + .. availability:: Linux 2.6.38, some algorithm types require more recent Kernels. .. versionadded:: 3.6 @@ -169,7 +169,7 @@ created. Socket addresses are represented as follows: their hosts. The sockets are represented as a ``(CID, port)`` tuple where the context ID or CID and port are integers. - Availability: Linux >= 4.8 QEMU >= 2.8 ESX >= 4.0 ESX Workstation >= 6.5 + .. availability:: Linux >= 4.8 QEMU >= 2.8 ESX >= 4.0 ESX Workstation >= 6.5. .. versionadded:: 3.7 @@ -313,7 +313,7 @@ Constants `Secure File Descriptor Handling `_ for a more thorough explanation. - Availability: Linux >= 2.6.27. + .. availability:: Linux >= 2.6.27. .. versionadded:: 3.2 @@ -361,7 +361,7 @@ Constants Many constants of these forms, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.6.25. + .. availability:: Linux >= 2.6.25. .. versionadded:: 3.3 @@ -372,7 +372,7 @@ Constants Broadcast manager constants, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.6.25. + .. availability:: Linux >= 2.6.25. .. versionadded:: 3.4 @@ -384,7 +384,7 @@ Constants This constant is documented in the Linux documentation. - Availability: Linux >= 3.6. + .. availability:: Linux >= 3.6. .. versionadded:: 3.5 @@ -393,7 +393,7 @@ Constants CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. ISO-TP constants, documented in the Linux documentation. - Availability: Linux >= 2.6.25 + .. availability:: Linux >= 2.6.25. .. versionadded:: 3.7 @@ -405,7 +405,7 @@ Constants Many constants of these forms, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.2. + .. availability:: Linux >= 2.2. .. data:: AF_RDS @@ -416,7 +416,7 @@ Constants Many constants of these forms, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.6.30. + .. availability:: Linux >= 2.6.30. .. versionadded:: 3.3 @@ -444,7 +444,7 @@ Constants Constants for Linux Kernel cryptography. - Availability: Linux >= 2.6.38. + .. availability:: Linux >= 2.6.38. .. versionadded:: 3.6 @@ -456,13 +456,13 @@ Constants Constants for Linux host/guest communication. - Availability: Linux >= 4.8. + .. availability:: Linux >= 4.8. .. versionadded:: 3.7 .. data:: AF_LINK - Availability: BSD, OSX. + .. availability:: BSD, OSX. .. versionadded:: 3.4 @@ -493,7 +493,7 @@ Constants Constant for Qualcomm's IPC router protocol, used to communicate with service providing remote processors. - Availability: Linux >= 4.7. + .. availability:: Linux >= 4.7. Functions ^^^^^^^^^ @@ -618,7 +618,7 @@ The following functions all create :ref:`socket objects `. Instantiate a socket from data obtained from the :meth:`socket.share` method. The socket is assumed to be in blocking mode. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.3 @@ -865,7 +865,7 @@ The :mod:`socket` module also offers various network-related services: both the value of *address_family* and the underlying implementation of :c:func:`inet_pton`. - Availability: Unix (maybe not all platforms), Windows. + .. availability:: Unix (maybe not all platforms), Windows. .. versionchanged:: 3.4 Windows support added @@ -885,7 +885,7 @@ The :mod:`socket` module also offers various network-related services: length for the specified address family, :exc:`ValueError` will be raised. :exc:`OSError` is raised for errors from the call to :func:`inet_ntop`. - Availability: Unix (maybe not all platforms), Windows. + .. availability:: Unix (maybe not all platforms), Windows. .. versionchanged:: 3.4 Windows support added @@ -911,7 +911,7 @@ The :mod:`socket` module also offers various network-related services: buffer. Raises :exc:`OverflowError` if *length* is outside the permissible range of values. - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -932,7 +932,7 @@ The :mod:`socket` module also offers various network-related services: amount of ancillary data that can be received, since additional data may be able to fit into the padding area. - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -957,7 +957,7 @@ The :mod:`socket` module also offers various network-related services: Set the machine's hostname to *name*. This will raise an :exc:`OSError` if you don't have enough rights. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -968,7 +968,7 @@ The :mod:`socket` module also offers various network-related services: (index int, name string) tuples. :exc:`OSError` if the system call fails. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -979,7 +979,7 @@ The :mod:`socket` module also offers various network-related services: interface name. :exc:`OSError` if no interface with the given name exists. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -990,7 +990,7 @@ The :mod:`socket` module also offers various network-related services: interface index number. :exc:`OSError` if no interface with the given index exists. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1317,7 +1317,7 @@ to sockets. fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) return msg, list(fds) - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -1359,7 +1359,7 @@ to sockets. >>> [b1, b2, b3] [bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')] - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -1463,7 +1463,7 @@ to sockets. def send_fds(sock, msg, fds): return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds))]) - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -1477,7 +1477,7 @@ to sockets. Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` socket. - Availability: Linux >= 2.6.38 + .. availability:: Linux >= 2.6.38. .. versionadded:: 3.6 @@ -1578,7 +1578,7 @@ to sockets. Once this method has been called, it is safe to close the socket since the operating system has already duplicated it for the target process. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.3 diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 9dadc58b650c..5b0ef2e1d361 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -328,7 +328,7 @@ Random generation See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for sources of entropy-gathering daemons. - Availability: not available with LibreSSL and OpenSSL > 1.1.0 + .. availability:: not available with LibreSSL and OpenSSL > 1.1.0. .. function:: RAND_add(bytes, entropy) @@ -460,8 +460,8 @@ Certificate handling * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath, * :attr:`openssl_capath` - hard coded path to a capath directory - Availability: LibreSSL ignores the environment vars - :attr:`openssl_cafile_env` and :attr:`openssl_capath_env` + .. availability:: LibreSSL ignores the environment vars + :attr:`openssl_cafile_env` and :attr:`openssl_capath_env`. .. versionadded:: 3.4 @@ -484,7 +484,7 @@ Certificate handling [(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}), (b'data...', 'x509_asn', True)] - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.4 @@ -499,7 +499,7 @@ Certificate handling :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.4 @@ -1610,7 +1610,7 @@ to speed up repeated connections from the same clients. 'strength_bits': 128, 'symmetric': 'aes-128-gcm'}] - Availability: OpenSSL 1.0.2+ + .. availability:: OpenSSL 1.0.2+. .. versionadded:: 3.6 diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index aa889ed00b03..8f4377bb526f 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1330,7 +1330,7 @@ handling consistency are valid for these functions. >>> subprocess.getstatusoutput('/bin/kill $$') (-15, '') - Availability: POSIX & Windows + .. availability:: POSIX & Windows. .. versionchanged:: 3.3.4 Windows support was added. @@ -1350,7 +1350,7 @@ handling consistency are valid for these functions. >>> subprocess.getoutput('ls /bin/ls') '/bin/ls' - Availability: POSIX & Windows + .. availability:: POSIX & Windows. .. versionchanged:: 3.3.4 Windows support added diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index cd43e541f13e..46d8db0230b8 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -161,7 +161,9 @@ always available. .. data:: dllhandle - Integer specifying the handle of the Python DLL. Availability: Windows. + Integer specifying the handle of the Python DLL. + + .. availability:: Windows. .. function:: displayhook(value) @@ -477,7 +479,7 @@ always available. Return the build time API version of Android as an integer. - Availability: Android. + .. availability:: Android. .. versionadded:: 3.7 @@ -501,7 +503,9 @@ always available. Return the current value of the flags that are used for :c:func:`dlopen` calls. Symbolic names for the flag values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. - :data:`os.RTLD_LAZY`). Availability: Unix. + :data:`os.RTLD_LAZY`). + + .. availability:: Unix. .. function:: getfilesystemencoding() @@ -669,7 +673,7 @@ always available. is being emulated for the process. It is intended for use in logging rather than for feature detection. - Availability: Windows. + .. availability:: Windows. .. versionchanged:: 3.2 Changed to a named tuple and added *service_pack_minor*, @@ -1094,7 +1098,7 @@ always available. can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`). - Availability: Unix. + .. availability:: Unix. .. function:: setprofile(profilefunc) @@ -1340,7 +1344,7 @@ always available. This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable before launching Python. - Availability: Windows + .. availability:: Windows. .. versionadded:: 3.6 See :pep:`529` for more details. @@ -1486,7 +1490,9 @@ always available. stored as string resource 1000 in the Python DLL. The value is normally the first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the - registry keys used by Python. Availability: Windows. + registry keys used by Python. + + .. availability:: Windows. .. data:: _xoptions diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index e6185c5b3a21..a9d5268dd2b8 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -100,7 +100,8 @@ This module defines the following functions: memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information). - Availability: Windows, systems with POSIX threads. + + .. availability:: Windows, systems with POSIX threads. This module also defines the following constant: diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 3eddc3f1ad3d..56f972c9d032 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -170,8 +170,8 @@ Functions Passing an invalid or expired *thread_id* may result in undefined behavior, such as segmentation fault. - Availability: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for - further information) + .. availability:: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for + further information). .. versionadded:: 3.7 @@ -180,7 +180,7 @@ Functions Return the resolution (precision) of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -190,7 +190,7 @@ Functions Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -199,7 +199,7 @@ Functions Similar to :func:`clock_gettime` but return time as nanoseconds. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -209,7 +209,7 @@ Functions Set the time of the specified clock *clk_id*. Currently, :data:`CLOCK_REALTIME` is the only accepted value for *clk_id*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -218,7 +218,7 @@ Functions Similar to :func:`clock_settime` but set time with nanoseconds. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -617,8 +617,8 @@ Functions returned value is undefined, so that only the difference between the results of consecutive calls in the same thread is valid. - Availability: Windows, Linux, Unix systems supporting - ``CLOCK_THREAD_CPUTIME_ID``. + .. availability:: Windows, Linux, Unix systems supporting + ``CLOCK_THREAD_CPUTIME_ID``. .. versionadded:: 3.7 @@ -647,7 +647,7 @@ Functions nonzero if there is a time, past, present or future when daylight saving time applies). - Availability: Unix. + .. availability:: Unix. .. note:: @@ -743,7 +743,7 @@ These constants are used as parameters for :func:`clock_getres` and have discontinuities if the time is changed using ``settimeofday()`` or similar. - Availability: Linux 2.6.39 or later. + .. availability:: Linux 2.6.39 or later. .. versionadded:: 3.7 @@ -754,7 +754,7 @@ These constants are used as parameters for :func:`clock_getres` and hardware source, and may give close to nanosecond resolution. ``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock. - Availability: Solaris. + .. availability:: Solaris. .. versionadded:: 3.3 @@ -764,7 +764,7 @@ These constants are used as parameters for :func:`clock_getres` and Clock that cannot be set and represents monotonic time since some unspecified starting point. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -783,7 +783,7 @@ These constants are used as parameters for :func:`clock_getres` and High-resolution per-process timer from the CPU. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -792,7 +792,7 @@ These constants are used as parameters for :func:`clock_getres` and High-resolution per-process timer from the CPU. - Availability: FreeBSD, NetBSD 7 or later, OpenBSD. + .. availability:: FreeBSD, NetBSD 7 or later, OpenBSD. .. versionadded:: 3.7 @@ -812,7 +812,7 @@ These constants are used as parameters for :func:`clock_getres` and suspended, providing accurate uptime measurement, both absolute and interval. - Availability: FreeBSD, OpenBSD 5.5 or later. + .. availability:: FreeBSD, OpenBSD 5.5 or later. .. versionadded:: 3.7 @@ -825,7 +825,7 @@ The following constant is the only parameter that can be sent to System-wide real-time clock. Setting this clock requires appropriate privileges. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 8036daa7d1de..132920f130ad 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -131,6 +131,25 @@ def run(self): return [pnode] +# Support for documenting platform availability + +class Availability(Directive): + + has_content = False + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = True + + def run(self): + pnode = nodes.paragraph(classes=['availability']) + n, m = self.state.inline_text(':ref:`Availability `: ', + self.lineno) + pnode.extend(n + m) + n, m = self.state.inline_text(self.arguments[0], self.lineno) + pnode.extend(n + m) + return [pnode] + + # Support for documenting decorators class PyDecoratorMixin(object): @@ -401,6 +420,7 @@ def setup(app): app.add_role('issue', issue_role) app.add_role('source', source_role) app.add_directive('impl-detail', ImplementationDetail) + app.add_directive('availability', Availability) app.add_directive('deprecated-removed', DeprecatedRemoved) app.add_builder(PydocTopicsBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py index 2c1816eedf92..a3024d6734d2 100755 --- a/Doc/tools/rstlint.py +++ b/Doc/tools/rstlint.py @@ -27,17 +27,18 @@ 'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning', # Sphinx and Python docs custom ones 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', - 'autoexception', 'autofunction', 'automethod', 'automodule', 'centered', - 'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember', - 'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar', - 'data', 'decorator', 'decoratormethod', 'deprecated-removed', - 'deprecated(?!-removed)', 'describe', 'directive', 'doctest', 'envvar', - 'event', 'exception', 'function', 'glossary', 'highlight', 'highlightlang', - 'impl-detail', 'index', 'literalinclude', 'method', 'miscnews', 'module', - 'moduleauthor', 'opcode', 'pdbcommand', 'productionlist', - 'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod', - 'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo', - 'todolist', 'versionadded', 'versionchanged' + 'autoexception', 'autofunction', 'automethod', 'automodule', + 'availability', 'centered', 'cfunction', 'class', 'classmethod', 'cmacro', + 'cmdoption', 'cmember', 'code-block', 'confval', 'cssclass', 'ctype', + 'currentmodule', 'cvar', 'data', 'decorator', 'decoratormethod', + 'deprecated-removed', 'deprecated(?!-removed)', 'describe', 'directive', + 'doctest', 'envvar', 'event', 'exception', 'function', 'glossary', + 'highlight', 'highlightlang', 'impl-detail', 'index', 'literalinclude', + 'method', 'miscnews', 'module', 'moduleauthor', 'opcode', 'pdbcommand', + 'productionlist', 'program', 'role', 'sectionauthor', 'seealso', + 'sourcecode', 'staticmethod', 'tabularcolumns', 'testcode', 'testoutput', + 'testsetup', 'toctree', 'todo', 'todolist', 'versionadded', + 'versionchanged' ] all_directives = '(' + '|'.join(directives) + ')' diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index b61df8a4b77d..bd3cdef57390 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -785,7 +785,7 @@ conflict. This may also be enabled at runtime with :func:`sys._enablelegacywindowsfsencoding()`. - Availability: Windows + .. availability:: Windows. .. versionadded:: 3.6 See :pep:`529` for more details. @@ -799,7 +799,7 @@ conflict. This variable is ignored if the standard streams are redirected (to files or pipes) rather than referring to console buffers. - Availability: Windows + .. availability:: Windows. .. versionadded:: 3.6 @@ -850,7 +850,7 @@ conflict. order to force the interpreter to use ``ASCII`` instead of ``UTF-8`` for system interfaces. - Availability: \*nix + .. availability:: \*nix. .. versionadded:: 3.7 See :pep:`538` for more details. @@ -911,7 +911,7 @@ conflict. Also available as the :option:`-X` ``utf8`` option. - Availability: \*nix + .. availability:: \*nix. .. versionadded:: 3.7 See :pep:`540` for more details. diff --git a/Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst b/Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst new file mode 100644 index 000000000000..0637dd66e42c --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst @@ -0,0 +1,2 @@ +Create availability directive for documentation. Original patch by Georg +Brandl. From webhook-mailer at python.org Fri Oct 12 12:01:08 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 12 Oct 2018 16:01:08 -0000 Subject: [Python-checkins] bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822) Message-ID: https://github.com/python/cpython/commit/dc0d571b6401527f236b0513f29847e2b9b8a188 commit: dc0d571b6401527f236b0513f29847e2b9b8a188 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-12T19:01:00+03:00 summary: bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822) files: M Lib/tkinter/__init__.py M Lib/tkinter/commondialog.py M Lib/tkinter/dialog.py M Lib/tkinter/dnd.py M Lib/tkinter/filedialog.py M Lib/tkinter/messagebox.py M Lib/tkinter/scrolledtext.py M Lib/tkinter/simpledialog.py diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 25f1ff41e4ee..fa015ff12e06 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -52,10 +52,12 @@ _magic_re = re.compile(r'([\\{}])') _space_re = re.compile(r'([\s])', re.ASCII) + def _join(value): """Internal function.""" return ' '.join(map(_stringify, value)) + def _stringify(value): """Internal function.""" if isinstance(value, (list, tuple)): @@ -80,6 +82,7 @@ def _stringify(value): value = '{%s}' % value return value + def _flatten(seq): """Internal function.""" res = () @@ -90,9 +93,11 @@ def _flatten(seq): res = res + (item,) return res + try: _flatten = _tkinter._flatten except AttributeError: pass + def _cnfmerge(cnfs): """Internal function.""" if isinstance(cnfs, dict): @@ -110,9 +115,11 @@ def _cnfmerge(cnfs): cnf[k] = v return cnf + try: _cnfmerge = _tkinter._cnfmerge except AttributeError: pass + def _splitdict(tk, v, cut_minus=True, conv=None): """Return a properly formatted dict built from Tcl list pairs. @@ -177,9 +184,11 @@ class EventType(str, enum.Enum): Activate = '36', Deactivate = '37', MouseWheel = '38', + def __str__(self): return self.name + class Event: """Container for the properties of an event. @@ -222,6 +231,7 @@ class Event: widget - widget in which the event occurred delta - delta of wheel movement (MouseWheel) """ + def __repr__(self): attrs = {k: v for k, v in self.__dict__.items() if v != '??'} if not self.char: @@ -260,9 +270,11 @@ def __repr__(self): ''.join(' %s=%s' % (k, attrs[k]) for k in keys if k in attrs) ) + _support_default_root = 1 _default_root = None + def NoDefaultRoot(): """Inhibit setting of default root window. @@ -275,10 +287,12 @@ def NoDefaultRoot(): _default_root = None del _default_root + def _tkerror(err): """Internal function.""" pass + def _exit(code=0): """Internal function. Calling it will raise the exception SystemExit.""" try: @@ -287,7 +301,10 @@ def _exit(code=0): pass raise SystemExit(code) + _varnum = 0 + + class Variable: """Class to define value holders for e.g. buttons. @@ -296,6 +313,7 @@ class Variable: _default = "" _tk = None _tclCommands = None + def __init__(self, master=None, value=None, name=None): """Construct a variable @@ -325,6 +343,7 @@ def __init__(self, master=None, value=None, name=None): self.initialize(value) elif not self._tk.getboolean(self._tk.call("info", "exists", self._name)): self.initialize(self._default) + def __del__(self): """Unset the variable in Tcl.""" if self._tk is None: @@ -336,13 +355,17 @@ def __del__(self): #print '- Tkinter: deleted command', name self._tk.deletecommand(name) self._tclCommands = None + def __str__(self): """Return the name of the variable in Tcl.""" return self._name + def set(self, value): """Set the variable to VALUE.""" return self._tk.globalsetvar(self._name, value) + initialize = set + def get(self): """Return value of variable.""" return self._tk.globalgetvar(self._name) @@ -464,9 +487,11 @@ def __eq__(self, other): return self.__class__.__name__ == other.__class__.__name__ \ and self._name == other._name + class StringVar(Variable): """Value holder for strings variables.""" _default = "" + def __init__(self, master=None, value=None, name=None): """Construct a string variable. @@ -486,9 +511,11 @@ def get(self): return value return str(value) + class IntVar(Variable): """Value holder for integer variables.""" _default = 0 + def __init__(self, master=None, value=None, name=None): """Construct an integer variable. @@ -509,9 +536,11 @@ def get(self): except (TypeError, TclError): return int(self._tk.getdouble(value)) + class DoubleVar(Variable): """Value holder for float variables.""" _default = 0.0 + def __init__(self, master=None, value=None, name=None): """Construct a float variable. @@ -528,9 +557,11 @@ def get(self): """Return the value of the variable as a float.""" return self._tk.getdouble(self._tk.globalgetvar(self._name)) + class BooleanVar(Variable): """Value holder for boolean variables.""" _default = False + def __init__(self, master=None, value=None, name=None): """Construct a boolean variable. @@ -546,6 +577,7 @@ def __init__(self, master=None, value=None, name=None): def set(self, value): """Set the variable to VALUE.""" return self._tk.globalsetvar(self._name, self._tk.getboolean(value)) + initialize = set def get(self): @@ -555,14 +587,17 @@ def get(self): except TclError: raise ValueError("invalid literal for getboolean()") + def mainloop(n=0): """Run the main loop of Tcl.""" _default_root.tk.mainloop(n) + getint = int getdouble = float + def getboolean(s): """Convert true and false to integer values 1 and 0.""" try: @@ -570,7 +605,9 @@ def getboolean(s): except TclError: raise ValueError("invalid literal for getboolean()") + # Methods defined on both toplevel and interior widgets + class Misc: """Internal class. @@ -581,6 +618,7 @@ class Misc: # XXX font command? _tclCommands = None + def destroy(self): """Internal function. @@ -591,6 +629,7 @@ def destroy(self): #print '- Tkinter: deleted command', name self.tk.deletecommand(name) self._tclCommands = None + def deletecommand(self, name): """Internal function. @@ -601,6 +640,7 @@ def deletecommand(self, name): self._tclCommands.remove(name) except ValueError: pass + def tk_strictMotif(self, boolean=None): """Set Tcl internal variable, whether the look and feel should adhere to Motif. @@ -610,9 +650,11 @@ def tk_strictMotif(self, boolean=None): Returns the set value.""" return self.tk.getboolean(self.tk.call( 'set', 'tk_strictMotif', boolean)) + def tk_bisque(self): """Change the color scheme to light brown as used in Tk 3.6 and before.""" self.tk.call('tk_bisque') + def tk_setPalette(self, *args, **kw): """Set a new color scheme for all widget elements. @@ -626,6 +668,7 @@ def tk_setPalette(self, *args, **kw): disabledForeground, insertBackground, troughColor.""" self.tk.call(('tk_setPalette',) + _flatten(args) + _flatten(list(kw.items()))) + def wait_variable(self, name='PY_VAR'): """Wait until the variable is modified. @@ -633,6 +676,7 @@ def wait_variable(self, name='PY_VAR'): BooleanVar must be given.""" self.tk.call('tkwait', 'variable', name) waitvar = wait_variable # XXX b/w compat + def wait_window(self, window=None): """Wait until a WIDGET is destroyed. @@ -640,6 +684,7 @@ def wait_window(self, window=None): if window is None: window = self self.tk.call('tkwait', 'window', window._w) + def wait_visibility(self, window=None): """Wait until the visibility of a WIDGET changes (e.g. it appears). @@ -648,9 +693,11 @@ def wait_visibility(self, window=None): if window is None: window = self self.tk.call('tkwait', 'visibility', window._w) + def setvar(self, name='PY_VAR', value='1'): """Set Tcl variable NAME to VALUE.""" self.tk.setvar(name, value) + def getvar(self, name='PY_VAR'): """Return value of Tcl variable NAME.""" return self.tk.getvar(name) @@ -682,11 +729,13 @@ def focus_set(self): the focus through the window manager.""" self.tk.call('focus', self._w) focus = focus_set # XXX b/w compat? + def focus_force(self): """Direct input focus to this widget even if the application does not have the focus. Use with caution!""" self.tk.call('focus', '-force', self._w) + def focus_get(self): """Return the widget which has currently the focus in the application. @@ -697,6 +746,7 @@ def focus_get(self): name = self.tk.call('focus') if name == 'none' or not name: return None return self._nametowidget(name) + def focus_displayof(self): """Return the widget which has currently the focus on the display where this widget is located. @@ -705,16 +755,19 @@ def focus_displayof(self): name = self.tk.call('focus', '-displayof', self._w) if name == 'none' or not name: return None return self._nametowidget(name) + def focus_lastfor(self): """Return the widget which would have the focus if top level for this widget gets the focus from the window manager.""" name = self.tk.call('focus', '-lastfor', self._w) if name == 'none' or not name: return None return self._nametowidget(name) + def tk_focusFollowsMouse(self): """The widget under mouse will get automatically focus. Can not be disabled easily.""" self.tk.call('tk_focusFollowsMouse') + def tk_focusNext(self): """Return the next widget in the focus order which follows widget which has currently the focus. @@ -727,11 +780,13 @@ def tk_focusNext(self): name = self.tk.call('tk_focusNext', self._w) if not name: return None return self._nametowidget(name) + def tk_focusPrev(self): """Return previous widget in the focus order. See tk_focusNext for details.""" name = self.tk.call('tk_focusPrev', self._w) if not name: return None return self._nametowidget(name) + def after(self, ms, func=None, *args): """Call function once after given time. @@ -755,6 +810,7 @@ def callit(): callit.__name__ = func.__name__ name = self._register(callit) return self.tk.call('after', ms, name) + def after_idle(self, func, *args): """Call FUNC once if the Tcl main loop has no event to process. @@ -762,6 +818,7 @@ def after_idle(self, func, *args): Return an identifier to cancel the scheduling with after_cancel.""" return self.after('idle', func, *args) + def after_cancel(self, id): """Cancel scheduling of function identified with ID. @@ -778,6 +835,7 @@ def after_cancel(self, id): except TclError: pass self.tk.call('after', 'cancel', id) + def bell(self, displayof=0): """Ring a display's bell.""" self.tk.call(('bell',) + self._displayof(displayof)) @@ -813,6 +871,7 @@ def clipboard_clear(self, **kw): argument specifies the target display.""" if 'displayof' not in kw: kw['displayof'] = self._w self.tk.call(('clipboard', 'clear') + self._options(kw)) + def clipboard_append(self, string, **kw): """Append STRING to the Tk clipboard. @@ -823,21 +882,25 @@ def clipboard_append(self, string, **kw): self.tk.call(('clipboard', 'append') + self._options(kw) + ('--', string)) # XXX grab current w/o window argument + def grab_current(self): """Return widget which has currently the grab in this application or None.""" name = self.tk.call('grab', 'current', self._w) if not name: return None return self._nametowidget(name) + def grab_release(self): """Release grab for this widget if currently set.""" self.tk.call('grab', 'release', self._w) + def grab_set(self): """Set grab for this widget. A grab directs all events to this and descendant widgets in the application.""" self.tk.call('grab', 'set', self._w) + def grab_set_global(self): """Set global grab for this widget. @@ -845,12 +908,14 @@ def grab_set_global(self): descendant widgets on the display. Use with caution - other applications do not get events anymore.""" self.tk.call('grab', 'set', '-global', self._w) + def grab_status(self): """Return None, "local" or "global" if this widget has no, a local or a global grab.""" status = self.tk.call('grab', 'status', self._w) if status == 'none': status = None return status + def option_add(self, pattern, value, priority = None): """Set a VALUE (second parameter) for an option PATTERN (first parameter). @@ -858,27 +923,32 @@ def option_add(self, pattern, value, priority = None): An optional third parameter gives the numeric priority (defaults to 80).""" self.tk.call('option', 'add', pattern, value, priority) + def option_clear(self): """Clear the option database. It will be reloaded if option_add is called.""" self.tk.call('option', 'clear') + def option_get(self, name, className): """Return the value for an option NAME for this widget with CLASSNAME. Values with higher priority override lower values.""" return self.tk.call('option', 'get', self._w, name, className) + def option_readfile(self, fileName, priority = None): """Read file FILENAME into the option database. An optional second parameter gives the numeric priority.""" self.tk.call('option', 'readfile', fileName, priority) + def selection_clear(self, **kw): """Clear the current X selection.""" if 'displayof' not in kw: kw['displayof'] = self._w self.tk.call(('selection', 'clear') + self._options(kw)) + def selection_get(self, **kw): """Return the contents of the current X selection. @@ -896,6 +966,7 @@ def selection_get(self, **kw): except TclError: del kw['type'] return self.tk.call(('selection', 'get') + self._options(kw)) + def selection_handle(self, command, **kw): """Specify a function COMMAND to call if the X selection owned by this widget is queried by another @@ -911,6 +982,7 @@ def selection_handle(self, command, **kw): name = self._register(command) self.tk.call(('selection', 'handle') + self._options(kw) + (self._w, name)) + def selection_own(self, **kw): """Become owner of X selection. @@ -918,6 +990,7 @@ def selection_own(self, **kw): the selection (default PRIMARY).""" self.tk.call(('selection', 'own') + self._options(kw) + (self._w,)) + def selection_own_get(self, **kw): """Return owner of X selection. @@ -929,29 +1002,37 @@ def selection_own_get(self, **kw): name = self.tk.call(('selection', 'own') + self._options(kw)) if not name: return None return self._nametowidget(name) + def send(self, interp, cmd, *args): """Send Tcl command CMD to different interpreter INTERP to be executed.""" return self.tk.call(('send', interp, cmd) + args) + def lower(self, belowThis=None): """Lower this widget in the stacking order.""" self.tk.call('lower', self._w, belowThis) + def tkraise(self, aboveThis=None): """Raise this widget in the stacking order.""" self.tk.call('raise', self._w, aboveThis) + lift = tkraise + def winfo_atom(self, name, displayof=0): """Return integer which represents atom NAME.""" args = ('winfo', 'atom') + self._displayof(displayof) + (name,) return self.tk.getint(self.tk.call(args)) + def winfo_atomname(self, id, displayof=0): """Return name of atom with identifier ID.""" args = ('winfo', 'atomname') \ + self._displayof(displayof) + (id,) return self.tk.call(args) + def winfo_cells(self): """Return number of cells in the colormap for this widget.""" return self.tk.getint( self.tk.call('winfo', 'cells', self._w)) + def winfo_children(self): """Return a list of all widgets which are children of this widget.""" result = [] @@ -968,10 +1049,12 @@ def winfo_children(self): def winfo_class(self): """Return window class name of this widget.""" return self.tk.call('winfo', 'class', self._w) + def winfo_colormapfull(self): """Return true if at the last color request the colormap was full.""" return self.tk.getboolean( self.tk.call('winfo', 'colormapfull', self._w)) + def winfo_containing(self, rootX, rootY, displayof=0): """Return the widget which is at the root coordinates ROOTX, ROOTY.""" args = ('winfo', 'containing') \ @@ -979,147 +1062,182 @@ def winfo_containing(self, rootX, rootY, displayof=0): name = self.tk.call(args) if not name: return None return self._nametowidget(name) + def winfo_depth(self): """Return the number of bits per pixel.""" return self.tk.getint(self.tk.call('winfo', 'depth', self._w)) + def winfo_exists(self): """Return true if this widget exists.""" return self.tk.getint( self.tk.call('winfo', 'exists', self._w)) + def winfo_fpixels(self, number): """Return the number of pixels for the given distance NUMBER (e.g. "3c") as float.""" return self.tk.getdouble(self.tk.call( 'winfo', 'fpixels', self._w, number)) + def winfo_geometry(self): """Return geometry string for this widget in the form "widthxheight+X+Y".""" return self.tk.call('winfo', 'geometry', self._w) + def winfo_height(self): """Return height of this widget.""" return self.tk.getint( self.tk.call('winfo', 'height', self._w)) + def winfo_id(self): """Return identifier ID for this widget.""" return int(self.tk.call('winfo', 'id', self._w), 0) + def winfo_interps(self, displayof=0): """Return the name of all Tcl interpreters for this display.""" args = ('winfo', 'interps') + self._displayof(displayof) return self.tk.splitlist(self.tk.call(args)) + def winfo_ismapped(self): """Return true if this widget is mapped.""" return self.tk.getint( self.tk.call('winfo', 'ismapped', self._w)) + def winfo_manager(self): """Return the window manager name for this widget.""" return self.tk.call('winfo', 'manager', self._w) + def winfo_name(self): """Return the name of this widget.""" return self.tk.call('winfo', 'name', self._w) + def winfo_parent(self): """Return the name of the parent of this widget.""" return self.tk.call('winfo', 'parent', self._w) + def winfo_pathname(self, id, displayof=0): """Return the pathname of the widget given by ID.""" args = ('winfo', 'pathname') \ + self._displayof(displayof) + (id,) return self.tk.call(args) + def winfo_pixels(self, number): """Rounded integer value of winfo_fpixels.""" return self.tk.getint( self.tk.call('winfo', 'pixels', self._w, number)) + def winfo_pointerx(self): """Return the x coordinate of the pointer on the root window.""" return self.tk.getint( self.tk.call('winfo', 'pointerx', self._w)) + def winfo_pointerxy(self): """Return a tuple of x and y coordinates of the pointer on the root window.""" return self._getints( self.tk.call('winfo', 'pointerxy', self._w)) + def winfo_pointery(self): """Return the y coordinate of the pointer on the root window.""" return self.tk.getint( self.tk.call('winfo', 'pointery', self._w)) + def winfo_reqheight(self): """Return requested height of this widget.""" return self.tk.getint( self.tk.call('winfo', 'reqheight', self._w)) + def winfo_reqwidth(self): """Return requested width of this widget.""" return self.tk.getint( self.tk.call('winfo', 'reqwidth', self._w)) + def winfo_rgb(self, color): """Return tuple of decimal values for red, green, blue for COLOR in this widget.""" return self._getints( self.tk.call('winfo', 'rgb', self._w, color)) + def winfo_rootx(self): """Return x coordinate of upper left corner of this widget on the root window.""" return self.tk.getint( self.tk.call('winfo', 'rootx', self._w)) + def winfo_rooty(self): """Return y coordinate of upper left corner of this widget on the root window.""" return self.tk.getint( self.tk.call('winfo', 'rooty', self._w)) + def winfo_screen(self): """Return the screen name of this widget.""" return self.tk.call('winfo', 'screen', self._w) + def winfo_screencells(self): """Return the number of the cells in the colormap of the screen of this widget.""" return self.tk.getint( self.tk.call('winfo', 'screencells', self._w)) + def winfo_screendepth(self): """Return the number of bits per pixel of the root window of the screen of this widget.""" return self.tk.getint( self.tk.call('winfo', 'screendepth', self._w)) + def winfo_screenheight(self): """Return the number of pixels of the height of the screen of this widget in pixel.""" return self.tk.getint( self.tk.call('winfo', 'screenheight', self._w)) + def winfo_screenmmheight(self): """Return the number of pixels of the height of the screen of this widget in mm.""" return self.tk.getint( self.tk.call('winfo', 'screenmmheight', self._w)) + def winfo_screenmmwidth(self): """Return the number of pixels of the width of the screen of this widget in mm.""" return self.tk.getint( self.tk.call('winfo', 'screenmmwidth', self._w)) + def winfo_screenvisual(self): """Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen.""" return self.tk.call('winfo', 'screenvisual', self._w) + def winfo_screenwidth(self): """Return the number of pixels of the width of the screen of this widget in pixel.""" return self.tk.getint( self.tk.call('winfo', 'screenwidth', self._w)) + def winfo_server(self): """Return information of the X-Server of the screen of this widget in the form "XmajorRminor vendor vendorVersion".""" return self.tk.call('winfo', 'server', self._w) + def winfo_toplevel(self): """Return the toplevel widget of this widget.""" return self._nametowidget(self.tk.call( 'winfo', 'toplevel', self._w)) + def winfo_viewable(self): """Return true if the widget and all its higher ancestors are mapped.""" return self.tk.getint( self.tk.call('winfo', 'viewable', self._w)) + def winfo_visual(self): """Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.""" return self.tk.call('winfo', 'visual', self._w) + def winfo_visualid(self): """Return the X identifier for the visual for this widget.""" return self.tk.call('winfo', 'visualid', self._w) + def winfo_visualsavailable(self, includeids=False): """Return a list of all visuals available for the screen of this widget. @@ -1130,56 +1248,68 @@ def winfo_visualsavailable(self, includeids=False): 'includeids' if includeids else None) data = [self.tk.splitlist(x) for x in self.tk.splitlist(data)] return [self.__winfo_parseitem(x) for x in data] + def __winfo_parseitem(self, t): """Internal function.""" return t[:1] + tuple(map(self.__winfo_getint, t[1:])) + def __winfo_getint(self, x): """Internal function.""" return int(x, 0) + def winfo_vrootheight(self): """Return the height of the virtual root window associated with this widget in pixels. If there is no virtual root window return the height of the screen.""" return self.tk.getint( self.tk.call('winfo', 'vrootheight', self._w)) + def winfo_vrootwidth(self): """Return the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.""" return self.tk.getint( self.tk.call('winfo', 'vrootwidth', self._w)) + def winfo_vrootx(self): """Return the x offset of the virtual root relative to the root window of the screen of this widget.""" return self.tk.getint( self.tk.call('winfo', 'vrootx', self._w)) + def winfo_vrooty(self): """Return the y offset of the virtual root relative to the root window of the screen of this widget.""" return self.tk.getint( self.tk.call('winfo', 'vrooty', self._w)) + def winfo_width(self): """Return the width of this widget.""" return self.tk.getint( self.tk.call('winfo', 'width', self._w)) + def winfo_x(self): """Return the x coordinate of the upper left corner of this widget in the parent.""" return self.tk.getint( self.tk.call('winfo', 'x', self._w)) + def winfo_y(self): """Return the y coordinate of the upper left corner of this widget in the parent.""" return self.tk.getint( self.tk.call('winfo', 'y', self._w)) + def update(self): """Enter event loop until all pending events have been processed by Tcl.""" self.tk.call('update') + def update_idletasks(self): """Enter event loop until all idle callbacks have been called. This will update the display of windows but not process events caused by the user.""" self.tk.call('update', 'idletasks') + def bindtags(self, tagList=None): """Set or get the list of bindtags for this widget. @@ -1192,6 +1322,7 @@ def bindtags(self, tagList=None): self.tk.call('bindtags', self._w)) else: self.tk.call('bindtags', self._w, tagList) + def _bind(self, what, sequence, func, add, needcleanup=1): """Internal function.""" if isinstance(func, str): @@ -1209,6 +1340,7 @@ def _bind(self, what, sequence, func, add, needcleanup=1): return self.tk.call(what + (sequence,)) else: return self.tk.splitlist(self.tk.call(what)) + def bind(self, sequence=None, func=None, add=None): """Bind to this widget at event SEQUENCE a call to function FUNC. @@ -1249,23 +1381,26 @@ def bind(self, sequence=None, func=None, add=None): of bound events are returned.""" return self._bind(('bind', self._w), sequence, func, add) + def unbind(self, sequence, funcid=None): """Unbind for this widget for event SEQUENCE the function identified with FUNCID.""" self.tk.call('bind', self._w, sequence, '') if funcid: self.deletecommand(funcid) + def bind_all(self, sequence=None, func=None, add=None): """Bind to all widgets at an event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.""" return self._bind(('bind', 'all'), sequence, func, add, 0) + def unbind_all(self, sequence): """Unbind for all widgets for event SEQUENCE all functions.""" self.tk.call('bind', 'all' , sequence, '') - def bind_class(self, className, sequence=None, func=None, add=None): + def bind_class(self, className, sequence=None, func=None, add=None): """Bind to widgets with bindtag CLASSNAME at event SEQUENCE a call of function FUNC. An additional boolean parameter ADD specifies whether FUNC will be @@ -1274,28 +1409,35 @@ def bind_class(self, className, sequence=None, func=None, add=None): the return value.""" return self._bind(('bind', className), sequence, func, add, 0) + def unbind_class(self, className, sequence): """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.""" self.tk.call('bind', className , sequence, '') + def mainloop(self, n=0): """Call the mainloop of Tk.""" self.tk.mainloop(n) + def quit(self): """Quit the Tcl interpreter. All widgets will be destroyed.""" self.tk.quit() + def _getints(self, string): """Internal function.""" if string: return tuple(map(self.tk.getint, self.tk.splitlist(string))) + def _getdoubles(self, string): """Internal function.""" if string: return tuple(map(self.tk.getdouble, self.tk.splitlist(string))) + def _getboolean(self, string): """Internal function.""" if string: return self.tk.getboolean(string) + def _displayof(self, displayof): """Internal function.""" if displayof: @@ -1303,6 +1445,7 @@ def _displayof(self, displayof): if displayof is None: return ('-displayof', self._w) return () + @property def _windowingsystem(self): """Internal function.""" @@ -1312,6 +1455,7 @@ def _windowingsystem(self): ws = self._root()._windowingsystem_cached = \ self.tk.call('tk', 'windowingsystem') return ws + def _options(self, cnf, kw = None): """Internal function.""" if kw: @@ -1337,6 +1481,7 @@ def _options(self, cnf, kw = None): v = ' '.join(nv) res = res + ('-'+k, v) return res + def nametowidget(self, name): """Return the Tkinter instance of a widget identified by its Tcl name NAME.""" @@ -1353,7 +1498,9 @@ def nametowidget(self, name): w = w.children[n] return w + _nametowidget = nametowidget + def _register(self, func, subst=None, needcleanup=1): """Return a newly created Tcl function. If this function is called, the Python function FUNC will @@ -1375,7 +1522,9 @@ def _register(self, func, subst=None, needcleanup=1): self._tclCommands = [] self._tclCommands.append(name) return name + register = _register + def _root(self): """Internal function.""" w = self @@ -1385,6 +1534,7 @@ def _root(self): '%s', '%t', '%w', '%x', '%y', '%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D') _subst_format_str = " ".join(_subst_format) + def _substitute(self, *args): """Internal function.""" if len(args) != len(self._subst_format): return args @@ -1445,6 +1595,7 @@ def getint_event(s): except (ValueError, TclError): e.delta = 0 return (e,) + def _report_exception(self): """Internal function.""" exc, val, tb = sys.exc_info() @@ -1475,6 +1626,7 @@ def _configure(self, cmd, cnf, kw): return self._getconfigure1(_flatten((self._w, cmd, '-'+cnf))) self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) # These used to be defined in Widget: + def configure(self, cnf=None, **kw): """Configure resources of a widget. @@ -1483,18 +1635,24 @@ def configure(self, cnf=None, **kw): the allowed keyword arguments call the method keys. """ return self._configure('configure', cnf, kw) + config = configure + def cget(self, key): """Return the resource value for a KEY given as string.""" return self.tk.call(self._w, 'cget', '-' + key) + __getitem__ = cget + def __setitem__(self, key, value): self.configure({key: value}) + def keys(self): """Return a list of all resource names of this widget.""" splitlist = self.tk.splitlist return [splitlist(x)[0][1:] for x in splitlist(self.tk.call(self._w, 'configure'))] + def __str__(self): """Return the window path name of this widget.""" return self._w @@ -1505,6 +1663,7 @@ def __repr__(self): # Pack methods that apply to the master _noarg_ = ['_noarg_'] + def pack_propagate(self, flag=_noarg_): """Set or get the status for propagation of geometry information. @@ -1517,14 +1676,18 @@ def pack_propagate(self, flag=_noarg_): 'pack', 'propagate', self._w)) else: self.tk.call('pack', 'propagate', self._w, flag) + propagate = pack_propagate + def pack_slaves(self): """Return a list of all slaves of this widget in its packing order.""" return [self._nametowidget(x) for x in self.tk.splitlist( self.tk.call('pack', 'slaves', self._w))] + slaves = pack_slaves + # Place method that applies to the master def place_slaves(self): """Return a list of all slaves of this widget @@ -1533,14 +1696,18 @@ def place_slaves(self): self.tk.splitlist( self.tk.call( 'place', 'slaves', self._w))] + # Grid methods that apply to the master + def grid_anchor(self, anchor=None): # new in Tk 8.5 """The anchor value controls how to place the grid within the master when no row/column has any weight. The default anchor is nw.""" self.tk.call('grid', 'anchor', self._w, anchor) + anchor = grid_anchor + def grid_bbox(self, column=None, row=None, col2=None, row2=None): """Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid. @@ -1559,6 +1726,7 @@ def grid_bbox(self, column=None, row=None, col2=None, row2=None): if col2 is not None and row2 is not None: args = args + (col2, row2) return self._getints(self.tk.call(*args)) or None + bbox = grid_bbox def _gridconvvalue(self, value): @@ -1603,7 +1771,9 @@ def grid_columnconfigure(self, index, cnf={}, **kw): weight (how much does additional space propagate to this column) and pad (how much space to let additionally).""" return self._grid_configure('columnconfigure', index, cnf, kw) + columnconfigure = grid_columnconfigure + def grid_location(self, x, y): """Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master @@ -1611,6 +1781,7 @@ def grid_location(self, x, y): return self._getints( self.tk.call( 'grid', 'location', self._w, x, y)) or None + def grid_propagate(self, flag=_noarg_): """Set or get the status for propagation of geometry information. @@ -1623,6 +1794,7 @@ def grid_propagate(self, flag=_noarg_): 'grid', 'propagate', self._w)) else: self.tk.call('grid', 'propagate', self._w, flag) + def grid_rowconfigure(self, index, cnf={}, **kw): """Configure row INDEX of a grid. @@ -1630,12 +1802,16 @@ def grid_rowconfigure(self, index, cnf={}, **kw): weight (how much does additional space propagate to this row) and pad (how much space to let additionally).""" return self._grid_configure('rowconfigure', index, cnf, kw) + rowconfigure = grid_rowconfigure + def grid_size(self): """Return a tuple of the number of column and rows in the grid.""" return self._getints( self.tk.call('grid', 'size', self._w)) or None + size = grid_size + def grid_slaves(self, row=None, column=None): """Return a list of all slaves of this widget in its packing order.""" @@ -1692,11 +1868,13 @@ def image_types(self): class CallWrapper: """Internal class. Stores function to call when some user defined Tcl function is called e.g. after an event occurred.""" + def __init__(self, func, subst, widget): """Store FUNC, SUBST and WIDGET as members.""" self.func = func self.subst = subst self.widget = widget + def __call__(self, *args): """Apply first function SUBST to arguments, than FUNC.""" try: @@ -1764,6 +1942,7 @@ def wm_aspect(self, self.tk.call('wm', 'aspect', self._w, minNumer, minDenom, maxNumer, maxDenom)) + aspect = wm_aspect def wm_attributes(self, *args): @@ -1786,13 +1965,16 @@ def wm_attributes(self, *args): """ args = ('wm', 'attributes', self._w) + args return self.tk.call(args) - attributes=wm_attributes + + attributes = wm_attributes def wm_client(self, name=None): """Store NAME in WM_CLIENT_MACHINE property of this widget. Return current value.""" return self.tk.call('wm', 'client', self._w, name) + client = wm_client + def wm_colormapwindows(self, *wlist): """Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their @@ -1805,24 +1987,32 @@ def wm_colormapwindows(self, *wlist): else: return [self._nametowidget(x) for x in self.tk.splitlist(self.tk.call(args))] + colormapwindows = wm_colormapwindows + def wm_command(self, value=None): """Store VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.""" return self.tk.call('wm', 'command', self._w, value) + command = wm_command + def wm_deiconify(self): """Deiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.""" return self.tk.call('wm', 'deiconify', self._w) + deiconify = wm_deiconify + def wm_focusmodel(self, model=None): """Set focus model to MODEL. "active" means that this widget will claim the focus itself, "passive" means that the window manager shall give the focus. Return current focus model if MODEL is None.""" return self.tk.call('wm', 'focusmodel', self._w, model) + focusmodel = wm_focusmodel + def wm_forget(self, window): # new in Tk 8.5 """The window will be unmapped from the screen and will no longer be managed by wm. toplevel windows will be treated like frame @@ -1830,16 +2020,22 @@ def wm_forget(self, window): # new in Tk 8.5 option configuration will be remembered and the menus will return once the widget is managed again.""" self.tk.call('wm', 'forget', window) + forget = wm_forget + def wm_frame(self): """Return identifier for decorative frame of this widget if present.""" return self.tk.call('wm', 'frame', self._w) + frame = wm_frame + def wm_geometry(self, newGeometry=None): """Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.""" return self.tk.call('wm', 'geometry', self._w, newGeometry) + geometry = wm_geometry + def wm_grid(self, baseWidth=None, baseHeight=None, widthInc=None, heightInc=None): @@ -1850,12 +2046,16 @@ def wm_grid(self, return self._getints(self.tk.call( 'wm', 'grid', self._w, baseWidth, baseHeight, widthInc, heightInc)) + grid = wm_grid + def wm_group(self, pathName=None): """Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.""" return self.tk.call('wm', 'group', self._w, pathName) + group = wm_group + def wm_iconbitmap(self, bitmap=None, default=None): """Set bitmap for the iconified widget to BITMAP. Return the bitmap if None is given. @@ -1869,21 +2069,29 @@ def wm_iconbitmap(self, bitmap=None, default=None): return self.tk.call('wm', 'iconbitmap', self._w, '-default', default) else: return self.tk.call('wm', 'iconbitmap', self._w, bitmap) + iconbitmap = wm_iconbitmap + def wm_iconify(self): """Display widget as icon.""" return self.tk.call('wm', 'iconify', self._w) + iconify = wm_iconify + def wm_iconmask(self, bitmap=None): """Set mask for the icon bitmap of this widget. Return the mask if None is given.""" return self.tk.call('wm', 'iconmask', self._w, bitmap) + iconmask = wm_iconmask + def wm_iconname(self, newName=None): """Set the name of the icon for this widget. Return the name if None is given.""" return self.tk.call('wm', 'iconname', self._w, newName) + iconname = wm_iconname + def wm_iconphoto(self, default=False, *args): # new in Tk 8.5 """Sets the titlebar icon for this window based on the named photo images passed through args. If default is True, this is applied to @@ -1908,51 +2116,67 @@ def wm_iconphoto(self, default=False, *args): # new in Tk 8.5 self.tk.call('wm', 'iconphoto', self._w, "-default", *args) else: self.tk.call('wm', 'iconphoto', self._w, *args) + iconphoto = wm_iconphoto + def wm_iconposition(self, x=None, y=None): """Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.""" return self._getints(self.tk.call( 'wm', 'iconposition', self._w, x, y)) + iconposition = wm_iconposition + def wm_iconwindow(self, pathName=None): """Set widget PATHNAME to be displayed instead of icon. Return the current value if None is given.""" return self.tk.call('wm', 'iconwindow', self._w, pathName) + iconwindow = wm_iconwindow + def wm_manage(self, widget): # new in Tk 8.5 """The widget specified will become a stand alone top-level window. The window will be decorated with the window managers title bar, etc.""" self.tk.call('wm', 'manage', widget) + manage = wm_manage + def wm_maxsize(self, width=None, height=None): """Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.""" return self._getints(self.tk.call( 'wm', 'maxsize', self._w, width, height)) + maxsize = wm_maxsize + def wm_minsize(self, width=None, height=None): """Set min WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.""" return self._getints(self.tk.call( 'wm', 'minsize', self._w, width, height)) + minsize = wm_minsize + def wm_overrideredirect(self, boolean=None): """Instruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.""" return self._getboolean(self.tk.call( 'wm', 'overrideredirect', self._w, boolean)) + overrideredirect = wm_overrideredirect + def wm_positionfrom(self, who=None): """Instruct the window manager that the position of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".""" return self.tk.call('wm', 'positionfrom', self._w, who) + positionfrom = wm_positionfrom + def wm_protocol(self, name=None, func=None): """Bind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be @@ -1963,36 +2187,49 @@ def wm_protocol(self, name=None, func=None): command = func return self.tk.call( 'wm', 'protocol', self._w, name, command) + protocol = wm_protocol + def wm_resizable(self, width=None, height=None): """Instruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.""" return self.tk.call('wm', 'resizable', self._w, width, height) + resizable = wm_resizable + def wm_sizefrom(self, who=None): """Instruct the window manager that the size of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".""" return self.tk.call('wm', 'sizefrom', self._w, who) + sizefrom = wm_sizefrom + def wm_state(self, newstate=None): """Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).""" return self.tk.call('wm', 'state', self._w, newstate) + state = wm_state + def wm_title(self, string=None): """Set the title of this widget.""" return self.tk.call('wm', 'title', self._w, string) + title = wm_title + def wm_transient(self, master=None): """Instruct the window manager that this widget is transient with regard to widget MASTER.""" return self.tk.call('wm', 'transient', self._w, master) + transient = wm_transient + def wm_withdraw(self): """Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.""" return self.tk.call('wm', 'withdraw', self._w) + withdraw = wm_withdraw @@ -2000,6 +2237,7 @@ class Tk(Misc, Wm): """Toplevel widget of Tk which represents mostly the main window of an application. It has an associated Tcl interpreter.""" _w = '.' + def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1, sync=0, use=None): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will @@ -2026,10 +2264,12 @@ def __init__(self, screenName=None, baseName=None, className='Tk', if not sys.flags.ignore_environment: # Issue #16248: Honor the -E flag to avoid code injection. self.readprofile(baseName, className) + def loadtk(self): if not self._tkloaded: self.tk.loadtk() self._loadtk() + def _loadtk(self): self._tkloaded = 1 global _default_root @@ -2055,6 +2295,7 @@ def _loadtk(self): if _support_default_root and not _default_root: _default_root = self self.protocol("WM_DELETE_WINDOW", self.destroy) + def destroy(self): """Destroy this and all descendants widgets. This will end the application of this Tcl interpreter.""" @@ -2064,6 +2305,7 @@ def destroy(self): global _default_root if _support_default_root and _default_root is self: _default_root = None + def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls exec on the contents of BASENAME.py and @@ -2085,6 +2327,7 @@ def readprofile(self, baseName, className): self.tk.call('source', base_tcl) if os.path.isfile(base_py): exec(open(base_py).read(), dir) + def report_callback_exception(self, exc, val, tb): """Report callback exception on sys.stderr. @@ -2096,6 +2339,7 @@ def report_callback_exception(self, exc, val, tb): sys.last_value = val sys.last_traceback = tb traceback.print_exception(exc, val, tb) + def __getattr__(self, attr): "Delegate attribute access to the interpreter object" return getattr(self.tk, attr) @@ -2118,10 +2362,12 @@ def __getattr__(self, attr): def Tcl(screenName=None, baseName=None, className='Tk', useTk=0): return Tk(screenName, baseName, className, useTk) + class Pack: """Geometry manager Pack. Base class to use the methods pack_* in every widget.""" + def pack_configure(self, cnf={}, **kw): """Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget @@ -2141,11 +2387,15 @@ def pack_configure(self, cnf={}, **kw): self.tk.call( ('pack', 'configure', self._w) + self._options(cnf, kw)) + pack = configure = config = pack_configure + def pack_forget(self): """Unmap this widget and do not use it for the packing order.""" self.tk.call('pack', 'forget', self._w) + forget = pack_forget + def pack_info(self): """Return information about the packing options for this widget.""" @@ -2153,14 +2403,17 @@ def pack_info(self): if 'in' in d: d['in'] = self.nametowidget(d['in']) return d + info = pack_info propagate = pack_propagate = Misc.pack_propagate slaves = pack_slaves = Misc.pack_slaves + class Place: """Geometry manager Place. Base class to use the methods place_* in every widget.""" + def place_configure(self, cnf={}, **kw): """Place a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed @@ -2186,11 +2439,15 @@ def place_configure(self, cnf={}, **kw): self.tk.call( ('place', 'configure', self._w) + self._options(cnf, kw)) + place = configure = config = place_configure + def place_forget(self): """Unmap this widget.""" self.tk.call('place', 'forget', self._w) + forget = place_forget + def place_info(self): """Return information about the placing options for this widget.""" @@ -2198,14 +2455,17 @@ def place_info(self): if 'in' in d: d['in'] = self.nametowidget(d['in']) return d + info = place_info slaves = place_slaves = Misc.place_slaves + class Grid: """Geometry manager Grid. Base class to use the methods grid_* in every widget.""" # Thanks to Masazumi Yoshikawa (yosikawa at isi.edu) + def grid_configure(self, cnf={}, **kw): """Position a widget in the parent widget in a grid. Use as options: column=number - use cell identified with given column (starting with 0) @@ -2224,16 +2484,21 @@ def grid_configure(self, cnf={}, **kw): self.tk.call( ('grid', 'configure', self._w) + self._options(cnf, kw)) + grid = configure = config = grid_configure bbox = grid_bbox = Misc.grid_bbox columnconfigure = grid_columnconfigure = Misc.grid_columnconfigure + def grid_forget(self): """Unmap this widget.""" self.tk.call('grid', 'forget', self._w) + forget = grid_forget + def grid_remove(self): """Unmap this widget but remember the grid options.""" self.tk.call('grid', 'remove', self._w) + def grid_info(self): """Return information about the options for positioning this widget in a grid.""" @@ -2241,6 +2506,7 @@ def grid_info(self): if 'in' in d: d['in'] = self.nametowidget(d['in']) return d + info = grid_info location = grid_location = Misc.grid_location propagate = grid_propagate = Misc.grid_propagate @@ -2248,8 +2514,10 @@ def grid_info(self): size = grid_size = Misc.grid_size slaves = grid_slaves = Misc.grid_slaves + class BaseWidget(Misc): """Internal class.""" + def _setup(self, master, cnf): """Internal function. Sets up information about children.""" if _support_default_root: @@ -2283,6 +2551,7 @@ def _setup(self, master, cnf): if self._name in self.master.children: self.master.children[self._name].destroy() self.master.children[self._name] = self + def __init__(self, master, widgetName, cnf={}, kw={}, extra=()): """Construct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.""" @@ -2299,6 +2568,7 @@ def __init__(self, master, widgetName, cnf={}, kw={}, extra=()): (widgetName, self._w) + extra + self._options(cnf)) for k, v in classes: k.configure(self, v) + def destroy(self): """Destroy this and all descendants widgets.""" for c in list(self.children.values()): c.destroy() @@ -2306,10 +2576,12 @@ def destroy(self): if self._name in self.master.children: del self.master.children[self._name] Misc.destroy(self) + def _do(self, name, args=()): # XXX Obsolete -- better use self.tk.call directly! return self.tk.call((self._w, name) + args) + class Widget(BaseWidget, Pack, Place, Grid): """Internal class. @@ -2317,8 +2589,10 @@ class Widget(BaseWidget, Pack, Place, Grid): Pack, Place or Grid.""" pass + class Toplevel(BaseWidget, Wm): """Toplevel widget, e.g. for dialogs.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a toplevel widget with the parent MASTER. @@ -2345,8 +2619,10 @@ def __init__(self, master=None, cnf={}, **kw): self.title(root.title()) self.protocol("WM_DELETE_WINDOW", self.destroy) + class Button(Widget): """Button widget.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a button widget with the parent MASTER. @@ -2390,8 +2666,10 @@ def invoke(self): """ return self.tk.call(self._w, 'invoke') + class Canvas(Widget, XView, YView): """Canvas widget to display graphical elements like lines or text.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a canvas widget with the parent MASTER. @@ -2403,46 +2681,57 @@ def __init__(self, master=None, cnf={}, **kw): state, takefocus, width, xscrollcommand, xscrollincrement, yscrollcommand, yscrollincrement.""" Widget.__init__(self, master, 'canvas', cnf, kw) + def addtag(self, *args): """Internal function.""" self.tk.call((self._w, 'addtag') + args) + def addtag_above(self, newtag, tagOrId): """Add tag NEWTAG to all items above TAGORID.""" self.addtag(newtag, 'above', tagOrId) + def addtag_all(self, newtag): """Add tag NEWTAG to all items.""" self.addtag(newtag, 'all') + def addtag_below(self, newtag, tagOrId): """Add tag NEWTAG to all items below TAGORID.""" self.addtag(newtag, 'below', tagOrId) + def addtag_closest(self, newtag, x, y, halo=None, start=None): """Add tag NEWTAG to item which is closest to pixel at X, Y. If several match take the top-most. All items closer than HALO are considered overlapping (all are closests). If START is specified the next below this tag is taken.""" self.addtag(newtag, 'closest', x, y, halo, start) + def addtag_enclosed(self, newtag, x1, y1, x2, y2): """Add tag NEWTAG to all items in the rectangle defined by X1,Y1,X2,Y2.""" self.addtag(newtag, 'enclosed', x1, y1, x2, y2) + def addtag_overlapping(self, newtag, x1, y1, x2, y2): """Add tag NEWTAG to all items which overlap the rectangle defined by X1,Y1,X2,Y2.""" self.addtag(newtag, 'overlapping', x1, y1, x2, y2) + def addtag_withtag(self, newtag, tagOrId): """Add tag NEWTAG to all items with TAGORID.""" self.addtag(newtag, 'withtag', tagOrId) + def bbox(self, *args): """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses all items with tags specified as arguments.""" return self._getints( self.tk.call((self._w, 'bbox') + args)) or None + def tag_unbind(self, tagOrId, sequence, funcid=None): """Unbind for all items with TAGORID for event SEQUENCE the function identified with FUNCID.""" self.tk.call(self._w, 'bind', tagOrId, sequence, '') if funcid: self.deletecommand(funcid) + def tag_bind(self, tagOrId, sequence=None, func=None, add=None): """Bind to all items with TAGORID at event SEQUENCE a call to function FUNC. @@ -2451,22 +2740,26 @@ def tag_bind(self, tagOrId, sequence=None, func=None, add=None): replace the previous function. See bind for the return value.""" return self._bind((self._w, 'bind', tagOrId), sequence, func, add) + def canvasx(self, screenx, gridspacing=None): """Return the canvas x coordinate of pixel position SCREENX rounded to nearest multiple of GRIDSPACING units.""" return self.tk.getdouble(self.tk.call( self._w, 'canvasx', screenx, gridspacing)) + def canvasy(self, screeny, gridspacing=None): """Return the canvas y coordinate of pixel position SCREENY rounded to nearest multiple of GRIDSPACING units.""" return self.tk.getdouble(self.tk.call( self._w, 'canvasy', screeny, gridspacing)) + def coords(self, *args): """Return a list of coordinates for the item given in ARGS.""" # XXX Should use _flatten on args return [self.tk.getdouble(x) for x in self.tk.splitlist( self.tk.call((self._w, 'coords') + args))] + def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={}) """Internal function.""" args = _flatten(args) @@ -2478,96 +2771,123 @@ def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={}) return self.tk.getint(self.tk.call( self._w, 'create', itemType, *(args + self._options(cnf, kw)))) + def create_arc(self, *args, **kw): """Create arc shaped region with coordinates x1,y1,x2,y2.""" return self._create('arc', args, kw) + def create_bitmap(self, *args, **kw): """Create bitmap with coordinates x1,y1.""" return self._create('bitmap', args, kw) + def create_image(self, *args, **kw): """Create image item with coordinates x1,y1.""" return self._create('image', args, kw) + def create_line(self, *args, **kw): """Create line with coordinates x1,y1,...,xn,yn.""" return self._create('line', args, kw) + def create_oval(self, *args, **kw): """Create oval with coordinates x1,y1,x2,y2.""" return self._create('oval', args, kw) + def create_polygon(self, *args, **kw): """Create polygon with coordinates x1,y1,...,xn,yn.""" return self._create('polygon', args, kw) + def create_rectangle(self, *args, **kw): """Create rectangle with coordinates x1,y1,x2,y2.""" return self._create('rectangle', args, kw) + def create_text(self, *args, **kw): """Create text with coordinates x1,y1.""" return self._create('text', args, kw) + def create_window(self, *args, **kw): """Create window with coordinates x1,y1,x2,y2.""" return self._create('window', args, kw) + def dchars(self, *args): """Delete characters of text items identified by tag or id in ARGS (possibly several times) from FIRST to LAST character (including).""" self.tk.call((self._w, 'dchars') + args) + def delete(self, *args): """Delete items identified by all tag or ids contained in ARGS.""" self.tk.call((self._w, 'delete') + args) + def dtag(self, *args): """Delete tag or id given as last arguments in ARGS from items identified by first argument in ARGS.""" self.tk.call((self._w, 'dtag') + args) + def find(self, *args): """Internal function.""" return self._getints( self.tk.call((self._w, 'find') + args)) or () + def find_above(self, tagOrId): """Return items above TAGORID.""" return self.find('above', tagOrId) + def find_all(self): """Return all items.""" return self.find('all') + def find_below(self, tagOrId): """Return all items below TAGORID.""" return self.find('below', tagOrId) + def find_closest(self, x, y, halo=None, start=None): """Return item which is closest to pixel at X, Y. If several match take the top-most. All items closer than HALO are considered overlapping (all are closest). If START is specified the next below this tag is taken.""" return self.find('closest', x, y, halo, start) + def find_enclosed(self, x1, y1, x2, y2): """Return all items in rectangle defined by X1,Y1,X2,Y2.""" return self.find('enclosed', x1, y1, x2, y2) + def find_overlapping(self, x1, y1, x2, y2): """Return all items which overlap the rectangle defined by X1,Y1,X2,Y2.""" return self.find('overlapping', x1, y1, x2, y2) + def find_withtag(self, tagOrId): """Return all items with TAGORID.""" return self.find('withtag', tagOrId) + def focus(self, *args): """Set focus to the first item specified in ARGS.""" return self.tk.call((self._w, 'focus') + args) + def gettags(self, *args): """Return tags associated with the first item specified in ARGS.""" return self.tk.splitlist( self.tk.call((self._w, 'gettags') + args)) + def icursor(self, *args): """Set cursor at position POS in the item identified by TAGORID. In ARGS TAGORID must be first.""" self.tk.call((self._w, 'icursor') + args) + def index(self, *args): """Return position of cursor as integer in item specified in ARGS.""" return self.tk.getint(self.tk.call((self._w, 'index') + args)) + def insert(self, *args): """Insert TEXT in item TAGORID at position POS. ARGS must be TAGORID POS TEXT.""" self.tk.call((self._w, 'insert') + args) + def itemcget(self, tagOrId, option): """Return the resource value for an OPTION for item TAGORID.""" return self.tk.call( (self._w, 'itemcget') + (tagOrId, '-'+option)) + def itemconfigure(self, tagOrId, cnf=None, **kw): """Configure resources of an item TAGORID. @@ -2576,7 +2896,9 @@ def itemconfigure(self, tagOrId, cnf=None, **kw): the allowed keyword arguments call the method without arguments. """ return self._configure(('itemconfigure', tagOrId), cnf, kw) + itemconfig = itemconfigure + # lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift, # so the preferred name for them is tag_lower, tag_raise # (similar to tag_bind, and similar to the Text widget); @@ -2585,10 +2907,13 @@ def tag_lower(self, *args): """Lower an item TAGORID given in ARGS (optional below another item).""" self.tk.call((self._w, 'lower') + args) + lower = tag_lower + def move(self, *args): """Move an item TAGORID given in ARGS.""" self.tk.call((self._w, 'move') + args) + def postscript(self, cnf={}, **kw): """Print the contents of the canvas to a postscript file. Valid options: colormap, colormode, file, fontmap, @@ -2596,43 +2921,56 @@ def postscript(self, cnf={}, **kw): rotate, width, x, y.""" return self.tk.call((self._w, 'postscript') + self._options(cnf, kw)) + def tag_raise(self, *args): """Raise an item TAGORID given in ARGS (optional above another item).""" self.tk.call((self._w, 'raise') + args) + lift = tkraise = tag_raise + def scale(self, *args): """Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.""" self.tk.call((self._w, 'scale') + args) + def scan_mark(self, x, y): """Remember the current X, Y coordinates.""" self.tk.call(self._w, 'scan', 'mark', x, y) + def scan_dragto(self, x, y, gain=10): """Adjust the view of the canvas to GAIN times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y, gain) + def select_adjust(self, tagOrId, index): """Adjust the end of the selection near the cursor of an item TAGORID to index.""" self.tk.call(self._w, 'select', 'adjust', tagOrId, index) + def select_clear(self): """Clear the selection if it is in this widget.""" self.tk.call(self._w, 'select', 'clear') + def select_from(self, tagOrId, index): """Set the fixed end of a selection in item TAGORID to INDEX.""" self.tk.call(self._w, 'select', 'from', tagOrId, index) + def select_item(self): """Return the item which has the selection.""" return self.tk.call(self._w, 'select', 'item') or None + def select_to(self, tagOrId, index): """Set the variable end of a selection in item TAGORID to INDEX.""" self.tk.call(self._w, 'select', 'to', tagOrId, index) + def type(self, tagOrId): """Return the type of the item TAGORID.""" return self.tk.call(self._w, 'type', tagOrId) or None + class Checkbutton(Widget): """Checkbutton widget which is either in on- or off-state.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a checkbutton widget with the parent MASTER. @@ -2644,24 +2982,31 @@ def __init__(self, master=None, cnf={}, **kw): selectcolor, selectimage, state, takefocus, text, textvariable, underline, variable, width, wraplength.""" Widget.__init__(self, master, 'checkbutton', cnf, kw) + def deselect(self): """Put the button in off-state.""" self.tk.call(self._w, 'deselect') + def flash(self): """Flash the button.""" self.tk.call(self._w, 'flash') + def invoke(self): """Toggle the button and invoke a command if given as resource.""" return self.tk.call(self._w, 'invoke') + def select(self): """Put the button in on-state.""" self.tk.call(self._w, 'select') + def toggle(self): """Toggle the button.""" self.tk.call(self._w, 'toggle') + class Entry(Widget, XView): """Entry widget which allows displaying simple text.""" + def __init__(self, master=None, cnf={}, **kw): """Construct an entry widget with the parent MASTER. @@ -2674,59 +3019,80 @@ def __init__(self, master=None, cnf={}, **kw): textvariable, validate, validatecommand, vcmd, width, xscrollcommand.""" Widget.__init__(self, master, 'entry', cnf, kw) + def delete(self, first, last=None): """Delete text from FIRST to LAST (not included).""" self.tk.call(self._w, 'delete', first, last) + def get(self): """Return the text.""" return self.tk.call(self._w, 'get') + def icursor(self, index): """Insert cursor at INDEX.""" self.tk.call(self._w, 'icursor', index) + def index(self, index): """Return position of cursor.""" return self.tk.getint(self.tk.call( self._w, 'index', index)) + def insert(self, index, string): """Insert STRING at INDEX.""" self.tk.call(self._w, 'insert', index, string) + def scan_mark(self, x): """Remember the current X, Y coordinates.""" self.tk.call(self._w, 'scan', 'mark', x) + def scan_dragto(self, x): """Adjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x) + def selection_adjust(self, index): """Adjust the end of the selection near the cursor to INDEX.""" self.tk.call(self._w, 'selection', 'adjust', index) + select_adjust = selection_adjust + def selection_clear(self): """Clear the selection if it is in this widget.""" self.tk.call(self._w, 'selection', 'clear') + select_clear = selection_clear + def selection_from(self, index): """Set the fixed end of a selection to INDEX.""" self.tk.call(self._w, 'selection', 'from', index) + select_from = selection_from + def selection_present(self): """Return True if there are characters selected in the entry, False otherwise.""" return self.tk.getboolean( self.tk.call(self._w, 'selection', 'present')) + select_present = selection_present + def selection_range(self, start, end): """Set the selection from START to END (not included).""" self.tk.call(self._w, 'selection', 'range', start, end) + select_range = selection_range + def selection_to(self, index): """Set the variable end of a selection to INDEX.""" self.tk.call(self._w, 'selection', 'to', index) + select_to = selection_to + class Frame(Widget): """Frame widget which may contain other widgets and can have a 3D border.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a frame widget with the parent MASTER. @@ -2743,8 +3109,10 @@ def __init__(self, master=None, cnf={}, **kw): del cnf['class'] Widget.__init__(self, master, 'frame', cnf, {}, extra) + class Label(Widget): """Label widget which can display text and bitmaps.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a label widget with the parent MASTER. @@ -2765,8 +3133,10 @@ def __init__(self, master=None, cnf={}, **kw): """ Widget.__init__(self, master, 'label', cnf, kw) + class Listbox(Widget, XView, YView): """Listbox widget which can display a list of strings.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a listbox widget with the parent MASTER. @@ -2776,19 +3146,24 @@ def __init__(self, master=None, cnf={}, **kw): selectborderwidth, selectforeground, selectmode, setgrid, takefocus, width, xscrollcommand, yscrollcommand, listvariable.""" Widget.__init__(self, master, 'listbox', cnf, kw) + def activate(self, index): """Activate item identified by INDEX.""" self.tk.call(self._w, 'activate', index) + def bbox(self, index): """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses the item identified by the given index.""" return self._getints(self.tk.call(self._w, 'bbox', index)) or None + def curselection(self): """Return the indices of currently selected item.""" return self._getints(self.tk.call(self._w, 'curselection')) or () + def delete(self, first, last=None): """Delete items from FIRST to LAST (included).""" self.tk.call(self._w, 'delete', first, last) + def get(self, first, last=None): """Get list of items from FIRST to LAST (included).""" if last is not None: @@ -2796,55 +3171,72 @@ def get(self, first, last=None): self._w, 'get', first, last)) else: return self.tk.call(self._w, 'get', first) + def index(self, index): """Return index of item identified with INDEX.""" i = self.tk.call(self._w, 'index', index) if i == 'none': return None return self.tk.getint(i) + def insert(self, index, *elements): """Insert ELEMENTS at INDEX.""" self.tk.call((self._w, 'insert', index) + elements) + def nearest(self, y): """Get index of item which is nearest to y coordinate Y.""" return self.tk.getint(self.tk.call( self._w, 'nearest', y)) + def scan_mark(self, x, y): """Remember the current X, Y coordinates.""" self.tk.call(self._w, 'scan', 'mark', x, y) + def scan_dragto(self, x, y): """Adjust the view of the listbox to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y) + def see(self, index): """Scroll such that INDEX is visible.""" self.tk.call(self._w, 'see', index) + def selection_anchor(self, index): """Set the fixed end oft the selection to INDEX.""" self.tk.call(self._w, 'selection', 'anchor', index) + select_anchor = selection_anchor + def selection_clear(self, first, last=None): """Clear the selection from FIRST to LAST (included).""" self.tk.call(self._w, 'selection', 'clear', first, last) + select_clear = selection_clear + def selection_includes(self, index): """Return 1 if INDEX is part of the selection.""" return self.tk.getboolean(self.tk.call( self._w, 'selection', 'includes', index)) + select_includes = selection_includes + def selection_set(self, first, last=None): """Set the selection from FIRST to LAST (included) without changing the currently selected elements.""" self.tk.call(self._w, 'selection', 'set', first, last) + select_set = selection_set + def size(self): """Return the number of elements in the listbox.""" return self.tk.getint(self.tk.call(self._w, 'size')) + def itemcget(self, index, option): """Return the resource value for an ITEM and an OPTION.""" return self.tk.call( (self._w, 'itemcget') + (index, '-'+option)) + def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an ITEM. @@ -2854,10 +3246,13 @@ def itemconfigure(self, index, cnf=None, **kw): Valid resource names: background, bg, foreground, fg, selectbackground, selectforeground.""" return self._configure(('itemconfigure', index), cnf, kw) + itemconfig = itemconfigure + class Menu(Widget): """Menu widget which allows displaying menu bars, pull-down menus and pop-up menus.""" + def __init__(self, master=None, cnf={}, **kw): """Construct menu widget with the parent MASTER. @@ -2866,50 +3261,65 @@ def __init__(self, master=None, cnf={}, **kw): disabledforeground, fg, font, foreground, postcommand, relief, selectcolor, takefocus, tearoff, tearoffcommand, title, type.""" Widget.__init__(self, master, 'menu', cnf, kw) + def tk_popup(self, x, y, entry=""): """Post the menu at position X,Y with entry ENTRY.""" self.tk.call('tk_popup', self._w, x, y, entry) + def activate(self, index): """Activate entry at INDEX.""" self.tk.call(self._w, 'activate', index) + def add(self, itemType, cnf={}, **kw): """Internal function.""" self.tk.call((self._w, 'add', itemType) + self._options(cnf, kw)) + def add_cascade(self, cnf={}, **kw): """Add hierarchical menu item.""" self.add('cascade', cnf or kw) + def add_checkbutton(self, cnf={}, **kw): """Add checkbutton menu item.""" self.add('checkbutton', cnf or kw) + def add_command(self, cnf={}, **kw): """Add command menu item.""" self.add('command', cnf or kw) + def add_radiobutton(self, cnf={}, **kw): """Addd radio menu item.""" self.add('radiobutton', cnf or kw) + def add_separator(self, cnf={}, **kw): """Add separator.""" self.add('separator', cnf or kw) + def insert(self, index, itemType, cnf={}, **kw): """Internal function.""" self.tk.call((self._w, 'insert', index, itemType) + self._options(cnf, kw)) + def insert_cascade(self, index, cnf={}, **kw): """Add hierarchical menu item at INDEX.""" self.insert(index, 'cascade', cnf or kw) + def insert_checkbutton(self, index, cnf={}, **kw): """Add checkbutton menu item at INDEX.""" self.insert(index, 'checkbutton', cnf or kw) + def insert_command(self, index, cnf={}, **kw): """Add command menu item at INDEX.""" self.insert(index, 'command', cnf or kw) + def insert_radiobutton(self, index, cnf={}, **kw): """Addd radio menu item at INDEX.""" self.insert(index, 'radiobutton', cnf or kw) + def insert_separator(self, index, cnf={}, **kw): """Add separator at INDEX.""" self.insert(index, 'separator', cnf or kw) + def delete(self, index1, index2=None): """Delete menu items between INDEX1 and INDEX2 (included).""" if index2 is None: @@ -2925,52 +3335,68 @@ def delete(self, index1, index2=None): if c: self.deletecommand(c) self.tk.call(self._w, 'delete', index1, index2) + def entrycget(self, index, option): """Return the resource value of a menu item for OPTION at INDEX.""" return self.tk.call(self._w, 'entrycget', index, '-' + option) + def entryconfigure(self, index, cnf=None, **kw): """Configure a menu item at INDEX.""" return self._configure(('entryconfigure', index), cnf, kw) + entryconfig = entryconfigure + def index(self, index): """Return the index of a menu item identified by INDEX.""" i = self.tk.call(self._w, 'index', index) if i == 'none': return None return self.tk.getint(i) + def invoke(self, index): """Invoke a menu item identified by INDEX and execute the associated command.""" return self.tk.call(self._w, 'invoke', index) + def post(self, x, y): """Display a menu at position X,Y.""" self.tk.call(self._w, 'post', x, y) + def type(self, index): """Return the type of the menu item at INDEX.""" return self.tk.call(self._w, 'type', index) + def unpost(self): """Unmap a menu.""" self.tk.call(self._w, 'unpost') + def xposition(self, index): # new in Tk 8.5 """Return the x-position of the leftmost pixel of the menu item at INDEX.""" return self.tk.getint(self.tk.call(self._w, 'xposition', index)) + def yposition(self, index): """Return the y-position of the topmost pixel of the menu item at INDEX.""" return self.tk.getint(self.tk.call( self._w, 'yposition', index)) + class Menubutton(Widget): """Menubutton widget, obsolete since Tk8.0.""" + def __init__(self, master=None, cnf={}, **kw): Widget.__init__(self, master, 'menubutton', cnf, kw) + class Message(Widget): """Message widget to display multiline text. Obsolete since Label does it too.""" + def __init__(self, master=None, cnf={}, **kw): Widget.__init__(self, master, 'message', cnf, kw) + class Radiobutton(Widget): """Radiobutton widget which shows only one of several buttons in on-state.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a radiobutton widget with the parent MASTER. @@ -2982,22 +3408,28 @@ def __init__(self, master=None, cnf={}, **kw): state, takefocus, text, textvariable, underline, value, variable, width, wraplength.""" Widget.__init__(self, master, 'radiobutton', cnf, kw) + def deselect(self): """Put the button in off-state.""" self.tk.call(self._w, 'deselect') + def flash(self): """Flash the button.""" self.tk.call(self._w, 'flash') + def invoke(self): """Toggle the button and invoke a command if given as resource.""" return self.tk.call(self._w, 'invoke') + def select(self): """Put the button in on-state.""" self.tk.call(self._w, 'select') + class Scale(Widget): """Scale widget which can display a numerical scale.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a scale widget with the parent MASTER. @@ -3008,6 +3440,7 @@ def __init__(self, master=None, cnf={}, **kw): showvalue, sliderlength, sliderrelief, state, takefocus, tickinterval, to, troughcolor, variable, width.""" Widget.__init__(self, master, 'scale', cnf, kw) + def get(self): """Get the current value as integer or float.""" value = self.tk.call(self._w, 'get') @@ -3015,22 +3448,27 @@ def get(self): return self.tk.getint(value) except (ValueError, TypeError, TclError): return self.tk.getdouble(value) + def set(self, value): """Set the value to VALUE.""" self.tk.call(self._w, 'set', value) + def coords(self, value=None): """Return a tuple (X,Y) of the point along the centerline of the trough that corresponds to VALUE or the current value if None is given.""" return self._getints(self.tk.call(self._w, 'coords', value)) + def identify(self, x, y): """Return where the point X,Y lies. Valid return values are "slider", "though1" and "though2".""" return self.tk.call(self._w, 'identify', x, y) + class Scrollbar(Widget): """Scrollbar widget which displays a slider at a certain position.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a scrollbar widget with the parent MASTER. @@ -3041,6 +3479,7 @@ def __init__(self, master=None, cnf={}, **kw): relief, repeatdelay, repeatinterval, takefocus, troughcolor, width.""" Widget.__init__(self, master, 'scrollbar', cnf, kw) + def activate(self, index=None): """Marks the element indicated by index as active. The only index values understood by this method are "arrow1", @@ -3049,32 +3488,37 @@ def activate(self, index=None): the method returns the name of the element that is currently active, or None if no element is active.""" return self.tk.call(self._w, 'activate', index) or None + def delta(self, deltax, deltay): """Return the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.""" return self.tk.getdouble( self.tk.call(self._w, 'delta', deltax, deltay)) + def fraction(self, x, y): """Return the fractional value which corresponds to a slider position of X,Y.""" return self.tk.getdouble(self.tk.call(self._w, 'fraction', x, y)) + def identify(self, x, y): """Return the element under position X,Y as one of "arrow1","slider","arrow2" or "".""" return self.tk.call(self._w, 'identify', x, y) + def get(self): """Return the current fractional values (upper and lower end) of the slider position.""" return self._getdoubles(self.tk.call(self._w, 'get')) + def set(self, first, last): """Set the fractional values of the slider position (upper and lower ends as value between 0 and 1).""" self.tk.call(self._w, 'set', first, last) - class Text(Widget, XView, YView): """Text widget which can display text in various forms.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a text widget with the parent MASTER. @@ -3099,16 +3543,19 @@ def __init__(self, master=None, cnf={}, **kw): """ Widget.__init__(self, master, 'text', cnf, kw) + def bbox(self, index): """Return a tuple of (x,y,width,height) which gives the bounding box of the visible part of the character at the given index.""" return self._getints( self.tk.call(self._w, 'bbox', index)) or None + def compare(self, index1, op, index2): """Return whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.""" return self.tk.getboolean(self.tk.call( self._w, 'compare', index1, op, index2)) + def count(self, index1, index2, *args): # new in Tk 8.5 """Counts the number of relevant things between the two indices. If index1 is after index2, the result will be a negative number @@ -3128,20 +3575,24 @@ def count(self, index1, index2, *args): # new in Tk 8.5 return (res, ) else: return res + def debug(self, boolean=None): """Turn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.""" if boolean is None: return self.tk.getboolean(self.tk.call(self._w, 'debug')) self.tk.call(self._w, 'debug', boolean) + def delete(self, index1, index2=None): """Delete the characters between INDEX1 and INDEX2 (not included).""" self.tk.call(self._w, 'delete', index1, index2) + def dlineinfo(self, index): """Return tuple (x,y,width,height,baseline) giving the bounding box and baseline position of the visible part of the line containing the character at INDEX.""" return self._getints(self.tk.call(self._w, 'dlineinfo', index)) + def dump(self, index1, index2=None, command=None, **kw): """Return the contents of the widget between index1 and index2. @@ -3245,6 +3696,7 @@ def get(self, index1, index2=None): """Return the text from INDEX1 to INDEX2 (not included).""" return self.tk.call(self._w, 'get', index1, index2) # (Image commands are new in 8.0) + def image_cget(self, index, option): """Return the value of OPTION of an embedded image at INDEX.""" if option[:1] != "-": @@ -3252,45 +3704,57 @@ def image_cget(self, index, option): if option[-1:] == "_": option = option[:-1] return self.tk.call(self._w, "image", "cget", index, option) + def image_configure(self, index, cnf=None, **kw): """Configure an embedded image at INDEX.""" return self._configure(('image', 'configure', index), cnf, kw) + def image_create(self, index, cnf={}, **kw): """Create an embedded image at INDEX.""" return self.tk.call( self._w, "image", "create", index, *self._options(cnf, kw)) + def image_names(self): """Return all names of embedded images in this widget.""" return self.tk.call(self._w, "image", "names") + def index(self, index): """Return the index in the form line.char for INDEX.""" return str(self.tk.call(self._w, 'index', index)) + def insert(self, index, chars, *args): """Insert CHARS before the characters at INDEX. An additional tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.""" self.tk.call((self._w, 'insert', index, chars) + args) + def mark_gravity(self, markName, direction=None): """Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT). Return the current value if None is given for DIRECTION.""" return self.tk.call( (self._w, 'mark', 'gravity', markName, direction)) + def mark_names(self): """Return all mark names.""" return self.tk.splitlist(self.tk.call( self._w, 'mark', 'names')) + def mark_set(self, markName, index): """Set mark MARKNAME before the character at INDEX.""" self.tk.call(self._w, 'mark', 'set', markName, index) + def mark_unset(self, *markNames): """Delete all marks in MARKNAMES.""" self.tk.call((self._w, 'mark', 'unset') + markNames) + def mark_next(self, index): """Return the name of the next mark after INDEX.""" return self.tk.call(self._w, 'mark', 'next', index) or None + def mark_previous(self, index): """Return the name of the previous mark before INDEX.""" return self.tk.call(self._w, 'mark', 'previous', index) or None + def peer_create(self, newPathName, cnf={}, **kw): # new in Tk 8.5 """Creates a peer text widget with the given newPathName, and any optional standard configuration options. By default the peer will @@ -3298,10 +3762,12 @@ def peer_create(self, newPathName, cnf={}, **kw): # new in Tk 8.5 these can be overridden with the standard configuration options.""" self.tk.call(self._w, 'peer', 'create', newPathName, *self._options(cnf, kw)) + def peer_names(self): # new in Tk 8.5 """Returns a list of peers of this widget (this does not include the widget itself).""" return self.tk.splitlist(self.tk.call(self._w, 'peer', 'names')) + def replace(self, index1, index2, chars, *args): # new in Tk 8.5 """Replaces the range of characters between index1 and index2 with the given characters and tags specified by args. @@ -3309,14 +3775,17 @@ def replace(self, index1, index2, chars, *args): # new in Tk 8.5 See the method insert for some more information about args, and the method delete for information about the indices.""" self.tk.call(self._w, 'replace', index1, index2, chars, *args) + def scan_mark(self, x, y): """Remember the current X, Y coordinates.""" self.tk.call(self._w, 'scan', 'mark', x, y) + def scan_dragto(self, x, y): """Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y) + def search(self, pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): @@ -3336,20 +3805,24 @@ def search(self, pattern, index, stopindex=None, args.append(index) if stopindex: args.append(stopindex) return str(self.tk.call(tuple(args))) + def see(self, index): """Scroll such that the character at INDEX is visible.""" self.tk.call(self._w, 'see', index) + def tag_add(self, tagName, index1, *args): """Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS. Additional pairs of indices may follow in ARGS.""" self.tk.call( (self._w, 'tag', 'add', tagName, index1) + args) + def tag_unbind(self, tagName, sequence, funcid=None): """Unbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.""" self.tk.call(self._w, 'tag', 'bind', tagName, sequence, '') if funcid: self.deletecommand(funcid) + def tag_bind(self, tagName, sequence, func, add=None): """Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC. @@ -3358,6 +3831,7 @@ def tag_bind(self, tagName, sequence, func, add=None): replace the previous function. See bind for the return value.""" return self._bind((self._w, 'tag', 'bind', tagName), sequence, func, add) + def tag_cget(self, tagName, option): """Return the value of OPTION for tag TAGNAME.""" if option[:1] != '-': @@ -3365,46 +3839,57 @@ def tag_cget(self, tagName, option): if option[-1:] == '_': option = option[:-1] return self.tk.call(self._w, 'tag', 'cget', tagName, option) + def tag_configure(self, tagName, cnf=None, **kw): """Configure a tag TAGNAME.""" return self._configure(('tag', 'configure', tagName), cnf, kw) + tag_config = tag_configure + def tag_delete(self, *tagNames): """Delete all tags in TAGNAMES.""" self.tk.call((self._w, 'tag', 'delete') + tagNames) + def tag_lower(self, tagName, belowThis=None): """Change the priority of tag TAGNAME such that it is lower than the priority of BELOWTHIS.""" self.tk.call(self._w, 'tag', 'lower', tagName, belowThis) + def tag_names(self, index=None): """Return a list of all tag names.""" return self.tk.splitlist( self.tk.call(self._w, 'tag', 'names', index)) + def tag_nextrange(self, tagName, index1, index2=None): """Return a list of start and end index for the first sequence of characters between INDEX1 and INDEX2 which all have tag TAGNAME. The text is searched forward from INDEX1.""" return self.tk.splitlist(self.tk.call( self._w, 'tag', 'nextrange', tagName, index1, index2)) + def tag_prevrange(self, tagName, index1, index2=None): """Return a list of start and end index for the first sequence of characters between INDEX1 and INDEX2 which all have tag TAGNAME. The text is searched backwards from INDEX1.""" return self.tk.splitlist(self.tk.call( self._w, 'tag', 'prevrange', tagName, index1, index2)) + def tag_raise(self, tagName, aboveThis=None): """Change the priority of tag TAGNAME such that it is higher than the priority of ABOVETHIS.""" self.tk.call( self._w, 'tag', 'raise', tagName, aboveThis) + def tag_ranges(self, tagName): """Return a list of ranges of text which have tag TAGNAME.""" return self.tk.splitlist(self.tk.call( self._w, 'tag', 'ranges', tagName)) + def tag_remove(self, tagName, index1, index2=None): """Remove tag TAGNAME from all characters between INDEX1 and INDEX2.""" self.tk.call( self._w, 'tag', 'remove', tagName, index1, index2) + def window_cget(self, index, option): """Return the value of OPTION of an embedded window at INDEX.""" if option[:1] != '-': @@ -3412,19 +3897,24 @@ def window_cget(self, index, option): if option[-1:] == '_': option = option[:-1] return self.tk.call(self._w, 'window', 'cget', index, option) + def window_configure(self, index, cnf=None, **kw): """Configure an embedded window at INDEX.""" return self._configure(('window', 'configure', index), cnf, kw) + window_config = window_configure + def window_create(self, index, cnf={}, **kw): """Create a window at INDEX.""" self.tk.call( (self._w, 'window', 'create', index) + self._options(cnf, kw)) + def window_names(self): """Return all names of embedded windows in this widget.""" return self.tk.splitlist( self.tk.call(self._w, 'window', 'names')) + def yview_pickplace(self, *what): """Obsolete function, use see.""" self.tk.call((self._w, 'yview', '-pickplace') + what) @@ -3432,17 +3922,21 @@ def yview_pickplace(self, *what): class _setit: """Internal class. It wraps the command in the widget OptionMenu.""" + def __init__(self, var, value, callback=None): self.__value = value self.__var = var self.__callback = callback + def __call__(self, *args): self.__var.set(self.__value) if self.__callback: self.__callback(self.__value, *args) + class OptionMenu(Menubutton): """OptionMenu which allows the user to select a value from a menu.""" + def __init__(self, master, variable, value, *values, **kwargs): """Construct an optionmenu widget with the parent MASTER, with the resource textvariable set to VARIABLE, the initially selected @@ -3478,9 +3972,11 @@ def destroy(self): Menubutton.destroy(self) self.__menu = None + class Image: """Base class for images.""" _last_id = 0 + def __init__(self, imgtype, name=None, cnf={}, master=None, **kw): self.name = None if not master: @@ -3500,7 +3996,9 @@ def __init__(self, imgtype, name=None, cnf={}, master=None, **kw): options = options + ('-'+k, v) self.tk.call(('image', 'create', imgtype, name,) + options) self.name = name + def __str__(self): return self.name + def __del__(self): if self.name: try: @@ -3508,10 +4006,13 @@ def __del__(self): except TclError: # May happen if the root was destroyed pass + def __setitem__(self, key, value): self.tk.call(self.name, 'configure', '-'+key, value) + def __getitem__(self, key): return self.tk.call(self.name, 'configure', '-'+key) + def configure(self, **kw): """Configure the image.""" res = () @@ -3522,42 +4023,53 @@ def configure(self, **kw): v = self._register(v) res = res + ('-'+k, v) self.tk.call((self.name, 'config') + res) + config = configure + def height(self): """Return the height of the image.""" return self.tk.getint( self.tk.call('image', 'height', self.name)) + def type(self): """Return the type of the image, e.g. "photo" or "bitmap".""" return self.tk.call('image', 'type', self.name) + def width(self): """Return the width of the image.""" return self.tk.getint( self.tk.call('image', 'width', self.name)) + class PhotoImage(Image): """Widget which can display images in PGM, PPM, GIF, PNG format.""" + def __init__(self, name=None, cnf={}, master=None, **kw): """Create an image with NAME. Valid resource names: data, format, file, gamma, height, palette, width.""" Image.__init__(self, 'photo', name, cnf, master, **kw) + def blank(self): """Display a transparent image.""" self.tk.call(self.name, 'blank') + def cget(self, option): """Return the value of OPTION.""" return self.tk.call(self.name, 'cget', '-' + option) # XXX config + def __getitem__(self, key): return self.tk.call(self.name, 'cget', '-' + key) # XXX copy -from, -to, ...? + def copy(self): """Return a new PhotoImage with the same image as this widget.""" destImage = PhotoImage(master=self.tk) self.tk.call(destImage, 'copy', self.name) return destImage + def zoom(self, x, y=''): """Return a new PhotoImage with the same image as this widget but zoom it with a factor of x in the X direction and y in the Y @@ -3567,6 +4079,7 @@ def zoom(self, x, y=''): if y=='': y=x self.tk.call(destImage, 'copy', self.name, '-zoom',x,y) return destImage + def subsample(self, x, y=''): """Return a new PhotoImage based on the same image as this widget but use only every Xth or Yth pixel. If y is not given, the @@ -3576,9 +4089,11 @@ def subsample(self, x, y=''): if y=='': y=x self.tk.call(destImage, 'copy', self.name, '-subsample',x,y) return destImage + def get(self, x, y): """Return the color (red, green, blue) of the pixel at X,Y.""" return self.tk.call(self.name, 'get', x, y) + def put(self, data, to=None): """Put row formatted colors to image starting from position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))""" @@ -3589,6 +4104,7 @@ def put(self, data, to=None): args = args + ('-to',) + tuple(to) self.tk.call(args) # XXX read + def write(self, filename, format=None, from_coords=None): """Write image to file FILENAME in FORMAT starting from position FROM_COORDS.""" @@ -3599,23 +4115,28 @@ def write(self, filename, format=None, from_coords=None): args = args + ('-from',) + tuple(from_coords) self.tk.call(args) + class BitmapImage(Image): """Widget which can display images in XBM format.""" + def __init__(self, name=None, cnf={}, master=None, **kw): """Create a bitmap with NAME. Valid resource names: background, data, file, foreground, maskdata, maskfile.""" Image.__init__(self, 'bitmap', name, cnf, master, **kw) + def image_names(): return _default_root.tk.splitlist(_default_root.tk.call('image', 'names')) + def image_types(): return _default_root.tk.splitlist(_default_root.tk.call('image', 'types')) class Spinbox(Widget, XView): """spinbox widget.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a spinbox widget with the parent MASTER. @@ -3790,8 +4311,10 @@ def selection_to(self, index): ########################################################################### + class LabelFrame(Widget): """labelframe widget.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a labelframe widget with the parent MASTER. @@ -3812,8 +4335,10 @@ def __init__(self, master=None, cnf={}, **kw): ######################################################################## + class PanedWindow(Widget): """panedwindow widget.""" + def __init__(self, master=None, cnf={}, **kw): """Construct a panedwindow widget with the parent MASTER. @@ -3846,7 +4371,8 @@ def remove(self, child): All geometry management options for child will be forgotten. """ self.tk.call(self._w, 'forget', child) - forget=remove + + forget = remove def identify(self, x, y): """Identify the panedwindow component at point x, y @@ -3994,6 +4520,7 @@ def paneconfigure(self, tagOrId, cnf=None, **kw): self._w, 'paneconfigure', tagOrId, '-'+cnf) self.tk.call((self._w, 'paneconfigure', tagOrId) + self._options(cnf, kw)) + paneconfig = paneconfigure def panes(self): @@ -4002,6 +4529,7 @@ def panes(self): # Test: + def _test(): root = Tk() text = "This is Tcl/Tk version %s" % TclVersion @@ -4022,5 +4550,6 @@ def _test(): root.deiconify() root.mainloop() + if __name__ == '__main__': _test() diff --git a/Lib/tkinter/commondialog.py b/Lib/tkinter/commondialog.py index 1e75cae689d4..c4ec010ee6b3 100644 --- a/Lib/tkinter/commondialog.py +++ b/Lib/tkinter/commondialog.py @@ -10,6 +10,7 @@ from tkinter import * + class Dialog: command = None diff --git a/Lib/tkinter/dialog.py b/Lib/tkinter/dialog.py index f61c5f7fa9ba..cb463f717c0e 100644 --- a/Lib/tkinter/dialog.py +++ b/Lib/tkinter/dialog.py @@ -19,8 +19,10 @@ def __init__(self, master=None, cnf={}, **kw): *cnf['strings'])) try: Widget.destroy(self) except TclError: pass + def destroy(self): pass + def _test(): d = Dialog(None, {'title': 'File Modified', 'text': diff --git a/Lib/tkinter/dnd.py b/Lib/tkinter/dnd.py index e0971a26adde..4de2331c8762 100644 --- a/Lib/tkinter/dnd.py +++ b/Lib/tkinter/dnd.py @@ -201,7 +201,6 @@ def finish(self, event, commit=0): source.dnd_end(target, event) - # ---------------------------------------------------------------------- # The rest is here for testing and demonstration purposes only! @@ -265,6 +264,7 @@ def where(self, canvas, event): def dnd_end(self, target, event): pass + class Tester: def __init__(self, root): @@ -299,6 +299,7 @@ def dnd_commit(self, source, event): x, y = source.where(self.canvas, event) source.attach(self.canvas, x, y) + def test(): root = tkinter.Tk() root.geometry("+1+1") @@ -317,5 +318,6 @@ def test(): i3.attach(t3.canvas) root.mainloop() + if __name__ == '__main__': test() diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py index a71afb25b9cd..d9d3436145c9 100644 --- a/Lib/tkinter/filedialog.py +++ b/Lib/tkinter/filedialog.py @@ -264,7 +264,6 @@ def ok_command(self): self.quit(file) - # For the following classes and modules: # # options (all have default values): @@ -341,6 +340,7 @@ def _fixresult(self, widget, result): return self._fixresult(widget, widget.tk.splitlist(result)) return _Dialog._fixresult(self, widget, result) + class SaveAs(_Dialog): "Ask for a filename to save as" @@ -369,16 +369,19 @@ def _fixresult(self, widget, result): # # convenience stuff + def askopenfilename(**options): "Ask for a filename to open" return Open(**options).show() + def asksaveasfilename(**options): "Ask for a filename to save as" return SaveAs(**options).show() + def askopenfilenames(**options): """Ask for multiple filenames to open @@ -390,6 +393,7 @@ def askopenfilenames(**options): # FIXME: are the following perhaps a bit too convenient? + def askopenfile(mode = "r", **options): "Ask for a filename to open, and returned the opened file" @@ -398,6 +402,7 @@ def askopenfile(mode = "r", **options): return open(filename, mode) return None + def askopenfiles(mode = "r", **options): """Ask for multiple filenames and return the open file objects @@ -423,12 +428,12 @@ def asksaveasfile(mode = "w", **options): return open(filename, mode) return None + def askdirectory (**options): "Ask for a directory, and return the file name" return Directory(**options).show() - # -------------------------------------------------------------------- # test stuff @@ -475,5 +480,6 @@ def test(): saveasfilename=asksaveasfilename() print("saveas", saveasfilename.encode(enc)) + if __name__ == '__main__': test() diff --git a/Lib/tkinter/messagebox.py b/Lib/tkinter/messagebox.py index 5c35d5adbaf8..4a711fa623b3 100644 --- a/Lib/tkinter/messagebox.py +++ b/Lib/tkinter/messagebox.py @@ -78,32 +78,39 @@ def _show(title=None, message=None, _icon=None, _type=None, **options): # In others we get a Tcl_Obj. return str(res) + def showinfo(title=None, message=None, **options): "Show an info message" return _show(title, message, INFO, OK, **options) + def showwarning(title=None, message=None, **options): "Show a warning message" return _show(title, message, WARNING, OK, **options) + def showerror(title=None, message=None, **options): "Show an error message" return _show(title, message, ERROR, OK, **options) + def askquestion(title=None, message=None, **options): "Ask a question" return _show(title, message, QUESTION, YESNO, **options) + def askokcancel(title=None, message=None, **options): "Ask if operation should proceed; return true if the answer is ok" s = _show(title, message, QUESTION, OKCANCEL, **options) return s == OK + def askyesno(title=None, message=None, **options): "Ask a question; return true if the answer is yes" s = _show(title, message, QUESTION, YESNO, **options) return s == YES + def askyesnocancel(title=None, message=None, **options): "Ask a question; return true if the answer is yes, None if cancelled." s = _show(title, message, QUESTION, YESNOCANCEL, **options) @@ -113,6 +120,7 @@ def askyesnocancel(title=None, message=None, **options): return None return s == YES + def askretrycancel(title=None, message=None, **options): "Ask if operation should be retried; return true if the answer is yes" s = _show(title, message, WARNING, RETRYCANCEL, **options) diff --git a/Lib/tkinter/scrolledtext.py b/Lib/tkinter/scrolledtext.py index 9aa936ae9492..749a06a6f00f 100644 --- a/Lib/tkinter/scrolledtext.py +++ b/Lib/tkinter/scrolledtext.py @@ -16,6 +16,7 @@ from tkinter import Frame, Text, Scrollbar, Pack, Grid, Place from tkinter.constants import RIGHT, LEFT, Y, BOTH + class ScrolledText(Text): def __init__(self, master=None, **kw): self.frame = Frame(master) @@ -50,5 +51,6 @@ def example(): stext.focus_set() stext.mainloop() + if __name__ == "__main__": example() diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py index a95f5516c901..85244171117b 100644 --- a/Lib/tkinter/simpledialog.py +++ b/Lib/tkinter/simpledialog.py @@ -28,6 +28,7 @@ import tkinter # used at _QueryDialog for tkinter._default_root + class SimpleDialog: def __init__(self, master, @@ -119,7 +120,6 @@ class Dialog(Toplevel): ''' def __init__(self, parent, title = None): - '''Initialize a dialog. Arguments: @@ -324,9 +324,11 @@ def validate(self): class _QueryInteger(_QueryDialog): errormessage = "Not an integer." + def getresult(self): return self.getint(self.entry.get()) + def askinteger(title, prompt, **kw): '''get an integer from the user @@ -341,11 +343,14 @@ def askinteger(title, prompt, **kw): d = _QueryInteger(title, prompt, **kw) return d.result + class _QueryFloat(_QueryDialog): errormessage = "Not a floating point value." + def getresult(self): return self.getdouble(self.entry.get()) + def askfloat(title, prompt, **kw): '''get a float from the user @@ -360,6 +365,7 @@ def askfloat(title, prompt, **kw): d = _QueryFloat(title, prompt, **kw) return d.result + class _QueryString(_QueryDialog): def __init__(self, *args, **kw): if "show" in kw: @@ -378,6 +384,7 @@ def body(self, master): def getresult(self): return self.entry.get() + def askstring(title, prompt, **kw): '''get a string from the user @@ -393,7 +400,6 @@ def askstring(title, prompt, **kw): return d.result - if __name__ == '__main__': def test(): From webhook-mailer at python.org Fri Oct 12 12:44:14 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 12 Oct 2018 16:44:14 -0000 Subject: [Python-checkins] bpo-23831: Add moveto method to the tkinter.Canvas widget. (GH-9768) Message-ID: https://github.com/python/cpython/commit/bf034715db9d6e1603ea432d40041e5577ed3332 commit: bf034715db9d6e1603ea432d40041e5577ed3332 branch: master author: Juliette Monsel committer: Serhiy Storchaka date: 2018-10-12T19:44:10+03:00 summary: bpo-23831: Add moveto method to the tkinter.Canvas widget. (GH-9768) files: A Misc/NEWS.d/next/Library/2018-10-09-15-44-04.bpo-23831.2CL7lL.rst M Doc/whatsnew/3.8.rst M Lib/tkinter/__init__.py M Lib/tkinter/test/test_tkinter/test_widgets.py diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index d9c3f1bd7dd6..bd3283caadb8 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -177,6 +177,10 @@ Added methods :meth:`~tkinter.Spinbox.selection_from`, in the :class:`tkinter.Spinbox` class. (Contributed by Juliette Monsel in :issue:`34829`.) +Added method :meth:`~tkinter.Canvas.moveto` +in the :class:`tkinter.Canvas` class. +(Contributed by Juliette Monsel in :issue:`23831`.) + venv ---- diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index fa015ff12e06..1dc411884511 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -2914,6 +2914,15 @@ def move(self, *args): """Move an item TAGORID given in ARGS.""" self.tk.call((self._w, 'move') + args) + def moveto(self, tagOrId, x='', y=''): + """Move the items given by TAGORID in the canvas coordinate + space so that the first coordinate pair of the bottommost + item with tag TAGORID is located at position (X,Y). + X and Y may be the empty string, in which case the + corresponding coordinate will be unchanged. All items matching + TAGORID remain in the same positions relative to each other.""" + self.tk.call(self._w, 'moveto', tagOrId, x, y) + def postscript(self, cnf={}, **kw): """Print the contents of the canvas to a postscript file. Valid options: colormap, colormode, file, fontmap, diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index c068a9de2d77..12a0fbeeeee1 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -745,6 +745,29 @@ def test_yscrollincrement(self): self.checkPixelsParam(widget, 'yscrollincrement', 10, 0, 11.2, 13.6, -10, '0.1i') + @requires_tcl(8, 6) + def test_moveto(self): + widget = self.create() + i1 = widget.create_rectangle(1, 1, 20, 20, tags='group') + i2 = widget.create_rectangle(30, 30, 50, 70, tags='group') + x1, y1, _, _ = widget.bbox(i1) + x2, y2, _, _ = widget.bbox(i2) + widget.moveto('group', 200, 100) + x1_2, y1_2, _, _ = widget.bbox(i1) + x2_2, y2_2, _, _ = widget.bbox(i2) + self.assertEqual(x1_2, 200) + self.assertEqual(y1_2, 100) + self.assertEqual(x2 - x1, x2_2 - x1_2) + self.assertEqual(y2 - y1, y2_2 - y1_2) + widget.tag_lower(i2, i1) + widget.moveto('group', y=50) + x1_3, y1_3, _, _ = widget.bbox(i1) + x2_3, y2_3, _, _ = widget.bbox(i2) + self.assertEqual(y2_3, 50) + self.assertEqual(x2_3, x2_2) + self.assertEqual(x2_2 - x1_2, x2_3 - x1_3) + self.assertEqual(y2_2 - y1_2, y2_3 - y1_3) + @add_standard_options(IntegerSizeTests, StandardOptionsTests) class ListboxTest(AbstractWidgetTest, unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-09-15-44-04.bpo-23831.2CL7lL.rst b/Misc/NEWS.d/next/Library/2018-10-09-15-44-04.bpo-23831.2CL7lL.rst new file mode 100644 index 000000000000..de12407b4ffe --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-15-44-04.bpo-23831.2CL7lL.rst @@ -0,0 +1,2 @@ +Add ``moveto()`` method to the ``tkinter.Canvas`` widget. Patch by Juliette +Monsel. From webhook-mailer at python.org Fri Oct 12 13:23:42 2018 From: webhook-mailer at python.org (Julien Palard) Date: Fri, 12 Oct 2018 17:23:42 -0000 Subject: [Python-checkins] Pin again sphinx version as stated in the comment. (GH-9824) Message-ID: https://github.com/python/cpython/commit/17775ae4633ca79468a1f72e92e13a775f1242ca commit: 17775ae4633ca79468a1f72e92e13a775f1242ca branch: master author: Julien Palard committer: GitHub date: 2018-10-12T19:23:37+02:00 summary: Pin again sphinx version as stated in the comment. (GH-9824) files: M .travis.yml diff --git a/.travis.yml b/.travis.yml index 19be17e2f25e..16b9746feeb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,7 @@ matrix: # Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures. # (Updating the version is fine as long as no warnings are raised by doing so.) # The theme used by the docs is stored separately, so we need to install that as well. - - python -m pip install sphinx blurb python-docs-theme + - python -m pip install sphinx==1.8.1 blurb python-docs-theme script: - make check suspicious html SPHINXOPTS="-q -W -j4" - os: osx From eric at trueblade.com Fri Oct 12 20:05:33 2018 From: eric at trueblade.com (Eric V. Smith) Date: Fri, 12 Oct 2018 20:05:33 -0400 Subject: [Python-checkins] [Python-Dev] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) In-Reply-To: References: <42Wj0P517lzFrcx@mail.python.org> <125297d6-545f-3052-0900-9df2072f0057@trueblade.com> Message-ID: <9C0147D2-E70D-4C08-93C3-D40DF4DB51C6@trueblade.com> > On Oct 12, 2018, at 7:03 PM, Martin Panter wrote: > >> On 12/10/2018, Eric V. Smith wrote: >>> On 10/12/2018 5:17 AM, Tal Einat wrote: >>> >>> The latest stable releases can always be found on the `Python download page >>> -`_. There are two recommended production-ready >>> -versions at this point in time, because at the moment there are two branches of >>> -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since >>> -currently there is more third party software available for Python 2 than for >>> -Python 3. Python 2 code will generally not run unchanged in Python 3. >>> +`_. There are two production-ready version >>> +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. >> >> This should be "time", not "times". I'd fix it, but I'm unsure if this >> is being backported or not, and I don't want to mess up any merges >> before they're done. > > Or just remove ?at this time[s]?; it doesn?t add much. > > Also, ?two . . . version? should be changed back to plural: ?two . . . > versions?. See https://github.com/python/cpython/pull/9821 for some updates. Eric > >> I do think this should backported to 3.7, 3.6, and 2.7. >> >>> +Although Python 2.x is still widely used, `it will not be >>> +maintained after January 1, 2020 >>> `_. >>> +Python 2.x was known for having more third-party libraries available, >>> however, >>> +by the time of this writing, most of the widely used libraries support >>> Python 3.x, >> >> Should probably be "at the time of this writing". >> >>> +and some are even dropping the Python 2.x support. >> >> And this would read better as "are even dropping support for Python 2.x". > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/eric%2Ba-python-dev%40trueblade.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From webhook-mailer at python.org Fri Oct 12 23:54:24 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 13 Oct 2018 03:54:24 -0000 Subject: [Python-checkins] bpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831) Message-ID: https://github.com/python/cpython/commit/f6c29a65e2a6da5c0014c868cf963c975b74e72b commit: f6c29a65e2a6da5c0014c868cf963c975b74e72b branch: master author: Ned Deily committer: GitHub date: 2018-10-12T23:54:20-04:00 summary: bpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831) With macOS framework builds, test case test_nonexisting_script in test_nonexisting_script fails because the test case assumes that the file name in sys.executable will appear in the error message. For macOS framework builds, sys.executable is the file name of the stub launcher and its file name bears no relationship to the file name of the actual python executable. For now, skip the test in this case. files: M Lib/test/test_cmd_line_script.py diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 2595ca98c7ad..4f5af3754418 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -630,9 +630,13 @@ def test_consistent_sys_path_for_module_execution(self): traceback_lines = stderr.decode().splitlines() self.assertIn("No module named script_pkg", traceback_lines[-1]) + @unittest.skipIf(sys.platform == 'darwin' and sys._framework, + "test not valid for macOS framework builds") def test_nonexisting_script(self): # bpo-34783: "./python script.py" must not crash # if the script file doesn't exist. + # (Skip test for macOS framework builds because sys.excutable name + # is not the actual Python executable file name. script = 'nonexistingscript.py' self.assertFalse(os.path.exists(script)) # Only test the base name, since the error message can use From webhook-mailer at python.org Sat Oct 13 00:07:04 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 13 Oct 2018 04:07:04 -0000 Subject: [Python-checkins] bpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831) (GH-9832) Message-ID: https://github.com/python/cpython/commit/5d8ef8bc3f7307cd15f9d82ad4846e82b498ae88 commit: 5d8ef8bc3f7307cd15f9d82ad4846e82b498ae88 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-13T00:07:01-04:00 summary: bpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831) (GH-9832) With macOS framework builds, test case test_nonexisting_script in test_nonexisting_script fails because the test case assumes that the file name in sys.executable will appear in the error message. For macOS framework builds, sys.executable is the file name of the stub launcher and its file name bears no relationship to the file name of the actual python executable. For now, skip the test in this case. (cherry picked from commit f6c29a65e2a6da5c0014c868cf963c975b74e72b) Co-authored-by: Ned Deily files: M Lib/test/test_cmd_line_script.py diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 2595ca98c7ad..4f5af3754418 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -630,9 +630,13 @@ def test_consistent_sys_path_for_module_execution(self): traceback_lines = stderr.decode().splitlines() self.assertIn("No module named script_pkg", traceback_lines[-1]) + @unittest.skipIf(sys.platform == 'darwin' and sys._framework, + "test not valid for macOS framework builds") def test_nonexisting_script(self): # bpo-34783: "./python script.py" must not crash # if the script file doesn't exist. + # (Skip test for macOS framework builds because sys.excutable name + # is not the actual Python executable file name. script = 'nonexistingscript.py' self.assertFalse(os.path.exists(script)) # Only test the base name, since the error message can use From webhook-mailer at python.org Sat Oct 13 02:14:12 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sat, 13 Oct 2018 06:14:12 -0000 Subject: [Python-checkins] bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) Message-ID: https://github.com/python/cpython/commit/e385d0661ecf8bc9ba95c4395d9a11262c2cbfec commit: e385d0661ecf8bc9ba95c4395d9a11262c2cbfec branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-13T08:14:08+02:00 summary: bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) files: A Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 132920f130ad..08fa9df44183 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -424,11 +424,9 @@ def setup(app): app.add_directive('deprecated-removed', DeprecatedRemoved) app.add_builder(PydocTopicsBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) - app.add_description_unit('opcode', 'opcode', '%s (opcode)', - parse_opcode_signature) - app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)', - parse_pdb_command) - app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') + app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command) + app.add_object_type('2to3fixer', '2to3fixer', '%s (2to3 fixer)') app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction) app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod) app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction) diff --git a/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst new file mode 100644 index 000000000000..6341296663ae --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst @@ -0,0 +1,2 @@ +Use app.add_object_type() instead of the deprecated Sphinx function +app.description_unit() From solipsis at pitrou.net Sat Oct 13 05:09:51 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 13 Oct 2018 09:09:51 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=7 Message-ID: <20181013090951.1.81D561CE18796766@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, 0, -2] memory blocks, sum=-2 test_multiprocessing_forkserver leaked [-1, 1, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogX_sgvh', '--timeout', '7200'] From webhook-mailer at python.org Sat Oct 13 05:25:12 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 13 Oct 2018 09:25:12 -0000 Subject: [Python-checkins] [2.7] bpo-22851: Fix a segfault when accessing generator.gi_frame.f_restricted. (GH-9348) Message-ID: https://github.com/python/cpython/commit/68ddb59417ee0b0dedf5c8b66a304138c9ce0a63 commit: 68ddb59417ee0b0dedf5c8b66a304138c9ce0a63 branch: 2.7 author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-13T12:25:05+03:00 summary: [2.7] bpo-22851: Fix a segfault when accessing generator.gi_frame.f_restricted. (GH-9348) Frame's field f_tstate is NULL when the generator is exhausted. files: A Misc/NEWS.d/next/Core and Builtins/2018-09-17-04-41-42.bpo-22851.0hsJPh.rst M Include/frameobject.h M Lib/test/test_generators.py diff --git a/Include/frameobject.h b/Include/frameobject.h index 843908159ddb..34603794c655 100644 --- a/Include/frameobject.h +++ b/Include/frameobject.h @@ -56,7 +56,7 @@ PyAPI_DATA(PyTypeObject) PyFrame_Type; #define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type) #define PyFrame_IsRestricted(f) \ - ((f)->f_builtins != (f)->f_tstate->interp->builtins) + ((f)->f_tstate && (f)->f_builtins != (f)->f_tstate->interp->builtins) PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, PyObject *, PyObject *); diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 0f7bf19abb8c..10285f67a2c6 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1877,6 +1877,16 @@ def printsolution(self, x): """ +crash_test = """ +>>> def foo(): yield +>>> gen = foo() +>>> gen.next() +>>> print gen.gi_frame.f_restricted # This would segfault. +False + +""" + + __test__ = {"tut": tutorial_tests, "pep": pep_tests, "email": email_tests, @@ -1886,6 +1896,7 @@ def printsolution(self, x): "weakref": weakref_tests, "coroutine": coroutine_tests, "refleaks": refleaks_tests, + "crash": crash_test, } # Magic test name that regrtest.py invokes *after* importing this module. diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-17-04-41-42.bpo-22851.0hsJPh.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-17-04-41-42.bpo-22851.0hsJPh.rst new file mode 100644 index 000000000000..c5f524940085 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-17-04-41-42.bpo-22851.0hsJPh.rst @@ -0,0 +1,2 @@ +Fix a segfault when accessing ``generator.gi_frame.f_restricted`` when the +generator is exhausted. Patch by Zackery Spytz. From webhook-mailer at python.org Sat Oct 13 05:26:13 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 13 Oct 2018 09:26:13 -0000 Subject: [Python-checkins] bpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if the queue is closed. (GH-9010) Message-ID: https://github.com/python/cpython/commit/0461704060474cb358d3495322950c4fd00616a0 commit: 0461704060474cb358d3495322950c4fd00616a0 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-13T12:26:09+03:00 summary: bpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if the queue is closed. (GH-9010) Previously, put() and get() would raise AssertionError and OSError, respectively. files: A Misc/NEWS.d/next/Library/2018-08-30-14-44-11.bpo-22872.NhIaZ9.rst M Doc/library/multiprocessing.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 8402370d98f6..578b5483286a 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -787,6 +787,10 @@ For an example of the usage of queues for interprocess communication see available, else raise the :exc:`queue.Full` exception (*timeout* is ignored in that case). + .. versionchanged:: 3.8 + If the queue is closed, :exc:`ValueError` is raised instead of + :exc:`AssertionError`. + .. method:: put_nowait(obj) Equivalent to ``put(obj, False)``. @@ -801,6 +805,10 @@ For an example of the usage of queues for interprocess communication see ``False``), return an item if one is immediately available, else raise the :exc:`queue.Empty` exception (*timeout* is ignored in that case). + .. versionchanged:: 3.8 + If the queue is closed, :exc:`ValueError` is raised instead of + :exc:`OSError`. + .. method:: get_nowait() Equivalent to ``get(False)``. diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index 88f7d267bfd3..d112db2cd981 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -78,7 +78,8 @@ def _after_fork(self): self._poll = self._reader.poll def put(self, obj, block=True, timeout=None): - assert not self._closed, "Queue {0!r} has been closed".format(self) + if self._closed: + raise ValueError(f"Queue {self!r} is closed") if not self._sem.acquire(block, timeout): raise Full @@ -89,6 +90,8 @@ def put(self, obj, block=True, timeout=None): self._notempty.notify() def get(self, block=True, timeout=None): + if self._closed: + raise ValueError(f"Queue {self!r} is closed") if block and timeout is None: with self._rlock: res = self._recv_bytes() @@ -298,7 +301,8 @@ def __setstate__(self, state): self._cond, self._unfinished_tasks = state[-2:] def put(self, obj, block=True, timeout=None): - assert not self._closed, "Queue {0!r} is closed".format(self) + if self._closed: + raise ValueError(f"Queue {self!r} is closed") if not self._sem.acquire(block, timeout): raise Full diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 814aae8fa375..dc59e9fd740a 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -1114,6 +1114,14 @@ def _on_queue_feeder_error(e, obj): # Assert that the serialization and the hook have been called correctly self.assertTrue(not_serializable_obj.reduce_was_called) self.assertTrue(not_serializable_obj.on_queue_feeder_error_was_called) + + def test_closed_queue_put_get_exceptions(self): + for q in multiprocessing.Queue(), multiprocessing.JoinableQueue(): + q.close() + with self.assertRaisesRegex(ValueError, 'is closed'): + q.put('foo') + with self.assertRaisesRegex(ValueError, 'is closed'): + q.get() # # # diff --git a/Misc/NEWS.d/next/Library/2018-08-30-14-44-11.bpo-22872.NhIaZ9.rst b/Misc/NEWS.d/next/Library/2018-08-30-14-44-11.bpo-22872.NhIaZ9.rst new file mode 100644 index 000000000000..547c7b1a31cb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-08-30-14-44-11.bpo-22872.NhIaZ9.rst @@ -0,0 +1,4 @@ +When the queue is closed, :exc:`ValueError` is now raised by +:meth:`multiprocessing.Queue.put` and :meth:`multiprocessing.Queue.get` +instead of :exc:`AssertionError` and :exc:`OSError`, respectively. +Patch by Zackery Spytz. From webhook-mailer at python.org Sat Oct 13 05:27:34 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 13 Oct 2018 09:27:34 -0000 Subject: [Python-checkins] bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569) Message-ID: https://github.com/python/cpython/commit/d4d60134b29290049e28df54f23493de4f1824b6 commit: d4d60134b29290049e28df54f23493de4f1824b6 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-13T12:27:30+03:00 summary: bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569) files: A Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst M Lib/lib2to3/fixes/fix_execfile.py M Lib/lib2to3/tests/test_fixers.py diff --git a/Lib/lib2to3/fixes/fix_execfile.py b/Lib/lib2to3/fixes/fix_execfile.py index 09cb6f6661ca..b6c786fd4e8b 100644 --- a/Lib/lib2to3/fixes/fix_execfile.py +++ b/Lib/lib2to3/fixes/fix_execfile.py @@ -31,7 +31,8 @@ def transform(self, node, results): # call. execfile_paren = node.children[-1].children[-1].clone() # Construct open().read(). - open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_args = ArgList([filename.clone(), Comma(), String('"rb"', ' ')], + rparen=execfile_paren) open_call = Node(syms.power, [Name("open"), open_args]) read = [Node(syms.trailer, [Dot(), Name('read')]), Node(syms.trailer, [LParen(), RParen()])] diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py index 8cecf3cce61b..3da5dd845c93 100644 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/lib2to3/tests/test_fixers.py @@ -1201,36 +1201,36 @@ class Test_execfile(FixerTestCase): def test_conversion(self): b = """execfile("fn")""" - a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob)""" self.check(b, a) b = """execfile("fn", glob, loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob, loc)""" self.check(b, a) b = """execfile("fn", globals=glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob)""" self.check(b, a) b = """execfile("fn", locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), locals=loc)""" self.check(b, a) b = """execfile("fn", globals=glob, locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob, locals=loc)""" self.check(b, a) def test_spacing(self): b = """execfile( "fn" )""" - a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + a = """exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", globals = glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals = glob)""" self.check(b, a) diff --git a/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst new file mode 100644 index 000000000000..8e9d2f9482d2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst @@ -0,0 +1,2 @@ +The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file with mode +``'rb'``. Patch by Zackery Spytz. From webhook-mailer at python.org Sat Oct 13 05:48:22 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 13 Oct 2018 09:48:22 -0000 Subject: [Python-checkins] bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569) Message-ID: https://github.com/python/cpython/commit/22381394ad1541db0b652eed802601f62510d22f commit: 22381394ad1541db0b652eed802601f62510d22f branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-13T02:48:18-07:00 summary: bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569) (cherry picked from commit d4d60134b29290049e28df54f23493de4f1824b6) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst M Lib/lib2to3/fixes/fix_execfile.py M Lib/lib2to3/tests/test_fixers.py diff --git a/Lib/lib2to3/fixes/fix_execfile.py b/Lib/lib2to3/fixes/fix_execfile.py index 09cb6f6661ca..b6c786fd4e8b 100644 --- a/Lib/lib2to3/fixes/fix_execfile.py +++ b/Lib/lib2to3/fixes/fix_execfile.py @@ -31,7 +31,8 @@ def transform(self, node, results): # call. execfile_paren = node.children[-1].children[-1].clone() # Construct open().read(). - open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_args = ArgList([filename.clone(), Comma(), String('"rb"', ' ')], + rparen=execfile_paren) open_call = Node(syms.power, [Name("open"), open_args]) read = [Node(syms.trailer, [Dot(), Name('read')]), Node(syms.trailer, [LParen(), RParen()])] diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py index 8cecf3cce61b..3da5dd845c93 100644 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/lib2to3/tests/test_fixers.py @@ -1201,36 +1201,36 @@ class Test_execfile(FixerTestCase): def test_conversion(self): b = """execfile("fn")""" - a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob)""" self.check(b, a) b = """execfile("fn", glob, loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob, loc)""" self.check(b, a) b = """execfile("fn", globals=glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob)""" self.check(b, a) b = """execfile("fn", locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), locals=loc)""" self.check(b, a) b = """execfile("fn", globals=glob, locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob, locals=loc)""" self.check(b, a) def test_spacing(self): b = """execfile( "fn" )""" - a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + a = """exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", globals = glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals = glob)""" self.check(b, a) diff --git a/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst new file mode 100644 index 000000000000..8e9d2f9482d2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst @@ -0,0 +1,2 @@ +The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file with mode +``'rb'``. Patch by Zackery Spytz. From webhook-mailer at python.org Sat Oct 13 05:51:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 13 Oct 2018 09:51:38 -0000 Subject: [Python-checkins] bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569) Message-ID: https://github.com/python/cpython/commit/950fa40eee483f7507cd825b574a018b957dd253 commit: 950fa40eee483f7507cd825b574a018b957dd253 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-13T02:51:35-07:00 summary: bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569) (cherry picked from commit d4d60134b29290049e28df54f23493de4f1824b6) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst M Lib/lib2to3/fixes/fix_execfile.py M Lib/lib2to3/tests/test_fixers.py diff --git a/Lib/lib2to3/fixes/fix_execfile.py b/Lib/lib2to3/fixes/fix_execfile.py index 09cb6f6661ca..b6c786fd4e8b 100644 --- a/Lib/lib2to3/fixes/fix_execfile.py +++ b/Lib/lib2to3/fixes/fix_execfile.py @@ -31,7 +31,8 @@ def transform(self, node, results): # call. execfile_paren = node.children[-1].children[-1].clone() # Construct open().read(). - open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_args = ArgList([filename.clone(), Comma(), String('"rb"', ' ')], + rparen=execfile_paren) open_call = Node(syms.power, [Name("open"), open_args]) read = [Node(syms.trailer, [Dot(), Name('read')]), Node(syms.trailer, [LParen(), RParen()])] diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py index 3e1a255737ec..052ab7397af6 100644 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/lib2to3/tests/test_fixers.py @@ -1201,36 +1201,36 @@ class Test_execfile(FixerTestCase): def test_conversion(self): b = """execfile("fn")""" - a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob)""" self.check(b, a) b = """execfile("fn", glob, loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob, loc)""" self.check(b, a) b = """execfile("fn", globals=glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob)""" self.check(b, a) b = """execfile("fn", locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), locals=loc)""" self.check(b, a) b = """execfile("fn", globals=glob, locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob, locals=loc)""" self.check(b, a) def test_spacing(self): b = """execfile( "fn" )""" - a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + a = """exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", globals = glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals = glob)""" self.check(b, a) diff --git a/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst new file mode 100644 index 000000000000..8e9d2f9482d2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst @@ -0,0 +1,2 @@ +The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file with mode +``'rb'``. Patch by Zackery Spytz. From webhook-mailer at python.org Sat Oct 13 13:10:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 13 Oct 2018 17:10:45 -0000 Subject: [Python-checkins] Fixes issues in Windows release upload script (GH-9845) Message-ID: https://github.com/python/cpython/commit/a486a4712c3357250dbebb55ee74d2693dd79148 commit: a486a4712c3357250dbebb55ee74d2693dd79148 branch: master author: Steve Dower committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-13T10:10:42-07:00 summary: Fixes issues in Windows release upload script (GH-9845) files: M Tools/msi/uploadrelease.ps1 diff --git a/Tools/msi/uploadrelease.ps1 b/Tools/msi/uploadrelease.ps1 index 3e01d1e45312..491df80be1e9 100644 --- a/Tools/msi/uploadrelease.ps1 +++ b/Tools/msi/uploadrelease.ps1 @@ -39,6 +39,8 @@ param( if (-not $build) { throw "-build option is required" } if (-not $user) { throw "-user option is required" } +$tools = $script:MyInvocation.MyCommand.Path | Split-Path -parent; + if (-not ((Test-Path "$build\win32\python-*.exe") -or (Test-Path "$build\amd64\python-*.exe"))) { throw "-build argument does not look like a 'build' directory" } @@ -105,7 +107,7 @@ if (-not $skipupload) { if (-not $skippurge) { # Run a CDN purge - py purge.py "$($p[0])$($p[1])" + py $tools\purge.py "$($p[0])$($p[1])" } if (-not $skiptest) { @@ -126,8 +128,11 @@ if (-not $skiptest) { if (-not $skiphash) { # Display MD5 hash and size of each downloadable file pushd $build - gci python*.chm, *\*.exe, *\*.zip | ` + $hashes = gci python*.chm, *\*.exe, *\*.zip | ` Sort-Object Name | ` - Format-Table Name, @{Label="MD5"; Expression={(Get-FileHash $_ -Algorithm MD5).Hash}}, Length + Format-Table Name, @{Label="MD5"; Expression={(Get-FileHash $_ -Algorithm MD5).Hash}}, Length -AutoSize | ` + Out-String -Width 4096 + $hashes | clip + $hashes popd } From webhook-mailer at python.org Sat Oct 13 13:39:50 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 13 Oct 2018 17:39:50 -0000 Subject: [Python-checkins] Add new tests for bytes and bytearray constructors. (GH-9843) Message-ID: https://github.com/python/cpython/commit/1a997eb291fdc5f5606c898fffbde61d899ed762 commit: 1a997eb291fdc5f5606c898fffbde61d899ed762 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-13T20:39:45+03:00 summary: Add new tests for bytes and bytearray constructors. (GH-9843) Covered all special cases: bytes, tuple, list, differend kinds of iterables and iterators. files: M Lib/test/test_bytes.py diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 1408fb4fb84b..b7b48bfe17f6 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -69,11 +69,49 @@ def test_empty_sequence(self): self.assertRaises(IndexError, lambda: b[-sys.maxsize-2]) self.assertRaises(IndexError, lambda: b[-10**100]) + def test_from_iterable(self): + b = self.type2test(range(256)) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Non-sequence iterable. + b = self.type2test({42}) + self.assertEqual(b, b"*") + b = self.type2test({43, 45}) + self.assertIn(tuple(b), {(43, 45), (45, 43)}) + + # Iterator that has a __length_hint__. + b = self.type2test(iter(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Iterator that doesn't have a __length_hint__. + b = self.type2test(i for i in range(256) if i % 2) + self.assertEqual(len(b), 128) + self.assertEqual(list(b), list(range(256))[1::2]) + + # Sequence without __iter__. + class S: + def __getitem__(self, i): + return (1, 2, 3)[i] + b = self.type2test(S()) + self.assertEqual(b, b"\x01\x02\x03") + + def test_from_tuple(self): + # There is a special case for tuples. + b = self.type2test(tuple(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + b = self.type2test((1, 2, 3)) + self.assertEqual(b, b"\x01\x02\x03") + def test_from_list(self): - ints = list(range(256)) - b = self.type2test(i for i in ints) + # There is a special case for lists. + b = self.type2test(list(range(256))) self.assertEqual(len(b), 256) - self.assertEqual(list(b), ints) + self.assertEqual(list(b), list(range(256))) + b = self.type2test([1, 2, 3]) + self.assertEqual(b, b"\x01\x02\x03") def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), @@ -85,6 +123,8 @@ def test_from_index(self): def test_from_buffer(self): a = self.type2test(array.array('B', [1, 2, 3])) self.assertEqual(a, b"\x01\x02\x03") + a = self.type2test(b"\x01\x02\x03") + self.assertEqual(a, b"\x01\x02\x03") # http://bugs.python.org/issue29159 # Fallback when __index__ raises exception other than OverflowError From webhook-mailer at python.org Sat Oct 13 14:02:26 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 13 Oct 2018 18:02:26 -0000 Subject: [Python-checkins] Add new tests for bytes and bytearray constructors. (GH-9843) Message-ID: https://github.com/python/cpython/commit/d07564274a120030275ea17859458838c1513694 commit: d07564274a120030275ea17859458838c1513694 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-13T11:02:23-07:00 summary: Add new tests for bytes and bytearray constructors. (GH-9843) Covered all special cases: bytes, tuple, list, differend kinds of iterables and iterators. (cherry picked from commit 1a997eb291fdc5f5606c898fffbde61d899ed762) Co-authored-by: Serhiy Storchaka files: M Lib/test/test_bytes.py diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 1408fb4fb84b..b7b48bfe17f6 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -69,11 +69,49 @@ def test_empty_sequence(self): self.assertRaises(IndexError, lambda: b[-sys.maxsize-2]) self.assertRaises(IndexError, lambda: b[-10**100]) + def test_from_iterable(self): + b = self.type2test(range(256)) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Non-sequence iterable. + b = self.type2test({42}) + self.assertEqual(b, b"*") + b = self.type2test({43, 45}) + self.assertIn(tuple(b), {(43, 45), (45, 43)}) + + # Iterator that has a __length_hint__. + b = self.type2test(iter(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Iterator that doesn't have a __length_hint__. + b = self.type2test(i for i in range(256) if i % 2) + self.assertEqual(len(b), 128) + self.assertEqual(list(b), list(range(256))[1::2]) + + # Sequence without __iter__. + class S: + def __getitem__(self, i): + return (1, 2, 3)[i] + b = self.type2test(S()) + self.assertEqual(b, b"\x01\x02\x03") + + def test_from_tuple(self): + # There is a special case for tuples. + b = self.type2test(tuple(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + b = self.type2test((1, 2, 3)) + self.assertEqual(b, b"\x01\x02\x03") + def test_from_list(self): - ints = list(range(256)) - b = self.type2test(i for i in ints) + # There is a special case for lists. + b = self.type2test(list(range(256))) self.assertEqual(len(b), 256) - self.assertEqual(list(b), ints) + self.assertEqual(list(b), list(range(256))) + b = self.type2test([1, 2, 3]) + self.assertEqual(b, b"\x01\x02\x03") def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), @@ -85,6 +123,8 @@ def test_from_index(self): def test_from_buffer(self): a = self.type2test(array.array('B', [1, 2, 3])) self.assertEqual(a, b"\x01\x02\x03") + a = self.type2test(b"\x01\x02\x03") + self.assertEqual(a, b"\x01\x02\x03") # http://bugs.python.org/issue29159 # Fallback when __index__ raises exception other than OverflowError From webhook-mailer at python.org Sat Oct 13 14:12:43 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 13 Oct 2018 18:12:43 -0000 Subject: [Python-checkins] bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) Message-ID: https://github.com/python/cpython/commit/97cf0828727ac2a269c89c5aa09570a69a22c83c commit: 97cf0828727ac2a269c89c5aa09570a69a22c83c branch: master author: Andrew Svetlov committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-13T11:12:40-07:00 summary: bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) https://bugs.python.org/issue34970 files: A Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst M Lib/asyncio/tasks.py diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 743e82baff7a..15422da1b3b2 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -42,7 +42,9 @@ def all_tasks(loop=None): """Return a set of all tasks for the loop.""" if loop is None: loop = events.get_running_loop() - return {t for t in _all_tasks + # NB: set(_all_tasks) is required to protect + # from https://bugs.python.org/issue34970 bug + return {t for t in list(_all_tasks) if futures._get_loop(t) is loop and not t.done()} @@ -52,7 +54,9 @@ def _all_tasks_compat(loop=None): # method. if loop is None: loop = events.get_event_loop() - return {t for t in _all_tasks if futures._get_loop(t) is loop} + # NB: set(_all_tasks) is required to protect + # from https://bugs.python.org/issue34970 bug + return {t for t in list(_all_tasks) if futures._get_loop(t) is loop} def _set_task_name(task, name): diff --git a/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst b/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst new file mode 100644 index 000000000000..a58b3dd35419 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst @@ -0,0 +1 @@ +Protect tasks weak set manipulation in ``asyncio.all_tasks()`` From webhook-mailer at python.org Sat Oct 13 14:53:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 13 Oct 2018 18:53:28 -0000 Subject: [Python-checkins] Add new tests for bytes and bytearray constructors. (GH-9843) Message-ID: https://github.com/python/cpython/commit/73d9cccb7a12a1fc45d1d250d43f8db20cea66a1 commit: 73d9cccb7a12a1fc45d1d250d43f8db20cea66a1 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-13T11:53:24-07:00 summary: Add new tests for bytes and bytearray constructors. (GH-9843) Covered all special cases: bytes, tuple, list, differend kinds of iterables and iterators. (cherry picked from commit 1a997eb291fdc5f5606c898fffbde61d899ed762) Co-authored-by: Serhiy Storchaka files: M Lib/test/test_bytes.py diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 6fcc26a0a1bf..8c9d17fd1614 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -69,11 +69,49 @@ def test_empty_sequence(self): self.assertRaises(IndexError, lambda: b[-sys.maxsize-2]) self.assertRaises(IndexError, lambda: b[-10**100]) + def test_from_iterable(self): + b = self.type2test(range(256)) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Non-sequence iterable. + b = self.type2test({42}) + self.assertEqual(b, b"*") + b = self.type2test({43, 45}) + self.assertIn(tuple(b), {(43, 45), (45, 43)}) + + # Iterator that has a __length_hint__. + b = self.type2test(iter(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Iterator that doesn't have a __length_hint__. + b = self.type2test(i for i in range(256) if i % 2) + self.assertEqual(len(b), 128) + self.assertEqual(list(b), list(range(256))[1::2]) + + # Sequence without __iter__. + class S: + def __getitem__(self, i): + return (1, 2, 3)[i] + b = self.type2test(S()) + self.assertEqual(b, b"\x01\x02\x03") + + def test_from_tuple(self): + # There is a special case for tuples. + b = self.type2test(tuple(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + b = self.type2test((1, 2, 3)) + self.assertEqual(b, b"\x01\x02\x03") + def test_from_list(self): - ints = list(range(256)) - b = self.type2test(i for i in ints) + # There is a special case for lists. + b = self.type2test(list(range(256))) self.assertEqual(len(b), 256) - self.assertEqual(list(b), ints) + self.assertEqual(list(b), list(range(256))) + b = self.type2test([1, 2, 3]) + self.assertEqual(b, b"\x01\x02\x03") def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), @@ -85,6 +123,8 @@ def test_from_index(self): def test_from_buffer(self): a = self.type2test(array.array('B', [1, 2, 3])) self.assertEqual(a, b"\x01\x02\x03") + a = self.type2test(b"\x01\x02\x03") + self.assertEqual(a, b"\x01\x02\x03") # http://bugs.python.org/issue29159 # Fallback when __index__ raises exception other than OverflowError From webhook-mailer at python.org Sat Oct 13 15:26:52 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Sat, 13 Oct 2018 19:26:52 -0000 Subject: [Python-checkins] bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849) Message-ID: https://github.com/python/cpython/commit/5dbb1b7df1d9ecaa6b5344028cd1777502cf5c73 commit: 5dbb1b7df1d9ecaa6b5344028cd1777502cf5c73 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Andrew Svetlov date: 2018-10-13T22:26:47+03:00 summary: bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849) https://bugs.python.org/issue34970 (cherry picked from commit 97cf0828727ac2a269c89c5aa09570a69a22c83c) Co-authored-by: Andrew Svetlov files: A Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst M Lib/asyncio/tasks.py diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 72792a25cf55..416c346be2ec 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -35,7 +35,9 @@ def all_tasks(loop=None): """Return a set of all tasks for the loop.""" if loop is None: loop = events.get_running_loop() - return {t for t in _all_tasks + # NB: set(_all_tasks) is required to protect + # from https://bugs.python.org/issue34970 bug + return {t for t in list(_all_tasks) if futures._get_loop(t) is loop and not t.done()} @@ -45,7 +47,9 @@ def _all_tasks_compat(loop=None): # method. if loop is None: loop = events.get_event_loop() - return {t for t in _all_tasks if futures._get_loop(t) is loop} + # NB: set(_all_tasks) is required to protect + # from https://bugs.python.org/issue34970 bug + return {t for t in list(_all_tasks) if futures._get_loop(t) is loop} class Task(futures._PyFuture): # Inherit Python Task implementation diff --git a/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst b/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst new file mode 100644 index 000000000000..a58b3dd35419 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst @@ -0,0 +1 @@ +Protect tasks weak set manipulation in ``asyncio.all_tasks()`` From webhook-mailer at python.org Sat Oct 13 16:39:49 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 13 Oct 2018 20:39:49 -0000 Subject: [Python-checkins] bpo-34370: Revert to using released Tk 8.6.8 with macOS installers Message-ID: https://github.com/python/cpython/commit/f55c3ae657595d12ce78aca76c9c6b998d632424 commit: f55c3ae657595d12ce78aca76c9c6b998d632424 branch: 3.6 author: Ned Deily committer: Ned Deily date: 2018-10-13T02:08:48-04:00 summary: bpo-34370: Revert to using released Tk 8.6.8 with macOS installers For 3.7.1rc1 and 3.6.7rc1 we used a pre-release development snapshot of Tk 8.6 to pick up some post-8.6.8 fixes for macOS. But the snapshot introduced at least one regression (bpo-34927). For rc2, revert to using the standard release 8.6.8 for now. This reverts commit adf493227f1efd5d6b34f46b854142bf3b5a411c. files: A Misc/NEWS.d/next/macOS/2018-10-13-02-07-55.bpo-34370.FqUqcG.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 2959bea48a18..b97d55bb0306 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -239,9 +239,9 @@ def library_recipes(): }, ), dict( - name="Tk 8.6.8+", - url="http://core.tcl.tk/tk/tarball/16fdad9d/tk-16fdad9d.tar.gz", - checksum='b8e0df69021924e8392f03d506252bdb', + name="Tk 8.6.8", + url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk8.6.8-src.tar.gz", + checksum='5e0faecba458ee1386078fb228d008ba', patches=[ "tk868_on_10_8_10_9.patch", ], diff --git a/Misc/NEWS.d/next/macOS/2018-10-13-02-07-55.bpo-34370.FqUqcG.rst b/Misc/NEWS.d/next/macOS/2018-10-13-02-07-55.bpo-34370.FqUqcG.rst new file mode 100644 index 000000000000..57cadc319591 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-13-02-07-55.bpo-34370.FqUqcG.rst @@ -0,0 +1,3 @@ +Revert to using the released Tk 8.6.8 with macOS installers instead of the +Tk 8.6.x development snapshot used with 3.7.1rc1 and 3.6.7rc1. The snapshot +introduced at least one significant regression (bpo-34927). From webhook-mailer at python.org Sat Oct 13 16:46:38 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 13 Oct 2018 20:46:38 -0000 Subject: [Python-checkins] bpo-34370: Revert to using released Tk 8.6.8 with macOS installers Message-ID: https://github.com/python/cpython/commit/d8b6425e58a1fccdf8ddbbcde63066c13c1bcfaf commit: d8b6425e58a1fccdf8ddbbcde63066c13c1bcfaf branch: 3.7 author: Ned Deily committer: Ned Deily date: 2018-10-13T01:38:43-04:00 summary: bpo-34370: Revert to using released Tk 8.6.8 with macOS installers For 3.7.1rc1 and 3.6.7rc1 we used a pre-release development snapshot of Tk 8.6 to pick up some post-8.6.8 fixes for macOS. But the snapshot introduced at least one regression (bpo-34927). For rc2, revert to using the standard release 8.6.8 for now. This reverts commit d9cfe5ed2c2c61eeae915b76f5e10aadbbb28da6. files: A Misc/NEWS.d/next/macOS/2018-10-12-22-43-02.bpo-34370.kTJas4.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 7d3bed2f6457..15488780327e 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -242,63 +242,29 @@ def library_recipes(): "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.6'%(getVersion())), }, ), + dict( + name="Tk 8.6.8", + url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk8.6.8-src.tar.gz", + checksum='5e0faecba458ee1386078fb228d008ba', + patches=[ + "tk868_on_10_8_10_9.patch", + ], + buildDir="unix", + configure_pre=[ + '--enable-aqua', + '--enable-shared', + '--enable-threads', + '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),), + ], + useLDFlags=False, + install='make TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s DESTDIR=%(DESTDIR)s'%{ + "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')), + "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.6'%(getVersion())), + "TK_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tk8.6'%(getVersion())), + }, + ), ]) - # temporary workaround in 3.7.1 for addressing bpo-34370: - # use development snapshot of Tk 8.6 branch (post 8.6.8) to pick up - # potential fixes for various scrolling problems seen with 8.6.8. - # However, the snapshot fails to build on 10.6. For the moment, - # continue to build the 3.7.x 10.6 variant with the standard - # 8.6.6 branch. - if getDeptargetTuple() < (10, 9): - result.extend([ - dict( - name="Tk 8.6.8", - url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk8.6.8-src.tar.gz", - checksum='5e0faecba458ee1386078fb228d008ba', - patches=[ - "tk868_on_10_8_10_9.patch", - ], - buildDir="unix", - configure_pre=[ - '--enable-aqua', - '--enable-shared', - '--enable-threads', - '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),), - ], - useLDFlags=False, - install='make TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s DESTDIR=%(DESTDIR)s'%{ - "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')), - "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.6'%(getVersion())), - "TK_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tk8.6'%(getVersion())), - }, - ), - ]) - else: - result.extend([ - dict( - name="Tk 8.6.8+", - url="http://core.tcl.tk/tk/tarball/16fdad9d/tk-16fdad9d.tar.gz", - checksum='b8e0df69021924e8392f03d506252bdb', - patches=[ - "tk868_on_10_8_10_9.patch", - ], - buildDir="unix", - configure_pre=[ - '--enable-aqua', - '--enable-shared', - '--enable-threads', - '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),), - ], - useLDFlags=False, - install='make TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s DESTDIR=%(DESTDIR)s'%{ - "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')), - "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.6'%(getVersion())), - "TK_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tk8.6'%(getVersion())), - }, - ), - ]) - if PYTHON_3: result.extend([ dict( diff --git a/Misc/NEWS.d/next/macOS/2018-10-12-22-43-02.bpo-34370.kTJas4.rst b/Misc/NEWS.d/next/macOS/2018-10-12-22-43-02.bpo-34370.kTJas4.rst new file mode 100644 index 000000000000..57cadc319591 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-12-22-43-02.bpo-34370.kTJas4.rst @@ -0,0 +1,3 @@ +Revert to using the released Tk 8.6.8 with macOS installers instead of the +Tk 8.6.x development snapshot used with 3.7.1rc1 and 3.6.7rc1. The snapshot +introduced at least one significant regression (bpo-34927). From webhook-mailer at python.org Sat Oct 13 20:00:39 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sun, 14 Oct 2018 00:00:39 -0000 Subject: [Python-checkins] bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) Message-ID: https://github.com/python/cpython/commit/d274afb5e579a5d9d990f68f9af856cf4c918779 commit: d274afb5e579a5d9d990f68f9af856cf4c918779 branch: master author: Terry Jan Reedy committer: GitHub date: 2018-10-13T20:00:31-04:00 summary: bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) A Windows build with _tkinter, tkinter, and idlelib but without ctypes is unlikely but apparently possible. files: M Lib/idlelib/pyshell.py diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 5458c59dbd7e..47eef4399ce6 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -12,11 +12,11 @@ # Valid arguments for the ...Awareness call below are defined in the following. # https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx if sys.platform == 'win32': - import ctypes - PROCESS_SYSTEM_DPI_AWARE = 1 try: + import ctypes + PROCESS_SYSTEM_DPI_AWARE = 1 ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE) - except (AttributeError, OSError): + except (ImportError, AttributeError, OSError): pass import tkinter.messagebox as tkMessageBox From webhook-mailer at python.org Sat Oct 13 20:19:26 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 14 Oct 2018 00:19:26 -0000 Subject: [Python-checkins] bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) Message-ID: https://github.com/python/cpython/commit/77e0abe228564a5be23284bd8e963c11952eb55b commit: 77e0abe228564a5be23284bd8e963c11952eb55b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-13T17:19:22-07:00 summary: bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) A Windows build with _tkinter, tkinter, and idlelib but without ctypes is unlikely but apparently possible. (cherry picked from commit d274afb5e579a5d9d990f68f9af856cf4c918779) Co-authored-by: Terry Jan Reedy files: M Lib/idlelib/pyshell.py diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 5458c59dbd7e..47eef4399ce6 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -12,11 +12,11 @@ # Valid arguments for the ...Awareness call below are defined in the following. # https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx if sys.platform == 'win32': - import ctypes - PROCESS_SYSTEM_DPI_AWARE = 1 try: + import ctypes + PROCESS_SYSTEM_DPI_AWARE = 1 ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE) - except (AttributeError, OSError): + except (ImportError, AttributeError, OSError): pass import tkinter.messagebox as tkMessageBox From webhook-mailer at python.org Sat Oct 13 20:28:07 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 14 Oct 2018 00:28:07 -0000 Subject: [Python-checkins] bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) Message-ID: https://github.com/python/cpython/commit/68299305c7898eb8eb0cea6cad19c299d0d1ba2d commit: 68299305c7898eb8eb0cea6cad19c299d0d1ba2d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-13T17:28:04-07:00 summary: bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) A Windows build with _tkinter, tkinter, and idlelib but without ctypes is unlikely but apparently possible. (cherry picked from commit d274afb5e579a5d9d990f68f9af856cf4c918779) Co-authored-by: Terry Jan Reedy files: M Lib/idlelib/pyshell.py diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 5458c59dbd7e..47eef4399ce6 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -12,11 +12,11 @@ # Valid arguments for the ...Awareness call below are defined in the following. # https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx if sys.platform == 'win32': - import ctypes - PROCESS_SYSTEM_DPI_AWARE = 1 try: + import ctypes + PROCESS_SYSTEM_DPI_AWARE = 1 ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE) - except (AttributeError, OSError): + except (ImportError, AttributeError, OSError): pass import tkinter.messagebox as tkMessageBox From webhook-mailer at python.org Sun Oct 14 03:32:22 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 14 Oct 2018 07:32:22 -0000 Subject: [Python-checkins] bpo-34941: Fix searching Element subclasses. (GH-9766) Message-ID: https://github.com/python/cpython/commit/b11c5667f99c4f0018e3394c4d07c519d835671a commit: b11c5667f99c4f0018e3394c4d07c519d835671a branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-14T10:32:19+03:00 summary: bpo-34941: Fix searching Element subclasses. (GH-9766) Methods find(), findtext() and findall() of xml.etree.ElementTree.Element were not able to find chldren which are instances of Element subclasses. files: A Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst M Lib/test/test_xml_etree.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index ecb910f04f59..61416ba7c691 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -2160,6 +2160,21 @@ def newmethod(self): mye = MyElement('joe') self.assertEqual(mye.newmethod(), 'joe') + def test_Element_subclass_find(self): + class MyElement(ET.Element): + pass + + e = ET.Element('foo') + e.text = 'text' + sub = MyElement('bar') + sub.text = 'subtext' + e.append(sub) + self.assertEqual(e.findtext('bar'), 'subtext') + self.assertEqual(e.find('bar').tag, 'bar') + found = list(e.findall('bar')) + self.assertEqual(len(found), 1, found) + self.assertEqual(found[0].tag, 'bar') + class ElementFindTest(unittest.TestCase): def test_find_simple(self): diff --git a/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst b/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst new file mode 100644 index 000000000000..402372489bef --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst @@ -0,0 +1,3 @@ +Methods ``find()``, ``findtext()`` and ``findall()`` of the ``Element`` +class in the :mod:`xml.etree.ElementTree` module are now able to find +children which are instances of ``Element`` subclasses. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index bd7702ea6970..1c72c6538326 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -204,6 +204,8 @@ typedef struct { #define Element_CheckExact(op) (Py_TYPE(op) == &Element_Type) +#define Element_Check(op) PyObject_TypeCheck(op, &Element_Type) + /* -------------------------------------------------------------------- */ /* Element constructors and destructor */ @@ -1132,7 +1134,7 @@ _elementtree_Element_extend(ElementObject *self, PyObject *elements) for (i = 0; i < PySequence_Fast_GET_SIZE(seq); i++) { PyObject* element = PySequence_Fast_GET_ITEM(seq, i); Py_INCREF(element); - if (!PyObject_TypeCheck(element, (PyTypeObject *)&Element_Type)) { + if (!Element_Check(element)) { PyErr_Format( PyExc_TypeError, "expected an Element, not \"%.200s\"", @@ -1184,7 +1186,7 @@ _elementtree_Element_find_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); @@ -1229,14 +1231,14 @@ _elementtree_Element_findtext_impl(ElementObject *self, PyObject *path, } for (i = 0; i < self->extra->length; i++) { - ElementObject* item = (ElementObject*) self->extra->children[i]; + PyObject *item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); - rc = PyObject_RichCompareBool(item->tag, path, Py_EQ); + rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc > 0) { - PyObject* text = element_get_text(item); + PyObject* text = element_get_text((ElementObject*)item); if (text == Py_None) { Py_DECREF(item); return PyUnicode_New(0, 0); @@ -1269,13 +1271,12 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, { Py_ssize_t i; PyObject* out; - PyObject* tag = path; elementtreestate *st = ET_STATE_GLOBAL; - if (checkpath(tag) || namespaces != Py_None) { + if (checkpath(path) || namespaces != Py_None) { _Py_IDENTIFIER(findall); return _PyObject_CallMethodIdObjArgs( - st->elementpath_obj, &PyId_findall, self, tag, namespaces, NULL + st->elementpath_obj, &PyId_findall, self, path, namespaces, NULL ); } @@ -1289,10 +1290,10 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); - rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ); + rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc != 0 && (rc < 0 || PyList_Append(out, item) < 0)) { Py_DECREF(item); Py_DECREF(out); @@ -2173,7 +2174,7 @@ elementiter_next(ElementIterObject *it) continue; } - if (!PyObject_TypeCheck(extra->children[child_index], &Element_Type)) { + if (!Element_Check(extra->children[child_index])) { PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute 'iter'", Py_TYPE(extra->children[child_index])->tp_name); From webhook-mailer at python.org Sun Oct 14 03:55:52 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 14 Oct 2018 07:55:52 -0000 Subject: [Python-checkins] bpo-34941: Fix searching Element subclasses. (GH-9766) Message-ID: https://github.com/python/cpython/commit/b1c800303e8458e00428ae66351ad492a503a46f commit: b1c800303e8458e00428ae66351ad492a503a46f branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-14T00:55:49-07:00 summary: bpo-34941: Fix searching Element subclasses. (GH-9766) Methods find(), findtext() and findall() of xml.etree.ElementTree.Element were not able to find chldren which are instances of Element subclasses. (cherry picked from commit b11c5667f99c4f0018e3394c4d07c519d835671a) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst M Lib/test/test_xml_etree.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 088a04e98b60..75c9c25a8b63 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -2160,6 +2160,21 @@ def newmethod(self): mye = MyElement('joe') self.assertEqual(mye.newmethod(), 'joe') + def test_Element_subclass_find(self): + class MyElement(ET.Element): + pass + + e = ET.Element('foo') + e.text = 'text' + sub = MyElement('bar') + sub.text = 'subtext' + e.append(sub) + self.assertEqual(e.findtext('bar'), 'subtext') + self.assertEqual(e.find('bar').tag, 'bar') + found = list(e.findall('bar')) + self.assertEqual(len(found), 1, found) + self.assertEqual(found[0].tag, 'bar') + class ElementFindTest(unittest.TestCase): def test_find_simple(self): diff --git a/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst b/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst new file mode 100644 index 000000000000..402372489bef --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst @@ -0,0 +1,3 @@ +Methods ``find()``, ``findtext()`` and ``findall()`` of the ``Element`` +class in the :mod:`xml.etree.ElementTree` module are now able to find +children which are instances of ``Element`` subclasses. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 4b86f96a70d3..78a52e859df2 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -204,6 +204,8 @@ typedef struct { #define Element_CheckExact(op) (Py_TYPE(op) == &Element_Type) +#define Element_Check(op) PyObject_TypeCheck(op, &Element_Type) + /* -------------------------------------------------------------------- */ /* Element constructors and destructor */ @@ -1132,7 +1134,7 @@ _elementtree_Element_extend(ElementObject *self, PyObject *elements) for (i = 0; i < PySequence_Fast_GET_SIZE(seq); i++) { PyObject* element = PySequence_Fast_GET_ITEM(seq, i); Py_INCREF(element); - if (!PyObject_TypeCheck(element, (PyTypeObject *)&Element_Type)) { + if (!Element_Check(element)) { PyErr_Format( PyExc_TypeError, "expected an Element, not \"%.200s\"", @@ -1184,7 +1186,7 @@ _elementtree_Element_find_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); @@ -1229,14 +1231,14 @@ _elementtree_Element_findtext_impl(ElementObject *self, PyObject *path, } for (i = 0; i < self->extra->length; i++) { - ElementObject* item = (ElementObject*) self->extra->children[i]; + PyObject *item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); - rc = PyObject_RichCompareBool(item->tag, path, Py_EQ); + rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc > 0) { - PyObject* text = element_get_text(item); + PyObject* text = element_get_text((ElementObject*)item); if (text == Py_None) { Py_DECREF(item); return PyUnicode_New(0, 0); @@ -1269,13 +1271,12 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, { Py_ssize_t i; PyObject* out; - PyObject* tag = path; elementtreestate *st = ET_STATE_GLOBAL; - if (checkpath(tag) || namespaces != Py_None) { + if (checkpath(path) || namespaces != Py_None) { _Py_IDENTIFIER(findall); return _PyObject_CallMethodIdObjArgs( - st->elementpath_obj, &PyId_findall, self, tag, namespaces, NULL + st->elementpath_obj, &PyId_findall, self, path, namespaces, NULL ); } @@ -1289,10 +1290,10 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); - rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ); + rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc != 0 && (rc < 0 || PyList_Append(out, item) < 0)) { Py_DECREF(item); Py_DECREF(out); @@ -2174,7 +2175,7 @@ elementiter_next(ElementIterObject *it) continue; } - if (!PyObject_TypeCheck(extra->children[child_index], &Element_Type)) { + if (!Element_Check(extra->children[child_index])) { PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute 'iter'", Py_TYPE(extra->children[child_index])->tp_name); From webhook-mailer at python.org Sun Oct 14 04:18:23 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Sun, 14 Oct 2018 08:18:23 -0000 Subject: [Python-checkins] Update compound_stmts.rst (#9864) Message-ID: https://github.com/python/cpython/commit/c8bb467f4006fbf5d24d2491248bcbabee5d827e commit: c8bb467f4006fbf5d24d2491248bcbabee5d827e branch: master author: Andr?s Delfino committer: Andrew Svetlov date: 2018-10-14T11:18:16+03:00 summary: Update compound_stmts.rst (#9864) files: M Doc/reference/compound_stmts.rst diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index ebb18ca08477..ddc796adcd77 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -765,8 +765,8 @@ Is semantically equivalent to:: See also :meth:`__aiter__` and :meth:`__anext__` for details. -It is a :exc:`SyntaxError` to use ``async for`` statement outside of an -:keyword:`async def` function. +It is a :exc:`SyntaxError` to use an ``async for`` statement outside of a +coroutine. .. index:: statement: async with @@ -803,8 +803,8 @@ Is semantically equivalent to:: See also :meth:`__aenter__` and :meth:`__aexit__` for details. -It is a :exc:`SyntaxError` to use ``async with`` statement outside of an -:keyword:`async def` function. +It is a :exc:`SyntaxError` to use an ``async with`` statement outside of a +coroutine. .. seealso:: From webhook-mailer at python.org Sun Oct 14 04:33:02 2018 From: webhook-mailer at python.org (Andrew Svetlov) Date: Sun, 14 Oct 2018 08:33:02 -0000 Subject: [Python-checkins] Update compound_stmts.rst (GH-9864) (GH-9869) Message-ID: https://github.com/python/cpython/commit/91b863d93b93e15799af10d9117982840ecf3462 commit: 91b863d93b93e15799af10d9117982840ecf3462 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Andrew Svetlov date: 2018-10-14T11:32:58+03:00 summary: Update compound_stmts.rst (GH-9864) (GH-9869) (cherry picked from commit c8bb467f4006fbf5d24d2491248bcbabee5d827e) Co-authored-by: Andr?s Delfino files: M Doc/reference/compound_stmts.rst diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index aeb4ada4fc43..2e832c2d22c1 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -764,8 +764,8 @@ Is semantically equivalent to:: See also :meth:`__aiter__` and :meth:`__anext__` for details. -It is a :exc:`SyntaxError` to use ``async for`` statement outside of an -:keyword:`async def` function. +It is a :exc:`SyntaxError` to use an ``async for`` statement outside of a +coroutine. .. index:: statement: async with @@ -802,8 +802,8 @@ Is semantically equivalent to:: See also :meth:`__aenter__` and :meth:`__aexit__` for details. -It is a :exc:`SyntaxError` to use ``async with`` statement outside of an -:keyword:`async def` function. +It is a :exc:`SyntaxError` to use an ``async with`` statement outside of a +coroutine. .. seealso:: From webhook-mailer at python.org Sun Oct 14 04:40:24 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 14 Oct 2018 08:40:24 -0000 Subject: [Python-checkins] [3.6] bpo-34941: Fix searching Element subclasses. (GH-9766) (GH-9868) Message-ID: https://github.com/python/cpython/commit/7c1c42b3209f1d2546daab6cd77f953eb255df6c commit: 7c1c42b3209f1d2546daab6cd77f953eb255df6c branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-10-14T11:40:13+03:00 summary: [3.6] bpo-34941: Fix searching Element subclasses. (GH-9766) (GH-9868) Methods find(), findtext() and findall() of xml.etree.ElementTree.Element were not able to find chldren which are instances of Element subclasses. (cherry picked from commit b11c5667f99c4f0018e3394c4d07c519d835671a) files: A Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst M Lib/test/test_xml_etree.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 2b8c5e598656..b01709e90162 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -2145,6 +2145,21 @@ def newmethod(self): mye = MyElement('joe') self.assertEqual(mye.newmethod(), 'joe') + def test_Element_subclass_find(self): + class MyElement(ET.Element): + pass + + e = ET.Element('foo') + e.text = 'text' + sub = MyElement('bar') + sub.text = 'subtext' + e.append(sub) + self.assertEqual(e.findtext('bar'), 'subtext') + self.assertEqual(e.find('bar').tag, 'bar') + found = list(e.findall('bar')) + self.assertEqual(len(found), 1, found) + self.assertEqual(found[0].tag, 'bar') + class ElementFindTest(unittest.TestCase): def test_find_simple(self): diff --git a/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst b/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst new file mode 100644 index 000000000000..402372489bef --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-09-14-42-16.bpo-34941.1Q5QKv.rst @@ -0,0 +1,3 @@ +Methods ``find()``, ``findtext()`` and ``findall()`` of the ``Element`` +class in the :mod:`xml.etree.ElementTree` module are now able to find +children which are instances of ``Element`` subclasses. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 53f05f937ffb..00fa0ae1ede4 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -204,6 +204,8 @@ typedef struct { #define Element_CheckExact(op) (Py_TYPE(op) == &Element_Type) +#define Element_Check(op) PyObject_TypeCheck(op, &Element_Type) + /* -------------------------------------------------------------------- */ /* Element constructors and destructor */ @@ -1131,7 +1133,7 @@ _elementtree_Element_extend(ElementObject *self, PyObject *elements) for (i = 0; i < PySequence_Fast_GET_SIZE(seq); i++) { PyObject* element = PySequence_Fast_GET_ITEM(seq, i); Py_INCREF(element); - if (!PyObject_TypeCheck(element, (PyTypeObject *)&Element_Type)) { + if (!Element_Check(element)) { PyErr_Format( PyExc_TypeError, "expected an Element, not \"%.200s\"", @@ -1183,7 +1185,7 @@ _elementtree_Element_find_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); @@ -1227,14 +1229,14 @@ _elementtree_Element_findtext_impl(ElementObject *self, PyObject *path, } for (i = 0; i < self->extra->length; i++) { - ElementObject* item = (ElementObject*) self->extra->children[i]; + PyObject *item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); - rc = PyObject_RichCompareBool(item->tag, path, Py_EQ); + rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc > 0) { - PyObject* text = element_get_text(item); + PyObject* text = element_get_text((ElementObject*)item); if (text == Py_None) { Py_DECREF(item); return PyUnicode_New(0, 0); @@ -1267,13 +1269,12 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, { Py_ssize_t i; PyObject* out; - PyObject* tag = path; elementtreestate *st = ET_STATE_GLOBAL; - if (checkpath(tag) || namespaces != Py_None) { + if (checkpath(path) || namespaces != Py_None) { _Py_IDENTIFIER(findall); return _PyObject_CallMethodId( - st->elementpath_obj, &PyId_findall, "OOO", self, tag, namespaces + st->elementpath_obj, &PyId_findall, "OOO", self, path, namespaces ); } @@ -1287,10 +1288,10 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_CheckExact(item)) + if (!Element_Check(item)) continue; Py_INCREF(item); - rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ); + rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc != 0 && (rc < 0 || PyList_Append(out, item) < 0)) { Py_DECREF(item); Py_DECREF(out); @@ -2145,7 +2146,7 @@ elementiter_next(ElementIterObject *it) continue; } - if (!PyObject_TypeCheck(extra->children[child_index], &Element_Type)) { + if (!Element_Check(extra->children[child_index])) { PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute 'iter'", Py_TYPE(extra->children[child_index])->tp_name); From solipsis at pitrou.net Sun Oct 14 05:12:35 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 14 Oct 2018 09:12:35 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=-2 Message-ID: <20181014091235.1.C32B6B75E26CF362@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [-2, 1, 1] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogKzbDOO', '--timeout', '7200'] From webhook-mailer at python.org Sun Oct 14 06:07:58 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 14 Oct 2018 10:07:58 -0000 Subject: [Python-checkins] [2.7] Add new tests for bytes and bytearray constructors. (GH-9843) (#9866) Message-ID: https://github.com/python/cpython/commit/8ba72674bdf3d49afa6b6f79ae55d8a6120e8d36 commit: 8ba72674bdf3d49afa6b6f79ae55d8a6120e8d36 branch: 2.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-14T13:07:54+03:00 summary: [2.7] Add new tests for bytes and bytearray constructors. (GH-9843) (#9866) Covered all special cases: bytes, tuple, list, differend kinds of iterables and iterators. (cherry picked from commit 1a997eb291fdc5f5606c898fffbde61d899ed762) files: M Lib/test/test_bytes.py diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index ce2c5b21ee3f..9b5f713b0b88 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -4,6 +4,7 @@ the latter should be modernized). """ +import array import os import re import sys @@ -58,11 +59,49 @@ def test_empty_sequence(self): self.assertRaises(IndexError, lambda: b[-sys.maxint-2]) self.assertRaises(IndexError, lambda: b[-10**100]) + def test_from_iterable(self): + b = self.type2test(range(256)) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Non-sequence iterable. + b = self.type2test({42}) + self.assertEqual(b, b"*") + b = self.type2test({43, 45}) + self.assertIn(tuple(b), {(43, 45), (45, 43)}) + + # Iterator that has a __length_hint__. + b = self.type2test(iter(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + + # Iterator that doesn't have a __length_hint__. + b = self.type2test(i for i in range(256) if i % 2) + self.assertEqual(len(b), 128) + self.assertEqual(list(b), list(range(256))[1::2]) + + # Sequence without __iter__. + class S: + def __getitem__(self, i): + return (1, 2, 3)[i] + b = self.type2test(S()) + self.assertEqual(b, b"\x01\x02\x03") + + def test_from_tuple(self): + # There is a special case for tuples. + b = self.type2test(tuple(range(256))) + self.assertEqual(len(b), 256) + self.assertEqual(list(b), list(range(256))) + b = self.type2test((1, 2, 3)) + self.assertEqual(b, b"\x01\x02\x03") + def test_from_list(self): - ints = list(range(256)) - b = self.type2test(i for i in ints) + # There is a special case for lists. + b = self.type2test(list(range(256))) self.assertEqual(len(b), 256) - self.assertEqual(list(b), ints) + self.assertEqual(list(b), list(range(256))) + b = self.type2test([1, 2, 3]) + self.assertEqual(b, b"\x01\x02\x03") def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), @@ -71,6 +110,20 @@ def test_from_index(self): self.assertRaises(ValueError, self.type2test, [Indexable(-1)]) self.assertRaises(ValueError, self.type2test, [Indexable(256)]) + def test_from_buffer(self): + a = self.type2test(array.array('B', [1, 2, 3])) + self.assertEqual(a, b"\x01\x02\x03") + a = self.type2test(b"\x01\x02\x03") + self.assertEqual(a, b"\x01\x02\x03") + + # http://bugs.python.org/issue29159 + # Fallback when __index__ raises exception other than OverflowError + class B(bytes): + def __index__(self): + raise TypeError + + self.assertEqual(self.type2test(B(b"foobar")), b"foobar") + def test_from_ssize(self): self.assertEqual(self.type2test(0), b'') self.assertEqual(self.type2test(1), b'\x00') From webhook-mailer at python.org Sun Oct 14 12:41:14 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Sun, 14 Oct 2018 16:41:14 -0000 Subject: [Python-checkins] bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) Message-ID: https://github.com/python/cpython/commit/bd036d3d15fc1310ccc32a43a3296b8c157ac221 commit: bd036d3d15fc1310ccc32a43a3296b8c157ac221 branch: master author: Pablo Galindo committer: GitHub date: 2018-10-14T17:41:11+01:00 summary: bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) * Add News entry for the change in multiprocessing.reduction.recvfds made in GH-9613. files: A Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst new file mode 100644 index 000000000000..4f4a7f74864f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst @@ -0,0 +1,3 @@ +Use :func:`socket.CMSG_SPACE` to calculate ancillary data size instead of +:func:`socket.CMSG_LEN` in :func:`multiprocessing.reduction.recvfds` as +:rfc:`3542` requires the use of the former for portable applications. From webhook-mailer at python.org Sun Oct 14 13:01:06 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Sun, 14 Oct 2018 17:01:06 -0000 Subject: [Python-checkins] bpo-34939: Allow annotated global names in module namespace (GH-9844) Message-ID: https://github.com/python/cpython/commit/de2aea0ff02fa9486365ce9d215bef150fae3a0b commit: de2aea0ff02fa9486365ce9d215bef150fae3a0b branch: master author: Pablo Galindo committer: GitHub date: 2018-10-14T18:01:03+01:00 summary: bpo-34939: Allow annotated global names in module namespace (GH-9844) Allow annotated global names in the module namespace after the symbol is declared as global. Previously, only symbols annotated before they are declared as global (i.e. inside a function) were allowed. This change allows symbols to be declared as global before the annotation happens in the global scope. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-17-40-15.bpo-34939.0gpxlJ.rst M Lib/test/test_symtable.py M Python/symtable.c diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index 2cd735bdc508..8d76f6fe45f9 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -144,6 +144,20 @@ def test_annotated(self): self.assertTrue(st4.lookup('x').is_local()) self.assertFalse(st4.lookup('x').is_annotated()) + # Test that annotations in the global scope are valid after the + # variable is declared as nonlocal. + st5 = symtable.symtable('global x\nx: int', 'test', 'exec') + self.assertTrue(st5.lookup("x").is_global()) + + # Test that annotations for nonlocals are valid after the + # variable is declared as nonlocal. + st6 = symtable.symtable('def g():\n' + ' x = 2\n' + ' def f():\n' + ' nonlocal x\n' + ' x: int', + 'test', 'exec') + def test_imported(self): self.assertTrue(self.top.lookup("sys").is_imported()) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-17-40-15.bpo-34939.0gpxlJ.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-17-40-15.bpo-34939.0gpxlJ.rst new file mode 100644 index 000000000000..b588f72d903b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-17-40-15.bpo-34939.0gpxlJ.rst @@ -0,0 +1,2 @@ +Allow annotated names in module namespace that are declared global before +the annotation happens. Patch by Pablo Galindo. diff --git a/Python/symtable.c b/Python/symtable.c index d74f26fbe35a..dc934a556daa 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1175,6 +1175,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) VISIT_QUIT(st, 0); } if ((cur & (DEF_GLOBAL | DEF_NONLOCAL)) + && (st->st_cur->ste_symbols != st->st_global) && s->v.AnnAssign.simple) { PyErr_Format(PyExc_SyntaxError, cur & DEF_GLOBAL ? GLOBAL_ANNOT : NONLOCAL_ANNOT, From webhook-mailer at python.org Sun Oct 14 17:03:01 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 14 Oct 2018 21:03:01 -0000 Subject: [Python-checkins] bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852) Message-ID: https://github.com/python/cpython/commit/e890421e334ccf0c000c6b29c4a521d86cd12f47 commit: e890421e334ccf0c000c6b29c4a521d86cd12f47 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-15T00:02:57+03:00 summary: bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852) bytes and bytearray constructors converted unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst M Lib/test/test_bytes.py M Objects/bytearrayobject.c M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index b7b48bfe17f6..b9c5b628c4eb 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -126,8 +126,8 @@ def test_from_buffer(self): a = self.type2test(b"\x01\x02\x03") self.assertEqual(a, b"\x01\x02\x03") - # http://bugs.python.org/issue29159 - # Fallback when __index__ raises exception other than OverflowError + # Issues #29159 and #34974. + # Fallback when __index__ raises a TypeError class B(bytes): def __index__(self): raise TypeError @@ -184,6 +184,20 @@ def test_constructor_overflow(self): except (OverflowError, MemoryError): pass + def test_constructor_exceptions(self): + # Issue #34974: bytes and bytearray constructors replace unexpected + # exceptions. + class BadInt: + def __index__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadInt()) + self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()]) + + class BadIterable: + def __iter__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadIterable()) + def test_compare(self): b1 = self.type2test([1, 2, 3]) b2 = self.type2test([1, 2, 3]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst new file mode 100644 index 000000000000..2a7e773648ec --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst @@ -0,0 +1,3 @@ +:class:`bytes` and :class:`bytearray` constructors no longer convert +unexpected exceptions (e.g. :exc:`MemoryError` and :exc:`KeyboardInterrupt`) +to :exc:`TypeError`. diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 4e2bb603151b..58fe53bcca47 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -41,7 +41,6 @@ _getbytevalue(PyObject* arg, int *value) } else { PyObject *index = PyNumber_Index(arg); if (index == NULL) { - PyErr_Format(PyExc_TypeError, "an integer is required"); *value = -1; return 0; } @@ -821,7 +820,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) if (PyIndex_Check(arg)) { count = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return -1; PyErr_Clear(); /* fall through */ } diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index d51d1ba023c3..22d46878a38e 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2596,7 +2596,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (PyIndex_Check(x)) { size = PyNumber_AsSsize_t(x, PyExc_OverflowError); if (size == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return NULL; PyErr_Clear(); /* fall through */ } @@ -2778,6 +2778,9 @@ PyBytes_FromObject(PyObject *x) Py_DECREF(it); return result; } + if (!PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } } PyErr_Format(PyExc_TypeError, From webhook-mailer at python.org Sun Oct 14 17:26:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 14 Oct 2018 21:26:31 -0000 Subject: [Python-checkins] bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852) Message-ID: https://github.com/python/cpython/commit/1370832af24cc6f0f464354b9ec3ecdb343d35ce commit: 1370832af24cc6f0f464354b9ec3ecdb343d35ce branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-14T14:26:28-07:00 summary: bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852) bytes and bytearray constructors converted unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError. (cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst M Lib/test/test_bytes.py M Objects/bytearrayobject.c M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index b7b48bfe17f6..b9c5b628c4eb 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -126,8 +126,8 @@ def test_from_buffer(self): a = self.type2test(b"\x01\x02\x03") self.assertEqual(a, b"\x01\x02\x03") - # http://bugs.python.org/issue29159 - # Fallback when __index__ raises exception other than OverflowError + # Issues #29159 and #34974. + # Fallback when __index__ raises a TypeError class B(bytes): def __index__(self): raise TypeError @@ -184,6 +184,20 @@ def test_constructor_overflow(self): except (OverflowError, MemoryError): pass + def test_constructor_exceptions(self): + # Issue #34974: bytes and bytearray constructors replace unexpected + # exceptions. + class BadInt: + def __index__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadInt()) + self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()]) + + class BadIterable: + def __iter__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadIterable()) + def test_compare(self): b1 = self.type2test([1, 2, 3]) b2 = self.type2test([1, 2, 3]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst new file mode 100644 index 000000000000..2a7e773648ec --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst @@ -0,0 +1,3 @@ +:class:`bytes` and :class:`bytearray` constructors no longer convert +unexpected exceptions (e.g. :exc:`MemoryError` and :exc:`KeyboardInterrupt`) +to :exc:`TypeError`. diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 692b7be73924..3f3e6bcf0cb8 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -41,7 +41,6 @@ _getbytevalue(PyObject* arg, int *value) } else { PyObject *index = PyNumber_Index(arg); if (index == NULL) { - PyErr_Format(PyExc_TypeError, "an integer is required"); *value = -1; return 0; } @@ -821,7 +820,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) if (PyIndex_Check(arg)) { count = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return -1; PyErr_Clear(); /* fall through */ } diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 32ff5afe3e02..5b628420937d 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2597,7 +2597,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (PyIndex_Check(x)) { size = PyNumber_AsSsize_t(x, PyExc_OverflowError); if (size == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return NULL; PyErr_Clear(); /* fall through */ } @@ -2779,6 +2779,9 @@ PyBytes_FromObject(PyObject *x) Py_DECREF(it); return result; } + if (!PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } } PyErr_Format(PyExc_TypeError, From webhook-mailer at python.org Sun Oct 14 17:32:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 14 Oct 2018 21:32:06 -0000 Subject: [Python-checkins] bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852) Message-ID: https://github.com/python/cpython/commit/08ba7eb89d5353af31ef9e66a5337abea1b676ef commit: 08ba7eb89d5353af31ef9e66a5337abea1b676ef branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-14T14:32:03-07:00 summary: bpo-34974: Do not replace unexpected errors in bytes() and bytearray(). (GH-9852) bytes and bytearray constructors converted unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError. (cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst M Lib/test/test_bytes.py M Objects/bytearrayobject.c M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 8c9d17fd1614..8b1973241e45 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -126,8 +126,8 @@ def test_from_buffer(self): a = self.type2test(b"\x01\x02\x03") self.assertEqual(a, b"\x01\x02\x03") - # http://bugs.python.org/issue29159 - # Fallback when __index__ raises exception other than OverflowError + # Issues #29159 and #34974. + # Fallback when __index__ raises a TypeError class B(bytes): def __index__(self): raise TypeError @@ -184,6 +184,20 @@ def test_constructor_overflow(self): except (OverflowError, MemoryError): pass + def test_constructor_exceptions(self): + # Issue #34974: bytes and bytearray constructors replace unexpected + # exceptions. + class BadInt: + def __index__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadInt()) + self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()]) + + class BadIterable: + def __iter__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadIterable()) + def test_compare(self): b1 = self.type2test([1, 2, 3]) b2 = self.type2test([1, 2, 3]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst new file mode 100644 index 000000000000..2a7e773648ec --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst @@ -0,0 +1,3 @@ +:class:`bytes` and :class:`bytearray` constructors no longer convert +unexpected exceptions (e.g. :exc:`MemoryError` and :exc:`KeyboardInterrupt`) +to :exc:`TypeError`. diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 15524572929c..673dd0c65133 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -39,7 +39,6 @@ _getbytevalue(PyObject* arg, int *value) } else { PyObject *index = PyNumber_Index(arg); if (index == NULL) { - PyErr_Format(PyExc_TypeError, "an integer is required"); *value = -1; return 0; } @@ -819,7 +818,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) if (PyIndex_Check(arg)) { count = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return -1; PyErr_Clear(); /* fall through */ } diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 04ebe0b701e6..cd39ad632bbc 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2606,7 +2606,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (PyIndex_Check(x)) { size = PyNumber_AsSsize_t(x, PyExc_OverflowError); if (size == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return NULL; PyErr_Clear(); /* fall through */ } @@ -2788,6 +2788,9 @@ PyBytes_FromObject(PyObject *x) Py_DECREF(it); return result; } + if (!PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } } PyErr_Format(PyExc_TypeError, From webhook-mailer at python.org Mon Oct 15 01:46:21 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 15 Oct 2018 05:46:21 -0000 Subject: [Python-checkins] [2.7] bpo-34974: Do not replace unexpected errors in bytearray(). (GH-9852) (GH-9885) Message-ID: https://github.com/python/cpython/commit/43308dfc3335906cfefe9f14a44e468935f3c321 commit: 43308dfc3335906cfefe9f14a44e468935f3c321 branch: 2.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-15T08:46:16+03:00 summary: [2.7] bpo-34974: Do not replace unexpected errors in bytearray(). (GH-9852) (GH-9885) The bytearray constructor converted unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError. (cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47) files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst M Lib/test/test_bytes.py M Objects/bytearrayobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 9b5f713b0b88..c04f7b305a0a 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -116,8 +116,8 @@ def test_from_buffer(self): a = self.type2test(b"\x01\x02\x03") self.assertEqual(a, b"\x01\x02\x03") - # http://bugs.python.org/issue29159 - # Fallback when __index__ raises exception other than OverflowError + # Issues #29159 and #34974. + # Fallback when __index__ raises a TypeError class B(bytes): def __index__(self): raise TypeError @@ -156,6 +156,20 @@ def test_constructor_value_errors(self): self.assertRaises(ValueError, self.type2test, [sys.maxint+1]) self.assertRaises(ValueError, self.type2test, [10**100]) + def test_constructor_exceptions(self): + # Issue #34974: bytes and bytearray constructors replace unexpected + # exceptions. + class BadInt: + def __index__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadInt()) + self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()]) + + class BadIterable: + def __iter__(self): + 1/0 + self.assertRaises(ZeroDivisionError, self.type2test, BadIterable()) + def test_compare(self): b1 = self.type2test([1, 2, 3]) b2 = self.type2test([1, 2, 3]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst new file mode 100644 index 000000000000..34e6273db948 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-22-24-19.bpo-34974.7LgTc2.rst @@ -0,0 +1,3 @@ +The :class:`bytearray` constructor no longer convert +unexpected exceptions (e.g. :exc:`MemoryError` and :exc:`KeyboardInterrupt`) +to :exc:`TypeError`. diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index c178d9ef65d4..a96d6d981ddd 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -41,8 +41,10 @@ _getbytevalue(PyObject* arg, int *value) else { PyObject *index = PyNumber_Index(arg); if (index == NULL) { - PyErr_Format(PyExc_TypeError, - "an integer or string of size 1 is required"); + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + PyErr_Format(PyExc_TypeError, + "an integer or string of size 1 is required"); + } return 0; } face_value = PyLong_AsLong(index); @@ -852,7 +854,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) /* Is it an int? */ count = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError)) return -1; PyErr_Clear(); } From solipsis at pitrou.net Mon Oct 15 06:00:12 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 15 Oct 2018 10:00:12 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=6 Message-ID: <20181015100012.1.74A06BB6B656C32F@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 8, 0] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [1, -2, 2] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogJt3nxj', '--timeout', '7200'] From vadmium+py at gmail.com Fri Oct 12 19:03:20 2018 From: vadmium+py at gmail.com (Martin Panter) Date: Fri, 12 Oct 2018 23:03:20 +0000 Subject: [Python-checkins] [Python-Dev] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796) In-Reply-To: <125297d6-545f-3052-0900-9df2072f0057@trueblade.com> References: <42Wj0P517lzFrcx@mail.python.org> <125297d6-545f-3052-0900-9df2072f0057@trueblade.com> Message-ID: On 12/10/2018, Eric V. Smith wrote: > On 10/12/2018 5:17 AM, Tal Einat wrote: > >> The latest stable releases can always be found on the `Python download page >> -`_. There are two recommended production-ready >> -versions at this point in time, because at the moment there are two branches of >> -stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since >> -currently there is more third party software available for Python 2 than for >> -Python 3. Python 2 code will generally not run unchanged in Python 3. >> +`_. There are two production-ready version >> +of Python: 2.x and 3.x, but the recommended one at this times is Python 3.x. > > This should be "time", not "times". I'd fix it, but I'm unsure if this > is being backported or not, and I don't want to mess up any merges > before they're done. Or just remove ?at this time[s]?; it doesn?t add much. Also, ?two . . . version? should be changed back to plural: ?two . . . versions?. > I do think this should backported to 3.7, 3.6, and 2.7. > >> +Although Python 2.x is still widely used, `it will not be >> +maintained after January 1, 2020 >> `_. >> +Python 2.x was known for having more third-party libraries available, >> however, >> +by the time of this writing, most of the widely used libraries support >> Python 3.x, > > Should probably be "at the time of this writing". > >> +and some are even dropping the Python 2.x support. > > And this would read better as "are even dropping support for Python 2.x". From webhook-mailer at python.org Mon Oct 15 14:41:43 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Mon, 15 Oct 2018 18:41:43 -0000 Subject: [Python-checkins] bpo-34844: logging.Formatter enhancement - Ensure style and format string matches in logging.Formatter (GH-9703) Message-ID: https://github.com/python/cpython/commit/18fb1fb943b7dbd7f8a76017ee2a67ef13effb85 commit: 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85 branch: master author: BNMetrics committer: Vinay Sajip date: 2018-10-15T19:41:36+01:00 summary: bpo-34844: logging.Formatter enhancement - Ensure style and format string matches in logging.Formatter (GH-9703) files: A Misc/NEWS.d/next/Library/2018-10-04-20-44-45.bpo-34844.Hnuxav.rst M Doc/library/logging.config.rst M Doc/library/logging.rst M Lib/logging/__init__.py M Lib/logging/config.py M Lib/test/test_logging.py diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst index de805eb955df..7f6c3c69739d 100644 --- a/Doc/library/logging.config.rst +++ b/Doc/library/logging.config.rst @@ -226,6 +226,11 @@ otherwise, the context is used to determine what to instantiate. (with defaults of ``None``) and these are used to construct a :class:`~logging.Formatter` instance. + .. versionchanged:: 3.8 + a ``validate`` key (with default of ``True``) can be added into + the ``formatters`` section of the configuring dict, this is to + validate the format. + * *filters* - the corresponding value will be a dict in which each key is a filter id and each value is a dict describing how to configure the corresponding Filter instance. diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index c63ea212e41f..71a46ac7f20a 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -544,6 +544,10 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on .. versionchanged:: 3.2 The *style* parameter was added. + .. versionchanged:: 3.8 + The *validate* parameter was added. Incorrect or mismatched style and fmt + will raise a ``ValueError``. + For example: ``logging.Formatter('%(asctime)s - %(message)s', style='{')``. .. method:: format(record) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 7aeff45f2666..58afcd29c90a 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -23,9 +23,11 @@ To use, simply 'import logging' and log away! """ -import sys, os, time, io, traceback, warnings, weakref, collections.abc +import sys, os, time, io, re, traceback, warnings, weakref, collections.abc from string import Template +from string import Formatter as StrFormatter + __all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', 'FATAL', 'FileHandler', 'Filter', 'Formatter', 'Handler', 'INFO', @@ -413,15 +415,20 @@ def makeLogRecord(dict): rv.__dict__.update(dict) return rv + #--------------------------------------------------------------------------- # Formatter classes and functions #--------------------------------------------------------------------------- +_str_formatter = StrFormatter() +del StrFormatter + class PercentStyle(object): default_format = '%(message)s' asctime_format = '%(asctime)s' asctime_search = '%(asctime)' + validation_pattern = re.compile(r'%\(\w+\)[#0+ -]*(\*|\d+)?(\.(\*|\d+))?[diouxefgcrsa%]', re.I) def __init__(self, fmt): self._fmt = fmt or self.default_format @@ -429,17 +436,50 @@ def __init__(self, fmt): def usesTime(self): return self._fmt.find(self.asctime_search) >= 0 - def format(self, record): + def validate(self): + """Validate the input format, ensure it matches the correct style""" + if not self.validation_pattern.search(self._fmt): + raise ValueError("Invalid format '%s' for '%s' style" % (self._fmt, self.default_format[0])) + + def _format(self, record): return self._fmt % record.__dict__ + def format(self, record): + try: + return self._format(record) + except KeyError as e: + raise ValueError('Formatting field not found in record: %s' % e) + + class StrFormatStyle(PercentStyle): default_format = '{message}' asctime_format = '{asctime}' asctime_search = '{asctime' - def format(self, record): + fmt_spec = re.compile(r'^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$', re.I) + field_spec = re.compile(r'^(\d+|\w+)(\.\w+|\[[^]]+\])*$') + + def _format(self, record): return self._fmt.format(**record.__dict__) + def validate(self): + """Validate the input format, ensure it is the correct string formatting style""" + fields = set() + try: + for _, fieldname, spec, conversion in _str_formatter.parse(self._fmt): + if fieldname: + if not self.field_spec.match(fieldname): + raise ValueError('invalid field name/expression: %r' % fieldname) + fields.add(fieldname) + if conversion and conversion not in 'rsa': + raise ValueError('invalid conversion: %r' % conversion) + if spec and not self.fmt_spec.match(spec): + raise ValueError('bad specifier: %r' % spec) + except ValueError as e: + raise ValueError('invalid format: %s' % e) + if not fields: + raise ValueError('invalid format: no fields') + class StringTemplateStyle(PercentStyle): default_format = '${message}' @@ -454,9 +494,24 @@ def usesTime(self): fmt = self._fmt return fmt.find('$asctime') >= 0 or fmt.find(self.asctime_format) >= 0 - def format(self, record): + def validate(self): + pattern = Template.pattern + fields = set() + for m in pattern.finditer(self._fmt): + d = m.groupdict() + if d['named']: + fields.add(d['named']) + elif d['braced']: + fields.add(d['braced']) + elif m.group(0) == '$': + raise ValueError('invalid format: bare \'$\' not allowed') + if not fields: + raise ValueError('invalid format: no fields') + + def _format(self, record): return self._tpl.substitute(**record.__dict__) + BASIC_FORMAT = "%(levelname)s:%(name)s:%(message)s" _STYLES = { @@ -510,7 +565,7 @@ class Formatter(object): converter = time.localtime - def __init__(self, fmt=None, datefmt=None, style='%'): + def __init__(self, fmt=None, datefmt=None, style='%', validate=True): """ Initialize the formatter with specified format strings. @@ -530,6 +585,9 @@ def __init__(self, fmt=None, datefmt=None, style='%'): raise ValueError('Style must be one of: %s' % ','.join( _STYLES.keys())) self._style = _STYLES[style][0](fmt) + if validate: + self._style.validate() + self._fmt = self._style._fmt self.datefmt = datefmt diff --git a/Lib/logging/config.py b/Lib/logging/config.py index fa1a398aee2a..cfd93116eedd 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -666,11 +666,19 @@ def configure_formatter(self, config): dfmt = config.get('datefmt', None) style = config.get('style', '%') cname = config.get('class', None) + if not cname: c = logging.Formatter else: c = _resolve(cname) - result = c(fmt, dfmt, style) + + # A TypeError would be raised if "validate" key is passed in with a formatter callable + # that does not accept "validate" as a parameter + if 'validate' in config: # if user hasn't mentioned it, the default will be fine + result = c(fmt, dfmt, style, config['validate']) + else: + result = c(fmt, dfmt, style) + return result def configure_filter(self, config): diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index d352e5fa3f3d..9802955e6a98 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -2125,6 +2125,10 @@ def test_warnings_no_handlers(self): def formatFunc(format, datefmt=None): return logging.Formatter(format, datefmt) +class myCustomFormatter: + def __init__(self, fmt, datefmt=None): + pass + def handlerFunc(): return logging.StreamHandler() @@ -2765,6 +2769,114 @@ class ConfigDictTest(BaseTest): } } + # Configuration with custom logging.Formatter subclass as '()' key and 'validate' set to False + custom_formatter_class_validate = { + 'version': 1, + 'formatters': { + 'form1': { + '()': __name__ + '.ExceptionFormatter', + 'format': '%(levelname)s:%(name)s:%(message)s', + 'validate': False, + }, + }, + 'handlers' : { + 'hand1' : { + 'class': 'logging.StreamHandler', + 'formatter': 'form1', + 'level': 'NOTSET', + 'stream': 'ext://sys.stdout', + }, + }, + "loggers": { + "my_test_logger_custom_formatter": { + "level": "DEBUG", + "handlers": ["hand1"], + "propagate": "true" + } + } + } + + # Configuration with custom logging.Formatter subclass as 'class' key and 'validate' set to False + custom_formatter_class_validate2 = { + 'version': 1, + 'formatters': { + 'form1': { + 'class': __name__ + '.ExceptionFormatter', + 'format': '%(levelname)s:%(name)s:%(message)s', + 'validate': False, + }, + }, + 'handlers' : { + 'hand1' : { + 'class': 'logging.StreamHandler', + 'formatter': 'form1', + 'level': 'NOTSET', + 'stream': 'ext://sys.stdout', + }, + }, + "loggers": { + "my_test_logger_custom_formatter": { + "level": "DEBUG", + "handlers": ["hand1"], + "propagate": "true" + } + } + } + + # Configuration with custom class that is not inherited from logging.Formatter + custom_formatter_class_validate3 = { + 'version': 1, + 'formatters': { + 'form1': { + 'class': __name__ + '.myCustomFormatter', + 'format': '%(levelname)s:%(name)s:%(message)s', + 'validate': False, + }, + }, + 'handlers' : { + 'hand1' : { + 'class': 'logging.StreamHandler', + 'formatter': 'form1', + 'level': 'NOTSET', + 'stream': 'ext://sys.stdout', + }, + }, + "loggers": { + "my_test_logger_custom_formatter": { + "level": "DEBUG", + "handlers": ["hand1"], + "propagate": "true" + } + } + } + + # Configuration with custom function and 'validate' set to False + custom_formatter_with_function = { + 'version': 1, + 'formatters': { + 'form1': { + '()': formatFunc, + 'format': '%(levelname)s:%(name)s:%(message)s', + 'validate': False, + }, + }, + 'handlers' : { + 'hand1' : { + 'class': 'logging.StreamHandler', + 'formatter': 'form1', + 'level': 'NOTSET', + 'stream': 'ext://sys.stdout', + }, + }, + "loggers": { + "my_test_logger_custom_formatter": { + "level": "DEBUG", + "handlers": ["hand1"], + "propagate": "true" + } + } + } + def apply_config(self, conf): logging.config.dictConfig(conf) @@ -3163,12 +3275,43 @@ def verify_reverse(stuff): ], pat=r"^[\w.]+ -> (\w+): (\d+)$") def test_out_of_order(self): - self.apply_config(self.out_of_order) + self.assertRaises(ValueError, self.apply_config, self.out_of_order) + + def test_out_of_order_with_dollar_style(self): + config = self.out_of_order.copy() + config['formatters']['mySimpleFormatter']['format'] = "${asctime} (${name}) ${levelname}: ${message}" + + self.apply_config(config) handler = logging.getLogger('mymodule').handlers[0] self.assertIsInstance(handler.target, logging.Handler) self.assertIsInstance(handler.formatter._style, logging.StringTemplateStyle) + def test_custom_formatter_class_with_validate(self): + self.apply_config(self.custom_formatter_class_validate) + handler = logging.getLogger("my_test_logger_custom_formatter").handlers[0] + self.assertIsInstance(handler.formatter, ExceptionFormatter) + + def test_custom_formatter_class_with_validate2(self): + self.apply_config(self.custom_formatter_class_validate2) + handler = logging.getLogger("my_test_logger_custom_formatter").handlers[0] + self.assertIsInstance(handler.formatter, ExceptionFormatter) + + def test_custom_formatter_class_with_validate2_with_wrong_fmt(self): + config = self.custom_formatter_class_validate.copy() + config['formatters']['form1']['style'] = "$" + + # Exception should not be raise as we have configured 'validate' to False + self.apply_config(config) + handler = logging.getLogger("my_test_logger_custom_formatter").handlers[0] + self.assertIsInstance(handler.formatter, ExceptionFormatter) + + def test_custom_formatter_class_with_validate3(self): + self.assertRaises(ValueError, self.apply_config, self.custom_formatter_class_validate3) + + def test_custom_formatter_function_with_validate(self): + self.assertRaises(ValueError, self.apply_config, self.custom_formatter_with_function) + def test_baseconfig(self): d = { 'atuple': (1, 2, 3), @@ -3485,20 +3628,26 @@ def get_record(self, name=None): result.update(self.variants[name]) return logging.makeLogRecord(result) + def assert_error_message(self, exception, message, *args, **kwargs): + try: + self.assertRaises(exception, *args, **kwargs) + except exception as e: + self.assertEqual(message, e.message) + def test_percent(self): # Test %-formatting r = self.get_record() f = logging.Formatter('${%(message)s}') self.assertEqual(f.format(r), '${Message with 2 placeholders}') f = logging.Formatter('%(random)s') - self.assertRaises(KeyError, f.format, r) + self.assertRaises(ValueError, f.format, r) self.assertFalse(f.usesTime()) f = logging.Formatter('%(asctime)s') self.assertTrue(f.usesTime()) f = logging.Formatter('%(asctime)-15s') self.assertTrue(f.usesTime()) - f = logging.Formatter('asctime') - self.assertFalse(f.usesTime()) + f = logging.Formatter('%(asctime)#15s') + self.assertTrue(f.usesTime()) def test_braces(self): # Test {}-formatting @@ -3506,7 +3655,8 @@ def test_braces(self): f = logging.Formatter('$%{message}%$', style='{') self.assertEqual(f.format(r), '$%Message with 2 placeholders%$') f = logging.Formatter('{random}', style='{') - self.assertRaises(KeyError, f.format, r) + self.assertRaises(ValueError, f.format, r) + f = logging.Formatter("{message}", style='{') self.assertFalse(f.usesTime()) f = logging.Formatter('{asctime}', style='{') self.assertTrue(f.usesTime()) @@ -3514,27 +3664,177 @@ def test_braces(self): self.assertTrue(f.usesTime()) f = logging.Formatter('{asctime:15}', style='{') self.assertTrue(f.usesTime()) - f = logging.Formatter('asctime', style='{') - self.assertFalse(f.usesTime()) def test_dollars(self): # Test $-formatting r = self.get_record() + f = logging.Formatter('${message}', style='$') + self.assertEqual(f.format(r), 'Message with 2 placeholders') f = logging.Formatter('$message', style='$') self.assertEqual(f.format(r), 'Message with 2 placeholders') f = logging.Formatter('$$%${message}%$$', style='$') self.assertEqual(f.format(r), '$%Message with 2 placeholders%$') f = logging.Formatter('${random}', style='$') - self.assertRaises(KeyError, f.format, r) + self.assertRaises(ValueError, f.format, r) self.assertFalse(f.usesTime()) f = logging.Formatter('${asctime}', style='$') self.assertTrue(f.usesTime()) - f = logging.Formatter('${asctime', style='$') - self.assertFalse(f.usesTime()) f = logging.Formatter('$asctime', style='$') self.assertTrue(f.usesTime()) - f = logging.Formatter('asctime', style='$') + f = logging.Formatter('${message}', style='$') self.assertFalse(f.usesTime()) + f = logging.Formatter('${asctime}--', style='$') + self.assertTrue(f.usesTime()) + + def test_format_validate(self): + # Check correct formatting + # Percentage style + f = logging.Formatter("%(levelname)-15s - %(message) 5s - %(process)03d - %(module) - %(asctime)*.3s") + self.assertEqual(f._fmt, "%(levelname)-15s - %(message) 5s - %(process)03d - %(module) - %(asctime)*.3s") + f = logging.Formatter("%(asctime)*s - %(asctime)*.3s - %(process)-34.33o") + self.assertEqual(f._fmt, "%(asctime)*s - %(asctime)*.3s - %(process)-34.33o") + f = logging.Formatter("%(process)#+027.23X") + self.assertEqual(f._fmt, "%(process)#+027.23X") + f = logging.Formatter("%(foo)#.*g") + self.assertEqual(f._fmt, "%(foo)#.*g") + + # StrFormat Style + f = logging.Formatter("$%{message}%$ - {asctime!a:15} - {customfield['key']}", style="{") + self.assertEqual(f._fmt, "$%{message}%$ - {asctime!a:15} - {customfield['key']}") + f = logging.Formatter("{process:.2f} - {custom.f:.4f}", style="{") + self.assertEqual(f._fmt, "{process:.2f} - {custom.f:.4f}") + f = logging.Formatter("{customfield!s:#<30}", style="{") + self.assertEqual(f._fmt, "{customfield!s:#<30}") + f = logging.Formatter("{message!r}", style="{") + self.assertEqual(f._fmt, "{message!r}") + f = logging.Formatter("{message!s}", style="{") + self.assertEqual(f._fmt, "{message!s}") + f = logging.Formatter("{message!a}", style="{") + self.assertEqual(f._fmt, "{message!a}") + f = logging.Formatter("{process!r:4.2}", style="{") + self.assertEqual(f._fmt, "{process!r:4.2}") + f = logging.Formatter("{process!s:<#30,.12f}- {custom:=+#30,.1d} - {module:^30}", style="{") + self.assertEqual(f._fmt, "{process!s:<#30,.12f}- {custom:=+#30,.1d} - {module:^30}") + f = logging.Formatter("{process!s:{w},.{p}}", style="{") + self.assertEqual(f._fmt, "{process!s:{w},.{p}}") + f = logging.Formatter("{foo:12.{p}}", style="{") + self.assertEqual(f._fmt, "{foo:12.{p}}") + f = logging.Formatter("{foo:{w}.6}", style="{") + self.assertEqual(f._fmt, "{foo:{w}.6}") + f = logging.Formatter("{foo[0].bar[1].baz}", style="{") + self.assertEqual(f._fmt, "{foo[0].bar[1].baz}") + f = logging.Formatter("{foo[k1].bar[k2].baz}", style="{") + self.assertEqual(f._fmt, "{foo[k1].bar[k2].baz}") + f = logging.Formatter("{12[k1].bar[k2].baz}", style="{") + self.assertEqual(f._fmt, "{12[k1].bar[k2].baz}") + + # Dollar style + f = logging.Formatter("${asctime} - $message", style="$") + self.assertEqual(f._fmt, "${asctime} - $message") + f = logging.Formatter("$bar $$", style="$") + self.assertEqual(f._fmt, "$bar $$") + f = logging.Formatter("$bar $$$$", style="$") + self.assertEqual(f._fmt, "$bar $$$$") # this would print two $($$) + + # Testing when ValueError being raised from incorrect format + # Percentage Style + self.assertRaises(ValueError, logging.Formatter, "%(asctime)Z") + self.assertRaises(ValueError, logging.Formatter, "%(asctime)b") + self.assertRaises(ValueError, logging.Formatter, "%(asctime)*") + self.assertRaises(ValueError, logging.Formatter, "%(asctime)*3s") + self.assertRaises(ValueError, logging.Formatter, "%(asctime)_") + self.assertRaises(ValueError, logging.Formatter, '{asctime}') + self.assertRaises(ValueError, logging.Formatter, '${message}') + self.assertRaises(ValueError, logging.Formatter, '%(foo)#12.3*f') # with both * and decimal number as precision + self.assertRaises(ValueError, logging.Formatter, '%(foo)0*.8*f') + + # StrFormat Style + # Testing failure for '-' in field name + self.assert_error_message( + ValueError, + "invalid field name/expression: 'name-thing'", + logging.Formatter, "{name-thing}", style="{" + ) + # Testing failure for style mismatch + self.assert_error_message( + ValueError, + "invalid format: no fields", + logging.Formatter, '%(asctime)s', style='{' + ) + # Testing failure for invalid conversion + self.assert_error_message( + ValueError, + "invalid conversion: 'Z'" + ) + self.assertRaises(ValueError, logging.Formatter, '{asctime!s:#30,15f}', style='{') + self.assert_error_message( + ValueError, + "invalid format: expected ':' after conversion specifier", + logging.Formatter, '{asctime!aa:15}', style='{' + ) + # Testing failure for invalid spec + self.assert_error_message( + ValueError, + "bad specifier: '.2ff'", + logging.Formatter, '{process:.2ff}', style='{' + ) + self.assertRaises(ValueError, logging.Formatter, '{process:.2Z}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{process!s:<##30,12g}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{process!s:<#30#,12g}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{process!s:{{w}},{{p}}}', style='{') + # Testing failure for mismatch braces + self.assert_error_message( + ValueError, + "invalid format: unmatched '{' in format spec", + logging.Formatter, '{process', style='{' + ) + self.assert_error_message( + ValueError, + "invalid format: unmatched '{' in format spec", + logging.Formatter, 'process}', style='{' + ) + self.assertRaises(ValueError, logging.Formatter, '{{foo!r:4.2}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{{foo!r:4.2}}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo/bar}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo:{{w}}.{{p}}}}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo!X:{{w}}.{{p}}}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo!a:random}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo!a:ran{dom}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo!a:ran{d}om}', style='{') + self.assertRaises(ValueError, logging.Formatter, '{foo.!a:d}', style='{') + + # Dollar style + # Testing failure for mismatch bare $ + self.assert_error_message( + ValueError, + "invalid format: bare \'$\' not allowed", + logging.Formatter, '$bar $$$', style='$' + ) + self.assert_error_message( + ValueError, + "invalid format: bare \'$\' not allowed", + logging.Formatter, 'bar $', style='$' + ) + self.assert_error_message( + ValueError, + "invalid format: bare \'$\' not allowed", + logging.Formatter, 'foo $.', style='$' + ) + # Testing failure for mismatch style + self.assert_error_message( + ValueError, + "invalid format: no fields", + logging.Formatter, '{asctime}', style='$' + ) + self.assertRaises(ValueError, logging.Formatter, '%(asctime)s', style='$') + + # Testing failure for incorrect fields + self.assert_error_message( + ValueError, + "invalid format: no fields", + logging.Formatter, 'foo', style='$' + ) + self.assertRaises(ValueError, logging.Formatter, '${asctime', style='$') def test_invalid_style(self): self.assertRaises(ValueError, logging.Formatter, None, None, 'x') @@ -4000,10 +4300,10 @@ def test_stream(self): self.assertEqual(handler.stream, stream) def test_format(self): - logging.basicConfig(format='foo') + logging.basicConfig(format='%(asctime)s - %(message)s') formatter = logging.root.handlers[0].formatter - self.assertEqual(formatter._style._fmt, 'foo') + self.assertEqual(formatter._style._fmt, '%(asctime)s - %(message)s') def test_datefmt(self): logging.basicConfig(datefmt='bar') @@ -4032,11 +4332,11 @@ def test_incompatible(self): handlers = [logging.StreamHandler()] stream = sys.stderr assertRaises(ValueError, logging.basicConfig, filename='test.log', - stream=stream) + stream=stream) assertRaises(ValueError, logging.basicConfig, filename='test.log', - handlers=handlers) + handlers=handlers) assertRaises(ValueError, logging.basicConfig, stream=stream, - handlers=handlers) + handlers=handlers) # Issue 23207: test for invalid kwargs assertRaises(ValueError, logging.basicConfig, loglevel=logging.INFO) # Should pop both filename and filemode even if filename is None diff --git a/Misc/NEWS.d/next/Library/2018-10-04-20-44-45.bpo-34844.Hnuxav.rst b/Misc/NEWS.d/next/Library/2018-10-04-20-44-45.bpo-34844.Hnuxav.rst new file mode 100644 index 000000000000..464dcb1e4ceb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-04-20-44-45.bpo-34844.Hnuxav.rst @@ -0,0 +1,6 @@ +logging.Formatter enhancement - Ensure styles and fmt matches in +logging.Formatter - Added validate method in each format style class: +StrFormatStyle, PercentStyle, StringTemplateStyle. - This method is called +in the constructor of logging.Formatter class - Also re-raise the KeyError +in the format method of each style class, so it would a bit clear that it's +an error with the invalid format fields. From webhook-mailer at python.org Mon Oct 15 15:06:57 2018 From: webhook-mailer at python.org (Brian Curtin) Date: Mon, 15 Oct 2018 19:06:57 -0000 Subject: [Python-checkins] fix dangling keyfunc examples in documentation of heapq and sorted (#1432) Message-ID: https://github.com/python/cpython/commit/6bdb6f7675922e601e742758c7c240a751fd365b commit: 6bdb6f7675922e601e742758c7c240a751fd365b branch: master author: Wolfgang Maier committer: Brian Curtin date: 2018-10-15T13:06:53-06:00 summary: fix dangling keyfunc examples in documentation of heapq and sorted (#1432) * fix dangling mention of key=str.lower in heapq doc * Fix dangling mention of keyfunc example for sorted() files: M Doc/library/functions.rst M Doc/library/heapq.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 17960eb9c10e..e7b98eb44b2e 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1412,8 +1412,8 @@ are always available. They are listed here in alphabetical order. Has two optional arguments which must be specified as keyword arguments. *key* specifies a function of one argument that is used to extract a comparison - key from each list element: ``key=str.lower``. The default value is ``None`` - (compare the elements directly). + key from each element in *iterable* (for example, ``key=str.lower``). The + default value is ``None`` (compare the elements directly). *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index 0b1a3c8b00ce..8b00f7b27959 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -112,17 +112,17 @@ The module also offers three general purpose functions based on heaps. Return a list with the *n* largest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key, - reverse=True)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, + reverse=True)[:n]``. .. function:: nsmallest(n, iterable, key=None) Return a list with the *n* smallest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:n]``. The latter two functions perform best for smaller values of *n*. For larger From webhook-mailer at python.org Mon Oct 15 15:07:26 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 15 Oct 2018 19:07:26 -0000 Subject: [Python-checkins] Stop using deprecated logging API in Sphinx suspicious checker (GH-9875) Message-ID: https://github.com/python/cpython/commit/ee171a26c1169abfae534b08acc0d95c6e45a22a commit: ee171a26c1169abfae534b08acc0d95c6e45a22a branch: master author: Pablo Galindo committer: GitHub date: 2018-10-15T20:07:23+01:00 summary: Stop using deprecated logging API in Sphinx suspicious checker (GH-9875) files: M Doc/tools/extensions/suspicious.py diff --git a/Doc/tools/extensions/suspicious.py b/Doc/tools/extensions/suspicious.py index 0a70e57d2b04..8d80f6759bff 100644 --- a/Doc/tools/extensions/suspicious.py +++ b/Doc/tools/extensions/suspicious.py @@ -48,6 +48,7 @@ from docutils import nodes from sphinx.builders import Builder +import sphinx.util detect_all = re.compile(r''' ::(?=[^=])| # two :: (but NOT ::=) @@ -85,6 +86,7 @@ class CheckSuspiciousMarkupBuilder(Builder): Checks for possibly invalid markup that may leak into the output. """ name = 'suspicious' + logger = sphinx.util.logging.getLogger("CheckSuspiciousMarkupBuilder") def init(self): # create output file @@ -116,7 +118,7 @@ def finish(self): self.warn('Found %s/%s unused rules:' % (len(unused_rules), len(self.rules))) for rule in unused_rules: - self.info(repr(rule)) + self.logger.info(repr(rule)) return def check_issue(self, line, lineno, issue): @@ -146,7 +148,7 @@ def is_ignored(self, line, lineno, issue): return False def report_issue(self, text, lineno, issue): - if not self.any_issue: self.info() + if not self.any_issue: self.logger.info() self.any_issue = True self.write_log_entry(lineno, issue, text) if py3: @@ -181,7 +183,7 @@ def load_rules(self, filename): A csv file, with exactly the same format as suspicious.csv Fields: document name (normalized), line number, issue, surrounding text """ - self.info("loading ignore rules... ", nonl=1) + self.logger.info("loading ignore rules... ", nonl=1) self.rules = rules = [] try: if py3: @@ -206,7 +208,7 @@ def load_rules(self, filename): rule = Rule(docname, lineno, issue, text) rules.append(rule) f.close() - self.info('done, %d rules loaded' % len(self.rules)) + self.logger.info('done, %d rules loaded' % len(self.rules)) def get_lineno(node): From webhook-mailer at python.org Mon Oct 15 15:19:13 2018 From: webhook-mailer at python.org (Brian Curtin) Date: Mon, 15 Oct 2018 19:19:13 -0000 Subject: [Python-checkins] fix dangling keyfunc examples in documentation of heapq and sorted (GH-1432) Message-ID: https://github.com/python/cpython/commit/c804a5975d9704f67e201ee2765eadc8b159ad27 commit: c804a5975d9704f67e201ee2765eadc8b159ad27 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Brian Curtin date: 2018-10-15T13:19:08-06:00 summary: fix dangling keyfunc examples in documentation of heapq and sorted (GH-1432) * fix dangling mention of key=str.lower in heapq doc * Fix dangling mention of keyfunc example for sorted() (cherry picked from commit 6bdb6f7675922e601e742758c7c240a751fd365b) Co-authored-by: Wolfgang Maier files: M Doc/library/functions.rst M Doc/library/heapq.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index bb472862e493..c0f4ffd2cb2a 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1405,8 +1405,8 @@ are always available. They are listed here in alphabetical order. Has two optional arguments which must be specified as keyword arguments. *key* specifies a function of one argument that is used to extract a comparison - key from each list element: ``key=str.lower``. The default value is ``None`` - (compare the elements directly). + key from each element in *iterable* (for example, ``key=str.lower``). The + default value is ``None`` (compare the elements directly). *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index 0b1a3c8b00ce..8b00f7b27959 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -112,17 +112,17 @@ The module also offers three general purpose functions based on heaps. Return a list with the *n* largest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key, - reverse=True)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, + reverse=True)[:n]``. .. function:: nsmallest(n, iterable, key=None) Return a list with the *n* smallest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:n]``. The latter two functions perform best for smaller values of *n*. For larger From webhook-mailer at python.org Mon Oct 15 15:19:26 2018 From: webhook-mailer at python.org (Brian Curtin) Date: Mon, 15 Oct 2018 19:19:26 -0000 Subject: [Python-checkins] fix dangling keyfunc examples in documentation of heapq and sorted (GH-1432) Message-ID: https://github.com/python/cpython/commit/407f3dd69192ee8614faf1f9a484045a39174c74 commit: 407f3dd69192ee8614faf1f9a484045a39174c74 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Brian Curtin date: 2018-10-15T13:19:22-06:00 summary: fix dangling keyfunc examples in documentation of heapq and sorted (GH-1432) * fix dangling mention of key=str.lower in heapq doc * Fix dangling mention of keyfunc example for sorted() (cherry picked from commit 6bdb6f7675922e601e742758c7c240a751fd365b) Co-authored-by: Wolfgang Maier files: M Doc/library/functions.rst M Doc/library/heapq.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index b6e52469bd85..bc528dd1711d 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1383,8 +1383,8 @@ are always available. They are listed here in alphabetical order. Has two optional arguments which must be specified as keyword arguments. *key* specifies a function of one argument that is used to extract a comparison - key from each list element: ``key=str.lower``. The default value is ``None`` - (compare the elements directly). + key from each element in *iterable* (for example, ``key=str.lower``). The + default value is ``None`` (compare the elements directly). *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index 7e33e7481467..d04033b1ffa0 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -110,17 +110,17 @@ The module also offers three general purpose functions based on heaps. Return a list with the *n* largest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key, - reverse=True)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, + reverse=True)[:n]``. .. function:: nsmallest(n, iterable, key=None) Return a list with the *n* smallest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:n]``. The latter two functions perform best for smaller values of *n*. For larger From webhook-mailer at python.org Mon Oct 15 16:52:39 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 15 Oct 2018 20:52:39 -0000 Subject: [Python-checkins] [3.7] bpo-11233: Create availability directive for documentation (GH-9692) (GH-9830) Message-ID: https://github.com/python/cpython/commit/b248a8c9a5e7cf6b8e84a3efda493fccfc511316 commit: b248a8c9a5e7cf6b8e84a3efda493fccfc511316 branch: 3.7 author: Cheryl Sabella committer: Victor Stinner date: 2018-10-15T22:52:26+02:00 summary: [3.7] bpo-11233: Create availability directive for documentation (GH-9692) (GH-9830) Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl (cherry picked from commit 2d6097d027e0dd3debbabc702aa9c98d94ba32a3) Co-authored-by: Cheryl Sabella files: A Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst M Doc/c-api/exceptions.rst M Doc/c-api/init.rst M Doc/library/_thread.rst M Doc/library/asyncio-eventloop.rst M Doc/library/asyncio-policy.rst M Doc/library/asyncio-stream.rst M Doc/library/asyncore.rst M Doc/library/codecs.rst M Doc/library/hashlib.rst M Doc/library/intro.rst M Doc/library/mimetypes.rst M Doc/library/os.path.rst M Doc/library/os.rst M Doc/library/resource.rst M Doc/library/select.rst M Doc/library/shutil.rst M Doc/library/signal.rst M Doc/library/socket.rst M Doc/library/ssl.rst M Doc/library/subprocess.rst M Doc/library/sys.rst M Doc/library/threading.rst M Doc/library/time.rst M Doc/tools/extensions/pyspecific.py M Doc/tools/rstlint.py M Doc/using/cmdline.rst diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 2bc1bd876a2f..dd1e026cb071 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -186,34 +186,42 @@ NULL pointer for use in a ``return`` statement. then it constructs a tuple object whose first item is the *ierr* value and whose second item is the corresponding error message (gotten from :c:func:`FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError, - object)``. This function always returns *NULL*. Availability: Windows. + object)``. This function always returns *NULL*. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr) Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter - specifying the exception type to be raised. Availability: Windows. + specifying the exception type to be raised. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename) Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the filename is given as a C string. *filename* is decoded from the filesystem - encoding (:func:`os.fsdecode`). Availability: Windows. + encoding (:func:`os.fsdecode`). + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename) Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an additional parameter specifying the exception type to be raised. - Availability: Windows. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObjects(PyObject *type, int ierr, PyObject *filename, PyObject *filename2) Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but accepts a second filename object. - Availability: Windows. + + .. availability:: Windows. .. versionadded:: 3.4 @@ -221,7 +229,9 @@ NULL pointer for use in a ``return`` statement. .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename) Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional - parameter specifying the exception type to be raised. Availability: Windows. + parameter specifying the exception type to be raised. + + .. availability:: Windows. .. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path) diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 694b4669eea8..50998be5747b 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -156,7 +156,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. See :pep:`529` for more details. - Availability: Windows. + .. availability:: Windows. .. c:var:: Py_LegacyWindowsStdioFlag @@ -168,7 +168,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. See :pep:`528` for more details. - Availability: Windows. + .. availability:: Windows. .. c:var:: Py_NoSiteFlag diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst index 67cb70944f4d..acffabf24bad 100644 --- a/Doc/library/_thread.rst +++ b/Doc/library/_thread.rst @@ -101,7 +101,8 @@ This module defines the following constants and functions: memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information). - Availability: Windows, systems with POSIX threads. + + .. availability:: Windows, systems with POSIX threads. .. data:: TIMEOUT_MAX diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index a61b971acbdc..df453cdfb7d8 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -504,7 +504,7 @@ Opening network connections See the documentation of the :meth:`loop.create_connection` method for information about arguments to this method. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -624,7 +624,7 @@ Creating network servers See the documentation of the :meth:`loop.create_server` method for information about arguments to this method. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -973,7 +973,7 @@ Unix signals Return ``True`` if the signal handler was removed, or ``False`` if no handler was set for the given signal. -Availability: Unix. + .. availability:: Unix. .. seealso:: @@ -1417,14 +1417,14 @@ on all platforms. asyncio.set_event_loop(loop) - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. class:: ProactorEventLoop An event loop for Windows that uses "I/O Completion Ports" (IOCP). - Availability: Windows. + .. availability:: Windows. An example how to use :class:`ProactorEventLoop` on Windows:: diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index 42f936da468e..cab25934d782 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -103,7 +103,7 @@ asyncio ships with the following built-in policies: An alternative event loop policy that uses the :class:`ProactorEventLoop` event loop implementation. - Availability: Windows. + .. availability:: Windows. Process Watchers diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst index c543aa6d4179..42b4c1f76d3e 100644 --- a/Doc/library/asyncio-stream.rst +++ b/Doc/library/asyncio-stream.rst @@ -115,7 +115,7 @@ and work with streams: See also the documentation of :meth:`loop.create_unix_connection`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -137,7 +137,7 @@ and work with streams: See also the documentation of :meth:`loop.create_unix_server`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index 11d36163e44a..a86518ebff27 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -273,14 +273,18 @@ any that have been added to the map during asynchronous service) is closed. with an optional map argument and wraps it for use with the :c:func:`poll` or :c:func:`loop` functions. If provided a file object or anything with a :c:func:`fileno` method, that method will be called and passed to the - :class:`file_wrapper` constructor. Availability: UNIX. + :class:`file_wrapper` constructor. + + .. availability:: Unix. .. class:: file_wrapper() A file_wrapper takes an integer file descriptor and calls :func:`os.dup` to duplicate the handle so that the original handle may be closed independently of the file_wrapper. This class implements sufficient methods to emulate a - socket for use by the :class:`file_dispatcher` class. Availability: UNIX. + socket for use by the :class:`file_dispatcher` class. + + .. availability:: Unix. .. _asyncore-example-1: diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 24008a0b3f00..b9c04c241a8b 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1471,7 +1471,7 @@ functions can be used directly if desired. Encode operand according to the ANSI codepage (CP_ACP). -Availability: Windows only. +.. availability:: Windows only. .. versionchanged:: 3.3 Support any error handler. diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index baf6b0af242c..ab4414f3b51b 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -271,7 +271,7 @@ include a `salt `_. factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). *dklen* is the length of the derived key. - Availability: OpenSSL 1.1+ + .. availability:: OpenSSL 1.1+. .. versionadded:: 3.6 diff --git a/Doc/library/intro.rst b/Doc/library/intro.rst index e3283cac9947..8567e4d1d089 100644 --- a/Doc/library/intro.rst +++ b/Doc/library/intro.rst @@ -47,3 +47,16 @@ this material. Let the show begin! + +.. _availability: + +Notes on availability +===================== + +* An "Availability: Unix" note means that this function is commonly found on + Unix systems. It does not make any claims about its existence on a specific + operating system. + +* If not separately noted, all functions that claim "Availability: Unix" are + supported on Mac OS X, which builds on a Unix core. + diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 67b7a7178534..5c1982b4735e 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -255,7 +255,9 @@ than one MIME-type database; it provides an interface similar to the one of the .. method:: MimeTypes.read_windows_registry(strict=True) - Load MIME type information from the Windows registry. Availability: Windows. + Load MIME type information from the Windows registry. + + .. availability:: Windows. If *strict* is ``True``, information will be added to the list of standard types, else to the list of non-standard types. diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 36bb21c222ed..75e7e5be9121 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -85,7 +85,7 @@ the :mod:`glob` module.) pathnames, or if *paths* is empty. Unlike :func:`commonprefix`, this returns a valid path. - Availability: Unix, Windows + .. availability:: Unix, Windows. .. versionadded:: 3.5 @@ -349,7 +349,7 @@ the :mod:`glob` module.) *start* defaults to :attr:`os.curdir`. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -361,7 +361,7 @@ the :mod:`glob` module.) This is determined by the device number and i-node number and raises an exception if an :func:`os.stat` call on either pathname fails. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added Windows support. @@ -377,7 +377,7 @@ the :mod:`glob` module.) Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added Windows support. @@ -393,7 +393,7 @@ the :mod:`glob` module.) :func:`os.lstat`, or :func:`os.stat`. This function implements the underlying comparison used by :func:`samefile` and :func:`sameopenfile`. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.4 Added Windows support. diff --git a/Doc/library/os.rst b/Doc/library/os.rst index d937451be51e..907c6c307fb1 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -32,15 +32,6 @@ Notes on the availability of these functions: objects, and result in an object of the same type, if a path or file name is returned. -* An "Availability: Unix" note means that this function is commonly found on - Unix systems. It does not make any claims about its existence on a specific - operating system. - -* If not separately noted, all functions that claim "Availability: Unix" are - supported on Mac OS X, which builds on a Unix core. - -.. Availability notes get their own line and occur at the end of the function -.. documentation. .. note:: @@ -105,7 +96,7 @@ process and user. Return the filename corresponding to the controlling terminal of the process. - Availability: Unix. + .. availability:: Unix. .. data:: environ @@ -235,7 +226,7 @@ process and user. and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you would like to use a different encoding. - Availability: most flavors of Unix, Windows. + .. availability:: most flavors of Unix, Windows. .. function:: getenvb(key, default=None) @@ -246,7 +237,7 @@ process and user. :func:`getenvb` is only available if :data:`supports_bytes_environ` is True. - Availability: most flavors of Unix. + .. availability:: most flavors of Unix. .. versionadded:: 3.2 @@ -267,7 +258,7 @@ process and user. Return the effective group id of the current process. This corresponds to the "set id" bit on the file being executed in the current process. - Availability: Unix. + .. availability:: Unix. .. function:: geteuid() @@ -276,7 +267,7 @@ process and user. Return the current process's effective user id. - Availability: Unix. + .. availability:: Unix. .. function:: getgid() @@ -285,7 +276,7 @@ process and user. Return the real group id of the current process. - Availability: Unix. + .. availability:: Unix. .. function:: getgrouplist(user, group) @@ -294,7 +285,7 @@ process and user. list, it is included; typically, *group* is specified as the group ID field from the password record for *user*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -303,7 +294,7 @@ process and user. Return list of supplemental group ids associated with the current process. - Availability: Unix. + .. availability:: Unix. .. note:: @@ -331,7 +322,7 @@ process and user. falls back to ``pwd.getpwuid(os.getuid())[0]`` to get the login name of the current real user id. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: getpgid(pid) @@ -339,7 +330,7 @@ process and user. Return the process group id of the process with process id *pid*. If *pid* is 0, the process group id of the current process is returned. - Availability: Unix. + .. availability:: Unix. .. function:: getpgrp() @@ -347,7 +338,7 @@ process and user. Return the id of the current process group. - Availability: Unix. + .. availability:: Unix. .. function:: getpid() @@ -365,7 +356,7 @@ process and user. the id returned is the one of the init process (1), on Windows it is still the same id, which may be already reused by another process. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added support for Windows. @@ -383,7 +374,7 @@ process and user. (respectively) the calling process, the process group of the calling process, or the real user ID of the calling process. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -394,7 +385,7 @@ process and user. Parameters for the :func:`getpriority` and :func:`setpriority` functions. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -404,7 +395,7 @@ process and user. Return a tuple (ruid, euid, suid) denoting the current process's real, effective, and saved user ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -414,7 +405,7 @@ process and user. Return a tuple (rgid, egid, sgid) denoting the current process's real, effective, and saved group ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -425,7 +416,7 @@ process and user. Return the current process's real user id. - Availability: Unix. + .. availability:: Unix. .. function:: initgroups(username, gid) @@ -434,7 +425,7 @@ process and user. the groups of which the specified username is a member, plus the specified group id. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -447,7 +438,7 @@ process and user. changes to the environment affect subprocesses started with :func:`os.system`, :func:`popen` or :func:`fork` and :func:`execv`. - Availability: most flavors of Unix, Windows. + .. availability:: most flavors of Unix, Windows. .. note:: @@ -464,21 +455,21 @@ process and user. Set the current process's effective group id. - Availability: Unix. + .. availability:: Unix. .. function:: seteuid(euid) Set the current process's effective user id. - Availability: Unix. + .. availability:: Unix. .. function:: setgid(gid) Set the current process' group id. - Availability: Unix. + .. availability:: Unix. .. function:: setgroups(groups) @@ -487,7 +478,7 @@ process and user. *groups*. *groups* must be a sequence, and each element must be an integer identifying a group. This operation is typically available only to the superuser. - Availability: Unix. + .. availability:: Unix. .. note:: On Mac OS X, the length of *groups* may not exceed the system-defined maximum number of effective group ids, typically 16. @@ -499,7 +490,7 @@ process and user. Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on which version is implemented (if any). See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setpgid(pid, pgrp) @@ -508,7 +499,7 @@ process and user. process with id *pid* to the process group with id *pgrp*. See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setpriority(which, who, priority) @@ -525,7 +516,7 @@ process and user. *priority* is a value in the range -20 to 19. The default priority is 0; lower priorities cause more favorable scheduling. - Availability: Unix + .. availability:: Unix. .. versionadded:: 3.3 @@ -534,14 +525,14 @@ process and user. Set the current process's real and effective group ids. - Availability: Unix. + .. availability:: Unix. .. function:: setresgid(rgid, egid, sgid) Set the current process's real, effective, and saved group ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -550,7 +541,7 @@ process and user. Set the current process's real, effective, and saved user ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.2 @@ -559,21 +550,21 @@ process and user. Set the current process's real and effective user ids. - Availability: Unix. + .. availability:: Unix. .. function:: getsid(pid) Call the system call :c:func:`getsid`. See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setsid() Call the system call :c:func:`setsid`. See the Unix manual for the semantics. - Availability: Unix. + .. availability:: Unix. .. function:: setuid(uid) @@ -582,7 +573,7 @@ process and user. Set the current process's user id. - Availability: Unix. + .. availability:: Unix. .. placed in this section since it relates to errno.... a little weak @@ -631,7 +622,7 @@ process and user. :func:`socket.gethostname` or even ``socket.gethostbyaddr(socket.gethostname())``. - Availability: recent flavors of Unix. + .. availability:: recent flavors of Unix. .. versionchanged:: 3.3 Return type changed from a tuple to a tuple-like object @@ -651,7 +642,7 @@ process and user. calls to :func:`unsetenv` don't update ``os.environ``, so it is actually preferable to delete items of ``os.environ``. - Availability: most flavors of Unix, Windows. + .. availability:: most flavors of Unix, Windows. .. _os-newstreams: @@ -754,7 +745,7 @@ as internal buffering of data. docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, this is equivalent to ``os.chmod(fd, mode)``. - Availability: Unix. + .. availability:: Unix. .. function:: fchown(fd, uid, gid) @@ -764,7 +755,7 @@ as internal buffering of data. :func:`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``. - Availability: Unix. + .. availability:: Unix. .. function:: fdatasync(fd) @@ -772,7 +763,7 @@ as internal buffering of data. Force write of file with filedescriptor *fd* to disk. Does not force update of metadata. - Availability: Unix. + .. availability:: Unix. .. note:: This function is not available on MacOS. @@ -795,7 +786,7 @@ as internal buffering of data. As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``. - Availability: Unix. + .. availability:: Unix. .. function:: fstat(fd) @@ -816,7 +807,7 @@ as internal buffering of data. file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is equivalent to ``os.statvfs(fd)``. - Availability: Unix. + .. availability:: Unix. .. function:: fsync(fd) @@ -828,7 +819,7 @@ as internal buffering of data. ``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal buffers associated with *f* are written to disk. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: ftruncate(fd, length) @@ -837,7 +828,7 @@ as internal buffering of data. most *length* bytes in size. As of Python 3.3, this is equivalent to ``os.truncate(fd, length)``. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.5 Added support for Windows @@ -849,7 +840,7 @@ as internal buffering of data. See also :func:`set_blocking` and :meth:`socket.socket.setblocking`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.5 @@ -867,7 +858,7 @@ as internal buffering of data. :data:`F_ULOCK` or :data:`F_TEST`. *len* specifies the section of the file to lock. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -879,7 +870,7 @@ as internal buffering of data. Flags that specify what action :func:`lockf` will take. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1011,7 +1002,7 @@ or `the MSDN `_ on Windo descriptors are :ref:`non-inheritable `. For a (slightly) more portable approach, use the :mod:`pty` module. - Availability: some flavors of Unix. + .. availability:: some flavors of Unix. .. versionchanged:: 3.4 The new file descriptors are now non-inheritable. @@ -1023,7 +1014,7 @@ or `the MSDN `_ on Windo reading and writing, respectively. The new file descriptor is :ref:`non-inheritable `. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.4 The new file descriptors are now non-inheritable. @@ -1037,7 +1028,7 @@ or `the MSDN `_ on Windo Return a pair of file descriptors ``(r, w)`` usable for reading and writing, respectively. - Availability: some flavors of Unix. + .. availability:: some flavors of Unix. .. versionadded:: 3.3 @@ -1047,7 +1038,7 @@ or `the MSDN `_ on Windo Ensures that enough disk space is allocated for the file specified by *fd* starting from *offset* and continuing for *len* bytes. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1062,7 +1053,7 @@ or `the MSDN `_ on Windo :data:`POSIX_FADV_RANDOM`, :data:`POSIX_FADV_NOREUSE`, :data:`POSIX_FADV_WILLNEED` or :data:`POSIX_FADV_DONTNEED`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1077,7 +1068,7 @@ or `the MSDN `_ on Windo Flags that can be used in *advice* in :func:`posix_fadvise` that specify the access pattern that is likely to be used. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1090,7 +1081,7 @@ or `the MSDN `_ on Windo Return a bytestring containing the bytes read. If the end of the file referred to by *fd* has been reached, an empty bytes object is returned. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1116,8 +1107,8 @@ or `the MSDN `_ on Windo Combine the functionality of :func:`os.readv` and :func:`os.pread`. - Availability: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, - OpenBSD 2.7 and newer. Using flags requires Linux 4.6 or newer. + .. availability:: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, + OpenBSD 2.7 and newer. Using flags requires Linux 4.6 or newer. .. versionadded:: 3.7 @@ -1132,7 +1123,7 @@ or `the MSDN `_ on Windo If no bytes were read, it will return ``-1`` and set errno to :data:`errno.EAGAIN`. - Availability: Linux 4.14 and newer. + .. availability:: Linux 4.14 and newer. .. versionadded:: 3.7 @@ -1146,7 +1137,7 @@ or `the MSDN `_ on Windo Currently, on Linux, this feature is usable only on a file descriptor opened using the :data:`O_DIRECT` flag. - Availability: Linux 4.6 and newer. + .. availability:: Linux 4.6 and newer. .. versionadded:: 3.7 @@ -1158,7 +1149,7 @@ or `the MSDN `_ on Windo Return the number of bytes actually written. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1184,8 +1175,8 @@ or `the MSDN `_ on Windo Combine the functionality of :func:`os.writev` and :func:`os.pwrite`. - Availability: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, - OpenBSD 2.7 and newer. Using flags requires Linux 4.7 or newer. + .. availability:: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, + OpenBSD 2.7 and newer. Using flags requires Linux 4.7 or newer. .. versionadded:: 3.7 @@ -1195,7 +1186,7 @@ or `the MSDN `_ on Windo Provide a per-write equivalent of the :data:`O_DSYNC` ``open(2)`` flag. This flag effect applies only to the data range written by the system call. - Availability: Linux 4.7 and newer. + .. availability:: Linux 4.7 and newer. .. versionadded:: 3.7 @@ -1205,7 +1196,7 @@ or `the MSDN `_ on Windo Provide a per-write equivalent of the :data:`O_SYNC` ``open(2)`` flag. This flag effect applies only to the data range written by the system call. - Availability: Linux 4.7 and newer. + .. availability:: Linux 4.7 and newer. .. versionadded:: 3.7 @@ -1257,7 +1248,7 @@ or `the MSDN `_ on Windo Cross-platform applications should not use *headers*, *trailers* and *flags* arguments. - Availability: Unix. + .. availability:: Unix. .. note:: @@ -1274,7 +1265,7 @@ or `the MSDN `_ on Windo See also :func:`get_blocking` and :meth:`socket.socket.setblocking`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.5 @@ -1286,7 +1277,7 @@ or `the MSDN `_ on Windo Parameters to the :func:`sendfile` function, if the implementation supports them. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1304,7 +1295,7 @@ or `the MSDN `_ on Windo The operating system may set a limit (:func:`sysconf` value ``'SC_IOV_MAX'``) on the number of buffers that can be used. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1314,7 +1305,7 @@ or `the MSDN `_ on Windo Return the process group associated with the terminal given by *fd* (an open file descriptor as returned by :func:`os.open`). - Availability: Unix. + .. availability:: Unix. .. function:: tcsetpgrp(fd, pg) @@ -1322,7 +1313,7 @@ or `the MSDN `_ on Windo Set the process group associated with the terminal given by *fd* (an open file descriptor as returned by :func:`os.open`) to *pg*. - Availability: Unix. + .. availability:: Unix. .. function:: ttyname(fd) @@ -1331,7 +1322,7 @@ or `the MSDN `_ on Windo file descriptor *fd*. If *fd* is not associated with a terminal device, an exception is raised. - Availability: Unix. + .. availability:: Unix. .. function:: write(fd, str) @@ -1366,7 +1357,7 @@ or `the MSDN `_ on Windo The operating system may set a limit (:func:`sysconf` value ``'SC_IOV_MAX'``) on the number of buffers that can be used. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1393,7 +1384,7 @@ Querying the size of a terminal should normally be used, ``os.get_terminal_size`` is the low-level implementation. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. class:: terminal_size @@ -1442,13 +1433,13 @@ streams are closed, and inheritable handles are only inherited if the Get the "inheritable" flag of the specified handle (a boolean). - Availability: Windows. + .. availability:: Windows. .. function:: set_handle_inheritable(handle, inheritable) Set the "inheritable" flag of the specified handle. - Availability: Windows. + .. availability:: Windows. .. _os-file-dir: @@ -1603,7 +1594,7 @@ features: This function can support :ref:`not following symlinks `. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 The *follow_symlinks* argument. @@ -1668,7 +1659,7 @@ features: See :func:`shutil.chown` for a higher-level function that accepts names in addition to numeric ids. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 Added support for specifying an open file descriptor for *path*, @@ -1682,7 +1673,7 @@ features: Change the root directory of the current process to *path*. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1694,7 +1685,7 @@ features: descriptor *fd*. The descriptor must refer to an opened directory, not an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``. - Availability: Unix. + .. availability:: Unix. .. function:: getcwd() @@ -1713,7 +1704,7 @@ features: not follow symbolic links. As of Python 3.3, this is equivalent to ``os.chflags(path, flags, follow_symlinks=False)``. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1726,7 +1717,7 @@ features: for possible values of *mode*. As of Python 3.3, this is equivalent to ``os.chmod(path, mode, follow_symlinks=False)``. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1737,7 +1728,7 @@ features: function will not follow symbolic links. As of Python 3.3, this is equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1751,7 +1742,7 @@ features: supply :ref:`paths relative to directory descriptors `, and :ref:`not following symlinks `. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added Windows support. @@ -1909,7 +1900,7 @@ features: FIFO for reading, and the client opens it for writing. Note that :func:`mkfifo` doesn't open the FIFO --- it just creates the rendezvous point. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 The *dir_fd* argument. @@ -1931,7 +1922,7 @@ features: This function can also support :ref:`paths relative to directory descriptors `. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 The *dir_fd* argument. @@ -1975,7 +1966,7 @@ features: This function can support :ref:`specifying a file descriptor `. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -1987,7 +1978,7 @@ features: the integer values defined for those names by the host operating system. This can be used to determine the set of names known to the system. - Availability: Unix. + .. availability:: Unix. .. function:: readlink(path, *, dir_fd=None) @@ -2005,7 +1996,7 @@ features: This function can also support :ref:`paths relative to directory descriptors `. - Availability: Unix, Windows + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added support for Windows 6.0 (Vista) symbolic links. @@ -2594,7 +2585,7 @@ features: This function can support :ref:`specifying a file descriptor `. - Availability: Unix. + .. availability:: Unix. .. versionchanged:: 3.2 The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added. @@ -2724,7 +2715,7 @@ features: :exc:`OSError` is raised when the function is called by an unprivileged user. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.2 Added support for Windows 6.0 (Vista) symbolic links. @@ -2741,7 +2732,7 @@ features: Force write of everything to disk. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -2753,7 +2744,7 @@ features: This function can support :ref:`specifying a file descriptor `. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionadded:: 3.3 @@ -2962,7 +2953,7 @@ features: for name in dirs: os.rmdir(name, dir_fd=rootfd) - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3139,7 +3130,7 @@ to be ignored. you can check whether or not it is available using :data:`os.supports_fd`. If it is unavailable, using it will raise a :exc:`NotImplementedError`. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionadded:: 3.3 Added support for specifying an open file descriptor for *path* @@ -3173,7 +3164,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means no error occurred. - Availability: Unix. + .. availability:: Unix. .. data:: EX_USAGE @@ -3181,49 +3172,49 @@ written in Python, such as a mail server's external command delivery program. Exit code that means the command was used incorrectly, such as when the wrong number of arguments are given. - Availability: Unix. + .. availability:: Unix. .. data:: EX_DATAERR Exit code that means the input data was incorrect. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOINPUT Exit code that means an input file did not exist or was not readable. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOUSER Exit code that means a specified user did not exist. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOHOST Exit code that means a specified host did not exist. - Availability: Unix. + .. availability:: Unix. .. data:: EX_UNAVAILABLE Exit code that means that a required service is unavailable. - Availability: Unix. + .. availability:: Unix. .. data:: EX_SOFTWARE Exit code that means an internal software error was detected. - Availability: Unix. + .. availability:: Unix. .. data:: EX_OSERR @@ -3231,7 +3222,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means an operating system error was detected, such as the inability to fork or create a pipe. - Availability: Unix. + .. availability:: Unix. .. data:: EX_OSFILE @@ -3239,21 +3230,21 @@ written in Python, such as a mail server's external command delivery program. Exit code that means some system file did not exist, could not be opened, or had some other kind of error. - Availability: Unix. + .. availability:: Unix. .. data:: EX_CANTCREAT Exit code that means a user specified output file could not be created. - Availability: Unix. + .. availability:: Unix. .. data:: EX_IOERR Exit code that means that an error occurred while doing I/O on some file. - Availability: Unix. + .. availability:: Unix. .. data:: EX_TEMPFAIL @@ -3262,7 +3253,7 @@ written in Python, such as a mail server's external command delivery program. that may not really be an error, such as a network connection that couldn't be made during a retryable operation. - Availability: Unix. + .. availability:: Unix. .. data:: EX_PROTOCOL @@ -3270,7 +3261,7 @@ written in Python, such as a mail server's external command delivery program. Exit code that means that a protocol exchange was illegal, invalid, or not understood. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOPERM @@ -3278,21 +3269,21 @@ written in Python, such as a mail server's external command delivery program. Exit code that means that there were insufficient permissions to perform the operation (but not intended for file system problems). - Availability: Unix. + .. availability:: Unix. .. data:: EX_CONFIG Exit code that means that some kind of configuration error occurred. - Availability: Unix. + .. availability:: Unix. .. data:: EX_NOTFOUND Exit code that means something like "an entry was not found". - Availability: Unix. + .. availability:: Unix. .. function:: fork() @@ -3307,7 +3298,7 @@ written in Python, such as a mail server's external command delivery program. See :mod:`ssl` for applications that use the SSL module with fork(). - Availability: Unix. + .. availability:: Unix. .. function:: forkpty() @@ -3318,7 +3309,7 @@ written in Python, such as a mail server's external command delivery program. master end of the pseudo-terminal. For a more portable approach, use the :mod:`pty` module. If an error occurs :exc:`OSError` is raised. - Availability: some flavors of Unix. + .. availability:: some flavors of Unix. .. function:: kill(pid, sig) @@ -3352,14 +3343,14 @@ written in Python, such as a mail server's external command delivery program. Send the signal *sig* to the process group *pgid*. - Availability: Unix. + .. availability:: Unix. .. function:: nice(increment) Add *increment* to the process's "niceness". Return the new niceness. - Availability: Unix. + .. availability:: Unix. .. function:: plock(op) @@ -3367,7 +3358,7 @@ written in Python, such as a mail server's external command delivery program. Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked. - Availability: Unix. + .. availability:: Unix. .. function:: popen(cmd, mode='r', buffering=-1) @@ -3422,7 +3413,7 @@ written in Python, such as a mail server's external command delivery program. There is no way to unregister a function. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -3486,10 +3477,10 @@ written in Python, such as a mail server's external command delivery program. L = ['cp', 'index.html', '/dev/null'] os.spawnvpe(os.P_WAIT, 'cp', L, os.environ) - Availability: Unix, Windows. :func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` - and :func:`spawnvpe` are not available on Windows. :func:`spawnle` and - :func:`spawnve` are not thread-safe on Windows; we advise you to use the - :mod:`subprocess` module instead. + .. availability:: Unix, Windows. :func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` + and :func:`spawnvpe` are not available on Windows. :func:`spawnle` and + :func:`spawnve` are not thread-safe on Windows; we advise you to use the + :mod:`subprocess` module instead. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -3503,7 +3494,7 @@ written in Python, such as a mail server's external command delivery program. will return as soon as the new process has been created, with the process id as the return value. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. data:: P_WAIT @@ -3514,7 +3505,7 @@ written in Python, such as a mail server's external command delivery program. of the process the run is successful, or ``-signal`` if a signal kills the process. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. data:: P_DETACH @@ -3526,7 +3517,7 @@ written in Python, such as a mail server's external command delivery program. console of the calling process. If :const:`P_OVERLAY` is used, the current process will be replaced; the :func:`spawn\* ` function will not return. - Availability: Windows. + .. availability:: Windows. .. function:: startfile(path[, operation]) @@ -3555,7 +3546,7 @@ written in Python, such as a mail server's external command delivery program. function is not resolved until this function is first called. If the function cannot be resolved, :exc:`NotImplementedError` will be raised. - Availability: Windows. + .. availability:: Windows. .. function:: system(command) @@ -3582,7 +3573,7 @@ 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. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: times() @@ -3605,7 +3596,7 @@ written in Python, such as a mail server's external command delivery program. On Windows, only :attr:`user` and :attr:`system` are known; the other attributes are zero. - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. versionchanged:: 3.3 Return type changed from a tuple to a tuple-like object @@ -3620,7 +3611,7 @@ 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. - Availability: Unix. + .. availability:: Unix. .. function:: waitid(idtype, id, options) @@ -3635,7 +3626,7 @@ written in Python, such as a mail server's external command delivery program. :attr:`si_code` or ``None`` if :data:`WNOHANG` is specified and there are no children in a waitable state. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3646,7 +3637,7 @@ written in Python, such as a mail server's external command delivery program. These are the possible values for *idtype* in :func:`waitid`. They affect how *id* is interpreted. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3657,7 +3648,7 @@ written in Python, such as a mail server's external command delivery program. Flags that can be used in *options* in :func:`waitid` that specify what child signal to wait for. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3670,7 +3661,7 @@ written in Python, such as a mail server's external command delivery program. These are the possible values for :attr:`si_code` in the result returned by :func:`waitid`. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -3717,7 +3708,7 @@ written in Python, such as a mail server's external command delivery program. option argument is the same as that provided to :func:`waitpid` and :func:`wait4`. - Availability: Unix. + .. availability:: Unix. .. function:: wait4(pid, options) @@ -3728,7 +3719,7 @@ 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`. - Availability: Unix. + .. availability:: Unix. .. data:: WNOHANG @@ -3736,7 +3727,7 @@ written in Python, such as a mail server's external command delivery program. The option for :func:`waitpid` to return immediately if no child process status is available immediately. The function returns ``(0, 0)`` in this case. - Availability: Unix. + .. availability:: Unix. .. data:: WCONTINUED @@ -3744,7 +3735,7 @@ written in Python, such as a mail server's external command delivery program. This option causes child processes to be reported if they have been continued from a job control stop since their status was last reported. - Availability: some Unix systems. + .. availability:: some Unix systems. .. data:: WUNTRACED @@ -3752,7 +3743,7 @@ written in Python, such as a mail server's external command delivery program. This option causes child processes to be reported if they have been stopped but their current state has not been reported since they were stopped. - Availability: Unix. + .. availability:: Unix. The following functions take a process status code as returned by @@ -3764,7 +3755,7 @@ used to determine the disposition of a process. Return ``True`` if a core dump was generated for the process, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFCONTINUED(status) @@ -3772,7 +3763,7 @@ used to determine the disposition of a process. Return ``True`` if the process has been continued from a job control stop, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFSTOPPED(status) @@ -3780,7 +3771,7 @@ used to determine the disposition of a process. Return ``True`` if the process has been stopped, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFSIGNALED(status) @@ -3788,7 +3779,7 @@ used to determine the disposition of a process. Return ``True`` if the process exited due to a signal, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WIFEXITED(status) @@ -3796,7 +3787,7 @@ used to determine the disposition of a process. Return ``True`` if the process exited using the :manpage:`exit(2)` system call, otherwise return ``False``. - Availability: Unix. + .. availability:: Unix. .. function:: WEXITSTATUS(status) @@ -3804,21 +3795,21 @@ used to determine the disposition of a process. If ``WIFEXITED(status)`` is true, return the integer parameter to the :manpage:`exit(2)` system call. Otherwise, the return value is meaningless. - Availability: Unix. + .. availability:: Unix. .. function:: WSTOPSIG(status) Return the signal which caused the process to stop. - Availability: Unix. + .. availability:: Unix. .. function:: WTERMSIG(status) Return the signal which caused the process to exit. - Availability: Unix. + .. availability:: Unix. Interface to the scheduler @@ -3964,7 +3955,7 @@ Miscellaneous System Information included in ``confstr_names``, an :exc:`OSError` is raised with :const:`errno.EINVAL` for the error number. - Availability: Unix. + .. availability:: Unix. .. data:: confstr_names @@ -3973,7 +3964,7 @@ Miscellaneous System Information defined for those names by the host operating system. This can be used to determine the set of names known to the system. - Availability: Unix. + .. availability:: Unix. .. function:: cpu_count() @@ -3994,7 +3985,7 @@ Miscellaneous System Information 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was unobtainable. - Availability: Unix. + .. availability:: Unix. .. function:: sysconf(name) @@ -4004,7 +3995,7 @@ Miscellaneous System Information the *name* parameter for :func:`confstr` apply here as well; the dictionary that provides information on the known names is given by ``sysconf_names``. - Availability: Unix. + .. availability:: Unix. .. data:: sysconf_names @@ -4013,7 +4004,7 @@ Miscellaneous System Information defined for those names by the host operating system. This can be used to determine the set of names known to the system. - Availability: Unix. + .. availability:: Unix. The following data values are used to support path manipulation operations. These are defined for all platforms. @@ -4125,7 +4116,7 @@ Random numbers See also the `Linux getrandom() manual page `_. - Availability: Linux 3.17 and newer. + .. availability:: Linux 3.17 and newer. .. versionadded:: 3.6 diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst index bdfe5f6d4594..bd49c87f1d78 100644 --- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -92,7 +92,7 @@ this module for those platforms. :exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for the process. - Availability: Linux 2.6.36 or later with glibc 2.13 or later + .. availability:: Linux 2.6.36 or later with glibc 2.13 or later. .. versionadded:: 3.4 @@ -178,7 +178,7 @@ platform. The number of bytes that can be allocated for POSIX message queues. - Availability: Linux 2.6.8 or later. + .. availability:: Linux 2.6.8 or later. .. versionadded:: 3.4 @@ -187,7 +187,7 @@ platform. The ceiling for the process's nice level (calculated as 20 - rlim_cur). - Availability: Linux 2.6.12 or later. + .. availability:: Linux 2.6.12 or later. .. versionadded:: 3.4 @@ -196,7 +196,7 @@ platform. The ceiling of the real-time priority. - Availability: Linux 2.6.12 or later. + .. availability:: Linux 2.6.12 or later. .. versionadded:: 3.4 @@ -206,7 +206,7 @@ platform. The time limit (in microseconds) on CPU time that a process can spend under real-time scheduling without making a blocking syscall. - Availability: Linux 2.6.25 or later. + .. availability:: Linux 2.6.25 or later. .. versionadded:: 3.4 @@ -215,7 +215,7 @@ platform. The number of signals which the process may queue. - Availability: Linux 2.6.8 or later. + .. availability:: Linux 2.6.8 or later. .. versionadded:: 3.4 @@ -225,7 +225,7 @@ platform. This limits the amount of network memory, and hence the amount of mbufs, that this user may hold at any time. - Availability: FreeBSD 9 or later. + .. availability:: FreeBSD 9 or later. .. versionadded:: 3.4 @@ -236,7 +236,7 @@ platform. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. Please see :manpage:`tuning(7)` for a complete description of this sysctl. - Availability: FreeBSD 9 or later. + .. availability:: FreeBSD 9 or later. .. versionadded:: 3.4 @@ -244,7 +244,7 @@ platform. The maximum number of pseudo-terminals created by this user id. - Availability: FreeBSD 9 or later. + .. availability:: FreeBSD 9 or later. .. versionadded:: 3.4 diff --git a/Doc/library/select.rst b/Doc/library/select.rst index 5ffb21583fa5..955ac2a8ef42 100644 --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -171,7 +171,9 @@ The module defines the following: :func:`poll` or another interface in this module. This doesn't apply to other kind of file-like objects such as sockets. - This value is guaranteed by POSIX to be at least 512. Availability: Unix. + This value is guaranteed by POSIX to be at least 512. + + .. availability:: Unix .. versionadded:: 3.2 diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 1527deb167f1..382f75d04f71 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -323,7 +323,7 @@ Directory and files operations .. versionadded:: 3.3 - Availability: Unix, Windows. + .. availability:: Unix, Windows. .. function:: chown(path, user=None, group=None) @@ -334,7 +334,7 @@ Directory and files operations See also :func:`os.chown`, the underlying function. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index fa90dff0d9f4..148a59c7105e 100644 --- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -106,7 +106,7 @@ The variables defined in the :mod:`signal` module are: The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal can only be used with :func:`os.kill`. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.2 @@ -116,7 +116,7 @@ The variables defined in the :mod:`signal` module are: The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This signal can only be used with :func:`os.kill`. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.2 @@ -193,7 +193,9 @@ The :mod:`signal` module defines the following functions: then the number of seconds before any previously set alarm was to have been delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is canceled. If the return value is zero, no alarm is currently scheduled. (See - the Unix man page :manpage:`alarm(2)`.) Availability: Unix. + the Unix man page :manpage:`alarm(2)`.) + + .. availability:: Unix. .. function:: getsignal(signalnum) @@ -234,8 +236,8 @@ The :mod:`signal` module defines the following functions: If *signalnum* is 0, then no signal is sent, but error checking is still performed; this can be used to check if the target thread is still running. - Availability: Unix (see the man page :manpage:`pthread_kill(3)` for further - information). + .. availability:: Unix (see the man page :manpage:`pthread_kill(3)` for further + information). See also :func:`os.kill`. @@ -265,8 +267,8 @@ The :mod:`signal` module defines the following functions: For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the signal mask of the calling thread. - Availability: Unix. See the man page :manpage:`sigprocmask(3)` and - :manpage:`pthread_sigmask(3)` for further information. + .. availability:: Unix. See the man page :manpage:`sigprocmask(3)` and + :manpage:`pthread_sigmask(3)` for further information. See also :func:`pause`, :func:`sigpending` and :func:`sigwait`. @@ -291,13 +293,16 @@ The :mod:`signal` module defines the following functions: The old values are returned as a tuple: (delay, interval). Attempting to pass an invalid interval timer will cause an - :exc:`ItimerError`. Availability: Unix. + :exc:`ItimerError`. + + .. availability:: Unix. .. function:: getitimer(which) Returns current value of a given interval timer specified by *which*. - Availability: Unix. + + .. availability:: Unix. .. function:: set_wakeup_fd(fd, *, warn_on_full_buffer=True) @@ -347,8 +352,10 @@ The :mod:`signal` module defines the following functions: Change system call restart behaviour: if *flag* is :const:`False`, system calls will be restarted when interrupted by signal *signalnum*, otherwise - system calls will be interrupted. Returns nothing. Availability: Unix (see - the man page :manpage:`siginterrupt(3)` for further information). + system calls will be interrupted. Returns nothing. + + .. availability:: Unix (see the man page :manpage:`siginterrupt(3)` + for further information). Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling @@ -387,8 +394,8 @@ The :mod:`signal` module defines the following functions: thread (i.e., the signals which have been raised while blocked). Return the set of the pending signals. - Availability: Unix (see the man page :manpage:`sigpending(2)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigpending(2)` for further + information). See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`. @@ -401,8 +408,8 @@ The :mod:`signal` module defines the following functions: signals specified in the signal set *sigset*. The function accepts the signal (removes it from the pending list of signals), and returns the signal number. - Availability: Unix (see the man page :manpage:`sigwait(3)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigwait(3)` for further + information). See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:`sigwaitinfo` and :func:`sigtimedwait`. @@ -426,8 +433,8 @@ The :mod:`signal` module defines the following functions: :attr:`si_errno`, :attr:`si_pid`, :attr:`si_uid`, :attr:`si_status`, :attr:`si_band`. - Availability: Unix (see the man page :manpage:`sigwaitinfo(2)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigwaitinfo(2)` for further + information). See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`. @@ -445,8 +452,8 @@ The :mod:`signal` module defines the following functions: specifying a timeout. If *timeout* is specified as :const:`0`, a poll is performed. Returns :const:`None` if a timeout occurs. - Availability: Unix (see the man page :manpage:`sigtimedwait(2)` for further - information). + .. availability:: Unix (see the man page :manpage:`sigtimedwait(2)` for further + information). See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`. diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 32e7c5e6c079..37b15774012d 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -161,7 +161,7 @@ created. Socket addresses are represented as follows: - *feat* and *mask* are unsigned 32bit integers. - Availability Linux 2.6.38, some algorithm types require more recent Kernels. + .. availability:: Linux 2.6.38, some algorithm types require more recent Kernels. .. versionadded:: 3.6 @@ -169,7 +169,7 @@ created. Socket addresses are represented as follows: their hosts. The sockets are represented as a ``(CID, port)`` tuple where the context ID or CID and port are integers. - Availability: Linux >= 4.8 QEMU >= 2.8 ESX >= 4.0 ESX Workstation >= 6.5 + .. availability:: Linux >= 4.8 QEMU >= 2.8 ESX >= 4.0 ESX Workstation >= 6.5. .. versionadded:: 3.7 @@ -306,7 +306,7 @@ Constants `Secure File Descriptor Handling `_ for a more thorough explanation. - Availability: Linux >= 2.6.27. + .. availability:: Linux >= 2.6.27. .. versionadded:: 3.2 @@ -354,7 +354,7 @@ Constants Many constants of these forms, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.6.25. + .. availability:: Linux >= 2.6.25. .. versionadded:: 3.3 @@ -365,7 +365,7 @@ Constants Broadcast manager constants, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.6.25. + .. availability:: Linux >= 2.6.25. .. versionadded:: 3.4 @@ -377,7 +377,7 @@ Constants This constant is documented in the Linux documentation. - Availability: Linux >= 3.6. + .. availability:: Linux >= 3.6. .. versionadded:: 3.5 @@ -386,7 +386,7 @@ Constants CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. ISO-TP constants, documented in the Linux documentation. - Availability: Linux >= 2.6.25 + .. availability:: Linux >= 2.6.25. .. versionadded:: 3.7 @@ -398,7 +398,7 @@ Constants Many constants of these forms, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.2. + .. availability:: Linux >= 2.2. .. data:: AF_RDS @@ -409,7 +409,7 @@ Constants Many constants of these forms, documented in the Linux documentation, are also defined in the socket module. - Availability: Linux >= 2.6.30. + .. availability:: Linux >= 2.6.30. .. versionadded:: 3.3 @@ -437,7 +437,7 @@ Constants Constants for Linux Kernel cryptography. - Availability: Linux >= 2.6.38. + .. availability:: Linux >= 2.6.38. .. versionadded:: 3.6 @@ -449,13 +449,13 @@ Constants Constants for Linux host/guest communication. - Availability: Linux >= 4.8. + .. availability:: Linux >= 4.8. .. versionadded:: 3.7 .. data:: AF_LINK - Availability: BSD, OSX. + .. availability:: BSD, OSX. .. versionadded:: 3.4 @@ -604,7 +604,7 @@ The following functions all create :ref:`socket objects `. Instantiate a socket from data obtained from the :meth:`socket.share` method. The socket is assumed to be in blocking mode. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.3 @@ -851,7 +851,7 @@ The :mod:`socket` module also offers various network-related services: both the value of *address_family* and the underlying implementation of :c:func:`inet_pton`. - Availability: Unix (maybe not all platforms), Windows. + .. availability:: Unix (maybe not all platforms), Windows. .. versionchanged:: 3.4 Windows support added @@ -871,7 +871,7 @@ The :mod:`socket` module also offers various network-related services: length for the specified address family, :exc:`ValueError` will be raised. :exc:`OSError` is raised for errors from the call to :func:`inet_ntop`. - Availability: Unix (maybe not all platforms), Windows. + .. availability:: Unix (maybe not all platforms), Windows. .. versionchanged:: 3.4 Windows support added @@ -897,7 +897,7 @@ The :mod:`socket` module also offers various network-related services: buffer. Raises :exc:`OverflowError` if *length* is outside the permissible range of values. - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -918,7 +918,7 @@ The :mod:`socket` module also offers various network-related services: amount of ancillary data that can be received, since additional data may be able to fit into the padding area. - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -943,7 +943,7 @@ The :mod:`socket` module also offers various network-related services: Set the machine's hostname to *name*. This will raise an :exc:`OSError` if you don't have enough rights. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -954,7 +954,7 @@ The :mod:`socket` module also offers various network-related services: (index int, name string) tuples. :exc:`OSError` if the system call fails. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -965,7 +965,7 @@ The :mod:`socket` module also offers various network-related services: interface name. :exc:`OSError` if no interface with the given name exists. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -976,7 +976,7 @@ The :mod:`socket` module also offers various network-related services: interface index number. :exc:`OSError` if no interface with the given index exists. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -1303,7 +1303,7 @@ to sockets. fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) return msg, list(fds) - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -1345,7 +1345,7 @@ to sockets. >>> [b1, b2, b3] [bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')] - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -1449,7 +1449,7 @@ to sockets. def send_fds(sock, msg, fds): return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds))]) - Availability: most Unix platforms, possibly others. + .. availability:: most Unix platforms, possibly others. .. versionadded:: 3.3 @@ -1463,7 +1463,7 @@ to sockets. Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` socket. - Availability: Linux >= 2.6.38 + .. availability:: Linux >= 2.6.38. .. versionadded:: 3.6 @@ -1564,7 +1564,7 @@ to sockets. Once this method has been called, it is safe to close the socket since the operating system has already duplicated it for the target process. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.3 diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 911b28d02346..175ea17ff138 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -328,7 +328,7 @@ Random generation See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for sources of entropy-gathering daemons. - Availability: not available with LibreSSL and OpenSSL > 1.1.0 + .. availability:: not available with LibreSSL and OpenSSL > 1.1.0. .. function:: RAND_add(bytes, entropy) @@ -460,8 +460,8 @@ Certificate handling * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath, * :attr:`openssl_capath` - hard coded path to a capath directory - Availability: LibreSSL ignores the environment vars - :attr:`openssl_cafile_env` and :attr:`openssl_capath_env` + .. availability:: LibreSSL ignores the environment vars + :attr:`openssl_cafile_env` and :attr:`openssl_capath_env`. .. versionadded:: 3.4 @@ -484,7 +484,7 @@ Certificate handling [(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}), (b'data...', 'x509_asn', True)] - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.4 @@ -499,7 +499,7 @@ Certificate handling :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data. - Availability: Windows. + .. availability:: Windows. .. versionadded:: 3.4 @@ -1610,7 +1610,7 @@ to speed up repeated connections from the same clients. 'strength_bits': 128, 'symmetric': 'aes-128-gcm'}] - Availability: OpenSSL 1.0.2+ + .. availability:: OpenSSL 1.0.2+. .. versionadded:: 3.6 diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 23beb52d3b9a..f22f224c7bbb 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1330,7 +1330,7 @@ handling consistency are valid for these functions. >>> subprocess.getstatusoutput('/bin/kill $$') (-15, '') - Availability: POSIX & Windows + .. availability:: POSIX & Windows. .. versionchanged:: 3.3.4 Windows support was added. @@ -1350,7 +1350,7 @@ handling consistency are valid for these functions. >>> subprocess.getoutput('ls /bin/ls') '/bin/ls' - Availability: POSIX & Windows + .. availability:: POSIX & Windows. .. versionchanged:: 3.3.4 Windows support added diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a04d957447a8..33a7b692ddec 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -161,7 +161,9 @@ always available. .. data:: dllhandle - Integer specifying the handle of the Python DLL. Availability: Windows. + Integer specifying the handle of the Python DLL. + + .. availability:: Windows. .. function:: displayhook(value) @@ -457,7 +459,7 @@ always available. Return the build time API version of Android as an integer. - Availability: Android. + .. availability:: Android. .. versionadded:: 3.7 @@ -481,7 +483,9 @@ always available. Return the current value of the flags that are used for :c:func:`dlopen` calls. Symbolic names for the flag values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. - :data:`os.RTLD_LAZY`). Availability: Unix. + :data:`os.RTLD_LAZY`). + + .. availability:: Unix. .. function:: getfilesystemencoding() @@ -649,7 +653,7 @@ always available. is being emulated for the process. It is intended for use in logging rather than for feature detection. - Availability: Windows. + .. availability:: Windows. .. versionchanged:: 3.2 Changed to a named tuple and added *service_pack_minor*, @@ -1074,7 +1078,7 @@ always available. can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`). - Availability: Unix. + .. availability:: Unix. .. function:: setprofile(profilefunc) @@ -1320,7 +1324,7 @@ always available. This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable before launching Python. - Availability: Windows + .. availability:: Windows. .. versionadded:: 3.6 See :pep:`529` for more details. @@ -1466,7 +1470,9 @@ always available. stored as string resource 1000 in the Python DLL. The value is normally the first three characters of :const:`version`. It is provided in the :mod:`sys` module for informational purposes; modifying this value has no effect on the - registry keys used by Python. Availability: Windows. + registry keys used by Python. + + .. availability:: Windows. .. data:: _xoptions diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index e6185c5b3a21..a9d5268dd2b8 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -100,7 +100,8 @@ This module defines the following functions: memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information). - Availability: Windows, systems with POSIX threads. + + .. availability:: Windows, systems with POSIX threads. This module also defines the following constant: diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 3eddc3f1ad3d..56f972c9d032 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -170,8 +170,8 @@ Functions Passing an invalid or expired *thread_id* may result in undefined behavior, such as segmentation fault. - Availability: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for - further information) + .. availability:: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for + further information). .. versionadded:: 3.7 @@ -180,7 +180,7 @@ Functions Return the resolution (precision) of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -190,7 +190,7 @@ Functions Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -199,7 +199,7 @@ Functions Similar to :func:`clock_gettime` but return time as nanoseconds. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -209,7 +209,7 @@ Functions Set the time of the specified clock *clk_id*. Currently, :data:`CLOCK_REALTIME` is the only accepted value for *clk_id*. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -218,7 +218,7 @@ Functions Similar to :func:`clock_settime` but set time with nanoseconds. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.7 @@ -617,8 +617,8 @@ Functions returned value is undefined, so that only the difference between the results of consecutive calls in the same thread is valid. - Availability: Windows, Linux, Unix systems supporting - ``CLOCK_THREAD_CPUTIME_ID``. + .. availability:: Windows, Linux, Unix systems supporting + ``CLOCK_THREAD_CPUTIME_ID``. .. versionadded:: 3.7 @@ -647,7 +647,7 @@ Functions nonzero if there is a time, past, present or future when daylight saving time applies). - Availability: Unix. + .. availability:: Unix. .. note:: @@ -743,7 +743,7 @@ These constants are used as parameters for :func:`clock_getres` and have discontinuities if the time is changed using ``settimeofday()`` or similar. - Availability: Linux 2.6.39 or later. + .. availability:: Linux 2.6.39 or later. .. versionadded:: 3.7 @@ -754,7 +754,7 @@ These constants are used as parameters for :func:`clock_getres` and hardware source, and may give close to nanosecond resolution. ``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock. - Availability: Solaris. + .. availability:: Solaris. .. versionadded:: 3.3 @@ -764,7 +764,7 @@ These constants are used as parameters for :func:`clock_getres` and Clock that cannot be set and represents monotonic time since some unspecified starting point. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -783,7 +783,7 @@ These constants are used as parameters for :func:`clock_getres` and High-resolution per-process timer from the CPU. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 @@ -792,7 +792,7 @@ These constants are used as parameters for :func:`clock_getres` and High-resolution per-process timer from the CPU. - Availability: FreeBSD, NetBSD 7 or later, OpenBSD. + .. availability:: FreeBSD, NetBSD 7 or later, OpenBSD. .. versionadded:: 3.7 @@ -812,7 +812,7 @@ These constants are used as parameters for :func:`clock_getres` and suspended, providing accurate uptime measurement, both absolute and interval. - Availability: FreeBSD, OpenBSD 5.5 or later. + .. availability:: FreeBSD, OpenBSD 5.5 or later. .. versionadded:: 3.7 @@ -825,7 +825,7 @@ The following constant is the only parameter that can be sent to System-wide real-time clock. Setting this clock requires appropriate privileges. - Availability: Unix. + .. availability:: Unix. .. versionadded:: 3.3 diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 90d7ceac568c..4df292d1689d 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -131,6 +131,25 @@ def run(self): return [pnode] +# Support for documenting platform availability + +class Availability(Directive): + + has_content = False + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = True + + def run(self): + pnode = nodes.paragraph(classes=['availability']) + n, m = self.state.inline_text(':ref:`Availability `: ', + self.lineno) + pnode.extend(n + m) + n, m = self.state.inline_text(self.arguments[0], self.lineno) + pnode.extend(n + m) + return [pnode] + + # Support for documenting decorators class PyDecoratorMixin(object): @@ -401,6 +420,7 @@ def setup(app): app.add_role('issue', issue_role) app.add_role('source', source_role) app.add_directive('impl-detail', ImplementationDetail) + app.add_directive('availability', Availability) app.add_directive('deprecated-removed', DeprecatedRemoved) app.add_builder(PydocTopicsBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py index 2c1816eedf92..a3024d6734d2 100755 --- a/Doc/tools/rstlint.py +++ b/Doc/tools/rstlint.py @@ -27,17 +27,18 @@ 'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning', # Sphinx and Python docs custom ones 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', - 'autoexception', 'autofunction', 'automethod', 'automodule', 'centered', - 'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember', - 'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar', - 'data', 'decorator', 'decoratormethod', 'deprecated-removed', - 'deprecated(?!-removed)', 'describe', 'directive', 'doctest', 'envvar', - 'event', 'exception', 'function', 'glossary', 'highlight', 'highlightlang', - 'impl-detail', 'index', 'literalinclude', 'method', 'miscnews', 'module', - 'moduleauthor', 'opcode', 'pdbcommand', 'productionlist', - 'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod', - 'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo', - 'todolist', 'versionadded', 'versionchanged' + 'autoexception', 'autofunction', 'automethod', 'automodule', + 'availability', 'centered', 'cfunction', 'class', 'classmethod', 'cmacro', + 'cmdoption', 'cmember', 'code-block', 'confval', 'cssclass', 'ctype', + 'currentmodule', 'cvar', 'data', 'decorator', 'decoratormethod', + 'deprecated-removed', 'deprecated(?!-removed)', 'describe', 'directive', + 'doctest', 'envvar', 'event', 'exception', 'function', 'glossary', + 'highlight', 'highlightlang', 'impl-detail', 'index', 'literalinclude', + 'method', 'miscnews', 'module', 'moduleauthor', 'opcode', 'pdbcommand', + 'productionlist', 'program', 'role', 'sectionauthor', 'seealso', + 'sourcecode', 'staticmethod', 'tabularcolumns', 'testcode', 'testoutput', + 'testsetup', 'toctree', 'todo', 'todolist', 'versionadded', + 'versionchanged' ] all_directives = '(' + '|'.join(directives) + ')' diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index f25e02b48190..dca89eceeda9 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -769,7 +769,7 @@ conflict. This may also be enabled at runtime with :func:`sys._enablelegacywindowsfsencoding()`. - Availability: Windows + .. availability:: Windows. .. versionadded:: 3.6 See :pep:`529` for more details. @@ -783,7 +783,7 @@ conflict. This variable is ignored if the standard streams are redirected (to files or pipes) rather than referring to console buffers. - Availability: Windows + .. availability:: Windows. .. versionadded:: 3.6 @@ -834,7 +834,7 @@ conflict. order to force the interpreter to use ``ASCII`` instead of ``UTF-8`` for system interfaces. - Availability: \*nix + .. availability:: \*nix. .. versionadded:: 3.7 See :pep:`538` for more details. @@ -895,7 +895,7 @@ conflict. Also available as the :option:`-X` ``utf8`` option. - Availability: \*nix + .. availability:: \*nix. .. versionadded:: 3.7 See :pep:`540` for more details. diff --git a/Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst b/Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst new file mode 100644 index 000000000000..0637dd66e42c --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-03-20-39-25.bpo-11233.BX6Gen.rst @@ -0,0 +1,2 @@ +Create availability directive for documentation. Original patch by Georg +Brandl. From webhook-mailer at python.org Mon Oct 15 17:20:01 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 15 Oct 2018 21:20:01 -0000 Subject: [Python-checkins] bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) Message-ID: https://github.com/python/cpython/commit/2e438cc2554495b28480a3ffe5cdf41b6ab823a0 commit: 2e438cc2554495b28480a3ffe5cdf41b6ab823a0 branch: master author: Victor Stinner committer: GitHub date: 2018-10-15T23:19:57+02:00 summary: bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) python-gdb.py now handles errors on computing the line number of a Python frame. Changes: * PyFrameObjectPtr.current_line_num() now catchs any Exception on calling addr2line(), instead of failing with a surprising " 'FakeRepr' object is not subscriptable" error. * All callers of current_line_num() now handle current_line_num() returning None. * PyFrameObjectPtr.current_line() now also catchs IndexError on getting a line from the Python source file. files: A Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst M Tools/gdb/libpython.py diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst new file mode 100644 index 000000000000..53bb425ea7b4 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst @@ -0,0 +1,2 @@ +python-gdb.py now handles errors on computing the line number of a Python +frame. diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 27eabcb0d3d0..bfaa9403b787 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -934,35 +934,50 @@ def current_line_num(self): if long(f_trace) != 0: # we have a non-NULL f_trace: return self.f_lineno - else: - #try: + + try: return self.co.addr2line(self.f_lasti) - #except ValueError: - # return self.f_lineno + except Exception: + # bpo-34989: addr2line() is a complex function, it can fail in many + # ways. For example, it fails with a TypeError on "FakeRepr" if + # gdb fails to load debug symbols. Use a catch-all "except + # Exception" to make the whole function safe. The caller has to + # handle None anyway for optimized Python. + return None def current_line(self): '''Get the text of the current source line as a string, with a trailing newline character''' if self.is_optimized_out(): return '(frame information optimized out)' + + lineno = self.current_line_num() + if lineno is None: + return '(failed to get frame line number)' + filename = self.filename() try: - f = open(os_fsencode(filename), 'r') + with open(os_fsencode(filename), 'r') as fp: + lines = fp.readlines() except IOError: return None - with f: - all_lines = f.readlines() - # Convert from 1-based current_line_num to 0-based list offset: - return all_lines[self.current_line_num()-1] + + try: + # Convert from 1-based current_line_num to 0-based list offset + return lines[lineno - 1] + except IndexError: + return None def write_repr(self, out, visited): if self.is_optimized_out(): out.write('(frame information optimized out)') return - out.write('Frame 0x%x, for file %s, line %i, in %s (' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + out.write('Frame 0x%x, for file %s, line %s, in %s (' % (self.as_address(), self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) first = True for pyop_name, pyop_value in self.iter_locals(): @@ -981,9 +996,11 @@ def print_traceback(self): sys.stdout.write(' (frame information optimized out)\n') return visited = set() - sys.stdout.write(' File "%s", line %i, in %s\n' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + sys.stdout.write(' File "%s", line %s, in %s\n' % (self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) class PySetObjectPtr(PyObjectPtr): @@ -1732,6 +1749,9 @@ def invoke(self, args, from_tty): filename = pyop.filename() lineno = pyop.current_line_num() + if lineno is None: + print('Unable to read python frame line number') + return if start is None: start = lineno - 5 From webhook-mailer at python.org Mon Oct 15 17:20:14 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 15 Oct 2018 21:20:14 -0000 Subject: [Python-checkins] bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) Message-ID: https://github.com/python/cpython/commit/d991ede16b34399c5ea9bd30e9a5c520bed6bea8 commit: d991ede16b34399c5ea9bd30e9a5c520bed6bea8 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T14:20:11-07:00 summary: bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) * Add News entry for the change in multiprocessing.reduction.recvfds made in GH-9613. (cherry picked from commit bd036d3d15fc1310ccc32a43a3296b8c157ac221) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst new file mode 100644 index 000000000000..4f4a7f74864f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst @@ -0,0 +1,3 @@ +Use :func:`socket.CMSG_SPACE` to calculate ancillary data size instead of +:func:`socket.CMSG_LEN` in :func:`multiprocessing.reduction.recvfds` as +:rfc:`3542` requires the use of the former for portable applications. From webhook-mailer at python.org Mon Oct 15 17:39:19 2018 From: webhook-mailer at python.org (Yury Selivanov) Date: Mon, 15 Oct 2018 21:39:19 -0000 Subject: [Python-checkins] bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (GH-9859) Message-ID: https://github.com/python/cpython/commit/43a5bd7b458f0ad2d62b00b033d025689d48d591 commit: 43a5bd7b458f0ad2d62b00b033d025689d48d591 branch: master author: Braden Groom committer: Yury Selivanov date: 2018-10-15T17:39:16-04:00 summary: bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (GH-9859) files: M Doc/library/asyncio-protocol.rst diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst index 14ec31a6d5d2..5e6b5b480562 100644 --- a/Doc/library/asyncio-protocol.rst +++ b/Doc/library/asyncio-protocol.rst @@ -717,7 +717,7 @@ received data, and close the connection:: import asyncio - class EchoServerClientProtocol(asyncio.Protocol): + class EchoServerProtocol(asyncio.Protocol): def connection_made(self, transport): peername = transport.get_extra_info('peername') print('Connection from {}'.format(peername)) @@ -740,7 +740,7 @@ received data, and close the connection:: loop = asyncio.get_running_loop() server = await loop.create_server( - lambda: EchoServerClientProtocol(), + lambda: EchoServerProtocol(), '127.0.0.1', 8888) async with server: From webhook-mailer at python.org Mon Oct 15 17:48:01 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 15 Oct 2018 21:48:01 -0000 Subject: [Python-checkins] bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) Message-ID: https://github.com/python/cpython/commit/fcea3ddc4a7e756fa8f182789e886ccd3d524484 commit: fcea3ddc4a7e756fa8f182789e886ccd3d524484 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T14:47:56-07:00 summary: bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) python-gdb.py now handles errors on computing the line number of a Python frame. Changes: * PyFrameObjectPtr.current_line_num() now catchs any Exception on calling addr2line(), instead of failing with a surprising " 'FakeRepr' object is not subscriptable" error. * All callers of current_line_num() now handle current_line_num() returning None. * PyFrameObjectPtr.current_line() now also catchs IndexError on getting a line from the Python source file. (cherry picked from commit 2e438cc2554495b28480a3ffe5cdf41b6ab823a0) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst M Tools/gdb/libpython.py diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst new file mode 100644 index 000000000000..53bb425ea7b4 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst @@ -0,0 +1,2 @@ +python-gdb.py now handles errors on computing the line number of a Python +frame. diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 27eabcb0d3d0..bfaa9403b787 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -934,35 +934,50 @@ def current_line_num(self): if long(f_trace) != 0: # we have a non-NULL f_trace: return self.f_lineno - else: - #try: + + try: return self.co.addr2line(self.f_lasti) - #except ValueError: - # return self.f_lineno + except Exception: + # bpo-34989: addr2line() is a complex function, it can fail in many + # ways. For example, it fails with a TypeError on "FakeRepr" if + # gdb fails to load debug symbols. Use a catch-all "except + # Exception" to make the whole function safe. The caller has to + # handle None anyway for optimized Python. + return None def current_line(self): '''Get the text of the current source line as a string, with a trailing newline character''' if self.is_optimized_out(): return '(frame information optimized out)' + + lineno = self.current_line_num() + if lineno is None: + return '(failed to get frame line number)' + filename = self.filename() try: - f = open(os_fsencode(filename), 'r') + with open(os_fsencode(filename), 'r') as fp: + lines = fp.readlines() except IOError: return None - with f: - all_lines = f.readlines() - # Convert from 1-based current_line_num to 0-based list offset: - return all_lines[self.current_line_num()-1] + + try: + # Convert from 1-based current_line_num to 0-based list offset + return lines[lineno - 1] + except IndexError: + return None def write_repr(self, out, visited): if self.is_optimized_out(): out.write('(frame information optimized out)') return - out.write('Frame 0x%x, for file %s, line %i, in %s (' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + out.write('Frame 0x%x, for file %s, line %s, in %s (' % (self.as_address(), self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) first = True for pyop_name, pyop_value in self.iter_locals(): @@ -981,9 +996,11 @@ def print_traceback(self): sys.stdout.write(' (frame information optimized out)\n') return visited = set() - sys.stdout.write(' File "%s", line %i, in %s\n' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + sys.stdout.write(' File "%s", line %s, in %s\n' % (self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) class PySetObjectPtr(PyObjectPtr): @@ -1732,6 +1749,9 @@ def invoke(self, args, from_tty): filename = pyop.filename() lineno = pyop.current_line_num() + if lineno is None: + print('Unable to read python frame line number') + return if start is None: start = lineno - 5 From webhook-mailer at python.org Mon Oct 15 17:50:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 15 Oct 2018 21:50:45 -0000 Subject: [Python-checkins] bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) Message-ID: https://github.com/python/cpython/commit/71e601eb0857fb03c1dd3c349afb030ef84f95d0 commit: 71e601eb0857fb03c1dd3c349afb030ef84f95d0 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T14:50:41-07:00 summary: bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) python-gdb.py now handles errors on computing the line number of a Python frame. Changes: * PyFrameObjectPtr.current_line_num() now catchs any Exception on calling addr2line(), instead of failing with a surprising " 'FakeRepr' object is not subscriptable" error. * All callers of current_line_num() now handle current_line_num() returning None. * PyFrameObjectPtr.current_line() now also catchs IndexError on getting a line from the Python source file. (cherry picked from commit 2e438cc2554495b28480a3ffe5cdf41b6ab823a0) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst M Tools/gdb/libpython.py diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst new file mode 100644 index 000000000000..53bb425ea7b4 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst @@ -0,0 +1,2 @@ +python-gdb.py now handles errors on computing the line number of a Python +frame. diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 6d3d52f397d4..073aca858859 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -934,35 +934,50 @@ def current_line_num(self): if long(f_trace) != 0: # we have a non-NULL f_trace: return self.f_lineno - else: - #try: + + try: return self.co.addr2line(self.f_lasti) - #except ValueError: - # return self.f_lineno + except Exception: + # bpo-34989: addr2line() is a complex function, it can fail in many + # ways. For example, it fails with a TypeError on "FakeRepr" if + # gdb fails to load debug symbols. Use a catch-all "except + # Exception" to make the whole function safe. The caller has to + # handle None anyway for optimized Python. + return None def current_line(self): '''Get the text of the current source line as a string, with a trailing newline character''' if self.is_optimized_out(): return '(frame information optimized out)' + + lineno = self.current_line_num() + if lineno is None: + return '(failed to get frame line number)' + filename = self.filename() try: - f = open(os_fsencode(filename), 'r') + with open(os_fsencode(filename), 'r') as fp: + lines = fp.readlines() except IOError: return None - with f: - all_lines = f.readlines() - # Convert from 1-based current_line_num to 0-based list offset: - return all_lines[self.current_line_num()-1] + + try: + # Convert from 1-based current_line_num to 0-based list offset + return lines[lineno - 1] + except IndexError: + return None def write_repr(self, out, visited): if self.is_optimized_out(): out.write('(frame information optimized out)') return - out.write('Frame 0x%x, for file %s, line %i, in %s (' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + out.write('Frame 0x%x, for file %s, line %s, in %s (' % (self.as_address(), self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) first = True for pyop_name, pyop_value in self.iter_locals(): @@ -981,9 +996,11 @@ def print_traceback(self): sys.stdout.write(' (frame information optimized out)\n') return visited = set() - sys.stdout.write(' File "%s", line %i, in %s\n' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + sys.stdout.write(' File "%s", line %s, in %s\n' % (self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) class PySetObjectPtr(PyObjectPtr): @@ -1742,6 +1759,9 @@ def invoke(self, args, from_tty): filename = pyop.filename() lineno = pyop.current_line_num() + if lineno is None: + print('Unable to read python frame line number') + return if start is None: start = lineno - 5 From webhook-mailer at python.org Mon Oct 15 17:50:58 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 15 Oct 2018 21:50:58 -0000 Subject: [Python-checkins] bpo-34783: Fix test_nonexisting_script() (GH-9896) Message-ID: https://github.com/python/cpython/commit/ea75187c68b374bb839f1172f310b206044bc3e5 commit: ea75187c68b374bb839f1172f310b206044bc3e5 branch: master author: Victor Stinner committer: GitHub date: 2018-10-15T23:50:55+02:00 summary: bpo-34783: Fix test_nonexisting_script() (GH-9896) Fix test_cmd_line_script.test_nonexisting_script(): the test must not rely on sys.executable, since main.c uses config->program which can be different than sys.executable in many cases (for example, on macOS when using the framework). files: M Lib/test/test_cmd_line_script.py diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 4f5af3754418..5ec9bbbb1230 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -630,8 +630,6 @@ def test_consistent_sys_path_for_module_execution(self): traceback_lines = stderr.decode().splitlines() self.assertIn("No module named script_pkg", traceback_lines[-1]) - @unittest.skipIf(sys.platform == 'darwin' and sys._framework, - "test not valid for macOS framework builds") def test_nonexisting_script(self): # bpo-34783: "./python script.py" must not crash # if the script file doesn't exist. @@ -639,17 +637,12 @@ def test_nonexisting_script(self): # is not the actual Python executable file name. script = 'nonexistingscript.py' self.assertFalse(os.path.exists(script)) - # Only test the base name, since the error message can use - # a relative path, whereas sys.executable can be an asolution path. - program = os.path.basename(sys.executable) proc = spawn_python(script, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate() - # "./python" must be in the error message: - # "./python: can't open file (...)" - self.assertIn(program, err) + self.assertIn(": can't open file ", err) self.assertNotEqual(proc.returncode, 0) From webhook-mailer at python.org Mon Oct 15 17:59:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 15 Oct 2018 21:59:54 -0000 Subject: [Python-checkins] bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (GH-9859) Message-ID: https://github.com/python/cpython/commit/802de12d99d16e621537d454eac942d2f448afee commit: 802de12d99d16e621537d454eac942d2f448afee branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T14:59:49-07:00 summary: bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (GH-9859) (cherry picked from commit 43a5bd7b458f0ad2d62b00b033d025689d48d591) Co-authored-by: Braden Groom files: M Doc/library/asyncio-protocol.rst diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst index bdfdcf7ddb6e..f54dece05f3a 100644 --- a/Doc/library/asyncio-protocol.rst +++ b/Doc/library/asyncio-protocol.rst @@ -717,7 +717,7 @@ received data, and close the connection:: import asyncio - class EchoServerClientProtocol(asyncio.Protocol): + class EchoServerProtocol(asyncio.Protocol): def connection_made(self, transport): peername = transport.get_extra_info('peername') print('Connection from {}'.format(peername)) @@ -740,7 +740,7 @@ received data, and close the connection:: loop = asyncio.get_running_loop() server = await loop.create_server( - lambda: EchoServerClientProtocol(), + lambda: EchoServerProtocol(), '127.0.0.1', 8888) async with server: From webhook-mailer at python.org Mon Oct 15 18:06:34 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 15 Oct 2018 22:06:34 -0000 Subject: [Python-checkins] bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) (GH-9899) Message-ID: https://github.com/python/cpython/commit/aadb44ee98bc73bc5132acea5848ac6aef1ff8c0 commit: aadb44ee98bc73bc5132acea5848ac6aef1ff8c0 branch: 2.7 author: Victor Stinner committer: GitHub date: 2018-10-16T00:06:23+02:00 summary: bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) (GH-9899) python-gdb.py now handles errors on computing the line number of a Python frame. Changes: * PyFrameObjectPtr.current_line_num() now catchs any Exception on calling addr2line(), instead of failing with a surprising " 'FakeRepr' object is not subscriptable" error. * All callers of current_line_num() now handle current_line_num() returning None. * PyFrameObjectPtr.current_line() now also catchs IndexError on getting a line from the Python source file. (cherry picked from commit 2e438cc2554495b28480a3ffe5cdf41b6ab823a0) files: A Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst M Tools/gdb/libpython.py diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst new file mode 100644 index 000000000000..53bb425ea7b4 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2018-10-15-13-22-28.bpo-34989.hU4fra.rst @@ -0,0 +1,2 @@ +python-gdb.py now handles errors on computing the line number of a Python +frame. diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 3ae70974cc1c..9def56e61024 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -922,35 +922,50 @@ def current_line_num(self): if long(f_trace) != 0: # we have a non-NULL f_trace: return self.f_lineno - else: - #try: + + try: return self.co.addr2line(self.f_lasti) - #except ValueError: - # return self.f_lineno + except Exception: + # bpo-34989: addr2line() is a complex function, it can fail in many + # ways. For example, it fails with a TypeError on "FakeRepr" if + # gdb fails to load debug symbols. Use a catch-all "except + # Exception" to make the whole function safe. The caller has to + # handle None anyway for optimized Python. + return None def current_line(self): '''Get the text of the current source line as a string, with a trailing newline character''' if self.is_optimized_out(): return '(frame information optimized out)' + + lineno = self.current_line_num() + if lineno is None: + return '(failed to get frame line number)' + filename = self.filename() try: - f = open(filename, 'r') + with open(filename, 'r') as fp: + lines = fp.readlines() except IOError: return None - with f: - all_lines = f.readlines() - # Convert from 1-based current_line_num to 0-based list offset: - return all_lines[self.current_line_num()-1] + + try: + # Convert from 1-based current_line_num to 0-based list offset + return lines[lineno - 1] + except IndexError: + return None def write_repr(self, out, visited): if self.is_optimized_out(): out.write('(frame information optimized out)') return - out.write('Frame 0x%x, for file %s, line %i, in %s (' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + out.write('Frame 0x%x, for file %s, line %s, in %s (' % (self.as_address(), self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) first = True for pyop_name, pyop_value in self.iter_locals(): @@ -969,9 +984,11 @@ def print_traceback(self): sys.stdout.write(' (frame information optimized out)\n') return visited = set() - sys.stdout.write(' File "%s", line %i, in %s\n' + lineno = self.current_line_num() + lineno = str(lineno) if lineno is not None else "?" + sys.stdout.write(' File "%s", line %s, in %s\n' % (self.co_filename.proxyval(visited), - self.current_line_num(), + lineno, self.co_name.proxyval(visited))) class PySetObjectPtr(PyObjectPtr): @@ -1546,6 +1563,9 @@ def invoke(self, args, from_tty): filename = pyop.filename() lineno = pyop.current_line_num() + if lineno is None: + print('Unable to read python frame line number') + return if start is None: start = lineno - 5 From webhook-mailer at python.org Mon Oct 15 18:30:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 15 Oct 2018 22:30:08 -0000 Subject: [Python-checkins] bpo-34783: Fix test_nonexisting_script() (GH-9896) Message-ID: https://github.com/python/cpython/commit/350aeab8127da551fcd0090230575b7aabff03c9 commit: 350aeab8127da551fcd0090230575b7aabff03c9 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T15:30:05-07:00 summary: bpo-34783: Fix test_nonexisting_script() (GH-9896) Fix test_cmd_line_script.test_nonexisting_script(): the test must not rely on sys.executable, since main.c uses config->program which can be different than sys.executable in many cases (for example, on macOS when using the framework). (cherry picked from commit ea75187c68b374bb839f1172f310b206044bc3e5) Co-authored-by: Victor Stinner files: M Lib/test/test_cmd_line_script.py diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 4f5af3754418..5ec9bbbb1230 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -630,8 +630,6 @@ def test_consistent_sys_path_for_module_execution(self): traceback_lines = stderr.decode().splitlines() self.assertIn("No module named script_pkg", traceback_lines[-1]) - @unittest.skipIf(sys.platform == 'darwin' and sys._framework, - "test not valid for macOS framework builds") def test_nonexisting_script(self): # bpo-34783: "./python script.py" must not crash # if the script file doesn't exist. @@ -639,17 +637,12 @@ def test_nonexisting_script(self): # is not the actual Python executable file name. script = 'nonexistingscript.py' self.assertFalse(os.path.exists(script)) - # Only test the base name, since the error message can use - # a relative path, whereas sys.executable can be an asolution path. - program = os.path.basename(sys.executable) proc = spawn_python(script, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate() - # "./python" must be in the error message: - # "./python: can't open file (...)" - self.assertIn(program, err) + self.assertIn(": can't open file ", err) self.assertNotEqual(proc.returncode, 0) From webhook-mailer at python.org Tue Oct 16 01:46:40 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 16 Oct 2018 05:46:40 -0000 Subject: [Python-checkins] [2.7] bpo-16965: 2to3 now rewrites execfile() to open with rb. (GH-8569) (GH-9890) Message-ID: https://github.com/python/cpython/commit/f5e00f490ab5abfcf5e38e58bf969c7b5dcb4818 commit: f5e00f490ab5abfcf5e38e58bf969c7b5dcb4818 branch: 2.7 author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-16T08:46:35+03:00 summary: [2.7] bpo-16965: 2to3 now rewrites execfile() to open with rb. (GH-8569) (GH-9890) (cherry picked from commit d4d60134b29290049e28df54f23493de4f1824b6) files: A Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst M Lib/lib2to3/fixes/fix_execfile.py M Lib/lib2to3/tests/test_fixers.py diff --git a/Lib/lib2to3/fixes/fix_execfile.py b/Lib/lib2to3/fixes/fix_execfile.py index 2f29d3b281a9..786268bb9dc7 100644 --- a/Lib/lib2to3/fixes/fix_execfile.py +++ b/Lib/lib2to3/fixes/fix_execfile.py @@ -31,7 +31,8 @@ def transform(self, node, results): # call. execfile_paren = node.children[-1].children[-1].clone() # Construct open().read(). - open_args = ArgList([filename.clone()], rparen=execfile_paren) + open_args = ArgList([filename.clone(), Comma(), String('"rb"', ' ')], + rparen=execfile_paren) open_call = Node(syms.power, [Name(u"open"), open_args]) read = [Node(syms.trailer, [Dot(), Name(u'read')]), Node(syms.trailer, [LParen(), RParen()])] diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py index b0e60fe196bd..c7d5ff93e824 100644 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/lib2to3/tests/test_fixers.py @@ -1143,36 +1143,36 @@ class Test_execfile(FixerTestCase): def test_conversion(self): b = """execfile("fn")""" - a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob)""" self.check(b, a) b = """execfile("fn", glob, loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob, loc)""" self.check(b, a) b = """execfile("fn", globals=glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob)""" self.check(b, a) b = """execfile("fn", locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), locals=loc)""" self.check(b, a) b = """execfile("fn", globals=glob, locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob, locals=loc)""" self.check(b, a) def test_spacing(self): b = """execfile( "fn" )""" - a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + a = """exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", globals = glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals = glob)""" self.check(b, a) diff --git a/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst new file mode 100644 index 000000000000..8e9d2f9482d2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-12-20-30-42.bpo-16965.xo5LAr.rst @@ -0,0 +1,2 @@ +The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file with mode +``'rb'``. Patch by Zackery Spytz. From webhook-mailer at python.org Tue Oct 16 02:46:43 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 16 Oct 2018 06:46:43 -0000 Subject: [Python-checkins] bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) Message-ID: https://github.com/python/cpython/commit/514bbfc7fc4dcb868d4364632ad14c0533af154f commit: 514bbfc7fc4dcb868d4364632ad14c0533af154f branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T23:46:38-07:00 summary: bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) (cherry picked from commit e385d0661ecf8bc9ba95c4395d9a11262c2cbfec) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 4df292d1689d..a7f7797861bf 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -424,11 +424,9 @@ def setup(app): app.add_directive('deprecated-removed', DeprecatedRemoved) app.add_builder(PydocTopicsBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) - app.add_description_unit('opcode', 'opcode', '%s (opcode)', - parse_opcode_signature) - app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)', - parse_pdb_command) - app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') + app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command) + app.add_object_type('2to3fixer', '2to3fixer', '%s (2to3 fixer)') app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction) app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod) app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction) diff --git a/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst new file mode 100644 index 000000000000..6341296663ae --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst @@ -0,0 +1,2 @@ +Use app.add_object_type() instead of the deprecated Sphinx function +app.description_unit() From webhook-mailer at python.org Tue Oct 16 02:47:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 16 Oct 2018 06:47:09 -0000 Subject: [Python-checkins] bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) Message-ID: https://github.com/python/cpython/commit/e2c3bc7e79c3506609845f7f62ba102e6c7e9993 commit: e2c3bc7e79c3506609845f7f62ba102e6c7e9993 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T23:47:07-07:00 summary: bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) (cherry picked from commit e385d0661ecf8bc9ba95c4395d9a11262c2cbfec) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 02e7a132d490..5b2c31563766 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -388,11 +388,9 @@ def setup(app): app.add_directive('deprecated-removed', DeprecatedRemoved) app.add_builder(PydocTopicsBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) - app.add_description_unit('opcode', 'opcode', '%s (opcode)', - parse_opcode_signature) - app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)', - parse_pdb_command) - app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') + app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command) + app.add_object_type('2to3fixer', '2to3fixer', '%s (2to3 fixer)') app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction) app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod) app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction) diff --git a/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst new file mode 100644 index 000000000000..6341296663ae --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst @@ -0,0 +1,2 @@ +Use app.add_object_type() instead of the deprecated Sphinx function +app.description_unit() From webhook-mailer at python.org Tue Oct 16 02:47:29 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 16 Oct 2018 06:47:29 -0000 Subject: [Python-checkins] bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) Message-ID: https://github.com/python/cpython/commit/f82c9f1e1af8d35056a6961281d72467b4c46b8d commit: f82c9f1e1af8d35056a6961281d72467b4c46b8d branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-15T23:47:26-07:00 summary: bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827) (cherry picked from commit e385d0661ecf8bc9ba95c4395d9a11262c2cbfec) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 8c45274bb27b..6378f76bdc2c 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -253,11 +253,9 @@ def setup(app): app.add_directive('impl-detail', ImplementationDetail) app.add_builder(PydocTopicsBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) - app.add_description_unit('opcode', 'opcode', '%s (opcode)', - parse_opcode_signature) - app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)', - parse_pdb_command) - app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') + app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command) + app.add_object_type('2to3fixer', '2to3fixer', '%s (2to3 fixer)') app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction) app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod) return {'version': '1.0', 'parallel_read_safe': True} diff --git a/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst new file mode 100644 index 000000000000..6341296663ae --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst @@ -0,0 +1,2 @@ +Use app.add_object_type() instead of the deprecated Sphinx function +app.description_unit() From webhook-mailer at python.org Tue Oct 16 03:31:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 16 Oct 2018 07:31:03 -0000 Subject: [Python-checkins] bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) Message-ID: https://github.com/python/cpython/commit/ae011e00189d9083dd84c357718264e24fe77314 commit: ae011e00189d9083dd84c357718264e24fe77314 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-16T00:30:58-07:00 summary: bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) * Add News entry for the change in multiprocessing.reduction.recvfds made in GH-9613. (cherry picked from commit bd036d3d15fc1310ccc32a43a3296b8c157ac221) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst new file mode 100644 index 000000000000..4f4a7f74864f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst @@ -0,0 +1,3 @@ +Use :func:`socket.CMSG_SPACE` to calculate ancillary data size instead of +:func:`socket.CMSG_LEN` in :func:`multiprocessing.reduction.recvfds` as +:rfc:`3542` requires the use of the former for portable applications. From solipsis at pitrou.net Tue Oct 16 05:07:53 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 16 Oct 2018 09:07:53 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=9 Message-ID: <20181016090753.1.910849C1C74EAF74@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 0, 3] memory blocks, sum=3 test_collections leaked [-7, 1, 7] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, 0, -1] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogoOWTd9', '--timeout', '7200'] From webhook-mailer at python.org Tue Oct 16 07:36:56 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Tue, 16 Oct 2018 11:36:56 -0000 Subject: [Python-checkins] Added CLI starter example to logging cookbook. (GH-9910) Message-ID: https://github.com/python/cpython/commit/1a4a10d9f125499f610787ffda8846a569fc1d97 commit: 1a4a10d9f125499f610787ffda8846a569fc1d97 branch: master author: Vinay Sajip committer: GitHub date: 2018-10-16T12:36:52+01:00 summary: Added CLI starter example to logging cookbook. (GH-9910) files: M Doc/howto/logging-cookbook.rst diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst index 83c2d49c6d2a..faf2ed15a066 100644 --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -2548,3 +2548,164 @@ In this case, the message #5 printed to ``stdout`` doesn't appear, as expected. Of course, the approach described here can be generalised, for example to attach logging filters temporarily. Note that the above code works in Python 2 as well as Python 3. + + +.. _starter-template: + +A CLI application starter template +---------------------------------- + +Here's an example which shows how you can: + +* Use a logging level based on command-line arguments +* Dispatch to multiple subcommands in separate files, all logging at the same + level in a consistent way +* Make use of simple, minimal configuration + +Suppose we have a command-line application whose job is to stop, start or +restart some services. This could be organised for the purposes of illustration +as a file ``app.py`` that is the main script for the application, with individual +commands implemented in ``start.py``, ``stop.py`` and ``restart.py``. Suppose +further that we want to control the verbosity of the application via a +command-line argument, defaulting to ``logging.INFO``. Here's one way that +``app.py`` could be written:: + + import argparse + import importlib + import logging + import os + import sys + + def main(args=None): + scriptname = os.path.basename(__file__) + parser = argparse.ArgumentParser(scriptname) + levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL') + parser.add_argument('--log-level', default='INFO', choices=levels) + subparsers = parser.add_subparsers(dest='command', + help='Available commands:') + start_cmd = subparsers.add_parser('start', help='Start a service') + start_cmd.add_argument('name', metavar='NAME', + help='Name of service to start') + stop_cmd = subparsers.add_parser('stop', + help='Stop one or more services') + stop_cmd.add_argument('names', metavar='NAME', nargs='+', + help='Name of service to stop') + restart_cmd = subparsers.add_parser('restart', + help='Restart one or more services') + restart_cmd.add_argument('names', metavar='NAME', nargs='+', + help='Name of service to restart') + options = parser.parse_args() + # the code to dispatch commands could all be in this file. For the purposes + # of illustration only, we implement each command in a separate module. + try: + mod = importlib.import_module(options.command) + cmd = getattr(mod, 'command') + except (ImportError, AttributeError): + print('Unable to find the code for command \'%s\'' % options.command) + return 1 + # Could get fancy here and load configuration from file or dictionary + logging.basicConfig(level=options.log_level, + format='%(levelname)s %(name)s %(message)s') + cmd(options) + + if __name__ == '__main__': + sys.exit(main()) + +And the ``start``, ``stop`` and ``restart`` commands can be implemented in +separate modules, like so for starting:: + + # start.py + import logging + + logger = logging.getLogger(__name__) + + def command(options): + logger.debug('About to start %s', options.name) + # actually do the command processing here ... + logger.info('Started the \'%s\' service.', options.name) + +and thus for stopping:: + + # stop.py + import logging + + logger = logging.getLogger(__name__) + + def command(options): + n = len(options.names) + if n == 1: + plural = '' + services = '\'%s\'' % options.names[0] + else: + plural = 's' + services = ', '.join('\'%s\'' % name for name in options.names) + i = services.rfind(', ') + services = services[:i] + ' and ' + services[i + 2:] + logger.debug('About to stop %s', services) + # actually do the command processing here ... + logger.info('Stopped the %s service%s.', services, plural) + +and similarly for restarting:: + + # restart.py + import logging + + logger = logging.getLogger(__name__) + + def command(options): + n = len(options.names) + if n == 1: + plural = '' + services = '\'%s\'' % options.names[0] + else: + plural = 's' + services = ', '.join('\'%s\'' % name for name in options.names) + i = services.rfind(', ') + services = services[:i] + ' and ' + services[i + 2:] + logger.debug('About to restart %s', services) + # actually do the command processing here ... + logger.info('Restarted the %s service%s.', services, plural) + +If we run this application with the default log level, we get output like this: + +.. code-block:: shell-session + + $ python app.py start foo + INFO start Started the 'foo' service. + + $ python app.py stop foo bar + INFO stop Stopped the 'foo' and 'bar' services. + + $ python app.py restart foo bar baz + INFO restart Restarted the 'foo', 'bar' and 'baz' services. + +The first word is the logging level, and the second word is the module or +package name of the place where the event was logged. + +If we change the logging level, then we can change the information sent to the +log. For example, if we want more information: + +.. code-block:: shell-session + + $ python app.py --log-level DEBUG start foo + DEBUG start About to start foo + INFO start Started the 'foo' service. + + $ python app.py --log-level DEBUG stop foo bar + DEBUG stop About to stop 'foo' and 'bar' + INFO stop Stopped the 'foo' and 'bar' services. + + $ python app.py --log-level DEBUG restart foo bar baz + DEBUG restart About to restart 'foo', 'bar' and 'baz' + INFO restart Restarted the 'foo', 'bar' and 'baz' services. + +And if we want less: + +.. code-block:: shell-session + + $ python app.py --log-level WARNING start foo + $ python app.py --log-level WARNING stop foo bar + $ python app.py --log-level WARNING restart foo bar baz + +In this case, the commands don't print anything to the console, since nothing +at ``WARNING`` level or above is logged by them. From webhook-mailer at python.org Tue Oct 16 10:18:03 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Tue, 16 Oct 2018 14:18:03 -0000 Subject: [Python-checkins] bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (GH-9913) Message-ID: https://github.com/python/cpython/commit/137b0632dccb992ca11e9445142fb33a29c33a51 commit: 137b0632dccb992ca11e9445142fb33a29c33a51 branch: master author: Pablo Galindo committer: GitHub date: 2018-10-16T15:17:57+01:00 summary: bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (GH-9913) When runnint test_logging with --huntrleaks after commit 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85, test_out_of_order fails to raise ValueError due to the fact that the new test test_out_of_order_with_dollar_style mutates the out_of_order dictionary. Even if the test copies the dictionary first, the mutation is done in a very deep level so the original one is also affected. files: M Lib/test/test_logging.py diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 9802955e6a98..c797d66aa645 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -25,6 +25,7 @@ import codecs import configparser +import copy import datetime import pathlib import pickle @@ -3278,7 +3279,7 @@ def test_out_of_order(self): self.assertRaises(ValueError, self.apply_config, self.out_of_order) def test_out_of_order_with_dollar_style(self): - config = self.out_of_order.copy() + config = copy.deepcopy(self.out_of_order) config['formatters']['mySimpleFormatter']['format'] = "${asctime} (${name}) ${levelname}: ${message}" self.apply_config(config) From webhook-mailer at python.org Tue Oct 16 15:26:22 2018 From: webhook-mailer at python.org (R. David Murray) Date: Tue, 16 Oct 2018 19:26:22 -0000 Subject: [Python-checkins] In email.parser in message_from_bytes, update `strict` to `policy` (#9854) Message-ID: https://github.com/python/cpython/commit/a5ca98537b9f3f5eeae9157b1548b741df3fbf90 commit: a5ca98537b9f3f5eeae9157b1548b741df3fbf90 branch: master author: Cheryl Sabella committer: R. David Murray date: 2018-10-16T15:26:17-04:00 summary: In email.parser in message_from_bytes, update `strict` to `policy` (#9854) According to the versionchanged note, the `strict` argument was removed in 3.3 and `policy` was added, but the name of the argument in the paragraph wasn't updated. files: M Doc/library/email.parser.rst diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index e0cab6a69497..49b4e992708a 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -238,7 +238,7 @@ in the top-level :mod:`email` package namespace. Return a message object structure from a :term:`bytes-like object`. This is equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and - *strict* are interpreted as with the :class:`~email.parser.BytesParser` class + *policy* are interpreted as with the :class:`~email.parser.BytesParser` class constructor. .. versionadded:: 3.2 From webhook-mailer at python.org Tue Oct 16 15:28:38 2018 From: webhook-mailer at python.org (R. David Murray) Date: Tue, 16 Oct 2018 19:28:38 -0000 Subject: [Python-checkins] In email docs, correct spelling of foregoing (#9856) Message-ID: https://github.com/python/cpython/commit/c984d20ec81609aa439ccdb3af5bc35fca0c2112 commit: c984d20ec81609aa439ccdb3af5bc35fca0c2112 branch: master author: Cheryl Sabella committer: R. David Murray date: 2018-10-16T15:28:34-04:00 summary: In email docs, correct spelling of foregoing (#9856) files: M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 1033d8c130eb..07d455ba39d3 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -87,7 +87,7 @@ to advanced applications. Following those is a set of examples of using the fundamental parts of the APIs covered in the preceding sections. -The forgoing represent the modern (unicode friendly) API of the email package. +The foregoing represent the modern (unicode friendly) API of the email package. The remaining sections, starting with the :class:`~email.message.Message` class, cover the legacy :data:`~email.policy.compat32` API that deals much more directly with the details of how email messages are represented. The From webhook-mailer at python.org Wed Oct 17 02:45:54 2018 From: webhook-mailer at python.org (Julien Palard) Date: Wed, 17 Oct 2018 06:45:54 -0000 Subject: [Python-checkins] Doc: Fix is_prime (GH-9909) Message-ID: https://github.com/python/cpython/commit/8e73ad38ab7d218b9ef8976032865928dfad00f1 commit: 8e73ad38ab7d218b9ef8976032865928dfad00f1 branch: master author: Julien Palard committer: GitHub date: 2018-10-17T08:45:51+02:00 summary: Doc: Fix is_prime (GH-9909) files: M Doc/library/concurrent.futures.rst diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst index 47ca6b38f84e..3890e49f597b 100644 --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -257,6 +257,10 @@ ProcessPoolExecutor Example 1099726899285419] def is_prime(n): + if n < 2: + return False + if n == 2: + return True if n % 2 == 0: return False From solipsis at pitrou.net Wed Oct 17 05:11:09 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 17 Oct 2018 09:11:09 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=2 Message-ID: <20181017091109.1.C2CCFF8BDFA468F6@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 1] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [0, -2, 1] memory blocks, sum=-1 test_multiprocessing_spawn leaked [-2, 2, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogiO2pPU', '--timeout', '7200'] From webhook-mailer at python.org Wed Oct 17 06:03:50 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 17 Oct 2018 10:03:50 -0000 Subject: [Python-checkins] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) Message-ID: https://github.com/python/cpython/commit/fcd5e84a515e19409840c570730f0728e9fcfc83 commit: fcd5e84a515e19409840c570730f0728e9fcfc83 branch: master author: St?phane Wirtel committer: Victor Stinner date: 2018-10-17T12:03:40+02:00 summary: bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert Kuska. Co-authored-by: Robert Kuska files: A Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst M Lib/cProfile.py M Lib/test/test_cprofile.py diff --git a/Lib/cProfile.py b/Lib/cProfile.py index 3c9be3cbd224..305e79e28049 100755 --- a/Lib/cProfile.py +++ b/Lib/cProfile.py @@ -131,6 +131,7 @@ def main(): import os import sys import runpy + import pstats from optparse import OptionParser usage = "cProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ..." parser = OptionParser(usage=usage) @@ -139,7 +140,8 @@ def main(): help="Save stats to ", default=None) parser.add_option('-s', '--sort', dest="sort", help="Sort order when printing to stdout, based on pstats.Stats class", - default=-1) + default=-1, + choices=sorted(pstats.Stats.sort_arg_dict_default)) parser.add_option('-m', dest="module", action="store_true", help="Profile a library module", default=False) diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py index 2fd67ee75688..406d70305f9e 100644 --- a/Lib/test/test_cprofile.py +++ b/Lib/test/test_cprofile.py @@ -2,6 +2,7 @@ import sys from test.support import run_unittest, TESTFN, unlink +import unittest # rip off all interesting stuff from test_profile import cProfile @@ -76,9 +77,14 @@ def test_profile_as_context_manager(self): # profile shouldn't be set once we leave the with-block. self.assertIs(sys.getprofile(), None) +class TestCommandLine(unittest.TestCase): + def test_sort(self): + rc, out, err = assert_python_failure('-m', 'cProfile', '-s', 'demo') + self.assertGreater(rc, 0) + self.assertIn(b"option -s: invalid choice: 'demo'", err) def test_main(): - run_unittest(CProfileTest) + run_unittest(CProfileTest, TestCommandLine) def main(): if '-r' not in sys.argv: diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst new file mode 100644 index 000000000000..034e7e53970a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst @@ -0,0 +1,2 @@ +Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert +Kuska From webhook-mailer at python.org Wed Oct 17 07:48:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 17 Oct 2018 11:48:08 -0000 Subject: [Python-checkins] [3.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9926) Message-ID: https://github.com/python/cpython/commit/657e3f9a2c0d620807dd81882d566ad8f1ae423e commit: 657e3f9a2c0d620807dd81882d566ad8f1ae423e branch: 3.7 author: St?phane Wirtel committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-17T04:48:05-07:00 summary: [3.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9926) [3.7] [bpo-23420](https://bugs.python.org/issue23420): Verify the value of '-s' when execute the CLI of cProfile (GH-9925) Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert Kuska. Co-authored-by: Robert Kuska (cherry picked from commit fcd5e84a515e19409840c570730f0728e9fcfc83) https://bugs.python.org/issue23420 files: A Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst M Lib/cProfile.py M Lib/test/test_cprofile.py diff --git a/Lib/cProfile.py b/Lib/cProfile.py index c044be8bf76e..f6e423b3dd1a 100755 --- a/Lib/cProfile.py +++ b/Lib/cProfile.py @@ -124,6 +124,7 @@ def main(): import os import sys import runpy + import pstats from optparse import OptionParser usage = "cProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ..." parser = OptionParser(usage=usage) @@ -132,7 +133,8 @@ def main(): help="Save stats to ", default=None) parser.add_option('-s', '--sort', dest="sort", help="Sort order when printing to stdout, based on pstats.Stats class", - default=-1) + default=-1, + choices=sorted(pstats.Stats.sort_arg_dict_default)) parser.add_option('-m', dest="module", action="store_true", help="Profile a library module", default=False) diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py index 1430d2250485..5c4ec5b81729 100644 --- a/Lib/test/test_cprofile.py +++ b/Lib/test/test_cprofile.py @@ -2,6 +2,7 @@ import sys from test.support import run_unittest, TESTFN, unlink +import unittest # rip off all interesting stuff from test_profile import cProfile @@ -50,8 +51,14 @@ def test_module_path_option(self): assert_python_ok('-m', 'cProfile', '-m', 'timeit', '-n', '1') +class TestCommandLine(unittest.TestCase): + def test_sort(self): + rc, out, err = assert_python_failure('-m', 'cProfile', '-s', 'demo') + self.assertGreater(rc, 0) + self.assertIn(b"option -s: invalid choice: 'demo'", err) + def test_main(): - run_unittest(CProfileTest) + run_unittest(CProfileTest, TestCommandLine) def main(): if '-r' not in sys.argv: diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst new file mode 100644 index 000000000000..034e7e53970a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst @@ -0,0 +1,2 @@ +Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert +Kuska From webhook-mailer at python.org Wed Oct 17 07:48:55 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 17 Oct 2018 11:48:55 -0000 Subject: [Python-checkins] [3.6] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9927) Message-ID: https://github.com/python/cpython/commit/669fa8b6376ee8703ae4383536dfcc0e96e51b78 commit: 669fa8b6376ee8703ae4383536dfcc0e96e51b78 branch: 3.6 author: St?phane Wirtel committer: Victor Stinner date: 2018-10-17T13:48:52+02:00 summary: [3.6] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9927) Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert Kuska. Co-authored-by: Robert Kuska (cherry picked from commit fcd5e84a515e19409840c570730f0728e9fcfc83) files: A Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst M Lib/cProfile.py M Lib/test/test_cprofile.py diff --git a/Lib/cProfile.py b/Lib/cProfile.py index 6ae8512ddd2e..a6d4476750dc 100755 --- a/Lib/cProfile.py +++ b/Lib/cProfile.py @@ -121,7 +121,7 @@ def label(code): # ____________________________________________________________ def main(): - import os, sys + import os, sys, pstats from optparse import OptionParser usage = "cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ..." parser = OptionParser(usage=usage) @@ -130,7 +130,8 @@ def main(): help="Save stats to ", default=None) parser.add_option('-s', '--sort', dest="sort", help="Sort order when printing to stdout, based on pstats.Stats class", - default=-1) + default=-1, + choices=sorted(pstats.Stats.sort_arg_dict_default)) if not sys.argv[1:]: parser.print_usage() diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py index 53f891733029..0008aaba4a70 100644 --- a/Lib/test/test_cprofile.py +++ b/Lib/test/test_cprofile.py @@ -1,7 +1,9 @@ """Test suite for the cProfile module.""" import sys +import unittest from test.support import run_unittest, TESTFN, unlink +from test.support.script_helper import assert_python_failure # rip off all interesting stuff from test_profile import cProfile @@ -36,8 +38,15 @@ def test_bad_counter_during_dealloc(self): unlink(TESTFN) +class TestCommandLine(unittest.TestCase): + def test_sort(self): + rc, out, err = assert_python_failure('-m', 'cProfile', '-s', 'demo') + self.assertGreater(rc, 0) + self.assertIn(b"option -s: invalid choice: 'demo'", err) + + def test_main(): - run_unittest(CProfileTest) + run_unittest(CProfileTest, TestCommandLine) def main(): if '-r' not in sys.argv: diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst new file mode 100644 index 000000000000..034e7e53970a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst @@ -0,0 +1,2 @@ +Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert +Kuska From webhook-mailer at python.org Wed Oct 17 07:51:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 17 Oct 2018 11:51:31 -0000 Subject: [Python-checkins] [2.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9928) Message-ID: https://github.com/python/cpython/commit/6e57382464101d2669a425622e19fff57586b2ff commit: 6e57382464101d2669a425622e19fff57586b2ff branch: 2.7 author: St?phane Wirtel committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-17T04:51:28-07:00 summary: [2.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9928) Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert Kuska. Co-authored-by: Robert Kuska (cherry picked from commit fcd5e84a515e19409840c570730f0728e9fcfc83) https://bugs.python.org/issue23420 files: A Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst M Lib/cProfile.py M Lib/test/test_cprofile.py diff --git a/Lib/cProfile.py b/Lib/cProfile.py index d3770946db11..cd53cc0abd53 100755 --- a/Lib/cProfile.py +++ b/Lib/cProfile.py @@ -161,7 +161,7 @@ def label(code): # ____________________________________________________________ def main(): - import os, sys + import os, sys, pstats from optparse import OptionParser usage = "cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ..." parser = OptionParser(usage=usage) @@ -170,7 +170,8 @@ def main(): help="Save stats to ", default=None) parser.add_option('-s', '--sort', dest="sort", help="Sort order when printing to stdout, based on pstats.Stats class", - default=-1) + default=-1, + choices=sorted(pstats.Stats.sort_arg_dict_default)) if not sys.argv[1:]: parser.print_usage() diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py index af3fe62a9a6b..83d52296e218 100644 --- a/Lib/test/test_cprofile.py +++ b/Lib/test/test_cprofile.py @@ -1,7 +1,9 @@ """Test suite for the cProfile module.""" import sys +import unittest from test.test_support import run_unittest, TESTFN, unlink +from test.support.script_helper import assert_python_failure # rip off all interesting stuff from test_profile import cProfile @@ -26,8 +28,14 @@ def test_bad_counter_during_dealloc(self): unlink(TESTFN) +class TestCommandLine(unittest.TestCase): + def test_sort(self): + rc, out, err = assert_python_failure('-m', 'cProfile', '-s', 'demo') + self.assertGreater(rc, 0) + self.assertIn(b"option -s: invalid choice: 'demo'", err) + def test_main(): - run_unittest(CProfileTest) + run_unittest(CProfileTest, TestCommandLine) def main(): if '-r' not in sys.argv: diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst new file mode 100644 index 000000000000..034e7e53970a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-00-00.bpo-23420.Lq74Uu.rst @@ -0,0 +1,2 @@ +Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert +Kuska From webhook-mailer at python.org Wed Oct 17 17:55:41 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 17 Oct 2018 21:55:41 -0000 Subject: [Python-checkins] Add missing comma to wsgiref doc (GH-9932) Message-ID: https://github.com/python/cpython/commit/0f11a88622ceda93a6b7eed7db52a5eb8083445f commit: 0f11a88622ceda93a6b7eed7db52a5eb8083445f branch: master author: Cheryl Sabella committer: Pablo Galindo date: 2018-10-17T22:55:32+01:00 summary: Add missing comma to wsgiref doc (GH-9932) files: M Doc/library/wsgiref.rst diff --git a/Doc/library/wsgiref.rst b/Doc/library/wsgiref.rst index f8811c5a3617..e0f745f810b9 100644 --- a/Doc/library/wsgiref.rst +++ b/Doc/library/wsgiref.rst @@ -54,7 +54,7 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see This function is useful when creating a gateway that wraps CGI or a CGI-like protocol such as FastCGI. Typically, servers providing such protocols will - include a ``HTTPS`` variable with a value of "1" "yes", or "on" when a request + include a ``HTTPS`` variable with a value of "1", "yes", or "on" when a request is received via SSL. So, this function returns "https" if such a value is found, and "http" otherwise. From webhook-mailer at python.org Wed Oct 17 19:05:09 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 17 Oct 2018 23:05:09 -0000 Subject: [Python-checkins] bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) Message-ID: https://github.com/python/cpython/commit/74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557 commit: 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557 branch: master author: St?phane Wirtel committer: Victor Stinner date: 2018-10-18T01:05:04+02:00 summary: bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) On macOS, fix reading from and writing into a file with a size larger than 2 GiB. files: A Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst M Include/fileutils.h M Lib/test/test_largefile.py M Modules/_io/fileio.c M Python/fileutils.c diff --git a/Include/fileutils.h b/Include/fileutils.h index f0a8e2c61a4f..232d9664cdd0 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -81,6 +81,19 @@ PyAPI_FUNC(int) _Py_EncodeLocaleEx( #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _Py_device_encoding(int); +#if defined(MS_WINDOWS) || defined(__APPLE__) + /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611). + On macOS 10.13, read() and write() with more than INT_MAX bytes + fail with EINVAL (bpo-24658). */ +# define _PY_READ_MAX INT_MAX +# define _PY_WRITE_MAX INT_MAX +#else + /* write() should truncate the input to PY_SSIZE_T_MAX bytes, + but it's safer to do it ourself to have a portable behaviour */ +# define _PY_READ_MAX PY_SSIZE_T_MAX +# define _PY_WRITE_MAX PY_SSIZE_T_MAX +#endif + #ifdef MS_WINDOWS struct _Py_stat_struct { unsigned long st_dev; diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index 21296ccafe54..8870c721ab0e 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -5,12 +5,12 @@ import stat import sys import unittest -from test.support import TESTFN, requires, unlink +from test.support import TESTFN, requires, unlink, bigmemtest import io # C implementation of io import _pyio as pyio # Python implementation of io # size of file to create (>2 GiB; 2 GiB == 2,147,483,648 bytes) -size = 2500000000 +size = 2_500_000_000 class LargeFileTest: """Test that each file function works as expected for large @@ -45,6 +45,15 @@ def tearDownClass(cls): raise cls.failureException('File was not truncated by opening ' 'with mode "wb"') + # _pyio.FileIO.readall() uses a temporary bytearray then casted to bytes, + # so memuse=2 is needed + @bigmemtest(size=size, memuse=2, dry_run=False) + def test_large_read(self, _size): + # bpo-24658: Test that a read greater than 2GB does not fail. + with self.open(TESTFN, "rb") as f: + self.assertEqual(len(f.read()), size + 1) + self.assertEqual(f.tell(), size + 1) + def test_osstat(self): self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1) diff --git a/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst b/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst new file mode 100644 index 000000000000..ff660a125c64 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst @@ -0,0 +1 @@ +On macOS, fix reading from and writing into a file with a size larger than 2 GiB. \ No newline at end of file diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index c0e43e0ae41a..44d51c9faf5d 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -791,11 +791,9 @@ _io_FileIO_read_impl(fileio *self, Py_ssize_t size) if (size < 0) return _io_FileIO_readall_impl(self); -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (size > INT_MAX) - size = INT_MAX; -#endif + if (size > _PY_READ_MAX) { + size = _PY_READ_MAX; + } bytes = PyBytes_FromStringAndSize(NULL, size); if (bytes == NULL) diff --git a/Python/fileutils.c b/Python/fileutils.c index 0486f865924a..2c4061e2692c 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1471,18 +1471,9 @@ _Py_read(int fd, void *buf, size_t count) * handler raised an exception. */ assert(!PyErr_Occurred()); -#ifdef MS_WINDOWS - if (count > INT_MAX) { - /* On Windows, the count parameter of read() is an int */ - count = INT_MAX; - } -#else - if (count > PY_SSIZE_T_MAX) { - /* if count is greater than PY_SSIZE_T_MAX, - * read() result is undefined */ - count = PY_SSIZE_T_MAX; + if (count > _PY_READ_MAX) { + count = _PY_READ_MAX; } -#endif _Py_BEGIN_SUPPRESS_IPH do { @@ -1533,15 +1524,10 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held) depending on heap usage). */ count = 32767; } - else if (count > INT_MAX) - count = INT_MAX; -#else - if (count > PY_SSIZE_T_MAX) { - /* write() should truncate count to PY_SSIZE_T_MAX, but it's safer - * to do it ourself to have a portable behaviour. */ - count = PY_SSIZE_T_MAX; - } #endif + if (count > _PY_WRITE_MAX) { + count = _PY_WRITE_MAX; + } if (gil_held) { do { From webhook-mailer at python.org Wed Oct 17 19:52:26 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 17 Oct 2018 23:52:26 -0000 Subject: [Python-checkins] [3.6] bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) (GH-9937) Message-ID: https://github.com/python/cpython/commit/a5ebc205beea2bf1501e4ac33ed6e81732dd0604 commit: a5ebc205beea2bf1501e4ac33ed6e81732dd0604 branch: 3.6 author: St?phane Wirtel committer: Victor Stinner date: 2018-10-18T01:52:21+02:00 summary: [3.6] bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) (GH-9937) On macOS, fix reading from and writing into a file with a size larger than 2 GiB. (cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557) files: A Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst M Include/fileutils.h M Lib/test/test_largefile.py M Modules/_io/fileio.c M Python/fileutils.c diff --git a/Include/fileutils.h b/Include/fileutils.h index 9fce7d23cf0e..4efcf13219c3 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -29,6 +29,19 @@ PyAPI_FUNC(char*) _Py_EncodeLocaleEx( PyAPI_FUNC(PyObject *) _Py_device_encoding(int); +#if defined(MS_WINDOWS) || defined(__APPLE__) + /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611). + On macOS 10.13, read() and write() with more than INT_MAX bytes + fail with EINVAL (bpo-24658). */ +# define _PY_READ_MAX INT_MAX +# define _PY_WRITE_MAX INT_MAX +#else + /* write() should truncate the input to PY_SSIZE_T_MAX bytes, + but it's safer to do it ourself to have a portable behaviour */ +# define _PY_READ_MAX PY_SSIZE_T_MAX +# define _PY_WRITE_MAX PY_SSIZE_T_MAX +#endif + #ifdef MS_WINDOWS struct _Py_stat_struct { unsigned long st_dev; diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index d07bb8eee5a7..fd2cc03259e8 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -5,12 +5,12 @@ import stat import sys import unittest -from test.support import TESTFN, requires, unlink +from test.support import TESTFN, requires, unlink, bigmemtest import io # C implementation of io import _pyio as pyio # Python implementation of io -# size of file to create (>2GB; 2GB == 2147483648 bytes) -size = 2500000000 +# size of file to create (>2 GiB; 2 GiB == 2,147,483,648 bytes) +size = 2_500_000_000 class LargeFileTest: """Test that each file function works as expected for large @@ -45,6 +45,15 @@ def tearDownClass(cls): raise cls.failureException('File was not truncated by opening ' 'with mode "wb"') + # _pyio.FileIO.readall() uses a temporary bytearray then casted to bytes, + # so memuse=2 is needed + @bigmemtest(size=size, memuse=2, dry_run=False) + def test_large_read(self, _size): + # bpo-24658: Test that a read greater than 2GB does not fail. + with self.open(TESTFN, "rb") as f: + self.assertEqual(len(f.read()), size + 1) + self.assertEqual(f.tell(), size + 1) + def test_osstat(self): self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1) diff --git a/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst b/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst new file mode 100644 index 000000000000..ff660a125c64 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst @@ -0,0 +1 @@ +On macOS, fix reading from and writing into a file with a size larger than 2 GiB. \ No newline at end of file diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 52cbb94b24b6..e014552887fa 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -799,11 +799,9 @@ _io_FileIO_read_impl(fileio *self, Py_ssize_t size) if (size < 0) return _io_FileIO_readall_impl(self); -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (size > INT_MAX) - size = INT_MAX; -#endif + if (size > _PY_READ_MAX) { + size = _PY_READ_MAX; + } bytes = PyBytes_FromStringAndSize(NULL, size); if (bytes == NULL) diff --git a/Python/fileutils.c b/Python/fileutils.c index b8e489125e3c..306838ecce44 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1263,18 +1263,9 @@ _Py_read(int fd, void *buf, size_t count) * handler raised an exception. */ assert(!PyErr_Occurred()); -#ifdef MS_WINDOWS - if (count > INT_MAX) { - /* On Windows, the count parameter of read() is an int */ - count = INT_MAX; - } -#else - if (count > PY_SSIZE_T_MAX) { - /* if count is greater than PY_SSIZE_T_MAX, - * read() result is undefined */ - count = PY_SSIZE_T_MAX; + if (count > _PY_READ_MAX) { + count = _PY_READ_MAX; } -#endif _Py_BEGIN_SUPPRESS_IPH do { @@ -1325,15 +1316,10 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held) depending on heap usage). */ count = 32767; } - else if (count > INT_MAX) - count = INT_MAX; -#else - if (count > PY_SSIZE_T_MAX) { - /* write() should truncate count to PY_SSIZE_T_MAX, but it's safer - * to do it ourself to have a portable behaviour. */ - count = PY_SSIZE_T_MAX; - } #endif + if (count > _PY_WRITE_MAX) { + count = _PY_WRITE_MAX; + } if (gil_held) { do { From webhook-mailer at python.org Wed Oct 17 21:10:51 2018 From: webhook-mailer at python.org (Gregory P. Smith) Date: Thu, 18 Oct 2018 01:10:51 -0000 Subject: [Python-checkins] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) Message-ID: https://github.com/python/cpython/commit/9d4712bc8f26bf1d7e626b53ab092fe030bcd68d commit: 9d4712bc8f26bf1d7e626b53ab092fe030bcd68d branch: master author: Gregory P. Smith committer: GitHub date: 2018-10-17T18:10:46-07:00 summary: bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) Restores the use of pyexpatns.h to isolate our embedded copy of the expat C library so that its symbols do not conflict at link or dynamic loading time with an embedding application or other extension modules with their own version of libexpat. https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60#diff-3afaf7274c90ce1b7405f75ad825f545 inadvertently removed it when upgrading expat. files: A Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst M Modules/expat/expat_external.h diff --git a/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst b/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst new file mode 100644 index 000000000000..4411ffea45ce --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst @@ -0,0 +1,4 @@ +Restores the use of pyexpatns.h to isolate our embedded copy of the expat C +library so that its symbols do not conflict at link or dynamic loading time +with an embedding application or other extension modules with their own +version of libexpat. diff --git a/Modules/expat/expat_external.h b/Modules/expat/expat_external.h index 629483a91b27..2d96b4f41ad7 100644 --- a/Modules/expat/expat_external.h +++ b/Modules/expat/expat_external.h @@ -35,6 +35,10 @@ /* External API definitions */ +/* Namespace external symbols to allow multiple libexpat version to + co-exist. */ +#include "pyexpatns.h" + #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) # define XML_USE_MSC_EXTENSIONS 1 #endif From webhook-mailer at python.org Wed Oct 17 22:05:51 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 18 Oct 2018 02:05:51 -0000 Subject: [Python-checkins] [3.6] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9941) Message-ID: https://github.com/python/cpython/commit/4bfecb9298d447d5599ea76f3f68f772c38b8fd0 commit: 4bfecb9298d447d5599ea76f3f68f772c38b8fd0 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-17T19:05:47-07:00 summary: [3.6] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9941) Restores the use of pyexpatns.h to isolate our embedded copy of the expat C library so that its symbols do not conflict at link or dynamic loading time with an embedding application or other extension modules with their own version of libexpat. https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60GH-diff-3afaf7274c90ce1b7405f75ad825f545 inadvertently removed it when upgrading expat. (cherry picked from commit 9d4712bc8f26bf1d7e626b53ab092fe030bcd68d) Co-authored-by: Gregory P. Smith https://bugs.python.org/issue35011 files: A Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst M Modules/expat/expat_external.h diff --git a/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst b/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst new file mode 100644 index 000000000000..4411ffea45ce --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst @@ -0,0 +1,4 @@ +Restores the use of pyexpatns.h to isolate our embedded copy of the expat C +library so that its symbols do not conflict at link or dynamic loading time +with an embedding application or other extension modules with their own +version of libexpat. diff --git a/Modules/expat/expat_external.h b/Modules/expat/expat_external.h index 629483a91b27..2d96b4f41ad7 100644 --- a/Modules/expat/expat_external.h +++ b/Modules/expat/expat_external.h @@ -35,6 +35,10 @@ /* External API definitions */ +/* Namespace external symbols to allow multiple libexpat version to + co-exist. */ +#include "pyexpatns.h" + #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) # define XML_USE_MSC_EXTENSIONS 1 #endif From webhook-mailer at python.org Wed Oct 17 22:06:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 18 Oct 2018 02:06:34 -0000 Subject: [Python-checkins] [3.7] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9940) Message-ID: https://github.com/python/cpython/commit/35ae99d7b394af0ce01460f7bccd7449a82289ad commit: 35ae99d7b394af0ce01460f7bccd7449a82289ad branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-17T19:06:30-07:00 summary: [3.7] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9940) Restores the use of pyexpatns.h to isolate our embedded copy of the expat C library so that its symbols do not conflict at link or dynamic loading time with an embedding application or other extension modules with their own version of libexpat. https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60GH-diff-3afaf7274c90ce1b7405f75ad825f545 inadvertently removed it when upgrading expat. (cherry picked from commit 9d4712bc8f26bf1d7e626b53ab092fe030bcd68d) Co-authored-by: Gregory P. Smith https://bugs.python.org/issue35011 files: A Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst M Modules/expat/expat_external.h diff --git a/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst b/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst new file mode 100644 index 000000000000..4411ffea45ce --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-10-17-17-38-57.bpo-35011.GgoPIC.rst @@ -0,0 +1,4 @@ +Restores the use of pyexpatns.h to isolate our embedded copy of the expat C +library so that its symbols do not conflict at link or dynamic loading time +with an embedding application or other extension modules with their own +version of libexpat. diff --git a/Modules/expat/expat_external.h b/Modules/expat/expat_external.h index 629483a91b27..2d96b4f41ad7 100644 --- a/Modules/expat/expat_external.h +++ b/Modules/expat/expat_external.h @@ -35,6 +35,10 @@ /* External API definitions */ +/* Namespace external symbols to allow multiple libexpat version to + co-exist. */ +#include "pyexpatns.h" + #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) # define XML_USE_MSC_EXTENSIONS 1 #endif From webhook-mailer at python.org Thu Oct 18 02:49:59 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 18 Oct 2018 06:49:59 -0000 Subject: [Python-checkins] bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924) Message-ID: https://github.com/python/cpython/commit/6f906b3d727d6b341abd5ad9c0652bbcbd5eb024 commit: 6f906b3d727d6b341abd5ad9c0652bbcbd5eb024 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-18T09:49:54+03:00 summary: bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924) C implementation of xml.etree.ElementTree.Element.__setstate__() leaked references to children when called for already initialized element. files: A Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.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 765652ff7522..e87de6094441 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -117,6 +117,22 @@ def __del__(self): elem.tail = X() elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure + def test_setstate_leaks(self): + # Test reference leaks + elem = cET.Element.__new__(cET.Element) + for i in range(100): + elem.__setstate__({'tag': 'foo', 'attrib': {'bar': 42}, + '_children': [cET.Element('child')], + 'text': 'text goes here', + 'tail': 'opposite of head'}) + + self.assertEqual(elem.tag, 'foo') + self.assertEqual(elem.text, 'text goes here') + self.assertEqual(elem.tail, 'opposite of head') + self.assertEqual(list(elem.attrib.items()), [('bar', 42)]) + self.assertEqual(len(elem), 1) + self.assertEqual(elem[0].tag, 'child') + @unittest.skipUnless(cET, 'requires _elementtree') class TestAliasWorking(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst new file mode 100644 index 000000000000..3d12a918fc73 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst @@ -0,0 +1,3 @@ +Fixed references leaks when call the ``__setstate__()`` method of +:class:`xml.etree.ElementTree.Element` in the C implementation for already +initialized element. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 1c72c6538326..919591467c0d 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -233,11 +233,29 @@ create_extra(ElementObject* self, PyObject* attrib) } LOCAL(void) -dealloc_extra(ElementObject* self) +dealloc_extra(ElementObjectExtra *extra) { - ElementObjectExtra *myextra; Py_ssize_t i; + if (!extra) + return; + + Py_DECREF(extra->attrib); + + for (i = 0; i < extra->length; i++) + Py_DECREF(extra->children[i]); + + if (extra->children != extra->_children) + PyObject_Free(extra->children); + + PyObject_Free(extra); +} + +LOCAL(void) +clear_extra(ElementObject* self) +{ + ElementObjectExtra *myextra; + if (!self->extra) return; @@ -246,15 +264,7 @@ dealloc_extra(ElementObject* self) myextra = self->extra; self->extra = NULL; - Py_DECREF(myextra->attrib); - - for (i = 0; i < myextra->length; i++) - Py_DECREF(myextra->children[i]); - - if (myextra->children != myextra->_children) - PyObject_Free(myextra->children); - - PyObject_Free(myextra); + dealloc_extra(myextra); } /* Convenience internal function to create new Element objects with the given @@ -420,6 +430,7 @@ element_resize(ElementObject* self, Py_ssize_t extra) Py_ssize_t size; PyObject* *children; + assert(extra >= 0); /* make sure self->children can hold the given number of extra elements. set an exception and return -1 if allocation failed */ @@ -624,7 +635,7 @@ element_gc_clear(ElementObject *self) /* After dropping all references from extra, it's no longer valid anyway, * so fully deallocate it. */ - dealloc_extra(self); + clear_extra(self); return 0; } @@ -676,7 +687,7 @@ static PyObject * _elementtree_Element_clear_impl(ElementObject *self) /*[clinic end generated code: output=8bcd7a51f94cfff6 input=3c719ff94bf45dd6]*/ { - dealloc_extra(self); + clear_extra(self); Py_INCREF(Py_None); _set_joined_ptr(&self->text, Py_None); @@ -710,6 +721,7 @@ _elementtree_Element___copy___impl(ElementObject *self) Py_INCREF(JOIN_OBJ(self->tail)); _set_joined_ptr(&element->tail, self->tail); + assert(!element->extra || !element->extra->length); if (self->extra) { if (element_resize(element, self->extra->length) < 0) { Py_DECREF(element); @@ -721,6 +733,7 @@ _elementtree_Element___copy___impl(ElementObject *self) element->extra->children[i] = self->extra->children[i]; } + assert(!element->extra->length); element->extra->length = self->extra->length; } @@ -783,6 +796,7 @@ _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo) goto error; _set_joined_ptr(&element->tail, JOIN_SET(tail, JOIN_GET(self->tail))); + assert(!element->extra || !element->extra->length); if (self->extra) { if (element_resize(element, self->extra->length) < 0) goto error; @@ -796,6 +810,7 @@ _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo) element->extra->children[i] = child; } + assert(!element->extra->length); element->extra->length = self->extra->length; } @@ -957,6 +972,7 @@ element_setstate_from_attributes(ElementObject *self, PyObject *children) { Py_ssize_t i, nchildren; + ElementObjectExtra *oldextra = NULL; if (!tag) { PyErr_SetString(PyExc_TypeError, "tag may not be NULL"); @@ -975,8 +991,9 @@ element_setstate_from_attributes(ElementObject *self, _set_joined_ptr(&self->tail, tail); /* Handle ATTRIB and CHILDREN. */ - if (!children && !attrib) + if (!children && !attrib) { Py_RETURN_NONE; + } /* Compute 'nchildren'. */ if (children) { @@ -984,32 +1001,48 @@ element_setstate_from_attributes(ElementObject *self, PyErr_SetString(PyExc_TypeError, "'_children' is not a list"); return NULL; } - nchildren = PyList_Size(children); - } - else { - nchildren = 0; - } + nchildren = PyList_GET_SIZE(children); - /* Allocate 'extra'. */ - if (element_resize(self, nchildren)) { - return NULL; - } - assert(self->extra && self->extra->allocated >= nchildren); + /* (Re-)allocate 'extra'. + Avoid DECREFs calling into this code again (cycles, etc.) + */ + oldextra = self->extra; + self->extra = NULL; + if (element_resize(self, nchildren)) { + assert(!self->extra || !self->extra->length); + clear_extra(self); + self->extra = oldextra; + return NULL; + } + assert(self->extra); + assert(self->extra->allocated >= nchildren); + if (oldextra) { + assert(self->extra->attrib == Py_None); + self->extra->attrib = oldextra->attrib; + oldextra->attrib = Py_None; + } - /* Copy children */ - for (i = 0; i < nchildren; i++) { - self->extra->children[i] = PyList_GET_ITEM(children, i); - Py_INCREF(self->extra->children[i]); - } + /* Copy children */ + for (i = 0; i < nchildren; i++) { + self->extra->children[i] = PyList_GET_ITEM(children, i); + Py_INCREF(self->extra->children[i]); + } - self->extra->length = nchildren; - self->extra->allocated = nchildren; + assert(!self->extra->length); + self->extra->length = nchildren; + } + else { + if (element_resize(self, 0)) { + return NULL; + } + } /* Stash attrib. */ if (attrib) { Py_INCREF(attrib); Py_XSETREF(self->extra->attrib, attrib); } + dealloc_extra(oldextra); Py_RETURN_NONE; } From webhook-mailer at python.org Thu Oct 18 02:58:44 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 18 Oct 2018 06:58:44 -0000 Subject: [Python-checkins] bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) Message-ID: https://github.com/python/cpython/commit/178d1c07778553bf66e09fe0bb13796be3fb9abf commit: 178d1c07778553bf66e09fe0bb13796be3fb9abf branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-17T23:58:40-07:00 summary: bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) On macOS, fix reading from and writing into a file with a size larger than 2 GiB. (cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst M Include/fileutils.h M Lib/test/test_largefile.py M Modules/_io/fileio.c M Python/fileutils.c diff --git a/Include/fileutils.h b/Include/fileutils.h index e4bf6d4db95d..c05ff43f5163 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -60,6 +60,19 @@ PyAPI_FUNC(int) _Py_EncodeLocaleEx( #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _Py_device_encoding(int); +#if defined(MS_WINDOWS) || defined(__APPLE__) + /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611). + On macOS 10.13, read() and write() with more than INT_MAX bytes + fail with EINVAL (bpo-24658). */ +# define _PY_READ_MAX INT_MAX +# define _PY_WRITE_MAX INT_MAX +#else + /* write() should truncate the input to PY_SSIZE_T_MAX bytes, + but it's safer to do it ourself to have a portable behaviour */ +# define _PY_READ_MAX PY_SSIZE_T_MAX +# define _PY_WRITE_MAX PY_SSIZE_T_MAX +#endif + #ifdef MS_WINDOWS struct _Py_stat_struct { unsigned long st_dev; diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index 21296ccafe54..8870c721ab0e 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -5,12 +5,12 @@ import stat import sys import unittest -from test.support import TESTFN, requires, unlink +from test.support import TESTFN, requires, unlink, bigmemtest import io # C implementation of io import _pyio as pyio # Python implementation of io # size of file to create (>2 GiB; 2 GiB == 2,147,483,648 bytes) -size = 2500000000 +size = 2_500_000_000 class LargeFileTest: """Test that each file function works as expected for large @@ -45,6 +45,15 @@ def tearDownClass(cls): raise cls.failureException('File was not truncated by opening ' 'with mode "wb"') + # _pyio.FileIO.readall() uses a temporary bytearray then casted to bytes, + # so memuse=2 is needed + @bigmemtest(size=size, memuse=2, dry_run=False) + def test_large_read(self, _size): + # bpo-24658: Test that a read greater than 2GB does not fail. + with self.open(TESTFN, "rb") as f: + self.assertEqual(len(f.read()), size + 1) + self.assertEqual(f.tell(), size + 1) + def test_osstat(self): self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1) diff --git a/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst b/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst new file mode 100644 index 000000000000..ff660a125c64 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-17-14-36-08.bpo-24658.Naddgx.rst @@ -0,0 +1 @@ +On macOS, fix reading from and writing into a file with a size larger than 2 GiB. \ No newline at end of file diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 0d5bf3b22114..8bbe1ce367e2 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -791,11 +791,9 @@ _io_FileIO_read_impl(fileio *self, Py_ssize_t size) if (size < 0) return _io_FileIO_readall_impl(self); -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (size > INT_MAX) - size = INT_MAX; -#endif + if (size > _PY_READ_MAX) { + size = _PY_READ_MAX; + } bytes = PyBytes_FromStringAndSize(NULL, size); if (bytes == NULL) diff --git a/Python/fileutils.c b/Python/fileutils.c index b413f4e1e682..e72ce543cb68 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1363,18 +1363,9 @@ _Py_read(int fd, void *buf, size_t count) * handler raised an exception. */ assert(!PyErr_Occurred()); -#ifdef MS_WINDOWS - if (count > INT_MAX) { - /* On Windows, the count parameter of read() is an int */ - count = INT_MAX; - } -#else - if (count > PY_SSIZE_T_MAX) { - /* if count is greater than PY_SSIZE_T_MAX, - * read() result is undefined */ - count = PY_SSIZE_T_MAX; + if (count > _PY_READ_MAX) { + count = _PY_READ_MAX; } -#endif _Py_BEGIN_SUPPRESS_IPH do { @@ -1425,15 +1416,10 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held) depending on heap usage). */ count = 32767; } - else if (count > INT_MAX) - count = INT_MAX; -#else - if (count > PY_SSIZE_T_MAX) { - /* write() should truncate count to PY_SSIZE_T_MAX, but it's safer - * to do it ourself to have a portable behaviour. */ - count = PY_SSIZE_T_MAX; - } #endif + if (count > _PY_WRITE_MAX) { + count = _PY_WRITE_MAX; + } if (gil_held) { do { From webhook-mailer at python.org Thu Oct 18 03:16:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 18 Oct 2018 07:16:45 -0000 Subject: [Python-checkins] bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924) Message-ID: https://github.com/python/cpython/commit/bcbefe23fe2eb616a03c22764ba4ea79e12e3e28 commit: bcbefe23fe2eb616a03c22764ba4ea79e12e3e28 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-18T00:16:40-07:00 summary: bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924) C implementation of xml.etree.ElementTree.Element.__setstate__() leaked references to children when called for already initialized element. (cherry picked from commit 6f906b3d727d6b341abd5ad9c0652bbcbd5eb024) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.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 d99b4e7527fb..1a1f660d5baa 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -116,6 +116,22 @@ def __del__(self): elem.tail = X() elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure + def test_setstate_leaks(self): + # Test reference leaks + elem = cET.Element.__new__(cET.Element) + for i in range(100): + elem.__setstate__({'tag': 'foo', 'attrib': {'bar': 42}, + '_children': [cET.Element('child')], + 'text': 'text goes here', + 'tail': 'opposite of head'}) + + self.assertEqual(elem.tag, 'foo') + self.assertEqual(elem.text, 'text goes here') + self.assertEqual(elem.tail, 'opposite of head') + self.assertEqual(list(elem.attrib.items()), [('bar', 42)]) + self.assertEqual(len(elem), 1) + self.assertEqual(elem[0].tag, 'child') + @unittest.skipUnless(cET, 'requires _elementtree') class TestAliasWorking(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst new file mode 100644 index 000000000000..3d12a918fc73 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst @@ -0,0 +1,3 @@ +Fixed references leaks when call the ``__setstate__()`` method of +:class:`xml.etree.ElementTree.Element` in the C implementation for already +initialized element. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 00fa0ae1ede4..a96e0306996b 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -233,11 +233,29 @@ create_extra(ElementObject* self, PyObject* attrib) } LOCAL(void) -dealloc_extra(ElementObject* self) +dealloc_extra(ElementObjectExtra *extra) { - ElementObjectExtra *myextra; Py_ssize_t i; + if (!extra) + return; + + Py_DECREF(extra->attrib); + + for (i = 0; i < extra->length; i++) + Py_DECREF(extra->children[i]); + + if (extra->children != extra->_children) + PyObject_Free(extra->children); + + PyObject_Free(extra); +} + +LOCAL(void) +clear_extra(ElementObject* self) +{ + ElementObjectExtra *myextra; + if (!self->extra) return; @@ -246,15 +264,7 @@ dealloc_extra(ElementObject* self) myextra = self->extra; self->extra = NULL; - Py_DECREF(myextra->attrib); - - for (i = 0; i < myextra->length; i++) - Py_DECREF(myextra->children[i]); - - if (myextra->children != myextra->_children) - PyObject_Free(myextra->children); - - PyObject_Free(myextra); + dealloc_extra(myextra); } /* Convenience internal function to create new Element objects with the given @@ -420,6 +430,7 @@ element_resize(ElementObject* self, Py_ssize_t extra) Py_ssize_t size; PyObject* *children; + assert(extra >= 0); /* make sure self->children can hold the given number of extra elements. set an exception and return -1 if allocation failed */ @@ -624,7 +635,7 @@ element_gc_clear(ElementObject *self) /* After dropping all references from extra, it's no longer valid anyway, * so fully deallocate it. */ - dealloc_extra(self); + clear_extra(self); return 0; } @@ -676,7 +687,7 @@ static PyObject * _elementtree_Element_clear_impl(ElementObject *self) /*[clinic end generated code: output=8bcd7a51f94cfff6 input=3c719ff94bf45dd6]*/ { - dealloc_extra(self); + clear_extra(self); Py_INCREF(Py_None); _set_joined_ptr(&self->text, Py_None); @@ -710,6 +721,7 @@ _elementtree_Element___copy___impl(ElementObject *self) Py_INCREF(JOIN_OBJ(self->tail)); _set_joined_ptr(&element->tail, self->tail); + assert(!element->extra || !element->extra->length); if (self->extra) { if (element_resize(element, self->extra->length) < 0) { Py_DECREF(element); @@ -721,6 +733,7 @@ _elementtree_Element___copy___impl(ElementObject *self) element->extra->children[i] = self->extra->children[i]; } + assert(!element->extra->length); element->extra->length = self->extra->length; } @@ -783,6 +796,7 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *memo) goto error; _set_joined_ptr(&element->tail, JOIN_SET(tail, JOIN_GET(self->tail))); + assert(!element->extra || !element->extra->length); if (self->extra) { if (element_resize(element, self->extra->length) < 0) goto error; @@ -796,6 +810,7 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *memo) element->extra->children[i] = child; } + assert(!element->extra->length); element->extra->length = self->extra->length; } @@ -956,6 +971,7 @@ element_setstate_from_attributes(ElementObject *self, PyObject *children) { Py_ssize_t i, nchildren; + ElementObjectExtra *oldextra = NULL; if (!tag) { PyErr_SetString(PyExc_TypeError, "tag may not be NULL"); @@ -974,8 +990,9 @@ element_setstate_from_attributes(ElementObject *self, _set_joined_ptr(&self->tail, tail); /* Handle ATTRIB and CHILDREN. */ - if (!children && !attrib) + if (!children && !attrib) { Py_RETURN_NONE; + } /* Compute 'nchildren'. */ if (children) { @@ -983,32 +1000,48 @@ element_setstate_from_attributes(ElementObject *self, PyErr_SetString(PyExc_TypeError, "'_children' is not a list"); return NULL; } - nchildren = PyList_Size(children); - } - else { - nchildren = 0; - } + nchildren = PyList_GET_SIZE(children); - /* Allocate 'extra'. */ - if (element_resize(self, nchildren)) { - return NULL; - } - assert(self->extra && self->extra->allocated >= nchildren); + /* (Re-)allocate 'extra'. + Avoid DECREFs calling into this code again (cycles, etc.) + */ + oldextra = self->extra; + self->extra = NULL; + if (element_resize(self, nchildren)) { + assert(!self->extra || !self->extra->length); + clear_extra(self); + self->extra = oldextra; + return NULL; + } + assert(self->extra); + assert(self->extra->allocated >= nchildren); + if (oldextra) { + assert(self->extra->attrib == Py_None); + self->extra->attrib = oldextra->attrib; + oldextra->attrib = Py_None; + } - /* Copy children */ - for (i = 0; i < nchildren; i++) { - self->extra->children[i] = PyList_GET_ITEM(children, i); - Py_INCREF(self->extra->children[i]); - } + /* Copy children */ + for (i = 0; i < nchildren; i++) { + self->extra->children[i] = PyList_GET_ITEM(children, i); + Py_INCREF(self->extra->children[i]); + } - self->extra->length = nchildren; - self->extra->allocated = nchildren; + assert(!self->extra->length); + self->extra->length = nchildren; + } + else { + if (element_resize(self, 0)) { + return NULL; + } + } /* Stash attrib. */ if (attrib) { Py_INCREF(attrib); Py_XSETREF(self->extra->attrib, attrib); } + dealloc_extra(oldextra); Py_RETURN_NONE; } From webhook-mailer at python.org Thu Oct 18 03:17:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 18 Oct 2018 07:17:19 -0000 Subject: [Python-checkins] bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924) Message-ID: https://github.com/python/cpython/commit/5b9b9353de502853b42a20d950ad0ac1fadd05ea commit: 5b9b9353de502853b42a20d950ad0ac1fadd05ea branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-18T00:17:15-07:00 summary: bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924) C implementation of xml.etree.ElementTree.Element.__setstate__() leaked references to children when called for already initialized element. (cherry picked from commit 6f906b3d727d6b341abd5ad9c0652bbcbd5eb024) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.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 765652ff7522..e87de6094441 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -117,6 +117,22 @@ def __del__(self): elem.tail = X() elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure + def test_setstate_leaks(self): + # Test reference leaks + elem = cET.Element.__new__(cET.Element) + for i in range(100): + elem.__setstate__({'tag': 'foo', 'attrib': {'bar': 42}, + '_children': [cET.Element('child')], + 'text': 'text goes here', + 'tail': 'opposite of head'}) + + self.assertEqual(elem.tag, 'foo') + self.assertEqual(elem.text, 'text goes here') + self.assertEqual(elem.tail, 'opposite of head') + self.assertEqual(list(elem.attrib.items()), [('bar', 42)]) + self.assertEqual(len(elem), 1) + self.assertEqual(elem[0].tag, 'child') + @unittest.skipUnless(cET, 'requires _elementtree') class TestAliasWorking(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst b/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst new file mode 100644 index 000000000000..3d12a918fc73 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-11-54-04.bpo-35008.dotef_.rst @@ -0,0 +1,3 @@ +Fixed references leaks when call the ``__setstate__()`` method of +:class:`xml.etree.ElementTree.Element` in the C implementation for already +initialized element. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 78a52e859df2..d13c6dd4db64 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -233,11 +233,29 @@ create_extra(ElementObject* self, PyObject* attrib) } LOCAL(void) -dealloc_extra(ElementObject* self) +dealloc_extra(ElementObjectExtra *extra) { - ElementObjectExtra *myextra; Py_ssize_t i; + if (!extra) + return; + + Py_DECREF(extra->attrib); + + for (i = 0; i < extra->length; i++) + Py_DECREF(extra->children[i]); + + if (extra->children != extra->_children) + PyObject_Free(extra->children); + + PyObject_Free(extra); +} + +LOCAL(void) +clear_extra(ElementObject* self) +{ + ElementObjectExtra *myextra; + if (!self->extra) return; @@ -246,15 +264,7 @@ dealloc_extra(ElementObject* self) myextra = self->extra; self->extra = NULL; - Py_DECREF(myextra->attrib); - - for (i = 0; i < myextra->length; i++) - Py_DECREF(myextra->children[i]); - - if (myextra->children != myextra->_children) - PyObject_Free(myextra->children); - - PyObject_Free(myextra); + dealloc_extra(myextra); } /* Convenience internal function to create new Element objects with the given @@ -420,6 +430,7 @@ element_resize(ElementObject* self, Py_ssize_t extra) Py_ssize_t size; PyObject* *children; + assert(extra >= 0); /* make sure self->children can hold the given number of extra elements. set an exception and return -1 if allocation failed */ @@ -624,7 +635,7 @@ element_gc_clear(ElementObject *self) /* After dropping all references from extra, it's no longer valid anyway, * so fully deallocate it. */ - dealloc_extra(self); + clear_extra(self); return 0; } @@ -676,7 +687,7 @@ static PyObject * _elementtree_Element_clear_impl(ElementObject *self) /*[clinic end generated code: output=8bcd7a51f94cfff6 input=3c719ff94bf45dd6]*/ { - dealloc_extra(self); + clear_extra(self); Py_INCREF(Py_None); _set_joined_ptr(&self->text, Py_None); @@ -710,6 +721,7 @@ _elementtree_Element___copy___impl(ElementObject *self) Py_INCREF(JOIN_OBJ(self->tail)); _set_joined_ptr(&element->tail, self->tail); + assert(!element->extra || !element->extra->length); if (self->extra) { if (element_resize(element, self->extra->length) < 0) { Py_DECREF(element); @@ -721,6 +733,7 @@ _elementtree_Element___copy___impl(ElementObject *self) element->extra->children[i] = self->extra->children[i]; } + assert(!element->extra->length); element->extra->length = self->extra->length; } @@ -783,6 +796,7 @@ _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo) goto error; _set_joined_ptr(&element->tail, JOIN_SET(tail, JOIN_GET(self->tail))); + assert(!element->extra || !element->extra->length); if (self->extra) { if (element_resize(element, self->extra->length) < 0) goto error; @@ -796,6 +810,7 @@ _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo) element->extra->children[i] = child; } + assert(!element->extra->length); element->extra->length = self->extra->length; } @@ -957,6 +972,7 @@ element_setstate_from_attributes(ElementObject *self, PyObject *children) { Py_ssize_t i, nchildren; + ElementObjectExtra *oldextra = NULL; if (!tag) { PyErr_SetString(PyExc_TypeError, "tag may not be NULL"); @@ -975,8 +991,9 @@ element_setstate_from_attributes(ElementObject *self, _set_joined_ptr(&self->tail, tail); /* Handle ATTRIB and CHILDREN. */ - if (!children && !attrib) + if (!children && !attrib) { Py_RETURN_NONE; + } /* Compute 'nchildren'. */ if (children) { @@ -984,32 +1001,48 @@ element_setstate_from_attributes(ElementObject *self, PyErr_SetString(PyExc_TypeError, "'_children' is not a list"); return NULL; } - nchildren = PyList_Size(children); - } - else { - nchildren = 0; - } + nchildren = PyList_GET_SIZE(children); - /* Allocate 'extra'. */ - if (element_resize(self, nchildren)) { - return NULL; - } - assert(self->extra && self->extra->allocated >= nchildren); + /* (Re-)allocate 'extra'. + Avoid DECREFs calling into this code again (cycles, etc.) + */ + oldextra = self->extra; + self->extra = NULL; + if (element_resize(self, nchildren)) { + assert(!self->extra || !self->extra->length); + clear_extra(self); + self->extra = oldextra; + return NULL; + } + assert(self->extra); + assert(self->extra->allocated >= nchildren); + if (oldextra) { + assert(self->extra->attrib == Py_None); + self->extra->attrib = oldextra->attrib; + oldextra->attrib = Py_None; + } - /* Copy children */ - for (i = 0; i < nchildren; i++) { - self->extra->children[i] = PyList_GET_ITEM(children, i); - Py_INCREF(self->extra->children[i]); - } + /* Copy children */ + for (i = 0; i < nchildren; i++) { + self->extra->children[i] = PyList_GET_ITEM(children, i); + Py_INCREF(self->extra->children[i]); + } - self->extra->length = nchildren; - self->extra->allocated = nchildren; + assert(!self->extra->length); + self->extra->length = nchildren; + } + else { + if (element_resize(self, 0)) { + return NULL; + } + } /* Stash attrib. */ if (attrib) { Py_INCREF(attrib); Py_XSETREF(self->extra->attrib, attrib); } + dealloc_extra(oldextra); Py_RETURN_NONE; } From webhook-mailer at python.org Thu Oct 18 04:52:06 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 18 Oct 2018 08:52:06 -0000 Subject: [Python-checkins] bpo-34765: Update the install-sh file (GH-9592) Message-ID: https://github.com/python/cpython/commit/b7ad31c8926aad2fdd0d4661373c25cc9d753a40 commit: b7ad31c8926aad2fdd0d4661373c25cc9d753a40 branch: master author: stratakis committer: Victor Stinner date: 2018-10-18T10:51:53+02:00 summary: bpo-34765: Update the install-sh file (GH-9592) Update the outdated install-sh file to the latest revision from automake v1.16.1 files: A Misc/NEWS.d/next/Build/2018-09-26-17-29-10.bpo-34765.AvxdVj.rst M install-sh diff --git a/Misc/NEWS.d/next/Build/2018-09-26-17-29-10.bpo-34765.AvxdVj.rst b/Misc/NEWS.d/next/Build/2018-09-26-17-29-10.bpo-34765.AvxdVj.rst new file mode 100644 index 000000000000..12ed26de8ce0 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-09-26-17-29-10.bpo-34765.AvxdVj.rst @@ -0,0 +1,2 @@ +Update the outdated install-sh file to the latest revision from automake +v1.16.1 diff --git a/install-sh b/install-sh old mode 100755 new mode 100644 index 0ec27bcd488d..8175c640fe62 --- a/install-sh +++ b/install-sh @@ -1,7 +1,8 @@ #!/bin/sh -# # install - install a program, script, or datafile -# + +scriptversion=2018-03-11.20; # UTC + # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. @@ -34,261 +35,484 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. +tab=' ' +nl=' +' +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +doit=${DOITPROG-} +doit_exec=${doit:-exec} +# Put in absolute file names if you don't have them in your path; +# or use environment vars. -# put in absolute paths if you don't have them in your path; or use env. vars. +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" +posix_mkdir= -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi +# Desired mode of installed file. +mode=0755 -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi -fi +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` +src= +dst= +dir_arg= +dst_arg= -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script +copy_on_change=false +is_target_a_directory=possibly -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. -pathcomp='' +Options: + --help display this help and exit. + --version display version info and exit. -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 - shift + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" - pathcomp=$pathcomp/ -done -fi +while test $# -ne 0; do + case $1 in + -c) ;; -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && + -C) copy_on_change=true;; - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else + -d) dir_arg=true;; -# If we're going to rename the final executable, determine the name now. + -g) chgrpcmd="$chgrpprog $2" + shift;; - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi + --help) echo "$usage"; exit $?;; -# don't allow the sed command to completely eliminate the filename + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi + -o) chowncmd="$chownprog $2" + shift;; -# Make a couple of temp file names in the proper directory. + -s) stripcmd=$stripprog;; - dsttmp=$dstdir/#inst.$$# - rmtmp=$dstdir/#rm.$$# + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; -# Trap to clean up temp files at exit. + -T) is_target_a_directory=never;; - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 + --version) echo "$0 $scriptversion"; exit $?;; -# Move or copy the file name to the temp name + --) shift + break;; - $doit $instcmd "$src" "$dsttmp" && + -*) echo "$0: invalid option: $1" >&2 + exit 1;; -# and set any options; do chmod last to preserve setuid bits + *) break;; + esac + shift +done -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi -{ - if [ -f "$dstdir/$dstfile" ] - then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi -} && +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi -# Now rename the file to the real destination. +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi -fi && +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac -# The final little trick to "correctly" pass the exit status to the exit trap. + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done -{ - (exit 0); exit -} +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: From solipsis at pitrou.net Thu Oct 18 05:07:33 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 18 Oct 2018 09:07:33 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181018090733.1.BA5E6A77429E97BA@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogy0GlPG', '--timeout', '7200'] From webhook-mailer at python.org Thu Oct 18 06:46:02 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Thu, 18 Oct 2018 10:46:02 -0000 Subject: [Python-checkins] Updated documentation on logging.debug(). (GH-9946) Message-ID: https://github.com/python/cpython/commit/bbd90e4f6273f1c29c03ab1374fdbd1a862fc14a commit: bbd90e4f6273f1c29c03ab1374fdbd1a862fc14a branch: master author: Vinay Sajip committer: GitHub date: 2018-10-18T11:45:58+01:00 summary: Updated documentation on logging.debug(). (GH-9946) files: M Doc/library/logging.rst diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 71a46ac7f20a..3a3428aa20e9 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -953,8 +953,8 @@ functions. There are three keyword arguments in *kwargs* which are inspected: *exc_info* which, if it does not evaluate as false, causes exception information to be added to the logging message. If an exception tuple (in the format returned by - :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info` - is called to get the exception information. + :func:`sys.exc_info`) or an exception instance is provided, it is used; + otherwise, :func:`sys.exc_info` is called to get the exception information. The second optional keyword argument is *stack_info*, which defaults to ``False``. If true, stack information is added to the logging From webhook-mailer at python.org Thu Oct 18 06:55:20 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Thu, 18 Oct 2018 10:55:20 -0000 Subject: [Python-checkins] Updated documentation on logging.debug(). (GH-9946) (GH-9949) Message-ID: https://github.com/python/cpython/commit/6802964fb4df1d40731a0e63ce81128aa441a0d2 commit: 6802964fb4df1d40731a0e63ce81128aa441a0d2 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Vinay Sajip date: 2018-10-18T11:55:15+01:00 summary: Updated documentation on logging.debug(). (GH-9946) (GH-9949) (cherry picked from commit bbd90e4f6273f1c29c03ab1374fdbd1a862fc14a) Co-authored-by: Vinay Sajip files: M Doc/library/logging.rst diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index a2188c860eb4..07556537860d 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -931,8 +931,8 @@ functions. There are three keyword arguments in *kwargs* which are inspected: *exc_info* which, if it does not evaluate as false, causes exception information to be added to the logging message. If an exception tuple (in the format returned by - :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info` - is called to get the exception information. + :func:`sys.exc_info`) or an exception instance is provided, it is used; + otherwise, :func:`sys.exc_info` is called to get the exception information. The second optional keyword argument is *stack_info*, which defaults to ``False``. If true, stack information is added to the logging From webhook-mailer at python.org Thu Oct 18 06:55:36 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Thu, 18 Oct 2018 10:55:36 -0000 Subject: [Python-checkins] Updated documentation on logging.debug(). (GH-9946) (GH-9950) Message-ID: https://github.com/python/cpython/commit/cc279f4b9d0fbab4c8003c97849846bc20259794 commit: cc279f4b9d0fbab4c8003c97849846bc20259794 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Vinay Sajip date: 2018-10-18T11:55:33+01:00 summary: Updated documentation on logging.debug(). (GH-9946) (GH-9950) (cherry picked from commit bbd90e4f6273f1c29c03ab1374fdbd1a862fc14a) Co-authored-by: Vinay Sajip files: M Doc/library/logging.rst diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 590d55689d8a..60d7758896a7 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -931,8 +931,8 @@ functions. There are three keyword arguments in *kwargs* which are inspected: *exc_info* which, if it does not evaluate as false, causes exception information to be added to the logging message. If an exception tuple (in the format returned by - :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info` - is called to get the exception information. + :func:`sys.exc_info`) or an exception instance is provided, it is used; + otherwise, :func:`sys.exc_info` is called to get the exception information. The second optional keyword argument is *stack_info*, which defaults to ``False``. If true, stack information is added to the logging From webhook-mailer at python.org Thu Oct 18 15:28:38 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 18 Oct 2018 19:28:38 -0000 Subject: [Python-checkins] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) Message-ID: https://github.com/python/cpython/commit/1deea5e53991b46351f6bb395b22365c9455ed88 commit: 1deea5e53991b46351f6bb395b22365c9455ed88 branch: master author: Juliette Monsel committer: Serhiy Storchaka date: 2018-10-18T22:28:31+03:00 summary: bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) files: A Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst M Lib/tkinter/__init__.py M Lib/tkinter/test/test_tkinter/test_widgets.py diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 1dc411884511..ae493ed3aaaf 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -4280,7 +4280,7 @@ def selection_adjust(self, index): select to commands. If the selection isn't currently in the spinbox, then a new selection is created to include the characters between index and the most recent selection - anchor point, inclusive. Returns an empty string. + anchor point, inclusive. """ return self.selection("adjust", index) @@ -4288,7 +4288,7 @@ def selection_clear(self): """Clear the selection If the selection isn't in this widget then the - command has no effect. Returns an empty string. + command has no effect. """ return self.selection("clear") @@ -4296,9 +4296,9 @@ def selection_element(self, element=None): """Sets or gets the currently selected element. If a spinbutton element is specified, it will be - displayed depressed + displayed depressed. """ - return self.selection("element", element) + return self.tk.call(self._w, 'selection', 'element', element) def selection_from(self, index): """Set the fixed end of a selection to INDEX.""" diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index 12a0fbeeeee1..16e9d93944c2 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -522,7 +522,14 @@ def test_selection_methods(self): self.assertEqual(widget.selection_get(), '2345') widget.selection_adjust(0) self.assertEqual(widget.selection_get(), '12345') - widget.selection_adjust(0) + + def test_selection_element(self): + widget = self.create() + self.assertEqual(widget.selection_element(), "none") + widget.selection_element("buttonup") + self.assertEqual(widget.selection_element(), "buttonup") + widget.selection_element("buttondown") + self.assertEqual(widget.selection_element(), "buttondown") @add_standard_options(StandardOptionsTests) diff --git a/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst new file mode 100644 index 000000000000..7c1f7bb59760 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst @@ -0,0 +1,2 @@ +Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. Patch by +Juliette Monsel. From webhook-mailer at python.org Thu Oct 18 15:53:23 2018 From: webhook-mailer at python.org (Zachary Ware) Date: Thu, 18 Oct 2018 19:53:23 -0000 Subject: [Python-checkins] Update opcode.h header comment to mention the source data file (GH-9935) Message-ID: https://github.com/python/cpython/commit/e3d1455fe472589c92b9e57b7d35addbb579edba commit: e3d1455fe472589c92b9e57b7d35addbb579edba branch: master author: Shivank98 committer: Zachary Ware date: 2018-10-18T14:53:18-05:00 summary: Update opcode.h header comment to mention the source data file (GH-9935) This is intended to help code explorers find out more about what's defined there. files: M Include/opcode.h M Tools/scripts/generate_opcode_h.py diff --git a/Include/opcode.h b/Include/opcode.h index e564bb9d598d..2a29e9788570 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -1,4 +1,4 @@ -/* Auto-generated by Tools/scripts/generate_opcode_h.py */ +/* Auto-generated by Tools/scripts/generate_opcode_h.py from Lib/opcode.py */ #ifndef Py_OPCODE_H #define Py_OPCODE_H #ifdef __cplusplus diff --git a/Tools/scripts/generate_opcode_h.py b/Tools/scripts/generate_opcode_h.py index 6622a3c8155b..b184ffa17093 100644 --- a/Tools/scripts/generate_opcode_h.py +++ b/Tools/scripts/generate_opcode_h.py @@ -3,7 +3,8 @@ import sys import tokenize -header = """/* Auto-generated by Tools/scripts/generate_opcode_h.py */ +header = """ +/* Auto-generated by Tools/scripts/generate_opcode_h.py from Lib/opcode.py */ #ifndef Py_OPCODE_H #define Py_OPCODE_H #ifdef __cplusplus @@ -12,7 +13,7 @@ /* Instruction opcodes for compiled code */ -""" +""".lstrip() footer = """ /* EXCEPT_HANDLER is a special, implicit block type which is created when From webhook-mailer at python.org Thu Oct 18 20:13:28 2018 From: webhook-mailer at python.org (R. David Murray) Date: Fri, 19 Oct 2018 00:13:28 -0000 Subject: [Python-checkins] bpo-26441: Remove documentation for deleted to_splittable and from_splittable methods (#9865) Message-ID: https://github.com/python/cpython/commit/5be00247ae0de2e24dd14bbe4d9ca159434a1710 commit: 5be00247ae0de2e24dd14bbe4d9ca159434a1710 branch: master author: Braden Groom committer: R. David Murray date: 2018-10-18T20:13:23-04:00 summary: bpo-26441: Remove documentation for deleted to_splittable and from_splittable methods (#9865) files: M Doc/library/email.charset.rst diff --git a/Doc/library/email.charset.rst b/Doc/library/email.charset.rst index 053463f9747b..38fda23bd823 100644 --- a/Doc/library/email.charset.rst +++ b/Doc/library/email.charset.rst @@ -110,39 +110,6 @@ Import this class from the :mod:`email.charset` module. returns the string ``7bit`` otherwise. - .. XXX to_splittable and from_splittable are not there anymore! - - .. to_splittable(s) - - Convert a possibly multibyte string to a safely splittable format. *s* is - the string to split. - - Uses the *input_codec* to try and convert the string to Unicode, so it can - be safely split on character boundaries (even for multibyte characters). - - Returns the string as-is if it isn't known how to convert *s* to Unicode - with the *input_charset*. - - Characters that could not be converted to Unicode will be replaced with - the Unicode replacement character ``'U+FFFD'``. - - - .. from_splittable(ustr[, to_output]) - - Convert a splittable string back into an encoded string. *ustr* is a - Unicode string to "unsplit". - - This method uses the proper codec to try and convert the string from - Unicode back into an encoded format. Return the string as-is if it is not - Unicode, or if it could not be converted from Unicode. - - Characters that could not be converted from Unicode will be replaced with - an appropriate character (usually ``'?'``). - - If *to_output* is ``True`` (the default), uses *output_codec* to convert - to an encoded format. If *to_output* is ``False``, it uses *input_codec*. - - .. method:: get_output_charset() Return the output character set. From webhook-mailer at python.org Thu Oct 18 20:16:19 2018 From: webhook-mailer at python.org (R. David Murray) Date: Fri, 19 Oct 2018 00:16:19 -0000 Subject: [Python-checkins] In email.parser in message_from_bytes, update `strict` to `policy` (GH-9854) (#9917) Message-ID: https://github.com/python/cpython/commit/8ba831f847e8f800834e5f3f452a9c2b5fdef171 commit: 8ba831f847e8f800834e5f3f452a9c2b5fdef171 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: R. David Murray date: 2018-10-18T20:16:16-04:00 summary: In email.parser in message_from_bytes, update `strict` to `policy` (GH-9854) (#9917) According to the versionchanged note, the `strict` argument was removed in 3.3 and `policy` was added, but the name of the argument in the paragraph wasn't updated. (cherry picked from commit a5ca98537b9f3f5eeae9157b1548b741df3fbf90) Co-authored-by: Cheryl Sabella files: M Doc/library/email.parser.rst diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index e0cab6a69497..49b4e992708a 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -238,7 +238,7 @@ in the top-level :mod:`email` package namespace. Return a message object structure from a :term:`bytes-like object`. This is equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and - *strict* are interpreted as with the :class:`~email.parser.BytesParser` class + *policy* are interpreted as with the :class:`~email.parser.BytesParser` class constructor. .. versionadded:: 3.2 From webhook-mailer at python.org Thu Oct 18 20:17:28 2018 From: webhook-mailer at python.org (R. David Murray) Date: Fri, 19 Oct 2018 00:17:28 -0000 Subject: [Python-checkins] In email docs, correct spelling of foregoing (GH-9856) (#9919) Message-ID: https://github.com/python/cpython/commit/2bc1e8c909773b4721c961d45eff7f4a41425b9b commit: 2bc1e8c909773b4721c961d45eff7f4a41425b9b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: R. David Murray date: 2018-10-18T20:17:25-04:00 summary: In email docs, correct spelling of foregoing (GH-9856) (#9919) (cherry picked from commit c984d20ec81609aa439ccdb3af5bc35fca0c2112) Co-authored-by: Cheryl Sabella files: M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 1033d8c130eb..07d455ba39d3 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -87,7 +87,7 @@ to advanced applications. Following those is a set of examples of using the fundamental parts of the APIs covered in the preceding sections. -The forgoing represent the modern (unicode friendly) API of the email package. +The foregoing represent the modern (unicode friendly) API of the email package. The remaining sections, starting with the :class:`~email.message.Message` class, cover the legacy :data:`~email.policy.compat32` API that deals much more directly with the details of how email messages are represented. The From webhook-mailer at python.org Thu Oct 18 20:21:50 2018 From: webhook-mailer at python.org (R. David Murray) Date: Fri, 19 Oct 2018 00:21:50 -0000 Subject: [Python-checkins] bpo-31522: mailbox.get_string: pass `from_` parameter to `get_bytes` (#9857) Message-ID: https://github.com/python/cpython/commit/d16f012f842e5719ff9fb90e217efc0f795853f2 commit: d16f012f842e5719ff9fb90e217efc0f795853f2 branch: master author: Cheryl Sabella committer: R. David Murray date: 2018-10-18T20:21:47-04:00 summary: bpo-31522: mailbox.get_string: pass `from_` parameter to `get_bytes` (#9857) This allows *from_* to be successfully set to a non-default value when calling mbox.get_string. files: A Misc/NEWS.d/next/Library/2018-10-13-18-16-20.bpo-31522.rWBb43.rst M Lib/mailbox.py M Lib/test/test_mailbox.py diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 056251dce0ad..5b4e86419f11 100644 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -784,7 +784,7 @@ def get_message(self, key): def get_string(self, key, from_=False): """Return a string representation or raise a KeyError.""" return email.message_from_bytes( - self.get_bytes(key)).as_string(unixfrom=from_) + self.get_bytes(key, from_)).as_string(unixfrom=from_) def get_bytes(self, key, from_=False): """Return a string representation or raise a KeyError.""" diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 3807b95b1582..a75c8cb00e80 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -988,6 +988,34 @@ def assertMailboxEmpty(self): with open(self._path) as f: self.assertEqual(f.readlines(), []) + def test_get_bytes_from(self): + # Get bytes representations of messages with _unixfrom. + unixfrom = 'From foo at bar blah\n' + key0 = self._box.add(unixfrom + self._template % 0) + key1 = self._box.add(unixfrom + _sample_message) + self.assertEqual(self._box.get_bytes(key0, from_=False), + (self._template % 0).encode('ascii')) + self.assertEqual(self._box.get_bytes(key1, from_=False), + _bytes_sample_message) + self.assertEqual(self._box.get_bytes(key0, from_=True), + (unixfrom + self._template % 0).encode('ascii')) + self.assertEqual(self._box.get_bytes(key1, from_=True), + unixfrom.encode('ascii') + _bytes_sample_message) + + def test_get_string_from(self): + # Get string representations of messages with _unixfrom. + unixfrom = 'From foo at bar blah\n' + key0 = self._box.add(unixfrom + self._template % 0) + key1 = self._box.add(unixfrom + _sample_message) + self.assertEqual(self._box.get_string(key0, from_=False), + self._template % 0) + self.assertEqual(self._box.get_string(key1, from_=False).split('\n'), + _sample_message.split('\n')) + self.assertEqual(self._box.get_string(key0, from_=True), + unixfrom + self._template % 0) + self.assertEqual(self._box.get_string(key1, from_=True).split('\n'), + (unixfrom + _sample_message).split('\n')) + def test_add_from_string(self): # Add a string starting with 'From ' to the mailbox key = self._box.add('From foo at bar blah\nFrom: foo\n\n0\n') diff --git a/Misc/NEWS.d/next/Library/2018-10-13-18-16-20.bpo-31522.rWBb43.rst b/Misc/NEWS.d/next/Library/2018-10-13-18-16-20.bpo-31522.rWBb43.rst new file mode 100644 index 000000000000..5aea7173fc6d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-18-16-20.bpo-31522.rWBb43.rst @@ -0,0 +1 @@ +The `mailbox.mbox.get_string` function *from_* parameter can now successfully be set to a non-default value. From webhook-mailer at python.org Fri Oct 19 02:57:42 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 19 Oct 2018 06:57:42 -0000 Subject: [Python-checkins] Fix several reference counting bugs in pyexpat.c. (GH-9955) Message-ID: https://github.com/python/cpython/commit/68def052dcd41313eff2bd9f269e22c5a941db4d commit: 68def052dcd41313eff2bd9f269e22c5a941db4d branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-19T09:57:38+03:00 summary: Fix several reference counting bugs in pyexpat.c. (GH-9955) files: M Modules/pyexpat.c diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index c52079e518f2..ab3dac6db168 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -243,8 +243,10 @@ string_intern(xmlparseobject *self, const char* str) if (!value) { if (PyDict_SetItem(self->intern, result, result) == 0) return result; - else + else { + Py_DECREF(result); return NULL; + } } Py_INCREF(value); Py_DECREF(result); @@ -393,6 +395,7 @@ my_StartElementHandler(void *userData, flag_error(self); Py_DECREF(n); Py_DECREF(v); + Py_DECREF(container); return; } else { @@ -401,12 +404,14 @@ my_StartElementHandler(void *userData, } } args = string_intern(self, name); - if (args != NULL) - args = Py_BuildValue("(NN)", args, container); if (args == NULL) { Py_DECREF(container); return; } + args = Py_BuildValue("(NN)", args, container); + if (args == NULL) { + return; + } /* Container is now a borrowed reference; ignore it. */ self->in_callback = 1; rv = call_with_frame("StartElement", __LINE__, @@ -565,7 +570,6 @@ my_ElementDeclHandler(void *userData, } args = Py_BuildValue("NN", nameobj, modelobj); if (args == NULL) { - Py_DECREF(modelobj); flag_error(self); goto finally; } From webhook-mailer at python.org Fri Oct 19 03:16:29 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 07:16:29 -0000 Subject: [Python-checkins] Fix several reference counting bugs in pyexpat.c. (GH-9955) Message-ID: https://github.com/python/cpython/commit/d6d35d0a005bb3d1e04095074c255bf8d0b651d7 commit: d6d35d0a005bb3d1e04095074c255bf8d0b651d7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T00:16:25-07:00 summary: Fix several reference counting bugs in pyexpat.c. (GH-9955) (cherry picked from commit 68def052dcd41313eff2bd9f269e22c5a941db4d) Co-authored-by: Zackery Spytz files: M Modules/pyexpat.c diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index c52079e518f2..ab3dac6db168 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -243,8 +243,10 @@ string_intern(xmlparseobject *self, const char* str) if (!value) { if (PyDict_SetItem(self->intern, result, result) == 0) return result; - else + else { + Py_DECREF(result); return NULL; + } } Py_INCREF(value); Py_DECREF(result); @@ -393,6 +395,7 @@ my_StartElementHandler(void *userData, flag_error(self); Py_DECREF(n); Py_DECREF(v); + Py_DECREF(container); return; } else { @@ -401,12 +404,14 @@ my_StartElementHandler(void *userData, } } args = string_intern(self, name); - if (args != NULL) - args = Py_BuildValue("(NN)", args, container); if (args == NULL) { Py_DECREF(container); return; } + args = Py_BuildValue("(NN)", args, container); + if (args == NULL) { + return; + } /* Container is now a borrowed reference; ignore it. */ self->in_callback = 1; rv = call_with_frame("StartElement", __LINE__, @@ -565,7 +570,6 @@ my_ElementDeclHandler(void *userData, } args = Py_BuildValue("NN", nameobj, modelobj); if (args == NULL) { - Py_DECREF(modelobj); flag_error(self); goto finally; } From webhook-mailer at python.org Fri Oct 19 03:25:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 07:25:03 -0000 Subject: [Python-checkins] Fix several reference counting bugs in pyexpat.c. (GH-9955) Message-ID: https://github.com/python/cpython/commit/d85c2726b9f305ac5128764bda773a78e52101cd commit: d85c2726b9f305ac5128764bda773a78e52101cd branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T00:25:00-07:00 summary: Fix several reference counting bugs in pyexpat.c. (GH-9955) (cherry picked from commit 68def052dcd41313eff2bd9f269e22c5a941db4d) Co-authored-by: Zackery Spytz files: M Modules/pyexpat.c diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index aa21d93c115a..2e69f61190d0 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -245,8 +245,10 @@ string_intern(xmlparseobject *self, const char* str) if (!value) { if (PyDict_SetItem(self->intern, result, result) == 0) return result; - else + else { + Py_DECREF(result); return NULL; + } } Py_INCREF(value); Py_DECREF(result); @@ -395,6 +397,7 @@ my_StartElementHandler(void *userData, flag_error(self); Py_DECREF(n); Py_DECREF(v); + Py_DECREF(container); return; } else { @@ -403,12 +406,14 @@ my_StartElementHandler(void *userData, } } args = string_intern(self, name); - if (args != NULL) - args = Py_BuildValue("(NN)", args, container); if (args == NULL) { Py_DECREF(container); return; } + args = Py_BuildValue("(NN)", args, container); + if (args == NULL) { + return; + } /* Container is now a borrowed reference; ignore it. */ self->in_callback = 1; rv = call_with_frame("StartElement", __LINE__, @@ -567,7 +572,6 @@ my_ElementDeclHandler(void *userData, } args = Py_BuildValue("NN", nameobj, modelobj); if (args == NULL) { - Py_DECREF(modelobj); flag_error(self); goto finally; } From webhook-mailer at python.org Fri Oct 19 03:26:41 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 07:26:41 -0000 Subject: [Python-checkins] Fix several reference counting bugs in pyexpat.c. (GH-9955) Message-ID: https://github.com/python/cpython/commit/5744a3362945e0d9cd7bb24ed5ebcedba8822d4c commit: 5744a3362945e0d9cd7bb24ed5ebcedba8822d4c branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T00:26:37-07:00 summary: Fix several reference counting bugs in pyexpat.c. (GH-9955) (cherry picked from commit 68def052dcd41313eff2bd9f269e22c5a941db4d) Co-authored-by: Zackery Spytz files: M Modules/pyexpat.c diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 1f8c0d70a559..bbda6ffd0242 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -398,8 +398,10 @@ string_intern(xmlparseobject *self, const char* str) if (!value) { if (PyDict_SetItem(self->intern, result, result) == 0) return result; - else + else { + Py_DECREF(result); return NULL; + } } Py_INCREF(value); Py_DECREF(result); @@ -547,6 +549,7 @@ my_StartElementHandler(void *userData, flag_error(self); Py_DECREF(n); Py_DECREF(v); + Py_DECREF(container); return; } else { @@ -555,12 +558,14 @@ my_StartElementHandler(void *userData, } } args = string_intern(self, name); - if (args != NULL) - args = Py_BuildValue("(NN)", args, container); if (args == NULL) { Py_DECREF(container); return; } + args = Py_BuildValue("(NN)", args, container); + if (args == NULL) { + return; + } /* Container is now a borrowed reference; ignore it. */ self->in_callback = 1; rv = call_with_frame(getcode(StartElement, "StartElement", __LINE__), @@ -742,7 +747,6 @@ my_ElementDeclHandler(void *userData, } args = Py_BuildValue("NN", nameobj, modelobj); if (args == NULL) { - Py_DECREF(modelobj); flag_error(self); goto finally; } From solipsis at pitrou.net Fri Oct 19 05:08:21 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 19 Oct 2018 09:08:21 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=11 Message-ID: <20181019090821.1.CDF74E30A620C553@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 8] memory blocks, sum=8 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [1, -2, 2] memory blocks, sum=1 test_multiprocessing_spawn leaked [-1, 1, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogMYh1Kn', '--timeout', '7200'] From webhook-mailer at python.org Fri Oct 19 05:13:07 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 19 Oct 2018 09:13:07 -0000 Subject: [Python-checkins] bpo-35013: Add more type checks for children of Element. (GH-9944) Message-ID: https://github.com/python/cpython/commit/f081fd83032be48aefdb1bbcc38ab5deb03785d5 commit: f081fd83032be48aefdb1bbcc38ab5deb03785d5 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-19T12:12:57+03:00 summary: bpo-35013: Add more type checks for children of Element. (GH-9944) It is now guarantied that children of xml.etree.ElementTree.Element are Elements (at least in C implementation). Previously methods __setitem__(), __setstate__() and __deepcopy__() could be used for adding non-Element children. files: M Lib/test/test_xml_etree.py M Lib/xml/etree/ElementTree.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 61416ba7c691..8b1690508797 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -1795,6 +1795,28 @@ def test_augmentation_type_errors(self): self.assertRaises(TypeError, e.append, 'b') self.assertRaises(TypeError, e.extend, [ET.Element('bar'), 'foo']) self.assertRaises(TypeError, e.insert, 0, 'foo') + e[:] = [ET.Element('bar')] + with self.assertRaises(TypeError): + e[0] = 'foo' + with self.assertRaises(TypeError): + e[:] = [ET.Element('bar'), 'foo'] + + if hasattr(e, '__setstate__'): + state = { + 'tag': 'tag', + '_children': [None], # non-Element + 'attrib': 'attr', + 'tail': 'tail', + 'text': 'text', + } + self.assertRaises(TypeError, e.__setstate__, state) + + if hasattr(e, '__deepcopy__'): + class E(ET.Element): + def __deepcopy__(self, memo): + return None # non-Element + e[:] = [E('bar')] + self.assertRaises(TypeError, copy.deepcopy, e) def test_cyclic_gc(self): class Dummy: @@ -1981,26 +2003,6 @@ def __del__(self): elem = b.close() self.assertEqual(elem[0].tail, 'ABCDEFGHIJKL') - def test_element_iter(self): - # Issue #27863 - state = { - 'tag': 'tag', - '_children': [None], # non-Element - 'attrib': 'attr', - 'tail': 'tail', - 'text': 'text', - } - - e = ET.Element('tag') - try: - e.__setstate__(state) - except AttributeError: - e.__dict__ = state - - it = e.iter() - self.assertIs(next(it), e) - self.assertRaises(AttributeError, next, it) - def test_subscr(self): # Issue #27863 class X: diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 371b37147e32..85586d0b1c49 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -217,11 +217,11 @@ def __getitem__(self, index): return self._children[index] def __setitem__(self, index, element): - # if isinstance(index, slice): - # for elt in element: - # assert iselement(elt) - # else: - # assert iselement(element) + if isinstance(index, slice): + for elt in element: + self._assert_is_element(elt) + else: + self._assert_is_element(element) self._children[index] = element def __delitem__(self, index): diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 919591467c0d..f88315d7711a 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -480,11 +480,24 @@ element_resize(ElementObject* self, Py_ssize_t extra) return -1; } +LOCAL(void) +raise_type_error(PyObject *element) +{ + PyErr_Format(PyExc_TypeError, + "expected an Element, not \"%.200s\"", + Py_TYPE(element)->tp_name); +} + LOCAL(int) element_add_subelement(ElementObject* self, PyObject* element) { /* add a child element to a parent */ + if (!Element_Check(element)) { + raise_type_error(element); + return -1; + } + if (element_resize(self, 1) < 0) return -1; @@ -803,7 +816,11 @@ _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo) for (i = 0; i < self->extra->length; i++) { PyObject* child = deepcopy(self->extra->children[i], memo); - if (!child) { + if (!child || !Element_Check(child)) { + if (child) { + raise_type_error(child); + Py_DECREF(child); + } element->extra->length = i; goto error; } @@ -1024,8 +1041,15 @@ element_setstate_from_attributes(ElementObject *self, /* Copy children */ for (i = 0; i < nchildren; i++) { - self->extra->children[i] = PyList_GET_ITEM(children, i); - Py_INCREF(self->extra->children[i]); + PyObject *child = PyList_GET_ITEM(children, i); + if (!Element_Check(child)) { + raise_type_error(child); + self->extra->length = i; + dealloc_extra(oldextra); + return NULL; + } + Py_INCREF(child); + self->extra->children[i] = child; } assert(!self->extra->length); @@ -1167,16 +1191,6 @@ _elementtree_Element_extend(ElementObject *self, PyObject *elements) for (i = 0; i < PySequence_Fast_GET_SIZE(seq); i++) { PyObject* element = PySequence_Fast_GET_ITEM(seq, i); Py_INCREF(element); - if (!Element_Check(element)) { - PyErr_Format( - PyExc_TypeError, - "expected an Element, not \"%.200s\"", - Py_TYPE(element)->tp_name); - Py_DECREF(seq); - Py_DECREF(element); - return NULL; - } - if (element_add_subelement(self, element) < 0) { Py_DECREF(seq); Py_DECREF(element); @@ -1219,8 +1233,7 @@ _elementtree_Element_find_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_Check(item)) - continue; + assert(Element_Check(item)); Py_INCREF(item); rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc > 0) @@ -1266,8 +1279,7 @@ _elementtree_Element_findtext_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject *item = self->extra->children[i]; int rc; - if (!Element_Check(item)) - continue; + assert(Element_Check(item)); Py_INCREF(item); rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc > 0) { @@ -1323,8 +1335,7 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path, for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; int rc; - if (!Element_Check(item)) - continue; + assert(Element_Check(item)); Py_INCREF(item); rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ); if (rc != 0 && (rc < 0 || PyList_Append(out, item) < 0)) { @@ -1736,6 +1747,10 @@ element_setitem(PyObject* self_, Py_ssize_t index, PyObject* item) old = self->extra->children[index]; if (item) { + if (!Element_Check(item)) { + raise_type_error(item); + return -1; + } Py_INCREF(item); self->extra->children[index] = item; } else { @@ -1930,6 +1945,15 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) } } + for (i = 0; i < newlen; i++) { + PyObject *element = PySequence_Fast_GET_ITEM(seq, i); + if (!Element_Check(element)) { + raise_type_error(element); + Py_DECREF(seq); + return -1; + } + } + if (slicelen > 0) { /* to avoid recursive calls to this method (via decref), move old items to the recycle bin here, and get rid of them when @@ -2207,12 +2231,7 @@ elementiter_next(ElementIterObject *it) continue; } - if (!Element_Check(extra->children[child_index])) { - PyErr_Format(PyExc_AttributeError, - "'%.100s' object has no attribute 'iter'", - Py_TYPE(extra->children[child_index])->tp_name); - return NULL; - } + assert(Element_Check(extra->children[child_index])); elem = (ElementObject *)extra->children[child_index]; item->child_index++; Py_INCREF(elem); From webhook-mailer at python.org Fri Oct 19 06:53:05 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 10:53:05 -0000 Subject: [Python-checkins] bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660) Message-ID: https://github.com/python/cpython/commit/209144831b0a19715bda3bd72b14a3e6192d9cc1 commit: 209144831b0a19715bda3bd72b14a3e6192d9cc1 branch: master author: matthewbelisle-wf committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-19T03:52:59-07:00 summary: bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660) Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by limiting the number of `MiniFieldStorage` objects created by `FieldStorage`. files: A Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst M Lib/cgi.py M Lib/test/test_cgi.py M Lib/test/test_urlparse.py M Lib/urllib/parse.py diff --git a/Lib/cgi.py b/Lib/cgi.py index b655a057d4be..adf4dcba19ac 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -311,7 +311,8 @@ class FieldStorage: """ def __init__(self, fp=None, headers=None, outerboundary=b'', environ=os.environ, keep_blank_values=0, strict_parsing=0, - limit=None, encoding='utf-8', errors='replace'): + limit=None, encoding='utf-8', errors='replace', + max_num_fields=None): """Constructor. Read multipart/* until last part. Arguments, all optional: @@ -351,10 +352,14 @@ def __init__(self, fp=None, headers=None, outerboundary=b'', for the page sending the form (content-type : meta http-equiv or header) + max_num_fields: int. If set, then __init__ throws a ValueError + if there are more than n fields read by parse_qsl(). + """ method = 'GET' self.keep_blank_values = keep_blank_values self.strict_parsing = strict_parsing + self.max_num_fields = max_num_fields if 'REQUEST_METHOD' in environ: method = environ['REQUEST_METHOD'].upper() self.qs_on_post = None @@ -578,12 +583,11 @@ def read_urlencoded(self): qs = qs.decode(self.encoding, self.errors) if self.qs_on_post: qs += '&' + self.qs_on_post - self.list = [] query = urllib.parse.parse_qsl( qs, self.keep_blank_values, self.strict_parsing, - encoding=self.encoding, errors=self.errors) - for key, value in query: - self.list.append(MiniFieldStorage(key, value)) + encoding=self.encoding, errors=self.errors, + max_num_fields=self.max_num_fields) + self.list = [MiniFieldStorage(key, value) for key, value in query] self.skip_lines() FieldStorageClass = None @@ -597,9 +601,9 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if self.qs_on_post: query = urllib.parse.parse_qsl( self.qs_on_post, self.keep_blank_values, self.strict_parsing, - encoding=self.encoding, errors=self.errors) - for key, value in query: - self.list.append(MiniFieldStorage(key, value)) + encoding=self.encoding, errors=self.errors, + max_num_fields=self.max_num_fields) + self.list.extend(MiniFieldStorage(key, value) for key, value in query) klass = self.FieldStorageClass or self.__class__ first_line = self.fp.readline() # bytes @@ -633,11 +637,23 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if 'content-length' in headers: del headers['content-length'] + # Propagate max_num_fields into the sub class appropriately + sub_max_num_fields = self.max_num_fields + if sub_max_num_fields is not None: + sub_max_num_fields -= len(self.list) + part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing,self.limit-self.bytes_read, - self.encoding, self.errors) + self.encoding, self.errors, sub_max_num_fields) + + max_num_fields = self.max_num_fields + if max_num_fields is not None and part.list: + max_num_fields -= len(part.list) + self.bytes_read += part.bytes_read self.list.append(part) + if max_num_fields is not None and max_num_fields < len(self.list): + raise ValueError('Max number of fields exceeded') if part.done or self.bytes_read >= self.length > 0: break self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index b284a0d09805..8ea9d6aee6c4 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -381,6 +381,55 @@ def testQSAndUrlEncode(self): v = gen_result(data, environ) self.assertEqual(self._qs_result, v) + def test_max_num_fields(self): + # For application/x-www-form-urlencoded + data = '&'.join(['a=a']*11) + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'application/x-www-form-urlencoded', + 'REQUEST_METHOD': 'POST', + } + + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=10, + ) + + # For multipart/form-data + data = """---123 +Content-Disposition: form-data; name="a" + +a +---123 +Content-Type: application/x-www-form-urlencoded + +a=a&a=a +---123-- +""" + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', + 'QUERY_STRING': 'a=a&a=a', + 'REQUEST_METHOD': 'POST', + } + + # 2 GET entities + # 2 top level POST entities + # 2 entities within the second POST entity + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=5, + ) + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=6, + ) + def testQSAndFormData(self): data = """---123 Content-Disposition: form-data; name="key2" diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index cd3eabb5606b..6738863f8def 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -880,6 +880,13 @@ def test_parse_qsl_encoding(self): errors="ignore") self.assertEqual(result, [('key', '\u0141-')]) + def test_parse_qsl_max_num_fields(self): + with self.assertRaises(ValueError): + urllib.parse.parse_qs('&'.join(['a=a']*11), max_num_fields=10) + with self.assertRaises(ValueError): + urllib.parse.parse_qs(';'.join(['a=a']*11), max_num_fields=10) + urllib.parse.parse_qs('&'.join(['a=a']*10), max_num_fields=10) + def test_urlencode_sequences(self): # Other tests incidentally urlencode things; test non-covered cases: # Sequence and object values. diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index f21b8eb49cca..dc2171144fc8 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -628,7 +628,7 @@ def unquote(string, encoding='utf-8', errors='replace'): def parse_qs(qs, keep_blank_values=False, strict_parsing=False, - encoding='utf-8', errors='replace'): + encoding='utf-8', errors='replace', max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -649,11 +649,15 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. + max_num_fields: int. If set, then throws a ValueError if there + are more than n fields read by parse_qsl(). + Returns a dictionary. """ parsed_result = {} pairs = parse_qsl(qs, keep_blank_values, strict_parsing, - encoding=encoding, errors=errors) + encoding=encoding, errors=errors, + max_num_fields=max_num_fields) for name, value in pairs: if name in parsed_result: parsed_result[name].append(value) @@ -663,7 +667,7 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False, def parse_qsl(qs, keep_blank_values=False, strict_parsing=False, - encoding='utf-8', errors='replace'): + encoding='utf-8', errors='replace', max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -683,9 +687,21 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. + max_num_fields: int. If set, then throws a ValueError + if there are more than n fields read by parse_qsl(). + Returns a list, as G-d intended. """ qs, _coerce_result = _coerce_args(qs) + + # If max_num_fields is defined then check that the number of fields + # is less than max_num_fields. This prevents a memory exhaustion DOS + # attack via post bodies with many fields. + if max_num_fields is not None: + num_fields = 1 + qs.count('&') + qs.count(';') + if max_num_fields < num_fields: + raise ValueError('Max number of fields exceeded') + pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] r = [] for name_value in pairs: diff --git a/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst new file mode 100644 index 000000000000..90c146ce834e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst @@ -0,0 +1,2 @@ +Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS attacks harder by +limiting the number of ``MiniFieldStorage`` objects created by ``FieldStorage``. From webhook-mailer at python.org Fri Oct 19 07:11:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 11:11:19 -0000 Subject: [Python-checkins] bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660) Message-ID: https://github.com/python/cpython/commit/a66f279a1381dd5c1c27232ccf9f210d575e1dcc commit: a66f279a1381dd5c1c27232ccf9f210d575e1dcc branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T04:11:16-07:00 summary: bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660) Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by limiting the number of `MiniFieldStorage` objects created by `FieldStorage`. (cherry picked from commit 209144831b0a19715bda3bd72b14a3e6192d9cc1) Co-authored-by: matthewbelisle-wf files: A Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst M Lib/cgi.py M Lib/test/test_cgi.py M Lib/test/test_urlparse.py M Lib/urllib/parse.py diff --git a/Lib/cgi.py b/Lib/cgi.py index f82cc6c8bd56..da4a34672c5e 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -328,7 +328,8 @@ class FieldStorage: """ def __init__(self, fp=None, headers=None, outerboundary=b'', environ=os.environ, keep_blank_values=0, strict_parsing=0, - limit=None, encoding='utf-8', errors='replace'): + limit=None, encoding='utf-8', errors='replace', + max_num_fields=None): """Constructor. Read multipart/* until last part. Arguments, all optional: @@ -368,10 +369,14 @@ def __init__(self, fp=None, headers=None, outerboundary=b'', for the page sending the form (content-type : meta http-equiv or header) + max_num_fields: int. If set, then __init__ throws a ValueError + if there are more than n fields read by parse_qsl(). + """ method = 'GET' self.keep_blank_values = keep_blank_values self.strict_parsing = strict_parsing + self.max_num_fields = max_num_fields if 'REQUEST_METHOD' in environ: method = environ['REQUEST_METHOD'].upper() self.qs_on_post = None @@ -595,12 +600,11 @@ def read_urlencoded(self): qs = qs.decode(self.encoding, self.errors) if self.qs_on_post: qs += '&' + self.qs_on_post - self.list = [] query = urllib.parse.parse_qsl( qs, self.keep_blank_values, self.strict_parsing, - encoding=self.encoding, errors=self.errors) - for key, value in query: - self.list.append(MiniFieldStorage(key, value)) + encoding=self.encoding, errors=self.errors, + max_num_fields=self.max_num_fields) + self.list = [MiniFieldStorage(key, value) for key, value in query] self.skip_lines() FieldStorageClass = None @@ -614,9 +618,9 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if self.qs_on_post: query = urllib.parse.parse_qsl( self.qs_on_post, self.keep_blank_values, self.strict_parsing, - encoding=self.encoding, errors=self.errors) - for key, value in query: - self.list.append(MiniFieldStorage(key, value)) + encoding=self.encoding, errors=self.errors, + max_num_fields=self.max_num_fields) + self.list.extend(MiniFieldStorage(key, value) for key, value in query) klass = self.FieldStorageClass or self.__class__ first_line = self.fp.readline() # bytes @@ -650,11 +654,23 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if 'content-length' in headers: del headers['content-length'] + # Propagate max_num_fields into the sub class appropriately + sub_max_num_fields = self.max_num_fields + if sub_max_num_fields is not None: + sub_max_num_fields -= len(self.list) + part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing,self.limit-self.bytes_read, - self.encoding, self.errors) + self.encoding, self.errors, sub_max_num_fields) + + max_num_fields = self.max_num_fields + if max_num_fields is not None and part.list: + max_num_fields -= len(part.list) + self.bytes_read += part.bytes_read self.list.append(part) + if max_num_fields is not None and max_num_fields < len(self.list): + raise ValueError('Max number of fields exceeded') if part.done or self.bytes_read >= self.length > 0: break self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 4f2bba14a1bd..ff9c005518e0 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -391,6 +391,55 @@ def testQSAndUrlEncode(self): v = gen_result(data, environ) self.assertEqual(self._qs_result, v) + def test_max_num_fields(self): + # For application/x-www-form-urlencoded + data = '&'.join(['a=a']*11) + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'application/x-www-form-urlencoded', + 'REQUEST_METHOD': 'POST', + } + + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=10, + ) + + # For multipart/form-data + data = """---123 +Content-Disposition: form-data; name="a" + +a +---123 +Content-Type: application/x-www-form-urlencoded + +a=a&a=a +---123-- +""" + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', + 'QUERY_STRING': 'a=a&a=a', + 'REQUEST_METHOD': 'POST', + } + + # 2 GET entities + # 2 top level POST entities + # 2 entities within the second POST entity + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=5, + ) + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=6, + ) + def testQSAndFormData(self): data = """---123 Content-Disposition: form-data; name="key2" diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index ddee1c38d8b4..be50b47603aa 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -879,6 +879,13 @@ def test_parse_qsl_encoding(self): errors="ignore") self.assertEqual(result, [('key', '\u0141-')]) + def test_parse_qsl_max_num_fields(self): + with self.assertRaises(ValueError): + urllib.parse.parse_qs('&'.join(['a=a']*11), max_num_fields=10) + with self.assertRaises(ValueError): + urllib.parse.parse_qs(';'.join(['a=a']*11), max_num_fields=10) + urllib.parse.parse_qs('&'.join(['a=a']*10), max_num_fields=10) + def test_urlencode_sequences(self): # Other tests incidentally urlencode things; test non-covered cases: # Sequence and object values. diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 58460f9234fb..f691ab74f87f 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -623,7 +623,7 @@ def unquote(string, encoding='utf-8', errors='replace'): def parse_qs(qs, keep_blank_values=False, strict_parsing=False, - encoding='utf-8', errors='replace'): + encoding='utf-8', errors='replace', max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -644,11 +644,15 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. + max_num_fields: int. If set, then throws a ValueError if there + are more than n fields read by parse_qsl(). + Returns a dictionary. """ parsed_result = {} pairs = parse_qsl(qs, keep_blank_values, strict_parsing, - encoding=encoding, errors=errors) + encoding=encoding, errors=errors, + max_num_fields=max_num_fields) for name, value in pairs: if name in parsed_result: parsed_result[name].append(value) @@ -658,7 +662,7 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False, def parse_qsl(qs, keep_blank_values=False, strict_parsing=False, - encoding='utf-8', errors='replace'): + encoding='utf-8', errors='replace', max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -678,9 +682,21 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. + max_num_fields: int. If set, then throws a ValueError + if there are more than n fields read by parse_qsl(). + Returns a list, as G-d intended. """ qs, _coerce_result = _coerce_args(qs) + + # If max_num_fields is defined then check that the number of fields + # is less than max_num_fields. This prevents a memory exhaustion DOS + # attack via post bodies with many fields. + if max_num_fields is not None: + num_fields = 1 + qs.count('&') + qs.count(';') + if max_num_fields < num_fields: + raise ValueError('Max number of fields exceeded') + pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] r = [] for name_value in pairs: diff --git a/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst new file mode 100644 index 000000000000..90c146ce834e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst @@ -0,0 +1,2 @@ +Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS attacks harder by +limiting the number of ``MiniFieldStorage`` objects created by ``FieldStorage``. From webhook-mailer at python.org Fri Oct 19 07:17:00 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 11:17:00 -0000 Subject: [Python-checkins] bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660) Message-ID: https://github.com/python/cpython/commit/322a914965368ffd7e4f97ede50b351fdf48d870 commit: 322a914965368ffd7e4f97ede50b351fdf48d870 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T04:16:57-07:00 summary: bpo-34866: Adding max_num_fields to cgi.FieldStorage (GH-9660) Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by limiting the number of `MiniFieldStorage` objects created by `FieldStorage`. (cherry picked from commit 209144831b0a19715bda3bd72b14a3e6192d9cc1) Co-authored-by: matthewbelisle-wf files: A Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst M Lib/cgi.py M Lib/test/test_cgi.py M Lib/test/test_urlparse.py M Lib/urllib/parse.py diff --git a/Lib/cgi.py b/Lib/cgi.py index 233a496e8170..2407707d7e7e 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -404,7 +404,8 @@ class FieldStorage: """ def __init__(self, fp=None, headers=None, outerboundary=b'', environ=os.environ, keep_blank_values=0, strict_parsing=0, - limit=None, encoding='utf-8', errors='replace'): + limit=None, encoding='utf-8', errors='replace', + max_num_fields=None): """Constructor. Read multipart/* until last part. Arguments, all optional: @@ -444,10 +445,14 @@ def __init__(self, fp=None, headers=None, outerboundary=b'', for the page sending the form (content-type : meta http-equiv or header) + max_num_fields: int. If set, then __init__ throws a ValueError + if there are more than n fields read by parse_qsl(). + """ method = 'GET' self.keep_blank_values = keep_blank_values self.strict_parsing = strict_parsing + self.max_num_fields = max_num_fields if 'REQUEST_METHOD' in environ: method = environ['REQUEST_METHOD'].upper() self.qs_on_post = None @@ -670,12 +675,11 @@ def read_urlencoded(self): qs = qs.decode(self.encoding, self.errors) if self.qs_on_post: qs += '&' + self.qs_on_post - self.list = [] query = urllib.parse.parse_qsl( qs, self.keep_blank_values, self.strict_parsing, - encoding=self.encoding, errors=self.errors) - for key, value in query: - self.list.append(MiniFieldStorage(key, value)) + encoding=self.encoding, errors=self.errors, + max_num_fields=self.max_num_fields) + self.list = [MiniFieldStorage(key, value) for key, value in query] self.skip_lines() FieldStorageClass = None @@ -689,9 +693,9 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if self.qs_on_post: query = urllib.parse.parse_qsl( self.qs_on_post, self.keep_blank_values, self.strict_parsing, - encoding=self.encoding, errors=self.errors) - for key, value in query: - self.list.append(MiniFieldStorage(key, value)) + encoding=self.encoding, errors=self.errors, + max_num_fields=self.max_num_fields) + self.list.extend(MiniFieldStorage(key, value) for key, value in query) klass = self.FieldStorageClass or self.__class__ first_line = self.fp.readline() # bytes @@ -725,11 +729,23 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if 'content-length' in headers: del headers['content-length'] + # Propagate max_num_fields into the sub class appropriately + sub_max_num_fields = self.max_num_fields + if sub_max_num_fields is not None: + sub_max_num_fields -= len(self.list) + part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing,self.limit-self.bytes_read, - self.encoding, self.errors) + self.encoding, self.errors, sub_max_num_fields) + + max_num_fields = self.max_num_fields + if max_num_fields is not None and part.list: + max_num_fields -= len(part.list) + self.bytes_read += part.bytes_read self.list.append(part) + if max_num_fields is not None and max_num_fields < len(self.list): + raise ValueError('Max number of fields exceeded') if part.done or self.bytes_read >= self.length > 0: break self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 637322137d63..953b99c1430a 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -373,6 +373,55 @@ def testQSAndUrlEncode(self): v = gen_result(data, environ) self.assertEqual(self._qs_result, v) + def test_max_num_fields(self): + # For application/x-www-form-urlencoded + data = '&'.join(['a=a']*11) + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'application/x-www-form-urlencoded', + 'REQUEST_METHOD': 'POST', + } + + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=10, + ) + + # For multipart/form-data + data = """---123 +Content-Disposition: form-data; name="a" + +a +---123 +Content-Type: application/x-www-form-urlencoded + +a=a&a=a +---123-- +""" + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', + 'QUERY_STRING': 'a=a&a=a', + 'REQUEST_METHOD': 'POST', + } + + # 2 GET entities + # 2 top level POST entities + # 2 entities within the second POST entity + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=5, + ) + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=6, + ) + def testQSAndFormData(self): data = """---123 Content-Disposition: form-data; name="key2" diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index ddee1c38d8b4..be50b47603aa 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -879,6 +879,13 @@ def test_parse_qsl_encoding(self): errors="ignore") self.assertEqual(result, [('key', '\u0141-')]) + def test_parse_qsl_max_num_fields(self): + with self.assertRaises(ValueError): + urllib.parse.parse_qs('&'.join(['a=a']*11), max_num_fields=10) + with self.assertRaises(ValueError): + urllib.parse.parse_qs(';'.join(['a=a']*11), max_num_fields=10) + urllib.parse.parse_qs('&'.join(['a=a']*10), max_num_fields=10) + def test_urlencode_sequences(self): # Other tests incidentally urlencode things; test non-covered cases: # Sequence and object values. diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index f959212b8bbb..85e68c8b42c7 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -624,7 +624,7 @@ def unquote(string, encoding='utf-8', errors='replace'): def parse_qs(qs, keep_blank_values=False, strict_parsing=False, - encoding='utf-8', errors='replace'): + encoding='utf-8', errors='replace', max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -645,11 +645,15 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. + max_num_fields: int. If set, then throws a ValueError if there + are more than n fields read by parse_qsl(). + Returns a dictionary. """ parsed_result = {} pairs = parse_qsl(qs, keep_blank_values, strict_parsing, - encoding=encoding, errors=errors) + encoding=encoding, errors=errors, + max_num_fields=max_num_fields) for name, value in pairs: if name in parsed_result: parsed_result[name].append(value) @@ -659,7 +663,7 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False, def parse_qsl(qs, keep_blank_values=False, strict_parsing=False, - encoding='utf-8', errors='replace'): + encoding='utf-8', errors='replace', max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -679,9 +683,21 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding and errors: specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. + max_num_fields: int. If set, then throws a ValueError + if there are more than n fields read by parse_qsl(). + Returns a list, as G-d intended. """ qs, _coerce_result = _coerce_args(qs) + + # If max_num_fields is defined then check that the number of fields + # is less than max_num_fields. This prevents a memory exhaustion DOS + # attack via post bodies with many fields. + if max_num_fields is not None: + num_fields = 1 + qs.count('&') + qs.count(';') + if max_num_fields < num_fields: + raise ValueError('Max number of fields exceeded') + pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] r = [] for name_value in pairs: diff --git a/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst new file mode 100644 index 000000000000..90c146ce834e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst @@ -0,0 +1,2 @@ +Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS attacks harder by +limiting the number of ``MiniFieldStorage`` objects created by ``FieldStorage``. From webhook-mailer at python.org Fri Oct 19 10:42:13 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 19 Oct 2018 14:42:13 -0000 Subject: [Python-checkins] bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652) Message-ID: https://github.com/python/cpython/commit/6543912c90ffa579dc4c01e811f9609cf92197d3 commit: 6543912c90ffa579dc4c01e811f9609cf92197d3 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-19T17:42:06+03:00 summary: bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652) for invalid escape sequences in string and bytes literals. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-01-10-41-53.bpo-32912.JeIOdM.rst M Doc/reference/lexical_analysis.rst M Doc/whatsnew/3.8.rst M Lib/test/test_fstring.py M Lib/test/test_string_literals.py M Python/ast.c diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index 84e8c783838b..e1d88eff959f 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -559,8 +559,11 @@ escape sequences only recognized in string literals fall into the category of unrecognized escapes for bytes literals. .. versionchanged:: 3.6 - Unrecognized escape sequences produce a DeprecationWarning. In - some future version of Python they will be a SyntaxError. + Unrecognized escape sequences produce a :exc:`DeprecationWarning`. + + .. versionchanged:: 3.8 + Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In + some future version of Python they will be a :exc:`SyntaxError`. Even in a raw literal, quotes can be escaped with a backslash, but the backslash remains in the result; for example, ``r"\""`` is a valid string diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index bd3283caadb8..e522addf391f 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -107,6 +107,12 @@ Other Language Changes and :keyword:`return` statements. (Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.) +* A backslash-character pair that is not a valid escape sequence generates + a :exc:`DeprecationWarning` since Python 3.6. In Python 3.8 it generates + a :exc:`SyntaxWarning` instead. + (Contributed by Serhiy Storchaka in :issue:`32912`.) + + New Modules =========== diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index fec72e008e5b..09b5ae1fdaee 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -626,7 +626,7 @@ def test_backslashes_in_string_part(self): self.assertEqual(f'2\x203', '2 3') self.assertEqual(f'\x203', ' 3') - with self.assertWarns(DeprecationWarning): # invalid escape sequence + with self.assertWarns(SyntaxWarning): # invalid escape sequence value = eval(r"f'\{6*7}'") self.assertEqual(value, '\\42') self.assertEqual(f'\\{6*7}', '\\42') diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py index aba4fc466762..55bcde4c43fb 100644 --- a/Lib/test/test_string_literals.py +++ b/Lib/test/test_string_literals.py @@ -109,18 +109,18 @@ def test_eval_str_invalid_escape(self): for b in range(1, 128): if b in b"""\n\r"'01234567NU\\abfnrtuvx""": continue - with self.assertWarns(DeprecationWarning): + with self.assertWarns(SyntaxWarning): self.assertEqual(eval(r"'\%c'" % b), '\\' + chr(b)) with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('always', category=DeprecationWarning) + warnings.simplefilter('always', category=SyntaxWarning) eval("'''\n\\z'''") self.assertEqual(len(w), 1) self.assertEqual(w[0].filename, '') self.assertEqual(w[0].lineno, 2) with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('error', category=DeprecationWarning) + warnings.simplefilter('error', category=SyntaxWarning) with self.assertRaises(SyntaxError) as cm: eval("'''\n\\z'''") exc = cm.exception @@ -158,18 +158,18 @@ def test_eval_bytes_invalid_escape(self): for b in range(1, 128): if b in b"""\n\r"'01234567\\abfnrtvx""": continue - with self.assertWarns(DeprecationWarning): + with self.assertWarns(SyntaxWarning): self.assertEqual(eval(r"b'\%c'" % b), b'\\' + bytes([b])) with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('always', category=DeprecationWarning) + warnings.simplefilter('always', category=SyntaxWarning) eval("b'''\n\\z'''") self.assertEqual(len(w), 1) self.assertEqual(w[0].filename, '') self.assertEqual(w[0].lineno, 2) with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('error', category=DeprecationWarning) + warnings.simplefilter('error', category=SyntaxWarning) with self.assertRaises(SyntaxError) as cm: eval("b'''\n\\z'''") exc = cm.exception diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-01-10-41-53.bpo-32912.JeIOdM.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-01-10-41-53.bpo-32912.JeIOdM.rst new file mode 100644 index 000000000000..9cb35998a2b5 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-01-10-41-53.bpo-32912.JeIOdM.rst @@ -0,0 +1,2 @@ +A :exc:`SyntaxWarning` is now emitted instead of a :exc:`DeprecationWarning` +for invalid escape sequences in string and bytes literals. diff --git a/Python/ast.c b/Python/ast.c index 587f838f8d8e..184e33b4b506 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -4128,14 +4128,14 @@ warn_invalid_escape_sequence(struct compiling *c, const node *n, if (msg == NULL) { return -1; } - if (PyErr_WarnExplicitObject(PyExc_DeprecationWarning, msg, + if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, c->c_filename, LINENO(n), NULL, NULL) < 0) { - if (PyErr_ExceptionMatches(PyExc_DeprecationWarning)) { + if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { const char *s; - /* Replace the DeprecationWarning exception with a SyntaxError + /* Replace the SyntaxWarning exception with a SyntaxError to get a more accurate error report */ PyErr_Clear(); From webhook-mailer at python.org Fri Oct 19 11:00:57 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 19 Oct 2018 15:00:57 -0000 Subject: [Python-checkins] bpo-34741: Get rid of tp_getattro and tp_setattro in pyexpat.xmlparser. (GH-9422) Message-ID: https://github.com/python/cpython/commit/55f8249d65af3f1b83df81fa46f6fc6e452ed944 commit: 55f8249d65af3f1b83df81fa46f6fc6e452ed944 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-19T18:00:51+03:00 summary: bpo-34741: Get rid of tp_getattro and tp_setattro in pyexpat.xmlparser. (GH-9422) Use tp_members and tp_getset instead. files: M Modules/clinic/pyexpat.c.h M Modules/pyexpat.c diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 777b6f311458..b7687e5a3695 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -208,23 +208,6 @@ pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *const *args, Py_ #endif /* (XML_COMBINED_VERSION >= 19505) */ -PyDoc_STRVAR(pyexpat_xmlparser___dir____doc__, -"__dir__($self, /)\n" -"--\n" -"\n"); - -#define PYEXPAT_XMLPARSER___DIR___METHODDEF \ - {"__dir__", (PyCFunction)pyexpat_xmlparser___dir__, METH_NOARGS, pyexpat_xmlparser___dir____doc__}, - -static PyObject * -pyexpat_xmlparser___dir___impl(xmlparseobject *self); - -static PyObject * -pyexpat_xmlparser___dir__(xmlparseobject *self, PyObject *Py_UNUSED(ignored)) -{ - return pyexpat_xmlparser___dir___impl(self); -} - PyDoc_STRVAR(pyexpat_ParserCreate__doc__, "ParserCreate($module, /, encoding=None, namespace_separator=None,\n" " intern=None)\n" @@ -289,4 +272,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=34d02345deee104c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6bdf1faf8ba1af32 input=a9049054013a1b77]*/ diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index ab3dac6db168..10d5aedf1cdb 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1,6 +1,7 @@ #include "Python.h" #include +#include "structmember.h" #include "frameobject.h" #include "expat.h" @@ -81,8 +82,7 @@ struct HandlerInfo { const char *name; xmlhandlersetter setter; xmlhandler handler; - PyCodeObject *tb_code; - PyObject *nameobj; + PyGetSetDef getset; }; static struct HandlerInfo handler_info[64]; @@ -138,19 +138,6 @@ have_handler(xmlparseobject *self, int type) return handler != NULL; } -static PyObject * -get_handler_name(struct HandlerInfo *hinfo) -{ - PyObject *name = hinfo->nameobj; - if (name == NULL) { - name = PyUnicode_FromString(hinfo->name); - hinfo->nameobj = name; - } - Py_XINCREF(name); - return name; -} - - /* Convert a string of XML_Chars into a Unicode string. Returns None if str is a null pointer. */ @@ -651,6 +638,7 @@ VOID_HANDLER(Default, VOID_HANDLER(DefaultHandlerExpand, (void *userData, const XML_Char *s, int len), ("(N)", (conv_string_len_to_unicode(s,len)))) +#define my_DefaultHandlerExpand my_DefaultHandlerExpandHandler INT_HANDLER(NotStandalone, (void *userData), @@ -1036,57 +1024,6 @@ pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag) } #endif -/*[clinic input] -pyexpat.xmlparser.__dir__ -[clinic start generated code]*/ - -static PyObject * -pyexpat_xmlparser___dir___impl(xmlparseobject *self) -/*[clinic end generated code: output=bc22451efb9e4d17 input=76aa455f2a661384]*/ -{ -#define APPEND(list, str) \ - do { \ - PyObject *o = PyUnicode_FromString(str); \ - if (o != NULL) \ - PyList_Append(list, o); \ - Py_XDECREF(o); \ - } while (0) - - int i; - PyObject *rc = PyList_New(0); - if (!rc) - return NULL; - for (i = 0; handler_info[i].name != NULL; i++) { - PyObject *o = get_handler_name(&handler_info[i]); - if (o != NULL) - PyList_Append(rc, o); - Py_XDECREF(o); - } - APPEND(rc, "ErrorCode"); - APPEND(rc, "ErrorLineNumber"); - APPEND(rc, "ErrorColumnNumber"); - APPEND(rc, "ErrorByteIndex"); - APPEND(rc, "CurrentLineNumber"); - APPEND(rc, "CurrentColumnNumber"); - APPEND(rc, "CurrentByteIndex"); - APPEND(rc, "buffer_size"); - APPEND(rc, "buffer_text"); - APPEND(rc, "buffer_used"); - APPEND(rc, "namespace_prefixes"); - APPEND(rc, "ordered_attributes"); - APPEND(rc, "specified_attributes"); - APPEND(rc, "intern"); - -#undef APPEND - - if (PyErr_Occurred()) { - Py_DECREF(rc); - rc = NULL; - } - - return rc; -} - static struct PyMethodDef xmlparse_methods[] = { PYEXPAT_XMLPARSER_PARSE_METHODDEF PYEXPAT_XMLPARSER_PARSEFILE_METHODDEF @@ -1098,7 +1035,6 @@ static struct PyMethodDef xmlparse_methods[] = { #if XML_COMBINED_VERSION >= 19505 PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif - PYEXPAT_XMLPARSER___DIR___METHODDEF {NULL, NULL} /* sentinel */ }; @@ -1238,221 +1174,153 @@ xmlparse_dealloc(xmlparseobject *self) PyObject_GC_Del(self); } -static int -handlername2int(PyObject *name) -{ - int i; - for (i = 0; handler_info[i].name != NULL; i++) { - if (_PyUnicode_EqualToASCIIString(name, handler_info[i].name)) { - return i; - } - } - return -1; -} static PyObject * -get_pybool(int istrue) +xmlparse_handler_getter(xmlparseobject *self, struct HandlerInfo *hi) { - PyObject *result = istrue ? Py_True : Py_False; + int handlernum = hi - handler_info; + PyObject *result = self->handlers[handlernum]; + if (result == NULL) + result = Py_None; Py_INCREF(result); return result; } -static PyObject * -xmlparse_getattro(xmlparseobject *self, PyObject *nameobj) +static int +xmlparse_handler_setter(xmlparseobject *self, PyObject *v, struct HandlerInfo *hi) { - Py_UCS4 first_char; - int handlernum = -1; - - if (!PyUnicode_Check(nameobj)) - goto generic; - if (PyUnicode_READY(nameobj)) - return NULL; + int handlernum = hi - handler_info; + if (v == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); + return -1; + } + if (handlernum == CharacterData) { + /* If we're changing the character data handler, flush all + * cached data with the old handler. Not sure there's a + * "right" thing to do, though, but this probably won't + * happen. + */ + if (flush_character_buffer(self) < 0) + return -1; + } - handlernum = handlername2int(nameobj); + xmlhandler c_handler = NULL; + if (v == Py_None) { + /* If this is the character data handler, and a character + data handler is already active, we need to be more + careful. What we can safely do is replace the existing + character data handler callback function with a no-op + function that will refuse to call Python. The downside + is that this doesn't completely remove the character + data handler from the C layer if there's any callback + active, so Expat does a little more work than it + otherwise would, but that's really an odd case. A more + elaborate system of handlers and state could remove the + C handler more effectively. */ + if (handlernum == CharacterData && self->in_callback) + c_handler = noop_character_data_handler; + v = NULL; + } + else if (v != NULL) { + Py_INCREF(v); + c_handler = handler_info[handlernum].handler; + } + Py_XSETREF(self->handlers[handlernum], v); + handler_info[handlernum].setter(self->itself, c_handler); + return 0; +} - if (handlernum != -1) { - PyObject *result = self->handlers[handlernum]; - if (result == NULL) - result = Py_None; - Py_INCREF(result); - return result; +#define INT_GETTER(name) \ + static PyObject * \ + xmlparse_##name##_getter(xmlparseobject *self, void *closure) \ + { \ + return PyLong_FromLong((long) XML_Get##name(self->itself)); \ } +INT_GETTER(ErrorCode) +INT_GETTER(ErrorLineNumber) +INT_GETTER(ErrorColumnNumber) +INT_GETTER(ErrorByteIndex) +INT_GETTER(CurrentLineNumber) +INT_GETTER(CurrentColumnNumber) +INT_GETTER(CurrentByteIndex) - first_char = PyUnicode_READ_CHAR(nameobj, 0); - if (first_char == 'E') { - if (_PyUnicode_EqualToASCIIString(nameobj, "ErrorCode")) - return PyLong_FromLong((long) - XML_GetErrorCode(self->itself)); - if (_PyUnicode_EqualToASCIIString(nameobj, "ErrorLineNumber")) - return PyLong_FromLong((long) - XML_GetErrorLineNumber(self->itself)); - if (_PyUnicode_EqualToASCIIString(nameobj, "ErrorColumnNumber")) - return PyLong_FromLong((long) - XML_GetErrorColumnNumber(self->itself)); - if (_PyUnicode_EqualToASCIIString(nameobj, "ErrorByteIndex")) - return PyLong_FromLong((long) - XML_GetErrorByteIndex(self->itself)); - } - if (first_char == 'C') { - if (_PyUnicode_EqualToASCIIString(nameobj, "CurrentLineNumber")) - return PyLong_FromLong((long) - XML_GetCurrentLineNumber(self->itself)); - if (_PyUnicode_EqualToASCIIString(nameobj, "CurrentColumnNumber")) - return PyLong_FromLong((long) - XML_GetCurrentColumnNumber(self->itself)); - if (_PyUnicode_EqualToASCIIString(nameobj, "CurrentByteIndex")) - return PyLong_FromLong((long) - XML_GetCurrentByteIndex(self->itself)); - } - if (first_char == 'b') { - if (_PyUnicode_EqualToASCIIString(nameobj, "buffer_size")) - return PyLong_FromLong((long) self->buffer_size); - if (_PyUnicode_EqualToASCIIString(nameobj, "buffer_text")) - return get_pybool(self->buffer != NULL); - if (_PyUnicode_EqualToASCIIString(nameobj, "buffer_used")) - return PyLong_FromLong((long) self->buffer_used); - } - if (_PyUnicode_EqualToASCIIString(nameobj, "namespace_prefixes")) - return get_pybool(self->ns_prefixes); - if (_PyUnicode_EqualToASCIIString(nameobj, "ordered_attributes")) - return get_pybool(self->ordered_attributes); - if (_PyUnicode_EqualToASCIIString(nameobj, "specified_attributes")) - return get_pybool((long) self->specified_attributes); - if (_PyUnicode_EqualToASCIIString(nameobj, "intern")) { - if (self->intern == NULL) { - Py_RETURN_NONE; - } - else { - Py_INCREF(self->intern); - return self->intern; - } - } - generic: - return PyObject_GenericGetAttr((PyObject*)self, nameobj); -} +#undef INT_GETTER -static int -sethandler(xmlparseobject *self, PyObject *name, PyObject* v) +static PyObject * +xmlparse_buffer_text_getter(xmlparseobject *self, void *closure) { - int handlernum = handlername2int(name); - if (handlernum >= 0) { - xmlhandler c_handler = NULL; - - if (v == Py_None) { - /* If this is the character data handler, and a character - data handler is already active, we need to be more - careful. What we can safely do is replace the existing - character data handler callback function with a no-op - function that will refuse to call Python. The downside - is that this doesn't completely remove the character - data handler from the C layer if there's any callback - active, so Expat does a little more work than it - otherwise would, but that's really an odd case. A more - elaborate system of handlers and state could remove the - C handler more effectively. */ - if (handlernum == CharacterData && self->in_callback) - c_handler = noop_character_data_handler; - v = NULL; - } - else if (v != NULL) { - Py_INCREF(v); - c_handler = handler_info[handlernum].handler; - } - Py_XSETREF(self->handlers[handlernum], v); - handler_info[handlernum].setter(self->itself, c_handler); - return 1; - } - return 0; + return PyBool_FromLong(self->buffer != NULL); } static int -xmlparse_setattro(xmlparseobject *self, PyObject *name, PyObject *v) +xmlparse_buffer_text_setter(xmlparseobject *self, PyObject *v, void *closure) { - /* Set attribute 'name' to value 'v'. v==NULL means delete */ - if (!PyUnicode_Check(name)) { - PyErr_Format(PyExc_TypeError, - "attribute name must be string, not '%.200s'", - name->ob_type->tp_name); - return -1; - } if (v == NULL) { PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); return -1; } - if (_PyUnicode_EqualToASCIIString(name, "buffer_text")) { - int b = PyObject_IsTrue(v); - if (b < 0) - return -1; - if (b) { + int b = PyObject_IsTrue(v); + if (b < 0) + return -1; + if (b) { + if (self->buffer == NULL) { + self->buffer = PyMem_Malloc(self->buffer_size); if (self->buffer == NULL) { - self->buffer = PyMem_Malloc(self->buffer_size); - if (self->buffer == NULL) { - PyErr_NoMemory(); - return -1; - } - self->buffer_used = 0; - } - } - else if (self->buffer != NULL) { - if (flush_character_buffer(self) < 0) + PyErr_NoMemory(); return -1; - PyMem_Free(self->buffer); - self->buffer = NULL; + } + self->buffer_used = 0; } - return 0; - } - if (_PyUnicode_EqualToASCIIString(name, "namespace_prefixes")) { - int b = PyObject_IsTrue(v); - if (b < 0) - return -1; - self->ns_prefixes = b; - XML_SetReturnNSTriplet(self->itself, self->ns_prefixes); - return 0; } - if (_PyUnicode_EqualToASCIIString(name, "ordered_attributes")) { - int b = PyObject_IsTrue(v); - if (b < 0) - return -1; - self->ordered_attributes = b; - return 0; - } - if (_PyUnicode_EqualToASCIIString(name, "specified_attributes")) { - int b = PyObject_IsTrue(v); - if (b < 0) + else if (self->buffer != NULL) { + if (flush_character_buffer(self) < 0) return -1; - self->specified_attributes = b; - return 0; + PyMem_Free(self->buffer); + self->buffer = NULL; } + return 0; +} - if (_PyUnicode_EqualToASCIIString(name, "buffer_size")) { - long new_buffer_size; - if (!PyLong_Check(v)) { +static PyObject * +xmlparse_buffer_size_getter(xmlparseobject *self, void *closure) +{ + return PyLong_FromLong((long) self->buffer_size); +} + +static int +xmlparse_buffer_size_setter(xmlparseobject *self, PyObject *v, void *closure) +{ + if (v == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); + return -1; + } + long new_buffer_size; + if (!PyLong_Check(v)) { PyErr_SetString(PyExc_TypeError, "buffer_size must be an integer"); return -1; - } + } - new_buffer_size = PyLong_AsLong(v); - if (new_buffer_size <= 0) { + new_buffer_size = PyLong_AsLong(v); + if (new_buffer_size <= 0) { if (!PyErr_Occurred()) - PyErr_SetString(PyExc_ValueError, "buffer_size must be greater than zero"); + PyErr_SetString(PyExc_ValueError, "buffer_size must be greater than zero"); return -1; - } + } - /* trivial case -- no change */ - if (new_buffer_size == self->buffer_size) { + /* trivial case -- no change */ + if (new_buffer_size == self->buffer_size) { return 0; - } + } - /* check maximum */ - if (new_buffer_size > INT_MAX) { + /* check maximum */ + if (new_buffer_size > INT_MAX) { char errmsg[100]; sprintf(errmsg, "buffer_size must not be greater than %i", INT_MAX); PyErr_SetString(PyExc_ValueError, errmsg); return -1; - } + } - if (self->buffer != NULL) { + if (self->buffer != NULL) { /* there is already a buffer */ if (self->buffer_used != 0) { if (flush_character_buffer(self) < 0) { @@ -1461,32 +1329,114 @@ xmlparse_setattro(xmlparseobject *self, PyObject *name, PyObject *v) } /* free existing buffer */ PyMem_Free(self->buffer); - } - self->buffer = PyMem_Malloc(new_buffer_size); - if (self->buffer == NULL) { + } + self->buffer = PyMem_Malloc(new_buffer_size); + if (self->buffer == NULL) { PyErr_NoMemory(); return -1; - } - self->buffer_size = new_buffer_size; - return 0; } + self->buffer_size = new_buffer_size; + return 0; +} - if (_PyUnicode_EqualToASCIIString(name, "CharacterDataHandler")) { - /* If we're changing the character data handler, flush all - * cached data with the old handler. Not sure there's a - * "right" thing to do, though, but this probably won't - * happen. - */ - if (flush_character_buffer(self) < 0) - return -1; +static PyObject * +xmlparse_buffer_used_getter(xmlparseobject *self, void *closure) +{ + return PyLong_FromLong((long) self->buffer_used); +} + +static PyObject * +xmlparse_namespace_prefixes_getter(xmlparseobject *self, void *closure) +{ + return PyBool_FromLong(self->ns_prefixes); +} + +static int +xmlparse_namespace_prefixes_setter(xmlparseobject *self, PyObject *v, void *closure) +{ + if (v == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); + return -1; } - if (sethandler(self, name, v)) { - return 0; + int b = PyObject_IsTrue(v); + if (b < 0) + return -1; + self->ns_prefixes = b; + XML_SetReturnNSTriplet(self->itself, self->ns_prefixes); + return 0; +} + +static PyObject * +xmlparse_ordered_attributes_getter(xmlparseobject *self, void *closure) +{ + return PyBool_FromLong(self->ordered_attributes); +} + +static int +xmlparse_ordered_attributes_setter(xmlparseobject *self, PyObject *v, void *closure) +{ + if (v == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); + return -1; } - PyErr_SetObject(PyExc_AttributeError, name); - return -1; + int b = PyObject_IsTrue(v); + if (b < 0) + return -1; + self->ordered_attributes = b; + return 0; +} + +static PyObject * +xmlparse_specified_attributes_getter(xmlparseobject *self, void *closure) +{ + return PyBool_FromLong((long) self->specified_attributes); +} + +static int +xmlparse_specified_attributes_setter(xmlparseobject *self, PyObject *v, void *closure) +{ + if (v == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute"); + return -1; + } + int b = PyObject_IsTrue(v); + if (b < 0) + return -1; + self->specified_attributes = b; + return 0; } +static PyMemberDef xmlparse_members[] = { + {"intern", T_OBJECT, offsetof(xmlparseobject, intern), READONLY, NULL}, + {NULL} +}; + +#define XMLPARSE_GETTER_DEF(name) \ + {#name, (getter)xmlparse_##name##_getter, NULL, NULL}, +#define XMLPARSE_GETTER_SETTER_DEF(name) \ + {#name, (getter)xmlparse_##name##_getter, \ + (setter)xmlparse_##name##_setter, NULL}, + +static PyGetSetDef xmlparse_getsetlist[] = { + XMLPARSE_GETTER_DEF(ErrorCode) + XMLPARSE_GETTER_DEF(ErrorLineNumber) + XMLPARSE_GETTER_DEF(ErrorColumnNumber) + XMLPARSE_GETTER_DEF(ErrorByteIndex) + XMLPARSE_GETTER_DEF(CurrentLineNumber) + XMLPARSE_GETTER_DEF(CurrentColumnNumber) + XMLPARSE_GETTER_DEF(CurrentByteIndex) + XMLPARSE_GETTER_SETTER_DEF(buffer_size) + XMLPARSE_GETTER_SETTER_DEF(buffer_text) + XMLPARSE_GETTER_DEF(buffer_used) + XMLPARSE_GETTER_SETTER_DEF(namespace_prefixes) + XMLPARSE_GETTER_SETTER_DEF(ordered_attributes) + XMLPARSE_GETTER_SETTER_DEF(specified_attributes) + {NULL}, +}; + +#undef XMLPARSE_GETTER_DEF +#undef XMLPARSE_GETTER_SETTER_DEF + static int xmlparse_traverse(xmlparseobject *op, visitproc visit, void *arg) { @@ -1524,8 +1474,8 @@ static PyTypeObject Xmlparsetype = { (hashfunc)0, /*tp_hash*/ (ternaryfunc)0, /*tp_call*/ (reprfunc)0, /*tp_str*/ - (getattrofunc)xmlparse_getattro, /* tp_getattro */ - (setattrofunc)xmlparse_setattro, /* tp_setattro */ + (getattrofunc)0, /* tp_getattro */ + (setattrofunc)0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ Xmlparsetype__doc__, /* tp_doc - Documentation string */ @@ -1536,6 +1486,8 @@ static PyTypeObject Xmlparsetype = { 0, /* tp_iter */ 0, /* tp_iternext */ xmlparse_methods, /* tp_methods */ + xmlparse_members, /* tp_members */ + xmlparse_getsetlist, /* tp_getset */ }; /* End of code for xmlparser objects */ @@ -1639,6 +1591,33 @@ static struct PyModuleDef pyexpatmodule = { NULL }; +static int init_handler_descrs(void) +{ + int i; + assert(!PyType_HasFeature(&Xmlparsetype, Py_TPFLAGS_VALID_VERSION_TAG)); + for (i = 0; handler_info[i].name != NULL; i++) { + struct HandlerInfo *hi = &handler_info[i]; + hi->getset.name = hi->name; + hi->getset.get = (getter)xmlparse_handler_getter; + hi->getset.set = (setter)xmlparse_handler_setter; + hi->getset.closure = &handler_info[i]; + + PyObject *descr; + if (PyDict_GetItemString(Xmlparsetype.tp_dict, hi->name)) + continue; + descr = PyDescr_NewGetSet(&Xmlparsetype, &hi->getset); + + if (descr == NULL) + return -1; + if (PyDict_SetItem(Xmlparsetype.tp_dict, PyDescr_NAME(descr), descr) < 0) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + } + return 0; +} + PyMODINIT_FUNC MODULE_INITFUNC(void) { @@ -1660,7 +1639,7 @@ MODULE_INITFUNC(void) if (modelmod_name == NULL) return NULL; - if (PyType_Ready(&Xmlparsetype) < 0) + if (PyType_Ready(&Xmlparsetype) < 0 || init_handler_descrs() < 0) return NULL; /* Create the module and add the functions */ @@ -1910,74 +1889,36 @@ clear_handlers(xmlparseobject *self, int initial) } static struct HandlerInfo handler_info[] = { - {"StartElementHandler", - (xmlhandlersetter)XML_SetStartElementHandler, - (xmlhandler)my_StartElementHandler}, - {"EndElementHandler", - (xmlhandlersetter)XML_SetEndElementHandler, - (xmlhandler)my_EndElementHandler}, - {"ProcessingInstructionHandler", - (xmlhandlersetter)XML_SetProcessingInstructionHandler, - (xmlhandler)my_ProcessingInstructionHandler}, - {"CharacterDataHandler", - (xmlhandlersetter)XML_SetCharacterDataHandler, - (xmlhandler)my_CharacterDataHandler}, - {"UnparsedEntityDeclHandler", - (xmlhandlersetter)XML_SetUnparsedEntityDeclHandler, - (xmlhandler)my_UnparsedEntityDeclHandler}, - {"NotationDeclHandler", - (xmlhandlersetter)XML_SetNotationDeclHandler, - (xmlhandler)my_NotationDeclHandler}, - {"StartNamespaceDeclHandler", - (xmlhandlersetter)XML_SetStartNamespaceDeclHandler, - (xmlhandler)my_StartNamespaceDeclHandler}, - {"EndNamespaceDeclHandler", - (xmlhandlersetter)XML_SetEndNamespaceDeclHandler, - (xmlhandler)my_EndNamespaceDeclHandler}, - {"CommentHandler", - (xmlhandlersetter)XML_SetCommentHandler, - (xmlhandler)my_CommentHandler}, - {"StartCdataSectionHandler", - (xmlhandlersetter)XML_SetStartCdataSectionHandler, - (xmlhandler)my_StartCdataSectionHandler}, - {"EndCdataSectionHandler", - (xmlhandlersetter)XML_SetEndCdataSectionHandler, - (xmlhandler)my_EndCdataSectionHandler}, - {"DefaultHandler", - (xmlhandlersetter)XML_SetDefaultHandler, - (xmlhandler)my_DefaultHandler}, - {"DefaultHandlerExpand", - (xmlhandlersetter)XML_SetDefaultHandlerExpand, - (xmlhandler)my_DefaultHandlerExpandHandler}, - {"NotStandaloneHandler", - (xmlhandlersetter)XML_SetNotStandaloneHandler, - (xmlhandler)my_NotStandaloneHandler}, - {"ExternalEntityRefHandler", - (xmlhandlersetter)XML_SetExternalEntityRefHandler, - (xmlhandler)my_ExternalEntityRefHandler}, - {"StartDoctypeDeclHandler", - (xmlhandlersetter)XML_SetStartDoctypeDeclHandler, - (xmlhandler)my_StartDoctypeDeclHandler}, - {"EndDoctypeDeclHandler", - (xmlhandlersetter)XML_SetEndDoctypeDeclHandler, - (xmlhandler)my_EndDoctypeDeclHandler}, - {"EntityDeclHandler", - (xmlhandlersetter)XML_SetEntityDeclHandler, - (xmlhandler)my_EntityDeclHandler}, - {"XmlDeclHandler", - (xmlhandlersetter)XML_SetXmlDeclHandler, - (xmlhandler)my_XmlDeclHandler}, - {"ElementDeclHandler", - (xmlhandlersetter)XML_SetElementDeclHandler, - (xmlhandler)my_ElementDeclHandler}, - {"AttlistDeclHandler", - (xmlhandlersetter)XML_SetAttlistDeclHandler, - (xmlhandler)my_AttlistDeclHandler}, + +#define HANDLER_INFO(name) \ + {#name, (xmlhandlersetter)XML_Set##name, (xmlhandler)my_##name}, + + HANDLER_INFO(StartElementHandler) + HANDLER_INFO(EndElementHandler) + HANDLER_INFO(ProcessingInstructionHandler) + HANDLER_INFO(CharacterDataHandler) + HANDLER_INFO(UnparsedEntityDeclHandler) + HANDLER_INFO(NotationDeclHandler) + HANDLER_INFO(StartNamespaceDeclHandler) + HANDLER_INFO(EndNamespaceDeclHandler) + HANDLER_INFO(CommentHandler) + HANDLER_INFO(StartCdataSectionHandler) + HANDLER_INFO(EndCdataSectionHandler) + HANDLER_INFO(DefaultHandler) + HANDLER_INFO(DefaultHandlerExpand) + HANDLER_INFO(NotStandaloneHandler) + HANDLER_INFO(ExternalEntityRefHandler) + HANDLER_INFO(StartDoctypeDeclHandler) + HANDLER_INFO(EndDoctypeDeclHandler) + HANDLER_INFO(EntityDeclHandler) + HANDLER_INFO(XmlDeclHandler) + HANDLER_INFO(ElementDeclHandler) + HANDLER_INFO(AttlistDeclHandler) #if XML_COMBINED_VERSION >= 19504 - {"SkippedEntityHandler", - (xmlhandlersetter)XML_SetSkippedEntityHandler, - (xmlhandler)my_SkippedEntityHandler}, + HANDLER_INFO(SkippedEntityHandler) #endif +#undef HANDLER_INFO + {NULL, NULL, NULL} /* sentinel */ }; From webhook-mailer at python.org Fri Oct 19 11:20:06 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 19 Oct 2018 15:20:06 -0000 Subject: [Python-checkins] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) Message-ID: https://github.com/python/cpython/commit/bd9c2ce7acaef45f23c2659b854fc9925096d040 commit: bd9c2ce7acaef45f23c2659b854fc9925096d040 branch: 3.7 author: Juliette Monsel committer: Serhiy Storchaka date: 2018-10-19T18:20:00+03:00 summary: bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (cherry picked from commit 1deea5e53991b46351f6bb395b22365c9455ed88) files: A Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst M Lib/tkinter/__init__.py M Lib/tkinter/test/test_tkinter/test_widgets.py diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index ff85f837d1d5..a6e8fb2e611b 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -3750,7 +3750,7 @@ def selection_adjust(self, index): select to commands. If the selection isn't currently in the spinbox, then a new selection is created to include the characters between index and the most recent selection - anchor point, inclusive. Returns an empty string. + anchor point, inclusive. """ return self.selection("adjust", index) @@ -3758,7 +3758,7 @@ def selection_clear(self): """Clear the selection If the selection isn't in this widget then the - command has no effect. Returns an empty string. + command has no effect. """ return self.selection("clear") @@ -3766,9 +3766,9 @@ def selection_element(self, element=None): """Sets or gets the currently selected element. If a spinbutton element is specified, it will be - displayed depressed + displayed depressed. """ - return self.selection("element", element) + return self.tk.call(self._w, 'selection', 'element', element) ########################################################################### diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index e4c9d337ba7d..3fb641108cf8 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -474,6 +474,14 @@ def test_bbox(self): self.assertRaises(TypeError, widget.bbox) self.assertRaises(TypeError, widget.bbox, 0, 1) + def test_selection_element(self): + widget = self.create() + self.assertEqual(widget.selection_element(), "none") + widget.selection_element("buttonup") + self.assertEqual(widget.selection_element(), "buttonup") + widget.selection_element("buttondown") + self.assertEqual(widget.selection_element(), "buttondown") + @add_standard_options(StandardOptionsTests) class TextTest(AbstractWidgetTest, unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst new file mode 100644 index 000000000000..7c1f7bb59760 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst @@ -0,0 +1,2 @@ +Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. Patch by +Juliette Monsel. From webhook-mailer at python.org Fri Oct 19 11:44:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 15:44:38 -0000 Subject: [Python-checkins] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) Message-ID: https://github.com/python/cpython/commit/c04347fad936f40cc0bd844e44a71ba88b027b2d commit: c04347fad936f40cc0bd844e44a71ba88b027b2d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T08:44:35-07:00 summary: bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (cherry picked from commit 1deea5e53991b46351f6bb395b22365c9455ed88) (cherry picked from commit bd9c2ce7acaef45f23c2659b854fc9925096d040) Co-authored-by: Juliette Monsel files: A Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst M Lib/tkinter/__init__.py M Lib/tkinter/test/test_tkinter/test_widgets.py diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index ff85f837d1d5..a6e8fb2e611b 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -3750,7 +3750,7 @@ def selection_adjust(self, index): select to commands. If the selection isn't currently in the spinbox, then a new selection is created to include the characters between index and the most recent selection - anchor point, inclusive. Returns an empty string. + anchor point, inclusive. """ return self.selection("adjust", index) @@ -3758,7 +3758,7 @@ def selection_clear(self): """Clear the selection If the selection isn't in this widget then the - command has no effect. Returns an empty string. + command has no effect. """ return self.selection("clear") @@ -3766,9 +3766,9 @@ def selection_element(self, element=None): """Sets or gets the currently selected element. If a spinbutton element is specified, it will be - displayed depressed + displayed depressed. """ - return self.selection("element", element) + return self.tk.call(self._w, 'selection', 'element', element) ########################################################################### diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index e4c9d337ba7d..3fb641108cf8 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -474,6 +474,14 @@ def test_bbox(self): self.assertRaises(TypeError, widget.bbox) self.assertRaises(TypeError, widget.bbox, 0, 1) + def test_selection_element(self): + widget = self.create() + self.assertEqual(widget.selection_element(), "none") + widget.selection_element("buttonup") + self.assertEqual(widget.selection_element(), "buttonup") + widget.selection_element("buttondown") + self.assertEqual(widget.selection_element(), "buttondown") + @add_standard_options(StandardOptionsTests) class TextTest(AbstractWidgetTest, unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst new file mode 100644 index 000000000000..7c1f7bb59760 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst @@ -0,0 +1,2 @@ +Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. Patch by +Juliette Monsel. From webhook-mailer at python.org Fri Oct 19 12:54:57 2018 From: webhook-mailer at python.org (Eric V. Smith) Date: Fri, 19 Oct 2018 16:54:57 -0000 Subject: [Python-checkins] bpo-33947: dataclasses no longer can raise RecursionError in repr (GF9916) Message-ID: https://github.com/python/cpython/commit/dd13c88b5371e13fc16b84e2f9b8715d917de269 commit: dd13c88b5371e13fc16b84e2f9b8715d917de269 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Eric V. Smith date: 2018-10-19T12:54:50-04:00 summary: bpo-33947: dataclasses no longer can raise RecursionError in repr (GF9916) The reprlib code was copied here instead of importing reprlib. I'm not sure if we really need to avoid the import, but since I expect dataclasses to be more common that reprlib, it seems wise. Plus, the code is small. files: A Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst M Lib/dataclasses.py M Lib/test/test_dataclasses.py diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 28e9f75127b1..71d9896a1052 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -5,6 +5,9 @@ import inspect import keyword import builtins +import functools +import _thread + __all__ = ['dataclass', 'field', @@ -337,6 +340,27 @@ def _tuple_str(obj_name, fields): return f'({",".join([f"{obj_name}.{f.name}" for f in fields])},)' +# This function's logic is copied from "recursive_repr" function in +# reprlib module to avoid dependency. +def _recursive_repr(user_function): + # Decorator to make a repr function return "..." for a recursive + # call. + repr_running = set() + + @functools.wraps(user_function) + def wrapper(self): + key = id(self), _thread.get_ident() + if key in repr_running: + return '...' + repr_running.add(key) + try: + result = user_function(self) + finally: + repr_running.discard(key) + return result + return wrapper + + def _create_fn(name, args, body, *, globals=None, locals=None, return_type=MISSING): # Note that we mutate locals when exec() is called. Caller @@ -497,12 +521,13 @@ def _init_fn(fields, frozen, has_post_init, self_name): def _repr_fn(fields): - return _create_fn('__repr__', - ('self',), - ['return self.__class__.__qualname__ + f"(' + - ', '.join([f"{f.name}={{self.{f.name}!r}}" - for f in fields]) + - ')"']) + fn = _create_fn('__repr__', + ('self',), + ['return self.__class__.__qualname__ + f"(' + + ', '.join([f"{f.name}={{self.{f.name}!r}}" + for f in fields]) + + ')"']) + return _recursive_repr(fn) def _frozen_get_del_attr(cls, fields): diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index 6efe785bc328..ff6060c6d283 100755 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -3169,6 +3169,92 @@ def __post_init__(self, y): replace(c, x=3) c = replace(c, x=3, y=5) self.assertEqual(c.x, 15) + + def test_recursive_repr(self): + @dataclass + class C: + f: "C" + + c = C(None) + c.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr..C(f=...)") + + def test_recursive_repr_two_attrs(self): + @dataclass + class C: + f: "C" + g: "C" + + c = C(None, None) + c.f = c + c.g = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_two_attrs" + "..C(f=..., g=...)") + + def test_recursive_repr_indirection(self): + @dataclass + class C: + f: "D" + + @dataclass + class D: + f: "C" + + c = C(None) + d = D(None) + c.f = d + d.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_indirection" + "..C(f=TestReplace.test_recursive_repr_indirection" + "..D(f=...))") + + def test_recursive_repr_indirection_two(self): + @dataclass + class C: + f: "D" + + @dataclass + class D: + f: "E" + + @dataclass + class E: + f: "C" + + c = C(None) + d = D(None) + e = E(None) + c.f = d + d.f = e + e.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_indirection_two" + "..C(f=TestReplace.test_recursive_repr_indirection_two" + "..D(f=TestReplace.test_recursive_repr_indirection_two" + "..E(f=...)))") + + def test_recursive_repr_two_attrs(self): + @dataclass + class C: + f: "C" + g: "C" + + c = C(None, None) + c.f = c + c.g = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_two_attrs" + "..C(f=..., g=...)") + + def test_recursive_repr_misc_attrs(self): + @dataclass + class C: + f: "C" + g: int + + c = C(None, 1) + c.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_misc_attrs" + "..C(f=..., g=1)") + ## def test_initvar(self): ## @dataclass ## class C: diff --git a/Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst b/Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst new file mode 100644 index 000000000000..bf08bac13cc7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst @@ -0,0 +1 @@ +dataclasses now handle recursive reprs without raising RecursionError. From webhook-mailer at python.org Fri Oct 19 13:28:34 2018 From: webhook-mailer at python.org (Eric V. Smith) Date: Fri, 19 Oct 2018 17:28:34 -0000 Subject: [Python-checkins] bpo-33947: dataclasses no longer can raise RecursionError in repr (GF9916) (#9970) Message-ID: https://github.com/python/cpython/commit/b9182aa7dad8991fc8768ae494b45b5f7c316aca commit: b9182aa7dad8991fc8768ae494b45b5f7c316aca branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Eric V. Smith date: 2018-10-19T13:28:30-04:00 summary: bpo-33947: dataclasses no longer can raise RecursionError in repr (GF9916) (#9970) The reprlib code was copied here instead of importing reprlib. I'm not sure if we really need to avoid the import, but since I expect dataclasses to be more common that reprlib, it seems wise. Plus, the code is small. (cherry picked from commit dd13c88b5371e13fc16b84e2f9b8715d917de269) Co-authored-by: Srinivas Thatiparthy (?????????? ?????????) files: A Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst M Lib/dataclasses.py M Lib/test/test_dataclasses.py diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 28e9f75127b1..71d9896a1052 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -5,6 +5,9 @@ import inspect import keyword import builtins +import functools +import _thread + __all__ = ['dataclass', 'field', @@ -337,6 +340,27 @@ def _tuple_str(obj_name, fields): return f'({",".join([f"{obj_name}.{f.name}" for f in fields])},)' +# This function's logic is copied from "recursive_repr" function in +# reprlib module to avoid dependency. +def _recursive_repr(user_function): + # Decorator to make a repr function return "..." for a recursive + # call. + repr_running = set() + + @functools.wraps(user_function) + def wrapper(self): + key = id(self), _thread.get_ident() + if key in repr_running: + return '...' + repr_running.add(key) + try: + result = user_function(self) + finally: + repr_running.discard(key) + return result + return wrapper + + def _create_fn(name, args, body, *, globals=None, locals=None, return_type=MISSING): # Note that we mutate locals when exec() is called. Caller @@ -497,12 +521,13 @@ def _init_fn(fields, frozen, has_post_init, self_name): def _repr_fn(fields): - return _create_fn('__repr__', - ('self',), - ['return self.__class__.__qualname__ + f"(' + - ', '.join([f"{f.name}={{self.{f.name}!r}}" - for f in fields]) + - ')"']) + fn = _create_fn('__repr__', + ('self',), + ['return self.__class__.__qualname__ + f"(' + + ', '.join([f"{f.name}={{self.{f.name}!r}}" + for f in fields]) + + ')"']) + return _recursive_repr(fn) def _frozen_get_del_attr(cls, fields): diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index 6efe785bc328..ff6060c6d283 100755 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -3169,6 +3169,92 @@ def __post_init__(self, y): replace(c, x=3) c = replace(c, x=3, y=5) self.assertEqual(c.x, 15) + + def test_recursive_repr(self): + @dataclass + class C: + f: "C" + + c = C(None) + c.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr..C(f=...)") + + def test_recursive_repr_two_attrs(self): + @dataclass + class C: + f: "C" + g: "C" + + c = C(None, None) + c.f = c + c.g = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_two_attrs" + "..C(f=..., g=...)") + + def test_recursive_repr_indirection(self): + @dataclass + class C: + f: "D" + + @dataclass + class D: + f: "C" + + c = C(None) + d = D(None) + c.f = d + d.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_indirection" + "..C(f=TestReplace.test_recursive_repr_indirection" + "..D(f=...))") + + def test_recursive_repr_indirection_two(self): + @dataclass + class C: + f: "D" + + @dataclass + class D: + f: "E" + + @dataclass + class E: + f: "C" + + c = C(None) + d = D(None) + e = E(None) + c.f = d + d.f = e + e.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_indirection_two" + "..C(f=TestReplace.test_recursive_repr_indirection_two" + "..D(f=TestReplace.test_recursive_repr_indirection_two" + "..E(f=...)))") + + def test_recursive_repr_two_attrs(self): + @dataclass + class C: + f: "C" + g: "C" + + c = C(None, None) + c.f = c + c.g = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_two_attrs" + "..C(f=..., g=...)") + + def test_recursive_repr_misc_attrs(self): + @dataclass + class C: + f: "C" + g: int + + c = C(None, 1) + c.f = c + self.assertEqual(repr(c), "TestReplace.test_recursive_repr_misc_attrs" + "..C(f=..., g=1)") + ## def test_initvar(self): ## @dataclass ## class C: diff --git a/Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst b/Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst new file mode 100644 index 000000000000..bf08bac13cc7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-17-02-15-23.bpo-33947.SRuq3T.rst @@ -0,0 +1 @@ +dataclasses now handle recursive reprs without raising RecursionError. From webhook-mailer at python.org Fri Oct 19 13:42:56 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 19 Oct 2018 17:42:56 -0000 Subject: [Python-checkins] bpo-20216: Correct docstrings of digest() methods in hashlib. (GH-9873) Message-ID: https://github.com/python/cpython/commit/f192aeb95a139ede74d69e39c046c498ff288a37 commit: f192aeb95a139ede74d69e39c046c498ff288a37 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Serhiy Storchaka date: 2018-10-19T20:42:53+03:00 summary: bpo-20216: Correct docstrings of digest() methods in hashlib. (GH-9873) files: M Modules/_hashopenssl.c M Modules/clinic/md5module.c.h M Modules/clinic/sha1module.c.h M Modules/clinic/sha256module.c.h M Modules/clinic/sha512module.c.h M Modules/md5module.c M Modules/sha1module.c M Modules/sha256module.c M Modules/sha512module.c diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 7121224e2ff1..42ea9974b952 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -187,7 +187,7 @@ EVP_copy(EVPobject *self, PyObject *unused) } PyDoc_STRVAR(EVP_digest__doc__, -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); static PyObject * EVP_digest(EVPobject *self, PyObject *unused) diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index 850d76bace7c..fa1a0d68e834 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(MD5Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define MD5TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__}, @@ -94,4 +94,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=50a95670913de8fb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=72aa003c308e26cf input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index be29355e23f7..c84fcbac5f6f 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(SHA1Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define SHA1TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__}, @@ -94,4 +94,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=9ee2aec7bb2b9e72 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=81d2424c0585bfd4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h index 9de5bd087d95..45f78c8f795e 100644 --- a/Modules/clinic/sha256module.c.h +++ b/Modules/clinic/sha256module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(SHA256Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define SHA256TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, @@ -124,4 +124,4 @@ _sha256_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=4b90199bc9f7cc88 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0086286cffcbc31c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha512module.c.h b/Modules/clinic/sha512module.c.h index ebb510e39a63..9d3a7c9e6d4a 100644 --- a/Modules/clinic/sha512module.c.h +++ b/Modules/clinic/sha512module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(SHA512Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define SHA512TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__}, @@ -124,4 +124,4 @@ _sha512_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=f963a543bf3c72e8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fcc3306fb6672222 input=a9049054013a1b77]*/ diff --git a/Modules/md5module.c b/Modules/md5module.c index c66b27308f05..d377f0bb4615 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -361,12 +361,12 @@ MD5Type_copy_impl(MD5object *self) /*[clinic input] MD5Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * MD5Type_digest_impl(MD5object *self) -/*[clinic end generated code: output=eb691dc4190a07ec input=7b96e65389412a34]*/ +/*[clinic end generated code: output=eb691dc4190a07ec input=bc0c4397c2994be6]*/ { unsigned char digest[MD5_DIGESTSIZE]; struct md5_state temp; diff --git a/Modules/sha1module.c b/Modules/sha1module.c index 358cd1e7f9ac..998ebd437dff 100644 --- a/Modules/sha1module.c +++ b/Modules/sha1module.c @@ -338,12 +338,12 @@ SHA1Type_copy_impl(SHA1object *self) /*[clinic input] SHA1Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * SHA1Type_digest_impl(SHA1object *self) -/*[clinic end generated code: output=2f05302a7aa2b5cb input=205d47e1927fd009]*/ +/*[clinic end generated code: output=2f05302a7aa2b5cb input=13824b35407444bd]*/ { unsigned char digest[SHA1_DIGESTSIZE]; struct sha1_state temp; diff --git a/Modules/sha256module.c b/Modules/sha256module.c index 3599eaf8be92..20b5f02f5481 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -428,12 +428,12 @@ SHA256Type_copy_impl(SHAobject *self) /*[clinic input] SHA256Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * SHA256Type_digest_impl(SHAobject *self) -/*[clinic end generated code: output=46616a5e909fbc3d input=1fb752e58954157d]*/ +/*[clinic end generated code: output=46616a5e909fbc3d input=f1f4cfea5cbde35c]*/ { unsigned char digest[SHA_DIGESTSIZE]; SHAobject temp; diff --git a/Modules/sha512module.c b/Modules/sha512module.c index d8c846a450f2..e070e4389f4c 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -493,12 +493,12 @@ SHA512Type_copy_impl(SHAobject *self) /*[clinic input] SHA512Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * SHA512Type_digest_impl(SHAobject *self) -/*[clinic end generated code: output=1080bbeeef7dde1b input=60c2cede9e023018]*/ +/*[clinic end generated code: output=1080bbeeef7dde1b input=f6470dd359071f4b]*/ { unsigned char digest[SHA_DIGESTSIZE]; SHAobject temp; From webhook-mailer at python.org Fri Oct 19 17:30:10 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 21:30:10 -0000 Subject: [Python-checkins] Fix typos in comments (GH-9905) Message-ID: https://github.com/python/cpython/commit/3bd0d620d6669558e03e1022cbab88d64d4530b3 commit: 3bd0d620d6669558e03e1022cbab88d64d4530b3 branch: master author: Quan Tian committer: Victor Stinner date: 2018-10-19T23:30:03+02:00 summary: Fix typos in comments (GH-9905) files: M Modules/gcmodule.c M Python/ceval.c M Python/pyarena.c diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index e3e290cf97a1..7cddabafbc46 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -504,7 +504,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) (void *)young); // relink gc_prev to prev element. _PyGCHead_SET_PREV(gc, prev); - // gc is not COLLECTING state aftere here. + // gc is not COLLECTING state after here. gc_clear_collecting(gc); prev = gc; } diff --git a/Python/ceval.c b/Python/ceval.c index 1a8c9e236493..9a96dc7b37b9 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3092,7 +3092,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag) /* There was an exception and a True return. * We must manually unwind the EXCEPT_HANDLER block * which was created when the exception was caught, - * otherwise the stack will be in an inconsisten state. + * otherwise the stack will be in an inconsistent state. */ PyTryBlock *b = PyFrame_BlockPop(f); assert(b->b_type == EXCEPT_HANDLER); diff --git a/Python/pyarena.c b/Python/pyarena.c index 103603fcdff3..abb5729c8ace 100644 --- a/Python/pyarena.c +++ b/Python/pyarena.c @@ -49,7 +49,7 @@ struct _arena { */ block *a_head; - /* Pointer to the block currently used for allocation. It's + /* Pointer to the block currently used for allocation. Its ab_next field should be NULL. If it is not-null after a call to block_alloc(), it means a new block has been allocated and a_cur should be reset to point it. @@ -57,7 +57,7 @@ struct _arena { block *a_cur; /* A Python list object containing references to all the PyObject - pointers associated with this area. They will be DECREFed + pointers associated with this arena. They will be DECREFed when the arena is freed. */ PyObject *a_objects; From webhook-mailer at python.org Fri Oct 19 17:42:12 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 21:42:12 -0000 Subject: [Python-checkins] Use dict unpacking in functools.partial() docs (GH-9412) Message-ID: https://github.com/python/cpython/commit/b981fec8d63697e8265d016582ce84944f272d55 commit: b981fec8d63697e8265d016582ce84944f272d55 branch: master author: Sergey Fedoseev committer: Victor Stinner date: 2018-10-19T23:42:07+02:00 summary: Use dict unpacking in functools.partial() docs (GH-9412) files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 7d59ec9187df..ec3d5a529e65 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -213,8 +213,7 @@ The :mod:`functools` module defines the following functions: def partial(func, *args, **keywords): def newfunc(*fargs, **fkeywords): - newkeywords = keywords.copy() - newkeywords.update(fkeywords) + newkeywords = {**keywords, **fkeywords} return func(*args, *fargs, **newkeywords) newfunc.func = func newfunc.args = args From webhook-mailer at python.org Fri Oct 19 17:46:34 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 21:46:34 -0000 Subject: [Python-checkins] bpo-33073: Rework int.as_integer_ratio() implementation (GH-9303) Message-ID: https://github.com/python/cpython/commit/b2e2025941f6a4fdb716bd141d31acf720353d21 commit: b2e2025941f6a4fdb716bd141d31acf720353d21 branch: master author: Serhiy Storchaka committer: Victor Stinner date: 2018-10-19T23:46:31+02:00 summary: bpo-33073: Rework int.as_integer_ratio() implementation (GH-9303) * Simplify the C code. * Simplify tests and make them more strict and robust. * Add references in the documentation. files: M Doc/whatsnew/3.8.rst M Lib/test/test_long.py M Objects/longobject.c diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index e522addf391f..93dd24acaa8a 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -91,8 +91,8 @@ Other Language Changes was lifted. (Contributed by Serhiy Storchaka in :issue:`32489`.) -* The ``int`` type now has a new ``as_integer_ratio`` method compatible - with the existing ``float.as_integer_ratio`` method. +* The :class:`int` type now has a new :meth:`~int.as_integer_ratio` method + compatible with the existing :meth:`float.as_integer_ratio` method. (Contributed by Lisa Roach in :issue:`33073`.) * Added support of ``\N{name}`` escapes in :mod:`regular expressions `. diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 5b860dd36bc0..53101b3badb3 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -3,7 +3,6 @@ import sys -import enum import random import math import array @@ -1354,35 +1353,14 @@ def test_shift_bool(self): self.assertEqual(type(value >> shift), int) def test_as_integer_ratio(self): - tests = [10, 0, -10, 1] + class myint(int): + pass + tests = [10, 0, -10, 1, sys.maxsize + 1, True, False, myint(42)] for value in tests: numerator, denominator = value.as_integer_ratio() - self.assertEqual((numerator, denominator), (value, 1)) - self.assertIsInstance(numerator, int) - self.assertIsInstance(denominator, int) - - def test_as_integer_ratio_maxint(self): - x = sys.maxsize + 1 - self.assertEqual(x.as_integer_ratio()[0], x) - - def test_as_integer_ratio_bool(self): - self.assertEqual(True.as_integer_ratio(), (1, 1)) - self.assertEqual(False.as_integer_ratio(), (0, 1)) - self.assertEqual(type(True.as_integer_ratio()[0]), int) - self.assertEqual(type(False.as_integer_ratio()[0]), int) - - def test_as_integer_ratio_int_enum(self): - class Foo(enum.IntEnum): - X = 42 - self.assertEqual(Foo.X.as_integer_ratio(), (42, 1)) - self.assertEqual(type(Foo.X.as_integer_ratio()[0]), int) - - def test_as_integer_ratio_int_flag(self): - class Foo(enum.IntFlag): - R = 1 << 2 - self.assertEqual(Foo.R.as_integer_ratio(), (4, 1)) - self.assertEqual(type(Foo.R.as_integer_ratio()[0]), int) - + self.assertEqual((numerator, denominator), (int(value), 1)) + self.assertEqual(type(numerator), int) + self.assertEqual(type(denominator), int) if __name__ == "__main__": diff --git a/Objects/longobject.c b/Objects/longobject.c index ae3a98cc791c..6f7fe335d9f2 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5280,13 +5280,8 @@ static PyObject * int_as_integer_ratio_impl(PyObject *self) /*[clinic end generated code: output=e60803ae1cc8621a input=55ce3058e15de393]*/ { - PyObject *numerator; PyObject *ratio_tuple; - - if (PyLong_CheckExact(self)) { - return PyTuple_Pack(2, self, _PyLong_One); - } - numerator = _PyLong_Copy((PyLongObject *) self); + PyObject *numerator = long_long(self); if (numerator == NULL) { return NULL; } From webhook-mailer at python.org Fri Oct 19 17:50:10 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 21:50:10 -0000 Subject: [Python-checkins] bpo-25750: Add test on bad descriptor __get__() (GH-9084) Message-ID: https://github.com/python/cpython/commit/5a30620e68ebb911eef4d583de3776d782148637 commit: 5a30620e68ebb911eef4d583de3776d782148637 branch: master author: jdemeyer committer: Victor Stinner date: 2018-10-19T23:50:06+02:00 summary: bpo-25750: Add test on bad descriptor __get__() (GH-9084) files: M Lib/test/test_descr.py M Modules/_testcapimodule.c diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index b96d35cc7299..b38cb765cdc0 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -13,6 +13,11 @@ from copy import deepcopy from test import support +try: + import _testcapi +except ImportError: + _testcapi = None + class OperatorsTest(unittest.TestCase): @@ -4757,6 +4762,22 @@ def __call__(self, arg): self.assertRegex(repr(method), r">") + @unittest.skipIf(_testcapi is None, 'need the _testcapi module') + def test_bpo25750(self): + # bpo-25750: calling a descriptor (implemented as built-in + # function with METH_FASTCALL) should not crash CPython if the + # descriptor deletes itself from the class. + class Descr: + __get__ = _testcapi.bad_get + + class X: + descr = Descr() + def __new__(cls): + cls.descr = None + # Create this large list to corrupt some unused memory + cls.lst = [2**i for i in range(10000)] + X.descr + class DictProxyTests(unittest.TestCase): def setUp(self): diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index add642f223af..4381e93ca913 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4550,6 +4550,28 @@ new_hamt(PyObject *self, PyObject *args) } +/* def bad_get(self, obj, cls): + cls() + return repr(self) +*/ +static PyObject* +bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + if (nargs != 3) { + PyErr_SetString(PyExc_TypeError, "bad_get requires exactly 3 arguments"); + return NULL; + } + + PyObject *res = PyObject_CallObject(args[2], NULL); + if (res == NULL) { + return NULL; + } + Py_DECREF(res); + + return PyObject_Repr(args[0]); +} + + static PyObject * encode_locale_ex(PyObject *self, PyObject *args) { @@ -5017,6 +5039,7 @@ static PyMethodDef TestMethods[] = { {"get_mapping_items", get_mapping_items, METH_O}, {"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS}, {"hamt", new_hamt, METH_NOARGS}, + {"bad_get", bad_get, METH_FASTCALL}, {"EncodeLocaleEx", encode_locale_ex, METH_VARARGS}, {"DecodeLocaleEx", decode_locale_ex, METH_VARARGS}, {"get_coreconfig", get_coreconfig, METH_NOARGS}, From webhook-mailer at python.org Fri Oct 19 17:57:40 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 21:57:40 -0000 Subject: [Python-checkins] unittest.mock doc: Fix references to recursive seal of Mocks (GH-9028) Message-ID: https://github.com/python/cpython/commit/96200eb2ffcda05de14099cf23f60d5091366e3e commit: 96200eb2ffcda05de14099cf23f60d5091366e3e branch: master author: Mario Corchero committer: Victor Stinner date: 2018-10-19T23:57:37+02:00 summary: unittest.mock doc: Fix references to recursive seal of Mocks (GH-9028) The docs in `library/unittest.mock` have been updated to remove confusing terms about submock and be explicit about the behavior expected. files: M Doc/library/unittest.mock.rst M Lib/unittest/mock.py diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index edafca0c674e..136804cfc2c8 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -2410,17 +2410,18 @@ Sealing mocks .. function:: seal(mock) - Seal will disable the creation of mock children by preventing getting or setting - of any new attribute on the sealed mock. The sealing process is performed recursively. + Seal will disable the automatic creation of mocks when accessing an attribute of + the mock being sealed or any of its attributes that are already mocks recursively. - If a mock instance is assigned to an attribute instead of being dynamically created + If a mock instance with a name or a spec is assigned to an attribute it won't be considered in the sealing chain. This allows one to prevent seal from fixing part of the mock object. :: >>> mock = Mock() >>> mock.submock.attribute1 = 2 - >>> mock.not_submock = mock.Mock() + >>> mock.not_submock = mock.Mock(name="sample_name") >>> seal(mock) + >>> mock.new_attribute # This will raise AttributeError. >>> mock.submock.attribute2 # This will raise AttributeError. >>> mock.not_submock.attribute2 # This won't raise. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 83026e6f3bd3..6b7f293bc5e0 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2425,15 +2425,14 @@ def __set__(self, obj, val): def seal(mock): - """Disable the automatic generation of "submocks" + """Disable the automatic generation of child mocks. Given an input Mock, seals it to ensure no further mocks will be generated when accessing an attribute that was not already defined. - Submocks are defined as all mocks which were created DIRECTLY from the - parent. If a mock is assigned to an attribute of an existing mock, - it is not considered a submock. - + The operation recursively seals the mock passed in, meaning that + the mock itself, any mocks generated by accessing one of its attributes, + and all assigned mocks without a name or spec will be sealed. """ mock._mock_sealed = True for attr in dir(mock): From webhook-mailer at python.org Fri Oct 19 18:17:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 22:17:34 -0000 Subject: [Python-checkins] unittest.mock doc: Fix references to recursive seal of Mocks (GH-9028) Message-ID: https://github.com/python/cpython/commit/984a800e082e649186e177ec4fedc7d7e3dcc22d commit: 984a800e082e649186e177ec4fedc7d7e3dcc22d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T15:17:31-07:00 summary: unittest.mock doc: Fix references to recursive seal of Mocks (GH-9028) The docs in `library/unittest.mock` have been updated to remove confusing terms about submock and be explicit about the behavior expected. (cherry picked from commit 96200eb2ffcda05de14099cf23f60d5091366e3e) Co-authored-by: Mario Corchero files: M Doc/library/unittest.mock.rst M Lib/unittest/mock.py diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index ef1b2e35719d..91633b505f56 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -2374,17 +2374,18 @@ Sealing mocks .. function:: seal(mock) - Seal will disable the creation of mock children by preventing getting or setting - of any new attribute on the sealed mock. The sealing process is performed recursively. + Seal will disable the automatic creation of mocks when accessing an attribute of + the mock being sealed or any of its attributes that are already mocks recursively. - If a mock instance is assigned to an attribute instead of being dynamically created + If a mock instance with a name or a spec is assigned to an attribute it won't be considered in the sealing chain. This allows one to prevent seal from fixing part of the mock object. >>> mock = Mock() >>> mock.submock.attribute1 = 2 - >>> mock.not_submock = mock.Mock() + >>> mock.not_submock = mock.Mock(name="sample_name") >>> seal(mock) + >>> mock.new_attribute # This will raise AttributeError. >>> mock.submock.attribute2 # This will raise AttributeError. >>> mock.not_submock.attribute2 # This won't raise. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index cfc0d76ee3f7..1a6c251d2cf7 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2423,15 +2423,14 @@ def __set__(self, obj, val): def seal(mock): - """Disable the automatic generation of "submocks" + """Disable the automatic generation of child mocks. Given an input Mock, seals it to ensure no further mocks will be generated when accessing an attribute that was not already defined. - Submocks are defined as all mocks which were created DIRECTLY from the - parent. If a mock is assigned to an attribute of an existing mock, - it is not considered a submock. - + The operation recursively seals the mock passed in, meaning that + the mock itself, any mocks generated by accessing one of its attributes, + and all assigned mocks without a name or spec will be sealed. """ mock._mock_sealed = True for attr in dir(mock): From webhook-mailer at python.org Fri Oct 19 18:27:53 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 22:27:53 -0000 Subject: [Python-checkins] queue doc: Clarify that the simple FIFO queue is SimpleQueue (GH-8372) Message-ID: https://github.com/python/cpython/commit/acef69068f61c9f4141f8509b6a1bfaadab87b5c commit: acef69068f61c9f4141f8509b6a1bfaadab87b5c branch: master author: Julien Palard committer: Victor Stinner date: 2018-10-20T00:27:49+02:00 summary: queue doc: Clarify that the simple FIFO queue is SimpleQueue (GH-8372) files: M Doc/library/queue.rst diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 6106d0cd381f..1fea86bfc5cd 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -26,8 +26,8 @@ competing threads; however, they are not designed to handle reentrancy within a thread. In addition, the module implements a "simple" -:abbr:`FIFO (first-in, first-out)` queue type where -specific implementations can provide additional guarantees +:abbr:`FIFO (first-in, first-out)` queue type, :class:`SimpleQueue`, whose +specific implementation provides additional guarantees in exchange for the smaller functionality. The :mod:`queue` module defines the following classes and exceptions: From webhook-mailer at python.org Fri Oct 19 18:32:08 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 22:32:08 -0000 Subject: [Python-checkins] bpo-34070: open() only checks for isatty if buffering < 0 (GH-8187) Message-ID: https://github.com/python/cpython/commit/8deab9672554edaf58f91e238cc899463d53f6ea commit: 8deab9672554edaf58f91e238cc899463d53f6ea branch: master author: David Herberth committer: Victor Stinner date: 2018-10-20T00:32:04+02:00 summary: bpo-34070: open() only checks for isatty if buffering < 0 (GH-8187) files: A Misc/NEWS.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst M Modules/_io/_iomodule.c diff --git a/Misc/NEWS.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst b/Misc/NEWS.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst new file mode 100644 index 000000000000..0088c62c0ffb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst @@ -0,0 +1,2 @@ +Make sure to only check if the handle is a tty, when opening +a file with ``buffering=-1``. diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 0d8a638f40cf..eedca011d2ed 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -241,7 +241,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, char rawmode[6], *m; int line_buffering, is_number; - long isatty; + long isatty = 0; PyObject *raw, *modeobj = NULL, *buffer, *wrapper, *result = NULL, *path_or_fd = NULL; @@ -388,7 +388,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, goto error; /* buffering */ - { + if (buffering < 0) { PyObject *res = _PyObject_CallMethodId(raw, &PyId_isatty, NULL); if (res == NULL) goto error; @@ -398,7 +398,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, goto error; } - if (buffering == 1 || (buffering < 0 && isatty)) { + if (buffering == 1 || isatty) { buffering = -1; line_buffering = 1; } From webhook-mailer at python.org Fri Oct 19 18:33:39 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 22:33:39 -0000 Subject: [Python-checkins] queue doc: Clarify that the simple FIFO queue is SimpleQueue (GH-8372) Message-ID: https://github.com/python/cpython/commit/76d31a3b966a618b2a0ee011372f18c992695fee commit: 76d31a3b966a618b2a0ee011372f18c992695fee branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T15:33:36-07:00 summary: queue doc: Clarify that the simple FIFO queue is SimpleQueue (GH-8372) (cherry picked from commit acef69068f61c9f4141f8509b6a1bfaadab87b5c) Co-authored-by: Julien Palard files: M Doc/library/queue.rst diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 1520faa9b83f..7335a64bef84 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -28,8 +28,8 @@ competing threads; however, they are not designed to handle reentrancy within a thread. In addition, the module implements a "simple" -:abbr:`FIFO (first-in, first-out)` queue type where -specific implementations can provide additional guarantees +:abbr:`FIFO (first-in, first-out)` queue type, :class:`SimpleQueue`, whose +specific implementation provides additional guarantees in exchange for the smaller functionality. The :mod:`queue` module defines the following classes and exceptions: From webhook-mailer at python.org Fri Oct 19 18:43:29 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 22:43:29 -0000 Subject: [Python-checkins] Elaborate datetime.timedelta docstring (GH-7458) Message-ID: https://github.com/python/cpython/commit/d6a61f232619f8a8e6efacc3da5a02abaf25f090 commit: d6a61f232619f8a8e6efacc3da5a02abaf25f090 branch: master author: Chris Barker committer: Victor Stinner date: 2018-10-20T00:43:24+02:00 summary: Elaborate datetime.timedelta docstring (GH-7458) files: M Modules/_datetimemodule.c diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index b7c59f1bd862..cdfa235f0917 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -2641,7 +2641,11 @@ static PyMethodDef delta_methods[] = { }; static const char delta_doc[] = -PyDoc_STR("Difference between two datetime values."); +PyDoc_STR("Difference between two datetime values.\n\n" + "timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, " + "minutes=0, hours=0, weeks=0)\n\n" + "All arguments are optional and default to 0.\n" + "Arguments may be integers or floats, and may be positive or negative."); static PyNumberMethods delta_as_number = { delta_add, /* nb_add */ From webhook-mailer at python.org Fri Oct 19 18:48:49 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 22:48:49 -0000 Subject: [Python-checkins] bpo-1621: Avoid signed integer overflow in set_table_resize(). (GH-9059) (GH-9199) Message-ID: https://github.com/python/cpython/commit/a9274f7b3f69519f0746c50f85a68abd926ebe7b commit: a9274f7b3f69519f0746c50f85a68abd926ebe7b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T00:48:46+02:00 summary: bpo-1621: Avoid signed integer overflow in set_table_resize(). (GH-9059) (GH-9199) Address a C undefined behavior signed integer overflow issue in set object table resizing. Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings. (cherry picked from commit 6c7d67ce83a62b5f0fe5c53a6df602827451bf7f) Co-authored-by: Sergey Fedoseev files: A Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst M Objects/setobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst new file mode 100644 index 000000000000..4047ff3bfe86 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst @@ -0,0 +1,2 @@ +Do not assume signed integer overflow behavior (C undefined behavior) when +performing set hash table resizing. diff --git a/Objects/setobject.c b/Objects/setobject.c index 96485f83ecb6..27836c0fb1ea 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -294,7 +294,6 @@ actually be smaller than the old one. static int set_table_resize(PySetObject *so, Py_ssize_t minused) { - Py_ssize_t newsize; setentry *oldtable, *newtable, *entry; Py_ssize_t oldfill = so->fill; Py_ssize_t oldused = so->used; @@ -307,13 +306,9 @@ set_table_resize(PySetObject *so, Py_ssize_t minused) /* Find the smallest table size > minused. */ /* XXX speed-up with intrinsics */ - for (newsize = PySet_MINSIZE; - newsize <= minused && newsize > 0; - newsize <<= 1) - ; - if (newsize <= 0) { - PyErr_NoMemory(); - return -1; + size_t newsize = PySet_MINSIZE; + while (newsize <= (size_t)minused) { + newsize <<= 1; // The largest possible value is PY_SSIZE_T_MAX + 1. } /* Get space for a new table. */ From webhook-mailer at python.org Fri Oct 19 18:50:37 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 22:50:37 -0000 Subject: [Python-checkins] bpo-1621: Avoid signed integer overflow in set_table_resize() (GH-9059) (GH-9198) Message-ID: https://github.com/python/cpython/commit/6665802549006eb50c1a68c3489ee3aaf81d0c8e commit: 6665802549006eb50c1a68c3489ee3aaf81d0c8e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T00:50:34+02:00 summary: bpo-1621: Avoid signed integer overflow in set_table_resize() (GH-9059) (GH-9198) Address a C undefined behavior signed integer overflow issue in set object table resizing. Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings. Co-authored-by: Sergey Fedoseev files: A Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst M Objects/setobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst new file mode 100644 index 000000000000..4047ff3bfe86 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-11-15-19-37.bpo-1621.7o19yG.rst @@ -0,0 +1,2 @@ +Do not assume signed integer overflow behavior (C undefined behavior) when +performing set hash table resizing. diff --git a/Objects/setobject.c b/Objects/setobject.c index ce35aa2a0cdb..357e48ca3ce0 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -302,7 +302,6 @@ actually be smaller than the old one. static int set_table_resize(PySetObject *so, Py_ssize_t minused) { - Py_ssize_t newsize; setentry *oldtable, *newtable, *entry; Py_ssize_t oldmask = so->mask; size_t newmask; @@ -313,13 +312,9 @@ set_table_resize(PySetObject *so, Py_ssize_t minused) /* Find the smallest table size > minused. */ /* XXX speed-up with intrinsics */ - for (newsize = PySet_MINSIZE; - newsize <= minused && newsize > 0; - newsize <<= 1) - ; - if (newsize <= 0) { - PyErr_NoMemory(); - return -1; + size_t newsize = PySet_MINSIZE; + while (newsize <= (size_t)minused) { + newsize <<= 1; // The largest possible value is PY_SSIZE_T_MAX + 1. } /* Get space for a new table. */ From webhook-mailer at python.org Fri Oct 19 19:02:17 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 23:02:17 -0000 Subject: [Python-checkins] Elaborate datetime.timedelta docstring (GH-7458) Message-ID: https://github.com/python/cpython/commit/ef7f29f66c8c8c51405f61cea8a7803987deee50 commit: ef7f29f66c8c8c51405f61cea8a7803987deee50 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T16:02:13-07:00 summary: Elaborate datetime.timedelta docstring (GH-7458) (cherry picked from commit d6a61f232619f8a8e6efacc3da5a02abaf25f090) Co-authored-by: Chris Barker files: M Modules/_datetimemodule.c diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 41b95b919394..81a0b1f16811 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -2640,7 +2640,11 @@ static PyMethodDef delta_methods[] = { }; static const char delta_doc[] = -PyDoc_STR("Difference between two datetime values."); +PyDoc_STR("Difference between two datetime values.\n\n" + "timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, " + "minutes=0, hours=0, weeks=0)\n\n" + "All arguments are optional and default to 0.\n" + "Arguments may be integers or floats, and may be positive or negative."); static PyNumberMethods delta_as_number = { delta_add, /* nb_add */ From webhook-mailer at python.org Fri Oct 19 19:08:18 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 23:08:18 -0000 Subject: [Python-checkins] Elaborate datetime.timedelta docstring (GH-7458) Message-ID: https://github.com/python/cpython/commit/47413fe608c8ecea3b8c4c6341442fd4174160c6 commit: 47413fe608c8ecea3b8c4c6341442fd4174160c6 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T16:08:14-07:00 summary: Elaborate datetime.timedelta docstring (GH-7458) (cherry picked from commit d6a61f232619f8a8e6efacc3da5a02abaf25f090) Co-authored-by: Chris Barker files: M Modules/_datetimemodule.c diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 64928b1f81c1..afc865e466de 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -2413,7 +2413,11 @@ static PyMethodDef delta_methods[] = { }; static const char delta_doc[] = -PyDoc_STR("Difference between two datetime values."); +PyDoc_STR("Difference between two datetime values.\n\n" + "timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, " + "minutes=0, hours=0, weeks=0)\n\n" + "All arguments are optional and default to 0.\n" + "Arguments may be integers or floats, and may be positive or negative."); static PyNumberMethods delta_as_number = { delta_add, /* nb_add */ From webhook-mailer at python.org Fri Oct 19 19:09:04 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:09:04 -0000 Subject: [Python-checkins] bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9545) Message-ID: https://github.com/python/cpython/commit/c119d5948f941d2f528dda3f099e196bd6383000 commit: c119d5948f941d2f528dda3f099e196bd6383000 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:09:01+02:00 summary: bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9545) The xml.sax and xml.dom.domreg modules now obey sys.flags.ignore_environment. Signed-off-by: Christian Heimes (cherry picked from commit 223e501fb9c2b6ae21b96054e20c4c31d94a5d96) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst M Lib/xml/dom/domreg.py M Lib/xml/sax/__init__.py diff --git a/Lib/xml/dom/domreg.py b/Lib/xml/dom/domreg.py index 8c3d901acb0b..69c17eebb265 100644 --- a/Lib/xml/dom/domreg.py +++ b/Lib/xml/dom/domreg.py @@ -6,6 +6,8 @@ # should be published by posting to xml-sig at python.org, and are # subsequently recorded in this file. +import sys + well_known_implementations = { 'minidom':'xml.dom.minidom', '4DOM': 'xml.dom.DOMImplementation', @@ -55,7 +57,7 @@ def getDOMImplementation(name=None, features=()): return mod.getDOMImplementation() elif name: return registered[name]() - elif "PYTHON_DOM" in os.environ: + elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ: return getDOMImplementation(name = os.environ["PYTHON_DOM"]) # User did not specify a name, try implementations in arbitrary diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py index ef67ae67a6bd..13f6cf58d0d2 100644 --- a/Lib/xml/sax/__init__.py +++ b/Lib/xml/sax/__init__.py @@ -58,7 +58,7 @@ def parseString(string, handler, errorHandler=ErrorHandler()): import xml.sax.expatreader import os, sys -if "PY_SAX_PARSER" in os.environ: +if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ: default_parser_list = os.environ["PY_SAX_PARSER"].split(",") del os diff --git a/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst b/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst new file mode 100644 index 000000000000..afb59f8cb0eb --- /dev/null +++ b/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst @@ -0,0 +1,3 @@ +The xml.sax and xml.dom.domreg no longer use environment variables to +override parser implementations when sys.flags.ignore_environment is set by +-E or -I arguments. From webhook-mailer at python.org Fri Oct 19 19:09:26 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:09:26 -0000 Subject: [Python-checkins] bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9546) Message-ID: https://github.com/python/cpython/commit/5e808f92ea4eb238b17757526b99f97debf7dd57 commit: 5e808f92ea4eb238b17757526b99f97debf7dd57 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:09:23+02:00 summary: bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9546) The xml.sax and xml.dom.domreg modules now obey sys.flags.ignore_environment. Signed-off-by: Christian Heimes https://bugs.python.org/issue34791 (cherry picked from commit 223e501fb9c2b6ae21b96054e20c4c31d94a5d96) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst M Lib/xml/dom/domreg.py M Lib/xml/sax/__init__.py diff --git a/Lib/xml/dom/domreg.py b/Lib/xml/dom/domreg.py index 8c3d901acb0b..69c17eebb265 100644 --- a/Lib/xml/dom/domreg.py +++ b/Lib/xml/dom/domreg.py @@ -6,6 +6,8 @@ # should be published by posting to xml-sig at python.org, and are # subsequently recorded in this file. +import sys + well_known_implementations = { 'minidom':'xml.dom.minidom', '4DOM': 'xml.dom.DOMImplementation', @@ -55,7 +57,7 @@ def getDOMImplementation(name=None, features=()): return mod.getDOMImplementation() elif name: return registered[name]() - elif "PYTHON_DOM" in os.environ: + elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ: return getDOMImplementation(name = os.environ["PYTHON_DOM"]) # User did not specify a name, try implementations in arbitrary diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py index ef67ae67a6bd..13f6cf58d0d2 100644 --- a/Lib/xml/sax/__init__.py +++ b/Lib/xml/sax/__init__.py @@ -58,7 +58,7 @@ def parseString(string, handler, errorHandler=ErrorHandler()): import xml.sax.expatreader import os, sys -if "PY_SAX_PARSER" in os.environ: +if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ: default_parser_list = os.environ["PY_SAX_PARSER"].split(",") del os diff --git a/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst b/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst new file mode 100644 index 000000000000..afb59f8cb0eb --- /dev/null +++ b/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst @@ -0,0 +1,3 @@ +The xml.sax and xml.dom.domreg no longer use environment variables to +override parser implementations when sys.flags.ignore_environment is set by +-E or -I arguments. From webhook-mailer at python.org Fri Oct 19 19:09:38 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:09:38 -0000 Subject: [Python-checkins] bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9547) Message-ID: https://github.com/python/cpython/commit/2546ac8eeb56fc146adea9a03158440a9271714e commit: 2546ac8eeb56fc146adea9a03158440a9271714e branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:09:35+02:00 summary: bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9547) The xml.sax and xml.dom.domreg modules now obey sys.flags.ignore_environment. Signed-off-by: Christian Heimes https://bugs.python.org/issue34791 (cherry picked from commit 223e501fb9c2b6ae21b96054e20c4c31d94a5d96) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst M Lib/xml/dom/domreg.py M Lib/xml/sax/__init__.py diff --git a/Lib/xml/dom/domreg.py b/Lib/xml/dom/domreg.py index ec3acdf9c1dd..083528010663 100644 --- a/Lib/xml/dom/domreg.py +++ b/Lib/xml/dom/domreg.py @@ -8,6 +8,8 @@ # should be published by posting to xml-sig at python.org, and are # subsequently recorded in this file. +import sys + well_known_implementations = { 'minidom':'xml.dom.minidom', '4DOM': 'xml.dom.DOMImplementation', @@ -57,7 +59,7 @@ def getDOMImplementation(name = None, features = ()): return mod.getDOMImplementation() elif name: return registered[name]() - elif "PYTHON_DOM" in os.environ: + elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ: return getDOMImplementation(name = os.environ["PYTHON_DOM"]) # User did not specify a name, try implementations in arbitrary diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py index 005b66e38a8e..d2e33913c075 100644 --- a/Lib/xml/sax/__init__.py +++ b/Lib/xml/sax/__init__.py @@ -59,7 +59,7 @@ def parseString(string, handler, errorHandler=ErrorHandler()): import xml.sax.expatreader import os, sys -if "PY_SAX_PARSER" in os.environ: +if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ: default_parser_list = os.environ["PY_SAX_PARSER"].split(",") del os diff --git a/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst b/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst new file mode 100644 index 000000000000..afb59f8cb0eb --- /dev/null +++ b/Misc/NEWS.d/next/Security/2018-09-24-18-49-25.bpo-34791.78GmIG.rst @@ -0,0 +1,3 @@ +The xml.sax and xml.dom.domreg no longer use environment variables to +override parser implementations when sys.flags.ignore_environment is set by +-E or -I arguments. From webhook-mailer at python.org Fri Oct 19 19:14:46 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:14:46 -0000 Subject: [Python-checkins] bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) (GH-9743) Message-ID: https://github.com/python/cpython/commit/4ec9f64e07c8f397ad6699f8b99843846c219588 commit: 4ec9f64e07c8f397ad6699f8b99843846c219588 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:14:42+02:00 summary: bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) (GH-9743) On failure, _PyBytes_Resize() will deallocate the bytes object and set "result" to NULL. https://bugs.python.org/issue34824 (cherry picked from commit 365ad2ead5bbaf7a3b18648ffa36e819559d3f75) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst M Modules/_ssl.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst new file mode 100644 index 000000000000..fe95b8973c09 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst @@ -0,0 +1,2 @@ +Fix a possible null pointer dereference in Modules/_ssl.c. Patch by Zackery +Spytz. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 4253e2a77201..f9d1b8c30877 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4711,12 +4711,17 @@ _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len) return result; nbytes = BIO_read(self->bio, PyBytes_AS_STRING(result), len); - /* There should never be any short reads but check anyway. */ - if ((nbytes < len) && (_PyBytes_Resize(&result, len) < 0)) { + if (nbytes < 0) { Py_DECREF(result); + _setSSLError(NULL, 0, __FILE__, __LINE__); return NULL; } + /* There should never be any short reads but check anyway. */ + if (nbytes < len) { + _PyBytes_Resize(&result, nbytes); + } + return result; } From webhook-mailer at python.org Fri Oct 19 19:14:51 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:14:51 -0000 Subject: [Python-checkins] bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) (GH-9744) Message-ID: https://github.com/python/cpython/commit/d92816de667169fbd54a3442705bc07286e8c69d commit: d92816de667169fbd54a3442705bc07286e8c69d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:14:49+02:00 summary: bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606) (GH-9744) On failure, _PyBytes_Resize() will deallocate the bytes object and set "result" to NULL. https://bugs.python.org/issue34824 (cherry picked from commit 365ad2ead5bbaf7a3b18648ffa36e819559d3f75) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst M Modules/_ssl.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst new file mode 100644 index 000000000000..fe95b8973c09 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-27-11-10-02.bpo-34824.VLlCaU.rst @@ -0,0 +1,2 @@ +Fix a possible null pointer dereference in Modules/_ssl.c. Patch by Zackery +Spytz. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index b0cfbdc96c07..2b043da280b8 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4365,12 +4365,17 @@ _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len) return result; nbytes = BIO_read(self->bio, PyBytes_AS_STRING(result), len); - /* There should never be any short reads but check anyway. */ - if ((nbytes < len) && (_PyBytes_Resize(&result, len) < 0)) { + if (nbytes < 0) { Py_DECREF(result); + _setSSLError(NULL, 0, __FILE__, __LINE__); return NULL; } + /* There should never be any short reads but check anyway. */ + if (nbytes < len) { + _PyBytes_Resize(&result, nbytes); + } + return result; } From webhook-mailer at python.org Fri Oct 19 19:18:06 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:18:06 -0000 Subject: [Python-checkins] In email.parser in message_from_bytes, update `strict` to `policy` (GH-9854) (GH-9918) Message-ID: https://github.com/python/cpython/commit/34634ee609852071b4bc80de7e7c83b85bc59b37 commit: 34634ee609852071b4bc80de7e7c83b85bc59b37 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:18:03+02:00 summary: In email.parser in message_from_bytes, update `strict` to `policy` (GH-9854) (GH-9918) According to the versionchanged note, the `strict` argument was removed in 3.3 and `policy` was added, but the name of the argument in the paragraph wasn't updated. (cherry picked from commit a5ca98537b9f3f5eeae9157b1548b741df3fbf90) Co-authored-by: Cheryl Sabella files: M Doc/library/email.parser.rst diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index e0cab6a69497..49b4e992708a 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -238,7 +238,7 @@ in the top-level :mod:`email` package namespace. Return a message object structure from a :term:`bytes-like object`. This is equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and - *strict* are interpreted as with the :class:`~email.parser.BytesParser` class + *policy* are interpreted as with the :class:`~email.parser.BytesParser` class constructor. .. versionadded:: 3.2 From webhook-mailer at python.org Fri Oct 19 19:18:57 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:18:57 -0000 Subject: [Python-checkins] In email docs, correct spelling of foregoing (GH-9856) (GH-9920) Message-ID: https://github.com/python/cpython/commit/7eacd6789c094dd9933b6c7bd850ae4c4141e768 commit: 7eacd6789c094dd9933b6c7bd850ae4c4141e768 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:18:54+02:00 summary: In email docs, correct spelling of foregoing (GH-9856) (GH-9920) (cherry picked from commit c984d20ec81609aa439ccdb3af5bc35fca0c2112) Co-authored-by: Cheryl Sabella files: M Doc/library/email.rst diff --git a/Doc/library/email.rst b/Doc/library/email.rst index 1033d8c130eb..07d455ba39d3 100644 --- a/Doc/library/email.rst +++ b/Doc/library/email.rst @@ -87,7 +87,7 @@ to advanced applications. Following those is a set of examples of using the fundamental parts of the APIs covered in the preceding sections. -The forgoing represent the modern (unicode friendly) API of the email package. +The foregoing represent the modern (unicode friendly) API of the email package. The remaining sections, starting with the :class:`~email.message.Message` class, cover the legacy :data:`~email.policy.compat32` API that deals much more directly with the details of how email messages are represented. The From webhook-mailer at python.org Fri Oct 19 19:21:01 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:21:01 -0000 Subject: [Python-checkins] bpo-20216: Correct docstrings of digest() methods in hashlib. (GH-9873) (GH-9971) Message-ID: https://github.com/python/cpython/commit/23efe77acf0dce513d7b7cab5523c061bb006b60 commit: 23efe77acf0dce513d7b7cab5523c061bb006b60 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-20T01:20:56+02:00 summary: bpo-20216: Correct docstrings of digest() methods in hashlib. (GH-9873) (GH-9971) (cherry picked from commit f192aeb95a139ede74d69e39c046c498ff288a37) Co-authored-by: Srinivas Thatiparthy (?????????? ?????????) files: M Modules/_hashopenssl.c M Modules/clinic/md5module.c.h M Modules/clinic/sha1module.c.h M Modules/clinic/sha256module.c.h M Modules/clinic/sha512module.c.h M Modules/md5module.c M Modules/sha1module.c M Modules/sha256module.c M Modules/sha512module.c diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 40cd6327312d..31d05409f249 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -187,7 +187,7 @@ EVP_copy(EVPobject *self, PyObject *unused) } PyDoc_STRVAR(EVP_digest__doc__, -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); static PyObject * EVP_digest(EVPobject *self, PyObject *unused) diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index 850d76bace7c..fa1a0d68e834 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(MD5Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define MD5TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__}, @@ -94,4 +94,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=50a95670913de8fb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=72aa003c308e26cf input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index be29355e23f7..c84fcbac5f6f 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(SHA1Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define SHA1TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__}, @@ -94,4 +94,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=9ee2aec7bb2b9e72 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=81d2424c0585bfd4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h index 9de5bd087d95..45f78c8f795e 100644 --- a/Modules/clinic/sha256module.c.h +++ b/Modules/clinic/sha256module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(SHA256Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define SHA256TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, @@ -124,4 +124,4 @@ _sha256_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=4b90199bc9f7cc88 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0086286cffcbc31c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha512module.c.h b/Modules/clinic/sha512module.c.h index ebb510e39a63..9d3a7c9e6d4a 100644 --- a/Modules/clinic/sha512module.c.h +++ b/Modules/clinic/sha512module.c.h @@ -24,7 +24,7 @@ PyDoc_STRVAR(SHA512Type_digest__doc__, "digest($self, /)\n" "--\n" "\n" -"Return the digest value as a string of binary data."); +"Return the digest value as a bytes object."); #define SHA512TYPE_DIGEST_METHODDEF \ {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__}, @@ -124,4 +124,4 @@ _sha512_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=f963a543bf3c72e8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fcc3306fb6672222 input=a9049054013a1b77]*/ diff --git a/Modules/md5module.c b/Modules/md5module.c index c66b27308f05..d377f0bb4615 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -361,12 +361,12 @@ MD5Type_copy_impl(MD5object *self) /*[clinic input] MD5Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * MD5Type_digest_impl(MD5object *self) -/*[clinic end generated code: output=eb691dc4190a07ec input=7b96e65389412a34]*/ +/*[clinic end generated code: output=eb691dc4190a07ec input=bc0c4397c2994be6]*/ { unsigned char digest[MD5_DIGESTSIZE]; struct md5_state temp; diff --git a/Modules/sha1module.c b/Modules/sha1module.c index 358cd1e7f9ac..998ebd437dff 100644 --- a/Modules/sha1module.c +++ b/Modules/sha1module.c @@ -338,12 +338,12 @@ SHA1Type_copy_impl(SHA1object *self) /*[clinic input] SHA1Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * SHA1Type_digest_impl(SHA1object *self) -/*[clinic end generated code: output=2f05302a7aa2b5cb input=205d47e1927fd009]*/ +/*[clinic end generated code: output=2f05302a7aa2b5cb input=13824b35407444bd]*/ { unsigned char digest[SHA1_DIGESTSIZE]; struct sha1_state temp; diff --git a/Modules/sha256module.c b/Modules/sha256module.c index 3599eaf8be92..20b5f02f5481 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -428,12 +428,12 @@ SHA256Type_copy_impl(SHAobject *self) /*[clinic input] SHA256Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * SHA256Type_digest_impl(SHAobject *self) -/*[clinic end generated code: output=46616a5e909fbc3d input=1fb752e58954157d]*/ +/*[clinic end generated code: output=46616a5e909fbc3d input=f1f4cfea5cbde35c]*/ { unsigned char digest[SHA_DIGESTSIZE]; SHAobject temp; diff --git a/Modules/sha512module.c b/Modules/sha512module.c index d8c846a450f2..e070e4389f4c 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -493,12 +493,12 @@ SHA512Type_copy_impl(SHAobject *self) /*[clinic input] SHA512Type.digest -Return the digest value as a string of binary data. +Return the digest value as a bytes object. [clinic start generated code]*/ static PyObject * SHA512Type_digest_impl(SHAobject *self) -/*[clinic end generated code: output=1080bbeeef7dde1b input=60c2cede9e023018]*/ +/*[clinic end generated code: output=1080bbeeef7dde1b input=f6470dd359071f4b]*/ { unsigned char digest[SHA_DIGESTSIZE]; SHAobject temp; From webhook-mailer at python.org Fri Oct 19 19:27:49 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:27:49 -0000 Subject: [Python-checkins] bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349) Message-ID: https://github.com/python/cpython/commit/6f17e51345d930ccb4db306acc12b7d1f6c5e690 commit: 6f17e51345d930ccb4db306acc12b7d1f6c5e690 branch: master author: Serhiy Storchaka committer: Victor Stinner date: 2018-10-20T01:27:45+02:00 summary: bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349) files: M Lib/test/test_ordered_dict.py M Objects/odictobject.c diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index 20efe3729de8..a296f6055b1a 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -697,9 +697,9 @@ def test_sizeof_exact(self): nodesize = calcsize('Pn2P') od = OrderedDict() - check(od, basicsize + 8*p + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table + check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table od.x = 1 - check(od, basicsize + 8*p + 8 + 5*entrysize) + check(od, basicsize + 8 + 5*entrysize) od.update([(i, i) for i in range(3)]) check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize) od.update([(i, i) for i in range(3, 10)]) diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 353afd23d6b5..47e77b6046b2 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -101,10 +101,6 @@ For removing nodes: * _odict_find_node(od, key) * _odict_keys_equal(od1, od2) -Used, but specific to the linked-list implementation: - -* _odict_free_fast_nodes(od) - And here's a look at how the linked-list relates to the OrderedDict API: ============ === === ==== ==== ==== === ==== ===== ==== ==== === ==== === === @@ -378,7 +374,6 @@ tp_iter odict_iter tp_dictoffset (offset) tp_init odict_init tp_alloc (repeated) -tp_new odict_new ================= ================ ================= ================ @@ -530,15 +525,6 @@ struct _odictnode { #define _odict_FOREACH(od, node) \ for (node = _odict_FIRST(od); node != NULL; node = _odictnode_NEXT(node)) -#define _odict_FAST_SIZE(od) ((PyDictObject *)od)->ma_keys->dk_size - -static void -_odict_free_fast_nodes(PyODictObject *od) { - if (od->od_fast_nodes) { - PyMem_FREE(od->od_fast_nodes); - } -} - /* Return the index into the hash table, regardless of a valid node. */ static Py_ssize_t _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash) @@ -559,7 +545,8 @@ _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash) /* Replace od->od_fast_nodes with a new table matching the size of dict's. */ static int -_odict_resize(PyODictObject *od) { +_odict_resize(PyODictObject *od) +{ Py_ssize_t size, i; _ODictNode **fast_nodes, *node; @@ -585,7 +572,7 @@ _odict_resize(PyODictObject *od) { } /* Replace the old fast nodes table. */ - _odict_free_fast_nodes(od); + PyMem_FREE(od->od_fast_nodes); od->od_fast_nodes = fast_nodes; od->od_fast_nodes_size = size; od->od_resize_sentinel = ((PyDictObject *)od)->ma_keys; @@ -623,6 +610,7 @@ _odict_find_node_hash(PyODictObject *od, PyObject *key, Py_hash_t hash) index = _odict_get_index(od, key, hash); if (index < 0) return NULL; + assert(od->od_fast_nodes != NULL); return od->od_fast_nodes[index]; } @@ -640,6 +628,7 @@ _odict_find_node(PyODictObject *od, PyObject *key) index = _odict_get_index(od, key, hash); if (index < 0) return NULL; + assert(od->od_fast_nodes != NULL); return od->od_fast_nodes[index]; } @@ -684,7 +673,8 @@ _odict_add_new_node(PyODictObject *od, PyObject *key, Py_hash_t hash) Py_DECREF(key); return -1; } - else if (od->od_fast_nodes[i] != NULL) { + assert(od->od_fast_nodes != NULL); + if (od->od_fast_nodes[i] != NULL) { /* We already have a node for the key so there's no need to add one. */ Py_DECREF(key); return 0; @@ -763,6 +753,7 @@ _odict_clear_node(PyODictObject *od, _ODictNode *node, PyObject *key, if (i < 0) return PyErr_Occurred() ? -1 : 0; + assert(od->od_fast_nodes != NULL); if (node == NULL) node = od->od_fast_nodes[i]; assert(node == od->od_fast_nodes[i]); @@ -783,8 +774,10 @@ _odict_clear_nodes(PyODictObject *od) { _ODictNode *node, *next; - _odict_free_fast_nodes(od); + PyMem_FREE(od->od_fast_nodes); od->od_fast_nodes = NULL; + od->od_fast_nodes_size = 0; + od->od_resize_sentinel = NULL; node = _odict_FIRST(od); _odict_FIRST(od) = NULL; @@ -887,7 +880,7 @@ static PyObject * odict_sizeof(PyODictObject *od, PyObject *Py_UNUSED(ignored)) { Py_ssize_t res = _PyDict_SizeOf((PyDictObject *)od); - res += sizeof(_ODictNode *) * _odict_FAST_SIZE(od); /* od_fast_nodes */ + res += sizeof(_ODictNode *) * od->od_fast_nodes_size; /* od_fast_nodes */ if (!_odict_EMPTY(od)) { res += sizeof(_ODictNode) * PyODict_SIZE(od); /* linked-list */ } @@ -1179,8 +1172,6 @@ odict_clear(register PyODictObject *od, PyObject *Py_UNUSED(ignored)) { PyDict_Clear((PyObject *)od); _odict_clear_nodes(od); - if (_odict_resize(od) < 0) - return NULL; Py_RETURN_NONE; } @@ -1484,13 +1475,10 @@ odict_traverse(PyODictObject *od, visitproc visit, void *arg) static int odict_tp_clear(PyODictObject *od) { - PyObject *res; Py_CLEAR(od->od_inst_dict); Py_CLEAR(od->od_weakreflist); - res = odict_clear(od, NULL); - if (res == NULL) - return -1; - Py_DECREF(res); + PyDict_Clear((PyObject *)od); + _odict_clear_nodes(od); return 0; } @@ -1565,27 +1553,6 @@ odict_init(PyObject *self, PyObject *args, PyObject *kwds) } } -/* tp_new */ - -static PyObject * -odict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -{ - PyODictObject *od; - - od = (PyODictObject *)PyDict_Type.tp_new(type, args, kwds); - if (od == NULL) - return NULL; - - /* type constructor fills the memory with zeros (see - PyType_GenericAlloc()), there is no need to set them to zero again */ - if (_odict_resize(od) < 0) { - Py_DECREF(od); - return NULL; - } - - return (PyObject*)od; -} - /* PyODict_Type */ PyTypeObject PyODict_Type = { @@ -1626,7 +1593,7 @@ PyTypeObject PyODict_Type = { offsetof(PyODictObject, od_inst_dict), /* tp_dictoffset */ (initproc)odict_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ - (newfunc)odict_new, /* tp_new */ + 0, /* tp_new */ 0, /* tp_free */ }; @@ -1636,8 +1603,9 @@ PyTypeObject PyODict_Type = { */ PyObject * -PyODict_New(void) { - return odict_new(&PyODict_Type, NULL, NULL); +PyODict_New(void) +{ + return PyDict_Type.tp_new(&PyODict_Type, NULL, NULL); } static int From webhook-mailer at python.org Fri Oct 19 19:31:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:31:20 -0000 Subject: [Python-checkins] bpo-33726, doc: Add short descriptions to PEP references in seealso (GH-7294) Message-ID: https://github.com/python/cpython/commit/0f14fc1a7cb2ea0012d0a943e4460acdee2108d7 commit: 0f14fc1a7cb2ea0012d0a943e4460acdee2108d7 branch: master author: Andr?s Delfino committer: Victor Stinner date: 2018-10-20T01:31:15+02:00 summary: bpo-33726, doc: Add short descriptions to PEP references in seealso (GH-7294) files: M Doc/reference/compound_stmts.rst M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index ddc796adcd77..638e1604c167 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -681,8 +681,14 @@ can be used to create instance variables with different implementation details. .. seealso:: - :pep:`3115` - Metaclasses in Python 3 + :pep:`3115` - Metaclasses in Python 3000 + The proposal that changed the declaration of metaclasses to the current + syntax, and the semantics for how classes with metaclasses are + constructed. + :pep:`3129` - Class Decorators + The proposal that added class decorators. Function and method decorators + were introduced in :pep:`318`. .. _async: @@ -809,6 +815,8 @@ coroutine. .. seealso:: :pep:`492` - Coroutines with async and await syntax + The proposal that made coroutines a proper standalone concept in Python, + and added supporting syntax. .. rubric:: Footnotes diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index bb1eea66f98b..f98721cd6552 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -353,8 +353,15 @@ target, then the interpreter evaluates the target except for the last .. seealso:: - :pep:`526` - Variable and attribute annotation syntax + :pep:`526` - Syntax for Variable Annotations + The proposal that added syntax for annotating the types of variables + (including class variables and instance variables), instead of expressing + them through comments. + :pep:`484` - Type hints + The proposal that added the :mod:`typing` module to provide a standard + syntax for type annotations that can be used in static analysis tools and + IDEs. .. _assert: From webhook-mailer at python.org Fri Oct 19 19:40:50 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 19 Oct 2018 23:40:50 -0000 Subject: [Python-checkins] bpo-33594: Add deprecation info in inspect.py module (GH-7036) Message-ID: https://github.com/python/cpython/commit/ded87d804e2a85b2a3ea9e7a11384b41fafdfa29 commit: ded87d804e2a85b2a3ea9e7a11384b41fafdfa29 branch: master author: Matthias Bussonnier committer: Victor Stinner date: 2018-10-20T01:40:45+02:00 summary: bpo-33594: Add deprecation info in inspect.py module (GH-7036) files: A Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst M Lib/inspect.py diff --git a/Lib/inspect.py b/Lib/inspect.py index 857892bc8144..3edf97d389ea 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1070,8 +1070,10 @@ def getargspec(func): Alternatively, use getfullargspec() for an API with a similar namedtuple based interface, but full support for annotations and keyword-only parameters. + + Deprecated since Python 3.5, use `inspect.getfullargspec()`. """ - warnings.warn("inspect.getargspec() is deprecated, " + warnings.warn("inspect.getargspec() is deprecated since Python 3.0, " "use inspect.signature() or inspect.getfullargspec()", DeprecationWarning, stacklevel=2) args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \ @@ -2797,19 +2799,25 @@ def __init__(self, parameters=None, *, return_annotation=_empty, @classmethod def from_function(cls, func): - """Constructs Signature for the given python function.""" + """Constructs Signature for the given python function. + + Deprecated since Python 3.5, use `Signature.from_callable()`. + """ - warnings.warn("inspect.Signature.from_function() is deprecated, " - "use Signature.from_callable()", + warnings.warn("inspect.Signature.from_function() is deprecated since " + "Python 3.5, use Signature.from_callable()", DeprecationWarning, stacklevel=2) return _signature_from_function(cls, func) @classmethod def from_builtin(cls, func): - """Constructs Signature for the given builtin function.""" + """Constructs Signature for the given builtin function. + + Deprecated since Python 3.5, use `Signature.from_callable()`. + """ - warnings.warn("inspect.Signature.from_builtin() is deprecated, " - "use Signature.from_callable()", + warnings.warn("inspect.Signature.from_builtin() is deprecated since " + "Python 3.5, use Signature.from_callable()", DeprecationWarning, stacklevel=2) return _signature_from_builtin(cls, func) diff --git a/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst b/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst new file mode 100644 index 000000000000..a63c4a5004c6 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst @@ -0,0 +1,3 @@ +Document ``getargspec``, ``from_function`` and ``from_builtin`` as +deprecated in their respective docstring, and include version since +deprecation in DeprecationWarning message. From webhook-mailer at python.org Fri Oct 19 19:43:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 23:43:58 -0000 Subject: [Python-checkins] bpo-33726, doc: Add short descriptions to PEP references in seealso (GH-7294) Message-ID: https://github.com/python/cpython/commit/2a6cf446802079a3ee57147de8273c84d63767e9 commit: 2a6cf446802079a3ee57147de8273c84d63767e9 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T16:43:55-07:00 summary: bpo-33726, doc: Add short descriptions to PEP references in seealso (GH-7294) (cherry picked from commit 0f14fc1a7cb2ea0012d0a943e4460acdee2108d7) Co-authored-by: Andr?s Delfino files: M Doc/reference/compound_stmts.rst M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 2e832c2d22c1..c49efa5889f2 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -680,8 +680,14 @@ can be used to create instance variables with different implementation details. .. seealso:: - :pep:`3115` - Metaclasses in Python 3 + :pep:`3115` - Metaclasses in Python 3000 + The proposal that changed the declaration of metaclasses to the current + syntax, and the semantics for how classes with metaclasses are + constructed. + :pep:`3129` - Class Decorators + The proposal that added class decorators. Function and method decorators + were introduced in :pep:`318`. .. _async: @@ -808,6 +814,8 @@ coroutine. .. seealso:: :pep:`492` - Coroutines with async and await syntax + The proposal that made coroutines a proper standalone concept in Python, + and added supporting syntax. .. rubric:: Footnotes diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 47f7c7bfffb0..9b93601135de 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -353,8 +353,15 @@ target, then the interpreter evaluates the target except for the last .. seealso:: - :pep:`526` - Variable and attribute annotation syntax + :pep:`526` - Syntax for Variable Annotations + The proposal that added syntax for annotating the types of variables + (including class variables and instance variables), instead of expressing + them through comments. + :pep:`484` - Type hints + The proposal that added the :mod:`typing` module to provide a standard + syntax for type annotations that can be used in static analysis tools and + IDEs. .. _assert: From webhook-mailer at python.org Fri Oct 19 19:44:33 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 23:44:33 -0000 Subject: [Python-checkins] bpo-33726, doc: Add short descriptions to PEP references in seealso (GH-7294) Message-ID: https://github.com/python/cpython/commit/70102ff18817dd3db79cf73a1028251bbf2106f2 commit: 70102ff18817dd3db79cf73a1028251bbf2106f2 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T16:44:31-07:00 summary: bpo-33726, doc: Add short descriptions to PEP references in seealso (GH-7294) (cherry picked from commit 0f14fc1a7cb2ea0012d0a943e4460acdee2108d7) Co-authored-by: Andr?s Delfino files: M Doc/reference/compound_stmts.rst M Doc/reference/simple_stmts.rst diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 1f753308e398..bd5cb104a0f5 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -667,8 +667,14 @@ can be used to create instance variables with different implementation details. .. seealso:: - :pep:`3115` - Metaclasses in Python 3 + :pep:`3115` - Metaclasses in Python 3000 + The proposal that changed the declaration of metaclasses to the current + syntax, and the semantics for how classes with metaclasses are + constructed. + :pep:`3129` - Class Decorators + The proposal that added class decorators. Function and method decorators + were introduced in :pep:`318`. Coroutines @@ -793,6 +799,8 @@ It is a :exc:`SyntaxError` to use ``async with`` statement outside of an .. seealso:: :pep:`492` - Coroutines with async and await syntax + The proposal that made coroutines a proper standalone concept in Python, + and added supporting syntax. .. rubric:: Footnotes diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 76630dfc590f..f54e2c9d3f06 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -353,8 +353,15 @@ target, then the interpreter evaluates the target except for the last .. seealso:: - :pep:`526` - Variable and attribute annotation syntax + :pep:`526` - Syntax for Variable Annotations + The proposal that added syntax for annotating the types of variables + (including class variables and instance variables), instead of expressing + them through comments. + :pep:`484` - Type hints + The proposal that added the :mod:`typing` module to provide a standard + syntax for type annotations that can be used in static analysis tools and + IDEs. .. _assert: From webhook-mailer at python.org Fri Oct 19 19:49:33 2018 From: webhook-mailer at python.org (Ethan Furman) Date: Fri, 19 Oct 2018 23:49:33 -0000 Subject: [Python-checkins] bpo-34536: raise error for invalid _missing_ results (GH-9147) (GH-9978) Message-ID: https://github.com/python/cpython/commit/0f2fc8bee0b435ee2934751264196db30d16ed8a commit: 0f2fc8bee0b435ee2934751264196db30d16ed8a branch: 3.7 author: Victor Stinner committer: Ethan Furman date: 2018-10-19T16:49:30-07:00 summary: bpo-34536: raise error for invalid _missing_ results (GH-9147) (GH-9978) * raise exception if _missing_ returns None or invalid type files: A Misc/NEWS.d/next/Library/2018-09-11-15-49-09.bpo-34536.3IPIH5.rst M Lib/enum.py M Lib/test/test_enum.py diff --git a/Lib/enum.py b/Lib/enum.py index 87f36911144a..e5a80cd609d4 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -540,7 +540,25 @@ def __new__(cls, value): if member._value_ == value: return member # still not found -- try _missing_ hook - return cls._missing_(value) + try: + exc = None + result = cls._missing_(value) + except Exception as e: + exc = e + result = None + if isinstance(result, cls): + return result + else: + ve_exc = ValueError("%r is not a valid %s" % (value, cls.__name__)) + if result is None and exc is None: + raise ve_exc + elif exc is None: + exc = TypeError( + 'error in %s._missing_: returned %r instead of None or a valid member' + % (cls.__name__, result) + ) + exc.__context__ = ve_exc + raise exc def _generate_next_value_(name, start, count, last_values): for last_value in reversed(last_values): diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 60eabbe3d487..b221045328db 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1717,6 +1717,38 @@ class Dupes(Enum): third = auto() self.assertEqual([Dupes.first, Dupes.second, Dupes.third], list(Dupes)) + def test_missing(self): + class Color(Enum): + red = 1 + green = 2 + blue = 3 + @classmethod + def _missing_(cls, item): + if item == 'three': + return cls.blue + elif item == 'bad return': + # trigger internal error + return 5 + elif item == 'error out': + raise ZeroDivisionError + else: + # trigger not found + return None + self.assertIs(Color('three'), Color.blue) + self.assertRaises(ValueError, Color, 7) + try: + Color('bad return') + except TypeError as exc: + self.assertTrue(isinstance(exc.__context__, ValueError)) + else: + raise Exception('Exception not raised.') + try: + Color('error out') + except ZeroDivisionError as exc: + self.assertTrue(isinstance(exc.__context__, ValueError)) + else: + raise Exception('Exception not raised.') + def test_multiple_mixin(self): class MaxMixin: @classproperty diff --git a/Misc/NEWS.d/next/Library/2018-09-11-15-49-09.bpo-34536.3IPIH5.rst b/Misc/NEWS.d/next/Library/2018-09-11-15-49-09.bpo-34536.3IPIH5.rst new file mode 100644 index 000000000000..be45eb57cad5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-11-15-49-09.bpo-34536.3IPIH5.rst @@ -0,0 +1,2 @@ +`Enum._missing_`: raise `ValueError` if None returned and `TypeError` if +non-member is returned. From webhook-mailer at python.org Fri Oct 19 19:57:22 2018 From: webhook-mailer at python.org (Ethan Furman) Date: Fri, 19 Oct 2018 23:57:22 -0000 Subject: [Python-checkins] bpo-34536: Cleanup test_enum imports (GH-9979) Message-ID: https://github.com/python/cpython/commit/4acf6c9d4be77b968fa498569d7a1545e5e77344 commit: 4acf6c9d4be77b968fa498569d7a1545e5e77344 branch: master author: Victor Stinner committer: Ethan Furman date: 2018-10-19T16:57:19-07:00 summary: bpo-34536: Cleanup test_enum imports (GH-9979) sys and threading were imported twice. files: M Lib/test/test_enum.py diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 216f7d5c2830..572e8733f45b 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -3,7 +3,6 @@ import pydoc import sys import unittest -import sys import threading from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto @@ -12,10 +11,6 @@ from test import support from datetime import timedelta -try: - import threading -except ImportError: - threading = None # for pickle tests try: From webhook-mailer at python.org Fri Oct 19 19:59:55 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 19 Oct 2018 23:59:55 -0000 Subject: [Python-checkins] bpo-33594: Add deprecation info in inspect.py module (GH-7036) Message-ID: https://github.com/python/cpython/commit/932ebc1e0ef9b0d5cd17370f5183bad0257d36f9 commit: 932ebc1e0ef9b0d5cd17370f5183bad0257d36f9 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T16:59:52-07:00 summary: bpo-33594: Add deprecation info in inspect.py module (GH-7036) (cherry picked from commit ded87d804e2a85b2a3ea9e7a11384b41fafdfa29) Co-authored-by: Matthias Bussonnier files: A Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst M Lib/inspect.py diff --git a/Lib/inspect.py b/Lib/inspect.py index dd3b784a607e..fbd86193e772 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1070,8 +1070,10 @@ def getargspec(func): Alternatively, use getfullargspec() for an API with a similar namedtuple based interface, but full support for annotations and keyword-only parameters. + + Deprecated since Python 3.5, use `inspect.getfullargspec()`. """ - warnings.warn("inspect.getargspec() is deprecated, " + warnings.warn("inspect.getargspec() is deprecated since Python 3.0, " "use inspect.signature() or inspect.getfullargspec()", DeprecationWarning, stacklevel=2) args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \ @@ -2784,19 +2786,25 @@ def __init__(self, parameters=None, *, return_annotation=_empty, @classmethod def from_function(cls, func): - """Constructs Signature for the given python function.""" + """Constructs Signature for the given python function. + + Deprecated since Python 3.5, use `Signature.from_callable()`. + """ - warnings.warn("inspect.Signature.from_function() is deprecated, " - "use Signature.from_callable()", + warnings.warn("inspect.Signature.from_function() is deprecated since " + "Python 3.5, use Signature.from_callable()", DeprecationWarning, stacklevel=2) return _signature_from_function(cls, func) @classmethod def from_builtin(cls, func): - """Constructs Signature for the given builtin function.""" + """Constructs Signature for the given builtin function. + + Deprecated since Python 3.5, use `Signature.from_callable()`. + """ - warnings.warn("inspect.Signature.from_builtin() is deprecated, " - "use Signature.from_callable()", + warnings.warn("inspect.Signature.from_builtin() is deprecated since " + "Python 3.5, use Signature.from_callable()", DeprecationWarning, stacklevel=2) return _signature_from_builtin(cls, func) diff --git a/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst b/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst new file mode 100644 index 000000000000..a63c4a5004c6 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst @@ -0,0 +1,3 @@ +Document ``getargspec``, ``from_function`` and ``from_builtin`` as +deprecated in their respective docstring, and include version since +deprecation in DeprecationWarning message. From webhook-mailer at python.org Fri Oct 19 20:05:56 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:05:56 -0000 Subject: [Python-checkins] bpo-33594: Add deprecation info in inspect.py module (GH-7036) Message-ID: https://github.com/python/cpython/commit/c8348fb6d2ef1b5bb91d6eb5fbafdf42c4ae16ce commit: c8348fb6d2ef1b5bb91d6eb5fbafdf42c4ae16ce branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:05:49-07:00 summary: bpo-33594: Add deprecation info in inspect.py module (GH-7036) (cherry picked from commit ded87d804e2a85b2a3ea9e7a11384b41fafdfa29) Co-authored-by: Matthias Bussonnier files: A Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst M Lib/inspect.py diff --git a/Lib/inspect.py b/Lib/inspect.py index b5d583ccfd1b..da4a424151f1 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1070,8 +1070,10 @@ def getargspec(func): Alternatively, use getfullargspec() for an API with a similar namedtuple based interface, but full support for annotations and keyword-only parameters. + + Deprecated since Python 3.5, use `inspect.getfullargspec()`. """ - warnings.warn("inspect.getargspec() is deprecated, " + warnings.warn("inspect.getargspec() is deprecated since Python 3.0, " "use inspect.signature() or inspect.getfullargspec()", DeprecationWarning, stacklevel=2) args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \ @@ -2802,19 +2804,25 @@ def __init__(self, parameters=None, *, return_annotation=_empty, @classmethod def from_function(cls, func): - """Constructs Signature for the given python function.""" + """Constructs Signature for the given python function. + + Deprecated since Python 3.5, use `Signature.from_callable()`. + """ - warnings.warn("inspect.Signature.from_function() is deprecated, " - "use Signature.from_callable()", + warnings.warn("inspect.Signature.from_function() is deprecated since " + "Python 3.5, use Signature.from_callable()", DeprecationWarning, stacklevel=2) return _signature_from_function(cls, func) @classmethod def from_builtin(cls, func): - """Constructs Signature for the given builtin function.""" + """Constructs Signature for the given builtin function. + + Deprecated since Python 3.5, use `Signature.from_callable()`. + """ - warnings.warn("inspect.Signature.from_builtin() is deprecated, " - "use Signature.from_callable()", + warnings.warn("inspect.Signature.from_builtin() is deprecated since " + "Python 3.5, use Signature.from_callable()", DeprecationWarning, stacklevel=2) return _signature_from_builtin(cls, func) diff --git a/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst b/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst new file mode 100644 index 000000000000..a63c4a5004c6 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-05-21-14-36-12.bpo-33594.-HRcyX.rst @@ -0,0 +1,3 @@ +Document ``getargspec``, ``from_function`` and ``from_builtin`` as +deprecated in their respective docstring, and include version since +deprecation in DeprecationWarning message. From webhook-mailer at python.org Fri Oct 19 20:22:34 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 20 Oct 2018 00:22:34 -0000 Subject: [Python-checkins] bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842) Message-ID: https://github.com/python/cpython/commit/a2670565d8f5c502388378aba1fe73023fd8c8d4 commit: a2670565d8f5c502388378aba1fe73023fd8c8d4 branch: master author: Alexey Izbyshev committer: Victor Stinner date: 2018-10-20T02:22:31+02:00 summary: bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842) If buffering=1 is specified for open() in binary mode, it is silently treated as buffering=-1 (i.e., the default buffer size). Coupled with the fact that line buffering is always supported in Python 2, such behavior caused several issues (e.g., bpo-10344, bpo-21332). Warn that line buffering is not supported if open() is called with binary mode and buffering=1. files: A Misc/NEWS.d/next/Core and Builtins/2018-09-11-23-50-40.bpo-32236.3RupnN.rst M Doc/library/codecs.rst M Lib/_pyio.py M Lib/codecs.py M Lib/subprocess.py M Lib/test/support/__init__.py M Lib/test/test_cmd_line_script.py M Lib/test/test_file.py M Lib/test/test_io.py M Lib/test/test_subprocess.py M Modules/_io/_iomodule.c diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index b9c04c241a8b..b323ab527d26 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -174,7 +174,7 @@ recommended approach for working with encoded text files, this module provides additional utility functions and classes that allow the use of a wider range of codecs when working with binary files: -.. function:: open(filename, mode='r', encoding=None, errors='strict', buffering=1) +.. function:: open(filename, mode='r', encoding=None, errors='strict', buffering=-1) Open an encoded file using the given *mode* and return an instance of :class:`StreamReaderWriter`, providing transparent encoding/decoding. @@ -194,8 +194,8 @@ wider range of codecs when working with binary files: *errors* may be given to define the error handling. It defaults to ``'strict'`` which causes a :exc:`ValueError` to be raised in case an encoding error occurs. - *buffering* has the same meaning as for the built-in :func:`open` function. It - defaults to line buffered. + *buffering* has the same meaning as for the built-in :func:`open` function. + It defaults to -1 which means that the default buffer size will be used. .. function:: EncodedFile(file, data_encoding, file_encoding=None, errors='strict') diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 01ef5b7b0bb5..b8975ff533d7 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -198,6 +198,11 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None, raise ValueError("binary mode doesn't take an errors argument") if binary and newline is not None: raise ValueError("binary mode doesn't take a newline argument") + if binary and buffering == 1: + import warnings + warnings.warn("line buffering (buffering=1) isn't supported in binary " + "mode, the default buffer size will be used", + RuntimeWarning, 2) raw = FileIO(file, (creating and "x" or "") + (reading and "r" or "") + diff --git a/Lib/codecs.py b/Lib/codecs.py index a70ed20f2bc7..6b028adb1d28 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -862,7 +862,7 @@ def __exit__(self, type, value, tb): ### Shortcuts -def open(filename, mode='r', encoding=None, errors='strict', buffering=1): +def open(filename, mode='r', encoding=None, errors='strict', buffering=-1): """ Open an encoded file using the given mode and return a wrapped version providing transparent encoding/decoding. @@ -883,7 +883,8 @@ def open(filename, mode='r', encoding=None, errors='strict', buffering=1): encoding error occurs. buffering has the same meaning as for the builtin open() API. - It defaults to line buffered. + It defaults to -1 which means that the default buffer size will + be used. The returned wrapped file object provides an extra attribute .encoding which allows querying the used encoding. This diff --git a/Lib/subprocess.py b/Lib/subprocess.py index c827113a933f..5db6f0cc24ba 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -743,12 +743,21 @@ def __init__(self, args, bufsize=-1, executable=None, self._closed_child_pipe_fds = False + if self.text_mode: + if bufsize == 1: + line_buffering = True + # Use the default buffer size for the underlying binary streams + # since they don't support line buffering. + bufsize = -1 + else: + line_buffering = False + try: if p2cwrite != -1: self.stdin = io.open(p2cwrite, 'wb', bufsize) if self.text_mode: self.stdin = io.TextIOWrapper(self.stdin, write_through=True, - line_buffering=(bufsize == 1), + line_buffering=line_buffering, encoding=encoding, errors=errors) if c2pread != -1: self.stdout = io.open(c2pread, 'rb', bufsize) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index ed0d46de6426..01e8935cc8d7 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -107,7 +107,8 @@ # threads "threading_setup", "threading_cleanup", "reap_threads", "start_threads", # miscellaneous - "check_warnings", "check_no_resource_warning", "EnvironmentVarGuard", + "check_warnings", "check_no_resource_warning", "check_no_warnings", + "EnvironmentVarGuard", "run_with_locale", "swap_item", "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict", "run_with_tz", "PGO", "missing_compiler_executable", "fd_count", @@ -1252,6 +1253,30 @@ def check_warnings(*filters, **kwargs): return _filterwarnings(filters, quiet) + at contextlib.contextmanager +def check_no_warnings(testcase, message='', category=Warning, force_gc=False): + """Context manager to check that no warnings are emitted. + + This context manager enables a given warning within its scope + and checks that no warnings are emitted even with that warning + enabled. + + If force_gc is True, a garbage collection is attempted before checking + for warnings. This may help to catch warnings emitted when objects + are deleted, such as ResourceWarning. + + Other keyword arguments are passed to warnings.filterwarnings(). + """ + with warnings.catch_warnings(record=True) as warns: + warnings.filterwarnings('always', + message=message, + category=category) + yield + if force_gc: + gc_collect() + testcase.assertEqual(warns, []) + + @contextlib.contextmanager def check_no_resource_warning(testcase): """Context manager to check that no ResourceWarning is emitted. @@ -1266,11 +1291,8 @@ def check_no_resource_warning(testcase): You must remove the object which may emit ResourceWarning before the end of the context manager. """ - with warnings.catch_warnings(record=True) as warns: - warnings.filterwarnings('always', category=ResourceWarning) + with check_no_warnings(testcase, category=ResourceWarning, force_gc=True): yield - gc_collect() - testcase.assertEqual(warns, []) class CleanImport(object): diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 5ec9bbbb1230..bc812eac3742 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -169,10 +169,10 @@ def test_stdin_loader(self): @contextlib.contextmanager def interactive_python(self, separate_stderr=False): if separate_stderr: - p = spawn_python('-i', bufsize=1, stderr=subprocess.PIPE) + p = spawn_python('-i', stderr=subprocess.PIPE) stderr = p.stderr else: - p = spawn_python('-i', bufsize=1, stderr=subprocess.STDOUT) + p = spawn_python('-i', stderr=subprocess.STDOUT) stderr = p.stdout try: # Drain stderr until prompt diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index f58d1dae6045..cd642e7aaf8b 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -169,22 +169,33 @@ def testBadModeArgument(self): f.close() self.fail("no error for invalid mode: %s" % bad_mode) + def _checkBufferSize(self, s): + try: + f = self.open(TESTFN, 'wb', s) + f.write(str(s).encode("ascii")) + f.close() + f.close() + f = self.open(TESTFN, 'rb', s) + d = int(f.read().decode("ascii")) + f.close() + f.close() + except OSError as msg: + self.fail('error setting buffer size %d: %s' % (s, str(msg))) + self.assertEqual(d, s) + def testSetBufferSize(self): # make sure that explicitly setting the buffer size doesn't cause # misbehaviour especially with repeated close() calls - for s in (-1, 0, 1, 512): - try: - f = self.open(TESTFN, 'wb', s) - f.write(str(s).encode("ascii")) - f.close() - f.close() - f = self.open(TESTFN, 'rb', s) - d = int(f.read().decode("ascii")) - f.close() - f.close() - except OSError as msg: - self.fail('error setting buffer size %d: %s' % (s, str(msg))) - self.assertEqual(d, s) + for s in (-1, 0, 512): + with support.check_no_warnings(self, + message='line buffering', + category=RuntimeWarning): + self._checkBufferSize(s) + + # test that attempts to use line buffering in binary mode cause + # a warning + with self.assertWarnsRegex(RuntimeWarning, 'line buffering'): + self._checkBufferSize(1) def testTruncateOnWindows(self): # SF bug diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index c68b2fea858b..abd55387bdbf 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -593,7 +593,7 @@ def test_large_file_ops(self): self.large_file_ops(f) def test_with_open(self): - for bufsize in (0, 1, 100): + for bufsize in (0, 100): f = None with self.open(support.TESTFN, "wb", bufsize) as f: f.write(b"xxx") diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index c56e1b632150..b0b6b06e9275 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1136,7 +1136,8 @@ def test_bufsize_equal_one_binary_mode(self): # line is not flushed in binary mode with bufsize=1. # we should get empty response line = b'line' + os.linesep.encode() # assume ascii-based locale - self._test_bufsize_equal_one(line, b'', universal_newlines=False) + with self.assertWarnsRegex(RuntimeWarning, 'line buffering'): + self._test_bufsize_equal_one(line, b'', universal_newlines=False) def test_leaking_fds_on_error(self): # see bug #5179: Popen leaks file descriptors to PIPEs if diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-11-23-50-40.bpo-32236.3RupnN.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-11-23-50-40.bpo-32236.3RupnN.rst new file mode 100644 index 000000000000..6fc138708c4d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-11-23-50-40.bpo-32236.3RupnN.rst @@ -0,0 +1,2 @@ +Warn that line buffering is not supported if :func:`open` is called with +binary mode and ``buffering=1``. diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index eedca011d2ed..965c4846bdb8 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -363,6 +363,15 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, goto error; } + if (binary && buffering == 1) { + if (PyErr_WarnEx(PyExc_RuntimeWarning, + "line buffering (buffering=1) isn't supported in " + "binary mode, the default buffer size will be used", + 1) < 0) { + goto error; + } + } + /* Create the Raw file stream */ { PyObject *RawIO_class = (PyObject *)&PyFileIO_Type; From webhook-mailer at python.org Fri Oct 19 20:28:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 20 Oct 2018 00:28:25 -0000 Subject: [Python-checkins] bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784) Message-ID: https://github.com/python/cpython/commit/834603112e6ca35944dd21105b01fca562dc3241 commit: 834603112e6ca35944dd21105b01fca562dc3241 branch: master author: Alexey Izbyshev committer: Victor Stinner date: 2018-10-20T02:28:22+02:00 summary: bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784) path_error() uses GetLastError() on Windows, but some os functions are implemented via CRT APIs which report errors via errno. This may result in raising OSError with invalid error code (such as zero). Introduce posix_path_error() function and use it where appropriate. files: A Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.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 6dbc25561237..3f6e48f0c8e6 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1589,6 +1589,16 @@ def test_execve_invalid_env(self): with self.assertRaises(ValueError): os.execve(args[0], args, newenv) + @unittest.skipUnless(sys.platform == "win32", "Win32-specific test") + def test_execve_with_empty_path(self): + # bpo-32890: Check GetLastError() misuse + try: + os.execve('', ['arg'], {}) + except OSError as e: + self.assertTrue(e.winerror is None or e.winerror != 0) + else: + self.fail('No OSError raised') + @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") class Win32ErrorTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst b/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst new file mode 100644 index 000000000000..e8a63b334192 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst @@ -0,0 +1,2 @@ +Fix usage of GetLastError() instead of errno in os.execve() and +os.truncate(). diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 23552bea4cae..9ccdc8eff1bd 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1455,6 +1455,12 @@ win32_error_object(const char* function, PyObject* filename) #endif /* MS_WINDOWS */ +static PyObject * +posix_path_object_error(PyObject *path) +{ + return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); +} + static PyObject * path_object_error(PyObject *path) { @@ -1462,7 +1468,7 @@ path_object_error(PyObject *path) return PyErr_SetExcFromWindowsErrWithFilenameObject( PyExc_OSError, 0, path); #else - return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); + return posix_path_object_error(path); #endif } @@ -1483,6 +1489,12 @@ path_error(path_t *path) return path_object_error(path->object); } +static PyObject * +posix_path_error(path_t *path) +{ + return posix_path_object_error(path->object); +} + static PyObject * path_error2(path_t *path, path_t *path2) { @@ -5141,7 +5153,7 @@ os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env) /* If we get here it's definitely an error */ - path_error(path); + posix_path_error(path); free_string_array(envlist, envc); fail: @@ -9477,7 +9489,7 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length) _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS if (result < 0) - return path_error(path); + return posix_path_error(path); Py_RETURN_NONE; } From webhook-mailer at python.org Fri Oct 19 20:33:51 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 20 Oct 2018 00:33:51 -0000 Subject: [Python-checkins] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Message-ID: https://github.com/python/cpython/commit/13ae4d44381a647aadd09b70b24833052659be41 commit: 13ae4d44381a647aadd09b70b24833052659be41 branch: master author: Berker Peksag committer: Victor Stinner date: 2018-10-20T02:33:48+02:00 summary: bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Initial patch by Chandan Kumar. files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 83b7db7c7cff..7d3b823a14e0 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -703,6 +703,11 @@ breaking intraclass method calls. For example:: for item in zip(keys, values): self.items_list.append(item) +The above example would work even if ``MappingSubclass`` were to introduce a +``__update`` identifier since it is replaced with ``_Mapping__update`` in the +``Mapping`` class and ``_MappingSubclass__update`` in the ``MappingSubclass`` +class respectively. + Note that the mangling rules are designed mostly to avoid accidents; it still is possible to access or modify a variable that is considered private. This can even be useful in special circumstances, such as in the debugger. From webhook-mailer at python.org Fri Oct 19 20:37:59 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 20 Oct 2018 00:37:59 -0000 Subject: [Python-checkins] bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (#5621) Message-ID: https://github.com/python/cpython/commit/027664a3d5ebad575aafe5fcc572e3b05f7f24e5 commit: 027664a3d5ebad575aafe5fcc572e3b05f7f24e5 branch: master author: Pablo Galindo committer: Victor Stinner date: 2018-10-20T02:37:55+02:00 summary: bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (#5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. files: M Doc/library/mmap.rst diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index c8ae7a68d37a..0f895d76b83f 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -65,7 +65,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`. .. class:: mmap(fileno, length, flags=MAP_SHARED, prot=PROT_WRITE|PROT_READ, access=ACCESS_DEFAULT[, offset]) @@ -94,8 +94,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the PAGESIZE or - ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY` + which is equal to :const:`PAGESIZE` on Unix systems. To ensure validity of the created memory mapping the file specified by the descriptor *fileno* is internally automatically synchronized @@ -189,7 +189,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length use of this call there is no guarantee that changes are written back before the object is destroyed. If *offset* and *size* are specified, only changes to the given range of bytes will be flushed to disk; otherwise, the - whole extent of the mapping is flushed. + whole extent of the mapping is flushed. *offset* must be a multiple of the + :const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`. ``None`` is returned to indicate success. An exception is raised when the call failed. From webhook-mailer at python.org Fri Oct 19 20:42:00 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:42:00 -0000 Subject: [Python-checkins] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Message-ID: https://github.com/python/cpython/commit/3e5bcd12f661bdf363c025b52a3d515829e64ed2 commit: 3e5bcd12f661bdf363c025b52a3d515829e64ed2 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:41:56-07:00 summary: bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Initial patch by Chandan Kumar. (cherry picked from commit 13ae4d44381a647aadd09b70b24833052659be41) Co-authored-by: Berker Peksag files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f26838cddbfa..487d535e169b 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -703,6 +703,11 @@ breaking intraclass method calls. For example:: for item in zip(keys, values): self.items_list.append(item) +The above example would work even if ``MappingSubclass`` were to introduce a +``__update`` identifier since it is replaced with ``_Mapping__update`` in the +``Mapping`` class and ``_MappingSubclass__update`` in the ``MappingSubclass`` +class respectively. + Note that the mangling rules are designed mostly to avoid accidents; it still is possible to access or modify a variable that is considered private. This can even be useful in special circumstances, such as in the debugger. From webhook-mailer at python.org Fri Oct 19 20:43:37 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Sat, 20 Oct 2018 00:43:37 -0000 Subject: [Python-checkins] bpo-34573: Simplify __reduce__() of set and dict iterators. (GH-9050) Message-ID: https://github.com/python/cpython/commit/6395844e6adebc12c4eba1fb75c5e7c9c8b89f85 commit: 6395844e6adebc12c4eba1fb75c5e7c9c8b89f85 branch: master author: Sergey Fedoseev committer: Pablo Galindo date: 2018-10-20T01:43:33+01:00 summary: bpo-34573: Simplify __reduce__() of set and dict iterators. (GH-9050) Simplify the pickling of set and dictionary objects iterators by consuming the iterator into a list with PySequence_List. files: M Objects/dictobject.c M Objects/setobject.c diff --git a/Objects/dictobject.c b/Objects/dictobject.c index fec69678c500..370895d6bcc8 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -3663,44 +3663,14 @@ PyTypeObject PyDictIterItem_Type = { static PyObject * dictiter_reduce(dictiterobject *di, PyObject *Py_UNUSED(ignored)) { - PyObject *list; - dictiterobject tmp; - - list = PyList_New(0); - if (!list) - return NULL; - - /* copy the itertor state */ - tmp = *di; + /* copy the iterator state */ + dictiterobject tmp = *di; Py_XINCREF(tmp.di_dict); /* iterate the temporary into a list */ - for(;;) { - PyObject *element = 0; - if (Py_TYPE(di) == &PyDictIterItem_Type) - element = dictiter_iternextitem(&tmp); - else if (Py_TYPE(di) == &PyDictIterKey_Type) - element = dictiter_iternextkey(&tmp); - else if (Py_TYPE(di) == &PyDictIterValue_Type) - element = dictiter_iternextvalue(&tmp); - else - Py_UNREACHABLE(); - if (element) { - if (PyList_Append(list, element)) { - Py_DECREF(element); - Py_DECREF(list); - Py_XDECREF(tmp.di_dict); - return NULL; - } - Py_DECREF(element); - } else - break; - } + PyObject *list = PySequence_List((PyObject*)&tmp); Py_XDECREF(tmp.di_dict); - /* check for error */ - if (tmp.di_dict != NULL) { - /* we have an error */ - Py_DECREF(list); + if (list == NULL) { return NULL; } return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), list); diff --git a/Objects/setobject.c b/Objects/setobject.c index e7a528888ef0..aa1f4eedbfd4 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -843,36 +843,14 @@ static PyObject *setiter_iternext(setiterobject *si); static PyObject * setiter_reduce(setiterobject *si, PyObject *Py_UNUSED(ignored)) { - PyObject *list; - setiterobject tmp; - - list = PyList_New(0); - if (!list) - return NULL; - /* copy the iterator state */ - tmp = *si; + setiterobject tmp = *si; Py_XINCREF(tmp.si_set); /* iterate the temporary into a list */ - for(;;) { - PyObject *element = setiter_iternext(&tmp); - if (element) { - if (PyList_Append(list, element)) { - Py_DECREF(element); - Py_DECREF(list); - Py_XDECREF(tmp.si_set); - return NULL; - } - Py_DECREF(element); - } else - break; - } + PyObject *list = PySequence_List((PyObject*)&tmp); Py_XDECREF(tmp.si_set); - /* check for error */ - if (tmp.si_set != NULL) { - /* we have an error */ - Py_DECREF(list); + if (list == NULL) { return NULL; } return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), list); From webhook-mailer at python.org Fri Oct 19 20:43:39 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:43:39 -0000 Subject: [Python-checkins] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Message-ID: https://github.com/python/cpython/commit/efc09a9701543f7180fc7ea0b6c45cf198c29cb8 commit: efc09a9701543f7180fc7ea0b6c45cf198c29cb8 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:43:35-07:00 summary: bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Initial patch by Chandan Kumar. (cherry picked from commit 13ae4d44381a647aadd09b70b24833052659be41) Co-authored-by: Berker Peksag files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f26838cddbfa..487d535e169b 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -703,6 +703,11 @@ breaking intraclass method calls. For example:: for item in zip(keys, values): self.items_list.append(item) +The above example would work even if ``MappingSubclass`` were to introduce a +``__update`` identifier since it is replaced with ``_Mapping__update`` in the +``Mapping`` class and ``_MappingSubclass__update`` in the ``MappingSubclass`` +class respectively. + Note that the mangling rules are designed mostly to avoid accidents; it still is possible to access or modify a variable that is considered private. This can even be useful in special circumstances, such as in the debugger. From webhook-mailer at python.org Fri Oct 19 20:45:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:45:10 -0000 Subject: [Python-checkins] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Message-ID: https://github.com/python/cpython/commit/b0f7fa1dda61ae7519deed816993ac5d55870958 commit: b0f7fa1dda61ae7519deed816993ac5d55870958 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:45:06-07:00 summary: bpo-21196: Clarify name mangling rules in tutorial (GH-5667) Initial patch by Chandan Kumar. (cherry picked from commit 13ae4d44381a647aadd09b70b24833052659be41) Co-authored-by: Berker Peksag files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 1058b77dd59e..9935ccb92725 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -651,6 +651,11 @@ breaking intraclass method calls. For example:: for item in zip(keys, values): self.items_list.append(item) +The above example would work even if ``MappingSubclass`` were to introduce a +``__update`` identifier since it is replaced with ``_Mapping__update`` in the +``Mapping`` class and ``_MappingSubclass__update`` in the ``MappingSubclass`` +class respectively. + Note that the mangling rules are designed mostly to avoid accidents; it still is possible to access or modify a variable that is considered private. This can even be useful in special circumstances, such as in the debugger. From webhook-mailer at python.org Fri Oct 19 20:46:03 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Sat, 20 Oct 2018 00:46:03 -0000 Subject: [Python-checkins] bpo-34983: Expose symtable.Symbol.is_nonlocal() in the symtable module (GH-9872) Message-ID: https://github.com/python/cpython/commit/d5b4f1b5a064c0d858352100fcddb91c363afa51 commit: d5b4f1b5a064c0d858352100fcddb91c363afa51 branch: master author: Pablo Galindo committer: GitHub date: 2018-10-20T01:46:00+01:00 summary: bpo-34983: Expose symtable.Symbol.is_nonlocal() in the symtable module (GH-9872) The symbol table was not exposing functionality to query the nonlocal symbols in a function or to check if a particular symbol is nonlocal. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-14-17-26-41.bpo-34983.l8XaZd.rst M Doc/library/symtable.rst M Lib/symtable.py M Lib/test/test_symtable.py M Modules/symtablemodule.c diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index ba2caff58945..7c6ac4dccf8b 100644 --- a/Doc/library/symtable.rst +++ b/Doc/library/symtable.rst @@ -105,6 +105,10 @@ Examining Symbol Tables Return a tuple containing names of globals in this function. + .. method:: get_nonlocals() + + Return a tuple containing names of nonlocals in this function. + .. method:: get_frees() Return a tuple containing names of free variables in this function. @@ -144,6 +148,10 @@ Examining Symbol Tables Return ``True`` if the symbol is global. + .. method:: is_nonlocal() + + Return ``True`` if the symbol is nonlocal. + .. method:: is_declared_global() Return ``True`` if the symbol is declared global with a global statement. diff --git a/Lib/symtable.py b/Lib/symtable.py index c7627a6ef688..5bea7cf61554 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -1,7 +1,7 @@ """Interface to the compiler's internal symbol tables""" import _symtable -from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, +from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE, LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL) @@ -117,6 +117,7 @@ class Function(SymbolTable): __locals = None __frees = None __globals = None + __nonlocals = None def __idents_matching(self, test_func): return tuple(ident for ident in self.get_identifiers() @@ -141,6 +142,11 @@ def get_globals(self): self.__globals = self.__idents_matching(test) return self.__globals + def get_nonlocals(self): + if self.__nonlocals is None: + self.__nonlocals = self.__idents_matching(lambda x:x & DEF_NONLOCAL) + return self.__nonlocals + def get_frees(self): if self.__frees is None: is_free = lambda x:((x >> SCOPE_OFF) & SCOPE_MASK) == FREE @@ -184,6 +190,9 @@ def is_parameter(self): def is_global(self): return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)) + def is_nonlocal(self): + return bool(self.__flags & DEF_NONLOCAL) + def is_declared_global(self): return bool(self.__scope == GLOBAL_EXPLICIT) diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index 8d76f6fe45f9..0a1cb8d5b432 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -10,6 +10,7 @@ import sys glob = 42 +some_var = 12 class Mine: instance_var = 24 @@ -19,10 +20,15 @@ def a_method(p1, p2): def spam(a, b, *var, **kw): global bar bar = 47 + some_var = 10 x = 23 glob def internal(): return x + def other_internal(): + nonlocal some_var + some_var = 3 + return some_var return internal def foo(): @@ -47,6 +53,7 @@ class SymtableTest(unittest.TestCase): a_method = find_block(Mine, "a_method") spam = find_block(top, "spam") internal = find_block(spam, "internal") + other_internal = find_block(spam, "other_internal") foo = find_block(top, "foo") def test_type(self): @@ -75,12 +82,12 @@ def test_children(self): def test_lineno(self): self.assertEqual(self.top.get_lineno(), 0) - self.assertEqual(self.spam.get_lineno(), 11) + self.assertEqual(self.spam.get_lineno(), 12) def test_function_info(self): func = self.spam self.assertEqual(sorted(func.get_parameters()), ["a", "b", "kw", "var"]) - expected = ["a", "b", "internal", "kw", "var", "x"] + expected = ['a', 'b', 'internal', 'kw', 'other_internal', 'some_var', 'var', 'x'] self.assertEqual(sorted(func.get_locals()), expected) self.assertEqual(sorted(func.get_globals()), ["bar", "glob"]) self.assertEqual(self.internal.get_frees(), ("x",)) @@ -93,6 +100,12 @@ def test_globals(self): self.assertFalse(self.internal.lookup("x").is_global()) self.assertFalse(self.Mine.lookup("instance_var").is_global()) + def test_nonlocal(self): + self.assertFalse(self.spam.lookup("some_var").is_nonlocal()) + self.assertTrue(self.other_internal.lookup("some_var").is_nonlocal()) + expected = ("some_var",) + self.assertEqual(self.other_internal.get_nonlocals(), expected) + def test_local(self): self.assertTrue(self.spam.lookup("x").is_local()) self.assertFalse(self.internal.lookup("x").is_local()) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-14-17-26-41.bpo-34983.l8XaZd.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-14-17-26-41.bpo-34983.l8XaZd.rst new file mode 100644 index 000000000000..dd76b63db119 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-14-17-26-41.bpo-34983.l8XaZd.rst @@ -0,0 +1,2 @@ +Expose :meth:`symtable.Symbol.is_nonlocal` in the symtable module. Patch by +Pablo Galindo. diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index 810f88da488e..e8d2f5b582be 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -84,6 +84,7 @@ PyInit__symtable(void) return NULL; PyModule_AddIntMacro(m, USE); PyModule_AddIntMacro(m, DEF_GLOBAL); + PyModule_AddIntMacro(m, DEF_NONLOCAL); PyModule_AddIntMacro(m, DEF_LOCAL); PyModule_AddIntMacro(m, DEF_PARAM); PyModule_AddIntMacro(m, DEF_FREE); From webhook-mailer at python.org Fri Oct 19 20:46:29 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:46:29 -0000 Subject: [Python-checkins] bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784) Message-ID: https://github.com/python/cpython/commit/8f53dcdb246a3acb0e64b742c35b5f785bd19092 commit: 8f53dcdb246a3acb0e64b742c35b5f785bd19092 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:46:25-07:00 summary: bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784) path_error() uses GetLastError() on Windows, but some os functions are implemented via CRT APIs which report errors via errno. This may result in raising OSError with invalid error code (such as zero). Introduce posix_path_error() function and use it where appropriate. (cherry picked from commit 834603112e6ca35944dd21105b01fca562dc3241) Co-authored-by: Alexey Izbyshev files: A Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.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 cef4a09d7de9..098d1d44fa35 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1589,6 +1589,16 @@ def test_execve_invalid_env(self): with self.assertRaises(ValueError): os.execve(args[0], args, newenv) + @unittest.skipUnless(sys.platform == "win32", "Win32-specific test") + def test_execve_with_empty_path(self): + # bpo-32890: Check GetLastError() misuse + try: + os.execve('', ['arg'], {}) + except OSError as e: + self.assertTrue(e.winerror is None or e.winerror != 0) + else: + self.fail('No OSError raised') + @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") class Win32ErrorTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst b/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst new file mode 100644 index 000000000000..e8a63b334192 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst @@ -0,0 +1,2 @@ +Fix usage of GetLastError() instead of errno in os.execve() and +os.truncate(). diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index bbbff1eca8ff..0c48a66a64dd 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1421,6 +1421,12 @@ win32_error_object(const char* function, PyObject* filename) #endif /* MS_WINDOWS */ +static PyObject * +posix_path_object_error(PyObject *path) +{ + return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); +} + static PyObject * path_object_error(PyObject *path) { @@ -1428,7 +1434,7 @@ path_object_error(PyObject *path) return PyErr_SetExcFromWindowsErrWithFilenameObject( PyExc_OSError, 0, path); #else - return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); + return posix_path_object_error(path); #endif } @@ -1449,6 +1455,12 @@ path_error(path_t *path) return path_object_error(path->object); } +static PyObject * +posix_path_error(path_t *path) +{ + return posix_path_object_error(path->object); +} + static PyObject * path_error2(path_t *path, path_t *path2) { @@ -5097,7 +5109,7 @@ os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env) /* If we get here it's definitely an error */ - path_error(path); + posix_path_error(path); free_string_array(envlist, envc); fail: @@ -9060,7 +9072,7 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length) _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS if (result < 0) - return path_error(path); + return posix_path_error(path); Py_RETURN_NONE; } From webhook-mailer at python.org Fri Oct 19 20:47:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:47:19 -0000 Subject: [Python-checkins] bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621) Message-ID: https://github.com/python/cpython/commit/75ee130c39e73730535d94923fd8322ef616cb83 commit: 75ee130c39e73730535d94923fd8322ef616cb83 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:47:15-07:00 summary: bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a3d5ebad575aafe5fcc572e3b05f7f24e5) Co-authored-by: Pablo Galindo files: M Doc/library/mmap.rst diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index d965fa36b47a..6c0f9a0d1255 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -61,7 +61,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`. .. class:: mmap(fileno, length, flags=MAP_SHARED, prot=PROT_WRITE|PROT_READ, access=ACCESS_DEFAULT[, offset]) @@ -90,8 +90,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the PAGESIZE or - ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY` + which is equal to :const:`PAGESIZE` on Unix systems. To ensure validity of the created memory mapping the file specified by the descriptor *fileno* is internally automatically synchronized @@ -185,7 +185,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length use of this call there is no guarantee that changes are written back before the object is destroyed. If *offset* and *size* are specified, only changes to the given range of bytes will be flushed to disk; otherwise, the - whole extent of the mapping is flushed. + whole extent of the mapping is flushed. *offset* must be a multiple of the + :const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`. **(Windows version)** A nonzero value returned indicates success; zero indicates failure. From webhook-mailer at python.org Fri Oct 19 20:48:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:48:08 -0000 Subject: [Python-checkins] bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621) Message-ID: https://github.com/python/cpython/commit/557a68789b97bf281aa7b7e96f083982c01a5f7e commit: 557a68789b97bf281aa7b7e96f083982c01a5f7e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:48:05-07:00 summary: bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a3d5ebad575aafe5fcc572e3b05f7f24e5) Co-authored-by: Pablo Galindo files: M Doc/library/mmap.rst diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index ca09a6a3ca99..f0d2071593d2 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -65,7 +65,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`. .. class:: mmap(fileno, length, flags=MAP_SHARED, prot=PROT_WRITE|PROT_READ, access=ACCESS_DEFAULT[, offset]) @@ -94,8 +94,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the PAGESIZE or - ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY` + which is equal to :const:`PAGESIZE` on Unix systems. To ensure validity of the created memory mapping the file specified by the descriptor *fileno* is internally automatically synchronized @@ -189,7 +189,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length use of this call there is no guarantee that changes are written back before the object is destroyed. If *offset* and *size* are specified, only changes to the given range of bytes will be flushed to disk; otherwise, the - whole extent of the mapping is flushed. + whole extent of the mapping is flushed. *offset* must be a multiple of the + :const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`. **(Windows version)** A nonzero value returned indicates success; zero indicates failure. From webhook-mailer at python.org Fri Oct 19 20:49:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:49:03 -0000 Subject: [Python-checkins] bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784) Message-ID: https://github.com/python/cpython/commit/d9a2665fc4573c4d311a89750737ad4cc3310252 commit: d9a2665fc4573c4d311a89750737ad4cc3310252 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:49:00-07:00 summary: bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784) path_error() uses GetLastError() on Windows, but some os functions are implemented via CRT APIs which report errors via errno. This may result in raising OSError with invalid error code (such as zero). Introduce posix_path_error() function and use it where appropriate. (cherry picked from commit 834603112e6ca35944dd21105b01fca562dc3241) Co-authored-by: Alexey Izbyshev files: A Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.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 8339f849e84e..9e35d55b8056 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1582,6 +1582,16 @@ def test_execve_invalid_env(self): with self.assertRaises(ValueError): os.execve(args[0], args, newenv) + @unittest.skipUnless(sys.platform == "win32", "Win32-specific test") + def test_execve_with_empty_path(self): + # bpo-32890: Check GetLastError() misuse + try: + os.execve('', ['arg'], {}) + except OSError as e: + self.assertTrue(e.winerror is None or e.winerror != 0) + else: + self.fail('No OSError raised') + @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") class Win32ErrorTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst b/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst new file mode 100644 index 000000000000..e8a63b334192 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst @@ -0,0 +1,2 @@ +Fix usage of GetLastError() instead of errno in os.execve() and +os.truncate(). diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index af6b9dc4ef03..7358c393b1a0 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1340,6 +1340,12 @@ win32_error_object(const char* function, PyObject* filename) #endif /* MS_WINDOWS */ +static PyObject * +posix_path_object_error(PyObject *path) +{ + return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); +} + static PyObject * path_object_error(PyObject *path) { @@ -1347,7 +1353,7 @@ path_object_error(PyObject *path) return PyErr_SetExcFromWindowsErrWithFilenameObject( PyExc_OSError, 0, path); #else - return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); + return posix_path_object_error(path); #endif } @@ -1368,6 +1374,12 @@ path_error(path_t *path) return path_object_error(path->object); } +static PyObject * +posix_path_error(path_t *path) +{ + return posix_path_object_error(path->object); +} + static PyObject * path_error2(path_t *path, path_t *path2) { @@ -5041,7 +5053,7 @@ os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env) /* If we get here it's definitely an error */ - path_error(path); + posix_path_error(path); free_string_array(envlist, envc); fail: @@ -8770,7 +8782,7 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length) _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS if (result < 0) - return path_error(path); + return posix_path_error(path); Py_RETURN_NONE; } From webhook-mailer at python.org Fri Oct 19 20:49:42 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 00:49:42 -0000 Subject: [Python-checkins] bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621) Message-ID: https://github.com/python/cpython/commit/2bad7acdfebb87a6eef238a7acca636cfb648a02 commit: 2bad7acdfebb87a6eef238a7acca636cfb648a02 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T17:49:37-07:00 summary: bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (GH-5621) Add restriction on the offset parameter for mmap.flush. Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix. (cherry picked from commit 027664a3d5ebad575aafe5fcc572e3b05f7f24e5) Co-authored-by: Pablo Galindo files: M Doc/library/mmap.rst diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index a86eb1392592..c9fc73365939 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -68,7 +68,7 @@ memory but does not update the underlying file. *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of the :const:`ALLOCATIONGRANULARITY`. .. class:: mmap(fileno, length[, flags[, prot[, access[, offset]]]]) @@ -97,8 +97,8 @@ memory but does not update the underlying file. *offset* may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. *offset* - defaults to 0. *offset* must be a multiple of the PAGESIZE or - ALLOCATIONGRANULARITY. + defaults to 0. *offset* must be a multiple of :const:`ALLOCATIONGRANULARITY` + which is equal to :const:`PAGESIZE` on Unix systems. To ensure validity of the created memory mapping the file specified by the descriptor *fileno* is internally automatically synchronized @@ -171,7 +171,8 @@ memory but does not update the underlying file. use of this call there is no guarantee that changes are written back before the object is destroyed. If *offset* and *size* are specified, only changes to the given range of bytes will be flushed to disk; otherwise, the - whole extent of the mapping is flushed. + whole extent of the mapping is flushed. *offset* must be a multiple of the + :const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`. **(Windows version)** A nonzero value returned indicates success; zero indicates failure. From webhook-mailer at python.org Fri Oct 19 20:49:45 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 20 Oct 2018 00:49:45 -0000 Subject: [Python-checkins] bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760) Message-ID: https://github.com/python/cpython/commit/aa95bfb5fee366aa58c90b7e1c77fc7e183dbf3a commit: aa95bfb5fee366aa58c90b7e1c77fc7e183dbf3a branch: master author: Alexey Izbyshev committer: Victor Stinner date: 2018-10-20T02:49:41+02:00 summary: bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760) Set SRCDIR as the current directory for git. files: M Tools/scripts/patchcheck.py diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index a1253d1de5bb..8a8480a0c22b 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -48,7 +48,9 @@ def get_git_branch(): """Get the symbolic name for the current git branch""" cmd = "git rev-parse --abbrev-ref HEAD".split() try: - return subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + return subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + cwd=SRCDIR) except subprocess.CalledProcessError: return None @@ -60,7 +62,9 @@ def get_git_upstream_remote(): """ cmd = "git remote get-url upstream".split() try: - subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + cwd=SRCDIR) except subprocess.CalledProcessError: return "origin" return "upstream" @@ -98,7 +102,9 @@ def changed_files(base_branch=None): else: cmd = 'git status --porcelain' filenames = [] - with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st: + with subprocess.Popen(cmd.split(), + stdout=subprocess.PIPE, + cwd=SRCDIR) as st: for line in st.stdout: line = line.decode().rstrip() status_text, filename = line.split(maxsplit=1) From webhook-mailer at python.org Fri Oct 19 21:21:48 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 01:21:48 -0000 Subject: [Python-checkins] bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760) Message-ID: https://github.com/python/cpython/commit/1662bbf09fade0310d03736066e5c36611bb4b9b commit: 1662bbf09fade0310d03736066e5c36611bb4b9b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T18:21:43-07:00 summary: bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760) Set SRCDIR as the current directory for git. (cherry picked from commit aa95bfb5fee366aa58c90b7e1c77fc7e183dbf3a) Co-authored-by: Alexey Izbyshev files: M Tools/scripts/patchcheck.py diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index a1253d1de5bb..8a8480a0c22b 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -48,7 +48,9 @@ def get_git_branch(): """Get the symbolic name for the current git branch""" cmd = "git rev-parse --abbrev-ref HEAD".split() try: - return subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + return subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + cwd=SRCDIR) except subprocess.CalledProcessError: return None @@ -60,7 +62,9 @@ def get_git_upstream_remote(): """ cmd = "git remote get-url upstream".split() try: - subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + cwd=SRCDIR) except subprocess.CalledProcessError: return "origin" return "upstream" @@ -98,7 +102,9 @@ def changed_files(base_branch=None): else: cmd = 'git status --porcelain' filenames = [] - with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st: + with subprocess.Popen(cmd.split(), + stdout=subprocess.PIPE, + cwd=SRCDIR) as st: for line in st.stdout: line = line.decode().rstrip() status_text, filename = line.split(maxsplit=1) From webhook-mailer at python.org Fri Oct 19 21:25:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 01:25:54 -0000 Subject: [Python-checkins] bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760) Message-ID: https://github.com/python/cpython/commit/42c52a9e45ed6ff2867403894bc030ed5780282d commit: 42c52a9e45ed6ff2867403894bc030ed5780282d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T18:25:51-07:00 summary: bpo-32256: Make patchcheck.py work for out-of-tree builds (GH-4760) Set SRCDIR as the current directory for git. (cherry picked from commit aa95bfb5fee366aa58c90b7e1c77fc7e183dbf3a) Co-authored-by: Alexey Izbyshev files: M Tools/scripts/patchcheck.py diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index 4ab6b778be59..e5214abf6290 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -49,7 +49,9 @@ def get_git_branch(): """Get the symbolic name for the current git branch""" cmd = "git rev-parse --abbrev-ref HEAD".split() try: - return subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + return subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + cwd=SRCDIR) except subprocess.CalledProcessError: return None @@ -61,7 +63,9 @@ def get_git_upstream_remote(): """ cmd = "git remote get-url upstream".split() try: - subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + cwd=SRCDIR) except subprocess.CalledProcessError: return "origin" return "upstream" @@ -99,7 +103,9 @@ def changed_files(base_branch=None): else: cmd = 'git status --porcelain' filenames = [] - with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st: + with subprocess.Popen(cmd.split(), + stdout=subprocess.PIPE, + cwd=SRCDIR) as st: for line in st.stdout: line = line.decode().rstrip() status_text, filename = line.split(maxsplit=1) From webhook-mailer at python.org Sat Oct 20 00:44:29 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 20 Oct 2018 04:44:29 -0000 Subject: [Python-checkins] bpo-34909: NEWS entry (GH-9995) Message-ID: https://github.com/python/cpython/commit/8c9fd9c91ba748df68a11e3bf216fa158314c9b5 commit: 8c9fd9c91ba748df68a11e3bf216fa158314c9b5 branch: master author: Ned Deily committer: GitHub date: 2018-10-20T00:44:21-04:00 summary: bpo-34909: NEWS entry (GH-9995) files: A Misc/NEWS.d/next/Library/2018-10-20-00-29-43.bpo-34909.Ew_8DC.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-20-00-29-43.bpo-34909.Ew_8DC.rst b/Misc/NEWS.d/next/Library/2018-10-20-00-29-43.bpo-34909.Ew_8DC.rst new file mode 100644 index 000000000000..b71b69ad8522 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-20-00-29-43.bpo-34909.Ew_8DC.rst @@ -0,0 +1,2 @@ +Enum: fix grandchildren subclassing when parent mixed with concrete data +types. From webhook-mailer at python.org Sat Oct 20 01:20:45 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 20 Oct 2018 05:20:45 -0000 Subject: [Python-checkins] bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) Message-ID: https://github.com/python/cpython/commit/a5259fb05d03f4871837c14fed704541a20896c0 commit: a5259fb05d03f4871837c14fed704541a20896c0 branch: master author: Sergey Fedoseev committer: Serhiy Storchaka date: 2018-10-20T08:20:39+03:00 summary: bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) files: A Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst M Lib/test/test_ordered_dict.py M Objects/odictobject.c diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index a296f6055b1a..b1d7f86a6760 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -732,6 +732,23 @@ def test_key_change_during_iteration(self): del od['c'] self.assertEqual(list(od), list('bdeaf')) + def test_iterators_pickling(self): + OrderedDict = self.OrderedDict + pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] + od = OrderedDict(pairs) + + for method_name in ('keys', 'values', 'items'): + meth = getattr(od, method_name) + expected = list(meth())[1:] + for i in range(pickle.HIGHEST_PROTOCOL + 1): + with self.subTest(method_name=method_name, protocol=i): + it = iter(meth()) + next(it) + p = pickle.dumps(it, i) + unpickled = pickle.loads(p) + self.assertEqual(list(unpickled), expected) + self.assertEqual(list(it), expected) + class PurePythonOrderedDictSubclassTests(PurePythonOrderedDictTests): diff --git a/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst b/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst new file mode 100644 index 000000000000..de718ad1e6f1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst @@ -0,0 +1,2 @@ +OrderedDict iterators are not exhausted during pickling anymore. Patch by +Sergey Fedoseev. diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 47e77b6046b2..67c3674ee095 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1805,38 +1805,19 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); static PyObject * odictiter_reduce(odictiterobject *di) { - PyObject *list, *iter; - - list = PyList_New(0); - if (!list) - return NULL; + /* copy the iterator state */ + odictiterobject tmp = *di; + Py_XINCREF(tmp.di_odict); + Py_XINCREF(tmp.di_current); /* iterate the temporary into a list */ - for(;;) { - PyObject *element = odictiter_iternext(di); - if (element) { - if (PyList_Append(list, element)) { - Py_DECREF(element); - Py_DECREF(list); - return NULL; - } - Py_DECREF(element); - } - else { - /* done iterating? */ - break; - } - } - if (PyErr_Occurred()) { - Py_DECREF(list); - return NULL; - } - iter = _PyObject_GetBuiltin("iter"); - if (iter == NULL) { - Py_DECREF(list); + PyObject *list = PySequence_List((PyObject*)&tmp); + Py_XDECREF(tmp.di_odict); + Py_XDECREF(tmp.di_current); + if (list == NULL) { return NULL; } - return Py_BuildValue("N(N)", iter, list); + return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), list); } static PyMethodDef odictiter_methods[] = { From webhook-mailer at python.org Sat Oct 20 01:54:12 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 05:54:12 -0000 Subject: [Python-checkins] bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) Message-ID: https://github.com/python/cpython/commit/dcd56f615e89d4920a0598a9c3d3301701f238a6 commit: dcd56f615e89d4920a0598a9c3d3301701f238a6 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T22:54:09-07:00 summary: bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) (cherry picked from commit a5259fb05d03f4871837c14fed704541a20896c0) Co-authored-by: Sergey Fedoseev files: A Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst M Lib/test/test_ordered_dict.py M Objects/odictobject.c diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index 20efe3729de8..bcb437f18ee4 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -732,6 +732,23 @@ def test_key_change_during_iteration(self): del od['c'] self.assertEqual(list(od), list('bdeaf')) + def test_iterators_pickling(self): + OrderedDict = self.OrderedDict + pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] + od = OrderedDict(pairs) + + for method_name in ('keys', 'values', 'items'): + meth = getattr(od, method_name) + expected = list(meth())[1:] + for i in range(pickle.HIGHEST_PROTOCOL + 1): + with self.subTest(method_name=method_name, protocol=i): + it = iter(meth()) + next(it) + p = pickle.dumps(it, i) + unpickled = pickle.loads(p) + self.assertEqual(list(unpickled), expected) + self.assertEqual(list(it), expected) + class PurePythonOrderedDictSubclassTests(PurePythonOrderedDictTests): diff --git a/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst b/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst new file mode 100644 index 000000000000..de718ad1e6f1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst @@ -0,0 +1,2 @@ +OrderedDict iterators are not exhausted during pickling anymore. Patch by +Sergey Fedoseev. diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 5aa51be22717..7c6e0b7c330e 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1837,38 +1837,19 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); static PyObject * odictiter_reduce(odictiterobject *di) { - PyObject *list, *iter; - - list = PyList_New(0); - if (!list) - return NULL; + /* copy the iterator state */ + odictiterobject tmp = *di; + Py_XINCREF(tmp.di_odict); + Py_XINCREF(tmp.di_current); /* iterate the temporary into a list */ - for(;;) { - PyObject *element = odictiter_iternext(di); - if (element) { - if (PyList_Append(list, element)) { - Py_DECREF(element); - Py_DECREF(list); - return NULL; - } - Py_DECREF(element); - } - else { - /* done iterating? */ - break; - } - } - if (PyErr_Occurred()) { - Py_DECREF(list); - return NULL; - } - iter = _PyObject_GetBuiltin("iter"); - if (iter == NULL) { - Py_DECREF(list); + PyObject *list = PySequence_List((PyObject*)&tmp); + Py_XDECREF(tmp.di_odict); + Py_XDECREF(tmp.di_current); + if (list == NULL) { return NULL; } - return Py_BuildValue("N(N)", iter, list); + return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), list); } static PyMethodDef odictiter_methods[] = { From webhook-mailer at python.org Sat Oct 20 02:05:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 06:05:23 -0000 Subject: [Python-checkins] bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) Message-ID: https://github.com/python/cpython/commit/0d3dd9fe0d2565f09f70d8ea7341dfd88e6bd380 commit: 0d3dd9fe0d2565f09f70d8ea7341dfd88e6bd380 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-19T23:05:19-07:00 summary: bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) (cherry picked from commit a5259fb05d03f4871837c14fed704541a20896c0) Co-authored-by: Sergey Fedoseev files: A Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst M Lib/test/test_ordered_dict.py M Objects/odictobject.c diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index b396426eb153..a796dd59b8d2 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -732,6 +732,23 @@ def test_key_change_during_iteration(self): del od['c'] self.assertEqual(list(od), list('bdeaf')) + def test_iterators_pickling(self): + OrderedDict = self.OrderedDict + pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] + od = OrderedDict(pairs) + + for method_name in ('keys', 'values', 'items'): + meth = getattr(od, method_name) + expected = list(meth())[1:] + for i in range(pickle.HIGHEST_PROTOCOL + 1): + with self.subTest(method_name=method_name, protocol=i): + it = iter(meth()) + next(it) + p = pickle.dumps(it, i) + unpickled = pickle.loads(p) + self.assertEqual(list(unpickled), expected) + self.assertEqual(list(it), expected) + class PurePythonOrderedDictSubclassTests(PurePythonOrderedDictTests): diff --git a/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst b/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst new file mode 100644 index 000000000000..de718ad1e6f1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-04-09-32-54.bpo-34574.X4RwYI.rst @@ -0,0 +1,2 @@ +OrderedDict iterators are not exhausted during pickling anymore. Patch by +Sergey Fedoseev. diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 26f15794418b..73f315867307 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1923,38 +1923,19 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); static PyObject * odictiter_reduce(odictiterobject *di) { - PyObject *list, *iter; - - list = PyList_New(0); - if (!list) - return NULL; + /* copy the iterator state */ + odictiterobject tmp = *di; + Py_XINCREF(tmp.di_odict); + Py_XINCREF(tmp.di_current); /* iterate the temporary into a list */ - for(;;) { - PyObject *element = odictiter_iternext(di); - if (element) { - if (PyList_Append(list, element)) { - Py_DECREF(element); - Py_DECREF(list); - return NULL; - } - Py_DECREF(element); - } - else { - /* done iterating? */ - break; - } - } - if (PyErr_Occurred()) { - Py_DECREF(list); - return NULL; - } - iter = _PyObject_GetBuiltin("iter"); - if (iter == NULL) { - Py_DECREF(list); + PyObject *list = PySequence_List((PyObject*)&tmp); + Py_XDECREF(tmp.di_odict); + Py_XDECREF(tmp.di_current); + if (list == NULL) { return NULL; } - return Py_BuildValue("N(N)", iter, list); + return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), list); } static PyMethodDef odictiter_methods[] = { From webhook-mailer at python.org Sat Oct 20 04:24:11 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 20 Oct 2018 08:24:11 -0000 Subject: [Python-checkins] bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349). (GH-10000) Message-ID: https://github.com/python/cpython/commit/861d34eee345956cbb0940fa676bfb7ff492999d commit: 861d34eee345956cbb0940fa676bfb7ff492999d branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-20T11:24:05+03:00 summary: bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349). (GH-10000) (cherry picked from commit 6f17e51345d930ccb4db306acc12b7d1f6c5e690) files: M Lib/test/test_ordered_dict.py M Objects/odictobject.c diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index bcb437f18ee4..b1d7f86a6760 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -697,9 +697,9 @@ def test_sizeof_exact(self): nodesize = calcsize('Pn2P') od = OrderedDict() - check(od, basicsize + 8*p + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table + check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table od.x = 1 - check(od, basicsize + 8*p + 8 + 5*entrysize) + check(od, basicsize + 8 + 5*entrysize) od.update([(i, i) for i in range(3)]) check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize) od.update([(i, i) for i in range(3, 10)]) diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 7c6e0b7c330e..676ed99078ce 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -101,10 +101,6 @@ For removing nodes: * _odict_find_node(od, key) * _odict_keys_equal(od1, od2) -Used, but specific to the linked-list implementation: - -* _odict_free_fast_nodes(od) - And here's a look at how the linked-list relates to the OrderedDict API: ============ === === ==== ==== ==== === ==== ===== ==== ==== === ==== === === @@ -378,7 +374,6 @@ tp_iter odict_iter tp_dictoffset (offset) tp_init odict_init tp_alloc (repeated) -tp_new odict_new ================= ================ ================= ================ @@ -530,15 +525,6 @@ struct _odictnode { #define _odict_FOREACH(od, node) \ for (node = _odict_FIRST(od); node != NULL; node = _odictnode_NEXT(node)) -#define _odict_FAST_SIZE(od) ((PyDictObject *)od)->ma_keys->dk_size - -static void -_odict_free_fast_nodes(PyODictObject *od) { - if (od->od_fast_nodes) { - PyMem_FREE(od->od_fast_nodes); - } -} - /* Return the index into the hash table, regardless of a valid node. */ static Py_ssize_t _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash) @@ -559,7 +545,8 @@ _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash) /* Replace od->od_fast_nodes with a new table matching the size of dict's. */ static int -_odict_resize(PyODictObject *od) { +_odict_resize(PyODictObject *od) +{ Py_ssize_t size, i; _ODictNode **fast_nodes, *node; @@ -585,7 +572,7 @@ _odict_resize(PyODictObject *od) { } /* Replace the old fast nodes table. */ - _odict_free_fast_nodes(od); + PyMem_FREE(od->od_fast_nodes); od->od_fast_nodes = fast_nodes; od->od_fast_nodes_size = size; od->od_resize_sentinel = ((PyDictObject *)od)->ma_keys; @@ -623,6 +610,7 @@ _odict_find_node_hash(PyODictObject *od, PyObject *key, Py_hash_t hash) index = _odict_get_index(od, key, hash); if (index < 0) return NULL; + assert(od->od_fast_nodes != NULL); return od->od_fast_nodes[index]; } @@ -640,6 +628,7 @@ _odict_find_node(PyODictObject *od, PyObject *key) index = _odict_get_index(od, key, hash); if (index < 0) return NULL; + assert(od->od_fast_nodes != NULL); return od->od_fast_nodes[index]; } @@ -684,7 +673,8 @@ _odict_add_new_node(PyODictObject *od, PyObject *key, Py_hash_t hash) Py_DECREF(key); return -1; } - else if (od->od_fast_nodes[i] != NULL) { + assert(od->od_fast_nodes != NULL); + if (od->od_fast_nodes[i] != NULL) { /* We already have a node for the key so there's no need to add one. */ Py_DECREF(key); return 0; @@ -763,6 +753,7 @@ _odict_clear_node(PyODictObject *od, _ODictNode *node, PyObject *key, if (i < 0) return PyErr_Occurred() ? -1 : 0; + assert(od->od_fast_nodes != NULL); if (node == NULL) node = od->od_fast_nodes[i]; assert(node == od->od_fast_nodes[i]); @@ -783,8 +774,10 @@ _odict_clear_nodes(PyODictObject *od) { _ODictNode *node, *next; - _odict_free_fast_nodes(od); + PyMem_FREE(od->od_fast_nodes); od->od_fast_nodes = NULL; + od->od_fast_nodes_size = 0; + od->od_resize_sentinel = NULL; node = _odict_FIRST(od); _odict_FIRST(od) = NULL; @@ -887,7 +880,7 @@ static PyObject * odict_sizeof(PyODictObject *od) { Py_ssize_t res = _PyDict_SizeOf((PyDictObject *)od); - res += sizeof(_ODictNode *) * _odict_FAST_SIZE(od); /* od_fast_nodes */ + res += sizeof(_ODictNode *) * od->od_fast_nodes_size; /* od_fast_nodes */ if (!_odict_EMPTY(od)) { res += sizeof(_ODictNode) * PyODict_SIZE(od); /* linked-list */ } @@ -1175,12 +1168,10 @@ PyDoc_STRVAR(odict_clear__doc__, "od.clear() -> None. Remove all items from od."); static PyObject * -odict_clear(register PyODictObject *od) +odict_clear(register PyODictObject *od, PyObject *Py_UNUSED(ignored)) { PyDict_Clear((PyObject *)od); _odict_clear_nodes(od); - if (_odict_resize(od) < 0) - return NULL; Py_RETURN_NONE; } @@ -1484,13 +1475,10 @@ odict_traverse(PyODictObject *od, visitproc visit, void *arg) static int odict_tp_clear(PyODictObject *od) { - PyObject *res; Py_CLEAR(od->od_inst_dict); Py_CLEAR(od->od_weakreflist); - res = odict_clear(od); - if (res == NULL) - return -1; - Py_DECREF(res); + PyDict_Clear((PyObject *)od); + _odict_clear_nodes(od); return 0; } @@ -1565,27 +1553,6 @@ odict_init(PyObject *self, PyObject *args, PyObject *kwds) } } -/* tp_new */ - -static PyObject * -odict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -{ - PyODictObject *od; - - od = (PyODictObject *)PyDict_Type.tp_new(type, args, kwds); - if (od == NULL) - return NULL; - - /* type constructor fills the memory with zeros (see - PyType_GenericAlloc()), there is no need to set them to zero again */ - if (_odict_resize(od) < 0) { - Py_DECREF(od); - return NULL; - } - - return (PyObject*)od; -} - /* PyODict_Type */ PyTypeObject PyODict_Type = { @@ -1626,7 +1593,7 @@ PyTypeObject PyODict_Type = { offsetof(PyODictObject, od_inst_dict), /* tp_dictoffset */ (initproc)odict_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ - (newfunc)odict_new, /* tp_new */ + 0, /* tp_new */ 0, /* tp_free */ }; @@ -1636,8 +1603,9 @@ PyTypeObject PyODict_Type = { */ PyObject * -PyODict_New(void) { - return odict_new(&PyODict_Type, NULL, NULL); +PyODict_New(void) +{ + return PyDict_Type.tp_new(&PyODict_Type, NULL, NULL); } static int From webhook-mailer at python.org Sat Oct 20 04:43:38 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sat, 20 Oct 2018 08:43:38 -0000 Subject: [Python-checkins] bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest (GH-9736) Message-ID: https://github.com/python/cpython/commit/0522fd81dc6e3482c2d4c8719f1f85ad5924eede commit: 0522fd81dc6e3482c2d4c8719f1f85ad5924eede branch: master author: St?phane Wirtel committer: Julien Palard date: 2018-10-20T10:43:32+02:00 summary: bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest (GH-9736) files: M Doc/library/doctest.rst diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 587a0a09a947..bc5a40424967 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -759,23 +759,27 @@ Warnings :mod:`doctest` is serious about requiring exact matches in expected output. If even a single character doesn't match, the test fails. This will probably surprise you a few times, as you learn exactly what Python does and doesn't -guarantee about output. For example, when printing a dict, Python doesn't -guarantee that the key-value pairs will be printed in any particular order, so a -test like :: +guarantee about output. For example, when printing a set, Python doesn't +guarantee that the element is printed in any particular order, so a test like :: >>> foo() - {"Hermione": "hippogryph", "Harry": "broomstick"} + {"Hermione", "Harry"} is vulnerable! One workaround is to do :: - >>> foo() == {"Hermione": "hippogryph", "Harry": "broomstick"} + >>> foo() == {"Hermione", "Harry"} True instead. Another is to do :: - >>> d = sorted(foo().items()) + >>> d = sorted(foo()) >>> d - [('Harry', 'broomstick'), ('Hermione', 'hippogryph')] + ['Harry', 'Hermione'] + +.. note:: + + Before Python 3.6, when printing a dict, Python did not guarantee that + the key-value pairs was printed in any particular order. There are others, but you get the idea. From webhook-mailer at python.org Sat Oct 20 04:47:11 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 20 Oct 2018 08:47:11 -0000 Subject: [Python-checkins] bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349). (GH-10001) Message-ID: https://github.com/python/cpython/commit/f1b90e3922e9d218cf1f6c94ab98874c1752bdf3 commit: f1b90e3922e9d218cf1f6c94ab98874c1752bdf3 branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-10-20T11:47:04+03:00 summary: bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349). (GH-10001) (cherry picked from commit 6f17e51345d930ccb4db306acc12b7d1f6c5e690) files: M Lib/test/test_ordered_dict.py M Objects/odictobject.c diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index a796dd59b8d2..b1d7f86a6760 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -697,9 +697,9 @@ def test_sizeof_exact(self): nodesize = calcsize('Pn2P') od = OrderedDict() - check(od, basicsize + 8*p + 8 + 5*entrysize) # 8byte indicies + 8*2//3 * entry table + check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table od.x = 1 - check(od, basicsize + 8*p + 8 + 5*entrysize) + check(od, basicsize + 8 + 5*entrysize) od.update([(i, i) for i in range(3)]) check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize) od.update([(i, i) for i in range(3, 10)]) diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 73f315867307..f433cd2f4cec 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -101,10 +101,6 @@ For removing nodes: * _odict_find_node(od, key) * _odict_keys_equal(od1, od2) -Used, but specific to the linked-list implementation: - -* _odict_free_fast_nodes(od) - And here's a look at how the linked-list relates to the OrderedDict API: ============ === === ==== ==== ==== === ==== ===== ==== ==== === ==== === === @@ -378,7 +374,6 @@ tp_iter odict_iter tp_dictoffset (offset) tp_init odict_init tp_alloc (repeated) -tp_new odict_new ================= ================ ================= ================ @@ -522,15 +517,6 @@ struct _odictnode { #define _odict_FOREACH(od, node) \ for (node = _odict_FIRST(od); node != NULL; node = _odictnode_NEXT(node)) -#define _odict_FAST_SIZE(od) ((PyDictObject *)od)->ma_keys->dk_size - -static void -_odict_free_fast_nodes(PyODictObject *od) { - if (od->od_fast_nodes) { - PyMem_FREE(od->od_fast_nodes); - } -} - /* Return the index into the hash table, regardless of a valid node. */ static Py_ssize_t _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash) @@ -551,7 +537,8 @@ _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash) /* Replace od->od_fast_nodes with a new table matching the size of dict's. */ static int -_odict_resize(PyODictObject *od) { +_odict_resize(PyODictObject *od) +{ Py_ssize_t size, i; _ODictNode **fast_nodes, *node; @@ -577,7 +564,7 @@ _odict_resize(PyODictObject *od) { } /* Replace the old fast nodes table. */ - _odict_free_fast_nodes(od); + PyMem_FREE(od->od_fast_nodes); od->od_fast_nodes = fast_nodes; od->od_fast_nodes_size = size; od->od_resize_sentinel = ((PyDictObject *)od)->ma_keys; @@ -615,6 +602,7 @@ _odict_find_node_hash(PyODictObject *od, PyObject *key, Py_hash_t hash) index = _odict_get_index(od, key, hash); if (index < 0) return NULL; + assert(od->od_fast_nodes != NULL); return od->od_fast_nodes[index]; } @@ -632,6 +620,7 @@ _odict_find_node(PyODictObject *od, PyObject *key) index = _odict_get_index(od, key, hash); if (index < 0) return NULL; + assert(od->od_fast_nodes != NULL); return od->od_fast_nodes[index]; } @@ -676,7 +665,8 @@ _odict_add_new_node(PyODictObject *od, PyObject *key, Py_hash_t hash) Py_DECREF(key); return -1; } - else if (od->od_fast_nodes[i] != NULL) { + assert(od->od_fast_nodes != NULL); + if (od->od_fast_nodes[i] != NULL) { /* We already have a node for the key so there's no need to add one. */ Py_DECREF(key); return 0; @@ -755,6 +745,7 @@ _odict_clear_node(PyODictObject *od, _ODictNode *node, PyObject *key, if (i < 0) return PyErr_Occurred() ? -1 : 0; + assert(od->od_fast_nodes != NULL); if (node == NULL) node = od->od_fast_nodes[i]; assert(node == od->od_fast_nodes[i]); @@ -775,8 +766,10 @@ _odict_clear_nodes(PyODictObject *od) { _ODictNode *node, *next; - _odict_free_fast_nodes(od); + PyMem_FREE(od->od_fast_nodes); od->od_fast_nodes = NULL; + od->od_fast_nodes_size = 0; + od->od_resize_sentinel = NULL; node = _odict_FIRST(od); _odict_FIRST(od) = NULL; @@ -941,7 +934,7 @@ static PyObject * odict_sizeof(PyODictObject *od) { Py_ssize_t res = _PyDict_SizeOf((PyDictObject *)od); - res += sizeof(_ODictNode *) * _odict_FAST_SIZE(od); /* od_fast_nodes */ + res += sizeof(_ODictNode *) * od->od_fast_nodes_size; /* od_fast_nodes */ if (!_odict_EMPTY(od)) { res += sizeof(_ODictNode) * PyODict_SIZE(od); /* linked-list */ } @@ -1231,12 +1224,10 @@ PyDoc_STRVAR(odict_clear__doc__, "od.clear() -> None. Remove all items from od."); static PyObject * -odict_clear(register PyODictObject *od) +odict_clear(register PyODictObject *od, PyObject *Py_UNUSED(ignored)) { PyDict_Clear((PyObject *)od); _odict_clear_nodes(od); - if (_odict_resize(od) < 0) - return NULL; Py_RETURN_NONE; } @@ -1570,13 +1561,10 @@ odict_traverse(PyODictObject *od, visitproc visit, void *arg) static int odict_tp_clear(PyODictObject *od) { - PyObject *res; Py_CLEAR(od->od_inst_dict); Py_CLEAR(od->od_weakreflist); - res = odict_clear(od); - if (res == NULL) - return -1; - Py_DECREF(res); + PyDict_Clear((PyObject *)od); + _odict_clear_nodes(od); return 0; } @@ -1651,27 +1639,6 @@ odict_init(PyObject *self, PyObject *args, PyObject *kwds) } } -/* tp_new */ - -static PyObject * -odict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -{ - PyODictObject *od; - - od = (PyODictObject *)PyDict_Type.tp_new(type, args, kwds); - if (od == NULL) - return NULL; - - /* type constructor fills the memory with zeros (see - PyType_GenericAlloc()), there is no need to set them to zero again */ - if (_odict_resize(od) < 0) { - Py_DECREF(od); - return NULL; - } - - return (PyObject*)od; -} - /* PyODict_Type */ PyTypeObject PyODict_Type = { @@ -1712,7 +1679,7 @@ PyTypeObject PyODict_Type = { offsetof(PyODictObject, od_inst_dict), /* tp_dictoffset */ (initproc)odict_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ - (newfunc)odict_new, /* tp_new */ + 0, /* tp_new */ 0, /* tp_free */ }; @@ -1722,8 +1689,9 @@ PyTypeObject PyODict_Type = { */ PyObject * -PyODict_New(void) { - return odict_new(&PyODict_Type, NULL, NULL); +PyODict_New(void) +{ + return PyDict_Type.tp_new(&PyODict_Type, NULL, NULL); } static int From solipsis at pitrou.net Sat Oct 20 05:10:35 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 20 Oct 2018 09:10:35 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=10 Message-ID: <20181020091035.1.D7F0AA27C20880E8@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, 0, 0] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, -2, 2] memory blocks, sum=0 test_multiprocessing_forkserver leaked [0, 1, -2] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogIWsIa1', '--timeout', '7200'] From webhook-mailer at python.org Sat Oct 20 11:27:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 15:27:06 -0000 Subject: [Python-checkins] bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) Message-ID: https://github.com/python/cpython/commit/d262250d0732bdf36cb92091e37360cf8ff40f7c commit: d262250d0732bdf36cb92091e37360cf8ff40f7c branch: master author: St?phane Wirtel committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-20T08:27:03-07:00 summary: bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) https://bugs.python.org/issue35032 files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index 7792cfaa16a1..0cfc9dd0f2d7 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -23,18 +23,6 @@ This is not necessarily a straightforward question. If you are already familiar with running programs from the Windows command line then everything will seem obvious; otherwise, you might need a little more guidance. -.. sidebar:: |Python Development on XP|_ - :subtitle: `Python Development on XP`_ - - This series of screencasts aims to get you up and running with Python on - Windows XP. The knowledge is distilled into 1.5 hours and will get you up - and running with the right Python distribution, coding in your choice of IDE, - and debugging and writing solid code with unit-tests. - -.. |Python Development on XP| image:: python-video-icon.png -.. _`Python Development on XP`: - http://showmedo.com/videotutorials/series?name=pythonOzsvaldPyNewbieSeries - Unless you use some sort of integrated development environment, you will end up *typing* Windows commands into what is variously referred to as a "DOS window" or "Command prompt window". Usually you can create such a window from your @@ -108,18 +96,6 @@ gives you a message like:: 'python' is not recognized as an internal or external command, operable program or batch file. -.. sidebar:: |Adding Python to DOS Path|_ - :subtitle: `Adding Python to DOS Path`_ - - Python is not added to the DOS path by default. This screencast will walk - you through the steps to add the correct entry to the `System Path`, allowing - Python to be executed from the command-line by all users. - -.. |Adding Python to DOS Path| image:: python-video-icon.png -.. _`Adding Python to DOS Path`: - http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96 - - or:: Bad command or filename From webhook-mailer at python.org Sat Oct 20 11:32:24 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 15:32:24 -0000 Subject: [Python-checkins] bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) Message-ID: https://github.com/python/cpython/commit/76e8582fca17b89d2709ad7f4e1ad658ee839962 commit: 76e8582fca17b89d2709ad7f4e1ad658ee839962 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-20T08:32:21-07:00 summary: bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) https://bugs.python.org/issue35032 (cherry picked from commit d262250d0732bdf36cb92091e37360cf8ff40f7c) Co-authored-by: St?phane Wirtel files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index f1839845832c..7c57a05b5c4f 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -23,18 +23,6 @@ This is not necessarily a straightforward question. If you are already familiar with running programs from the Windows command line then everything will seem obvious; otherwise, you might need a little more guidance. -.. sidebar:: |Python Development on XP|_ - :subtitle: `Python Development on XP`_ - - This series of screencasts aims to get you up and running with Python on - Windows XP. The knowledge is distilled into 1.5 hours and will get you up - and running with the right Python distribution, coding in your choice of IDE, - and debugging and writing solid code with unit-tests. - -.. |Python Development on XP| image:: python-video-icon.png -.. _`Python Development on XP`: - http://showmedo.com/videotutorials/series?name=pythonOzsvaldPyNewbieSeries - Unless you use some sort of integrated development environment, you will end up *typing* Windows commands into what is variously referred to as a "DOS window" or "Command prompt window". Usually you can create such a window from your @@ -108,18 +96,6 @@ gives you a message like:: 'python' is not recognized as an internal or external command, operable program or batch file. -.. sidebar:: |Adding Python to DOS Path|_ - :subtitle: `Adding Python to DOS Path`_ - - Python is not added to the DOS path by default. This screencast will walk - you through the steps to add the correct entry to the `System Path`, allowing - Python to be executed from the command-line by all users. - -.. |Adding Python to DOS Path| image:: python-video-icon.png -.. _`Adding Python to DOS Path`: - http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96 - - or:: Bad command or filename From webhook-mailer at python.org Sat Oct 20 11:32:24 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 15:32:24 -0000 Subject: [Python-checkins] bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) Message-ID: https://github.com/python/cpython/commit/b53edb12f7176c58960d5ebaf48e740bea72a500 commit: b53edb12f7176c58960d5ebaf48e740bea72a500 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-20T08:32:21-07:00 summary: bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) https://bugs.python.org/issue35032 (cherry picked from commit d262250d0732bdf36cb92091e37360cf8ff40f7c) Co-authored-by: St?phane Wirtel files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index f8e23cf69cfe..7f0c955baac6 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -17,18 +17,6 @@ This is not necessarily a straightforward question. If you are already familiar with running programs from the Windows command line then everything will seem obvious; otherwise, you might need a little more guidance. -.. sidebar:: |Python Development on XP|_ - :subtitle: `Python Development on XP`_ - - This series of screencasts aims to get you up and running with Python on - Windows XP. The knowledge is distilled into 1.5 hours and will get you up - and running with the right Python distribution, coding in your choice of IDE, - and debugging and writing solid code with unit-tests. - -.. |Python Development on XP| image:: python-video-icon.png -.. _`Python Development on XP`: - http://showmedo.com/videotutorials/series?name=pythonOzsvaldPyNewbieSeries - Unless you use some sort of integrated development environment, you will end up *typing* Windows commands into what is variously referred to as a "DOS window" or "Command prompt window". Usually you can create such a window from your @@ -92,18 +80,6 @@ gives you a message like:: 'python' is not recognized as an internal or external command, operable program or batch file. -.. sidebar:: |Adding Python to DOS Path|_ - :subtitle: `Adding Python to DOS Path`_ - - Python is not added to the DOS path by default. This screencast will walk - you through the steps to add the correct entry to the `System Path`, allowing - Python to be executed from the command-line by all users. - -.. |Adding Python to DOS Path| image:: python-video-icon.png -.. _`Adding Python to DOS Path`: - http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96 - - or:: Bad command or filename From webhook-mailer at python.org Sat Oct 20 11:32:31 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 20 Oct 2018 15:32:31 -0000 Subject: [Python-checkins] bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) Message-ID: https://github.com/python/cpython/commit/34a5ed5c0abbe75af2b75ad8bd03b68fd7e2f596 commit: 34a5ed5c0abbe75af2b75ad8bd03b68fd7e2f596 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-20T08:32:28-07:00 summary: bpo-35032: Remove inaccessible videos from faq/Windows (GH-10004) https://bugs.python.org/issue35032 (cherry picked from commit d262250d0732bdf36cb92091e37360cf8ff40f7c) Co-authored-by: St?phane Wirtel files: M Doc/faq/windows.rst diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index 7792cfaa16a1..0cfc9dd0f2d7 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -23,18 +23,6 @@ This is not necessarily a straightforward question. If you are already familiar with running programs from the Windows command line then everything will seem obvious; otherwise, you might need a little more guidance. -.. sidebar:: |Python Development on XP|_ - :subtitle: `Python Development on XP`_ - - This series of screencasts aims to get you up and running with Python on - Windows XP. The knowledge is distilled into 1.5 hours and will get you up - and running with the right Python distribution, coding in your choice of IDE, - and debugging and writing solid code with unit-tests. - -.. |Python Development on XP| image:: python-video-icon.png -.. _`Python Development on XP`: - http://showmedo.com/videotutorials/series?name=pythonOzsvaldPyNewbieSeries - Unless you use some sort of integrated development environment, you will end up *typing* Windows commands into what is variously referred to as a "DOS window" or "Command prompt window". Usually you can create such a window from your @@ -108,18 +96,6 @@ gives you a message like:: 'python' is not recognized as an internal or external command, operable program or batch file. -.. sidebar:: |Adding Python to DOS Path|_ - :subtitle: `Adding Python to DOS Path`_ - - Python is not added to the DOS path by default. This screencast will walk - you through the steps to add the correct entry to the `System Path`, allowing - Python to be executed from the command-line by all users. - -.. |Adding Python to DOS Path| image:: python-video-icon.png -.. _`Adding Python to DOS Path`: - http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96 - - or:: Bad command or filename From webhook-mailer at python.org Sat Oct 20 12:35:24 2018 From: webhook-mailer at python.org (Zachary Ware) Date: Sat, 20 Oct 2018 16:35:24 -0000 Subject: [Python-checkins] Encrypt Zulip webhook address (GH-10010) Message-ID: https://github.com/python/cpython/commit/0bd4826d2dfc9122b056742a6ee75b8188d0d75b commit: 0bd4826d2dfc9122b056742a6ee75b8188d0d75b branch: master author: Zachary Ware committer: GitHub date: 2018-10-20T11:35:21-05:00 summary: Encrypt Zulip webhook address (GH-10010) This should reduce false failure reports to the Zulip 'core/test runs' stream from Travis failures on private forks. files: M .travis.yml diff --git a/.travis.yml b/.travis.yml index 16b9746feeb5..41c0e0fd6aa1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -165,11 +165,6 @@ script: fi notifications: email: false - webhooks: - urls: - - https://python.zulipchat.com/api/v1/external/travis?api_key=QTP4LAknlFml0NuPQmAetvH4KQaokiQE&stream=core%2Ftest+runs - on_success: change - on_failure: always irc: channels: # This is set to a secure variable to prevent forks from notifying the @@ -180,3 +175,11 @@ notifications: on_success: change on_failure: always skip_join: true + webhooks: + urls: + # For the same reasons as above for IRC, we encrypt the webhook address + # for Zulip. The actual value is: + # https://python.zulipchat.com/api/v1/external/travis?api_key=&stream=core%2Ftest+runs + - secure: "vLz2TodSL7wQ8DsIu86koRS9i4dsK40PH8+wzY93PBCCAzJAz113LTxK3/9PamMv+ObDRUSe5OpXcquE3d5Gwpu8IymF113qK0I3uNr+O3FtmKlj/Kd1P/V+z4pTpS3zh3lW9gyKV9EMWXIWS0IYKKZQU144XqUlIiucWK2jHJF/cSz2cRAx/6Kx68X4mZwEC7hiMOF4ZsWUMbCglM89ybeS0pr0kK9mmh88qsPyRQov3mRKswmVPlePk7clVLNAL43qSe3SzmrmACZfQ9KJYmpYnr/cjo2b6svYHcQBAwAUarZZ9KBMXeV7HwGWsSXAvHH2ynR0P++braBHGEMTGMSitdVWzFTmeiHnrkp08WAB+uFs54iEx3VklTk9bCzozTm2S94TRxbrsG9SypMvQxG570JV6P2XYuR+taCb/GMtMqrtGQm2e1Ht+nDLtiUb+/+rwEbicJJ13knptOQZI4tPOZESI/kXkORkSNwFfLSNLSl9jTlMmO7KjAAPApURHEdx26RbItAn8mIX2NcHTRjKn2qV4h3C54nmHmKWn/ZudHHJc6ieZSEUBoaLGAYmcWJRqrM6jiy2h9I9TRrCKAiGh5jT47FYKLwosTtV245l/ZhDb6eTVfEFT6TSLEoyfx9cCtTUvfMtXYl8eN9wlFYYpH8MSWbMD14eEkKBTWg=" + on_success: change + on_failure: always From webhook-mailer at python.org Sat Oct 20 12:51:00 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 20 Oct 2018 16:51:00 -0000 Subject: [Python-checkins] bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) Message-ID: https://github.com/python/cpython/commit/d404ffa8adf252d49731fbd09b740360577274c8 commit: d404ffa8adf252d49731fbd09b740360577274c8 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Ned Deily date: 2018-10-20T00:42:13-04:00 summary: bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850) * Add News entry for the change in multiprocessing.reduction.recvfds made in GH-9613. (cherry picked from commit bd036d3d15fc1310ccc32a43a3296b8c157ac221) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst new file mode 100644 index 000000000000..4f4a7f74864f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst @@ -0,0 +1,3 @@ +Use :func:`socket.CMSG_SPACE` to calculate ancillary data size instead of +:func:`socket.CMSG_LEN` in :func:`multiprocessing.reduction.recvfds` as +:rfc:`3542` requires the use of the former for portable applications. From webhook-mailer at python.org Sat Oct 20 12:57:25 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 20 Oct 2018 16:57:25 -0000 Subject: [Python-checkins] bpo-34909: NEWS entry. Message-ID: https://github.com/python/cpython/commit/03ca8b5f23e9fe122bb0ca80397a2481c10cd7c4 commit: 03ca8b5f23e9fe122bb0ca80397a2481c10cd7c4 branch: 3.7 author: Ned Deily committer: Ned Deily date: 2018-10-20T00:35:43-04:00 summary: bpo-34909: NEWS entry. files: A Misc/NEWS.d/next/Library/2018-10-20-00-35-19.bpo-34909.Ew_8DC.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-20-00-35-19.bpo-34909.Ew_8DC.rst b/Misc/NEWS.d/next/Library/2018-10-20-00-35-19.bpo-34909.Ew_8DC.rst new file mode 100644 index 000000000000..b71b69ad8522 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-20-00-35-19.bpo-34909.Ew_8DC.rst @@ -0,0 +1,2 @@ +Enum: fix grandchildren subclassing when parent mixed with concrete data +types. From webhook-mailer at python.org Sat Oct 20 13:36:42 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 20 Oct 2018 17:36:42 -0000 Subject: [Python-checkins] [3.7] Remove duplicate NEWS entries due to cherry-picking (GH-10012) Message-ID: https://github.com/python/cpython/commit/f141ddaa30a0c5741a3db623072b90b8b1307368 commit: f141ddaa30a0c5741a3db623072b90b8b1307368 branch: 3.7 author: Ned Deily committer: GitHub date: 2018-10-20T13:36:39-04:00 summary: [3.7] Remove duplicate NEWS entries due to cherry-picking (GH-10012) files: D Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst D Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst b/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst deleted file mode 100644 index a58b3dd35419..000000000000 --- a/Misc/NEWS.d/next/Library/2018-10-13-11-14-13.bpo-34970.SrJTY7.rst +++ /dev/null @@ -1 +0,0 @@ -Protect tasks weak set manipulation in ``asyncio.all_tasks()`` diff --git a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst deleted file mode 100644 index 4f4a7f74864f..000000000000 --- a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst +++ /dev/null @@ -1,3 +0,0 @@ -Use :func:`socket.CMSG_SPACE` to calculate ancillary data size instead of -:func:`socket.CMSG_LEN` in :func:`multiprocessing.reduction.recvfds` as -:rfc:`3542` requires the use of the former for portable applications. From webhook-mailer at python.org Sat Oct 20 13:43:42 2018 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 20 Oct 2018 17:43:42 -0000 Subject: [Python-checkins] [3.6] Remove duplicate NEWS entry due to cherry-picking (GH-10013) Message-ID: https://github.com/python/cpython/commit/7cba835cc5d3bb6babaecd904a29f88c477b29b3 commit: 7cba835cc5d3bb6babaecd904a29f88c477b29b3 branch: 3.6 author: Ned Deily committer: GitHub date: 2018-10-20T13:43:39-04:00 summary: [3.6] Remove duplicate NEWS entry due to cherry-picking (GH-10013) files: D Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst diff --git a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst b/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst deleted file mode 100644 index 4f4a7f74864f..000000000000 --- a/Misc/NEWS.d/next/Library/2018-10-13-19-15-23.bpo-34521.YPaiTK.rst +++ /dev/null @@ -1,3 +0,0 @@ -Use :func:`socket.CMSG_SPACE` to calculate ancillary data size instead of -:func:`socket.CMSG_LEN` in :func:`multiprocessing.reduction.recvfds` as -:rfc:`3542` requires the use of the former for portable applications. From webhook-mailer at python.org Sat Oct 20 14:32:10 2018 From: webhook-mailer at python.org (Senthil Kumaran) Date: Sat, 20 Oct 2018 18:32:10 -0000 Subject: [Python-checkins] bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005) Message-ID: https://github.com/python/cpython/commit/eeab510bb7e51802c18b3770cbb23ae0ca91da6b commit: eeab510bb7e51802c18b3770cbb23ae0ca91da6b branch: master author: Senthil Kumaran committer: GitHub date: 2018-10-20T11:32:07-07:00 summary: bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005) * bpo-34576 - Fix the formatting for security considerations in http.server.rst * Address review comment. files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 0b93c62288b1..45bb529f8c07 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -16,12 +16,12 @@ This module defines classes for implementing HTTP servers (Web servers). -Security Considerations ------------------------ -http.server is meant for demo purposes and does not implement the stringent -security checks needed of real HTTP server. We do not recommend -using this module directly in production. +.. warning:: + + :mod:`http.server` is meant for demo purposes and does not implement the + stringent security checks needed of a real HTTP server. We do not recommend + using this module directly in production. One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. From webhook-mailer at python.org Sat Oct 20 16:27:55 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sat, 20 Oct 2018 20:27:55 -0000 Subject: [Python-checkins] [2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585) Message-ID: https://github.com/python/cpython/commit/18c44cc0c13eed792e286ddc1d331951e723aeb9 commit: 18c44cc0c13eed792e286ddc1d331951e723aeb9 branch: 2.7 author: Cheryl Sabella committer: Terry Jan Reedy date: 2018-10-20T16:27:51-04:00 summary: [2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585) (cherry picked from commit a96c96f5dab68d4e611af4b8caefd7268533fd9a) files: A Misc/NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst M Lib/idlelib/FileList.py M Lib/idlelib/PyShell.py M Lib/idlelib/run.py diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py index 8318ff17b2df..46979e33e358 100644 --- a/Lib/idlelib/FileList.py +++ b/Lib/idlelib/FileList.py @@ -107,8 +107,10 @@ def canonize(self, filename): def _test(): from idlelib.EditorWindow import fixwordbreaks + from idlelib.run import fix_scaling import sys root = Tk() + fix_scaling(root) fixwordbreaks(root) root.withdraw() flist = FileList(root) diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 337530ab8864..db854b65e22a 100755 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1552,6 +1552,8 @@ def main(): # start editor and/or shell windows: root = Tk(className="Idle") root.withdraw() + from idlelib.run import fix_scaling + fix_scaling(root) # set application icon icondir = os.path.join(os.path.dirname(__file__), 'Icons') diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 466c61ea341a..518afabd1dbb 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -155,6 +155,7 @@ def show_socket_error(err, address): import Tkinter import tkMessageBox root = Tkinter.Tk() + fix_scaling(root) root.withdraw() if err.args[0] == 61: # connection refused msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\ @@ -240,6 +241,19 @@ def exit(): capture_warnings(False) sys.exit(0) + +def fix_scaling(root): + """Scale fonts on HiDPI displays.""" + import tkFont + scaling = float(root.tk.call('tk', 'scaling')) + if scaling > 1.4: + for name in tkFont.names(root): + font = tkFont.Font(root=root, name=name, exists=True) + size = int(font['size']) + if size < 0: + font['size'] = int(round(-0.75*size)) + + class MyRPCServer(rpc.RPCServer): def handle_error(self, request, client_address): diff --git a/Misc/NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst b/Misc/NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst new file mode 100644 index 000000000000..68d68cb1c860 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2017-09-18-10-43-03.bpo-31500.Y_YDxA.rst @@ -0,0 +1 @@ +Default fonts now are scaled on HiDPI displays. From webhook-mailer at python.org Sat Oct 20 17:39:06 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Sat, 20 Oct 2018 21:39:06 -0000 Subject: [Python-checkins] bpo-35020: Link to sorting examples from list.sort() (GH-9931) Message-ID: https://github.com/python/cpython/commit/890a4b92933be8e7c554222d99ef829c88fa8637 commit: 890a4b92933be8e7c554222d99ef829c88fa8637 branch: master author: Xtreak committer: Raymond Hettinger date: 2018-10-20T14:39:03-07:00 summary: bpo-35020: Link to sorting examples from list.sort() (GH-9931) files: M Doc/howto/sorting.rst M Doc/library/stdtypes.rst diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst index 128044662899..b2fccb19f5d4 100644 --- a/Doc/howto/sorting.rst +++ b/Doc/howto/sorting.rst @@ -145,6 +145,17 @@ ascending *age*, do the *age* sort first and then sort again using *grade*: >>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on primary key, descending [('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)] +This can be abstracted out into a wrapper function that can take a list and +tuples of field and order to sort them on multiple passes. + + >>> def multisort(xs, specs): + ... for key, reverse in reversed(specs): + ... xs.sort(key=attrgetter(key), reverse=reverse) + ... return xs + + >>> multisort(list(student_objects), (('grade', True), ('age', False))) + [('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)] + The `Timsort `_ algorithm used in Python does multiple sorts efficiently because it can take advantage of any ordering already present in a dataset. @@ -246,7 +257,7 @@ To convert to a key function, just wrap the old comparison function: .. testsetup:: - from functools import cmp_to_key + >>> from functools import cmp_to_key .. doctest:: diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index d0d5c6157290..01fb5d5e15cd 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1201,6 +1201,8 @@ application). --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade). + For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`. + .. impl-detail:: While a list is being sorted, the effect of attempting to mutate, or even @@ -4752,4 +4754,3 @@ types, where they are relevant. Some of these are not reported by the .. [5] To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted. - From webhook-mailer at python.org Sat Oct 20 19:34:16 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sat, 20 Oct 2018 23:34:16 -0000 Subject: [Python-checkins] bpo-31500: Default fonts now are scaled on HiDPI displays. (#10015) Message-ID: https://github.com/python/cpython/commit/f125d788ff71095390a9e190da6722eb00166cd4 commit: f125d788ff71095390a9e190da6722eb00166cd4 branch: 2.7 author: Terry Jan Reedy committer: GitHub date: 2018-10-20T19:34:12-04:00 summary: bpo-31500: Default fonts now are scaled on HiDPI displays. (#10015) [2.7] bpo-31500: Add idlelib news items about HiDPI scaling files: M Lib/idlelib/NEWS.txt diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 257e28833e98..7eb30a1b4fc0 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -4,6 +4,8 @@ What's New in IDLE 2.7.16? ========================== *Release date: 2019-01-01?* +bpo-31500: Default fonts now are scaled on HiDPI displays. + bpo-34275: Make calltips always visible on Mac. Patch by Kevin Walzer. From webhook-mailer at python.org Sat Oct 20 19:51:08 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sat, 20 Oct 2018 23:51:08 -0000 Subject: [Python-checkins] Remove ">>>" from testsetup. (GH-10017) Message-ID: https://github.com/python/cpython/commit/12d0ff12305957511c9da22513858adbcef72a95 commit: 12d0ff12305957511c9da22513858adbcef72a95 branch: master author: Benjamin Peterson committer: GitHub date: 2018-10-20T16:51:05-07:00 summary: Remove ">>>" from testsetup. (GH-10017) Fixes doc build breakage from 890a4b92933be8e7c554222d99ef829c88fa8637. files: M Doc/howto/sorting.rst diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst index b2fccb19f5d4..1d6d5c45b4d9 100644 --- a/Doc/howto/sorting.rst +++ b/Doc/howto/sorting.rst @@ -257,7 +257,7 @@ To convert to a key function, just wrap the old comparison function: .. testsetup:: - >>> from functools import cmp_to_key + from functools import cmp_to_key .. doctest:: From webhook-mailer at python.org Sat Oct 20 20:07:59 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 21 Oct 2018 00:07:59 -0000 Subject: [Python-checkins] closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961) Message-ID: https://github.com/python/cpython/commit/94451182ccd6729c11338926d8a3d11645e86626 commit: 94451182ccd6729c11338926d8a3d11645e86626 branch: master author: Max B?langer committer: Benjamin Peterson date: 2018-10-20T17:07:54-07:00 summary: closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961) Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions files: A Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst M Modules/timemodule.c diff --git a/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst new file mode 100644 index 000000000000..aebd1af9351c --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst @@ -0,0 +1,2 @@ +Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule`` +on macOS. diff --git a/Modules/timemodule.c b/Modules/timemodule.c index f41d6fab95ba..01eb9f69c4a7 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1723,6 +1723,8 @@ PyInit_time(void) /* Set, or reset, module variables like time.timezone */ PyInit_timezone(m); +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) + #ifdef CLOCK_REALTIME PyModule_AddIntMacro(m, CLOCK_REALTIME); #endif @@ -1751,6 +1753,8 @@ PyInit_time(void) PyModule_AddIntMacro(m, CLOCK_UPTIME); #endif +#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */ + if (!initialized) { if (PyStructSequence_InitType2(&StructTimeType, &struct_time_type_desc) < 0) From webhook-mailer at python.org Sat Oct 20 20:30:58 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 21 Oct 2018 00:30:58 -0000 Subject: [Python-checkins] closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961) Message-ID: https://github.com/python/cpython/commit/beb83d013e0295c987087febf2be78b1da389b15 commit: beb83d013e0295c987087febf2be78b1da389b15 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-20T17:30:54-07:00 summary: closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961) Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions (cherry picked from commit 94451182ccd6729c11338926d8a3d11645e86626) Co-authored-by: Max B?langer files: A Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst M Modules/timemodule.c diff --git a/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst new file mode 100644 index 000000000000..aebd1af9351c --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst @@ -0,0 +1,2 @@ +Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule`` +on macOS. diff --git a/Modules/timemodule.c b/Modules/timemodule.c index f66f098740b2..6bb1ffb163d7 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1350,6 +1350,8 @@ PyInit_time(void) /* Set, or reset, module variables like time.timezone */ PyInit_timezone(m); +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) + #ifdef CLOCK_REALTIME PyModule_AddIntMacro(m, CLOCK_REALTIME); #endif @@ -1369,6 +1371,8 @@ PyInit_time(void) PyModule_AddIntMacro(m, CLOCK_THREAD_CPUTIME_ID); #endif +#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */ + if (!initialized) { if (PyStructSequence_InitType2(&StructTimeType, &struct_time_type_desc) < 0) From webhook-mailer at python.org Sat Oct 20 20:41:44 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 21 Oct 2018 00:41:44 -0000 Subject: [Python-checkins] closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961) Message-ID: https://github.com/python/cpython/commit/002aef3f66a9f8da635e20860622f2e539a0b611 commit: 002aef3f66a9f8da635e20860622f2e539a0b611 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-20T17:41:38-07:00 summary: closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961) Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions (cherry picked from commit 94451182ccd6729c11338926d8a3d11645e86626) Co-authored-by: Max B?langer files: A Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst M Modules/timemodule.c diff --git a/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst new file mode 100644 index 000000000000..aebd1af9351c --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst @@ -0,0 +1,2 @@ +Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule`` +on macOS. diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 7264ad616700..cd287f595b14 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1700,6 +1700,8 @@ PyInit_time(void) /* Set, or reset, module variables like time.timezone */ PyInit_timezone(m); +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) + #ifdef CLOCK_REALTIME PyModule_AddIntMacro(m, CLOCK_REALTIME); #endif @@ -1728,6 +1730,8 @@ PyInit_time(void) PyModule_AddIntMacro(m, CLOCK_UPTIME); #endif +#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */ + if (!initialized) { if (PyStructSequence_InitType2(&StructTimeType, &struct_time_type_desc) < 0) From webhook-mailer at python.org Sun Oct 21 00:22:18 2018 From: webhook-mailer at python.org (Nick Coghlan) Date: Sun, 21 Oct 2018 04:22:18 -0000 Subject: [Python-checkins] Update codeowners to match experts list change (#10022) Message-ID: https://github.com/python/cpython/commit/2f73ed69130cdf63b773275f430c9abdab0757ad commit: 2f73ed69130cdf63b773275f430c9abdab0757ad branch: master author: Nick Coghlan committer: GitHub date: 2018-10-21T14:22:15+10:00 summary: Update codeowners to match experts list change (#10022) files: M .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2e98e14a3d6f..4d4d352601b8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -59,7 +59,7 @@ Python/bootstrap_hash.c @python/crypto-team **/*queue* @rhettinger **/*bisect* @rhettinger **/*heapq* @rhettinger -**/*functools* @ncoghlan @rhettinger +**/*functools* @rhettinger **/*decimal* @rhettinger @skrah **/*dataclasses* @ericvsmith From webhook-mailer at python.org Sun Oct 21 03:09:42 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 21 Oct 2018 07:09:42 -0000 Subject: [Python-checkins] bpo-35029: Replace the SyntaxWarning exception with a SyntaxError. (GH-9999) Message-ID: https://github.com/python/cpython/commit/d31e7730cd5d74efbd7320751dacd51d09cc415d commit: d31e7730cd5d74efbd7320751dacd51d09cc415d branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-21T10:09:39+03:00 summary: bpo-35029: Replace the SyntaxWarning exception with a SyntaxError. (GH-9999) If SyntaxWarning was raised as an exception, it will be replaced with a SyntaxError for better error reporting. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-20-10-26-15.bpo-35029.t4tZcQ.rst M Lib/test/test_grammar.py M Python/compile.c diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 9dd42b4f5dab..3d8b1514f0cd 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -5,6 +5,7 @@ import inspect import unittest import sys +import warnings # testing import * from sys import * @@ -1099,6 +1100,14 @@ def testAssert2(self): else: self.fail("AssertionError not raised by 'assert False'") + with self.assertWarnsRegex(SyntaxWarning, 'assertion is always true'): + compile('assert(x, "msg")', '', 'exec') + with warnings.catch_warnings(): + warnings.filterwarnings('error', category=SyntaxWarning) + with self.assertRaisesRegex(SyntaxError, 'assertion is always true'): + compile('assert(x, "msg")', '', 'exec') + compile('assert x, "msg"', '', 'exec') + ### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef # Tested below diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-20-10-26-15.bpo-35029.t4tZcQ.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-20-10-26-15.bpo-35029.t4tZcQ.rst new file mode 100644 index 000000000000..3644c4410fba --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-20-10-26-15.bpo-35029.t4tZcQ.rst @@ -0,0 +1,2 @@ +:exc:`SyntaxWarning` raised as an exception at code generation time will be +now replaced with a :exc:`SyntaxError` for better error reporting. diff --git a/Python/compile.c b/Python/compile.c index 78b7baf3235f..11958d384175 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -174,6 +174,7 @@ static int compiler_addop(struct compiler *, int); static int compiler_addop_i(struct compiler *, int, Py_ssize_t); static int compiler_addop_j(struct compiler *, int, basicblock *, int); static int compiler_error(struct compiler *, const char *); +static int compiler_warn(struct compiler *, const char *); static int compiler_nameop(struct compiler *, identifier, expr_context_ty); static PyCodeObject *compiler_mod(struct compiler *, mod_ty); @@ -2971,7 +2972,6 @@ compiler_assert(struct compiler *c, stmt_ty s) { static PyObject *assertion_error = NULL; basicblock *end; - PyObject* msg; if (c->c_optimize) return 1; @@ -2981,18 +2981,13 @@ compiler_assert(struct compiler *c, stmt_ty s) return 0; } if (s->v.Assert.test->kind == Tuple_kind && - asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) { - msg = PyUnicode_FromString("assertion is always true, " - "perhaps remove parentheses?"); - if (msg == NULL) - return 0; - if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, - c->c_filename, c->u->u_lineno, - NULL, NULL) == -1) { - Py_DECREF(msg); + asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) + { + if (!compiler_warn(c, "assertion is always true, " + "perhaps remove parentheses?")) + { return 0; } - Py_DECREF(msg); } end = compiler_new_block(c); if (end == NULL) @@ -4793,6 +4788,31 @@ compiler_error(struct compiler *c, const char *errstr) return 0; } +/* Emits a SyntaxWarning and returns 1 on success. + If a SyntaxWarning raised as error, replaces it with a SyntaxError + and returns 0. +*/ +static int +compiler_warn(struct compiler *c, const char *errstr) +{ + PyObject *msg = PyUnicode_FromString(errstr); + if (msg == NULL) { + return 0; + } + if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, c->c_filename, + c->u->u_lineno, NULL, NULL) < 0) + { + Py_DECREF(msg); + if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { + PyErr_Clear(); + return compiler_error(c, errstr); + } + return 0; + } + Py_DECREF(msg); + return 1; +} + static int compiler_handle_subscr(struct compiler *c, const char *kind, expr_context_ty ctx) From webhook-mailer at python.org Sun Oct 21 03:10:27 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 21 Oct 2018 07:10:27 -0000 Subject: [Python-checkins] [2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (GH-9968) Message-ID: https://github.com/python/cpython/commit/427b8c7f7dcdbff21de78b10d9ad05c825480618 commit: 427b8c7f7dcdbff21de78b10d9ad05c825480618 branch: 2.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-21T10:10:24+03:00 summary: [2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (GH-9968) (cherry picked from commit 1deea5e53991b46351f6bb395b22365c9455ed88). (cherry picked from commit bd9c2ce7acaef45f23c2659b854fc9925096d040) Co-authored-by: Juliette Monsel files: A Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst M Lib/lib-tk/Tkinter.py M Lib/lib-tk/test/test_tkinter/test_widgets.py diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 2f3a3f12a512..6c02955928ec 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -3582,7 +3582,7 @@ def selection_adjust(self, index): select to commands. If the selection isn't currently in the spinbox, then a new selection is created to include the characters between index and the most recent selection - anchor point, inclusive. Returns an empty string. + anchor point, inclusive. """ return self.selection("adjust", index) @@ -3590,7 +3590,7 @@ def selection_clear(self): """Clear the selection If the selection isn't in this widget then the - command has no effect. Returns an empty string. + command has no effect. """ return self.selection("clear") @@ -3598,9 +3598,9 @@ def selection_element(self, element=None): """Sets or gets the currently selected element. If a spinbutton element is specified, it will be - displayed depressed + displayed depressed. """ - return self.selection("element", element) + return self.tk.call(self._w, 'selection', 'element', element) ########################################################################### diff --git a/Lib/lib-tk/test/test_tkinter/test_widgets.py b/Lib/lib-tk/test/test_tkinter/test_widgets.py index db2cd9db2430..4b196ac5d510 100644 --- a/Lib/lib-tk/test/test_tkinter/test_widgets.py +++ b/Lib/lib-tk/test/test_tkinter/test_widgets.py @@ -471,6 +471,14 @@ def test_bbox(self): self.assertRaises(TypeError, widget.bbox) self.assertRaises(TypeError, widget.bbox, 0, 1) + def test_selection_element(self): + widget = self.create() + self.assertEqual(widget.selection_element(), "none") + widget.selection_element("buttonup") + self.assertEqual(widget.selection_element(), "buttonup") + widget.selection_element("buttondown") + self.assertEqual(widget.selection_element(), "buttondown") + @add_standard_options(StandardOptionsTests) class TextTest(AbstractWidgetTest, unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst new file mode 100644 index 000000000000..7c1f7bb59760 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst @@ -0,0 +1,2 @@ +Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. Patch by +Juliette Monsel. From webhook-mailer at python.org Sun Oct 21 03:22:05 2018 From: webhook-mailer at python.org (Nick Coghlan) Date: Sun, 21 Oct 2018 07:22:05 -0000 Subject: [Python-checkins] bpo-8525: help() on a type now shows builtin subclasses (GH-5066) Message-ID: https://github.com/python/cpython/commit/a323cdcb33c8c856e5668acfb2c67ab5198672c4 commit: a323cdcb33c8c856e5668acfb2c67ab5198672c4 branch: master author: Sanyam Khurana <8039608+CuriousLearner at users.noreply.github.com> committer: Nick Coghlan date: 2018-10-21T17:22:02+10:00 summary: bpo-8525: help() on a type now shows builtin subclasses (GH-5066) For builtin types with builtin subclasses, help() on the type now shows up to 4 of the subclasses. This partially replaces the exception hierarchy information previously displayed in Python 2.7. files: A Misc/NEWS.d/next/Library/2018-01-01-00-16-59.bpo-8525.Dq8s63.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 8a6b27b16e52..3a461714821d 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1254,6 +1254,24 @@ def makename(c, m=object.__module__): push(' ' + makename(base)) push('') + # List the built-in subclasses, if any: + subclasses = sorted( + (str(cls.__name__) for cls in object.__subclasses__() + if not cls.__name__.startswith("_") and cls.__module__ == "builtins"), + key=str.lower + ) + no_of_subclasses = len(subclasses) + MAX_SUBCLASSES_TO_DISPLAY = 4 + if subclasses: + push("Built-in subclasses:") + for subclassname in subclasses[:MAX_SUBCLASSES_TO_DISPLAY]: + push(' ' + subclassname) + if no_of_subclasses > MAX_SUBCLASSES_TO_DISPLAY: + push(' ... and ' + + str(no_of_subclasses - MAX_SUBCLASSES_TO_DISPLAY) + + ' other subclasses') + push('') + # Cute little class to pump out a horizontal rule between sections. class HorizontalRule: def __init__(self): diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 06f872999515..6cd81ec5c334 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -517,6 +517,124 @@ def test_stripid(self): self.assertEqual(stripid(""), "") + def test_builtin_with_more_than_four_children(self): + """Tests help on builtin object which have more than four child classes. + + When running help() on a builtin class which has child classes, it + should contain a "Built-in subclasses" section and only 4 classes + should be displayed with a hint on how many more subclasses are present. + For example: + + >>> help(object) + Help on class object in module builtins: + + class object + | The most base type + | + | Built-in subclasses: + | async_generator + | BaseException + | builtin_function_or_method + | bytearray + | ... and 82 other subclasses + """ + doc = pydoc.TextDoc() + text = doc.docclass(object) + snip = (" | Built-in subclasses:\n" + " | async_generator\n" + " | BaseException\n" + " | builtin_function_or_method\n" + " | bytearray\n" + " | ... and \\d+ other subclasses") + self.assertRegex(text, snip) + + def test_builtin_with_child(self): + """Tests help on builtin object which have only child classes. + + When running help() on a builtin class which has child classes, it + should contain a "Built-in subclasses" section. For example: + + >>> help(ArithmeticError) + Help on class ArithmeticError in module builtins: + + class ArithmeticError(Exception) + | Base class for arithmetic errors. + | + ... + | + | Built-in subclasses: + | FloatingPointError + | OverflowError + | ZeroDivisionError + """ + doc = pydoc.TextDoc() + text = doc.docclass(ArithmeticError) + snip = (" | Built-in subclasses:\n" + " | FloatingPointError\n" + " | OverflowError\n" + " | ZeroDivisionError") + self.assertIn(snip, text) + + def test_builtin_with_grandchild(self): + """Tests help on builtin classes which have grandchild classes. + + When running help() on a builtin class which has child classes, it + should contain a "Built-in subclasses" section. However, if it also has + grandchildren, these should not show up on the subclasses section. + For example: + + >>> help(Exception) + Help on class Exception in module builtins: + + class Exception(BaseException) + | Common base class for all non-exit exceptions. + | + ... + | + | Built-in subclasses: + | ArithmeticError + | AssertionError + | AttributeError + ... + """ + doc = pydoc.TextDoc() + text = doc.docclass(Exception) + snip = (" | Built-in subclasses:\n" + " | ArithmeticError\n" + " | AssertionError\n" + " | AttributeError") + self.assertIn(snip, text) + # Testing that the grandchild ZeroDivisionError does not show up + self.assertNotIn('ZeroDivisionError', text) + + def test_builtin_no_child(self): + """Tests help on builtin object which have no child classes. + + When running help() on a builtin class which has no child classes, it + should not contain any "Built-in subclasses" section. For example: + + >>> help(ZeroDivisionError) + + Help on class ZeroDivisionError in module builtins: + + class ZeroDivisionError(ArithmeticError) + | Second argument to a division or modulo operation was zero. + | + | Method resolution order: + | ZeroDivisionError + | ArithmeticError + | Exception + | BaseException + | object + | + | Methods defined here: + ... + """ + doc = pydoc.TextDoc() + text = doc.docclass(ZeroDivisionError) + # Testing that the subclasses section does not appear + self.assertNotIn('Built-in subclasses', text) + @unittest.skipIf(sys.flags.optimize >= 2, 'Docstrings are omitted with -O2 and above') @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(), diff --git a/Misc/NEWS.d/next/Library/2018-01-01-00-16-59.bpo-8525.Dq8s63.rst b/Misc/NEWS.d/next/Library/2018-01-01-00-16-59.bpo-8525.Dq8s63.rst new file mode 100644 index 000000000000..d8af500ab63c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-01-01-00-16-59.bpo-8525.Dq8s63.rst @@ -0,0 +1,4 @@ +help() on a type now displays builtin subclasses. This is intended primarily +to help with notification of more specific exception subclasses. + +Patch by Sanyam Khurana. From solipsis at pitrou.net Sun Oct 21 05:08:53 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 21 Oct 2018 09:08:53 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=4 Message-ID: <20181021090853.1.659804CF316A4AC9@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 1] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, 1, -2] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/refloguCOAQz', '--timeout', '7200'] From webhook-mailer at python.org Sun Oct 21 08:25:59 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 21 Oct 2018 12:25:59 -0000 Subject: [Python-checkins] bpo-34973: Fix crash in bytes constructor. (GH-9841) Message-ID: https://github.com/python/cpython/commit/914f9a078f997e58cfcfabcbb30fafdd1f277bef commit: 914f9a078f997e58cfcfabcbb30fafdd1f277bef branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-21T15:25:53+03:00 summary: bpo-34973: Fix crash in bytes constructor. (GH-9841) Constructing bytes from mutating list could cause a crash. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst M Lib/test/test_bytes.py M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index b9c5b628c4eb..145411efbb9d 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -113,6 +113,23 @@ def test_from_list(self): b = self.type2test([1, 2, 3]) self.assertEqual(b, b"\x01\x02\x03") + def test_from_mutating_list(self): + # Issue #34973: Crash in bytes constructor with mutating list. + class X: + def __index__(self): + a.clear() + return 42 + a = [X(), X()] + self.assertEqual(bytes(a), b'*') + + class Y: + def __index__(self): + if len(a) < 1000: + a.append(self) + return 42 + a = [Y()] + self.assertEqual(bytes(a), b'*' * 1000) # should not crash + def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), Indexable(255)]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst new file mode 100644 index 000000000000..6e403cd4cec6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst @@ -0,0 +1,2 @@ +Fixed crash in :func:`bytes` when the :class:`list` argument is mutated +while it is iterated. diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 22d46878a38e..d1057b9c0c2d 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2639,49 +2639,83 @@ _PyBytes_FromBuffer(PyObject *x) return NULL; } -#define _PyBytes_FROM_LIST_BODY(x, GET_ITEM) \ - do { \ - PyObject *bytes; \ - Py_ssize_t i; \ - Py_ssize_t value; \ - char *str; \ - PyObject *item; \ - \ - bytes = PyBytes_FromStringAndSize(NULL, Py_SIZE(x)); \ - if (bytes == NULL) \ - return NULL; \ - str = ((PyBytesObject *)bytes)->ob_sval; \ - \ - for (i = 0; i < Py_SIZE(x); i++) { \ - item = GET_ITEM((x), i); \ - value = PyNumber_AsSsize_t(item, NULL); \ - if (value == -1 && PyErr_Occurred()) \ - goto error; \ - \ - if (value < 0 || value >= 256) { \ - PyErr_SetString(PyExc_ValueError, \ - "bytes must be in range(0, 256)"); \ - goto error; \ - } \ - *str++ = (char) value; \ - } \ - return bytes; \ - \ - error: \ - Py_DECREF(bytes); \ - return NULL; \ - } while (0) - static PyObject* _PyBytes_FromList(PyObject *x) { - _PyBytes_FROM_LIST_BODY(x, PyList_GET_ITEM); + Py_ssize_t i, size = PyList_GET_SIZE(x); + Py_ssize_t value; + char *str; + PyObject *item; + _PyBytesWriter writer; + + _PyBytesWriter_Init(&writer); + str = _PyBytesWriter_Alloc(&writer, size); + if (str == NULL) + return NULL; + writer.overallocate = 1; + size = writer.allocated; + + for (i = 0; i < PyList_GET_SIZE(x); i++) { + item = PyList_GET_ITEM(x, i); + Py_INCREF(item); + value = PyNumber_AsSsize_t(item, NULL); + Py_DECREF(item); + if (value == -1 && PyErr_Occurred()) + goto error; + + if (value < 0 || value >= 256) { + PyErr_SetString(PyExc_ValueError, + "bytes must be in range(0, 256)"); + goto error; + } + + if (i >= size) { + str = _PyBytesWriter_Resize(&writer, str, size+1); + if (str == NULL) + return NULL; + size = writer.allocated; + } + *str++ = (char) value; + } + return _PyBytesWriter_Finish(&writer, str); + + error: + _PyBytesWriter_Dealloc(&writer); + return NULL; } static PyObject* _PyBytes_FromTuple(PyObject *x) { - _PyBytes_FROM_LIST_BODY(x, PyTuple_GET_ITEM); + PyObject *bytes; + Py_ssize_t i, size = PyTuple_GET_SIZE(x); + Py_ssize_t value; + char *str; + PyObject *item; + + bytes = PyBytes_FromStringAndSize(NULL, size); + if (bytes == NULL) + return NULL; + str = ((PyBytesObject *)bytes)->ob_sval; + + for (i = 0; i < size; i++) { + item = PyTuple_GET_ITEM(x, i); + value = PyNumber_AsSsize_t(item, NULL); + if (value == -1 && PyErr_Occurred()) + goto error; + + if (value < 0 || value >= 256) { + PyErr_SetString(PyExc_ValueError, + "bytes must be in range(0, 256)"); + goto error; + } + *str++ = (char) value; + } + return bytes; + + error: + Py_DECREF(bytes); + return NULL; } static PyObject * From webhook-mailer at python.org Sun Oct 21 08:29:15 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 21 Oct 2018 12:29:15 -0000 Subject: [Python-checkins] bpo-34984: Improve error messages for bytes and bytearray constructors. (GH-9874) Message-ID: https://github.com/python/cpython/commit/2c2044e789875ea736ec42e216fdbe61816fbe28 commit: 2c2044e789875ea736ec42e216fdbe61816fbe28 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-21T15:29:12+03:00 summary: bpo-34984: Improve error messages for bytes and bytearray constructors. (GH-9874) files: M Lib/test/test_bytes.py M Objects/bytearrayobject.c M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 145411efbb9d..cc433217ce16 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -169,6 +169,8 @@ class C: self.assertRaises(TypeError, self.type2test, [0.0]) self.assertRaises(TypeError, self.type2test, [None]) self.assertRaises(TypeError, self.type2test, [C()]) + self.assertRaises(TypeError, self.type2test, encoding='ascii') + self.assertRaises(TypeError, self.type2test, errors='ignore') self.assertRaises(TypeError, self.type2test, 0, 'ascii') self.assertRaises(TypeError, self.type2test, b'', 'ascii') self.assertRaises(TypeError, self.type2test, 0, errors='ignore') diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 58fe53bcca47..782e27569780 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -783,7 +783,9 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) if (arg == NULL) { if (encoding != NULL || errors != NULL) { PyErr_SetString(PyExc_TypeError, - "encoding or errors without sequence argument"); + encoding != NULL ? + "encoding without a string argument" : + "errors without a string argument"); return -1; } return 0; @@ -812,7 +814,9 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) /* If it's not unicode, there can't be encoding or errors */ if (encoding != NULL || errors != NULL) { PyErr_SetString(PyExc_TypeError, - "encoding or errors without a string argument"); + encoding != NULL ? + "encoding without a string argument" : + "errors without a string argument"); return -1; } @@ -860,8 +864,14 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) /* Get the iterator */ it = PyObject_GetIter(arg); - if (it == NULL) + if (it == NULL) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + PyErr_Format(PyExc_TypeError, + "cannot convert '%.200s' object to bytearray", + arg->ob_type->tp_name); + } return -1; + } iternext = *Py_TYPE(it)->tp_iternext; /* Run the iterator to exhaustion */ @@ -1626,8 +1636,14 @@ bytearray_extend(PyByteArrayObject *self, PyObject *iterable_of_ints) } it = PyObject_GetIter(iterable_of_ints); - if (it == NULL) + if (it == NULL) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + PyErr_Format(PyExc_TypeError, + "can't extend bytearray with %.100s", + iterable_of_ints->ob_type->tp_name); + } return NULL; + } /* Try to determine the length of the argument. 32 is arbitrary. */ buf_size = PyObject_LengthHint(iterable_of_ints, 32); diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index d1057b9c0c2d..c412393e6c5e 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2537,8 +2537,9 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (x == NULL) { if (encoding != NULL || errors != NULL) { PyErr_SetString(PyExc_TypeError, - "encoding or errors without sequence " - "argument"); + encoding != NULL ? + "encoding without a string argument" : + "errors without a string argument"); return NULL; } return PyBytes_FromStringAndSize(NULL, 0); From webhook-mailer at python.org Sun Oct 21 08:55:55 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 21 Oct 2018 12:55:55 -0000 Subject: [Python-checkins] bpo-34973: Fix crash in bytes constructor. (GH-9841) Message-ID: https://github.com/python/cpython/commit/7f34d550231e047c88a1817b58bda03a33817490 commit: 7f34d550231e047c88a1817b58bda03a33817490 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-21T05:55:52-07:00 summary: bpo-34973: Fix crash in bytes constructor. (GH-9841) Constructing bytes from mutating list could cause a crash. (cherry picked from commit 914f9a078f997e58cfcfabcbb30fafdd1f277bef) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst M Lib/test/test_bytes.py M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index b9c5b628c4eb..145411efbb9d 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -113,6 +113,23 @@ def test_from_list(self): b = self.type2test([1, 2, 3]) self.assertEqual(b, b"\x01\x02\x03") + def test_from_mutating_list(self): + # Issue #34973: Crash in bytes constructor with mutating list. + class X: + def __index__(self): + a.clear() + return 42 + a = [X(), X()] + self.assertEqual(bytes(a), b'*') + + class Y: + def __index__(self): + if len(a) < 1000: + a.append(self) + return 42 + a = [Y()] + self.assertEqual(bytes(a), b'*' * 1000) # should not crash + def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), Indexable(255)]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst new file mode 100644 index 000000000000..6e403cd4cec6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst @@ -0,0 +1,2 @@ +Fixed crash in :func:`bytes` when the :class:`list` argument is mutated +while it is iterated. diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 5b628420937d..711faba64548 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2640,49 +2640,83 @@ _PyBytes_FromBuffer(PyObject *x) return NULL; } -#define _PyBytes_FROM_LIST_BODY(x, GET_ITEM) \ - do { \ - PyObject *bytes; \ - Py_ssize_t i; \ - Py_ssize_t value; \ - char *str; \ - PyObject *item; \ - \ - bytes = PyBytes_FromStringAndSize(NULL, Py_SIZE(x)); \ - if (bytes == NULL) \ - return NULL; \ - str = ((PyBytesObject *)bytes)->ob_sval; \ - \ - for (i = 0; i < Py_SIZE(x); i++) { \ - item = GET_ITEM((x), i); \ - value = PyNumber_AsSsize_t(item, NULL); \ - if (value == -1 && PyErr_Occurred()) \ - goto error; \ - \ - if (value < 0 || value >= 256) { \ - PyErr_SetString(PyExc_ValueError, \ - "bytes must be in range(0, 256)"); \ - goto error; \ - } \ - *str++ = (char) value; \ - } \ - return bytes; \ - \ - error: \ - Py_DECREF(bytes); \ - return NULL; \ - } while (0) - static PyObject* _PyBytes_FromList(PyObject *x) { - _PyBytes_FROM_LIST_BODY(x, PyList_GET_ITEM); + Py_ssize_t i, size = PyList_GET_SIZE(x); + Py_ssize_t value; + char *str; + PyObject *item; + _PyBytesWriter writer; + + _PyBytesWriter_Init(&writer); + str = _PyBytesWriter_Alloc(&writer, size); + if (str == NULL) + return NULL; + writer.overallocate = 1; + size = writer.allocated; + + for (i = 0; i < PyList_GET_SIZE(x); i++) { + item = PyList_GET_ITEM(x, i); + Py_INCREF(item); + value = PyNumber_AsSsize_t(item, NULL); + Py_DECREF(item); + if (value == -1 && PyErr_Occurred()) + goto error; + + if (value < 0 || value >= 256) { + PyErr_SetString(PyExc_ValueError, + "bytes must be in range(0, 256)"); + goto error; + } + + if (i >= size) { + str = _PyBytesWriter_Resize(&writer, str, size+1); + if (str == NULL) + return NULL; + size = writer.allocated; + } + *str++ = (char) value; + } + return _PyBytesWriter_Finish(&writer, str); + + error: + _PyBytesWriter_Dealloc(&writer); + return NULL; } static PyObject* _PyBytes_FromTuple(PyObject *x) { - _PyBytes_FROM_LIST_BODY(x, PyTuple_GET_ITEM); + PyObject *bytes; + Py_ssize_t i, size = PyTuple_GET_SIZE(x); + Py_ssize_t value; + char *str; + PyObject *item; + + bytes = PyBytes_FromStringAndSize(NULL, size); + if (bytes == NULL) + return NULL; + str = ((PyBytesObject *)bytes)->ob_sval; + + for (i = 0; i < size; i++) { + item = PyTuple_GET_ITEM(x, i); + value = PyNumber_AsSsize_t(item, NULL); + if (value == -1 && PyErr_Occurred()) + goto error; + + if (value < 0 || value >= 256) { + PyErr_SetString(PyExc_ValueError, + "bytes must be in range(0, 256)"); + goto error; + } + *str++ = (char) value; + } + return bytes; + + error: + Py_DECREF(bytes); + return NULL; } static PyObject * From webhook-mailer at python.org Sun Oct 21 08:56:13 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 21 Oct 2018 12:56:13 -0000 Subject: [Python-checkins] bpo-34973: Fix crash in bytes constructor. (GH-9841) Message-ID: https://github.com/python/cpython/commit/8bb037167cf3204a7d620ba11fbf43d2a9ec36e6 commit: 8bb037167cf3204a7d620ba11fbf43d2a9ec36e6 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-21T05:56:10-07:00 summary: bpo-34973: Fix crash in bytes constructor. (GH-9841) Constructing bytes from mutating list could cause a crash. (cherry picked from commit 914f9a078f997e58cfcfabcbb30fafdd1f277bef) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst M Lib/test/test_bytes.py M Objects/bytesobject.c diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 8b1973241e45..7fa2a387b271 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -113,6 +113,23 @@ def test_from_list(self): b = self.type2test([1, 2, 3]) self.assertEqual(b, b"\x01\x02\x03") + def test_from_mutating_list(self): + # Issue #34973: Crash in bytes constructor with mutating list. + class X: + def __index__(self): + a.clear() + return 42 + a = [X(), X()] + self.assertEqual(bytes(a), b'*') + + class Y: + def __index__(self): + if len(a) < 1000: + a.append(self) + return 42 + a = [Y()] + self.assertEqual(bytes(a), b'*' * 1000) # should not crash + def test_from_index(self): b = self.type2test([Indexable(), Indexable(1), Indexable(254), Indexable(255)]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst new file mode 100644 index 000000000000..6e403cd4cec6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-13-16-42-03.bpo-34973.B5M-3g.rst @@ -0,0 +1,2 @@ +Fixed crash in :func:`bytes` when the :class:`list` argument is mutated +while it is iterated. diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index cd39ad632bbc..8fcc0b39df1f 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2649,49 +2649,83 @@ _PyBytes_FromBuffer(PyObject *x) return NULL; } -#define _PyBytes_FROM_LIST_BODY(x, GET_ITEM) \ - do { \ - PyObject *bytes; \ - Py_ssize_t i; \ - Py_ssize_t value; \ - char *str; \ - PyObject *item; \ - \ - bytes = PyBytes_FromStringAndSize(NULL, Py_SIZE(x)); \ - if (bytes == NULL) \ - return NULL; \ - str = ((PyBytesObject *)bytes)->ob_sval; \ - \ - for (i = 0; i < Py_SIZE(x); i++) { \ - item = GET_ITEM((x), i); \ - value = PyNumber_AsSsize_t(item, NULL); \ - if (value == -1 && PyErr_Occurred()) \ - goto error; \ - \ - if (value < 0 || value >= 256) { \ - PyErr_SetString(PyExc_ValueError, \ - "bytes must be in range(0, 256)"); \ - goto error; \ - } \ - *str++ = (char) value; \ - } \ - return bytes; \ - \ - error: \ - Py_DECREF(bytes); \ - return NULL; \ - } while (0) - static PyObject* _PyBytes_FromList(PyObject *x) { - _PyBytes_FROM_LIST_BODY(x, PyList_GET_ITEM); + Py_ssize_t i, size = PyList_GET_SIZE(x); + Py_ssize_t value; + char *str; + PyObject *item; + _PyBytesWriter writer; + + _PyBytesWriter_Init(&writer); + str = _PyBytesWriter_Alloc(&writer, size); + if (str == NULL) + return NULL; + writer.overallocate = 1; + size = writer.allocated; + + for (i = 0; i < PyList_GET_SIZE(x); i++) { + item = PyList_GET_ITEM(x, i); + Py_INCREF(item); + value = PyNumber_AsSsize_t(item, NULL); + Py_DECREF(item); + if (value == -1 && PyErr_Occurred()) + goto error; + + if (value < 0 || value >= 256) { + PyErr_SetString(PyExc_ValueError, + "bytes must be in range(0, 256)"); + goto error; + } + + if (i >= size) { + str = _PyBytesWriter_Resize(&writer, str, size+1); + if (str == NULL) + return NULL; + size = writer.allocated; + } + *str++ = (char) value; + } + return _PyBytesWriter_Finish(&writer, str); + + error: + _PyBytesWriter_Dealloc(&writer); + return NULL; } static PyObject* _PyBytes_FromTuple(PyObject *x) { - _PyBytes_FROM_LIST_BODY(x, PyTuple_GET_ITEM); + PyObject *bytes; + Py_ssize_t i, size = PyTuple_GET_SIZE(x); + Py_ssize_t value; + char *str; + PyObject *item; + + bytes = PyBytes_FromStringAndSize(NULL, size); + if (bytes == NULL) + return NULL; + str = ((PyBytesObject *)bytes)->ob_sval; + + for (i = 0; i < size; i++) { + item = PyTuple_GET_ITEM(x, i); + value = PyNumber_AsSsize_t(item, NULL); + if (value == -1 && PyErr_Occurred()) + goto error; + + if (value < 0 || value >= 256) { + PyErr_SetString(PyExc_ValueError, + "bytes must be in range(0, 256)"); + goto error; + } + *str++ = (char) value; + } + return bytes; + + error: + Py_DECREF(bytes); + return NULL; } static PyObject * From webhook-mailer at python.org Sun Oct 21 08:57:35 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Sun, 21 Oct 2018 12:57:35 -0000 Subject: [Python-checkins] bpo-35036: Remove empty log line in the suspicious.py tool (GH-10024) Message-ID: https://github.com/python/cpython/commit/c3f52a59ce8406d9e59253ad4621e4749abdaeef commit: c3f52a59ce8406d9e59253ad4621e4749abdaeef branch: master author: Xtreak committer: Pablo Galindo date: 2018-10-21T13:57:32+01:00 summary: bpo-35036: Remove empty log line in the suspicious.py tool (GH-10024) Previous to commit ee171a2 the logline was working because of self.info() (now deprecated) defaults to an empty message. files: M Doc/tools/extensions/suspicious.py diff --git a/Doc/tools/extensions/suspicious.py b/Doc/tools/extensions/suspicious.py index 8d80f6759bff..494efabc4623 100644 --- a/Doc/tools/extensions/suspicious.py +++ b/Doc/tools/extensions/suspicious.py @@ -148,7 +148,6 @@ def is_ignored(self, line, lineno, issue): return False def report_issue(self, text, lineno, issue): - if not self.any_issue: self.logger.info() self.any_issue = True self.write_log_entry(lineno, issue, text) if py3: From webhook-mailer at python.org Sun Oct 21 10:54:55 2018 From: webhook-mailer at python.org (Julien Palard) Date: Sun, 21 Oct 2018 14:54:55 -0000 Subject: [Python-checkins] bpo-34081: Fix wrong example link that was linking to distutils (GH-8248) Message-ID: https://github.com/python/cpython/commit/121eb1694cab14df857ba6abe9839654cada15cf commit: 121eb1694cab14df857ba6abe9839654cada15cf branch: master author: Xtreak committer: Julien Palard date: 2018-10-21T16:54:52+02:00 summary: bpo-34081: Fix wrong example link that was linking to distutils (GH-8248) files: A Misc/NEWS.d/next/Build/2018-09-06-07-15-20.bpo-34081.cuSTnH.rst M .azure-pipelines/docs-steps.yml M Doc/Makefile diff --git a/.azure-pipelines/docs-steps.yml b/.azure-pipelines/docs-steps.yml index c0404aebdcc5..460576cbc955 100644 --- a/.azure-pipelines/docs-steps.yml +++ b/.azure-pipelines/docs-steps.yml @@ -12,7 +12,7 @@ steps: inputs: versionSpec: '>=3.6' -- script: python -m pip install sphinx~=1.6.1 blurb python-docs-theme +- script: python -m pip install sphinx==1.8.1 blurb python-docs-theme displayName: 'Install build dependencies' - ${{ if ne(parameters.latex, 'true') }}: diff --git a/Doc/Makefile b/Doc/Makefile index 042f960b93e7..50beac58ec38 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -12,7 +12,7 @@ PAPER = SOURCES = DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py) -ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PAPER) \ +ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -W -D latex_elements.papersize=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) .PHONY: help build html htmlhelp latex text changes linkcheck \ diff --git a/Misc/NEWS.d/next/Build/2018-09-06-07-15-20.bpo-34081.cuSTnH.rst b/Misc/NEWS.d/next/Build/2018-09-06-07-15-20.bpo-34081.cuSTnH.rst new file mode 100644 index 000000000000..af385bac231b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-09-06-07-15-20.bpo-34081.cuSTnH.rst @@ -0,0 +1 @@ +Make Sphinx warnings as errors in the Docs Makefile. From solipsis at pitrou.net Mon Oct 22 05:10:19 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 22 Oct 2018 09:10:19 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=1 Message-ID: <20181022091019.1.D8504B7C52227ABA@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, 1, 2] memory blocks, sum=3 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogS4E4Ec', '--timeout', '7200'] From webhook-mailer at python.org Mon Oct 22 15:22:17 2018 From: webhook-mailer at python.org (Tal Einat) Date: Mon, 22 Oct 2018 19:22:17 -0000 Subject: [Python-checkins] bpo-29843: raise AttributeError if given negative _length_ (GH-10029) Message-ID: https://github.com/python/cpython/commit/2447773573e74819e163f8963ab107bc5db123e5 commit: 2447773573e74819e163f8963ab107bc5db123e5 branch: master author: Tal Einat committer: GitHub date: 2018-10-22T18:33:10+03:00 summary: bpo-29843: raise AttributeError if given negative _length_ (GH-10029) Raise ValueError OverflowError in case of a negative _length_ in a ctypes.Array subclass. Also raise TypeError instead of AttributeError for non-integer _length_. Co-authored-by: Oren Milman files: A Misc/NEWS.d/next/Core and Builtins/2018-10-21-17-43-48.bpo-29743.aeCcKR.rst M Lib/ctypes/test/test_arrays.py M Modules/_ctypes/_ctypes.c diff --git a/Lib/ctypes/test/test_arrays.py b/Lib/ctypes/test/test_arrays.py index 6e562cfd24e6..6cfda8b7d2e6 100644 --- a/Lib/ctypes/test/test_arrays.py +++ b/Lib/ctypes/test/test_arrays.py @@ -163,8 +163,6 @@ class Y(T): self.assertEqual(Y()._length_, 187) def test_bad_subclass(self): - import sys - with self.assertRaises(AttributeError): class T(Array): pass @@ -174,14 +172,30 @@ class T(Array): with self.assertRaises(AttributeError): class T(Array): _length_ = 13 - with self.assertRaises(OverflowError): + + def test_bad_length(self): + with self.assertRaises(ValueError): class T(Array): _type_ = c_int - _length_ = sys.maxsize * 2 - with self.assertRaises(AttributeError): + _length_ = - sys.maxsize * 2 + with self.assertRaises(ValueError): + class T(Array): + _type_ = c_int + _length_ = -1 + with self.assertRaises(TypeError): class T(Array): _type_ = c_int _length_ = 1.87 + with self.assertRaises(OverflowError): + class T(Array): + _type_ = c_int + _length_ = sys.maxsize * 2 + + def test_zero_length(self): + # _length_ can be zero. + class T(Array): + _type_ = c_int + _length_ = 0 @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform') @bigmemtest(size=_2G, memuse=1, dry_run=False) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-21-17-43-48.bpo-29743.aeCcKR.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-21-17-43-48.bpo-29743.aeCcKR.rst new file mode 100644 index 000000000000..9e79bb388e85 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-21-17-43-48.bpo-29743.aeCcKR.rst @@ -0,0 +1,4 @@ +Raise :exc:`ValueError` instead of :exc:`OverflowError` in case of a negative +``_length_`` in a :class:`ctypes.Array` subclass. Also raise :exc:`TypeError` +instead of :exc:`AttributeError` for non-integer ``_length_``. +Original patch by Oren Milman. diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 3ae6348fef43..60f6985a6646 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1405,13 +1405,28 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) type_attr = NULL; length_attr = PyObject_GetAttrString((PyObject *)result, "_length_"); - if (!length_attr || !PyLong_Check(length_attr)) { - PyErr_SetString(PyExc_AttributeError, - "class must define a '_length_' attribute, " - "which must be a positive integer"); - Py_XDECREF(length_attr); + if (!length_attr) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_SetString(PyExc_AttributeError, + "class must define a '_length_' attribute"); + } + goto error; + } + + if (!PyLong_Check(length_attr)) { + Py_DECREF(length_attr); + PyErr_SetString(PyExc_TypeError, + "The '_length_' attribute must be an integer"); goto error; } + + if (_PyLong_Sign(length_attr) == -1) { + Py_DECREF(length_attr); + PyErr_SetString(PyExc_ValueError, + "The '_length_' attribute must not be negative"); + goto error; + } + length = PyLong_AsSsize_t(length_attr); Py_DECREF(length_attr); if (length == -1 && PyErr_Occurred()) { From webhook-mailer at python.org Mon Oct 22 15:27:27 2018 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Mon, 22 Oct 2018 19:27:27 -0000 Subject: [Python-checkins] Fix issue 34551 - remove redundant store (#9009) Message-ID: https://github.com/python/cpython/commit/5a95ba29da7e55fe6a8777b6ea4c68f60cf0e407 commit: 5a95ba29da7e55fe6a8777b6ea4c68f60cf0e407 branch: master author: Eric Lippert committer: ?ukasz Langa date: 2018-10-22T16:52:46+01:00 summary: Fix issue 34551 - remove redundant store (#9009) The assignment of i/2 to nk is redundant because on this code path, nk is already the size of the dictionary, and i is already twice the size of the dictionary. I've replaced the store with an assertion that i/2 is nk. files: M Objects/call.c diff --git a/Objects/call.c b/Objects/call.c index 1937a8b2278e..bda05738755a 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -352,7 +352,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs Py_INCREF(k[i+1]); i += 2; } - nk = i / 2; + assert(i / 2 == nk); } else { kwtuple = NULL; From webhook-mailer at python.org Mon Oct 22 15:37:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 22 Oct 2018 19:37:25 -0000 Subject: [Python-checkins] bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959) Message-ID: https://github.com/python/cpython/commit/3df85404d4bf420db3362eeae1345f2cad948a71 commit: 3df85404d4bf420db3362eeae1345f2cad948a71 branch: master author: Paul Ganssle committer: Victor Stinner date: 2018-10-22T18:32:52+02:00 summary: bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959) * Use _PyUnicode_Copy in sanitize_isoformat_str * Use repr in fromisoformat error message This reverses commit 67b74a98b2 per Serhiy Storchaka's suggestion: I suggested to use %R in the error message because including the raw string can be confusing in the case of empty string, or string containing trailing whitespaces, invisible or unprintable characters. We agree that it is better to change both the C and pure Python versions to use repr. * Retain non-sanitized dtstr for error printing This does not create an extra string, it just holds on to a reference to the original input string for purposes of creating the error message. * PEP 7 fixes to from_isoformat * Separate handling of Unicode and other errors In the initial implementation, errors other than encoding errors would both raise an error indicating an invalid format, which would not be true for errors like MemoryError. * Drop needs_decref from _sanitize_isoformat_str Instead _sanitize_isoformat_str returns a new reference, even to the original string. files: M Lib/datetime.py M Lib/test/datetimetester.py M Modules/_datetimemodule.c diff --git a/Lib/datetime.py b/Lib/datetime.py index cff92033c496..292919fd7988 100644 --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -857,7 +857,7 @@ def fromisoformat(cls, date_string): assert len(date_string) == 10 return cls(*_parse_isoformat_date(date_string)) except Exception: - raise ValueError('Invalid isoformat string: %s' % date_string) + raise ValueError(f'Invalid isoformat string: {date_string!r}') # Conversions to string @@ -1369,7 +1369,7 @@ def fromisoformat(cls, time_string): try: return cls(*_parse_isoformat_time(time_string)) except Exception: - raise ValueError('Invalid isoformat string: %s' % time_string) + raise ValueError(f'Invalid isoformat string: {time_string!r}') def strftime(self, fmt): @@ -1646,13 +1646,13 @@ def fromisoformat(cls, date_string): try: date_components = _parse_isoformat_date(dstr) except ValueError: - raise ValueError('Invalid isoformat string: %s' % date_string) + raise ValueError(f'Invalid isoformat string: {date_string!r}') if tstr: try: time_components = _parse_isoformat_time(tstr) except ValueError: - raise ValueError('Invalid isoformat string: %s' % date_string) + raise ValueError(f'Invalid isoformat string: {date_string!r}') else: time_components = [0, 0, 0, 0, None] diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 9c6e71c54d79..122f6b55ba33 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -13,6 +13,7 @@ import os import pickle import random +import re import struct import unittest @@ -2676,6 +2677,14 @@ def test_fromisoformat_fails_datetime(self): with self.assertRaises(ValueError): self.theclass.fromisoformat(bad_str) + def test_fromisoformat_fails_surrogate(self): + # Test that when fromisoformat() fails with a surrogate character as + # the separator, the error message contains the original string + dtstr = "2018-01-03\ud80001:0113" + + with self.assertRaisesRegex(ValueError, re.escape(repr(dtstr))): + self.theclass.fromisoformat(dtstr) + def test_fromisoformat_utc(self): dt_str = '2014-04-19T13:21:13+00:00' dt = self.theclass.fromisoformat(dt_str) diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index cdfa235f0917..bc4caa02d5f1 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -668,8 +668,8 @@ set_date_fields(PyDateTime_Date *self, int y, int m, int d) * String parsing utilities and helper functions */ -static const char* -parse_digits(const char* ptr, int* var, size_t num_digits) +static const char * +parse_digits(const char *ptr, int *var, size_t num_digits) { for (size_t i = 0; i < num_digits; ++i) { unsigned int tmp = (unsigned int)(*(ptr++) - '0'); @@ -683,15 +683,16 @@ parse_digits(const char* ptr, int* var, size_t num_digits) return ptr; } -static int parse_isoformat_date(const char *dtstr, - int* year, int *month, int* day) { +static int +parse_isoformat_date(const char *dtstr, int *year, int *month, int *day) +{ /* Parse the date components of the result of date.isoformat() - * - * Return codes: - * 0: Success - * -1: Failed to parse date component - * -2: Failed to parse dateseparator - */ + * + * Return codes: + * 0: Success + * -1: Failed to parse date component + * -2: Failed to parse dateseparator + */ const char *p = dtstr; p = parse_digits(p, year, 4); if (NULL == p) { @@ -720,8 +721,9 @@ static int parse_isoformat_date(const char *dtstr, } static int -parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, - int* hour, int* minute, int *second, int *microsecond) { +parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, int *hour, + int *minute, int *second, int *microsecond) +{ const char *p = tstr; const char *p_end = tstr_end; int *vals[3] = {hour, minute, second}; @@ -736,12 +738,15 @@ parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, char c = *(p++); if (p >= p_end) { return c != '\0'; - } else if (c == ':') { + } + else if (c == ':') { continue; - } else if (c == '.') { + } + else if (c == '.') { break; - } else { - return -4; // Malformed time separator + } + else { + return -4; // Malformed time separator } } @@ -765,9 +770,10 @@ parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, } static int -parse_isoformat_time(const char *dtstr, size_t dtlen, - int* hour, int *minute, int *second, int *microsecond, - int* tzoffset, int *tzmicrosecond) { +parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute, + int *second, int *microsecond, int *tzoffset, + int *tzmicrosecond) +{ // Parse the time portion of a datetime.isoformat() string // // Return codes: @@ -785,19 +791,21 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, if (*tzinfo_pos == '+' || *tzinfo_pos == '-') { break; } - } while(++tzinfo_pos < p_end); + } while (++tzinfo_pos < p_end); - int rv = parse_hh_mm_ss_ff(dtstr, tzinfo_pos, - hour, minute, second, microsecond); + int rv = parse_hh_mm_ss_ff(dtstr, tzinfo_pos, hour, minute, second, + microsecond); if (rv < 0) { return rv; - } else if (tzinfo_pos == p_end) { + } + else if (tzinfo_pos == p_end) { // We know that there's no time zone, so if there's stuff at the // end of the string it's an error. if (rv == 1) { return -5; - } else { + } + else { return 0; } } @@ -812,19 +820,18 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, return -5; } - int tzsign = (*tzinfo_pos == '-')?-1:1; + int tzsign = (*tzinfo_pos == '-') ? -1 : 1; tzinfo_pos++; int tzhour = 0, tzminute = 0, tzsecond = 0; - rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, - &tzhour, &tzminute, &tzsecond, tzmicrosecond); + rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, &tzhour, &tzminute, &tzsecond, + tzmicrosecond); *tzoffset = tzsign * ((tzhour * 3600) + (tzminute * 60) + tzsecond); *tzmicrosecond *= tzsign; - return rv?-5:1; + return rv ? -5 : 1; } - /* --------------------------------------------------------------------------- * Create various objects, mostly without range checking. */ @@ -839,30 +846,33 @@ new_date_ex(int year, int month, int day, PyTypeObject *type) return NULL; } - self = (PyDateTime_Date *) (type->tp_alloc(type, 0)); + self = (PyDateTime_Date *)(type->tp_alloc(type, 0)); if (self != NULL) set_date_fields(self, year, month, day); - return (PyObject *) self; + return (PyObject *)self; } #define new_date(year, month, day) \ new_date_ex(year, month, day, &PyDateTime_DateType) // Forward declaration -static PyObject * new_datetime_ex(int, int, int, int, int, int, int, - PyObject*, PyTypeObject*); +static PyObject * +new_datetime_ex(int, int, int, int, int, int, int, PyObject *, PyTypeObject *); /* Create date instance with no range checking, or call subclass constructor */ static PyObject * -new_date_subclass_ex(int year, int month, int day, PyObject *cls) { +new_date_subclass_ex(int year, int month, int day, PyObject *cls) +{ PyObject *result; // We have "fast path" constructors for two subclasses: date and datetime if ((PyTypeObject *)cls == &PyDateTime_DateType) { result = new_date_ex(year, month, day, (PyTypeObject *)cls); - } else if ((PyTypeObject *)cls == &PyDateTime_DateTimeType) { + } + else if ((PyTypeObject *)cls == &PyDateTime_DateTimeType) { result = new_datetime_ex(year, month, day, 0, 0, 0, 0, Py_None, (PyTypeObject *)cls); - } else { + } + else { result = PyObject_CallFunction(cls, "iii", year, month, day); } @@ -1281,7 +1291,8 @@ append_keyword_fold(PyObject *repr, int fold) } static inline PyObject * -tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) { +tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) +{ PyObject *tzinfo; if (rv == 1) { // Create a timezone from offset in seconds (0 returns UTC) @@ -1296,7 +1307,8 @@ tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) { } tzinfo = new_timezone(delta, NULL); Py_DECREF(delta); - } else { + } + else { tzinfo = Py_None; Py_INCREF(Py_None); } @@ -2886,17 +2898,19 @@ date_fromordinal(PyObject *cls, PyObject *args) /* Return the new date from a string as generated by date.isoformat() */ static PyObject * -date_fromisoformat(PyObject *cls, PyObject *dtstr) { +date_fromisoformat(PyObject *cls, PyObject *dtstr) +{ assert(dtstr != NULL); if (!PyUnicode_Check(dtstr)) { - PyErr_SetString(PyExc_TypeError, "fromisoformat: argument must be str"); + PyErr_SetString(PyExc_TypeError, + "fromisoformat: argument must be str"); return NULL; } Py_ssize_t len; - const char * dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); + const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); if (dt_ptr == NULL) { goto invalid_string_error; } @@ -2906,7 +2920,8 @@ date_fromisoformat(PyObject *cls, PyObject *dtstr) { int rv; if (len == 10) { rv = parse_isoformat_date(dt_ptr, &year, &month, &day); - } else { + } + else { rv = -1; } @@ -2917,12 +2932,10 @@ date_fromisoformat(PyObject *cls, PyObject *dtstr) { return new_date_subclass_ex(year, month, day, cls); invalid_string_error: - PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", - dtstr); + PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dtstr); return NULL; } - /* * Date arithmetic. */ @@ -4863,52 +4876,65 @@ datetime_combine(PyObject *cls, PyObject *args, PyObject *kw) } static PyObject * -_sanitize_isoformat_str(PyObject *dtstr, int *needs_decref) { +_sanitize_isoformat_str(PyObject *dtstr) +{ // `fromisoformat` allows surrogate characters in exactly one position, // the separator; to allow datetime_fromisoformat to make the simplifying // assumption that all valid strings can be encoded in UTF-8, this function // replaces any surrogate character separators with `T`. + // + // The result of this, if not NULL, returns a new reference Py_ssize_t len = PyUnicode_GetLength(dtstr); - *needs_decref = 0; - if (len <= 10 || !Py_UNICODE_IS_SURROGATE(PyUnicode_READ_CHAR(dtstr, 10))) { + if (len < 0) { + return NULL; + } + + if (len <= 10 || + !Py_UNICODE_IS_SURROGATE(PyUnicode_READ_CHAR(dtstr, 10))) { + Py_INCREF(dtstr); return dtstr; } - PyObject *str_out = PyUnicode_New(len, PyUnicode_MAX_CHAR_VALUE(dtstr)); + PyObject *str_out = _PyUnicode_Copy(dtstr); if (str_out == NULL) { return NULL; } - if (PyUnicode_CopyCharacters(str_out, 0, dtstr, 0, len) == -1 || - PyUnicode_WriteChar(str_out, 10, (Py_UCS4)'T')) { + if (PyUnicode_WriteChar(str_out, 10, (Py_UCS4)'T')) { Py_DECREF(str_out); return NULL; } - *needs_decref = 1; return str_out; } static PyObject * -datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { +datetime_fromisoformat(PyObject *cls, PyObject *dtstr) +{ assert(dtstr != NULL); if (!PyUnicode_Check(dtstr)) { - PyErr_SetString(PyExc_TypeError, "fromisoformat: argument must be str"); + PyErr_SetString(PyExc_TypeError, + "fromisoformat: argument must be str"); return NULL; } - int needs_decref = 0; - dtstr = _sanitize_isoformat_str(dtstr, &needs_decref); - if (dtstr == NULL) { + PyObject *dtstr_clean = _sanitize_isoformat_str(dtstr); + if (dtstr_clean == NULL) { goto error; } Py_ssize_t len; - const char * dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); + const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr_clean, &len); if (dt_ptr == NULL) { - goto invalid_string_error; + if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) { + // Encoding errors are invalid string errors at this point + goto invalid_string_error; + } + else { + goto error; + } } const char *p = dt_ptr; @@ -4924,8 +4950,9 @@ datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { // In UTF-8, the length of multi-byte characters is encoded in the MSB if ((p[10] & 0x80) == 0) { p += 11; - } else { - switch(p[10] & 0xf0) { + } + else { + switch (p[10] & 0xf0) { case 0xe0: p += 13; break; @@ -4939,15 +4966,14 @@ datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { } len -= (p - dt_ptr); - rv = parse_isoformat_time(p, len, - &hour, &minute, &second, µsecond, - &tzoffset, &tzusec); + rv = parse_isoformat_time(p, len, &hour, &minute, &second, + µsecond, &tzoffset, &tzusec); } if (rv < 0) { goto invalid_string_error; } - PyObject* tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, tzusec); + PyObject *tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, tzusec); if (tzinfo == NULL) { goto error; } @@ -4956,23 +4982,18 @@ datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { second, microsecond, tzinfo, cls); Py_DECREF(tzinfo); - if (needs_decref) { - Py_DECREF(dtstr); - } + Py_DECREF(dtstr_clean); return dt; invalid_string_error: PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dtstr); error: - if (needs_decref) { - Py_DECREF(dtstr); - } + Py_XDECREF(dtstr_clean); return NULL; } - /* * Destructor. */ From webhook-mailer at python.org Mon Oct 22 18:00:18 2018 From: webhook-mailer at python.org (Ned Deily) Date: Mon, 22 Oct 2018 22:00:18 -0000 Subject: [Python-checkins] [3.6] bpo-34901: add -I flag to sys.flags (GH-9755) Message-ID: https://github.com/python/cpython/commit/da7d7d0ccc2e7cab62080e146cab027f2aa6fd03 commit: da7d7d0ccc2e7cab62080e146cab027f2aa6fd03 branch: 3.6 author: danishprakash committer: Ned Deily date: 2018-10-22T17:48:34-04:00 summary: [3.6] bpo-34901: add -I flag to sys.flags (GH-9755) files: M Doc/library/sys.rst diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 68521df37ebb..f419c4501e0a 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -286,6 +286,7 @@ always available. :const:`debug` :option:`-d` :const:`inspect` :option:`-i` :const:`interactive` :option:`-i` + :const:`isolated` :option:`-I` :const:`optimize` :option:`-O` or :option:`-OO` :const:`dont_write_bytecode` :option:`-B` :const:`no_user_site` :option:`-s` @@ -306,6 +307,8 @@ always available. .. versionchanged:: 3.3 Removed obsolete ``division_warning`` attribute. + .. versionchanged:: 3.4 + Added ``isolated`` attribute for :option:`-I` ``isolated`` flag. .. data:: float_info From webhook-mailer at python.org Mon Oct 22 18:35:20 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 22 Oct 2018 22:35:20 -0000 Subject: [Python-checkins] bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959) Message-ID: https://github.com/python/cpython/commit/18450be94d74b5c7e05a08f4aaa4792749ecda18 commit: 18450be94d74b5c7e05a08f4aaa4792749ecda18 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-22T15:35:15-07:00 summary: bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959) * Use _PyUnicode_Copy in sanitize_isoformat_str * Use repr in fromisoformat error message This reverses commit 67b74a98b2 per Serhiy Storchaka's suggestion: I suggested to use %R in the error message because including the raw string can be confusing in the case of empty string, or string containing trailing whitespaces, invisible or unprintable characters. We agree that it is better to change both the C and pure Python versions to use repr. * Retain non-sanitized dtstr for error printing This does not create an extra string, it just holds on to a reference to the original input string for purposes of creating the error message. * PEP 7 fixes to from_isoformat * Separate handling of Unicode and other errors In the initial implementation, errors other than encoding errors would both raise an error indicating an invalid format, which would not be true for errors like MemoryError. * Drop needs_decref from _sanitize_isoformat_str Instead _sanitize_isoformat_str returns a new reference, even to the original string. (cherry picked from commit 3df85404d4bf420db3362eeae1345f2cad948a71) Co-authored-by: Paul Ganssle files: M Lib/datetime.py M Lib/test/datetimetester.py M Modules/_datetimemodule.c diff --git a/Lib/datetime.py b/Lib/datetime.py index 12a0f1489feb..8bffbef9ac32 100644 --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -857,7 +857,7 @@ def fromisoformat(cls, date_string): assert len(date_string) == 10 return cls(*_parse_isoformat_date(date_string)) except Exception: - raise ValueError('Invalid isoformat string: %s' % date_string) + raise ValueError(f'Invalid isoformat string: {date_string!r}') # Conversions to string @@ -1369,7 +1369,7 @@ def fromisoformat(cls, time_string): try: return cls(*_parse_isoformat_time(time_string)) except Exception: - raise ValueError('Invalid isoformat string: %s' % time_string) + raise ValueError(f'Invalid isoformat string: {time_string!r}') def strftime(self, fmt): @@ -1646,13 +1646,13 @@ def fromisoformat(cls, date_string): try: date_components = _parse_isoformat_date(dstr) except ValueError: - raise ValueError('Invalid isoformat string: %s' % date_string) + raise ValueError(f'Invalid isoformat string: {date_string!r}') if tstr: try: time_components = _parse_isoformat_time(tstr) except ValueError: - raise ValueError('Invalid isoformat string: %s' % date_string) + raise ValueError(f'Invalid isoformat string: {date_string!r}') else: time_components = [0, 0, 0, 0, None] diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 9c6e71c54d79..122f6b55ba33 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -13,6 +13,7 @@ import os import pickle import random +import re import struct import unittest @@ -2676,6 +2677,14 @@ def test_fromisoformat_fails_datetime(self): with self.assertRaises(ValueError): self.theclass.fromisoformat(bad_str) + def test_fromisoformat_fails_surrogate(self): + # Test that when fromisoformat() fails with a surrogate character as + # the separator, the error message contains the original string + dtstr = "2018-01-03\ud80001:0113" + + with self.assertRaisesRegex(ValueError, re.escape(repr(dtstr))): + self.theclass.fromisoformat(dtstr) + def test_fromisoformat_utc(self): dt_str = '2014-04-19T13:21:13+00:00' dt = self.theclass.fromisoformat(dt_str) diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 81a0b1f16811..f53880808d21 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -667,8 +667,8 @@ set_date_fields(PyDateTime_Date *self, int y, int m, int d) * String parsing utilities and helper functions */ -static const char* -parse_digits(const char* ptr, int* var, size_t num_digits) +static const char * +parse_digits(const char *ptr, int *var, size_t num_digits) { for (size_t i = 0; i < num_digits; ++i) { unsigned int tmp = (unsigned int)(*(ptr++) - '0'); @@ -682,15 +682,16 @@ parse_digits(const char* ptr, int* var, size_t num_digits) return ptr; } -static int parse_isoformat_date(const char *dtstr, - int* year, int *month, int* day) { +static int +parse_isoformat_date(const char *dtstr, int *year, int *month, int *day) +{ /* Parse the date components of the result of date.isoformat() - * - * Return codes: - * 0: Success - * -1: Failed to parse date component - * -2: Failed to parse dateseparator - */ + * + * Return codes: + * 0: Success + * -1: Failed to parse date component + * -2: Failed to parse dateseparator + */ const char *p = dtstr; p = parse_digits(p, year, 4); if (NULL == p) { @@ -719,8 +720,9 @@ static int parse_isoformat_date(const char *dtstr, } static int -parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, - int* hour, int* minute, int *second, int *microsecond) { +parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, int *hour, + int *minute, int *second, int *microsecond) +{ const char *p = tstr; const char *p_end = tstr_end; int *vals[3] = {hour, minute, second}; @@ -735,12 +737,15 @@ parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, char c = *(p++); if (p >= p_end) { return c != '\0'; - } else if (c == ':') { + } + else if (c == ':') { continue; - } else if (c == '.') { + } + else if (c == '.') { break; - } else { - return -4; // Malformed time separator + } + else { + return -4; // Malformed time separator } } @@ -764,9 +769,10 @@ parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, } static int -parse_isoformat_time(const char *dtstr, size_t dtlen, - int* hour, int *minute, int *second, int *microsecond, - int* tzoffset, int *tzmicrosecond) { +parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute, + int *second, int *microsecond, int *tzoffset, + int *tzmicrosecond) +{ // Parse the time portion of a datetime.isoformat() string // // Return codes: @@ -784,19 +790,21 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, if (*tzinfo_pos == '+' || *tzinfo_pos == '-') { break; } - } while(++tzinfo_pos < p_end); + } while (++tzinfo_pos < p_end); - int rv = parse_hh_mm_ss_ff(dtstr, tzinfo_pos, - hour, minute, second, microsecond); + int rv = parse_hh_mm_ss_ff(dtstr, tzinfo_pos, hour, minute, second, + microsecond); if (rv < 0) { return rv; - } else if (tzinfo_pos == p_end) { + } + else if (tzinfo_pos == p_end) { // We know that there's no time zone, so if there's stuff at the // end of the string it's an error. if (rv == 1) { return -5; - } else { + } + else { return 0; } } @@ -811,19 +819,18 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, return -5; } - int tzsign = (*tzinfo_pos == '-')?-1:1; + int tzsign = (*tzinfo_pos == '-') ? -1 : 1; tzinfo_pos++; int tzhour = 0, tzminute = 0, tzsecond = 0; - rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, - &tzhour, &tzminute, &tzsecond, tzmicrosecond); + rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, &tzhour, &tzminute, &tzsecond, + tzmicrosecond); *tzoffset = tzsign * ((tzhour * 3600) + (tzminute * 60) + tzsecond); *tzmicrosecond *= tzsign; - return rv?-5:1; + return rv ? -5 : 1; } - /* --------------------------------------------------------------------------- * Create various objects, mostly without range checking. */ @@ -838,30 +845,33 @@ new_date_ex(int year, int month, int day, PyTypeObject *type) return NULL; } - self = (PyDateTime_Date *) (type->tp_alloc(type, 0)); + self = (PyDateTime_Date *)(type->tp_alloc(type, 0)); if (self != NULL) set_date_fields(self, year, month, day); - return (PyObject *) self; + return (PyObject *)self; } #define new_date(year, month, day) \ new_date_ex(year, month, day, &PyDateTime_DateType) // Forward declaration -static PyObject * new_datetime_ex(int, int, int, int, int, int, int, - PyObject*, PyTypeObject*); +static PyObject * +new_datetime_ex(int, int, int, int, int, int, int, PyObject *, PyTypeObject *); /* Create date instance with no range checking, or call subclass constructor */ static PyObject * -new_date_subclass_ex(int year, int month, int day, PyObject *cls) { +new_date_subclass_ex(int year, int month, int day, PyObject *cls) +{ PyObject *result; // We have "fast path" constructors for two subclasses: date and datetime if ((PyTypeObject *)cls == &PyDateTime_DateType) { result = new_date_ex(year, month, day, (PyTypeObject *)cls); - } else if ((PyTypeObject *)cls == &PyDateTime_DateTimeType) { + } + else if ((PyTypeObject *)cls == &PyDateTime_DateTimeType) { result = new_datetime_ex(year, month, day, 0, 0, 0, 0, Py_None, (PyTypeObject *)cls); - } else { + } + else { result = PyObject_CallFunction(cls, "iii", year, month, day); } @@ -1280,7 +1290,8 @@ append_keyword_fold(PyObject *repr, int fold) } static inline PyObject * -tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) { +tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) +{ PyObject *tzinfo; if (rv == 1) { // Create a timezone from offset in seconds (0 returns UTC) @@ -1295,7 +1306,8 @@ tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) { } tzinfo = new_timezone(delta, NULL); Py_DECREF(delta); - } else { + } + else { tzinfo = Py_None; Py_INCREF(Py_None); } @@ -2879,17 +2891,19 @@ date_fromordinal(PyObject *cls, PyObject *args) /* Return the new date from a string as generated by date.isoformat() */ static PyObject * -date_fromisoformat(PyObject *cls, PyObject *dtstr) { +date_fromisoformat(PyObject *cls, PyObject *dtstr) +{ assert(dtstr != NULL); if (!PyUnicode_Check(dtstr)) { - PyErr_SetString(PyExc_TypeError, "fromisoformat: argument must be str"); + PyErr_SetString(PyExc_TypeError, + "fromisoformat: argument must be str"); return NULL; } Py_ssize_t len; - const char * dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); + const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); if (dt_ptr == NULL) { goto invalid_string_error; } @@ -2899,7 +2913,8 @@ date_fromisoformat(PyObject *cls, PyObject *dtstr) { int rv; if (len == 10) { rv = parse_isoformat_date(dt_ptr, &year, &month, &day); - } else { + } + else { rv = -1; } @@ -2910,12 +2925,10 @@ date_fromisoformat(PyObject *cls, PyObject *dtstr) { return new_date_subclass_ex(year, month, day, cls); invalid_string_error: - PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", - dtstr); + PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dtstr); return NULL; } - /* * Date arithmetic. */ @@ -4860,52 +4873,65 @@ datetime_combine(PyObject *cls, PyObject *args, PyObject *kw) } static PyObject * -_sanitize_isoformat_str(PyObject *dtstr, int *needs_decref) { +_sanitize_isoformat_str(PyObject *dtstr) +{ // `fromisoformat` allows surrogate characters in exactly one position, // the separator; to allow datetime_fromisoformat to make the simplifying // assumption that all valid strings can be encoded in UTF-8, this function // replaces any surrogate character separators with `T`. + // + // The result of this, if not NULL, returns a new reference Py_ssize_t len = PyUnicode_GetLength(dtstr); - *needs_decref = 0; - if (len <= 10 || !Py_UNICODE_IS_SURROGATE(PyUnicode_READ_CHAR(dtstr, 10))) { + if (len < 0) { + return NULL; + } + + if (len <= 10 || + !Py_UNICODE_IS_SURROGATE(PyUnicode_READ_CHAR(dtstr, 10))) { + Py_INCREF(dtstr); return dtstr; } - PyObject *str_out = PyUnicode_New(len, PyUnicode_MAX_CHAR_VALUE(dtstr)); + PyObject *str_out = _PyUnicode_Copy(dtstr); if (str_out == NULL) { return NULL; } - if (PyUnicode_CopyCharacters(str_out, 0, dtstr, 0, len) == -1 || - PyUnicode_WriteChar(str_out, 10, (Py_UCS4)'T')) { + if (PyUnicode_WriteChar(str_out, 10, (Py_UCS4)'T')) { Py_DECREF(str_out); return NULL; } - *needs_decref = 1; return str_out; } static PyObject * -datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { +datetime_fromisoformat(PyObject *cls, PyObject *dtstr) +{ assert(dtstr != NULL); if (!PyUnicode_Check(dtstr)) { - PyErr_SetString(PyExc_TypeError, "fromisoformat: argument must be str"); + PyErr_SetString(PyExc_TypeError, + "fromisoformat: argument must be str"); return NULL; } - int needs_decref = 0; - dtstr = _sanitize_isoformat_str(dtstr, &needs_decref); - if (dtstr == NULL) { + PyObject *dtstr_clean = _sanitize_isoformat_str(dtstr); + if (dtstr_clean == NULL) { goto error; } Py_ssize_t len; - const char * dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); + const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr_clean, &len); if (dt_ptr == NULL) { - goto invalid_string_error; + if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) { + // Encoding errors are invalid string errors at this point + goto invalid_string_error; + } + else { + goto error; + } } const char *p = dt_ptr; @@ -4921,8 +4947,9 @@ datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { // In UTF-8, the length of multi-byte characters is encoded in the MSB if ((p[10] & 0x80) == 0) { p += 11; - } else { - switch(p[10] & 0xf0) { + } + else { + switch (p[10] & 0xf0) { case 0xe0: p += 13; break; @@ -4936,15 +4963,14 @@ datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { } len -= (p - dt_ptr); - rv = parse_isoformat_time(p, len, - &hour, &minute, &second, µsecond, - &tzoffset, &tzusec); + rv = parse_isoformat_time(p, len, &hour, &minute, &second, + µsecond, &tzoffset, &tzusec); } if (rv < 0) { goto invalid_string_error; } - PyObject* tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, tzusec); + PyObject *tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, tzusec); if (tzinfo == NULL) { goto error; } @@ -4953,23 +4979,18 @@ datetime_fromisoformat(PyObject* cls, PyObject *dtstr) { second, microsecond, tzinfo, cls); Py_DECREF(tzinfo); - if (needs_decref) { - Py_DECREF(dtstr); - } + Py_DECREF(dtstr_clean); return dt; invalid_string_error: PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dtstr); error: - if (needs_decref) { - Py_DECREF(dtstr); - } + Py_XDECREF(dtstr_clean); return NULL; } - /* * Destructor. */ From webhook-mailer at python.org Tue Oct 23 02:11:24 2018 From: webhook-mailer at python.org (Xiang Zhang) Date: Tue, 23 Oct 2018 06:11:24 -0000 Subject: [Python-checkins] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) Message-ID: https://github.com/python/cpython/commit/83a07652e0033f0d9994ae7634b91d6581c56b00 commit: 83a07652e0033f0d9994ae7634b91d6581c56b00 branch: master author: Andrei Petre committer: Xiang Zhang date: 2018-10-23T14:11:20+08:00 summary: bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index ec3d5a529e65..40abdc24883c 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -205,10 +205,11 @@ The :mod:`functools` module defines the following functions: .. function:: partial(func, *args, **keywords) - Return a new :class:`partial` object which when called will behave like *func* - called with the positional arguments *args* and keyword arguments *keywords*. If - more arguments are supplied to the call, they are appended to *args*. If - additional keyword arguments are supplied, they extend and override *keywords*. + Return a new :ref:`partial object` which when called + will behave like *func* called with the positional arguments *args* + and keyword arguments *keywords*. If more arguments are supplied to the + call, they are appended to *args*. If additional keyword arguments are + supplied, they extend and override *keywords*. Roughly equivalent to:: def partial(func, *args, **keywords): @@ -246,7 +247,7 @@ The :mod:`functools` module defines the following functions: :func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another instance of :class:`partialmethod`), calls to ``__get__`` are delegated to the underlying descriptor, and an appropriate - :class:`partial` object returned as the result. + :ref:`partial object` returned as the result. When *func* is a non-descriptor callable, an appropriate bound method is created dynamically. This behaves like a normal Python function when From webhook-mailer at python.org Tue Oct 23 02:16:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 06:16:46 -0000 Subject: [Python-checkins] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) Message-ID: https://github.com/python/cpython/commit/fc62c7223ed1ecd422e870cf7bfc23060444450a commit: fc62c7223ed1ecd422e870cf7bfc23060444450a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-22T23:16:42-07:00 summary: bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) (cherry picked from commit 83a07652e0033f0d9994ae7634b91d6581c56b00) Co-authored-by: Andrei Petre files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 3413cd353ca9..8924593464f9 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -172,10 +172,11 @@ The :mod:`functools` module defines the following functions: .. function:: partial(func, *args, **keywords) - Return a new :class:`partial` object which when called will behave like *func* - called with the positional arguments *args* and keyword arguments *keywords*. If - more arguments are supplied to the call, they are appended to *args*. If - additional keyword arguments are supplied, they extend and override *keywords*. + Return a new :ref:`partial object` which when called + will behave like *func* called with the positional arguments *args* + and keyword arguments *keywords*. If more arguments are supplied to the + call, they are appended to *args*. If additional keyword arguments are + supplied, they extend and override *keywords*. Roughly equivalent to:: def partial(func, *args, **keywords): @@ -214,7 +215,7 @@ The :mod:`functools` module defines the following functions: :func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another instance of :class:`partialmethod`), calls to ``__get__`` are delegated to the underlying descriptor, and an appropriate - :class:`partial` object returned as the result. + :ref:`partial object` returned as the result. When *func* is a non-descriptor callable, an appropriate bound method is created dynamically. This behaves like a normal Python function when From webhook-mailer at python.org Tue Oct 23 02:16:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 06:16:54 -0000 Subject: [Python-checkins] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) Message-ID: https://github.com/python/cpython/commit/42892a2a38bb97c41e7b1b154e2b5b6f13d27b57 commit: 42892a2a38bb97c41e7b1b154e2b5b6f13d27b57 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-22T23:16:51-07:00 summary: bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) (cherry picked from commit 83a07652e0033f0d9994ae7634b91d6581c56b00) Co-authored-by: Andrei Petre files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 28062c11890e..b221a8584a12 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -167,10 +167,11 @@ The :mod:`functools` module defines the following functions: .. function:: partial(func, *args, **keywords) - Return a new :class:`partial` object which when called will behave like *func* - called with the positional arguments *args* and keyword arguments *keywords*. If - more arguments are supplied to the call, they are appended to *args*. If - additional keyword arguments are supplied, they extend and override *keywords*. + Return a new :ref:`partial object` which when called + will behave like *func* called with the positional arguments *args* + and keyword arguments *keywords*. If more arguments are supplied to the + call, they are appended to *args*. If additional keyword arguments are + supplied, they extend and override *keywords*. Roughly equivalent to:: def partial(func, *args, **keywords): @@ -209,7 +210,7 @@ The :mod:`functools` module defines the following functions: :func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another instance of :class:`partialmethod`), calls to ``__get__`` are delegated to the underlying descriptor, and an appropriate - :class:`partial` object returned as the result. + :ref:`partial object` returned as the result. When *func* is a non-descriptor callable, an appropriate bound method is created dynamically. This behaves like a normal Python function when From webhook-mailer at python.org Tue Oct 23 02:36:11 2018 From: webhook-mailer at python.org (Tal Einat) Date: Tue, 23 Oct 2018 06:36:11 -0000 Subject: [Python-checkins] bpo-34482: test datetime classes' handling of non-UTF-8-encodable strings (GH-8878) Message-ID: https://github.com/python/cpython/commit/3b0047d8e982b10b34ab05fd207b7d513cc1188a commit: 3b0047d8e982b10b34ab05fd207b7d513cc1188a branch: master author: Alexey Izbyshev committer: Tal Einat date: 2018-10-23T09:36:08+03:00 summary: bpo-34482: test datetime classes' handling of non-UTF-8-encodable strings (GH-8878) files: M Lib/test/datetimetester.py diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 122f6b55ba33..06fe647fb1a4 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -303,6 +303,8 @@ def test_tzname(self): self.assertEqual('UTC+09:30', timezone(9.5 * HOUR).tzname(None)) self.assertEqual('UTC-00:01', timezone(timedelta(minutes=-1)).tzname(None)) self.assertEqual('XYZ', timezone(-5 * HOUR, 'XYZ').tzname(None)) + # bpo-34482: Check that surrogates are handled properly. + self.assertEqual('\ud800', timezone(ZERO, '\ud800').tzname(None)) # Sub-minute offsets: self.assertEqual('UTC+01:06:40', timezone(timedelta(0, 4000)).tzname(None)) @@ -1308,6 +1310,12 @@ def test_strftime(self): except ValueError: pass + # bpo-34482: Check that surrogates don't cause a crash. + try: + t.strftime('%y\ud800%m') + except UnicodeEncodeError: + pass + #check that this standard extension works t.strftime("%f") @@ -1747,6 +1755,9 @@ def test_isoformat(self): self.assertEqual(t.isoformat('T'), "0001-02-03T04:05:01.000123") self.assertEqual(t.isoformat(' '), "0001-02-03 04:05:01.000123") self.assertEqual(t.isoformat('\x00'), "0001-02-03\x0004:05:01.000123") + # bpo-34482: Check that surrogates are handled properly. + self.assertEqual(t.isoformat('\ud800'), + "0001-02-03\ud80004:05:01.000123") self.assertEqual(t.isoformat(timespec='hours'), "0001-02-03T04") self.assertEqual(t.isoformat(timespec='minutes'), "0001-02-03T04:05") self.assertEqual(t.isoformat(timespec='seconds'), "0001-02-03T04:05:01") @@ -1755,6 +1766,8 @@ def test_isoformat(self): self.assertEqual(t.isoformat(timespec='auto'), "0001-02-03T04:05:01.000123") self.assertEqual(t.isoformat(sep=' ', timespec='minutes'), "0001-02-03 04:05") self.assertRaises(ValueError, t.isoformat, timespec='foo') + # bpo-34482: Check that surrogates are handled properly. + self.assertRaises(ValueError, t.isoformat, timespec='\ud800') # str is ISO format with the separator forced to a blank. self.assertEqual(str(t), "0001-02-03 04:05:01.000123") @@ -2286,6 +2299,19 @@ def test_strptime(self): self.assertIs(type(expected), self.theclass) self.assertIs(type(got), self.theclass) + # bpo-34482: Check that surrogates are handled properly. + inputs = [ + ('2004-12-01\ud80013:02:47.197', '%Y-%m-%d\ud800%H:%M:%S.%f'), + ('2004\ud80012-01 13:02:47.197', '%Y\ud800%m-%d %H:%M:%S.%f'), + ('2004-12-01 13:02\ud80047.197', '%Y-%m-%d %H:%M\ud800%S.%f'), + ] + for string, format in inputs: + with self.subTest(string=string, format=format): + expected = _strptime._strptime_datetime(self.theclass, string, + format) + got = self.theclass.strptime(string, format) + self.assertEqual(expected, got) + strptime = self.theclass.strptime self.assertEqual(strptime("+0002", "%z").utcoffset(), 2 * MINUTE) self.assertEqual(strptime("-0002", "%z").utcoffset(), -2 * MINUTE) @@ -2353,6 +2379,12 @@ def test_more_strftime(self): t = t.replace(tzinfo=tz) self.assertEqual(t.strftime("%z"), "-0200" + z) + # bpo-34482: Check that surrogates don't cause a crash. + try: + t.strftime('%y\ud800%m %H\ud800%M') + except UnicodeEncodeError: + pass + def test_extract(self): dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234) self.assertEqual(dt.date(), date(2002, 3, 4)) @@ -2878,6 +2910,8 @@ def test_isoformat(self): self.assertEqual(t.isoformat(timespec='microseconds'), "12:34:56.123456") self.assertEqual(t.isoformat(timespec='auto'), "12:34:56.123456") self.assertRaises(ValueError, t.isoformat, timespec='monkey') + # bpo-34482: Check that surrogates are handled properly. + self.assertRaises(ValueError, t.isoformat, timespec='\ud800') t = self.theclass(hour=12, minute=34, second=56, microsecond=999500) self.assertEqual(t.isoformat(timespec='milliseconds'), "12:34:56.999") @@ -2928,6 +2962,12 @@ def test_strftime(self): # A naive object replaces %z and %Z with empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + # bpo-34482: Check that surrogates don't cause a crash. + try: + t.strftime('%H\ud800%M') + except UnicodeEncodeError: + pass + def test_format(self): t = self.theclass(1, 2, 3, 4) self.assertEqual(t.__format__(''), str(t)) From webhook-mailer at python.org Tue Oct 23 02:43:13 2018 From: webhook-mailer at python.org (Xiang Zhang) Date: Tue, 23 Oct 2018 06:43:13 -0000 Subject: [Python-checkins] [2.7] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) Message-ID: https://github.com/python/cpython/commit/56a4a3aa555b3abc756cf837eddac4c0bf545db7 commit: 56a4a3aa555b3abc756cf837eddac4c0bf545db7 branch: 2.7 author: Xiang Zhang committer: GitHub date: 2018-10-23T14:43:08+08:00 summary: [2.7] bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) (cherry picked from commit 83a0765) Co-authored-by: Andrei Petre p31andrei at gmail.com files: M Doc/library/functools.rst diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index f3e396b4a6f9..aee14d5c81f6 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -76,9 +76,9 @@ The :mod:`functools` module defines the following functions: .. function:: partial(func[,*args][, **keywords]) - Return a new :class:`partial` object which when called will behave like *func* - called with the positional arguments *args* and keyword arguments *keywords*. If - more arguments are supplied to the call, they are appended to *args*. If + Return a new :ref:`partial object` which when called will behave + like *func* called with the positional arguments *args* and keyword arguments *keywords*. + If more arguments are supplied to the call, they are appended to *args*. If additional keyword arguments are supplied, they extend and override *keywords*. Roughly equivalent to:: From webhook-mailer at python.org Tue Oct 23 02:48:41 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Tue, 23 Oct 2018 06:48:41 -0000 Subject: [Python-checkins] bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) Message-ID: https://github.com/python/cpython/commit/b7d62050e7d5fc208ae7673613da4f1f2bc565c4 commit: b7d62050e7d5fc208ae7673613da4f1f2bc565c4 branch: master author: Josh Snyder committer: Vinay Sajip date: 2018-10-23T07:48:38+01:00 summary: bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) files: M Lib/logging/__init__.py diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 58afcd29c90a..b4659af7cc98 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1091,8 +1091,8 @@ def emit(self, record): try: msg = self.format(record) stream = self.stream - stream.write(msg) - stream.write(self.terminator) + # issue 35046: merged two stream.writes into one. + stream.write(msg + self.terminator) self.flush() except Exception: self.handleError(record) From webhook-mailer at python.org Tue Oct 23 03:04:27 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 07:04:27 -0000 Subject: [Python-checkins] bpo-34482: test datetime classes' handling of non-UTF-8-encodable strings (GH-8878) Message-ID: https://github.com/python/cpython/commit/313e5015d258778737bff766a8ccf997a0cc20c7 commit: 313e5015d258778737bff766a8ccf997a0cc20c7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T00:04:24-07:00 summary: bpo-34482: test datetime classes' handling of non-UTF-8-encodable strings (GH-8878) (cherry picked from commit 3b0047d8e982b10b34ab05fd207b7d513cc1188a) Co-authored-by: Alexey Izbyshev files: M Lib/test/datetimetester.py diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 122f6b55ba33..06fe647fb1a4 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -303,6 +303,8 @@ def test_tzname(self): self.assertEqual('UTC+09:30', timezone(9.5 * HOUR).tzname(None)) self.assertEqual('UTC-00:01', timezone(timedelta(minutes=-1)).tzname(None)) self.assertEqual('XYZ', timezone(-5 * HOUR, 'XYZ').tzname(None)) + # bpo-34482: Check that surrogates are handled properly. + self.assertEqual('\ud800', timezone(ZERO, '\ud800').tzname(None)) # Sub-minute offsets: self.assertEqual('UTC+01:06:40', timezone(timedelta(0, 4000)).tzname(None)) @@ -1308,6 +1310,12 @@ def test_strftime(self): except ValueError: pass + # bpo-34482: Check that surrogates don't cause a crash. + try: + t.strftime('%y\ud800%m') + except UnicodeEncodeError: + pass + #check that this standard extension works t.strftime("%f") @@ -1747,6 +1755,9 @@ def test_isoformat(self): self.assertEqual(t.isoformat('T'), "0001-02-03T04:05:01.000123") self.assertEqual(t.isoformat(' '), "0001-02-03 04:05:01.000123") self.assertEqual(t.isoformat('\x00'), "0001-02-03\x0004:05:01.000123") + # bpo-34482: Check that surrogates are handled properly. + self.assertEqual(t.isoformat('\ud800'), + "0001-02-03\ud80004:05:01.000123") self.assertEqual(t.isoformat(timespec='hours'), "0001-02-03T04") self.assertEqual(t.isoformat(timespec='minutes'), "0001-02-03T04:05") self.assertEqual(t.isoformat(timespec='seconds'), "0001-02-03T04:05:01") @@ -1755,6 +1766,8 @@ def test_isoformat(self): self.assertEqual(t.isoformat(timespec='auto'), "0001-02-03T04:05:01.000123") self.assertEqual(t.isoformat(sep=' ', timespec='minutes'), "0001-02-03 04:05") self.assertRaises(ValueError, t.isoformat, timespec='foo') + # bpo-34482: Check that surrogates are handled properly. + self.assertRaises(ValueError, t.isoformat, timespec='\ud800') # str is ISO format with the separator forced to a blank. self.assertEqual(str(t), "0001-02-03 04:05:01.000123") @@ -2286,6 +2299,19 @@ def test_strptime(self): self.assertIs(type(expected), self.theclass) self.assertIs(type(got), self.theclass) + # bpo-34482: Check that surrogates are handled properly. + inputs = [ + ('2004-12-01\ud80013:02:47.197', '%Y-%m-%d\ud800%H:%M:%S.%f'), + ('2004\ud80012-01 13:02:47.197', '%Y\ud800%m-%d %H:%M:%S.%f'), + ('2004-12-01 13:02\ud80047.197', '%Y-%m-%d %H:%M\ud800%S.%f'), + ] + for string, format in inputs: + with self.subTest(string=string, format=format): + expected = _strptime._strptime_datetime(self.theclass, string, + format) + got = self.theclass.strptime(string, format) + self.assertEqual(expected, got) + strptime = self.theclass.strptime self.assertEqual(strptime("+0002", "%z").utcoffset(), 2 * MINUTE) self.assertEqual(strptime("-0002", "%z").utcoffset(), -2 * MINUTE) @@ -2353,6 +2379,12 @@ def test_more_strftime(self): t = t.replace(tzinfo=tz) self.assertEqual(t.strftime("%z"), "-0200" + z) + # bpo-34482: Check that surrogates don't cause a crash. + try: + t.strftime('%y\ud800%m %H\ud800%M') + except UnicodeEncodeError: + pass + def test_extract(self): dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234) self.assertEqual(dt.date(), date(2002, 3, 4)) @@ -2878,6 +2910,8 @@ def test_isoformat(self): self.assertEqual(t.isoformat(timespec='microseconds'), "12:34:56.123456") self.assertEqual(t.isoformat(timespec='auto'), "12:34:56.123456") self.assertRaises(ValueError, t.isoformat, timespec='monkey') + # bpo-34482: Check that surrogates are handled properly. + self.assertRaises(ValueError, t.isoformat, timespec='\ud800') t = self.theclass(hour=12, minute=34, second=56, microsecond=999500) self.assertEqual(t.isoformat(timespec='milliseconds'), "12:34:56.999") @@ -2928,6 +2962,12 @@ def test_strftime(self): # A naive object replaces %z and %Z with empty strings. self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''") + # bpo-34482: Check that surrogates don't cause a crash. + try: + t.strftime('%H\ud800%M') + except UnicodeEncodeError: + pass + def test_format(self): t = self.theclass(1, 2, 3, 4) self.assertEqual(t.__format__(''), str(t)) From webhook-mailer at python.org Tue Oct 23 04:14:42 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 08:14:42 -0000 Subject: [Python-checkins] bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) Message-ID: https://github.com/python/cpython/commit/b79b5c09493e98374e48fa122d82dab528fc6e72 commit: b79b5c09493e98374e48fa122d82dab528fc6e72 branch: master author: matthewbelisle-wf committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-23T01:14:35-07:00 summary: bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) https://bugs.python.org/issue35028 files: M Lib/cgi.py M Lib/test/test_cgi.py diff --git a/Lib/cgi.py b/Lib/cgi.py index adf4dcba19ac..b96bd1f0fe39 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -618,6 +618,11 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): first_line = self.fp.readline() self.bytes_read += len(first_line) + # Propagate max_num_fields into the sub class appropriately + max_num_fields = self.max_num_fields + if max_num_fields is not None: + max_num_fields -= len(self.list) + while True: parser = FeedParser() hdr_text = b"" @@ -637,23 +642,19 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if 'content-length' in headers: del headers['content-length'] - # Propagate max_num_fields into the sub class appropriately - sub_max_num_fields = self.max_num_fields - if sub_max_num_fields is not None: - sub_max_num_fields -= len(self.list) - part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing,self.limit-self.bytes_read, - self.encoding, self.errors, sub_max_num_fields) + self.encoding, self.errors, max_num_fields) - max_num_fields = self.max_num_fields - if max_num_fields is not None and part.list: - max_num_fields -= len(part.list) + if max_num_fields is not None: + max_num_fields -= 1 + if part.list: + max_num_fields -= len(part.list) + if max_num_fields < 0: + raise ValueError('Max number of fields exceeded') self.bytes_read += part.bytes_read self.list.append(part) - if max_num_fields is not None and max_num_fields < len(self.list): - raise ValueError('Max number of fields exceeded') if part.done or self.bytes_read >= self.length > 0: break self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 8ea9d6aee6c4..b86638e1c283 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -401,33 +401,38 @@ def test_max_num_fields(self): data = """---123 Content-Disposition: form-data; name="a" -a +3 ---123 Content-Type: application/x-www-form-urlencoded -a=a&a=a +a=4 +---123 +Content-Type: application/x-www-form-urlencoded + +a=5 ---123-- """ environ = { 'CONTENT_LENGTH': str(len(data)), 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', - 'QUERY_STRING': 'a=a&a=a', + 'QUERY_STRING': 'a=1&a=2', 'REQUEST_METHOD': 'POST', } # 2 GET entities - # 2 top level POST entities - # 2 entities within the second POST entity + # 1 top level POST entities + # 1 entity within the second POST entity + # 1 entity within the third POST entity with self.assertRaises(ValueError): cgi.FieldStorage( fp=BytesIO(data.encode()), environ=environ, - max_num_fields=5, + max_num_fields=4, ) cgi.FieldStorage( fp=BytesIO(data.encode()), environ=environ, - max_num_fields=6, + max_num_fields=5, ) def testQSAndFormData(self): From solipsis at pitrou.net Tue Oct 23 05:08:33 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 23 Oct 2018 09:08:33 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=9 Message-ID: <20181023090833.1.158D2F1A952E1504@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, 0, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogcwSw0q', '--timeout', '7200'] From webhook-mailer at python.org Tue Oct 23 06:07:12 2018 From: webhook-mailer at python.org (Vinay Sajip) Date: Tue, 23 Oct 2018 10:07:12 -0000 Subject: [Python-checkins] bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (GH-10050) Message-ID: https://github.com/python/cpython/commit/d730719b094cb006711b1cd546927b863c173b31 commit: d730719b094cb006711b1cd546927b863c173b31 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Vinay Sajip date: 2018-10-23T11:07:06+01:00 summary: bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (GH-10050) (cherry picked from commit b7d62050e7d5fc208ae7673613da4f1f2bc565c4) files: M Lib/logging/__init__.py diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 3ad2cc38f61e..2761509d9951 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1033,8 +1033,8 @@ def emit(self, record): try: msg = self.format(record) stream = self.stream - stream.write(msg) - stream.write(self.terminator) + # issue 35046: merged two stream.writes into one. + stream.write(msg + self.terminator) self.flush() except Exception: self.handleError(record) From webhook-mailer at python.org Tue Oct 23 06:09:53 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 23 Oct 2018 10:09:53 -0000 Subject: [Python-checkins] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) Message-ID: https://github.com/python/cpython/commit/4f399be0e70d8b5516b6213568b7665765bb3114 commit: 4f399be0e70d8b5516b6213568b7665765bb3114 branch: master author: Zsolt Cserna committer: Victor Stinner date: 2018-10-23T12:09:50+02:00 summary: bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) Fix the documentation of copy2, as it does not copy file ownership (user and group), only mode, mtime, atime and flags. The original text was confusing to developers as it suggested that this command is the same as 'cp -p', but according to cp(1), '-p' copies file ownership as well. Clarify which metadata is copied by shutil.copystat in its docstring. files: M Doc/library/shutil.rst M Lib/shutil.py diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 6b4ce14b5da1..7a596eeff682 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -177,7 +177,7 @@ Directory and files operations .. function:: copy2(src, dst, *, follow_symlinks=True) Identical to :func:`~shutil.copy` except that :func:`copy2` - also attempts to preserve all file metadata. + also attempts to preserve file metadata. When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2` attempts to copy all metadata from the diff --git a/Lib/shutil.py b/Lib/shutil.py index a4aa0dfdd10b..40dd070ed11f 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -312,11 +312,15 @@ def _copyxattr(*args, **kwargs): pass def copystat(src, dst, *, follow_symlinks=True): - """Copy all stat info (mode bits, atime, mtime, flags) from src to dst. + """Copy file metadata - If the optional flag `follow_symlinks` is not set, symlinks aren't followed if and - only if both `src` and `dst` are symlinks. + Copy the permission bits, last access time, last modification time, and + flags from `src` to `dst`. On Linux, copystat() also copies the "extended + attributes" where possible. The file contents, owner, and group are + unaffected. `src` and `dst` are path names given as strings. + If the optional flag `follow_symlinks` is not set, symlinks aren't + followed if and only if both `src` and `dst` are symlinks. """ def _nop(*args, ns=None, follow_symlinks=None): pass @@ -384,8 +388,10 @@ def copy(src, dst, *, follow_symlinks=True): return dst def copy2(src, dst, *, follow_symlinks=True): - """Copy data and all stat info ("cp -p src dst"). Return the file's - destination. + """Copy data and metadata. Return the file's destination. + + Metadata is copied with copystat(). Please see the copystat function + for more information. The destination may be a directory. From webhook-mailer at python.org Tue Oct 23 06:54:47 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 10:54:47 -0000 Subject: [Python-checkins] bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) Message-ID: https://github.com/python/cpython/commit/58b614a327991f4baad4d2795a50027f75411450 commit: 58b614a327991f4baad4d2795a50027f75411450 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T03:54:42-07:00 summary: bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) https://bugs.python.org/issue35028 (cherry picked from commit b79b5c09493e98374e48fa122d82dab528fc6e72) Co-authored-by: matthewbelisle-wf files: M Lib/cgi.py M Lib/test/test_cgi.py diff --git a/Lib/cgi.py b/Lib/cgi.py index 2407707d7e7e..56f243e09f0f 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -710,6 +710,11 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): first_line = self.fp.readline() self.bytes_read += len(first_line) + # Propagate max_num_fields into the sub class appropriately + max_num_fields = self.max_num_fields + if max_num_fields is not None: + max_num_fields -= len(self.list) + while True: parser = FeedParser() hdr_text = b"" @@ -729,23 +734,19 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if 'content-length' in headers: del headers['content-length'] - # Propagate max_num_fields into the sub class appropriately - sub_max_num_fields = self.max_num_fields - if sub_max_num_fields is not None: - sub_max_num_fields -= len(self.list) - part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing,self.limit-self.bytes_read, - self.encoding, self.errors, sub_max_num_fields) + self.encoding, self.errors, max_num_fields) - max_num_fields = self.max_num_fields - if max_num_fields is not None and part.list: - max_num_fields -= len(part.list) + if max_num_fields is not None: + max_num_fields -= 1 + if part.list: + max_num_fields -= len(part.list) + if max_num_fields < 0: + raise ValueError('Max number of fields exceeded') self.bytes_read += part.bytes_read self.list.append(part) - if max_num_fields is not None and max_num_fields < len(self.list): - raise ValueError('Max number of fields exceeded') if part.done or self.bytes_read >= self.length > 0: break self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 953b99c1430a..b3e2d4cce8e2 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -393,33 +393,38 @@ def test_max_num_fields(self): data = """---123 Content-Disposition: form-data; name="a" -a +3 ---123 Content-Type: application/x-www-form-urlencoded -a=a&a=a +a=4 +---123 +Content-Type: application/x-www-form-urlencoded + +a=5 ---123-- """ environ = { 'CONTENT_LENGTH': str(len(data)), 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', - 'QUERY_STRING': 'a=a&a=a', + 'QUERY_STRING': 'a=1&a=2', 'REQUEST_METHOD': 'POST', } # 2 GET entities - # 2 top level POST entities - # 2 entities within the second POST entity + # 1 top level POST entities + # 1 entity within the second POST entity + # 1 entity within the third POST entity with self.assertRaises(ValueError): cgi.FieldStorage( fp=BytesIO(data.encode()), environ=environ, - max_num_fields=5, + max_num_fields=4, ) cgi.FieldStorage( fp=BytesIO(data.encode()), environ=environ, - max_num_fields=6, + max_num_fields=5, ) def testQSAndFormData(self): From webhook-mailer at python.org Tue Oct 23 06:54:55 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 10:54:55 -0000 Subject: [Python-checkins] bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) Message-ID: https://github.com/python/cpython/commit/178bf58e798d3ef63f18b314056efbc3c33dd48b commit: 178bf58e798d3ef63f18b314056efbc3c33dd48b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T03:54:52-07:00 summary: bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) https://bugs.python.org/issue35028 (cherry picked from commit b79b5c09493e98374e48fa122d82dab528fc6e72) Co-authored-by: matthewbelisle-wf files: M Lib/cgi.py M Lib/test/test_cgi.py diff --git a/Lib/cgi.py b/Lib/cgi.py index da4a34672c5e..8cf668718ded 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -635,6 +635,11 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): first_line = self.fp.readline() self.bytes_read += len(first_line) + # Propagate max_num_fields into the sub class appropriately + max_num_fields = self.max_num_fields + if max_num_fields is not None: + max_num_fields -= len(self.list) + while True: parser = FeedParser() hdr_text = b"" @@ -654,23 +659,19 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): if 'content-length' in headers: del headers['content-length'] - # Propagate max_num_fields into the sub class appropriately - sub_max_num_fields = self.max_num_fields - if sub_max_num_fields is not None: - sub_max_num_fields -= len(self.list) - part = klass(self.fp, headers, ib, environ, keep_blank_values, strict_parsing,self.limit-self.bytes_read, - self.encoding, self.errors, sub_max_num_fields) + self.encoding, self.errors, max_num_fields) - max_num_fields = self.max_num_fields - if max_num_fields is not None and part.list: - max_num_fields -= len(part.list) + if max_num_fields is not None: + max_num_fields -= 1 + if part.list: + max_num_fields -= len(part.list) + if max_num_fields < 0: + raise ValueError('Max number of fields exceeded') self.bytes_read += part.bytes_read self.list.append(part) - if max_num_fields is not None and max_num_fields < len(self.list): - raise ValueError('Max number of fields exceeded') if part.done or self.bytes_read >= self.length > 0: break self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index ff9c005518e0..f4e00c7a72c5 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -411,33 +411,38 @@ def test_max_num_fields(self): data = """---123 Content-Disposition: form-data; name="a" -a +3 ---123 Content-Type: application/x-www-form-urlencoded -a=a&a=a +a=4 +---123 +Content-Type: application/x-www-form-urlencoded + +a=5 ---123-- """ environ = { 'CONTENT_LENGTH': str(len(data)), 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', - 'QUERY_STRING': 'a=a&a=a', + 'QUERY_STRING': 'a=1&a=2', 'REQUEST_METHOD': 'POST', } # 2 GET entities - # 2 top level POST entities - # 2 entities within the second POST entity + # 1 top level POST entities + # 1 entity within the second POST entity + # 1 entity within the third POST entity with self.assertRaises(ValueError): cgi.FieldStorage( fp=BytesIO(data.encode()), environ=environ, - max_num_fields=5, + max_num_fields=4, ) cgi.FieldStorage( fp=BytesIO(data.encode()), environ=environ, - max_num_fields=6, + max_num_fields=5, ) def testQSAndFormData(self): From webhook-mailer at python.org Tue Oct 23 07:41:55 2018 From: webhook-mailer at python.org (Steve Dower) Date: Tue, 23 Oct 2018 11:41:55 -0000 Subject: [Python-checkins] bpo-34980: P/Invoke QueryFullProcessImageName to get process names (GH-9901) Message-ID: https://github.com/python/cpython/commit/fa5329424f4206630c34f75629fa78738db647f0 commit: fa5329424f4206630c34f75629fa78738db647f0 branch: master author: Jeremy Kloth committer: Steve Dower date: 2018-10-23T07:41:48-04:00 summary: bpo-34980: P/Invoke QueryFullProcessImageName to get process names (GH-9901) files: M PCbuild/pyproject.props diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 7016130b6fe8..6d36977456e0 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -109,19 +109,34 @@ - + + + + + From webhook-mailer at python.org Tue Oct 23 08:03:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 12:03:06 -0000 Subject: [Python-checkins] bpo-34980: P/Invoke QueryFullProcessImageName to get process names (GH-9901) Message-ID: https://github.com/python/cpython/commit/7a253dcd97fa669b8615476b287ef4dd0a935014 commit: 7a253dcd97fa669b8615476b287ef4dd0a935014 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T05:03:00-07:00 summary: bpo-34980: P/Invoke QueryFullProcessImageName to get process names (GH-9901) (cherry picked from commit fa5329424f4206630c34f75629fa78738db647f0) Co-authored-by: Jeremy Kloth files: M PCbuild/pyproject.props diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 7016130b6fe8..6d36977456e0 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -109,19 +109,34 @@ - + + + + + From webhook-mailer at python.org Tue Oct 23 08:07:39 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 12:07:39 -0000 Subject: [Python-checkins] bpo-34980: P/Invoke QueryFullProcessImageName to get process names (GH-9901) Message-ID: https://github.com/python/cpython/commit/69d0372fc9c5a600ecdfb7dd80f852b26c6ed087 commit: 69d0372fc9c5a600ecdfb7dd80f852b26c6ed087 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T05:07:35-07:00 summary: bpo-34980: P/Invoke QueryFullProcessImageName to get process names (GH-9901) (cherry picked from commit fa5329424f4206630c34f75629fa78738db647f0) Co-authored-by: Jeremy Kloth files: M PCbuild/pyproject.props diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 9a096bca6bd0..1602ebf5ec97 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -109,19 +109,34 @@ - + + + + + From webhook-mailer at python.org Tue Oct 23 09:37:08 2018 From: webhook-mailer at python.org (Ned Deily) Date: Tue, 23 Oct 2018 13:37:08 -0000 Subject: [Python-checkins] Add macos-team as a code owner (GH-10045) Message-ID: https://github.com/python/cpython/commit/96f2c739542d48edd6bd15c26b555c7e59d14cce commit: 96f2c739542d48edd6bd15c26b555c7e59d14cce branch: master author: Ned Deily committer: GitHub date: 2018-10-23T09:37:02-04:00 summary: Add macos-team as a code owner (GH-10045) files: M .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4d4d352601b8..224d95fd1971 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -67,3 +67,7 @@ Python/bootstrap_hash.c @python/crypto-team **/*idlelib* @terryjreedy **/*typing* @gvanrossum @ilevkivskyi + +# macOS +/Mac/ @python/macos-team +**/*osx_support* @python/macos-team From webhook-mailer at python.org Tue Oct 23 11:39:47 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 23 Oct 2018 15:39:47 -0000 Subject: [Python-checkins] bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) Message-ID: https://github.com/python/cpython/commit/82af0b63b07aa8d92b50098e382b458143cfc677 commit: 82af0b63b07aa8d92b50098e382b458143cfc677 branch: master author: Victor Stinner committer: GitHub date: 2018-10-23T17:39:40+02:00 summary: bpo-9263: _PyObject_Dump() detects freed memory (GH-10061) _PyObject_Dump() now uses an heuristic to check if the object memory has been freed: log "" in that case. The heuristic rely on the debug hooks on Python memory allocators which fills the memory with DEADBYTE (0xDB) when memory is deallocated. Use PYTHONMALLOC=debug to always enable these debug hooks. files: M Include/object.h M Include/pymem.h M Objects/object.c M Objects/obmalloc.c diff --git a/Include/object.h b/Include/object.h index c772deaf57db..bcf78afe6bbb 100644 --- a/Include/object.h +++ b/Include/object.h @@ -521,6 +521,7 @@ struct _Py_Identifier; PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); PyAPI_FUNC(void) _Py_BreakPoint(void); PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); diff --git a/Include/pymem.h b/Include/pymem.h index 8ee0efddca7d..ef6e0bb5e25f 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -55,7 +55,9 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack( PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback( unsigned int domain, uintptr_t ptr); -#endif /* !Py_LIMITED_API */ + +PyAPI_FUNC(int) _PyMem_IsFreed(void *ptr, size_t size); +#endif /* !defined(Py_LIMITED_API) */ /* BEWARE: diff --git a/Objects/object.c b/Objects/object.c index ab1baa70d434..00c0bad86152 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -410,34 +410,66 @@ _Py_BreakPoint(void) } +/* Heuristic checking if the object memory has been deallocated. + Rely on the debug hooks on Python memory allocators which fills the memory + with DEADBYTE (0xDB) when memory is deallocated. + + The function can be used to prevent segmentation fault on dereferencing + pointers like 0xdbdbdbdbdbdbdbdb. Such pointer is very unlikely to be mapped + in memory. */ +int +_PyObject_IsFreed(PyObject *op) +{ + int freed = _PyMem_IsFreed(&op->ob_type, sizeof(op->ob_type)); + /* ignore op->ob_ref: the value can have be modified + by Py_INCREF() and Py_DECREF(). */ +#ifdef Py_TRACE_REFS + freed &= _PyMem_IsFreed(&op->_ob_next, sizeof(op->_ob_next)); + freed &= _PyMem_IsFreed(&op->_ob_prev, sizeof(op->_ob_prev)); +#endif + return freed; +} + + /* For debugging convenience. See Misc/gdbinit for some useful gdb hooks */ void _PyObject_Dump(PyObject* op) { - if (op == NULL) - fprintf(stderr, "NULL\n"); - else { - PyGILState_STATE gil; - PyObject *error_type, *error_value, *error_traceback; - - fprintf(stderr, "object : "); - gil = PyGILState_Ensure(); - - PyErr_Fetch(&error_type, &error_value, &error_traceback); - (void)PyObject_Print(op, stderr, 0); - PyErr_Restore(error_type, error_value, error_traceback); - - PyGILState_Release(gil); - /* XXX(twouters) cast refcount to long until %zd is - universally available */ - fprintf(stderr, "\n" - "type : %s\n" - "refcount: %ld\n" - "address : %p\n", - Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name, - (long)op->ob_refcnt, - op); + if (op == NULL) { + fprintf(stderr, "\n"); + fflush(stderr); + return; + } + + if (_PyObject_IsFreed(op)) { + /* It seems like the object memory has been freed: + don't access it to prevent a segmentation fault. */ + fprintf(stderr, "\n"); } + + PyGILState_STATE gil; + PyObject *error_type, *error_value, *error_traceback; + + fprintf(stderr, "object : "); + fflush(stderr); + gil = PyGILState_Ensure(); + + PyErr_Fetch(&error_type, &error_value, &error_traceback); + (void)PyObject_Print(op, stderr, 0); + fflush(stderr); + PyErr_Restore(error_type, error_value, error_traceback); + + PyGILState_Release(gil); + /* XXX(twouters) cast refcount to long until %zd is + universally available */ + fprintf(stderr, "\n" + "type : %s\n" + "refcount: %ld\n" + "address : %p\n", + Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name, + (long)op->ob_refcnt, + op); + fflush(stderr); } PyObject * diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index eb7cbfca157c..d58da35952de 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -2033,6 +2033,22 @@ _PyMem_DebugRawCalloc(void *ctx, size_t nelem, size_t elsize) } +/* Heuristic checking if the memory has been freed. Rely on the debug hooks on + Python memory allocators which fills the memory with DEADBYTE (0xDB) when + memory is deallocated. */ +int +_PyMem_IsFreed(void *ptr, size_t size) +{ + unsigned char *bytes = ptr; + for (size_t i=0; i < size; i++) { + if (bytes[i] != DEADBYTE) { + return 0; + } + } + return 1; +} + + /* The debug free first checks the 2*SST bytes on each end for sanity (in particular, that the FORBIDDENBYTEs with the api ID are still intact). Then fills the original bytes with DEADBYTE. From webhook-mailer at python.org Tue Oct 23 15:28:11 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 23 Oct 2018 19:28:11 -0000 Subject: [Python-checkins] Fix error handling bugs in _elementtree.c. (GH-10060) Message-ID: https://github.com/python/cpython/commit/9f3ed3e213b30059087d059a7d1d3b2527fa8654 commit: 9f3ed3e213b30059087d059a7d1d3b2527fa8654 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-23T22:28:06+03:00 summary: Fix error handling bugs in _elementtree.c. (GH-10060) References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. files: M Modules/_elementtree.c diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index f88315d7711a..2f1c4c02e82a 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -336,6 +336,9 @@ static PyObject* get_attrib_from_keywords(PyObject *kwds) { PyObject *attrib_str = PyUnicode_FromString("attrib"); + if (attrib_str == NULL) { + return NULL; + } PyObject *attrib = PyDict_GetItem(kwds, attrib_str); if (attrib) { @@ -356,10 +359,10 @@ get_attrib_from_keywords(PyObject *kwds) Py_DECREF(attrib_str); - /* attrib can be NULL if PyDict_New failed */ - if (attrib) - if (PyDict_Update(attrib, kwds) < 0) - return NULL; + if (attrib != NULL && PyDict_Update(attrib, kwds) < 0) { + Py_DECREF(attrib); + return NULL; + } return attrib; } @@ -592,10 +595,9 @@ subelement(PyObject *self, PyObject *args, PyObject *kwds) attrib = PyDict_Copy(attrib); if (!attrib) return NULL; - if (kwds) { - if (PyDict_Update(attrib, kwds) < 0) { - return NULL; - } + if (kwds != NULL && PyDict_Update(attrib, kwds) < 0) { + Py_DECREF(attrib); + return NULL; } } else if (kwds) { /* have keyword args */ @@ -1871,7 +1873,6 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) * scheduled for removal. */ if (!(recycle = PyList_New(slicelen))) { - PyErr_NoMemory(); return -1; } @@ -1911,7 +1912,7 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) self->extra->length -= slicelen; /* Discard the recycle list with all the deleted sub-elements */ - Py_XDECREF(recycle); + Py_DECREF(recycle); return 0; } @@ -3338,7 +3339,6 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target, if (!target) { Py_CLEAR(self->entity); Py_CLEAR(self->names); - EXPAT(ParserFree)(self->parser); return -1; } } From webhook-mailer at python.org Tue Oct 23 15:40:58 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 23 Oct 2018 19:40:58 -0000 Subject: [Python-checkins] bpo-34794: Fix a leak in Tkinter. (GH-10025) Message-ID: https://github.com/python/cpython/commit/df13df41a25765d8a39a77220691698498e758d4 commit: df13df41a25765d8a39a77220691698498e758d4 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-23T22:40:54+03:00 summary: bpo-34794: Fix a leak in Tkinter. (GH-10025) Based on the investigation by Xiang Zhang. files: A Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst M Modules/_tkinter.c diff --git a/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst new file mode 100644 index 000000000000..770807fc7653 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst @@ -0,0 +1,2 @@ +Fixed a leak in Tkinter when pass the Python wrapper around Tcl_Obj back to +Tcl/Tk. diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 93d4dbc5f659..fa268599876a 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1101,9 +1101,7 @@ AsObj(PyObject *value) } if (PyTclObject_Check(value)) { - Tcl_Obj *v = ((PyTclObject*)value)->value; - Tcl_IncrRefCount(v); - return v; + return ((PyTclObject*)value)->value; } { From webhook-mailer at python.org Tue Oct 23 15:45:47 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 19:45:47 -0000 Subject: [Python-checkins] Fix error handling bugs in _elementtree.c. (GH-10060) Message-ID: https://github.com/python/cpython/commit/c46f0423a42c46cf62d12c300ec36a848f8ba72c commit: c46f0423a42c46cf62d12c300ec36a848f8ba72c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T12:45:44-07:00 summary: Fix error handling bugs in _elementtree.c. (GH-10060) References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654) Co-authored-by: Zackery Spytz files: M Modules/_elementtree.c diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index d13c6dd4db64..3118b55c874b 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -336,6 +336,9 @@ static PyObject* get_attrib_from_keywords(PyObject *kwds) { PyObject *attrib_str = PyUnicode_FromString("attrib"); + if (attrib_str == NULL) { + return NULL; + } PyObject *attrib = PyDict_GetItem(kwds, attrib_str); if (attrib) { @@ -356,10 +359,10 @@ get_attrib_from_keywords(PyObject *kwds) Py_DECREF(attrib_str); - /* attrib can be NULL if PyDict_New failed */ - if (attrib) - if (PyDict_Update(attrib, kwds) < 0) - return NULL; + if (attrib != NULL && PyDict_Update(attrib, kwds) < 0) { + Py_DECREF(attrib); + return NULL; + } return attrib; } @@ -579,10 +582,9 @@ subelement(PyObject *self, PyObject *args, PyObject *kwds) attrib = PyDict_Copy(attrib); if (!attrib) return NULL; - if (kwds) { - if (PyDict_Update(attrib, kwds) < 0) { - return NULL; - } + if (kwds != NULL && PyDict_Update(attrib, kwds) < 0) { + Py_DECREF(attrib); + return NULL; } } else if (kwds) { /* have keyword args */ @@ -1857,7 +1859,6 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) * scheduled for removal. */ if (!(recycle = PyList_New(slicelen))) { - PyErr_NoMemory(); return -1; } @@ -1897,7 +1898,7 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) self->extra->length -= slicelen; /* Discard the recycle list with all the deleted sub-elements */ - Py_XDECREF(recycle); + Py_DECREF(recycle); return 0; } @@ -3352,7 +3353,6 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *html, if (!target) { Py_CLEAR(self->entity); Py_CLEAR(self->names); - EXPAT(ParserFree)(self->parser); return -1; } } From webhook-mailer at python.org Tue Oct 23 15:53:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 19:53:03 -0000 Subject: [Python-checkins] Fix error handling bugs in _elementtree.c. (GH-10060) Message-ID: https://github.com/python/cpython/commit/b1b9ee824f1c7a8a8fc7fa0c6864b7eebc769d4d commit: b1b9ee824f1c7a8a8fc7fa0c6864b7eebc769d4d branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T12:52:57-07:00 summary: Fix error handling bugs in _elementtree.c. (GH-10060) References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654) Co-authored-by: Zackery Spytz files: M Modules/_elementtree.c diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index a96e0306996b..5c6959662316 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -336,6 +336,9 @@ static PyObject* get_attrib_from_keywords(PyObject *kwds) { PyObject *attrib_str = PyUnicode_FromString("attrib"); + if (attrib_str == NULL) { + return NULL; + } PyObject *attrib = PyDict_GetItem(kwds, attrib_str); if (attrib) { @@ -356,10 +359,10 @@ get_attrib_from_keywords(PyObject *kwds) Py_DECREF(attrib_str); - /* attrib can be NULL if PyDict_New failed */ - if (attrib) - if (PyDict_Update(attrib, kwds) < 0) - return NULL; + if (attrib != NULL && PyDict_Update(attrib, kwds) < 0) { + Py_DECREF(attrib); + return NULL; + } return attrib; } @@ -579,10 +582,9 @@ subelement(PyObject *self, PyObject *args, PyObject *kwds) attrib = PyDict_Copy(attrib); if (!attrib) return NULL; - if (kwds) { - if (PyDict_Update(attrib, kwds) < 0) { - return NULL; - } + if (kwds != NULL && PyDict_Update(attrib, kwds) < 0) { + Py_DECREF(attrib); + return NULL; } } else if (kwds) { /* have keyword args */ @@ -1828,7 +1830,6 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) * scheduled for removal. */ if (!(recycle = PyList_New(slicelen))) { - PyErr_NoMemory(); return -1; } @@ -1868,7 +1869,7 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value) self->extra->length -= slicelen; /* Discard the recycle list with all the deleted sub-elements */ - Py_XDECREF(recycle); + Py_DECREF(recycle); return 0; } @@ -3308,7 +3309,6 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *html, if (!target) { Py_CLEAR(self->entity); Py_CLEAR(self->names); - EXPAT(ParserFree)(self->parser); return -1; } } From webhook-mailer at python.org Tue Oct 23 15:58:28 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 23 Oct 2018 19:58:28 -0000 Subject: [Python-checkins] bpo-30863: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). (GH-2599) Message-ID: https://github.com/python/cpython/commit/c46db9232f1a6e0e3c33053549d03d4335db9dca commit: c46db9232f1a6e0e3c33053549d03d4335db9dca branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-23T22:58:24+03:00 summary: bpo-30863: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). (GH-2599) They no longer cache the wchar_t* representation of string objects. files: A Misc/NEWS.d/next/C API/2017-10-12-23-24-27.bpo-30863.xrED19.rst M Objects/unicodeobject.c diff --git a/Misc/NEWS.d/next/C API/2017-10-12-23-24-27.bpo-30863.xrED19.rst b/Misc/NEWS.d/next/C API/2017-10-12-23-24-27.bpo-30863.xrED19.rst new file mode 100644 index 000000000000..a8ef8761a792 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2017-10-12-23-24-27.bpo-30863.xrED19.rst @@ -0,0 +1,2 @@ +:c:func:`PyUnicode_AsWideChar` and :c:func:`PyUnicode_AsWideCharString` no +longer cache the ``wchar_t*`` representation of string objects. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index db9b25e29b50..31703d37ddbd 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2921,6 +2921,83 @@ PyUnicode_FromFormat(const char *format, ...) return ret; } +static Py_ssize_t +unicode_get_widechar_size(PyObject *unicode) +{ + Py_ssize_t res; + + assert(unicode != NULL); + assert(_PyUnicode_CHECK(unicode)); + + if (_PyUnicode_WSTR(unicode) != NULL) { + return PyUnicode_WSTR_LENGTH(unicode); + } + assert(PyUnicode_IS_READY(unicode)); + + res = _PyUnicode_LENGTH(unicode); +#if SIZEOF_WCHAR_T == 2 + if (PyUnicode_KIND(unicode) == PyUnicode_4BYTE_KIND) { + const Py_UCS4 *s = PyUnicode_4BYTE_DATA(unicode); + const Py_UCS4 *end = s + res; + for (; s < end; ++s) { + if (*s > 0xFFFF) { + ++res; + } + } + } +#endif + return res; +} + +static void +unicode_copy_as_widechar(PyObject *unicode, wchar_t *w, Py_ssize_t size) +{ + const wchar_t *wstr; + + assert(unicode != NULL); + assert(_PyUnicode_CHECK(unicode)); + + wstr = _PyUnicode_WSTR(unicode); + if (wstr != NULL) { + memcpy(w, wstr, size * sizeof(wchar_t)); + return; + } + assert(PyUnicode_IS_READY(unicode)); + + if (PyUnicode_KIND(unicode) == PyUnicode_1BYTE_KIND) { + const Py_UCS1 *s = PyUnicode_1BYTE_DATA(unicode); + for (; size--; ++s, ++w) { + *w = *s; + } + } + else { +#if SIZEOF_WCHAR_T == 4 + assert(PyUnicode_KIND(unicode) == PyUnicode_2BYTE_KIND); + const Py_UCS2 *s = PyUnicode_2BYTE_DATA(unicode); + for (; size--; ++s, ++w) { + *w = *s; + } +#else + assert(PyUnicode_KIND(unicode) == PyUnicode_4BYTE_KIND); + const Py_UCS4 *s = PyUnicode_4BYTE_DATA(unicode); + for (; size--; ++s, ++w) { + Py_UCS4 ch = *s; + if (ch > 0xFFFF) { + assert(ch <= MAX_UNICODE); + /* encode surrogate pair in this case */ + *w++ = Py_UNICODE_HIGH_SURROGATE(ch); + if (!size--) + break; + *w = Py_UNICODE_LOW_SURROGATE(ch); + } + else { + *w = ch; + } + } +#endif + } +} + #ifdef HAVE_WCHAR_H /* Convert a Unicode object to a wide character string. @@ -2937,33 +3014,35 @@ PyUnicode_AsWideChar(PyObject *unicode, Py_ssize_t size) { Py_ssize_t res; - const wchar_t *wstr; if (unicode == NULL) { PyErr_BadInternalCall(); return -1; } - wstr = PyUnicode_AsUnicodeAndSize(unicode, &res); - if (wstr == NULL) + if (!PyUnicode_Check(unicode)) { + PyErr_BadArgument(); return -1; - - if (w != NULL) { - if (size > res) - size = res + 1; - else - res = size; - memcpy(w, wstr, size * sizeof(wchar_t)); - return res; } - else + + res = unicode_get_widechar_size(unicode); + if (w == NULL) { return res + 1; + } + + if (size > res) { + size = res + 1; + } + else { + res = size; + } + unicode_copy_as_widechar(unicode, w, size); + return res; } wchar_t* PyUnicode_AsWideCharString(PyObject *unicode, Py_ssize_t *size) { - const wchar_t *wstr; wchar_t *buffer; Py_ssize_t buflen; @@ -2971,25 +3050,27 @@ PyUnicode_AsWideCharString(PyObject *unicode, PyErr_BadInternalCall(); return NULL; } - - wstr = PyUnicode_AsUnicodeAndSize(unicode, &buflen); - if (wstr == NULL) { - return NULL; - } - if (size == NULL && wcslen(wstr) != (size_t)buflen) { - PyErr_SetString(PyExc_ValueError, - "embedded null character"); + if (!PyUnicode_Check(unicode)) { + PyErr_BadArgument(); return NULL; } - buffer = PyMem_NEW(wchar_t, buflen + 1); + buflen = unicode_get_widechar_size(unicode); + buffer = (wchar_t *) PyMem_NEW(wchar_t, (buflen + 1)); if (buffer == NULL) { PyErr_NoMemory(); return NULL; } - memcpy(buffer, wstr, (buflen + 1) * sizeof(wchar_t)); - if (size != NULL) + unicode_copy_as_widechar(unicode, buffer, buflen + 1); + if (size != NULL) { *size = buflen; + } + else if (wcslen(buffer) != (size_t)buflen) { + PyMem_FREE(buffer); + PyErr_SetString(PyExc_ValueError, + "embedded null character"); + return NULL; + } return buffer; } @@ -3781,118 +3862,35 @@ PyUnicode_AsUTF8(PyObject *unicode) Py_UNICODE * PyUnicode_AsUnicodeAndSize(PyObject *unicode, Py_ssize_t *size) { - const unsigned char *one_byte; -#if SIZEOF_WCHAR_T == 4 - const Py_UCS2 *two_bytes; -#else - const Py_UCS4 *four_bytes; - const Py_UCS4 *ucs4_end; - Py_ssize_t num_surrogates; -#endif - wchar_t *w; - wchar_t *wchar_end; - if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); return NULL; } - if (_PyUnicode_WSTR(unicode) == NULL) { + Py_UNICODE *w = _PyUnicode_WSTR(unicode); + if (w == NULL) { /* Non-ASCII compact unicode object */ - assert(_PyUnicode_KIND(unicode) != 0); + assert(_PyUnicode_KIND(unicode) != PyUnicode_WCHAR_KIND); assert(PyUnicode_IS_READY(unicode)); - if (PyUnicode_KIND(unicode) == PyUnicode_4BYTE_KIND) { -#if SIZEOF_WCHAR_T == 2 - four_bytes = PyUnicode_4BYTE_DATA(unicode); - ucs4_end = four_bytes + _PyUnicode_LENGTH(unicode); - num_surrogates = 0; - - for (; four_bytes < ucs4_end; ++four_bytes) { - if (*four_bytes > 0xFFFF) - ++num_surrogates; - } - - _PyUnicode_WSTR(unicode) = (wchar_t *) PyObject_MALLOC( - sizeof(wchar_t) * (_PyUnicode_LENGTH(unicode) + 1 + num_surrogates)); - if (!_PyUnicode_WSTR(unicode)) { - PyErr_NoMemory(); - return NULL; - } - _PyUnicode_WSTR_LENGTH(unicode) = _PyUnicode_LENGTH(unicode) + num_surrogates; - - w = _PyUnicode_WSTR(unicode); - wchar_end = w + _PyUnicode_WSTR_LENGTH(unicode); - four_bytes = PyUnicode_4BYTE_DATA(unicode); - for (; four_bytes < ucs4_end; ++four_bytes, ++w) { - if (*four_bytes > 0xFFFF) { - assert(*four_bytes <= MAX_UNICODE); - /* encode surrogate pair in this case */ - *w++ = Py_UNICODE_HIGH_SURROGATE(*four_bytes); - *w = Py_UNICODE_LOW_SURROGATE(*four_bytes); - } - else - *w = *four_bytes; - - if (w > wchar_end) { - Py_UNREACHABLE(); - } - } - *w = 0; -#else - /* sizeof(wchar_t) == 4 */ - Py_FatalError("Impossible unicode object state, wstr and str " - "should share memory already."); + Py_ssize_t wlen = unicode_get_widechar_size(unicode); + if ((size_t)wlen > PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { + PyErr_NoMemory(); return NULL; -#endif } - else { - if ((size_t)_PyUnicode_LENGTH(unicode) > - PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { - PyErr_NoMemory(); - return NULL; - } - _PyUnicode_WSTR(unicode) = (wchar_t *) PyObject_MALLOC(sizeof(wchar_t) * - (_PyUnicode_LENGTH(unicode) + 1)); - if (!_PyUnicode_WSTR(unicode)) { - PyErr_NoMemory(); - return NULL; - } - if (!PyUnicode_IS_COMPACT_ASCII(unicode)) - _PyUnicode_WSTR_LENGTH(unicode) = _PyUnicode_LENGTH(unicode); - w = _PyUnicode_WSTR(unicode); - wchar_end = w + _PyUnicode_LENGTH(unicode); - - if (PyUnicode_KIND(unicode) == PyUnicode_1BYTE_KIND) { - one_byte = PyUnicode_1BYTE_DATA(unicode); - for (; w < wchar_end; ++one_byte, ++w) - *w = *one_byte; - /* null-terminate the wstr */ - *w = 0; - } - else if (PyUnicode_KIND(unicode) == PyUnicode_2BYTE_KIND) { -#if SIZEOF_WCHAR_T == 4 - two_bytes = PyUnicode_2BYTE_DATA(unicode); - for (; w < wchar_end; ++two_bytes, ++w) - *w = *two_bytes; - /* null-terminate the wstr */ - *w = 0; -#else - /* sizeof(wchar_t) == 2 */ - PyObject_FREE(_PyUnicode_WSTR(unicode)); - _PyUnicode_WSTR(unicode) = NULL; - Py_FatalError("Impossible unicode object state, wstr " - "and str should share memory already."); - return NULL; -#endif - } - else { - Py_UNREACHABLE(); - } + w = (wchar_t *) PyObject_MALLOC(sizeof(wchar_t) * (wlen + 1)); + if (w == NULL) { + PyErr_NoMemory(); + return NULL; + } + unicode_copy_as_widechar(unicode, w, wlen + 1); + _PyUnicode_WSTR(unicode) = w; + if (!PyUnicode_IS_COMPACT_ASCII(unicode)) { + _PyUnicode_WSTR_LENGTH(unicode) = wlen; } } if (size != NULL) *size = PyUnicode_WSTR_LENGTH(unicode); - return _PyUnicode_WSTR(unicode); + return w; } Py_UNICODE * From webhook-mailer at python.org Tue Oct 23 16:25:56 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 23 Oct 2018 20:25:56 -0000 Subject: [Python-checkins] bpo-34794: Fix a leak in Tkinter. (GH-10025) Message-ID: https://github.com/python/cpython/commit/2c549250d8fd6755e3338a771d250e34c78bdb50 commit: 2c549250d8fd6755e3338a771d250e34c78bdb50 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-23T13:25:53-07:00 summary: bpo-34794: Fix a leak in Tkinter. (GH-10025) Based on the investigation by Xiang Zhang. (cherry picked from commit df13df41a25765d8a39a77220691698498e758d4) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst M Modules/_tkinter.c diff --git a/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst new file mode 100644 index 000000000000..770807fc7653 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst @@ -0,0 +1,2 @@ +Fixed a leak in Tkinter when pass the Python wrapper around Tcl_Obj back to +Tcl/Tk. diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 68ee26e790cc..080b44f78562 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1153,9 +1153,7 @@ AsObj(PyObject *value) } if (PyTclObject_Check(value)) { - Tcl_Obj *v = ((PyTclObject*)value)->value; - Tcl_IncrRefCount(v); - return v; + return ((PyTclObject*)value)->value; } { From webhook-mailer at python.org Tue Oct 23 17:46:42 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 23 Oct 2018 21:46:42 -0000 Subject: [Python-checkins] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10069) Message-ID: https://github.com/python/cpython/commit/f7cefb427cbc50d89a4f19f7f334a4f5421cefd3 commit: f7cefb427cbc50d89a4f19f7f334a4f5421cefd3 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Victor Stinner date: 2018-10-23T23:46:32+02:00 summary: bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10069) Based on the investigation by Xiang Zhang. (cherry picked from commit df13df41a25765d8a39a77220691698498e758d4) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst M Modules/_tkinter.c diff --git a/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst new file mode 100644 index 000000000000..770807fc7653 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst @@ -0,0 +1,2 @@ +Fixed a leak in Tkinter when pass the Python wrapper around Tcl_Obj back to +Tcl/Tk. diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 93d4dbc5f659..fa268599876a 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1101,9 +1101,7 @@ AsObj(PyObject *value) } if (PyTclObject_Check(value)) { - Tcl_Obj *v = ((PyTclObject*)value)->value; - Tcl_IncrRefCount(v); - return v; + return ((PyTclObject*)value)->value; } { From webhook-mailer at python.org Tue Oct 23 17:58:00 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 23 Oct 2018 21:58:00 -0000 Subject: [Python-checkins] [3.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10065) Message-ID: https://github.com/python/cpython/commit/861f61b5a93d178e913ad3c760d529ee3155e66d commit: 861f61b5a93d178e913ad3c760d529ee3155e66d branch: 3.7 author: Zsolt Cserna committer: Victor Stinner date: 2018-10-23T23:57:55+02:00 summary: [3.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10065) Fix the documentation of copy2, as it does not copy file ownership (user and group), only mode, mtime, atime and flags. The original text was confusing to developers as it suggested that this command is the same as 'cp -p', but according to cp(1), '-p' copies file ownership as well. Clarify which metadata is copied by shutil.copystat in its docstring. (cherry picked from commit 4f399be0e70d8b5516b6213568b7665765bb3114) files: M Doc/library/shutil.rst M Lib/shutil.py diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 382f75d04f71..12e69a4ea040 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -166,7 +166,7 @@ Directory and files operations .. function:: copy2(src, dst, *, follow_symlinks=True) Identical to :func:`~shutil.copy` except that :func:`copy2` - also attempts to preserve all file metadata. + also attempts to preserve file metadata. When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2` attempts to copy all metadata from the diff --git a/Lib/shutil.py b/Lib/shutil.py index 3c02776a4065..f32c66b3550c 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -171,11 +171,15 @@ def _copyxattr(*args, **kwargs): pass def copystat(src, dst, *, follow_symlinks=True): - """Copy all stat info (mode bits, atime, mtime, flags) from src to dst. + """Copy file metadata - If the optional flag `follow_symlinks` is not set, symlinks aren't followed if and - only if both `src` and `dst` are symlinks. + Copy the permission bits, last access time, last modification time, and + flags from `src` to `dst`. On Linux, copystat() also copies the "extended + attributes" where possible. The file contents, owner, and group are + unaffected. `src` and `dst` are path names given as strings. + If the optional flag `follow_symlinks` is not set, symlinks aren't + followed if and only if both `src` and `dst` are symlinks. """ def _nop(*args, ns=None, follow_symlinks=None): pass @@ -243,8 +247,10 @@ def copy(src, dst, *, follow_symlinks=True): return dst def copy2(src, dst, *, follow_symlinks=True): - """Copy data and all stat info ("cp -p src dst"). Return the file's - destination." + """Copy data and metadata. Return the file's destination. + + Metadata is copied with copystat(). Please see the copystat function + for more information. The destination may be a directory. From webhook-mailer at python.org Tue Oct 23 17:58:14 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 23 Oct 2018 21:58:14 -0000 Subject: [Python-checkins] [3.6] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10068) Message-ID: https://github.com/python/cpython/commit/797cfbd69e3484ecf25f5acf75b06691e3fc97fa commit: 797cfbd69e3484ecf25f5acf75b06691e3fc97fa branch: 3.6 author: Zsolt Cserna committer: Victor Stinner date: 2018-10-23T23:58:11+02:00 summary: [3.6] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10068) Fix the documentation of copy2, as it does not copy file ownership (user and group), only mode, mtime, atime and flags. The original text was confusing to developers as it suggested that this command is the same as 'cp -p', but according to cp(1), '-p' copies file ownership as well. Clarify which metadata is copied by shutil.copystat in its docstring. (cherry picked from commit 4f399be0e70d8b5516b6213568b7665765bb3114) files: M Doc/library/shutil.rst M Lib/shutil.py diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 3d8cb0301e7d..c3f7bd664029 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -166,7 +166,7 @@ Directory and files operations .. function:: copy2(src, dst, *, follow_symlinks=True) Identical to :func:`~shutil.copy` except that :func:`copy2` - also attempts to preserve all file metadata. + also attempts to preserve file metadata. When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2` attempts to copy all metadata from the diff --git a/Lib/shutil.py b/Lib/shutil.py index bd4760f1a740..dd124484547c 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -171,11 +171,15 @@ def _copyxattr(*args, **kwargs): pass def copystat(src, dst, *, follow_symlinks=True): - """Copy all stat info (mode bits, atime, mtime, flags) from src to dst. + """Copy file metadata - If the optional flag `follow_symlinks` is not set, symlinks aren't followed if and - only if both `src` and `dst` are symlinks. + Copy the permission bits, last access time, last modification time, and + flags from `src` to `dst`. On Linux, copystat() also copies the "extended + attributes" where possible. The file contents, owner, and group are + unaffected. `src` and `dst` are path names given as strings. + If the optional flag `follow_symlinks` is not set, symlinks aren't + followed if and only if both `src` and `dst` are symlinks. """ def _nop(*args, ns=None, follow_symlinks=None): pass @@ -243,8 +247,10 @@ def copy(src, dst, *, follow_symlinks=True): return dst def copy2(src, dst, *, follow_symlinks=True): - """Copy data and all stat info ("cp -p src dst"). Return the file's - destination." + """Copy data and metadata. Return the file's destination. + + Metadata is copied with copystat(). Please see the copystat function + for more information. The destination may be a directory. From webhook-mailer at python.org Wed Oct 24 03:20:13 2018 From: webhook-mailer at python.org (Gregory P. Smith) Date: Wed, 24 Oct 2018 07:20:13 -0000 Subject: [Python-checkins] bpo-33899: Mention tokenize behavior change in What's New (GH-10073) Message-ID: https://github.com/python/cpython/commit/dfba1f67e7f1381ceb7cec8fbcfa37337620a9b0 commit: dfba1f67e7f1381ceb7cec8fbcfa37337620a9b0 branch: master author: Tal Einat committer: Gregory P. Smith date: 2018-10-24T00:20:05-07:00 summary: bpo-33899: Mention tokenize behavior change in What's New (GH-10073) files: M Doc/whatsnew/3.6.rst M Doc/whatsnew/3.7.rst M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index fec7c620d3b8..bba16543686c 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2414,3 +2414,11 @@ Notable changes in Python 3.6.5 The :func:`locale.localeconv` function now sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases. (Contributed by Victor Stinner in :issue:`31900`.) + +Notable changes in Python 3.6.7 +=============================== + +In 3.6.7 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token +when provided with input that does not have a trailing new line. This behavior +now matches what the C tokenizer does internally. +(Contributed by Ammar Askar in :issue:`33899`.) diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index ea460b74025e..d4daf8f71f9c 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -2507,3 +2507,8 @@ calling :c:func:`Py_Initialize`. In 3.7.1 the C API for Context Variables :ref:`was updated ` to use :c:type:`PyObject` pointers. See also :issue:`34762`. + +In 3.7.1 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token +when provided with input that does not have a trailing new line. This behavior +now matches what the C tokenizer does internally. +(Contributed by Ammar Askar in :issue:`33899`.) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 93dd24acaa8a..a09492137e77 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -173,6 +173,14 @@ Added :attr:`SSLContext.post_handshake_auth` to enable and post-handshake authentication. (Contributed by Christian Heimes in :issue:`34670`.) +tokenize +-------- + +The :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token when +provided with input that does not have a trailing new line. This behavior +now matches what the C tokenizer does internally. +(Contributed by Ammar Askar in :issue:`33899`.) + tkinter ------- From webhook-mailer at python.org Wed Oct 24 03:32:41 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 07:32:41 -0000 Subject: [Python-checkins] [3.6] bpo-33899: Mention tokenize behavior change in What's New (GH-10073) (GH-10075) Message-ID: https://github.com/python/cpython/commit/9a0476283393f9988d0946491052d7724a7f9d21 commit: 9a0476283393f9988d0946491052d7724a7f9d21 branch: 3.6 author: Tal Einat committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-24T00:32:37-07:00 summary: [3.6] bpo-33899: Mention tokenize behavior change in What's New (GH-10073) (GH-10075) (cherry picked from commit dfba1f67e7f1381ceb7cec8fbcfa37337620a9b0) https://bugs.python.org/issue33899 files: M Doc/whatsnew/3.6.rst diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 96a8831cd6ff..009584428fc1 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2433,3 +2433,8 @@ Notable changes in Python 3.6.7 :mod:`xml.dom.minidom` and mod:`xml.sax` modules no longer process external entities by default. See also :issue:`17239`. + +In 3.6.7 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token +when provided with input that does not have a trailing new line. This behavior +now matches what the C tokenizer does internally. +(Contributed by Ammar Askar in :issue:`33899`.) From webhook-mailer at python.org Wed Oct 24 03:33:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 07:33:03 -0000 Subject: [Python-checkins] [3.7] bpo-33899: Mention tokenize behavior change in What's New (GH-10073) (GH-10074) Message-ID: https://github.com/python/cpython/commit/b4c9874f5c7f64e1d41cbc588e515b8851bbb90c commit: b4c9874f5c7f64e1d41cbc588e515b8851bbb90c branch: 3.7 author: Tal Einat committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-24T00:33:00-07:00 summary: [3.7] bpo-33899: Mention tokenize behavior change in What's New (GH-10073) (GH-10074) (cherry picked from commit dfba1f67e7f1381ceb7cec8fbcfa37337620a9b0) https://bugs.python.org/issue33899 files: M Doc/whatsnew/3.6.rst M Doc/whatsnew/3.7.rst diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index fec7c620d3b8..bba16543686c 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2414,3 +2414,11 @@ Notable changes in Python 3.6.5 The :func:`locale.localeconv` function now sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases. (Contributed by Victor Stinner in :issue:`31900`.) + +Notable changes in Python 3.6.7 +=============================== + +In 3.6.7 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token +when provided with input that does not have a trailing new line. This behavior +now matches what the C tokenizer does internally. +(Contributed by Ammar Askar in :issue:`33899`.) diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 9cc79325460e..9a13dae13eab 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -2523,3 +2523,8 @@ In 3.7.1 the C API for Context Variables :mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external entities by default. See also :issue:`17239`. + +In 3.7.1 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token +when provided with input that does not have a trailing new line. This behavior +now matches what the C tokenizer does internally. +(Contributed by Ammar Askar in :issue:`33899`.) From solipsis at pitrou.net Wed Oct 24 05:11:17 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 24 Oct 2018 09:11:17 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=15 Message-ID: <20181024091117.1.E193BAB47334F31A@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_asyncio leaked [0, 3, 0] memory blocks, sum=3 test_collections leaked [0, 7, 0] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [2, -1, 0] memory blocks, sum=1 test_multiprocessing_spawn leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog7c1dM2', '--timeout', '7200'] From webhook-mailer at python.org Wed Oct 24 08:44:50 2018 From: webhook-mailer at python.org (Petr Viktorin) Date: Wed, 24 Oct 2018 12:44:50 -0000 Subject: [Python-checkins] bpo-32797: improve documentation of linecache.getline (GH-9540) Message-ID: https://github.com/python/cpython/commit/057f4078b044325dae4af55c4c64b684edaca315 commit: 057f4078b044325dae4af55c4c64b684edaca315 branch: master author: jdemeyer committer: Petr Viktorin date: 2018-10-24T14:44:41+02:00 summary: bpo-32797: improve documentation of linecache.getline (GH-9540) files: M Doc/library/linecache.rst diff --git a/Doc/library/linecache.rst b/Doc/library/linecache.rst index 34fcac57c072..9278fc0641fc 100644 --- a/Doc/library/linecache.rst +++ b/Doc/library/linecache.rst @@ -30,10 +30,13 @@ The :mod:`linecache` module defines the following functions: .. index:: triple: module; search; path - If a file named *filename* is not found, the function will look for it in the - module search path, ``sys.path``, after first checking for a :pep:`302` - ``__loader__`` in *module_globals*, in case the module was imported from a - zipfile or other non-filesystem import source. + If a file named *filename* is not found, the function first checks + for a :pep:`302` ``__loader__`` in *module_globals*. + If there is such a loader and it defines a ``get_source`` method, + then that determines the source lines + (if ``get_source()`` returns ``None``, then ``''`` is returned). + Finally, if *filename* is a relative filename, + it is looked up relative to the entries in the module search path, ``sys.path``. .. function:: clearcache() From webhook-mailer at python.org Wed Oct 24 13:32:27 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Wed, 24 Oct 2018 17:32:27 -0000 Subject: [Python-checkins] bpo-33899: Revert tokenize module adding an implicit final NEWLINE (GH-10072) Message-ID: https://github.com/python/cpython/commit/a1f45ec73f0486b187633e7ebc0a4f559d29d7d9 commit: a1f45ec73f0486b187633e7ebc0a4f559d29d7d9 branch: 2.7 author: Tal Einat committer: Benjamin Peterson date: 2018-10-24T10:32:21-07:00 summary: bpo-33899: Revert tokenize module adding an implicit final NEWLINE (GH-10072) This reverts commit 7829bba. files: D Misc/NEWS.d/next/Library/2018-06-24-01-57-14.bpo-33899.IaOcAr.rst M Lib/test/test_tokenize.py M Lib/tokenize.py diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index a4625971d378..fd9486bdd7d3 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -1,54 +1,32 @@ from test import test_support -from tokenize import (untokenize, generate_tokens, NUMBER, NAME, OP, NEWLINE, +from tokenize import (untokenize, generate_tokens, NUMBER, NAME, OP, STRING, ENDMARKER, tok_name, Untokenizer, tokenize) from StringIO import StringIO import os from unittest import TestCase -# Converts a source string into a list of textual representation -# of the tokens such as: -# ` NAME 'if' (1, 0) (1, 2)` -# to make writing tests easier. -def stringify_tokens_from_source(token_generator, source_string): - result = [] - num_lines = len(source_string.splitlines()) - missing_trailing_nl = source_string[-1] not in '\r\n' - - for type, token, start, end, line in token_generator: - if type == ENDMARKER: - break - # Ignore the new line on the last line if the input lacks one - if missing_trailing_nl and type == NEWLINE and end[0] == num_lines: - continue - type = tok_name[type] - result.append(" %(type)-10.10s %(token)-13.13r %(start)s %(end)s" % - locals()) - - return result - class TokenizeTest(TestCase): # Tests for the tokenize module. # The tests can be really simple. Given a small fragment of source - # code, print out a table with tokens. The ENDMARKER, ENCODING and - # final NEWLINE are omitted for brevity. + # code, print out a table with tokens. The ENDMARKER is omitted for + # brevity. def check_tokenize(self, s, expected): # Format the tokens in s in a table format. + # The ENDMARKER is omitted. + result = [] f = StringIO(s) - result = stringify_tokens_from_source(generate_tokens(f.readline), s) - + for type, token, start, end, line in generate_tokens(f.readline): + if type == ENDMARKER: + break + type = tok_name[type] + result.append(" %(type)-10.10s %(token)-13.13r %(start)s %(end)s" % + locals()) self.assertEqual(result, expected.rstrip().splitlines()) - def test_implicit_newline(self): - # Make sure that the tokenizer puts in an implicit NEWLINE - # when the input lacks a trailing new line. - f = StringIO("x") - tokens = list(generate_tokens(f.readline)) - self.assertEqual(tokens[-2][0], NEWLINE) - self.assertEqual(tokens[-1][0], ENDMARKER) def test_basic(self): self.check_tokenize("1 + 1", """\ @@ -638,7 +616,7 @@ def test_roundtrip(self): self.check_roundtrip("if x == 1:\n" " print x\n") self.check_roundtrip("# This is a comment\n" - "# This also\n") + "# This also") # Some people use different formatting conventions, which makes # untokenize a little trickier. Note that this test involves trailing diff --git a/Lib/tokenize.py b/Lib/tokenize.py index 6c857f854733..d426cd2df52a 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -306,15 +306,8 @@ def generate_tokens(readline): contline = None indents = [0] - last_line = b'' - line = b'' while 1: # loop over lines in stream try: - # We capture the value of the line variable here because - # readline uses the empty string '' to signal end of input, - # hence `line` itself will always be overwritten at the end - # of this loop. - last_line = line line = readline() except StopIteration: line = '' @@ -444,9 +437,6 @@ def generate_tokens(readline): (lnum, pos), (lnum, pos+1), line) pos += 1 - # Add an implicit NEWLINE if the input doesn't end in one - if last_line and last_line[-1] not in '\r\n': - yield (NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '') for indent in indents[1:]: # pop remaining indent levels yield (DEDENT, '', (lnum, 0), (lnum, 0), '') yield (ENDMARKER, '', (lnum, 0), (lnum, 0), '') diff --git a/Misc/NEWS.d/next/Library/2018-06-24-01-57-14.bpo-33899.IaOcAr.rst b/Misc/NEWS.d/next/Library/2018-06-24-01-57-14.bpo-33899.IaOcAr.rst deleted file mode 100644 index 21c909599363..000000000000 --- a/Misc/NEWS.d/next/Library/2018-06-24-01-57-14.bpo-33899.IaOcAr.rst +++ /dev/null @@ -1,3 +0,0 @@ -Tokenize module now implicitly emits a NEWLINE when provided with input that -does not have a trailing new line. This behavior now matches what the C -tokenizer does internally. Contributed by Ammar Askar. From webhook-mailer at python.org Wed Oct 24 17:22:34 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 21:22:34 -0000 Subject: [Python-checkins] [2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071) Message-ID: https://github.com/python/cpython/commit/4a59c9699ca8688359c460f98127a12e2db6e63b commit: 4a59c9699ca8688359c460f98127a12e2db6e63b branch: 2.7 author: Zsolt Cserna committer: Victor Stinner date: 2018-10-24T23:22:27+02:00 summary: [2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071) Fix the documentation of copy2, as it does not copy file ownership (user and group), only mode, mtime, atime and flags. The original text was confusing to developers as it suggested that this command is the same as 'cp -p', but according to cp(1), '-p' copies file ownership as well. Clarify which metadata is copied by shutil.copystat in its docstring. (cherry picked from commit 4f399be0e70d8b5516b6213568b7665765bb3114) files: M Doc/library/shutil.rst M Lib/shutil.py diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 6bd8f0585d77..7e9af1ad5a93 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -82,9 +82,11 @@ Directory and files operations .. function:: copy2(src, dst) - Similar to :func:`shutil.copy`, but metadata is copied as well -- in fact, - this is just :func:`shutil.copy` followed by :func:`copystat`. This is - similar to the Unix command :program:`cp -p`. + Identical to :func:`~shutil.copy` except that :func:`copy2` + also attempts to preserve file metadata. + + :func:`copy2` uses :func:`copystat` to copy the file metadata. + Please see :func:`copystat` for more information. .. function:: ignore_patterns(\*patterns) diff --git a/Lib/shutil.py b/Lib/shutil.py index 0ab1a06f5260..a45436cebccc 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -105,7 +105,13 @@ def copymode(src, dst): os.chmod(dst, mode) def copystat(src, dst): - """Copy all stat info (mode bits, atime, mtime, flags) from src to dst""" + """Copy file metadata + + Copy the permission bits, last access time, last modification time, and + flags from `src` to `dst`. On Linux, copystat() also copies the "extended + attributes" where possible. The file contents, owner, and group are + unaffected. `src` and `dst` are path names given as strings. + """ st = os.stat(src) mode = stat.S_IMODE(st.st_mode) if hasattr(os, 'utime'): @@ -134,7 +140,10 @@ def copy(src, dst): copymode(src, dst) def copy2(src, dst): - """Copy data and all stat info ("cp -p src dst"). + """Copy data and metadata. Return the file's destination. + + Metadata is copied with copystat(). Please see the copystat function + for more information. The destination may be a directory. From webhook-mailer at python.org Wed Oct 24 18:37:16 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 22:37:16 -0000 Subject: [Python-checkins] Use f-strings in asyncio-task code examples (GH-10035) Message-ID: https://github.com/python/cpython/commit/9f43fbbd9dfc78125c9533ce1dfe33ff5d15aa45 commit: 9f43fbbd9dfc78125c9533ce1dfe33ff5d15aa45 branch: master author: Mariatta committer: Victor Stinner date: 2018-10-25T00:37:12+02:00 summary: Use f-strings in asyncio-task code examples (GH-10035) Replace str.format with f-strings in the code examples of asyncio-task documentation. files: M Doc/library/asyncio-task.rst diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index ffeeb2d3bbb1..5157f921473e 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -57,12 +57,12 @@ To actually run a coroutine asyncio provides three main mechanisms: print(what) async def main(): - print('started at', time.strftime('%X')) + print(f"started at {time.strftime('%X')}") await say_after(1, 'hello') await say_after(2, 'world') - print('finished at', time.strftime('%X')) + print(f"finished at {time.strftime('%X')}") asyncio.run(main()) @@ -86,14 +86,14 @@ To actually run a coroutine asyncio provides three main mechanisms: task2 = asyncio.create_task( say_after(2, 'world')) - print('started at', time.strftime('%X')) + print(f"started at {time.strftime('%X')}") # Wait until both tasks are completed (should take # around 2 seconds.) await task1 await task2 - print('finished at', time.strftime('%X')) + print(f"finished at {time.strftime('%X')}") Note that expected output now shows that the snippet runs 1 second faster than before:: @@ -603,9 +603,9 @@ Scheduling From Other Threads print('The coroutine took too long, cancelling the task...') future.cancel() except Exception as exc: - print('The coroutine raised an exception: {!r}'.format(exc)) + print(f'The coroutine raised an exception: {exc!r}') else: - print('The coroutine returned: {!r}'.format(result)) + print(f'The coroutine returned: {result!r}') See the :ref:`concurrency and multithreading ` section of the documentation. From webhook-mailer at python.org Wed Oct 24 18:43:43 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 22:43:43 -0000 Subject: [Python-checkins] turtledemo/penrose.py: remove unused clock() calls (GH-10033) Message-ID: https://github.com/python/cpython/commit/9f270a24237ce562c327af5d187fad72b735e9d2 commit: 9f270a24237ce562c327af5d187fad72b735e9d2 branch: master author: Srinivas Thatiparthy (?????????? ?????????) committer: Victor Stinner date: 2018-10-25T00:43:39+02:00 summary: turtledemo/penrose.py: remove unused clock() calls (GH-10033) Actually time calculations were remove in commit 891a1f8. files: M Lib/turtledemo/penrose.py diff --git a/Lib/turtledemo/penrose.py b/Lib/turtledemo/penrose.py index e118d6a75e99..045722a22860 100755 --- a/Lib/turtledemo/penrose.py +++ b/Lib/turtledemo/penrose.py @@ -137,13 +137,10 @@ def test(l=200, n=4, fun=sun, startpos=(0,0), th=2): goto(startpos) setheading(0) tiledict = {} - a = clock() tracer(0) fun(l, n) - b = clock() draw(l, n, th) tracer(1) - c = clock() nk = len([x for x in tiledict if tiledict[x]]) nd = len([x for x in tiledict if not tiledict[x]]) print("%d kites and %d darts = %d pieces." % (nk, nd, nk+nd)) From webhook-mailer at python.org Wed Oct 24 18:45:49 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 22:45:49 -0000 Subject: [Python-checkins] Use f-strings in asyncio-task code examples (GH-10035) Message-ID: https://github.com/python/cpython/commit/d9dbb864cd9748e39791c9b9d7dc3c25b5967dff commit: d9dbb864cd9748e39791c9b9d7dc3c25b5967dff branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T15:45:44-07:00 summary: Use f-strings in asyncio-task code examples (GH-10035) Replace str.format with f-strings in the code examples of asyncio-task documentation. (cherry picked from commit 9f43fbbd9dfc78125c9533ce1dfe33ff5d15aa45) Co-authored-by: Mariatta files: M Doc/library/asyncio-task.rst diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 3168f478f3c0..376de8f4042f 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -57,12 +57,12 @@ To actually run a coroutine asyncio provides three main mechanisms: print(what) async def main(): - print('started at', time.strftime('%X')) + print(f"started at {time.strftime('%X')}") await say_after(1, 'hello') await say_after(2, 'world') - print('finished at', time.strftime('%X')) + print(f"finished at {time.strftime('%X')}") asyncio.run(main()) @@ -86,14 +86,14 @@ To actually run a coroutine asyncio provides three main mechanisms: task2 = asyncio.create_task( say_after(2, 'world')) - print('started at', time.strftime('%X')) + print(f"started at {time.strftime('%X')}") # Wait until both tasks are completed (should take # around 2 seconds.) await task1 await task2 - print('finished at', time.strftime('%X')) + print(f"finished at {time.strftime('%X')}") Note that expected output now shows that the snippet runs 1 second faster than before:: @@ -597,9 +597,9 @@ Scheduling From Other Threads print('The coroutine took too long, cancelling the task...') future.cancel() except Exception as exc: - print('The coroutine raised an exception: {!r}'.format(exc)) + print(f'The coroutine raised an exception: {exc!r}') else: - print('The coroutine returned: {!r}'.format(result)) + print(f'The coroutine returned: {result!r}') See the :ref:`concurrency and multithreading ` section of the documentation. From webhook-mailer at python.org Wed Oct 24 18:50:29 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 22:50:29 -0000 Subject: [Python-checkins] bpo-35027, distutils doc: Correct note on setup.py change in Python 3.7 (GH-10032) Message-ID: https://github.com/python/cpython/commit/e80e77a484983ffb527ef22d336ff9500589dce3 commit: e80e77a484983ffb527ef22d336ff9500589dce3 branch: master author: TilmanK committer: Victor Stinner date: 2018-10-25T00:50:25+02:00 summary: bpo-35027, distutils doc: Correct note on setup.py change in Python 3.7 (GH-10032) files: M Doc/distutils/setupscript.rst diff --git a/Doc/distutils/setupscript.rst b/Doc/distutils/setupscript.rst index 1d96acbe98f6..c1051d2e807e 100644 --- a/Doc/distutils/setupscript.rst +++ b/Doc/distutils/setupscript.rst @@ -682,9 +682,8 @@ information is sometimes used to indicate sub-releases. These are ) .. versionchanged:: 3.7 - :class:`~distutils.core.setup` now raises a :exc:`TypeError` if - ``classifiers``, ``keywords`` and ``platforms`` fields are not specified - as a list. + :class:`~distutils.core.setup` now warns when ``classifiers``, ``keywords`` + or ``platforms`` fields are not specified as a list or a string. .. _debug-setup-script: From webhook-mailer at python.org Wed Oct 24 18:59:21 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 22:59:21 -0000 Subject: [Python-checkins] bpo-35027, distutils doc: Correct note on setup.py change in Python 3.7 (GH-10032) Message-ID: https://github.com/python/cpython/commit/f2679afda06d1eeaf34852e49bbcf4fb39736d19 commit: f2679afda06d1eeaf34852e49bbcf4fb39736d19 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T15:59:15-07:00 summary: bpo-35027, distutils doc: Correct note on setup.py change in Python 3.7 (GH-10032) (cherry picked from commit e80e77a484983ffb527ef22d336ff9500589dce3) Co-authored-by: TilmanK files: M Doc/distutils/setupscript.rst diff --git a/Doc/distutils/setupscript.rst b/Doc/distutils/setupscript.rst index 1d96acbe98f6..c1051d2e807e 100644 --- a/Doc/distutils/setupscript.rst +++ b/Doc/distutils/setupscript.rst @@ -682,9 +682,8 @@ information is sometimes used to indicate sub-releases. These are ) .. versionchanged:: 3.7 - :class:`~distutils.core.setup` now raises a :exc:`TypeError` if - ``classifiers``, ``keywords`` and ``platforms`` fields are not specified - as a list. + :class:`~distutils.core.setup` now warns when ``classifiers``, ``keywords`` + or ``platforms`` fields are not specified as a list or a string. .. _debug-setup-script: From webhook-mailer at python.org Wed Oct 24 19:32:30 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 23:32:30 -0000 Subject: [Python-checkins] importlib doc: Fix approximated import_module() code (GH-9945) Message-ID: https://github.com/python/cpython/commit/78401f7156034f713170b8e87b51d23ebdc3bdfa commit: 78401f7156034f713170b8e87b51d23ebdc3bdfa branch: master author: orlnub123 committer: Victor Stinner date: 2018-10-25T01:32:26+02:00 summary: importlib doc: Fix approximated import_module() code (GH-9945) The spec gets stored on modules with the __spec__ attribute, not spec. files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 6f4da1198955..09d5989c2f8b 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1731,7 +1731,7 @@ Python 3.6 and newer for other parts of the code). if '.' in absolute_name: parent_name, _, child_name = absolute_name.rpartition('.') parent_module = import_module(parent_name) - path = parent_module.spec.submodule_search_locations + path = parent_module.__spec__.submodule_search_locations for finder in sys.meta_path: spec = finder.find_spec(absolute_name, path) if spec is not None: From webhook-mailer at python.org Wed Oct 24 19:38:03 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 23:38:03 -0000 Subject: [Python-checkins] importlib doc: Fix approximated import_module() code (GH-9945) Message-ID: https://github.com/python/cpython/commit/917efd8d7bc392490c62d9d0fd6dec4a74855b08 commit: 917efd8d7bc392490c62d9d0fd6dec4a74855b08 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T16:38:00-07:00 summary: importlib doc: Fix approximated import_module() code (GH-9945) The spec gets stored on modules with the __spec__ attribute, not spec. (cherry picked from commit 78401f7156034f713170b8e87b51d23ebdc3bdfa) Co-authored-by: orlnub123 files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 6f4da1198955..09d5989c2f8b 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1731,7 +1731,7 @@ Python 3.6 and newer for other parts of the code). if '.' in absolute_name: parent_name, _, child_name = absolute_name.rpartition('.') parent_module = import_module(parent_name) - path = parent_module.spec.submodule_search_locations + path = parent_module.__spec__.submodule_search_locations for finder in sys.meta_path: spec = finder.find_spec(absolute_name, path) if spec is not None: From webhook-mailer at python.org Wed Oct 24 19:38:07 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 23:38:07 -0000 Subject: [Python-checkins] importlib doc: Fix approximated import_module() code (GH-9945) Message-ID: https://github.com/python/cpython/commit/7717bf992c586bd4152a83c98af59a592bc8adc1 commit: 7717bf992c586bd4152a83c98af59a592bc8adc1 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T16:38:04-07:00 summary: importlib doc: Fix approximated import_module() code (GH-9945) The spec gets stored on modules with the __spec__ attribute, not spec. (cherry picked from commit 78401f7156034f713170b8e87b51d23ebdc3bdfa) Co-authored-by: orlnub123 files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 356d1608bf4e..760489ae5560 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1482,7 +1482,7 @@ Python 3.6 and newer for other parts of the code). if '.' in absolute_name: parent_name, _, child_name = absolute_name.rpartition('.') parent_module = import_module(parent_name) - path = parent_module.spec.submodule_search_locations + path = parent_module.__spec__.submodule_search_locations for finder in sys.meta_path: spec = finder.find_spec(absolute_name, path) if spec is not None: From webhook-mailer at python.org Wed Oct 24 19:47:04 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 23:47:04 -0000 Subject: [Python-checkins] configparser doc: Properly label ConfigParser attributes (GH-9930) Message-ID: https://github.com/python/cpython/commit/890423f79606124f6c54935d21f22375c399e23a commit: 890423f79606124f6c54935d21f22375c399e23a branch: master author: Ned Batchelder committer: Victor Stinner date: 2018-10-25T01:47:01+02:00 summary: configparser doc: Properly label ConfigParser attributes (GH-9930) files: M Doc/library/configparser.rst diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 0ae466e7d4f8..47d61723099f 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -663,7 +663,7 @@ More advanced customization may be achieved by overriding default values of these parser attributes. The defaults are defined on the classes, so they may be overridden by subclasses or by attribute assignment. -.. attribute:: BOOLEAN_STATES +.. attribute:: ConfigParser.BOOLEAN_STATES By default when using :meth:`~ConfigParser.getboolean`, config parsers consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, @@ -686,7 +686,7 @@ be overridden by subclasses or by attribute assignment. Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/``disabled``. -.. method:: optionxform(option) +.. method:: ConfigParser.optionxform(option) This method transforms option names on every read, get, or set operation. The default converts the name to lowercase. This also @@ -717,7 +717,7 @@ be overridden by subclasses or by attribute assignment. >>> list(custom['Section2'].keys()) ['AnotherKey'] -.. attribute:: SECTCRE +.. attribute:: ConfigParser.SECTCRE A compiled regular expression used to parse section headers. The default matches ``[section]`` to the name ``"section"``. Whitespace is considered From webhook-mailer at python.org Wed Oct 24 19:54:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 24 Oct 2018 23:54:25 -0000 Subject: [Python-checkins] bpo-28015: Support LTO build with clang (GH-9908) Message-ID: https://github.com/python/cpython/commit/5ad36f9b21a3aa3b2265b1b43d73522cc3322df2 commit: 5ad36f9b21a3aa3b2265b1b43d73522cc3322df2 branch: master author: serge-sans-paille committer: Victor Stinner date: 2018-10-25T01:54:22+02:00 summary: bpo-28015: Support LTO build with clang (GH-9908) .o generated by clang in LTO mode actually are LLVM bitcode files, which leads to a few errors during configure/build step: - add lto flags to the BASECFLAGS instead of CFLAGS, as CFLAGS are used to build autoconf test case, and some are not compatible with clang LTO (they assume binary in the .o, not bitcode) - force llvm-ar instead of ar, as ar is not aware of .o files generated by clang -flto files: A Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst M aclocal.m4 M configure M configure.ac diff --git a/Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst b/Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst new file mode 100644 index 000000000000..5a7a43c77307 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst @@ -0,0 +1 @@ +Have --with-lto works correctly with clang. diff --git a/aclocal.m4 b/aclocal.m4 index 030e6877de9f..94a2dd6d3ebd 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,7 +13,7 @@ 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 serial 11 (pkg-config-0.29) dnl dnl Copyright ? 2004 Scott James Remnant . dnl Copyright ? 2012-2015 Dan Nicholson @@ -55,7 +55,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ diff --git a/configure b/configure index 2f45c17852e5..3d66c1cb1c2f 100755 --- a/configure +++ b/configure @@ -671,16 +671,18 @@ BASECFLAGS CFLAGS_ALIASING OPT LLVM_PROF_FOUND -target_os -target_vendor -target_cpu -target LLVM_PROFDATA LLVM_PROF_ERR LLVM_PROF_FILE LLVM_PROF_MERGER PGO_PROF_USE_FLAG PGO_PROF_GEN_FLAG +LLVM_AR_FOUND +target_os +target_vendor +target_cpu +target +LLVM_AR DEF_MAKE_RULE DEF_MAKE_ALL_RULE ABIFLAGS @@ -6388,6 +6390,26 @@ else DEF_MAKE_RULE="all" fi +# Make llvm-relatec checks work on systems where llvm tools are not installed with their +# normal names in the default $PATH (ie: Ubuntu). They exist under the +# non-suffixed name in their versioned llvm directory. + +llvm_bin_dir='' +llvm_path="${PATH}" +if test "${CC}" = "clang" +then + clang_bin=`which clang` + # Some systems install clang elsewhere as a symlink to the real path + # which is where the related llvm tools are located. + if test -L "${clang_bin}" + then + clang_dir=`dirname "${clang_bin}"` + clang_bin=`readlink "${clang_bin}"` + llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` + llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" + fi +fi + # Enable LTO flags { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 $as_echo_n "checking for --with-lto... " >&6; } @@ -6413,65 +6435,8 @@ fi if test "$Py_LTO" = 'true' ; then case $CC in *clang*) - case $ac_sys_system in - Darwin*) - # Any changes made here should be reflected in the GCC+Darwin case below - LTOFLAGS="-flto -Wl,-export_dynamic" - ;; - *) - LTOFLAGS="-flto" - ;; - esac - ;; - *gcc*) - case $ac_sys_system in - Darwin*) - LTOFLAGS="-flto -Wl,-export_dynamic" - ;; - *) - LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" - ;; - esac - ;; - esac - if test "$ac_cv_prog_cc_g" = "yes" - then - # bpo-30345: Add -g to LDFLAGS when compiling with LTO - # to get debug symbols. - LTOFLAGS="$LTOFLAGS -g" - fi - - CFLAGS="$CFLAGS $LTOFLAGS" - LDFLAGS="$LDFLAGS $LTOFLAGS" -fi - -# Enable PGO flags. - - - - - -# Make this work on systems where llvm tools are not installed with their -# normal names in the default $PATH (ie: Ubuntu). They exist under the -# non-suffixed name in their versioned llvm directory. -llvm_bin_dir='' -llvm_path="${PATH}" -if test "${CC}" = "clang" -then - clang_bin=`which clang` - # Some systems install clang elsewhere as a symlink to the real path - # which is where the related llvm tools are located. - if test -L "${clang_bin}" - then - clang_dir=`dirname "${clang_bin}"` - clang_bin=`readlink "${clang_bin}"` - llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` - llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 @@ -6510,6 +6475,163 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- +# Extract the first word of "$target_alias-llvm-ar", so it can be a program name with args. +set dummy $target_alias-llvm-ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LLVM_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LLVM_AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_LLVM_AR="$LLVM_AR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in ${llvm_path} +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LLVM_AR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +LLVM_AR=$ac_cv_path_LLVM_AR +if test -n "$LLVM_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_AR" >&5 +$as_echo "$LLVM_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$ac_cv_path_LLVM_AR"; then + if test "$build" = "$target"; then + ac_pt_LLVM_AR=$LLVM_AR + # Extract the first word of "llvm-ar", so it can be a program name with args. +set dummy llvm-ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_LLVM_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_LLVM_AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_LLVM_AR="$ac_pt_LLVM_AR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in ${llvm_path} +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_LLVM_AR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ac_pt_LLVM_AR" && ac_cv_path_ac_pt_LLVM_AR="''" + ;; +esac +fi +ac_pt_LLVM_AR=$ac_cv_path_ac_pt_LLVM_AR +if test -n "$ac_pt_LLVM_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_AR" >&5 +$as_echo "$ac_pt_LLVM_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + LLVM_AR=$ac_pt_LLVM_AR + else + LLVM_AR="''" + fi +else + LLVM_AR="$ac_cv_path_LLVM_AR" +fi + + + if test -n "${LLVM_AR}" -a -x "${LLVM_AR}" + then + LLVM_AR_FOUND="found" + else + LLVM_AR_FOUND="not-found" + fi + if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found" + then + found_llvm_ar=`/usr/bin/xcrun -find llvm-ar 2>/dev/null` + if test -n "${found_llvm_ar}" + then + LLVM_AR='/usr/bin/xcrun llvm-ar' + LLVM_AR_FOUND=found + { $as_echo "$as_me:${as_lineno-$LINENO}: llvm-ar found via xcrun: ${LLVM_AR}" >&5 +$as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;} + fi + fi + if test $LLVM_AR_FOUND = not-found + then + LLVM_PROFR_ERR=yes + as_fn_error $? "llvm-ar is required for a --with-lto build with clang but could not be found." "$LINENO" 5 + else + LLVM_AR_ERR=no + fi + AR="${LLVM_AR}" + case $ac_sys_system in + Darwin*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto -Wl,-export_dynamic" + ;; + *) + LTOFLAGS="-flto" + ;; + esac + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + LTOFLAGS="-flto -Wl,-export_dynamic" + ;; + *) + LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" + ;; + esac + ;; + esac + + if test "$ac_cv_prog_cc_g" = "yes" + then + # bpo-30345: Add -g to LDFLAGS when compiling with LTO + # to get debug symbols. + LTOFLAGS="$LTOFLAGS -g" + fi + + BASECFLAGS="$BASECFLAGS $LTOFLAGS" + LDFLAGS="$LDFLAGS $LTOFLAGS" +fi + +# Enable PGO flags. + + + + + + # Extract the first word of "$target_alias-llvm-profdata", so it can be a program name with args. set dummy $target_alias-llvm-profdata; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/configure.ac b/configure.ac index f1b47dbf4f82..d1502dfef1f7 100644 --- a/configure.ac +++ b/configure.ac @@ -1265,6 +1265,26 @@ else DEF_MAKE_RULE="all" fi +# Make llvm-relatec checks work on systems where llvm tools are not installed with their +# normal names in the default $PATH (ie: Ubuntu). They exist under the +# non-suffixed name in their versioned llvm directory. + +llvm_bin_dir='' +llvm_path="${PATH}" +if test "${CC}" = "clang" +then + clang_bin=`which clang` + # Some systems install clang elsewhere as a symlink to the real path + # which is where the related llvm tools are located. + if test -L "${clang_bin}" + then + clang_dir=`dirname "${clang_bin}"` + clang_bin=`readlink "${clang_bin}"` + llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` + llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" + fi +fi + # Enable LTO flags AC_MSG_CHECKING(for --with-lto) AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in any build. Disabled by default.]), @@ -1281,6 +1301,33 @@ fi], if test "$Py_LTO" = 'true' ; then case $CC in *clang*) + AC_SUBST(LLVM_AR) + AC_PATH_TARGET_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) + AC_SUBST(LLVM_AR_FOUND) + if test -n "${LLVM_AR}" -a -x "${LLVM_AR}" + then + LLVM_AR_FOUND="found" + else + LLVM_AR_FOUND="not-found" + fi + if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found" + then + found_llvm_ar=`/usr/bin/xcrun -find llvm-ar 2>/dev/null` + if test -n "${found_llvm_ar}" + then + LLVM_AR='/usr/bin/xcrun llvm-ar' + LLVM_AR_FOUND=found + AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}]) + fi + fi + if test $LLVM_AR_FOUND = not-found + then + LLVM_PROFR_ERR=yes + AC_MSG_ERROR([llvm-ar is required for a --with-lto build with clang but could not be found.]) + else + LLVM_AR_ERR=no + fi + AR="${LLVM_AR}" case $ac_sys_system in Darwin*) # Any changes made here should be reflected in the GCC+Darwin case below @@ -1310,7 +1357,7 @@ if test "$Py_LTO" = 'true' ; then LTOFLAGS="$LTOFLAGS -g" fi - CFLAGS="$CFLAGS $LTOFLAGS" + BASECFLAGS="$BASECFLAGS $LTOFLAGS" LDFLAGS="$LDFLAGS $LTOFLAGS" fi @@ -1320,24 +1367,6 @@ AC_SUBST(PGO_PROF_USE_FLAG) AC_SUBST(LLVM_PROF_MERGER) AC_SUBST(LLVM_PROF_FILE) AC_SUBST(LLVM_PROF_ERR) -# Make this work on systems where llvm tools are not installed with their -# normal names in the default $PATH (ie: Ubuntu). They exist under the -# non-suffixed name in their versioned llvm directory. -llvm_bin_dir='' -llvm_path="${PATH}" -if test "${CC}" = "clang" -then - clang_bin=`which clang` - # Some systems install clang elsewhere as a symlink to the real path - # which is where the related llvm tools are located. - if test -L "${clang_bin}" - then - clang_dir=`dirname "${clang_bin}"` - clang_bin=`readlink "${clang_bin}"` - llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` - llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" - fi -fi AC_SUBST(LLVM_PROFDATA) AC_PATH_TARGET_TOOL(LLVM_PROFDATA, llvm-profdata, '', ${llvm_path}) AC_SUBST(LLVM_PROF_FOUND) From webhook-mailer at python.org Wed Oct 24 19:56:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 23:56:28 -0000 Subject: [Python-checkins] configparser doc: Properly label ConfigParser attributes (GH-9930) Message-ID: https://github.com/python/cpython/commit/b3223940091b1ea52b0fd856801d79e2281e5b19 commit: b3223940091b1ea52b0fd856801d79e2281e5b19 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T16:56:25-07:00 summary: configparser doc: Properly label ConfigParser attributes (GH-9930) (cherry picked from commit 890423f79606124f6c54935d21f22375c399e23a) Co-authored-by: Ned Batchelder files: M Doc/library/configparser.rst diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 0bd03b6259ee..4430e39b7c5b 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -695,7 +695,7 @@ More advanced customization may be achieved by overriding default values of these parser attributes. The defaults are defined on the classes, so they may be overridden by subclasses or by attribute assignment. -.. attribute:: BOOLEAN_STATES +.. attribute:: ConfigParser.BOOLEAN_STATES By default when using :meth:`~ConfigParser.getboolean`, config parsers consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, @@ -718,7 +718,7 @@ be overridden by subclasses or by attribute assignment. Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/``disabled``. -.. method:: optionxform(option) +.. method:: ConfigParser.optionxform(option) This method transforms option names on every read, get, or set operation. The default converts the name to lowercase. This also @@ -749,7 +749,7 @@ be overridden by subclasses or by attribute assignment. >>> list(custom['Section2'].keys()) ['AnotherKey'] -.. attribute:: SECTCRE +.. attribute:: ConfigParser.SECTCRE A compiled regular expression used to parse section headers. The default matches ``[section]`` to the name ``"section"``. Whitespace is considered From webhook-mailer at python.org Wed Oct 24 19:58:21 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 24 Oct 2018 23:58:21 -0000 Subject: [Python-checkins] configparser doc: Properly label ConfigParser attributes (GH-9930) Message-ID: https://github.com/python/cpython/commit/9fd92afff8b168973b42d0637aa29511f128aa23 commit: 9fd92afff8b168973b42d0637aa29511f128aa23 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T16:58:18-07:00 summary: configparser doc: Properly label ConfigParser attributes (GH-9930) (cherry picked from commit 890423f79606124f6c54935d21f22375c399e23a) Co-authored-by: Ned Batchelder files: M Doc/library/configparser.rst diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 4abc6aa75606..4885863e8ee8 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -691,7 +691,7 @@ More advanced customization may be achieved by overriding default values of these parser attributes. The defaults are defined on the classes, so they may be overridden by subclasses or by attribute assignment. -.. attribute:: BOOLEAN_STATES +.. attribute:: ConfigParser.BOOLEAN_STATES By default when using :meth:`~ConfigParser.getboolean`, config parsers consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, @@ -714,7 +714,7 @@ be overridden by subclasses or by attribute assignment. Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/``disabled``. -.. method:: optionxform(option) +.. method:: ConfigParser.optionxform(option) This method transforms option names on every read, get, or set operation. The default converts the name to lowercase. This also @@ -745,7 +745,7 @@ be overridden by subclasses or by attribute assignment. >>> list(custom['Section2'].keys()) ['AnotherKey'] -.. attribute:: SECTCRE +.. attribute:: ConfigParser.SECTCRE A compiled regular expression used to parse section headers. The default matches ``[section]`` to the name ``"section"``. Whitespace is considered From webhook-mailer at python.org Wed Oct 24 20:32:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 25 Oct 2018 00:32:08 -0000 Subject: [Python-checkins] bpo-28015: Support LTO build with clang (GH-9908) Message-ID: https://github.com/python/cpython/commit/69a3f153a92fd8c86080e8da477ee50df18fc0d1 commit: 69a3f153a92fd8c86080e8da477ee50df18fc0d1 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-24T17:32:04-07:00 summary: bpo-28015: Support LTO build with clang (GH-9908) .o generated by clang in LTO mode actually are LLVM bitcode files, which leads to a few errors during configure/build step: - add lto flags to the BASECFLAGS instead of CFLAGS, as CFLAGS are used to build autoconf test case, and some are not compatible with clang LTO (they assume binary in the .o, not bitcode) - force llvm-ar instead of ar, as ar is not aware of .o files generated by clang -flto (cherry picked from commit 5ad36f9b21a3aa3b2265b1b43d73522cc3322df2) Co-authored-by: serge-sans-paille files: A Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst M aclocal.m4 M configure M configure.ac diff --git a/Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst b/Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst new file mode 100644 index 000000000000..5a7a43c77307 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-10-16-12-22-36.bpo-28015.ylSgFh.rst @@ -0,0 +1 @@ +Have --with-lto works correctly with clang. diff --git a/aclocal.m4 b/aclocal.m4 index 6a24d8e6b9c0..32828c24dd89 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,7 +13,7 @@ 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 serial 11 (pkg-config-0.29) dnl dnl Copyright ? 2004 Scott James Remnant . dnl Copyright ? 2012-2015 Dan Nicholson @@ -55,7 +55,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ diff --git a/configure b/configure index 36e117a75522..12663996ff3b 100755 --- a/configure +++ b/configure @@ -672,16 +672,18 @@ BASECFLAGS CFLAGS_ALIASING OPT LLVM_PROF_FOUND -target_os -target_vendor -target_cpu -target LLVM_PROFDATA LLVM_PROF_ERR LLVM_PROF_FILE LLVM_PROF_MERGER PGO_PROF_USE_FLAG PGO_PROF_GEN_FLAG +LLVM_AR_FOUND +target_os +target_vendor +target_cpu +target +LLVM_AR DEF_MAKE_RULE DEF_MAKE_ALL_RULE ABIFLAGS @@ -6432,6 +6434,26 @@ else DEF_MAKE_RULE="all" fi +# Make llvm-relatec checks work on systems where llvm tools are not installed with their +# normal names in the default $PATH (ie: Ubuntu). They exist under the +# non-suffixed name in their versioned llvm directory. + +llvm_bin_dir='' +llvm_path="${PATH}" +if test "${CC}" = "clang" +then + clang_bin=`which clang` + # Some systems install clang elsewhere as a symlink to the real path + # which is where the related llvm tools are located. + if test -L "${clang_bin}" + then + clang_dir=`dirname "${clang_bin}"` + clang_bin=`readlink "${clang_bin}"` + llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` + llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" + fi +fi + # Enable LTO flags { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 $as_echo_n "checking for --with-lto... " >&6; } @@ -6457,65 +6479,8 @@ fi if test "$Py_LTO" = 'true' ; then case $CC in *clang*) - case $ac_sys_system in - Darwin*) - # Any changes made here should be reflected in the GCC+Darwin case below - LTOFLAGS="-flto -Wl,-export_dynamic" - ;; - *) - LTOFLAGS="-flto" - ;; - esac - ;; - *gcc*) - case $ac_sys_system in - Darwin*) - LTOFLAGS="-flto -Wl,-export_dynamic" - ;; - *) - LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" - ;; - esac - ;; - esac - if test "$ac_cv_prog_cc_g" = "yes" - then - # bpo-30345: Add -g to LDFLAGS when compiling with LTO - # to get debug symbols. - LTOFLAGS="$LTOFLAGS -g" - fi - - CFLAGS="$CFLAGS $LTOFLAGS" - LDFLAGS="$LDFLAGS $LTOFLAGS" -fi - -# Enable PGO flags. - - - - - -# Make this work on systems where llvm tools are not installed with their -# normal names in the default $PATH (ie: Ubuntu). They exist under the -# non-suffixed name in their versioned llvm directory. -llvm_bin_dir='' -llvm_path="${PATH}" -if test "${CC}" = "clang" -then - clang_bin=`which clang` - # Some systems install clang elsewhere as a symlink to the real path - # which is where the related llvm tools are located. - if test -L "${clang_bin}" - then - clang_dir=`dirname "${clang_bin}"` - clang_bin=`readlink "${clang_bin}"` - llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` - llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 @@ -6554,6 +6519,163 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- +# Extract the first word of "$target_alias-llvm-ar", so it can be a program name with args. +set dummy $target_alias-llvm-ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LLVM_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LLVM_AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_LLVM_AR="$LLVM_AR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in ${llvm_path} +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LLVM_AR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +LLVM_AR=$ac_cv_path_LLVM_AR +if test -n "$LLVM_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_AR" >&5 +$as_echo "$LLVM_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$ac_cv_path_LLVM_AR"; then + if test "$build" = "$target"; then + ac_pt_LLVM_AR=$LLVM_AR + # Extract the first word of "llvm-ar", so it can be a program name with args. +set dummy llvm-ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_LLVM_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_LLVM_AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_LLVM_AR="$ac_pt_LLVM_AR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in ${llvm_path} +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_LLVM_AR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ac_pt_LLVM_AR" && ac_cv_path_ac_pt_LLVM_AR="''" + ;; +esac +fi +ac_pt_LLVM_AR=$ac_cv_path_ac_pt_LLVM_AR +if test -n "$ac_pt_LLVM_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_AR" >&5 +$as_echo "$ac_pt_LLVM_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + LLVM_AR=$ac_pt_LLVM_AR + else + LLVM_AR="''" + fi +else + LLVM_AR="$ac_cv_path_LLVM_AR" +fi + + + if test -n "${LLVM_AR}" -a -x "${LLVM_AR}" + then + LLVM_AR_FOUND="found" + else + LLVM_AR_FOUND="not-found" + fi + if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found" + then + found_llvm_ar=`/usr/bin/xcrun -find llvm-ar 2>/dev/null` + if test -n "${found_llvm_ar}" + then + LLVM_AR='/usr/bin/xcrun llvm-ar' + LLVM_AR_FOUND=found + { $as_echo "$as_me:${as_lineno-$LINENO}: llvm-ar found via xcrun: ${LLVM_AR}" >&5 +$as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;} + fi + fi + if test $LLVM_AR_FOUND = not-found + then + LLVM_PROFR_ERR=yes + as_fn_error $? "llvm-ar is required for a --with-lto build with clang but could not be found." "$LINENO" 5 + else + LLVM_AR_ERR=no + fi + AR="${LLVM_AR}" + case $ac_sys_system in + Darwin*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto -Wl,-export_dynamic" + ;; + *) + LTOFLAGS="-flto" + ;; + esac + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + LTOFLAGS="-flto -Wl,-export_dynamic" + ;; + *) + LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" + ;; + esac + ;; + esac + + if test "$ac_cv_prog_cc_g" = "yes" + then + # bpo-30345: Add -g to LDFLAGS when compiling with LTO + # to get debug symbols. + LTOFLAGS="$LTOFLAGS -g" + fi + + BASECFLAGS="$BASECFLAGS $LTOFLAGS" + LDFLAGS="$LDFLAGS $LTOFLAGS" +fi + +# Enable PGO flags. + + + + + + # Extract the first word of "$target_alias-llvm-profdata", so it can be a program name with args. set dummy $target_alias-llvm-profdata; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/configure.ac b/configure.ac index 620b48a6e7b5..e322d0ae6c5b 100644 --- a/configure.ac +++ b/configure.ac @@ -1302,6 +1302,26 @@ else DEF_MAKE_RULE="all" fi +# Make llvm-relatec checks work on systems where llvm tools are not installed with their +# normal names in the default $PATH (ie: Ubuntu). They exist under the +# non-suffixed name in their versioned llvm directory. + +llvm_bin_dir='' +llvm_path="${PATH}" +if test "${CC}" = "clang" +then + clang_bin=`which clang` + # Some systems install clang elsewhere as a symlink to the real path + # which is where the related llvm tools are located. + if test -L "${clang_bin}" + then + clang_dir=`dirname "${clang_bin}"` + clang_bin=`readlink "${clang_bin}"` + llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` + llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" + fi +fi + # Enable LTO flags AC_MSG_CHECKING(for --with-lto) AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in any build. Disabled by default.]), @@ -1318,6 +1338,33 @@ fi], if test "$Py_LTO" = 'true' ; then case $CC in *clang*) + AC_SUBST(LLVM_AR) + AC_PATH_TARGET_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) + AC_SUBST(LLVM_AR_FOUND) + if test -n "${LLVM_AR}" -a -x "${LLVM_AR}" + then + LLVM_AR_FOUND="found" + else + LLVM_AR_FOUND="not-found" + fi + if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found" + then + found_llvm_ar=`/usr/bin/xcrun -find llvm-ar 2>/dev/null` + if test -n "${found_llvm_ar}" + then + LLVM_AR='/usr/bin/xcrun llvm-ar' + LLVM_AR_FOUND=found + AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}]) + fi + fi + if test $LLVM_AR_FOUND = not-found + then + LLVM_PROFR_ERR=yes + AC_MSG_ERROR([llvm-ar is required for a --with-lto build with clang but could not be found.]) + else + LLVM_AR_ERR=no + fi + AR="${LLVM_AR}" case $ac_sys_system in Darwin*) # Any changes made here should be reflected in the GCC+Darwin case below @@ -1347,7 +1394,7 @@ if test "$Py_LTO" = 'true' ; then LTOFLAGS="$LTOFLAGS -g" fi - CFLAGS="$CFLAGS $LTOFLAGS" + BASECFLAGS="$BASECFLAGS $LTOFLAGS" LDFLAGS="$LDFLAGS $LTOFLAGS" fi @@ -1357,24 +1404,6 @@ AC_SUBST(PGO_PROF_USE_FLAG) AC_SUBST(LLVM_PROF_MERGER) AC_SUBST(LLVM_PROF_FILE) AC_SUBST(LLVM_PROF_ERR) -# Make this work on systems where llvm tools are not installed with their -# normal names in the default $PATH (ie: Ubuntu). They exist under the -# non-suffixed name in their versioned llvm directory. -llvm_bin_dir='' -llvm_path="${PATH}" -if test "${CC}" = "clang" -then - clang_bin=`which clang` - # Some systems install clang elsewhere as a symlink to the real path - # which is where the related llvm tools are located. - if test -L "${clang_bin}" - then - clang_dir=`dirname "${clang_bin}"` - clang_bin=`readlink "${clang_bin}"` - llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` - llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" - fi -fi AC_SUBST(LLVM_PROFDATA) AC_PATH_TARGET_TOOL(LLVM_PROFDATA, llvm-profdata, '', ${llvm_path}) AC_SUBST(LLVM_PROF_FOUND) From solipsis at pitrou.net Thu Oct 25 05:07:56 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 25 Oct 2018 09:07:56 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=0 Message-ID: <20181025090756.1.8CA68AF3715F7EB9@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [-7, 1, 0] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [2, -1, 1] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogKDobiI', '--timeout', '7200'] From webhook-mailer at python.org Thu Oct 25 07:04:35 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 11:04:35 -0000 Subject: [Python-checkins] importlib: Fix typo in SourceLoader.path_stats docstring (GH-10052) Message-ID: https://github.com/python/cpython/commit/d7c3e5f0e89cb807093e33165815c8bbd3c00f4b commit: d7c3e5f0e89cb807093e33165815c8bbd3c00f4b branch: master author: Quentin committer: Victor Stinner date: 2018-10-25T13:04:28+02:00 summary: importlib: Fix typo in SourceLoader.path_stats docstring (GH-10052) files: M Lib/importlib/_bootstrap_external.py M Python/importlib_external.h diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 6ef6bf8ab6a4..0b742baa37c2 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -785,15 +785,16 @@ class SourceLoader(_LoaderBasics): def path_mtime(self, path): """Optional method that returns the modification time (an int) for the - specified path, where path is a str. + specified path (a str). Raises OSError when the path cannot be handled. """ raise OSError def path_stats(self, path): - """Optional method returning a metadata dict for the specified path - to by the path (str). + """Optional method returning a metadata dict for the specified + path (a str). + Possible keys: - 'mtime' (mandatory) is the numeric timestamp of last source code modification; diff --git a/Python/importlib_external.h b/Python/importlib_external.h index a597ca3d935c..5121ec57c2ba 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1155,625 +1155,297 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,90,9,100,17,83,0,41,18,218,12,83,111,117,114,99, 101,76,111,97,100,101,114,99,2,0,0,0,0,0,0,0, 2,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, - 0,116,0,130,1,100,1,83,0,41,2,122,178,79,112,116, + 0,116,0,130,1,100,1,83,0,41,2,122,165,79,112,116, 105,111,110,97,108,32,109,101,116,104,111,100,32,116,104,97, 116,32,114,101,116,117,114,110,115,32,116,104,101,32,109,111, 100,105,102,105,99,97,116,105,111,110,32,116,105,109,101,32, 40,97,110,32,105,110,116,41,32,102,111,114,32,116,104,101, 10,32,32,32,32,32,32,32,32,115,112,101,99,105,102,105, - 101,100,32,112,97,116,104,44,32,119,104,101,114,101,32,112, - 97,116,104,32,105,115,32,97,32,115,116,114,46,10,10,32, - 32,32,32,32,32,32,32,82,97,105,115,101,115,32,79,83, - 69,114,114,111,114,32,119,104,101,110,32,116,104,101,32,112, - 97,116,104,32,99,97,110,110,111,116,32,98,101,32,104,97, - 110,100,108,101,100,46,10,32,32,32,32,32,32,32,32,78, - 41,1,114,44,0,0,0,41,2,114,108,0,0,0,114,39, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,10,112,97,116,104,95,109,116,105,109,101,18,3, - 0,0,115,2,0,0,0,0,6,122,23,83,111,117,114,99, - 101,76,111,97,100,101,114,46,112,97,116,104,95,109,116,105, - 109,101,99,2,0,0,0,0,0,0,0,2,0,0,0,4, - 0,0,0,67,0,0,0,115,14,0,0,0,100,1,124,0, - 160,0,124,1,161,1,105,1,83,0,41,2,97,170,1,0, - 0,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100, - 32,114,101,116,117,114,110,105,110,103,32,97,32,109,101,116, - 97,100,97,116,97,32,100,105,99,116,32,102,111,114,32,116, - 104,101,32,115,112,101,99,105,102,105,101,100,32,112,97,116, - 104,10,32,32,32,32,32,32,32,32,116,111,32,98,121,32, - 116,104,101,32,112,97,116,104,32,40,115,116,114,41,46,10, - 32,32,32,32,32,32,32,32,80,111,115,115,105,98,108,101, - 32,107,101,121,115,58,10,32,32,32,32,32,32,32,32,45, - 32,39,109,116,105,109,101,39,32,40,109,97,110,100,97,116, - 111,114,121,41,32,105,115,32,116,104,101,32,110,117,109,101, - 114,105,99,32,116,105,109,101,115,116,97,109,112,32,111,102, - 32,108,97,115,116,32,115,111,117,114,99,101,10,32,32,32, - 32,32,32,32,32,32,32,99,111,100,101,32,109,111,100,105, - 102,105,99,97,116,105,111,110,59,10,32,32,32,32,32,32, - 32,32,45,32,39,115,105,122,101,39,32,40,111,112,116,105, - 111,110,97,108,41,32,105,115,32,116,104,101,32,115,105,122, - 101,32,105,110,32,98,121,116,101,115,32,111,102,32,116,104, - 101,32,115,111,117,114,99,101,32,99,111,100,101,46,10,10, - 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, - 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, - 32,97,108,108,111,119,115,32,116,104,101,32,108,111,97,100, - 101,114,32,116,111,32,114,101,97,100,32,98,121,116,101,99, - 111,100,101,32,102,105,108,101,115,46,10,32,32,32,32,32, - 32,32,32,82,97,105,115,101,115,32,79,83,69,114,114,111, - 114,32,119,104,101,110,32,116,104,101,32,112,97,116,104,32, - 99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101, - 100,46,10,32,32,32,32,32,32,32,32,114,155,0,0,0, - 41,1,114,201,0,0,0,41,2,114,108,0,0,0,114,39, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,10,112,97,116,104,95,115,116,97,116,115,26,3, - 0,0,115,2,0,0,0,0,11,122,23,83,111,117,114,99, - 101,76,111,97,100,101,114,46,112,97,116,104,95,115,116,97, - 116,115,99,4,0,0,0,0,0,0,0,4,0,0,0,4, - 0,0,0,67,0,0,0,115,12,0,0,0,124,0,160,0, - 124,2,124,3,161,2,83,0,41,1,122,228,79,112,116,105, - 111,110,97,108,32,109,101,116,104,111,100,32,119,104,105,99, - 104,32,119,114,105,116,101,115,32,100,97,116,97,32,40,98, - 121,116,101,115,41,32,116,111,32,97,32,102,105,108,101,32, - 112,97,116,104,32,40,97,32,115,116,114,41,46,10,10,32, - 32,32,32,32,32,32,32,73,109,112,108,101,109,101,110,116, - 105,110,103,32,116,104,105,115,32,109,101,116,104,111,100,32, - 97,108,108,111,119,115,32,102,111,114,32,116,104,101,32,119, - 114,105,116,105,110,103,32,111,102,32,98,121,116,101,99,111, - 100,101,32,102,105,108,101,115,46,10,10,32,32,32,32,32, - 32,32,32,84,104,101,32,115,111,117,114,99,101,32,112,97, - 116,104,32,105,115,32,110,101,101,100,101,100,32,105,110,32, - 111,114,100,101,114,32,116,111,32,99,111,114,114,101,99,116, - 108,121,32,116,114,97,110,115,102,101,114,32,112,101,114,109, - 105,115,115,105,111,110,115,10,32,32,32,32,32,32,32,32, - 41,1,218,8,115,101,116,95,100,97,116,97,41,4,114,108, - 0,0,0,114,99,0,0,0,90,10,99,97,99,104,101,95, - 112,97,116,104,114,21,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,218,15,95,99,97,99,104,101, - 95,98,121,116,101,99,111,100,101,39,3,0,0,115,2,0, - 0,0,0,8,122,28,83,111,117,114,99,101,76,111,97,100, - 101,114,46,95,99,97,99,104,101,95,98,121,116,101,99,111, - 100,101,99,3,0,0,0,0,0,0,0,3,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, - 41,2,122,150,79,112,116,105,111,110,97,108,32,109,101,116, - 104,111,100,32,119,104,105,99,104,32,119,114,105,116,101,115, - 32,100,97,116,97,32,40,98,121,116,101,115,41,32,116,111, - 32,97,32,102,105,108,101,32,112,97,116,104,32,40,97,32, - 115,116,114,41,46,10,10,32,32,32,32,32,32,32,32,73, + 101,100,32,112,97,116,104,32,40,97,32,115,116,114,41,46, + 10,10,32,32,32,32,32,32,32,32,82,97,105,115,101,115, + 32,79,83,69,114,114,111,114,32,119,104,101,110,32,116,104, + 101,32,112,97,116,104,32,99,97,110,110,111,116,32,98,101, + 32,104,97,110,100,108,101,100,46,10,32,32,32,32,32,32, + 32,32,78,41,1,114,44,0,0,0,41,2,114,108,0,0, + 0,114,39,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,218,10,112,97,116,104,95,109,116,105,109, + 101,18,3,0,0,115,2,0,0,0,0,6,122,23,83,111, + 117,114,99,101,76,111,97,100,101,114,46,112,97,116,104,95, + 109,116,105,109,101,99,2,0,0,0,0,0,0,0,2,0, + 0,0,4,0,0,0,67,0,0,0,115,14,0,0,0,100, + 1,124,0,160,0,124,1,161,1,105,1,83,0,41,2,97, + 158,1,0,0,79,112,116,105,111,110,97,108,32,109,101,116, + 104,111,100,32,114,101,116,117,114,110,105,110,103,32,97,32, + 109,101,116,97,100,97,116,97,32,100,105,99,116,32,102,111, + 114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,10, + 32,32,32,32,32,32,32,32,112,97,116,104,32,40,97,32, + 115,116,114,41,46,10,10,32,32,32,32,32,32,32,32,80, + 111,115,115,105,98,108,101,32,107,101,121,115,58,10,32,32, + 32,32,32,32,32,32,45,32,39,109,116,105,109,101,39,32, + 40,109,97,110,100,97,116,111,114,121,41,32,105,115,32,116, + 104,101,32,110,117,109,101,114,105,99,32,116,105,109,101,115, + 116,97,109,112,32,111,102,32,108,97,115,116,32,115,111,117, + 114,99,101,10,32,32,32,32,32,32,32,32,32,32,99,111, + 100,101,32,109,111,100,105,102,105,99,97,116,105,111,110,59, + 10,32,32,32,32,32,32,32,32,45,32,39,115,105,122,101, + 39,32,40,111,112,116,105,111,110,97,108,41,32,105,115,32, + 116,104,101,32,115,105,122,101,32,105,110,32,98,121,116,101, + 115,32,111,102,32,116,104,101,32,115,111,117,114,99,101,32, + 99,111,100,101,46,10,10,32,32,32,32,32,32,32,32,73, 109,112,108,101,109,101,110,116,105,110,103,32,116,104,105,115, - 32,109,101,116,104,111,100,32,97,108,108,111,119,115,32,102, - 111,114,32,116,104,101,32,119,114,105,116,105,110,103,32,111, - 102,32,98,121,116,101,99,111,100,101,32,102,105,108,101,115, - 46,10,32,32,32,32,32,32,32,32,78,114,2,0,0,0, - 41,3,114,108,0,0,0,114,39,0,0,0,114,21,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,203,0,0,0,49,3,0,0,115,2,0,0,0,0,4, - 122,21,83,111,117,114,99,101,76,111,97,100,101,114,46,115, - 101,116,95,100,97,116,97,99,2,0,0,0,0,0,0,0, - 5,0,0,0,10,0,0,0,67,0,0,0,115,82,0,0, - 0,124,0,160,0,124,1,161,1,125,2,122,14,124,0,160, - 1,124,2,161,1,125,3,87,0,110,48,4,0,116,2,107, - 10,114,72,1,0,125,4,1,0,122,18,116,3,100,1,124, - 1,100,2,141,2,124,4,130,2,87,0,53,0,100,3,125, - 4,126,4,88,0,89,0,110,2,88,0,116,4,124,3,131, - 1,83,0,41,4,122,52,67,111,110,99,114,101,116,101,32, - 105,109,112,108,101,109,101,110,116,97,116,105,111,110,32,111, - 102,32,73,110,115,112,101,99,116,76,111,97,100,101,114,46, - 103,101,116,95,115,111,117,114,99,101,46,122,39,115,111,117, - 114,99,101,32,110,111,116,32,97,118,97,105,108,97,98,108, - 101,32,116,104,114,111,117,103,104,32,103,101,116,95,100,97, - 116,97,40,41,41,1,114,106,0,0,0,78,41,5,114,164, - 0,0,0,218,8,103,101,116,95,100,97,116,97,114,44,0, - 0,0,114,107,0,0,0,114,162,0,0,0,41,5,114,108, - 0,0,0,114,127,0,0,0,114,39,0,0,0,114,160,0, - 0,0,218,3,101,120,99,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,10,103,101,116,95,115,111,117,114, - 99,101,56,3,0,0,115,20,0,0,0,0,2,10,1,2, - 1,14,1,16,1,4,1,2,255,4,1,2,255,20,2,122, - 23,83,111,117,114,99,101,76,111,97,100,101,114,46,103,101, - 116,95,115,111,117,114,99,101,114,96,0,0,0,41,1,218, - 9,95,111,112,116,105,109,105,122,101,99,3,0,0,0,1, - 0,0,0,4,0,0,0,8,0,0,0,67,0,0,0,115, - 22,0,0,0,116,0,106,1,116,2,124,1,124,2,100,1, - 100,2,124,3,100,3,141,6,83,0,41,4,122,130,82,101, - 116,117,114,110,32,116,104,101,32,99,111,100,101,32,111,98, - 106,101,99,116,32,99,111,109,112,105,108,101,100,32,102,114, - 111,109,32,115,111,117,114,99,101,46,10,10,32,32,32,32, - 32,32,32,32,84,104,101,32,39,100,97,116,97,39,32,97, - 114,103,117,109,101,110,116,32,99,97,110,32,98,101,32,97, - 110,121,32,111,98,106,101,99,116,32,116,121,112,101,32,116, - 104,97,116,32,99,111,109,112,105,108,101,40,41,32,115,117, - 112,112,111,114,116,115,46,10,32,32,32,32,32,32,32,32, - 114,195,0,0,0,84,41,2,218,12,100,111,110,116,95,105, - 110,104,101,114,105,116,114,75,0,0,0,41,3,114,122,0, - 0,0,114,194,0,0,0,218,7,99,111,109,112,105,108,101, - 41,4,114,108,0,0,0,114,21,0,0,0,114,39,0,0, - 0,114,208,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,14,115,111,117,114,99,101,95,116,111, - 95,99,111,100,101,66,3,0,0,115,8,0,0,0,0,5, - 12,1,2,0,2,255,122,27,83,111,117,114,99,101,76,111, - 97,100,101,114,46,115,111,117,114,99,101,95,116,111,95,99, - 111,100,101,99,2,0,0,0,0,0,0,0,15,0,0,0, - 9,0,0,0,67,0,0,0,115,46,2,0,0,124,0,160, - 0,124,1,161,1,125,2,100,1,125,3,100,1,125,4,100, - 1,125,5,100,2,125,6,100,3,125,7,122,12,116,1,124, - 2,131,1,125,8,87,0,110,26,4,0,116,2,107,10,114, - 68,1,0,1,0,1,0,100,1,125,8,89,0,144,1,110, - 48,88,0,122,14,124,0,160,3,124,2,161,1,125,9,87, - 0,110,22,4,0,116,4,107,10,114,106,1,0,1,0,1, - 0,89,0,144,1,110,10,88,0,116,5,124,9,100,4,25, - 0,131,1,125,3,122,14,124,0,160,6,124,8,161,1,125, - 10,87,0,110,20,4,0,116,4,107,10,114,154,1,0,1, - 0,1,0,89,0,110,218,88,0,124,1,124,8,100,5,156, - 2,125,11,122,148,116,7,124,10,124,1,124,11,131,3,125, - 12,116,8,124,10,131,1,100,6,100,1,133,2,25,0,125, - 13,124,12,100,7,64,0,100,8,107,3,125,6,124,6,144, - 1,114,36,124,12,100,9,64,0,100,8,107,3,125,7,116, - 9,106,10,100,10,107,3,144,1,114,34,124,7,115,254,116, - 9,106,10,100,11,107,2,144,1,114,34,124,0,160,6,124, - 2,161,1,125,4,116,9,160,11,116,12,124,4,161,2,125, - 5,116,13,124,10,124,5,124,1,124,11,131,4,1,0,110, - 20,116,14,124,10,124,3,124,9,100,12,25,0,124,1,124, - 11,131,5,1,0,87,0,110,26,4,0,116,15,116,16,102, - 2,107,10,144,1,114,84,1,0,1,0,1,0,89,0,110, - 32,88,0,116,17,160,18,100,13,124,8,124,2,161,3,1, - 0,116,19,124,13,124,1,124,8,124,2,100,14,141,4,83, - 0,124,4,100,1,107,8,144,1,114,136,124,0,160,6,124, - 2,161,1,125,4,124,0,160,20,124,4,124,2,161,2,125, - 14,116,17,160,18,100,15,124,2,161,2,1,0,116,21,106, - 22,144,2,115,42,124,8,100,1,107,9,144,2,114,42,124, - 3,100,1,107,9,144,2,114,42,124,6,144,1,114,228,124, - 5,100,1,107,8,144,1,114,214,116,9,160,11,124,4,161, - 1,125,5,116,23,124,14,124,5,124,7,131,3,125,10,110, - 16,116,24,124,14,124,3,116,25,124,4,131,1,131,3,125, - 10,122,30,124,0,160,26,124,2,124,8,124,10,161,3,1, - 0,116,17,160,18,100,16,124,8,161,2,1,0,87,0,110, - 22,4,0,116,2,107,10,144,2,114,40,1,0,1,0,1, - 0,89,0,110,2,88,0,124,14,83,0,41,17,122,190,67, - 111,110,99,114,101,116,101,32,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,32,111,102,32,73,110,115,112,101,99, - 116,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101, - 46,10,10,32,32,32,32,32,32,32,32,82,101,97,100,105, - 110,103,32,111,102,32,98,121,116,101,99,111,100,101,32,114, - 101,113,117,105,114,101,115,32,112,97,116,104,95,115,116,97, - 116,115,32,116,111,32,98,101,32,105,109,112,108,101,109,101, - 110,116,101,100,46,32,84,111,32,119,114,105,116,101,10,32, - 32,32,32,32,32,32,32,98,121,116,101,99,111,100,101,44, - 32,115,101,116,95,100,97,116,97,32,109,117,115,116,32,97, - 108,115,111,32,98,101,32,105,109,112,108,101,109,101,110,116, - 101,100,46,10,10,32,32,32,32,32,32,32,32,78,70,84, - 114,155,0,0,0,41,2,114,106,0,0,0,114,39,0,0, - 0,114,132,0,0,0,114,34,0,0,0,114,64,0,0,0, - 114,23,0,0,0,90,5,110,101,118,101,114,90,6,97,108, - 119,97,121,115,218,4,115,105,122,101,122,13,123,125,32,109, - 97,116,99,104,101,115,32,123,125,41,3,114,106,0,0,0, - 114,98,0,0,0,114,99,0,0,0,122,19,99,111,100,101, - 32,111,98,106,101,99,116,32,102,114,111,109,32,123,125,122, - 10,119,114,111,116,101,32,123,33,114,125,41,27,114,164,0, - 0,0,114,89,0,0,0,114,73,0,0,0,114,202,0,0, - 0,114,44,0,0,0,114,14,0,0,0,114,205,0,0,0, - 114,139,0,0,0,218,10,109,101,109,111,114,121,118,105,101, - 119,114,149,0,0,0,90,21,99,104,101,99,107,95,104,97, - 115,104,95,98,97,115,101,100,95,112,121,99,115,114,144,0, - 0,0,218,17,95,82,65,87,95,77,65,71,73,67,95,78, - 85,77,66,69,82,114,145,0,0,0,114,143,0,0,0,114, - 107,0,0,0,114,137,0,0,0,114,122,0,0,0,114,136, - 0,0,0,114,151,0,0,0,114,211,0,0,0,114,6,0, - 0,0,218,19,100,111,110,116,95,119,114,105,116,101,95,98, - 121,116,101,99,111,100,101,114,157,0,0,0,114,156,0,0, - 0,114,18,0,0,0,114,204,0,0,0,41,15,114,108,0, - 0,0,114,127,0,0,0,114,99,0,0,0,114,141,0,0, - 0,114,160,0,0,0,114,144,0,0,0,90,10,104,97,115, - 104,95,98,97,115,101,100,90,12,99,104,101,99,107,95,115, - 111,117,114,99,101,114,98,0,0,0,218,2,115,116,114,21, - 0,0,0,114,138,0,0,0,114,74,0,0,0,90,10,98, - 121,116,101,115,95,100,97,116,97,90,11,99,111,100,101,95, - 111,98,106,101,99,116,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,193,0,0,0,74,3,0,0,115,154, - 0,0,0,0,7,10,1,4,1,4,1,4,1,4,1,4, - 1,2,1,12,1,14,1,12,2,2,1,14,1,14,1,8, - 2,12,1,2,1,14,1,14,1,6,3,2,1,2,254,6, - 4,2,1,12,1,16,1,12,1,6,1,12,1,12,1,2, - 255,2,2,8,254,4,3,10,1,4,1,2,1,2,254,4, - 4,8,1,2,255,6,3,2,1,2,1,2,1,6,1,2, - 1,2,251,8,7,20,1,6,2,8,1,2,255,4,2,6, - 1,2,1,2,254,6,3,10,1,10,1,12,1,12,1,18, - 1,6,255,4,2,6,1,10,1,10,1,14,2,6,1,6, - 255,4,2,2,1,14,1,16,1,16,1,6,1,122,21,83, - 111,117,114,99,101,76,111,97,100,101,114,46,103,101,116,95, - 99,111,100,101,78,41,10,114,113,0,0,0,114,112,0,0, - 0,114,114,0,0,0,114,201,0,0,0,114,202,0,0,0, - 114,204,0,0,0,114,203,0,0,0,114,207,0,0,0,114, - 211,0,0,0,114,193,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,200,0, - 0,0,16,3,0,0,115,14,0,0,0,8,2,8,8,8, - 13,8,10,8,7,8,10,14,8,114,200,0,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0, - 0,0,0,115,124,0,0,0,101,0,90,1,100,0,90,2, - 100,1,90,3,100,2,100,3,132,0,90,4,100,4,100,5, - 132,0,90,5,100,6,100,7,132,0,90,6,101,7,135,0, - 102,1,100,8,100,9,132,8,131,1,90,8,101,7,100,10, - 100,11,132,0,131,1,90,9,100,12,100,13,132,0,90,10, - 101,7,100,14,100,15,132,0,131,1,90,11,100,16,100,17, - 132,0,90,12,100,18,100,19,132,0,90,13,100,20,100,21, - 132,0,90,14,100,22,100,23,132,0,90,15,135,0,4,0, - 90,16,83,0,41,24,218,10,70,105,108,101,76,111,97,100, - 101,114,122,103,66,97,115,101,32,102,105,108,101,32,108,111, - 97,100,101,114,32,99,108,97,115,115,32,119,104,105,99,104, - 32,105,109,112,108,101,109,101,110,116,115,32,116,104,101,32, - 108,111,97,100,101,114,32,112,114,111,116,111,99,111,108,32, - 109,101,116,104,111,100,115,32,116,104,97,116,10,32,32,32, - 32,114,101,113,117,105,114,101,32,102,105,108,101,32,115,121, - 115,116,101,109,32,117,115,97,103,101,46,99,3,0,0,0, - 0,0,0,0,3,0,0,0,2,0,0,0,67,0,0,0, - 115,16,0,0,0,124,1,124,0,95,0,124,2,124,0,95, - 1,100,1,83,0,41,2,122,75,67,97,99,104,101,32,116, - 104,101,32,109,111,100,117,108,101,32,110,97,109,101,32,97, - 110,100,32,116,104,101,32,112,97,116,104,32,116,111,32,116, - 104,101,32,102,105,108,101,32,102,111,117,110,100,32,98,121, - 32,116,104,101,10,32,32,32,32,32,32,32,32,102,105,110, - 100,101,114,46,78,41,2,114,106,0,0,0,114,39,0,0, - 0,41,3,114,108,0,0,0,114,127,0,0,0,114,39,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,191,0,0,0,165,3,0,0,115,4,0,0,0,0, - 3,6,1,122,19,70,105,108,101,76,111,97,100,101,114,46, - 95,95,105,110,105,116,95,95,99,2,0,0,0,0,0,0, - 0,2,0,0,0,2,0,0,0,67,0,0,0,115,24,0, - 0,0,124,0,106,0,124,1,106,0,107,2,111,22,124,0, - 106,1,124,1,106,1,107,2,83,0,41,1,78,41,2,218, - 9,95,95,99,108,97,115,115,95,95,114,119,0,0,0,41, - 2,114,108,0,0,0,218,5,111,116,104,101,114,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,6,95,95, - 101,113,95,95,171,3,0,0,115,6,0,0,0,0,1,12, - 1,10,255,122,17,70,105,108,101,76,111,97,100,101,114,46, - 95,95,101,113,95,95,99,1,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,20,0,0,0, - 116,0,124,0,106,1,131,1,116,0,124,0,106,2,131,1, - 65,0,83,0,41,1,78,41,3,218,4,104,97,115,104,114, - 106,0,0,0,114,39,0,0,0,41,1,114,108,0,0,0, + 32,109,101,116,104,111,100,32,97,108,108,111,119,115,32,116, + 104,101,32,108,111,97,100,101,114,32,116,111,32,114,101,97, + 100,32,98,121,116,101,99,111,100,101,32,102,105,108,101,115, + 46,10,32,32,32,32,32,32,32,32,82,97,105,115,101,115, + 32,79,83,69,114,114,111,114,32,119,104,101,110,32,116,104, + 101,32,112,97,116,104,32,99,97,110,110,111,116,32,98,101, + 32,104,97,110,100,108,101,100,46,10,32,32,32,32,32,32, + 32,32,114,155,0,0,0,41,1,114,201,0,0,0,41,2, + 114,108,0,0,0,114,39,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,218,10,112,97,116,104,95, + 115,116,97,116,115,26,3,0,0,115,2,0,0,0,0,12, + 122,23,83,111,117,114,99,101,76,111,97,100,101,114,46,112, + 97,116,104,95,115,116,97,116,115,99,4,0,0,0,0,0, + 0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,12, + 0,0,0,124,0,160,0,124,2,124,3,161,2,83,0,41, + 1,122,228,79,112,116,105,111,110,97,108,32,109,101,116,104, + 111,100,32,119,104,105,99,104,32,119,114,105,116,101,115,32, + 100,97,116,97,32,40,98,121,116,101,115,41,32,116,111,32, + 97,32,102,105,108,101,32,112,97,116,104,32,40,97,32,115, + 116,114,41,46,10,10,32,32,32,32,32,32,32,32,73,109, + 112,108,101,109,101,110,116,105,110,103,32,116,104,105,115,32, + 109,101,116,104,111,100,32,97,108,108,111,119,115,32,102,111, + 114,32,116,104,101,32,119,114,105,116,105,110,103,32,111,102, + 32,98,121,116,101,99,111,100,101,32,102,105,108,101,115,46, + 10,10,32,32,32,32,32,32,32,32,84,104,101,32,115,111, + 117,114,99,101,32,112,97,116,104,32,105,115,32,110,101,101, + 100,101,100,32,105,110,32,111,114,100,101,114,32,116,111,32, + 99,111,114,114,101,99,116,108,121,32,116,114,97,110,115,102, + 101,114,32,112,101,114,109,105,115,115,105,111,110,115,10,32, + 32,32,32,32,32,32,32,41,1,218,8,115,101,116,95,100, + 97,116,97,41,4,114,108,0,0,0,114,99,0,0,0,90, + 10,99,97,99,104,101,95,112,97,116,104,114,21,0,0,0, 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 8,95,95,104,97,115,104,95,95,175,3,0,0,115,2,0, - 0,0,0,1,122,19,70,105,108,101,76,111,97,100,101,114, - 46,95,95,104,97,115,104,95,95,99,2,0,0,0,0,0, - 0,0,2,0,0,0,3,0,0,0,3,0,0,0,115,16, - 0,0,0,116,0,116,1,124,0,131,2,160,2,124,1,161, - 1,83,0,41,1,122,100,76,111,97,100,32,97,32,109,111, - 100,117,108,101,32,102,114,111,109,32,97,32,102,105,108,101, - 46,10,10,32,32,32,32,32,32,32,32,84,104,105,115,32, - 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, - 97,116,101,100,46,32,32,85,115,101,32,101,120,101,99,95, - 109,111,100,117,108,101,40,41,32,105,110,115,116,101,97,100, - 46,10,10,32,32,32,32,32,32,32,32,41,3,218,5,115, - 117,112,101,114,114,217,0,0,0,114,199,0,0,0,41,2, - 114,108,0,0,0,114,127,0,0,0,41,1,114,218,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,199,0,0,0, - 178,3,0,0,115,2,0,0,0,0,10,122,22,70,105,108, - 101,76,111,97,100,101,114,46,108,111,97,100,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,6,0,0,0,124,0,106, - 0,83,0,41,1,122,58,82,101,116,117,114,110,32,116,104, - 101,32,112,97,116,104,32,116,111,32,116,104,101,32,115,111, - 117,114,99,101,32,102,105,108,101,32,97,115,32,102,111,117, - 110,100,32,98,121,32,116,104,101,32,102,105,110,100,101,114, - 46,41,1,114,39,0,0,0,41,2,114,108,0,0,0,114, - 127,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,164,0,0,0,190,3,0,0,115,2,0,0, - 0,0,3,122,23,70,105,108,101,76,111,97,100,101,114,46, - 103,101,116,95,102,105,108,101,110,97,109,101,99,2,0,0, - 0,0,0,0,0,3,0,0,0,10,0,0,0,67,0,0, - 0,115,44,0,0,0,116,0,160,1,124,1,100,1,161,2, - 143,22,125,2,124,2,160,2,161,0,87,0,2,0,53,0, - 81,0,82,0,163,0,83,0,81,0,82,0,88,0,100,2, - 83,0,41,3,122,39,82,101,116,117,114,110,32,116,104,101, - 32,100,97,116,97,32,102,114,111,109,32,112,97,116,104,32, - 97,115,32,114,97,119,32,98,121,116,101,115,46,218,1,114, - 78,41,3,114,56,0,0,0,114,57,0,0,0,90,4,114, - 101,97,100,41,3,114,108,0,0,0,114,39,0,0,0,114, - 60,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,205,0,0,0,195,3,0,0,115,4,0,0, - 0,0,2,14,1,122,19,70,105,108,101,76,111,97,100,101, - 114,46,103,101,116,95,100,97,116,97,99,2,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, - 18,0,0,0,124,0,160,0,124,1,161,1,114,14,124,0, - 83,0,100,0,83,0,41,1,78,41,1,114,166,0,0,0, - 41,2,114,108,0,0,0,114,196,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,218,19,103,101,116, - 95,114,101,115,111,117,114,99,101,95,114,101,97,100,101,114, - 202,3,0,0,115,6,0,0,0,0,2,10,1,4,1,122, - 30,70,105,108,101,76,111,97,100,101,114,46,103,101,116,95, - 114,101,115,111,117,114,99,101,95,114,101,97,100,101,114,99, - 2,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0, - 67,0,0,0,115,32,0,0,0,116,0,116,1,124,0,106, - 2,131,1,100,1,25,0,124,1,131,2,125,2,116,3,160, - 4,124,2,100,2,161,2,83,0,41,3,78,114,64,0,0, - 0,114,224,0,0,0,41,5,114,33,0,0,0,114,42,0, - 0,0,114,39,0,0,0,114,56,0,0,0,114,57,0,0, - 0,41,3,114,108,0,0,0,218,8,114,101,115,111,117,114, - 99,101,114,39,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,13,111,112,101,110,95,114,101,115, - 111,117,114,99,101,208,3,0,0,115,4,0,0,0,0,1, - 20,1,122,24,70,105,108,101,76,111,97,100,101,114,46,111, - 112,101,110,95,114,101,115,111,117,114,99,101,99,2,0,0, - 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, - 0,115,38,0,0,0,124,0,160,0,124,1,161,1,115,14, - 116,1,130,1,116,2,116,3,124,0,106,4,131,1,100,1, - 25,0,124,1,131,2,125,2,124,2,83,0,41,2,78,114, - 64,0,0,0,41,5,218,11,105,115,95,114,101,115,111,117, - 114,99,101,218,17,70,105,108,101,78,111,116,70,111,117,110, - 100,69,114,114,111,114,114,33,0,0,0,114,42,0,0,0, - 114,39,0,0,0,41,3,114,108,0,0,0,114,226,0,0, - 0,114,39,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,13,114,101,115,111,117,114,99,101,95, - 112,97,116,104,212,3,0,0,115,8,0,0,0,0,1,10, - 1,4,1,20,1,122,24,70,105,108,101,76,111,97,100,101, - 114,46,114,101,115,111,117,114,99,101,95,112,97,116,104,99, - 2,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, - 67,0,0,0,115,40,0,0,0,116,0,124,1,107,6,114, - 12,100,1,83,0,116,1,116,2,124,0,106,3,131,1,100, - 2,25,0,124,1,131,2,125,2,116,4,124,2,131,1,83, - 0,41,3,78,70,114,64,0,0,0,41,5,114,30,0,0, - 0,114,33,0,0,0,114,42,0,0,0,114,39,0,0,0, - 114,48,0,0,0,41,3,114,108,0,0,0,114,106,0,0, - 0,114,39,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,228,0,0,0,218,3,0,0,115,8, - 0,0,0,0,1,8,1,4,1,20,1,122,22,70,105,108, - 101,76,111,97,100,101,114,46,105,115,95,114,101,115,111,117, - 114,99,101,99,1,0,0,0,0,0,0,0,1,0,0,0, - 5,0,0,0,67,0,0,0,115,24,0,0,0,116,0,116, - 1,160,2,116,3,124,0,106,4,131,1,100,1,25,0,161, - 1,131,1,83,0,41,2,78,114,64,0,0,0,41,5,218, - 4,105,116,101,114,114,1,0,0,0,218,7,108,105,115,116, - 100,105,114,114,42,0,0,0,114,39,0,0,0,41,1,114, - 108,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,8,99,111,110,116,101,110,116,115,224,3,0, - 0,115,2,0,0,0,0,1,122,19,70,105,108,101,76,111, - 97,100,101,114,46,99,111,110,116,101,110,116,115,41,17,114, - 113,0,0,0,114,112,0,0,0,114,114,0,0,0,114,115, - 0,0,0,114,191,0,0,0,114,220,0,0,0,114,222,0, - 0,0,114,124,0,0,0,114,199,0,0,0,114,164,0,0, - 0,114,205,0,0,0,114,225,0,0,0,114,227,0,0,0, - 114,230,0,0,0,114,228,0,0,0,114,233,0,0,0,90, - 13,95,95,99,108,97,115,115,99,101,108,108,95,95,114,2, - 0,0,0,114,2,0,0,0,41,1,114,218,0,0,0,114, - 4,0,0,0,114,217,0,0,0,160,3,0,0,115,24,0, - 0,0,8,3,4,2,8,6,8,4,8,3,16,12,12,5, - 8,7,12,6,8,4,8,6,8,6,114,217,0,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, - 64,0,0,0,115,46,0,0,0,101,0,90,1,100,0,90, - 2,100,1,90,3,100,2,100,3,132,0,90,4,100,4,100, - 5,132,0,90,5,100,6,100,7,156,1,100,8,100,9,132, - 2,90,6,100,10,83,0,41,11,218,16,83,111,117,114,99, - 101,70,105,108,101,76,111,97,100,101,114,122,62,67,111,110, - 99,114,101,116,101,32,105,109,112,108,101,109,101,110,116,97, - 116,105,111,110,32,111,102,32,83,111,117,114,99,101,76,111, - 97,100,101,114,32,117,115,105,110,103,32,116,104,101,32,102, - 105,108,101,32,115,121,115,116,101,109,46,99,2,0,0,0, - 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, - 115,22,0,0,0,116,0,124,1,131,1,125,2,124,2,106, - 1,124,2,106,2,100,1,156,2,83,0,41,2,122,33,82, - 101,116,117,114,110,32,116,104,101,32,109,101,116,97,100,97, - 116,97,32,102,111,114,32,116,104,101,32,112,97,116,104,46, - 41,2,114,155,0,0,0,114,212,0,0,0,41,3,114,43, - 0,0,0,218,8,115,116,95,109,116,105,109,101,90,7,115, - 116,95,115,105,122,101,41,3,114,108,0,0,0,114,39,0, - 0,0,114,216,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,202,0,0,0,232,3,0,0,115, - 4,0,0,0,0,2,8,1,122,27,83,111,117,114,99,101, - 70,105,108,101,76,111,97,100,101,114,46,112,97,116,104,95, - 115,116,97,116,115,99,4,0,0,0,0,0,0,0,5,0, - 0,0,5,0,0,0,67,0,0,0,115,24,0,0,0,116, - 0,124,1,131,1,125,4,124,0,106,1,124,2,124,3,124, - 4,100,1,141,3,83,0,41,2,78,41,1,218,5,95,109, - 111,100,101,41,2,114,105,0,0,0,114,203,0,0,0,41, - 5,114,108,0,0,0,114,99,0,0,0,114,98,0,0,0, - 114,21,0,0,0,114,46,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,204,0,0,0,237,3, - 0,0,115,4,0,0,0,0,2,8,1,122,32,83,111,117, - 114,99,101,70,105,108,101,76,111,97,100,101,114,46,95,99, - 97,99,104,101,95,98,121,116,101,99,111,100,101,105,182,1, - 0,0,41,1,114,236,0,0,0,99,3,0,0,0,1,0, - 0,0,9,0,0,0,11,0,0,0,67,0,0,0,115,0, - 1,0,0,116,0,124,1,131,1,92,2,125,4,125,5,103, - 0,125,6,124,4,114,52,116,1,124,4,131,1,115,52,116, - 0,124,4,131,1,92,2,125,4,125,7,124,6,160,2,124, - 7,161,1,1,0,113,16,116,3,124,6,131,1,68,0,93, - 112,125,7,116,4,124,4,124,7,131,2,125,4,122,14,116, - 5,160,6,124,4,161,1,1,0,87,0,110,82,4,0,116, - 7,107,10,114,112,1,0,1,0,1,0,89,0,113,60,89, - 0,110,60,4,0,116,8,107,10,114,170,1,0,125,8,1, - 0,122,30,116,9,160,10,100,1,124,4,124,8,161,3,1, - 0,87,0,89,0,162,10,1,0,100,2,83,0,87,0,53, - 0,100,2,125,8,126,8,88,0,89,0,110,2,88,0,113, - 60,122,28,116,11,124,1,124,2,124,3,131,3,1,0,116, - 9,160,10,100,3,124,1,161,2,1,0,87,0,110,48,4, - 0,116,8,107,10,114,250,1,0,125,8,1,0,122,18,116, - 9,160,10,100,1,124,1,124,8,161,3,1,0,87,0,53, - 0,100,2,125,8,126,8,88,0,89,0,110,2,88,0,100, - 2,83,0,41,4,122,27,87,114,105,116,101,32,98,121,116, - 101,115,32,100,97,116,97,32,116,111,32,97,32,102,105,108, - 101,46,122,27,99,111,117,108,100,32,110,111,116,32,99,114, - 101,97,116,101,32,123,33,114,125,58,32,123,33,114,125,78, - 122,12,99,114,101,97,116,101,100,32,123,33,114,125,41,12, - 114,42,0,0,0,114,50,0,0,0,114,170,0,0,0,114, - 37,0,0,0,114,33,0,0,0,114,1,0,0,0,90,5, - 109,107,100,105,114,218,15,70,105,108,101,69,120,105,115,116, - 115,69,114,114,111,114,114,44,0,0,0,114,122,0,0,0, - 114,136,0,0,0,114,61,0,0,0,41,9,114,108,0,0, - 0,114,39,0,0,0,114,21,0,0,0,114,236,0,0,0, - 218,6,112,97,114,101,110,116,114,88,0,0,0,114,32,0, - 0,0,114,28,0,0,0,114,206,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,203,0,0,0, - 242,3,0,0,115,48,0,0,0,0,2,12,1,4,2,12, - 1,12,1,12,2,12,1,10,1,2,1,14,1,14,2,8, - 1,16,3,6,1,2,0,2,255,4,2,32,1,2,1,12, - 1,16,1,16,2,8,1,2,255,122,25,83,111,117,114,99, - 101,70,105,108,101,76,111,97,100,101,114,46,115,101,116,95, - 100,97,116,97,78,41,7,114,113,0,0,0,114,112,0,0, - 0,114,114,0,0,0,114,115,0,0,0,114,202,0,0,0, - 114,204,0,0,0,114,203,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,234, - 0,0,0,228,3,0,0,115,8,0,0,0,8,2,4,2, - 8,5,8,5,114,234,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,32, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, - 6,83,0,41,7,218,20,83,111,117,114,99,101,108,101,115, - 115,70,105,108,101,76,111,97,100,101,114,122,45,76,111,97, - 100,101,114,32,119,104,105,99,104,32,104,97,110,100,108,101, - 115,32,115,111,117,114,99,101,108,101,115,115,32,102,105,108, - 101,32,105,109,112,111,114,116,115,46,99,2,0,0,0,0, - 0,0,0,5,0,0,0,5,0,0,0,67,0,0,0,115, - 68,0,0,0,124,0,160,0,124,1,161,1,125,2,124,0, - 160,1,124,2,161,1,125,3,124,1,124,2,100,1,156,2, - 125,4,116,2,124,3,124,1,124,4,131,3,1,0,116,3, - 116,4,124,3,131,1,100,2,100,0,133,2,25,0,124,1, - 124,2,100,3,141,3,83,0,41,4,78,41,2,114,106,0, - 0,0,114,39,0,0,0,114,132,0,0,0,41,2,114,106, - 0,0,0,114,98,0,0,0,41,5,114,164,0,0,0,114, - 205,0,0,0,114,139,0,0,0,114,151,0,0,0,114,213, + 15,95,99,97,99,104,101,95,98,121,116,101,99,111,100,101, + 40,3,0,0,115,2,0,0,0,0,8,122,28,83,111,117, + 114,99,101,76,111,97,100,101,114,46,95,99,97,99,104,101, + 95,98,121,116,101,99,111,100,101,99,3,0,0,0,0,0, + 0,0,3,0,0,0,1,0,0,0,67,0,0,0,115,4, + 0,0,0,100,1,83,0,41,2,122,150,79,112,116,105,111, + 110,97,108,32,109,101,116,104,111,100,32,119,104,105,99,104, + 32,119,114,105,116,101,115,32,100,97,116,97,32,40,98,121, + 116,101,115,41,32,116,111,32,97,32,102,105,108,101,32,112, + 97,116,104,32,40,97,32,115,116,114,41,46,10,10,32,32, + 32,32,32,32,32,32,73,109,112,108,101,109,101,110,116,105, + 110,103,32,116,104,105,115,32,109,101,116,104,111,100,32,97, + 108,108,111,119,115,32,102,111,114,32,116,104,101,32,119,114, + 105,116,105,110,103,32,111,102,32,98,121,116,101,99,111,100, + 101,32,102,105,108,101,115,46,10,32,32,32,32,32,32,32, + 32,78,114,2,0,0,0,41,3,114,108,0,0,0,114,39, + 0,0,0,114,21,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,203,0,0,0,50,3,0,0, + 115,2,0,0,0,0,4,122,21,83,111,117,114,99,101,76, + 111,97,100,101,114,46,115,101,116,95,100,97,116,97,99,2, + 0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,67, + 0,0,0,115,82,0,0,0,124,0,160,0,124,1,161,1, + 125,2,122,14,124,0,160,1,124,2,161,1,125,3,87,0, + 110,48,4,0,116,2,107,10,114,72,1,0,125,4,1,0, + 122,18,116,3,100,1,124,1,100,2,141,2,124,4,130,2, + 87,0,53,0,100,3,125,4,126,4,88,0,89,0,110,2, + 88,0,116,4,124,3,131,1,83,0,41,4,122,52,67,111, + 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, + 97,116,105,111,110,32,111,102,32,73,110,115,112,101,99,116, + 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, + 101,46,122,39,115,111,117,114,99,101,32,110,111,116,32,97, + 118,97,105,108,97,98,108,101,32,116,104,114,111,117,103,104, + 32,103,101,116,95,100,97,116,97,40,41,41,1,114,106,0, + 0,0,78,41,5,114,164,0,0,0,218,8,103,101,116,95, + 100,97,116,97,114,44,0,0,0,114,107,0,0,0,114,162, 0,0,0,41,5,114,108,0,0,0,114,127,0,0,0,114, - 39,0,0,0,114,21,0,0,0,114,138,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,193,0, - 0,0,21,4,0,0,115,22,0,0,0,0,1,10,1,10, - 4,2,1,2,254,6,4,12,1,2,1,14,1,2,1,2, - 253,122,29,83,111,117,114,99,101,108,101,115,115,70,105,108, - 101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, - 122,39,82,101,116,117,114,110,32,78,111,110,101,32,97,115, - 32,116,104,101,114,101,32,105,115,32,110,111,32,115,111,117, - 114,99,101,32,99,111,100,101,46,78,114,2,0,0,0,41, - 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,207,0,0,0,37, - 4,0,0,115,2,0,0,0,0,2,122,31,83,111,117,114, - 99,101,108,101,115,115,70,105,108,101,76,111,97,100,101,114, - 46,103,101,116,95,115,111,117,114,99,101,78,41,6,114,113, - 0,0,0,114,112,0,0,0,114,114,0,0,0,114,115,0, - 0,0,114,193,0,0,0,114,207,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,239,0,0,0,17,4,0,0,115,6,0,0,0,8,2, - 4,2,8,16,114,239,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,64,0,0,0,115,92, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, - 6,100,7,132,0,90,6,100,8,100,9,132,0,90,7,100, - 10,100,11,132,0,90,8,100,12,100,13,132,0,90,9,100, - 14,100,15,132,0,90,10,100,16,100,17,132,0,90,11,101, - 12,100,18,100,19,132,0,131,1,90,13,100,20,83,0,41, - 21,218,19,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,122,93,76,111,97,100,101,114,32,102, - 111,114,32,101,120,116,101,110,115,105,111,110,32,109,111,100, - 117,108,101,115,46,10,10,32,32,32,32,84,104,101,32,99, - 111,110,115,116,114,117,99,116,111,114,32,105,115,32,100,101, - 115,105,103,110,101,100,32,116,111,32,119,111,114,107,32,119, - 105,116,104,32,70,105,108,101,70,105,110,100,101,114,46,10, - 10,32,32,32,32,99,3,0,0,0,0,0,0,0,3,0, - 0,0,2,0,0,0,67,0,0,0,115,16,0,0,0,124, - 1,124,0,95,0,124,2,124,0,95,1,100,0,83,0,41, - 1,78,41,2,114,106,0,0,0,114,39,0,0,0,41,3, - 114,108,0,0,0,114,106,0,0,0,114,39,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,191, - 0,0,0,54,4,0,0,115,4,0,0,0,0,1,6,1, - 122,28,69,120,116,101,110,115,105,111,110,70,105,108,101,76, - 111,97,100,101,114,46,95,95,105,110,105,116,95,95,99,2, - 0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,67, - 0,0,0,115,24,0,0,0,124,0,106,0,124,1,106,0, - 107,2,111,22,124,0,106,1,124,1,106,1,107,2,83,0, - 41,1,78,41,2,114,218,0,0,0,114,119,0,0,0,41, - 2,114,108,0,0,0,114,219,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,220,0,0,0,58, - 4,0,0,115,6,0,0,0,0,1,12,1,10,255,122,26, - 69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97, - 100,101,114,46,95,95,101,113,95,95,99,1,0,0,0,0, - 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, - 20,0,0,0,116,0,124,0,106,1,131,1,116,0,124,0, - 106,2,131,1,65,0,83,0,41,1,78,41,3,114,221,0, - 0,0,114,106,0,0,0,114,39,0,0,0,41,1,114,108, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,222,0,0,0,62,4,0,0,115,2,0,0,0, - 0,1,122,28,69,120,116,101,110,115,105,111,110,70,105,108, + 39,0,0,0,114,160,0,0,0,218,3,101,120,99,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,10,103, + 101,116,95,115,111,117,114,99,101,57,3,0,0,115,20,0, + 0,0,0,2,10,1,2,1,14,1,16,1,4,1,2,255, + 4,1,2,255,20,2,122,23,83,111,117,114,99,101,76,111, + 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,114, + 96,0,0,0,41,1,218,9,95,111,112,116,105,109,105,122, + 101,99,3,0,0,0,1,0,0,0,4,0,0,0,8,0, + 0,0,67,0,0,0,115,22,0,0,0,116,0,106,1,116, + 2,124,1,124,2,100,1,100,2,124,3,100,3,141,6,83, + 0,41,4,122,130,82,101,116,117,114,110,32,116,104,101,32, + 99,111,100,101,32,111,98,106,101,99,116,32,99,111,109,112, + 105,108,101,100,32,102,114,111,109,32,115,111,117,114,99,101, + 46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,39, + 100,97,116,97,39,32,97,114,103,117,109,101,110,116,32,99, + 97,110,32,98,101,32,97,110,121,32,111,98,106,101,99,116, + 32,116,121,112,101,32,116,104,97,116,32,99,111,109,112,105, + 108,101,40,41,32,115,117,112,112,111,114,116,115,46,10,32, + 32,32,32,32,32,32,32,114,195,0,0,0,84,41,2,218, + 12,100,111,110,116,95,105,110,104,101,114,105,116,114,75,0, + 0,0,41,3,114,122,0,0,0,114,194,0,0,0,218,7, + 99,111,109,112,105,108,101,41,4,114,108,0,0,0,114,21, + 0,0,0,114,39,0,0,0,114,208,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,14,115,111, + 117,114,99,101,95,116,111,95,99,111,100,101,67,3,0,0, + 115,8,0,0,0,0,5,12,1,2,0,2,255,122,27,83, + 111,117,114,99,101,76,111,97,100,101,114,46,115,111,117,114, + 99,101,95,116,111,95,99,111,100,101,99,2,0,0,0,0, + 0,0,0,15,0,0,0,9,0,0,0,67,0,0,0,115, + 46,2,0,0,124,0,160,0,124,1,161,1,125,2,100,1, + 125,3,100,1,125,4,100,1,125,5,100,2,125,6,100,3, + 125,7,122,12,116,1,124,2,131,1,125,8,87,0,110,26, + 4,0,116,2,107,10,114,68,1,0,1,0,1,0,100,1, + 125,8,89,0,144,1,110,48,88,0,122,14,124,0,160,3, + 124,2,161,1,125,9,87,0,110,22,4,0,116,4,107,10, + 114,106,1,0,1,0,1,0,89,0,144,1,110,10,88,0, + 116,5,124,9,100,4,25,0,131,1,125,3,122,14,124,0, + 160,6,124,8,161,1,125,10,87,0,110,20,4,0,116,4, + 107,10,114,154,1,0,1,0,1,0,89,0,110,218,88,0, + 124,1,124,8,100,5,156,2,125,11,122,148,116,7,124,10, + 124,1,124,11,131,3,125,12,116,8,124,10,131,1,100,6, + 100,1,133,2,25,0,125,13,124,12,100,7,64,0,100,8, + 107,3,125,6,124,6,144,1,114,36,124,12,100,9,64,0, + 100,8,107,3,125,7,116,9,106,10,100,10,107,3,144,1, + 114,34,124,7,115,254,116,9,106,10,100,11,107,2,144,1, + 114,34,124,0,160,6,124,2,161,1,125,4,116,9,160,11, + 116,12,124,4,161,2,125,5,116,13,124,10,124,5,124,1, + 124,11,131,4,1,0,110,20,116,14,124,10,124,3,124,9, + 100,12,25,0,124,1,124,11,131,5,1,0,87,0,110,26, + 4,0,116,15,116,16,102,2,107,10,144,1,114,84,1,0, + 1,0,1,0,89,0,110,32,88,0,116,17,160,18,100,13, + 124,8,124,2,161,3,1,0,116,19,124,13,124,1,124,8, + 124,2,100,14,141,4,83,0,124,4,100,1,107,8,144,1, + 114,136,124,0,160,6,124,2,161,1,125,4,124,0,160,20, + 124,4,124,2,161,2,125,14,116,17,160,18,100,15,124,2, + 161,2,1,0,116,21,106,22,144,2,115,42,124,8,100,1, + 107,9,144,2,114,42,124,3,100,1,107,9,144,2,114,42, + 124,6,144,1,114,228,124,5,100,1,107,8,144,1,114,214, + 116,9,160,11,124,4,161,1,125,5,116,23,124,14,124,5, + 124,7,131,3,125,10,110,16,116,24,124,14,124,3,116,25, + 124,4,131,1,131,3,125,10,122,30,124,0,160,26,124,2, + 124,8,124,10,161,3,1,0,116,17,160,18,100,16,124,8, + 161,2,1,0,87,0,110,22,4,0,116,2,107,10,144,2, + 114,40,1,0,1,0,1,0,89,0,110,2,88,0,124,14, + 83,0,41,17,122,190,67,111,110,99,114,101,116,101,32,105, + 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, + 32,73,110,115,112,101,99,116,76,111,97,100,101,114,46,103, + 101,116,95,99,111,100,101,46,10,10,32,32,32,32,32,32, + 32,32,82,101,97,100,105,110,103,32,111,102,32,98,121,116, + 101,99,111,100,101,32,114,101,113,117,105,114,101,115,32,112, + 97,116,104,95,115,116,97,116,115,32,116,111,32,98,101,32, + 105,109,112,108,101,109,101,110,116,101,100,46,32,84,111,32, + 119,114,105,116,101,10,32,32,32,32,32,32,32,32,98,121, + 116,101,99,111,100,101,44,32,115,101,116,95,100,97,116,97, + 32,109,117,115,116,32,97,108,115,111,32,98,101,32,105,109, + 112,108,101,109,101,110,116,101,100,46,10,10,32,32,32,32, + 32,32,32,32,78,70,84,114,155,0,0,0,41,2,114,106, + 0,0,0,114,39,0,0,0,114,132,0,0,0,114,34,0, + 0,0,114,64,0,0,0,114,23,0,0,0,90,5,110,101, + 118,101,114,90,6,97,108,119,97,121,115,218,4,115,105,122, + 101,122,13,123,125,32,109,97,116,99,104,101,115,32,123,125, + 41,3,114,106,0,0,0,114,98,0,0,0,114,99,0,0, + 0,122,19,99,111,100,101,32,111,98,106,101,99,116,32,102, + 114,111,109,32,123,125,122,10,119,114,111,116,101,32,123,33, + 114,125,41,27,114,164,0,0,0,114,89,0,0,0,114,73, + 0,0,0,114,202,0,0,0,114,44,0,0,0,114,14,0, + 0,0,114,205,0,0,0,114,139,0,0,0,218,10,109,101, + 109,111,114,121,118,105,101,119,114,149,0,0,0,90,21,99, + 104,101,99,107,95,104,97,115,104,95,98,97,115,101,100,95, + 112,121,99,115,114,144,0,0,0,218,17,95,82,65,87,95, + 77,65,71,73,67,95,78,85,77,66,69,82,114,145,0,0, + 0,114,143,0,0,0,114,107,0,0,0,114,137,0,0,0, + 114,122,0,0,0,114,136,0,0,0,114,151,0,0,0,114, + 211,0,0,0,114,6,0,0,0,218,19,100,111,110,116,95, + 119,114,105,116,101,95,98,121,116,101,99,111,100,101,114,157, + 0,0,0,114,156,0,0,0,114,18,0,0,0,114,204,0, + 0,0,41,15,114,108,0,0,0,114,127,0,0,0,114,99, + 0,0,0,114,141,0,0,0,114,160,0,0,0,114,144,0, + 0,0,90,10,104,97,115,104,95,98,97,115,101,100,90,12, + 99,104,101,99,107,95,115,111,117,114,99,101,114,98,0,0, + 0,218,2,115,116,114,21,0,0,0,114,138,0,0,0,114, + 74,0,0,0,90,10,98,121,116,101,115,95,100,97,116,97, + 90,11,99,111,100,101,95,111,98,106,101,99,116,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,193,0,0, + 0,75,3,0,0,115,154,0,0,0,0,7,10,1,4,1, + 4,1,4,1,4,1,4,1,2,1,12,1,14,1,12,2, + 2,1,14,1,14,1,8,2,12,1,2,1,14,1,14,1, + 6,3,2,1,2,254,6,4,2,1,12,1,16,1,12,1, + 6,1,12,1,12,1,2,255,2,2,8,254,4,3,10,1, + 4,1,2,1,2,254,4,4,8,1,2,255,6,3,2,1, + 2,1,2,1,6,1,2,1,2,251,8,7,20,1,6,2, + 8,1,2,255,4,2,6,1,2,1,2,254,6,3,10,1, + 10,1,12,1,12,1,18,1,6,255,4,2,6,1,10,1, + 10,1,14,2,6,1,6,255,4,2,2,1,14,1,16,1, + 16,1,6,1,122,21,83,111,117,114,99,101,76,111,97,100, + 101,114,46,103,101,116,95,99,111,100,101,78,41,10,114,113, + 0,0,0,114,112,0,0,0,114,114,0,0,0,114,201,0, + 0,0,114,202,0,0,0,114,204,0,0,0,114,203,0,0, + 0,114,207,0,0,0,114,211,0,0,0,114,193,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,200,0,0,0,16,3,0,0,115,14,0, + 0,0,8,2,8,8,8,14,8,10,8,7,8,10,14,8, + 114,200,0,0,0,99,0,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,0,0,0,0,115,124,0,0,0,101, + 0,90,1,100,0,90,2,100,1,90,3,100,2,100,3,132, + 0,90,4,100,4,100,5,132,0,90,5,100,6,100,7,132, + 0,90,6,101,7,135,0,102,1,100,8,100,9,132,8,131, + 1,90,8,101,7,100,10,100,11,132,0,131,1,90,9,100, + 12,100,13,132,0,90,10,101,7,100,14,100,15,132,0,131, + 1,90,11,100,16,100,17,132,0,90,12,100,18,100,19,132, + 0,90,13,100,20,100,21,132,0,90,14,100,22,100,23,132, + 0,90,15,135,0,4,0,90,16,83,0,41,24,218,10,70, + 105,108,101,76,111,97,100,101,114,122,103,66,97,115,101,32, + 102,105,108,101,32,108,111,97,100,101,114,32,99,108,97,115, + 115,32,119,104,105,99,104,32,105,109,112,108,101,109,101,110, + 116,115,32,116,104,101,32,108,111,97,100,101,114,32,112,114, + 111,116,111,99,111,108,32,109,101,116,104,111,100,115,32,116, + 104,97,116,10,32,32,32,32,114,101,113,117,105,114,101,32, + 102,105,108,101,32,115,121,115,116,101,109,32,117,115,97,103, + 101,46,99,3,0,0,0,0,0,0,0,3,0,0,0,2, + 0,0,0,67,0,0,0,115,16,0,0,0,124,1,124,0, + 95,0,124,2,124,0,95,1,100,1,83,0,41,2,122,75, + 67,97,99,104,101,32,116,104,101,32,109,111,100,117,108,101, + 32,110,97,109,101,32,97,110,100,32,116,104,101,32,112,97, + 116,104,32,116,111,32,116,104,101,32,102,105,108,101,32,102, + 111,117,110,100,32,98,121,32,116,104,101,10,32,32,32,32, + 32,32,32,32,102,105,110,100,101,114,46,78,41,2,114,106, + 0,0,0,114,39,0,0,0,41,3,114,108,0,0,0,114, + 127,0,0,0,114,39,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,191,0,0,0,166,3,0, + 0,115,4,0,0,0,0,3,6,1,122,19,70,105,108,101, + 76,111,97,100,101,114,46,95,95,105,110,105,116,95,95,99, + 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, + 67,0,0,0,115,24,0,0,0,124,0,106,0,124,1,106, + 0,107,2,111,22,124,0,106,1,124,1,106,1,107,2,83, + 0,41,1,78,41,2,218,9,95,95,99,108,97,115,115,95, + 95,114,119,0,0,0,41,2,114,108,0,0,0,218,5,111, + 116,104,101,114,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,6,95,95,101,113,95,95,172,3,0,0,115, + 6,0,0,0,0,1,12,1,10,255,122,17,70,105,108,101, + 76,111,97,100,101,114,46,95,95,101,113,95,95,99,1,0, + 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, + 0,0,115,20,0,0,0,116,0,124,0,106,1,131,1,116, + 0,124,0,106,2,131,1,65,0,83,0,41,1,78,41,3, + 218,4,104,97,115,104,114,106,0,0,0,114,39,0,0,0, + 41,1,114,108,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,218,8,95,95,104,97,115,104,95,95, + 176,3,0,0,115,2,0,0,0,0,1,122,19,70,105,108, 101,76,111,97,100,101,114,46,95,95,104,97,115,104,95,95, - 99,2,0,0,0,0,0,0,0,3,0,0,0,5,0,0, - 0,67,0,0,0,115,36,0,0,0,116,0,160,1,116,2, - 106,3,124,1,161,2,125,2,116,0,160,4,100,1,124,1, - 106,5,124,0,106,6,161,3,1,0,124,2,83,0,41,2, - 122,38,67,114,101,97,116,101,32,97,110,32,117,110,105,116, - 105,97,108,105,122,101,100,32,101,120,116,101,110,115,105,111, - 110,32,109,111,100,117,108,101,122,38,101,120,116,101,110,115, - 105,111,110,32,109,111,100,117,108,101,32,123,33,114,125,32, - 108,111,97,100,101,100,32,102,114,111,109,32,123,33,114,125, - 41,7,114,122,0,0,0,114,194,0,0,0,114,149,0,0, - 0,90,14,99,114,101,97,116,101,95,100,121,110,97,109,105, - 99,114,136,0,0,0,114,106,0,0,0,114,39,0,0,0, - 41,3,114,108,0,0,0,114,171,0,0,0,114,196,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,192,0,0,0,65,4,0,0,115,18,0,0,0,0,2, - 4,1,4,0,2,255,4,2,6,1,4,0,4,255,4,2, - 122,33,69,120,116,101,110,115,105,111,110,70,105,108,101,76, - 111,97,100,101,114,46,99,114,101,97,116,101,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 5,0,0,0,67,0,0,0,115,36,0,0,0,116,0,160, - 1,116,2,106,3,124,1,161,2,1,0,116,0,160,4,100, - 1,124,0,106,5,124,0,106,6,161,3,1,0,100,2,83, - 0,41,3,122,30,73,110,105,116,105,97,108,105,122,101,32, - 97,110,32,101,120,116,101,110,115,105,111,110,32,109,111,100, - 117,108,101,122,40,101,120,116,101,110,115,105,111,110,32,109, - 111,100,117,108,101,32,123,33,114,125,32,101,120,101,99,117, - 116,101,100,32,102,114,111,109,32,123,33,114,125,78,41,7, - 114,122,0,0,0,114,194,0,0,0,114,149,0,0,0,90, - 12,101,120,101,99,95,100,121,110,97,109,105,99,114,136,0, - 0,0,114,106,0,0,0,114,39,0,0,0,41,2,114,108, - 0,0,0,114,196,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,197,0,0,0,73,4,0,0, - 115,10,0,0,0,0,2,14,1,6,1,4,0,4,255,122, - 31,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, - 97,100,101,114,46,101,120,101,99,95,109,111,100,117,108,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0, - 0,3,0,0,0,115,36,0,0,0,116,0,124,0,106,1, - 131,1,100,1,25,0,137,0,116,2,135,0,102,1,100,2, - 100,3,132,8,116,3,68,0,131,1,131,1,83,0,41,4, - 122,49,82,101,116,117,114,110,32,84,114,117,101,32,105,102, - 32,116,104,101,32,101,120,116,101,110,115,105,111,110,32,109, - 111,100,117,108,101,32,105,115,32,97,32,112,97,99,107,97, - 103,101,46,114,34,0,0,0,99,1,0,0,0,0,0,0, - 0,2,0,0,0,4,0,0,0,51,0,0,0,115,26,0, - 0,0,124,0,93,18,125,1,136,0,100,0,124,1,23,0, - 107,2,86,0,1,0,113,2,100,1,83,0,41,2,114,191, - 0,0,0,78,114,2,0,0,0,41,2,114,27,0,0,0, - 218,6,115,117,102,102,105,120,41,1,218,9,102,105,108,101, - 95,110,97,109,101,114,2,0,0,0,114,4,0,0,0,218, - 9,60,103,101,110,101,120,112,114,62,82,4,0,0,115,4, - 0,0,0,4,1,2,255,122,49,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,105,115,95, - 112,97,99,107,97,103,101,46,60,108,111,99,97,108,115,62, - 46,60,103,101,110,101,120,112,114,62,41,4,114,42,0,0, - 0,114,39,0,0,0,218,3,97,110,121,218,18,69,88,84, - 69,78,83,73,79,78,95,83,85,70,70,73,88,69,83,41, - 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, - 41,1,114,242,0,0,0,114,4,0,0,0,114,166,0,0, - 0,79,4,0,0,115,8,0,0,0,0,2,14,1,12,1, - 2,255,122,30,69,120,116,101,110,115,105,111,110,70,105,108, - 101,76,111,97,100,101,114,46,105,115,95,112,97,99,107,97, - 103,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, - 41,2,122,63,82,101,116,117,114,110,32,78,111,110,101,32, - 97,115,32,97,110,32,101,120,116,101,110,115,105,111,110,32, - 109,111,100,117,108,101,32,99,97,110,110,111,116,32,99,114, - 101,97,116,101,32,97,32,99,111,100,101,32,111,98,106,101, - 99,116,46,78,114,2,0,0,0,41,2,114,108,0,0,0, - 114,127,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,193,0,0,0,85,4,0,0,115,2,0, - 0,0,0,2,122,28,69,120,116,101,110,115,105,111,110,70, - 105,108,101,76,111,97,100,101,114,46,103,101,116,95,99,111, - 100,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, - 41,2,122,53,82,101,116,117,114,110,32,78,111,110,101,32, - 97,115,32,101,120,116,101,110,115,105,111,110,32,109,111,100, - 117,108,101,115,32,104,97,118,101,32,110,111,32,115,111,117, - 114,99,101,32,99,111,100,101,46,78,114,2,0,0,0,41, - 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,207,0,0,0,89, - 4,0,0,115,2,0,0,0,0,2,122,30,69,120,116,101, - 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46, - 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, + 99,2,0,0,0,0,0,0,0,2,0,0,0,3,0,0, + 0,3,0,0,0,115,16,0,0,0,116,0,116,1,124,0, + 131,2,160,2,124,1,161,1,83,0,41,1,122,100,76,111, + 97,100,32,97,32,109,111,100,117,108,101,32,102,114,111,109, + 32,97,32,102,105,108,101,46,10,10,32,32,32,32,32,32, + 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, + 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, + 101,32,101,120,101,99,95,109,111,100,117,108,101,40,41,32, + 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32, + 32,32,41,3,218,5,115,117,112,101,114,114,217,0,0,0, + 114,199,0,0,0,41,2,114,108,0,0,0,114,127,0,0, + 0,41,1,114,218,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,199,0,0,0,179,3,0,0,115,2,0,0,0, + 0,10,122,22,70,105,108,101,76,111,97,100,101,114,46,108, + 111,97,100,95,109,111,100,117,108,101,99,2,0,0,0,0, 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, 6,0,0,0,124,0,106,0,83,0,41,1,122,58,82,101, 116,117,114,110,32,116,104,101,32,112,97,116,104,32,116,111, @@ -1781,905 +1453,1232 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 32,97,115,32,102,111,117,110,100,32,98,121,32,116,104,101, 32,102,105,110,100,101,114,46,41,1,114,39,0,0,0,41, 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,164,0,0,0,93, - 4,0,0,115,2,0,0,0,0,3,122,32,69,120,116,101, - 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46, - 103,101,116,95,102,105,108,101,110,97,109,101,78,41,14,114, - 113,0,0,0,114,112,0,0,0,114,114,0,0,0,114,115, - 0,0,0,114,191,0,0,0,114,220,0,0,0,114,222,0, - 0,0,114,192,0,0,0,114,197,0,0,0,114,166,0,0, - 0,114,193,0,0,0,114,207,0,0,0,114,124,0,0,0, - 114,164,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,240,0,0,0,46,4, - 0,0,115,20,0,0,0,8,6,4,2,8,4,8,4,8, - 3,8,8,8,6,8,6,8,4,8,4,114,240,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,164,0,0,0,191, + 3,0,0,115,2,0,0,0,0,3,122,23,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110, + 97,109,101,99,2,0,0,0,0,0,0,0,3,0,0,0, + 10,0,0,0,67,0,0,0,115,44,0,0,0,116,0,160, + 1,124,1,100,1,161,2,143,22,125,2,124,2,160,2,161, + 0,87,0,2,0,53,0,81,0,82,0,163,0,83,0,81, + 0,82,0,88,0,100,2,83,0,41,3,122,39,82,101,116, + 117,114,110,32,116,104,101,32,100,97,116,97,32,102,114,111, + 109,32,112,97,116,104,32,97,115,32,114,97,119,32,98,121, + 116,101,115,46,218,1,114,78,41,3,114,56,0,0,0,114, + 57,0,0,0,90,4,114,101,97,100,41,3,114,108,0,0, + 0,114,39,0,0,0,114,60,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,205,0,0,0,196, + 3,0,0,115,4,0,0,0,0,2,14,1,122,19,70,105, + 108,101,76,111,97,100,101,114,46,103,101,116,95,100,97,116, + 97,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,18,0,0,0,124,0,160,0,124, + 1,161,1,114,14,124,0,83,0,100,0,83,0,41,1,78, + 41,1,114,166,0,0,0,41,2,114,108,0,0,0,114,196, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,218,19,103,101,116,95,114,101,115,111,117,114,99,101, + 95,114,101,97,100,101,114,203,3,0,0,115,6,0,0,0, + 0,2,10,1,4,1,122,30,70,105,108,101,76,111,97,100, + 101,114,46,103,101,116,95,114,101,115,111,117,114,99,101,95, + 114,101,97,100,101,114,99,2,0,0,0,0,0,0,0,3, + 0,0,0,4,0,0,0,67,0,0,0,115,32,0,0,0, + 116,0,116,1,124,0,106,2,131,1,100,1,25,0,124,1, + 131,2,125,2,116,3,160,4,124,2,100,2,161,2,83,0, + 41,3,78,114,64,0,0,0,114,224,0,0,0,41,5,114, + 33,0,0,0,114,42,0,0,0,114,39,0,0,0,114,56, + 0,0,0,114,57,0,0,0,41,3,114,108,0,0,0,218, + 8,114,101,115,111,117,114,99,101,114,39,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,13,111, + 112,101,110,95,114,101,115,111,117,114,99,101,209,3,0,0, + 115,4,0,0,0,0,1,20,1,122,24,70,105,108,101,76, + 111,97,100,101,114,46,111,112,101,110,95,114,101,115,111,117, + 114,99,101,99,2,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,38,0,0,0,124,0,160, + 0,124,1,161,1,115,14,116,1,130,1,116,2,116,3,124, + 0,106,4,131,1,100,1,25,0,124,1,131,2,125,2,124, + 2,83,0,41,2,78,114,64,0,0,0,41,5,218,11,105, + 115,95,114,101,115,111,117,114,99,101,218,17,70,105,108,101, + 78,111,116,70,111,117,110,100,69,114,114,111,114,114,33,0, + 0,0,114,42,0,0,0,114,39,0,0,0,41,3,114,108, + 0,0,0,114,226,0,0,0,114,39,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,13,114,101, + 115,111,117,114,99,101,95,112,97,116,104,213,3,0,0,115, + 8,0,0,0,0,1,10,1,4,1,20,1,122,24,70,105, + 108,101,76,111,97,100,101,114,46,114,101,115,111,117,114,99, + 101,95,112,97,116,104,99,2,0,0,0,0,0,0,0,3, + 0,0,0,3,0,0,0,67,0,0,0,115,40,0,0,0, + 116,0,124,1,107,6,114,12,100,1,83,0,116,1,116,2, + 124,0,106,3,131,1,100,2,25,0,124,1,131,2,125,2, + 116,4,124,2,131,1,83,0,41,3,78,70,114,64,0,0, + 0,41,5,114,30,0,0,0,114,33,0,0,0,114,42,0, + 0,0,114,39,0,0,0,114,48,0,0,0,41,3,114,108, + 0,0,0,114,106,0,0,0,114,39,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,228,0,0, + 0,219,3,0,0,115,8,0,0,0,0,1,8,1,4,1, + 20,1,122,22,70,105,108,101,76,111,97,100,101,114,46,105, + 115,95,114,101,115,111,117,114,99,101,99,1,0,0,0,0, + 0,0,0,1,0,0,0,5,0,0,0,67,0,0,0,115, + 24,0,0,0,116,0,116,1,160,2,116,3,124,0,106,4, + 131,1,100,1,25,0,161,1,131,1,83,0,41,2,78,114, + 64,0,0,0,41,5,218,4,105,116,101,114,114,1,0,0, + 0,218,7,108,105,115,116,100,105,114,114,42,0,0,0,114, + 39,0,0,0,41,1,114,108,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,218,8,99,111,110,116, + 101,110,116,115,225,3,0,0,115,2,0,0,0,0,1,122, + 19,70,105,108,101,76,111,97,100,101,114,46,99,111,110,116, + 101,110,116,115,41,17,114,113,0,0,0,114,112,0,0,0, + 114,114,0,0,0,114,115,0,0,0,114,191,0,0,0,114, + 220,0,0,0,114,222,0,0,0,114,124,0,0,0,114,199, + 0,0,0,114,164,0,0,0,114,205,0,0,0,114,225,0, + 0,0,114,227,0,0,0,114,230,0,0,0,114,228,0,0, + 0,114,233,0,0,0,90,13,95,95,99,108,97,115,115,99, + 101,108,108,95,95,114,2,0,0,0,114,2,0,0,0,41, + 1,114,218,0,0,0,114,4,0,0,0,114,217,0,0,0, + 161,3,0,0,115,24,0,0,0,8,3,4,2,8,6,8, + 4,8,3,16,12,12,5,8,7,12,6,8,4,8,6,8, + 6,114,217,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,64,0,0,0,115,46,0,0,0, + 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, + 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, + 156,1,100,8,100,9,132,2,90,6,100,10,83,0,41,11, + 218,16,83,111,117,114,99,101,70,105,108,101,76,111,97,100, + 101,114,122,62,67,111,110,99,114,101,116,101,32,105,109,112, + 108,101,109,101,110,116,97,116,105,111,110,32,111,102,32,83, + 111,117,114,99,101,76,111,97,100,101,114,32,117,115,105,110, + 103,32,116,104,101,32,102,105,108,101,32,115,121,115,116,101, + 109,46,99,2,0,0,0,0,0,0,0,3,0,0,0,3, + 0,0,0,67,0,0,0,115,22,0,0,0,116,0,124,1, + 131,1,125,2,124,2,106,1,124,2,106,2,100,1,156,2, + 83,0,41,2,122,33,82,101,116,117,114,110,32,116,104,101, + 32,109,101,116,97,100,97,116,97,32,102,111,114,32,116,104, + 101,32,112,97,116,104,46,41,2,114,155,0,0,0,114,212, + 0,0,0,41,3,114,43,0,0,0,218,8,115,116,95,109, + 116,105,109,101,90,7,115,116,95,115,105,122,101,41,3,114, + 108,0,0,0,114,39,0,0,0,114,216,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,202,0, + 0,0,233,3,0,0,115,4,0,0,0,0,2,8,1,122, + 27,83,111,117,114,99,101,70,105,108,101,76,111,97,100,101, + 114,46,112,97,116,104,95,115,116,97,116,115,99,4,0,0, + 0,0,0,0,0,5,0,0,0,5,0,0,0,67,0,0, + 0,115,24,0,0,0,116,0,124,1,131,1,125,4,124,0, + 106,1,124,2,124,3,124,4,100,1,141,3,83,0,41,2, + 78,41,1,218,5,95,109,111,100,101,41,2,114,105,0,0, + 0,114,203,0,0,0,41,5,114,108,0,0,0,114,99,0, + 0,0,114,98,0,0,0,114,21,0,0,0,114,46,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,204,0,0,0,238,3,0,0,115,4,0,0,0,0,2, + 8,1,122,32,83,111,117,114,99,101,70,105,108,101,76,111, + 97,100,101,114,46,95,99,97,99,104,101,95,98,121,116,101, + 99,111,100,101,105,182,1,0,0,41,1,114,236,0,0,0, + 99,3,0,0,0,1,0,0,0,9,0,0,0,11,0,0, + 0,67,0,0,0,115,0,1,0,0,116,0,124,1,131,1, + 92,2,125,4,125,5,103,0,125,6,124,4,114,52,116,1, + 124,4,131,1,115,52,116,0,124,4,131,1,92,2,125,4, + 125,7,124,6,160,2,124,7,161,1,1,0,113,16,116,3, + 124,6,131,1,68,0,93,112,125,7,116,4,124,4,124,7, + 131,2,125,4,122,14,116,5,160,6,124,4,161,1,1,0, + 87,0,110,82,4,0,116,7,107,10,114,112,1,0,1,0, + 1,0,89,0,113,60,89,0,110,60,4,0,116,8,107,10, + 114,170,1,0,125,8,1,0,122,30,116,9,160,10,100,1, + 124,4,124,8,161,3,1,0,87,0,89,0,162,10,1,0, + 100,2,83,0,87,0,53,0,100,2,125,8,126,8,88,0, + 89,0,110,2,88,0,113,60,122,28,116,11,124,1,124,2, + 124,3,131,3,1,0,116,9,160,10,100,3,124,1,161,2, + 1,0,87,0,110,48,4,0,116,8,107,10,114,250,1,0, + 125,8,1,0,122,18,116,9,160,10,100,1,124,1,124,8, + 161,3,1,0,87,0,53,0,100,2,125,8,126,8,88,0, + 89,0,110,2,88,0,100,2,83,0,41,4,122,27,87,114, + 105,116,101,32,98,121,116,101,115,32,100,97,116,97,32,116, + 111,32,97,32,102,105,108,101,46,122,27,99,111,117,108,100, + 32,110,111,116,32,99,114,101,97,116,101,32,123,33,114,125, + 58,32,123,33,114,125,78,122,12,99,114,101,97,116,101,100, + 32,123,33,114,125,41,12,114,42,0,0,0,114,50,0,0, + 0,114,170,0,0,0,114,37,0,0,0,114,33,0,0,0, + 114,1,0,0,0,90,5,109,107,100,105,114,218,15,70,105, + 108,101,69,120,105,115,116,115,69,114,114,111,114,114,44,0, + 0,0,114,122,0,0,0,114,136,0,0,0,114,61,0,0, + 0,41,9,114,108,0,0,0,114,39,0,0,0,114,21,0, + 0,0,114,236,0,0,0,218,6,112,97,114,101,110,116,114, + 88,0,0,0,114,32,0,0,0,114,28,0,0,0,114,206, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,203,0,0,0,243,3,0,0,115,48,0,0,0, + 0,2,12,1,4,2,12,1,12,1,12,2,12,1,10,1, + 2,1,14,1,14,2,8,1,16,3,6,1,2,0,2,255, + 4,2,32,1,2,1,12,1,16,1,16,2,8,1,2,255, + 122,25,83,111,117,114,99,101,70,105,108,101,76,111,97,100, + 101,114,46,115,101,116,95,100,97,116,97,78,41,7,114,113, + 0,0,0,114,112,0,0,0,114,114,0,0,0,114,115,0, + 0,0,114,202,0,0,0,114,204,0,0,0,114,203,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,234,0,0,0,229,3,0,0,115,8, + 0,0,0,8,2,4,2,8,5,8,5,114,234,0,0,0, 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,64,0,0,0,115,96,0,0,0,101,0,90,1,100,0, + 0,64,0,0,0,115,32,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, + 100,5,132,0,90,5,100,6,83,0,41,7,218,20,83,111, + 117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,100, + 101,114,122,45,76,111,97,100,101,114,32,119,104,105,99,104, + 32,104,97,110,100,108,101,115,32,115,111,117,114,99,101,108, + 101,115,115,32,102,105,108,101,32,105,109,112,111,114,116,115, + 46,99,2,0,0,0,0,0,0,0,5,0,0,0,5,0, + 0,0,67,0,0,0,115,68,0,0,0,124,0,160,0,124, + 1,161,1,125,2,124,0,160,1,124,2,161,1,125,3,124, + 1,124,2,100,1,156,2,125,4,116,2,124,3,124,1,124, + 4,131,3,1,0,116,3,116,4,124,3,131,1,100,2,100, + 0,133,2,25,0,124,1,124,2,100,3,141,3,83,0,41, + 4,78,41,2,114,106,0,0,0,114,39,0,0,0,114,132, + 0,0,0,41,2,114,106,0,0,0,114,98,0,0,0,41, + 5,114,164,0,0,0,114,205,0,0,0,114,139,0,0,0, + 114,151,0,0,0,114,213,0,0,0,41,5,114,108,0,0, + 0,114,127,0,0,0,114,39,0,0,0,114,21,0,0,0, + 114,138,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,193,0,0,0,22,4,0,0,115,22,0, + 0,0,0,1,10,1,10,4,2,1,2,254,6,4,12,1, + 2,1,14,1,2,1,2,253,122,29,83,111,117,114,99,101, + 108,101,115,115,70,105,108,101,76,111,97,100,101,114,46,103, + 101,116,95,99,111,100,101,99,2,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, + 0,100,1,83,0,41,2,122,39,82,101,116,117,114,110,32, + 78,111,110,101,32,97,115,32,116,104,101,114,101,32,105,115, + 32,110,111,32,115,111,117,114,99,101,32,99,111,100,101,46, + 78,114,2,0,0,0,41,2,114,108,0,0,0,114,127,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,114,207,0,0,0,38,4,0,0,115,2,0,0,0,0, + 2,122,31,83,111,117,114,99,101,108,101,115,115,70,105,108, + 101,76,111,97,100,101,114,46,103,101,116,95,115,111,117,114, + 99,101,78,41,6,114,113,0,0,0,114,112,0,0,0,114, + 114,0,0,0,114,115,0,0,0,114,193,0,0,0,114,207, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,239,0,0,0,18,4,0,0, + 115,6,0,0,0,8,2,4,2,8,16,114,239,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,64,0,0,0,115,92,0,0,0,101,0,90,1,100,0, 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, 100,5,132,0,90,5,100,6,100,7,132,0,90,6,100,8, 100,9,132,0,90,7,100,10,100,11,132,0,90,8,100,12, 100,13,132,0,90,9,100,14,100,15,132,0,90,10,100,16, - 100,17,132,0,90,11,100,18,100,19,132,0,90,12,100,20, - 100,21,132,0,90,13,100,22,83,0,41,23,218,14,95,78, - 97,109,101,115,112,97,99,101,80,97,116,104,97,38,1,0, - 0,82,101,112,114,101,115,101,110,116,115,32,97,32,110,97, - 109,101,115,112,97,99,101,32,112,97,99,107,97,103,101,39, - 115,32,112,97,116,104,46,32,32,73,116,32,117,115,101,115, - 32,116,104,101,32,109,111,100,117,108,101,32,110,97,109,101, - 10,32,32,32,32,116,111,32,102,105,110,100,32,105,116,115, - 32,112,97,114,101,110,116,32,109,111,100,117,108,101,44,32, - 97,110,100,32,102,114,111,109,32,116,104,101,114,101,32,105, - 116,32,108,111,111,107,115,32,117,112,32,116,104,101,32,112, - 97,114,101,110,116,39,115,10,32,32,32,32,95,95,112,97, - 116,104,95,95,46,32,32,87,104,101,110,32,116,104,105,115, - 32,99,104,97,110,103,101,115,44,32,116,104,101,32,109,111, - 100,117,108,101,39,115,32,111,119,110,32,112,97,116,104,32, - 105,115,32,114,101,99,111,109,112,117,116,101,100,44,10,32, - 32,32,32,117,115,105,110,103,32,112,97,116,104,95,102,105, - 110,100,101,114,46,32,32,70,111,114,32,116,111,112,45,108, - 101,118,101,108,32,109,111,100,117,108,101,115,44,32,116,104, - 101,32,112,97,114,101,110,116,32,109,111,100,117,108,101,39, - 115,32,112,97,116,104,10,32,32,32,32,105,115,32,115,121, - 115,46,112,97,116,104,46,99,4,0,0,0,0,0,0,0, - 4,0,0,0,3,0,0,0,67,0,0,0,115,36,0,0, - 0,124,1,124,0,95,0,124,2,124,0,95,1,116,2,124, - 0,160,3,161,0,131,1,124,0,95,4,124,3,124,0,95, - 5,100,0,83,0,41,1,78,41,6,218,5,95,110,97,109, - 101,218,5,95,112,97,116,104,114,102,0,0,0,218,16,95, - 103,101,116,95,112,97,114,101,110,116,95,112,97,116,104,218, - 17,95,108,97,115,116,95,112,97,114,101,110,116,95,112,97, - 116,104,218,12,95,112,97,116,104,95,102,105,110,100,101,114, - 41,4,114,108,0,0,0,114,106,0,0,0,114,39,0,0, - 0,218,11,112,97,116,104,95,102,105,110,100,101,114,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,191,0, - 0,0,106,4,0,0,115,8,0,0,0,0,1,6,1,6, - 1,14,1,122,23,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,95,95,105,110,105,116,95,95,99,1,0,0, - 0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,0, - 0,115,38,0,0,0,124,0,106,0,160,1,100,1,161,1, - 92,3,125,1,125,2,125,3,124,2,100,2,107,2,114,30, - 100,3,83,0,124,1,100,4,102,2,83,0,41,5,122,62, - 82,101,116,117,114,110,115,32,97,32,116,117,112,108,101,32, - 111,102,32,40,112,97,114,101,110,116,45,109,111,100,117,108, - 101,45,110,97,109,101,44,32,112,97,114,101,110,116,45,112, - 97,116,104,45,97,116,116,114,45,110,97,109,101,41,114,63, - 0,0,0,114,35,0,0,0,41,2,114,6,0,0,0,114, - 39,0,0,0,90,8,95,95,112,97,116,104,95,95,41,2, - 114,247,0,0,0,114,36,0,0,0,41,4,114,108,0,0, - 0,114,238,0,0,0,218,3,100,111,116,90,2,109,101,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,23, - 95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,116, - 104,95,110,97,109,101,115,112,4,0,0,115,8,0,0,0, - 0,2,18,1,8,2,4,3,122,38,95,78,97,109,101,115, - 112,97,99,101,80,97,116,104,46,95,102,105,110,100,95,112, - 97,114,101,110,116,95,112,97,116,104,95,110,97,109,101,115, - 99,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0, - 0,67,0,0,0,115,28,0,0,0,124,0,160,0,161,0, - 92,2,125,1,125,2,116,1,116,2,106,3,124,1,25,0, - 124,2,131,2,83,0,41,1,78,41,4,114,254,0,0,0, - 114,118,0,0,0,114,6,0,0,0,218,7,109,111,100,117, - 108,101,115,41,3,114,108,0,0,0,90,18,112,97,114,101, - 110,116,95,109,111,100,117,108,101,95,110,97,109,101,90,14, - 112,97,116,104,95,97,116,116,114,95,110,97,109,101,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,249,0, - 0,0,122,4,0,0,115,4,0,0,0,0,1,12,1,122, - 31,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, - 95,103,101,116,95,112,97,114,101,110,116,95,112,97,116,104, - 99,1,0,0,0,0,0,0,0,3,0,0,0,4,0,0, - 0,67,0,0,0,115,80,0,0,0,116,0,124,0,160,1, - 161,0,131,1,125,1,124,1,124,0,106,2,107,3,114,74, - 124,0,160,3,124,0,106,4,124,1,161,2,125,2,124,2, - 100,0,107,9,114,68,124,2,106,5,100,0,107,8,114,68, - 124,2,106,6,114,68,124,2,106,6,124,0,95,7,124,1, - 124,0,95,2,124,0,106,7,83,0,41,1,78,41,8,114, - 102,0,0,0,114,249,0,0,0,114,250,0,0,0,114,251, - 0,0,0,114,247,0,0,0,114,128,0,0,0,114,163,0, - 0,0,114,248,0,0,0,41,3,114,108,0,0,0,90,11, - 112,97,114,101,110,116,95,112,97,116,104,114,171,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 12,95,114,101,99,97,108,99,117,108,97,116,101,126,4,0, - 0,115,16,0,0,0,0,2,12,1,10,1,14,3,18,1, - 6,1,8,1,6,1,122,27,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,46,95,114,101,99,97,108,99,117,108, - 97,116,101,99,1,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,67,0,0,0,115,12,0,0,0,116,0,124, - 0,160,1,161,0,131,1,83,0,41,1,78,41,2,114,231, - 0,0,0,114,0,1,0,0,41,1,114,108,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,8, - 95,95,105,116,101,114,95,95,139,4,0,0,115,2,0,0, - 0,0,1,122,23,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,95,95,105,116,101,114,95,95,99,3,0,0, - 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, - 0,115,14,0,0,0,124,2,124,0,106,0,124,1,60,0, - 100,0,83,0,41,1,78,41,1,114,248,0,0,0,41,3, - 114,108,0,0,0,218,5,105,110,100,101,120,114,39,0,0, + 100,17,132,0,90,11,101,12,100,18,100,19,132,0,131,1, + 90,13,100,20,83,0,41,21,218,19,69,120,116,101,110,115, + 105,111,110,70,105,108,101,76,111,97,100,101,114,122,93,76, + 111,97,100,101,114,32,102,111,114,32,101,120,116,101,110,115, + 105,111,110,32,109,111,100,117,108,101,115,46,10,10,32,32, + 32,32,84,104,101,32,99,111,110,115,116,114,117,99,116,111, + 114,32,105,115,32,100,101,115,105,103,110,101,100,32,116,111, + 32,119,111,114,107,32,119,105,116,104,32,70,105,108,101,70, + 105,110,100,101,114,46,10,10,32,32,32,32,99,3,0,0, + 0,0,0,0,0,3,0,0,0,2,0,0,0,67,0,0, + 0,115,16,0,0,0,124,1,124,0,95,0,124,2,124,0, + 95,1,100,0,83,0,41,1,78,41,2,114,106,0,0,0, + 114,39,0,0,0,41,3,114,108,0,0,0,114,106,0,0, + 0,114,39,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,191,0,0,0,55,4,0,0,115,4, + 0,0,0,0,1,6,1,122,28,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,105, + 110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,0, + 0,0,2,0,0,0,67,0,0,0,115,24,0,0,0,124, + 0,106,0,124,1,106,0,107,2,111,22,124,0,106,1,124, + 1,106,1,107,2,83,0,41,1,78,41,2,114,218,0,0, + 0,114,119,0,0,0,41,2,114,108,0,0,0,114,219,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,114,220,0,0,0,59,4,0,0,115,6,0,0,0,0, + 1,12,1,10,255,122,26,69,120,116,101,110,115,105,111,110, + 70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,95, + 95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, + 0,0,67,0,0,0,115,20,0,0,0,116,0,124,0,106, + 1,131,1,116,0,124,0,106,2,131,1,65,0,83,0,41, + 1,78,41,3,114,221,0,0,0,114,106,0,0,0,114,39, + 0,0,0,41,1,114,108,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,222,0,0,0,63,4, + 0,0,115,2,0,0,0,0,1,122,28,69,120,116,101,110, + 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,95, + 95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,0, + 3,0,0,0,5,0,0,0,67,0,0,0,115,36,0,0, + 0,116,0,160,1,116,2,106,3,124,1,161,2,125,2,116, + 0,160,4,100,1,124,1,106,5,124,0,106,6,161,3,1, + 0,124,2,83,0,41,2,122,38,67,114,101,97,116,101,32, + 97,110,32,117,110,105,116,105,97,108,105,122,101,100,32,101, + 120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,122, + 38,101,120,116,101,110,115,105,111,110,32,109,111,100,117,108, + 101,32,123,33,114,125,32,108,111,97,100,101,100,32,102,114, + 111,109,32,123,33,114,125,41,7,114,122,0,0,0,114,194, + 0,0,0,114,149,0,0,0,90,14,99,114,101,97,116,101, + 95,100,121,110,97,109,105,99,114,136,0,0,0,114,106,0, + 0,0,114,39,0,0,0,41,3,114,108,0,0,0,114,171, + 0,0,0,114,196,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,192,0,0,0,66,4,0,0, + 115,18,0,0,0,0,2,4,1,4,0,2,255,4,2,6, + 1,4,0,4,255,4,2,122,33,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,99,114,101, + 97,116,101,95,109,111,100,117,108,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,5,0,0,0,67,0,0,0,115, + 36,0,0,0,116,0,160,1,116,2,106,3,124,1,161,2, + 1,0,116,0,160,4,100,1,124,0,106,5,124,0,106,6, + 161,3,1,0,100,2,83,0,41,3,122,30,73,110,105,116, + 105,97,108,105,122,101,32,97,110,32,101,120,116,101,110,115, + 105,111,110,32,109,111,100,117,108,101,122,40,101,120,116,101, + 110,115,105,111,110,32,109,111,100,117,108,101,32,123,33,114, + 125,32,101,120,101,99,117,116,101,100,32,102,114,111,109,32, + 123,33,114,125,78,41,7,114,122,0,0,0,114,194,0,0, + 0,114,149,0,0,0,90,12,101,120,101,99,95,100,121,110, + 97,109,105,99,114,136,0,0,0,114,106,0,0,0,114,39, + 0,0,0,41,2,114,108,0,0,0,114,196,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,197, + 0,0,0,74,4,0,0,115,10,0,0,0,0,2,14,1, + 6,1,4,0,4,255,122,31,69,120,116,101,110,115,105,111, + 110,70,105,108,101,76,111,97,100,101,114,46,101,120,101,99, + 95,109,111,100,117,108,101,99,2,0,0,0,0,0,0,0, + 2,0,0,0,4,0,0,0,3,0,0,0,115,36,0,0, + 0,116,0,124,0,106,1,131,1,100,1,25,0,137,0,116, + 2,135,0,102,1,100,2,100,3,132,8,116,3,68,0,131, + 1,131,1,83,0,41,4,122,49,82,101,116,117,114,110,32, + 84,114,117,101,32,105,102,32,116,104,101,32,101,120,116,101, + 110,115,105,111,110,32,109,111,100,117,108,101,32,105,115,32, + 97,32,112,97,99,107,97,103,101,46,114,34,0,0,0,99, + 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, + 51,0,0,0,115,26,0,0,0,124,0,93,18,125,1,136, + 0,100,0,124,1,23,0,107,2,86,0,1,0,113,2,100, + 1,83,0,41,2,114,191,0,0,0,78,114,2,0,0,0, + 41,2,114,27,0,0,0,218,6,115,117,102,102,105,120,41, + 1,218,9,102,105,108,101,95,110,97,109,101,114,2,0,0, + 0,114,4,0,0,0,218,9,60,103,101,110,101,120,112,114, + 62,83,4,0,0,115,4,0,0,0,4,1,2,255,122,49, + 69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97, + 100,101,114,46,105,115,95,112,97,99,107,97,103,101,46,60, + 108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114, + 62,41,4,114,42,0,0,0,114,39,0,0,0,218,3,97, + 110,121,218,18,69,88,84,69,78,83,73,79,78,95,83,85, + 70,70,73,88,69,83,41,2,114,108,0,0,0,114,127,0, + 0,0,114,2,0,0,0,41,1,114,242,0,0,0,114,4, + 0,0,0,114,166,0,0,0,80,4,0,0,115,8,0,0, + 0,0,2,14,1,12,1,2,255,122,30,69,120,116,101,110, + 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,105, + 115,95,112,97,99,107,97,103,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, + 0,0,0,100,1,83,0,41,2,122,63,82,101,116,117,114, + 110,32,78,111,110,101,32,97,115,32,97,110,32,101,120,116, + 101,110,115,105,111,110,32,109,111,100,117,108,101,32,99,97, + 110,110,111,116,32,99,114,101,97,116,101,32,97,32,99,111, + 100,101,32,111,98,106,101,99,116,46,78,114,2,0,0,0, + 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,193,0,0,0, + 86,4,0,0,115,2,0,0,0,0,2,122,28,69,120,116, + 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, + 46,103,101,116,95,99,111,100,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, + 0,0,0,100,1,83,0,41,2,122,53,82,101,116,117,114, + 110,32,78,111,110,101,32,97,115,32,101,120,116,101,110,115, + 105,111,110,32,109,111,100,117,108,101,115,32,104,97,118,101, + 32,110,111,32,115,111,117,114,99,101,32,99,111,100,101,46, + 78,114,2,0,0,0,41,2,114,108,0,0,0,114,127,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,114,207,0,0,0,90,4,0,0,115,2,0,0,0,0, + 2,122,30,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, + 0,0,67,0,0,0,115,6,0,0,0,124,0,106,0,83, + 0,41,1,122,58,82,101,116,117,114,110,32,116,104,101,32, + 112,97,116,104,32,116,111,32,116,104,101,32,115,111,117,114, + 99,101,32,102,105,108,101,32,97,115,32,102,111,117,110,100, + 32,98,121,32,116,104,101,32,102,105,110,100,101,114,46,41, + 1,114,39,0,0,0,41,2,114,108,0,0,0,114,127,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,114,164,0,0,0,94,4,0,0,115,2,0,0,0,0, + 3,122,32,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110, + 97,109,101,78,41,14,114,113,0,0,0,114,112,0,0,0, + 114,114,0,0,0,114,115,0,0,0,114,191,0,0,0,114, + 220,0,0,0,114,222,0,0,0,114,192,0,0,0,114,197, + 0,0,0,114,166,0,0,0,114,193,0,0,0,114,207,0, + 0,0,114,124,0,0,0,114,164,0,0,0,114,2,0,0, 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,11,95,95,115,101,116,105,116,101,109,95,95,142,4,0, - 0,115,2,0,0,0,0,1,122,26,95,78,97,109,101,115, - 112,97,99,101,80,97,116,104,46,95,95,115,101,116,105,116, - 101,109,95,95,99,1,0,0,0,0,0,0,0,1,0,0, - 0,3,0,0,0,67,0,0,0,115,12,0,0,0,116,0, - 124,0,160,1,161,0,131,1,83,0,41,1,78,41,2,114, - 18,0,0,0,114,0,1,0,0,41,1,114,108,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 7,95,95,108,101,110,95,95,145,4,0,0,115,2,0,0, - 0,0,1,122,22,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,95,95,108,101,110,95,95,99,1,0,0,0, + 114,240,0,0,0,47,4,0,0,115,20,0,0,0,8,6, + 4,2,8,4,8,4,8,3,8,8,8,6,8,6,8,4, + 8,4,114,240,0,0,0,99,0,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,64,0,0,0,115,96,0,0, + 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, + 3,132,0,90,4,100,4,100,5,132,0,90,5,100,6,100, + 7,132,0,90,6,100,8,100,9,132,0,90,7,100,10,100, + 11,132,0,90,8,100,12,100,13,132,0,90,9,100,14,100, + 15,132,0,90,10,100,16,100,17,132,0,90,11,100,18,100, + 19,132,0,90,12,100,20,100,21,132,0,90,13,100,22,83, + 0,41,23,218,14,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,97,38,1,0,0,82,101,112,114,101,115,101,110, + 116,115,32,97,32,110,97,109,101,115,112,97,99,101,32,112, + 97,99,107,97,103,101,39,115,32,112,97,116,104,46,32,32, + 73,116,32,117,115,101,115,32,116,104,101,32,109,111,100,117, + 108,101,32,110,97,109,101,10,32,32,32,32,116,111,32,102, + 105,110,100,32,105,116,115,32,112,97,114,101,110,116,32,109, + 111,100,117,108,101,44,32,97,110,100,32,102,114,111,109,32, + 116,104,101,114,101,32,105,116,32,108,111,111,107,115,32,117, + 112,32,116,104,101,32,112,97,114,101,110,116,39,115,10,32, + 32,32,32,95,95,112,97,116,104,95,95,46,32,32,87,104, + 101,110,32,116,104,105,115,32,99,104,97,110,103,101,115,44, + 32,116,104,101,32,109,111,100,117,108,101,39,115,32,111,119, + 110,32,112,97,116,104,32,105,115,32,114,101,99,111,109,112, + 117,116,101,100,44,10,32,32,32,32,117,115,105,110,103,32, + 112,97,116,104,95,102,105,110,100,101,114,46,32,32,70,111, + 114,32,116,111,112,45,108,101,118,101,108,32,109,111,100,117, + 108,101,115,44,32,116,104,101,32,112,97,114,101,110,116,32, + 109,111,100,117,108,101,39,115,32,112,97,116,104,10,32,32, + 32,32,105,115,32,115,121,115,46,112,97,116,104,46,99,4, + 0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,67, + 0,0,0,115,36,0,0,0,124,1,124,0,95,0,124,2, + 124,0,95,1,116,2,124,0,160,3,161,0,131,1,124,0, + 95,4,124,3,124,0,95,5,100,0,83,0,41,1,78,41, + 6,218,5,95,110,97,109,101,218,5,95,112,97,116,104,114, + 102,0,0,0,218,16,95,103,101,116,95,112,97,114,101,110, + 116,95,112,97,116,104,218,17,95,108,97,115,116,95,112,97, + 114,101,110,116,95,112,97,116,104,218,12,95,112,97,116,104, + 95,102,105,110,100,101,114,41,4,114,108,0,0,0,114,106, + 0,0,0,114,39,0,0,0,218,11,112,97,116,104,95,102, + 105,110,100,101,114,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,191,0,0,0,107,4,0,0,115,8,0, + 0,0,0,1,6,1,6,1,14,1,122,23,95,78,97,109, + 101,115,112,97,99,101,80,97,116,104,46,95,95,105,110,105, + 116,95,95,99,1,0,0,0,0,0,0,0,4,0,0,0, + 3,0,0,0,67,0,0,0,115,38,0,0,0,124,0,106, + 0,160,1,100,1,161,1,92,3,125,1,125,2,125,3,124, + 2,100,2,107,2,114,30,100,3,83,0,124,1,100,4,102, + 2,83,0,41,5,122,62,82,101,116,117,114,110,115,32,97, + 32,116,117,112,108,101,32,111,102,32,40,112,97,114,101,110, + 116,45,109,111,100,117,108,101,45,110,97,109,101,44,32,112, + 97,114,101,110,116,45,112,97,116,104,45,97,116,116,114,45, + 110,97,109,101,41,114,63,0,0,0,114,35,0,0,0,41, + 2,114,6,0,0,0,114,39,0,0,0,90,8,95,95,112, + 97,116,104,95,95,41,2,114,247,0,0,0,114,36,0,0, + 0,41,4,114,108,0,0,0,114,238,0,0,0,218,3,100, + 111,116,90,2,109,101,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,218,23,95,102,105,110,100,95,112,97,114, + 101,110,116,95,112,97,116,104,95,110,97,109,101,115,113,4, + 0,0,115,8,0,0,0,0,2,18,1,8,2,4,3,122, + 38,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, + 95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,116, + 104,95,110,97,109,101,115,99,1,0,0,0,0,0,0,0, + 3,0,0,0,3,0,0,0,67,0,0,0,115,28,0,0, + 0,124,0,160,0,161,0,92,2,125,1,125,2,116,1,116, + 2,106,3,124,1,25,0,124,2,131,2,83,0,41,1,78, + 41,4,114,254,0,0,0,114,118,0,0,0,114,6,0,0, + 0,218,7,109,111,100,117,108,101,115,41,3,114,108,0,0, + 0,90,18,112,97,114,101,110,116,95,109,111,100,117,108,101, + 95,110,97,109,101,90,14,112,97,116,104,95,97,116,116,114, + 95,110,97,109,101,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,249,0,0,0,123,4,0,0,115,4,0, + 0,0,0,1,12,1,122,31,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,46,95,103,101,116,95,112,97,114,101, + 110,116,95,112,97,116,104,99,1,0,0,0,0,0,0,0, + 3,0,0,0,4,0,0,0,67,0,0,0,115,80,0,0, + 0,116,0,124,0,160,1,161,0,131,1,125,1,124,1,124, + 0,106,2,107,3,114,74,124,0,160,3,124,0,106,4,124, + 1,161,2,125,2,124,2,100,0,107,9,114,68,124,2,106, + 5,100,0,107,8,114,68,124,2,106,6,114,68,124,2,106, + 6,124,0,95,7,124,1,124,0,95,2,124,0,106,7,83, + 0,41,1,78,41,8,114,102,0,0,0,114,249,0,0,0, + 114,250,0,0,0,114,251,0,0,0,114,247,0,0,0,114, + 128,0,0,0,114,163,0,0,0,114,248,0,0,0,41,3, + 114,108,0,0,0,90,11,112,97,114,101,110,116,95,112,97, + 116,104,114,171,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,218,12,95,114,101,99,97,108,99,117, + 108,97,116,101,127,4,0,0,115,16,0,0,0,0,2,12, + 1,10,1,14,3,18,1,6,1,8,1,6,1,122,27,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,114, + 101,99,97,108,99,117,108,97,116,101,99,1,0,0,0,0, + 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, + 12,0,0,0,116,0,124,0,160,1,161,0,131,1,83,0, + 41,1,78,41,2,114,231,0,0,0,114,0,1,0,0,41, + 1,114,108,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,218,8,95,95,105,116,101,114,95,95,140, + 4,0,0,115,2,0,0,0,0,1,122,23,95,78,97,109, + 101,115,112,97,99,101,80,97,116,104,46,95,95,105,116,101, + 114,95,95,99,3,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,14,0,0,0,124,2,124, + 0,106,0,124,1,60,0,100,0,83,0,41,1,78,41,1, + 114,248,0,0,0,41,3,114,108,0,0,0,218,5,105,110, + 100,101,120,114,39,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,218,11,95,95,115,101,116,105,116, + 101,109,95,95,143,4,0,0,115,2,0,0,0,0,1,122, + 26,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, + 95,95,115,101,116,105,116,101,109,95,95,99,1,0,0,0, 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, - 115,12,0,0,0,100,1,160,0,124,0,106,1,161,1,83, - 0,41,2,78,122,20,95,78,97,109,101,115,112,97,99,101, - 80,97,116,104,40,123,33,114,125,41,41,2,114,54,0,0, - 0,114,248,0,0,0,41,1,114,108,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,8,95,95, - 114,101,112,114,95,95,148,4,0,0,115,2,0,0,0,0, - 1,122,23,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,95,95,114,101,112,114,95,95,99,2,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, - 12,0,0,0,124,1,124,0,160,0,161,0,107,6,83,0, - 41,1,78,41,1,114,0,1,0,0,41,2,114,108,0,0, - 0,218,4,105,116,101,109,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,12,95,95,99,111,110,116,97,105, - 110,115,95,95,151,4,0,0,115,2,0,0,0,0,1,122, - 27,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, - 95,95,99,111,110,116,97,105,110,115,95,95,99,2,0,0, - 0,0,0,0,0,2,0,0,0,3,0,0,0,67,0,0, - 0,115,16,0,0,0,124,0,106,0,160,1,124,1,161,1, - 1,0,100,0,83,0,41,1,78,41,2,114,248,0,0,0, - 114,170,0,0,0,41,2,114,108,0,0,0,114,6,1,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,170,0,0,0,154,4,0,0,115,2,0,0,0,0,1, - 122,21,95,78,97,109,101,115,112,97,99,101,80,97,116,104, - 46,97,112,112,101,110,100,78,41,14,114,113,0,0,0,114, - 112,0,0,0,114,114,0,0,0,114,115,0,0,0,114,191, - 0,0,0,114,254,0,0,0,114,249,0,0,0,114,0,1, - 0,0,114,1,1,0,0,114,3,1,0,0,114,4,1,0, - 0,114,5,1,0,0,114,7,1,0,0,114,170,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,246,0,0,0,99,4,0,0,115,22,0, - 0,0,8,5,4,2,8,6,8,10,8,4,8,13,8,3, - 8,3,8,3,8,3,8,3,114,246,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,3,0,0,0,64,0, - 0,0,115,80,0,0,0,101,0,90,1,100,0,90,2,100, - 1,100,2,132,0,90,3,101,4,100,3,100,4,132,0,131, - 1,90,5,100,5,100,6,132,0,90,6,100,7,100,8,132, - 0,90,7,100,9,100,10,132,0,90,8,100,11,100,12,132, - 0,90,9,100,13,100,14,132,0,90,10,100,15,100,16,132, - 0,90,11,100,17,83,0,41,18,218,16,95,78,97,109,101, - 115,112,97,99,101,76,111,97,100,101,114,99,4,0,0,0, - 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, - 115,18,0,0,0,116,0,124,1,124,2,124,3,131,3,124, - 0,95,1,100,0,83,0,41,1,78,41,2,114,246,0,0, - 0,114,248,0,0,0,41,4,114,108,0,0,0,114,106,0, - 0,0,114,39,0,0,0,114,252,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,191,0,0,0, - 160,4,0,0,115,2,0,0,0,0,1,122,25,95,78,97, - 109,101,115,112,97,99,101,76,111,97,100,101,114,46,95,95, - 105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, - 100,1,160,0,124,1,106,1,161,1,83,0,41,2,122,115, - 82,101,116,117,114,110,32,114,101,112,114,32,102,111,114,32, - 116,104,101,32,109,111,100,117,108,101,46,10,10,32,32,32, - 32,32,32,32,32,84,104,101,32,109,101,116,104,111,100,32, - 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, - 84,104,101,32,105,109,112,111,114,116,32,109,97,99,104,105, - 110,101,114,121,32,100,111,101,115,32,116,104,101,32,106,111, - 98,32,105,116,115,101,108,102,46,10,10,32,32,32,32,32, - 32,32,32,122,25,60,109,111,100,117,108,101,32,123,33,114, - 125,32,40,110,97,109,101,115,112,97,99,101,41,62,41,2, - 114,54,0,0,0,114,113,0,0,0,41,2,114,177,0,0, - 0,114,196,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,11,109,111,100,117,108,101,95,114,101, - 112,114,163,4,0,0,115,2,0,0,0,0,7,122,28,95, - 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46, - 109,111,100,117,108,101,95,114,101,112,114,99,2,0,0,0, - 0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0, - 115,4,0,0,0,100,1,83,0,41,2,78,84,114,2,0, - 0,0,41,2,114,108,0,0,0,114,127,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,166,0, - 0,0,172,4,0,0,115,2,0,0,0,0,1,122,27,95, - 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46, - 105,115,95,112,97,99,107,97,103,101,99,2,0,0,0,0, + 115,12,0,0,0,116,0,124,0,160,1,161,0,131,1,83, + 0,41,1,78,41,2,114,18,0,0,0,114,0,1,0,0, + 41,1,114,108,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,218,7,95,95,108,101,110,95,95,146, + 4,0,0,115,2,0,0,0,0,1,122,22,95,78,97,109, + 101,115,112,97,99,101,80,97,116,104,46,95,95,108,101,110, + 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,12,0,0,0,100,1,160,0, + 124,0,106,1,161,1,83,0,41,2,78,122,20,95,78,97, + 109,101,115,112,97,99,101,80,97,116,104,40,123,33,114,125, + 41,41,2,114,54,0,0,0,114,248,0,0,0,41,1,114, + 108,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,8,95,95,114,101,112,114,95,95,149,4,0, + 0,115,2,0,0,0,0,1,122,23,95,78,97,109,101,115, + 112,97,99,101,80,97,116,104,46,95,95,114,101,112,114,95, + 95,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,12,0,0,0,124,1,124,0,160, + 0,161,0,107,6,83,0,41,1,78,41,1,114,0,1,0, + 0,41,2,114,108,0,0,0,218,4,105,116,101,109,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,12,95, + 95,99,111,110,116,97,105,110,115,95,95,152,4,0,0,115, + 2,0,0,0,0,1,122,27,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,46,95,95,99,111,110,116,97,105,110, + 115,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,67,0,0,0,115,16,0,0,0,124,0,106, + 0,160,1,124,1,161,1,1,0,100,0,83,0,41,1,78, + 41,2,114,248,0,0,0,114,170,0,0,0,41,2,114,108, + 0,0,0,114,6,1,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,170,0,0,0,155,4,0,0, + 115,2,0,0,0,0,1,122,21,95,78,97,109,101,115,112, + 97,99,101,80,97,116,104,46,97,112,112,101,110,100,78,41, + 14,114,113,0,0,0,114,112,0,0,0,114,114,0,0,0, + 114,115,0,0,0,114,191,0,0,0,114,254,0,0,0,114, + 249,0,0,0,114,0,1,0,0,114,1,1,0,0,114,3, + 1,0,0,114,4,1,0,0,114,5,1,0,0,114,7,1, + 0,0,114,170,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,246,0,0,0, + 100,4,0,0,115,22,0,0,0,8,5,4,2,8,6,8, + 10,8,4,8,13,8,3,8,3,8,3,8,3,8,3,114, + 246,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,64,0,0,0,115,80,0,0,0,101,0, + 90,1,100,0,90,2,100,1,100,2,132,0,90,3,101,4, + 100,3,100,4,132,0,131,1,90,5,100,5,100,6,132,0, + 90,6,100,7,100,8,132,0,90,7,100,9,100,10,132,0, + 90,8,100,11,100,12,132,0,90,9,100,13,100,14,132,0, + 90,10,100,15,100,16,132,0,90,11,100,17,83,0,41,18, + 218,16,95,78,97,109,101,115,112,97,99,101,76,111,97,100, + 101,114,99,4,0,0,0,0,0,0,0,4,0,0,0,4, + 0,0,0,67,0,0,0,115,18,0,0,0,116,0,124,1, + 124,2,124,3,131,3,124,0,95,1,100,0,83,0,41,1, + 78,41,2,114,246,0,0,0,114,248,0,0,0,41,4,114, + 108,0,0,0,114,106,0,0,0,114,39,0,0,0,114,252, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,191,0,0,0,161,4,0,0,115,2,0,0,0, + 0,1,122,25,95,78,97,109,101,115,112,97,99,101,76,111, + 97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,12,0,0,0,100,1,160,0,124,1,106,1,161, + 1,83,0,41,2,122,115,82,101,116,117,114,110,32,114,101, + 112,114,32,102,111,114,32,116,104,101,32,109,111,100,117,108, + 101,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, + 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, + 97,116,101,100,46,32,32,84,104,101,32,105,109,112,111,114, + 116,32,109,97,99,104,105,110,101,114,121,32,100,111,101,115, + 32,116,104,101,32,106,111,98,32,105,116,115,101,108,102,46, + 10,10,32,32,32,32,32,32,32,32,122,25,60,109,111,100, + 117,108,101,32,123,33,114,125,32,40,110,97,109,101,115,112, + 97,99,101,41,62,41,2,114,54,0,0,0,114,113,0,0, + 0,41,2,114,177,0,0,0,114,196,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,11,109,111, + 100,117,108,101,95,114,101,112,114,164,4,0,0,115,2,0, + 0,0,0,7,122,28,95,78,97,109,101,115,112,97,99,101, + 76,111,97,100,101,114,46,109,111,100,117,108,101,95,114,101, + 112,114,99,2,0,0,0,0,0,0,0,2,0,0,0,1, + 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, + 41,2,78,84,114,2,0,0,0,41,2,114,108,0,0,0, + 114,127,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,166,0,0,0,173,4,0,0,115,2,0, + 0,0,0,1,122,27,95,78,97,109,101,115,112,97,99,101, + 76,111,97,100,101,114,46,105,115,95,112,97,99,107,97,103, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, + 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, + 2,78,114,35,0,0,0,114,2,0,0,0,41,2,114,108, + 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,207,0,0,0,176,4,0,0, + 115,2,0,0,0,0,1,122,27,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,46,103,101,116,95,115,111, + 117,114,99,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,6,0,0,0,67,0,0,0,115,16,0,0,0,116,0, + 100,1,100,2,100,3,100,4,100,5,141,4,83,0,41,6, + 78,114,35,0,0,0,122,8,60,115,116,114,105,110,103,62, + 114,195,0,0,0,84,41,1,114,209,0,0,0,41,1,114, + 210,0,0,0,41,2,114,108,0,0,0,114,127,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, + 193,0,0,0,179,4,0,0,115,2,0,0,0,0,1,122, + 25,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, + 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 4,0,0,0,100,1,83,0,41,2,78,114,35,0,0,0, - 114,2,0,0,0,41,2,114,108,0,0,0,114,127,0,0, + 4,0,0,0,100,1,83,0,41,2,122,42,85,115,101,32, + 100,101,102,97,117,108,116,32,115,101,109,97,110,116,105,99, + 115,32,102,111,114,32,109,111,100,117,108,101,32,99,114,101, + 97,116,105,111,110,46,78,114,2,0,0,0,41,2,114,108, + 0,0,0,114,171,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,192,0,0,0,182,4,0,0, + 115,2,0,0,0,0,1,122,30,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,46,99,114,101,97,116,101, + 95,109,111,100,117,108,101,99,2,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, + 0,100,0,83,0,41,1,78,114,2,0,0,0,41,2,114, + 108,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,197,0,0,0,185,4,0, + 0,115,2,0,0,0,0,1,122,28,95,78,97,109,101,115, + 112,97,99,101,76,111,97,100,101,114,46,101,120,101,99,95, + 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,4,0,0,0,67,0,0,0,115,26,0,0,0, + 116,0,160,1,100,1,124,0,106,2,161,2,1,0,116,0, + 160,3,124,0,124,1,161,2,83,0,41,2,122,98,76,111, + 97,100,32,97,32,110,97,109,101,115,112,97,99,101,32,109, + 111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,32, + 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, + 101,120,101,99,95,109,111,100,117,108,101,40,41,32,105,110, + 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, + 122,38,110,97,109,101,115,112,97,99,101,32,109,111,100,117, + 108,101,32,108,111,97,100,101,100,32,119,105,116,104,32,112, + 97,116,104,32,123,33,114,125,41,4,114,122,0,0,0,114, + 136,0,0,0,114,248,0,0,0,114,198,0,0,0,41,2, + 114,108,0,0,0,114,127,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,199,0,0,0,188,4, + 0,0,115,8,0,0,0,0,7,6,1,4,255,4,2,122, + 28,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, + 114,46,108,111,97,100,95,109,111,100,117,108,101,78,41,12, + 114,113,0,0,0,114,112,0,0,0,114,114,0,0,0,114, + 191,0,0,0,114,189,0,0,0,114,9,1,0,0,114,166, + 0,0,0,114,207,0,0,0,114,193,0,0,0,114,192,0, + 0,0,114,197,0,0,0,114,199,0,0,0,114,2,0,0, 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,207,0,0,0,175,4,0,0,115,2,0,0,0,0,1, - 122,27,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,46,103,101,116,95,115,111,117,114,99,101,99,2,0, - 0,0,0,0,0,0,2,0,0,0,6,0,0,0,67,0, - 0,0,115,16,0,0,0,116,0,100,1,100,2,100,3,100, - 4,100,5,141,4,83,0,41,6,78,114,35,0,0,0,122, - 8,60,115,116,114,105,110,103,62,114,195,0,0,0,84,41, - 1,114,209,0,0,0,41,1,114,210,0,0,0,41,2,114, - 108,0,0,0,114,127,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,193,0,0,0,178,4,0, - 0,115,2,0,0,0,0,1,122,25,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,46,103,101,116,95,99, - 111,100,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, - 0,41,2,122,42,85,115,101,32,100,101,102,97,117,108,116, - 32,115,101,109,97,110,116,105,99,115,32,102,111,114,32,109, - 111,100,117,108,101,32,99,114,101,97,116,105,111,110,46,78, - 114,2,0,0,0,41,2,114,108,0,0,0,114,171,0,0, + 114,8,1,0,0,160,4,0,0,115,16,0,0,0,8,1, + 8,3,12,9,8,3,8,3,8,3,8,3,8,3,114,8, + 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 4,0,0,0,64,0,0,0,115,114,0,0,0,101,0,90, + 1,100,0,90,2,100,1,90,3,101,4,100,2,100,3,132, + 0,131,1,90,5,101,4,100,4,100,5,132,0,131,1,90, + 6,101,4,100,6,100,7,132,0,131,1,90,7,101,4,100, + 8,100,9,132,0,131,1,90,8,101,4,100,10,102,1,100, + 11,100,12,132,1,131,1,90,9,101,4,100,10,100,10,102, + 2,100,13,100,14,132,1,131,1,90,10,101,4,100,10,102, + 1,100,15,100,16,132,1,131,1,90,11,100,10,83,0,41, + 17,218,10,80,97,116,104,70,105,110,100,101,114,122,62,77, + 101,116,97,32,112,97,116,104,32,102,105,110,100,101,114,32, + 102,111,114,32,115,121,115,46,112,97,116,104,32,97,110,100, + 32,112,97,99,107,97,103,101,32,95,95,112,97,116,104,95, + 95,32,97,116,116,114,105,98,117,116,101,115,46,99,1,0, + 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, + 0,0,115,64,0,0,0,116,0,116,1,106,2,160,3,161, + 0,131,1,68,0,93,44,92,2,125,1,125,2,124,2,100, + 1,107,8,114,40,116,1,106,2,124,1,61,0,113,14,116, + 4,124,2,100,2,131,2,114,14,124,2,160,5,161,0,1, + 0,113,14,100,1,83,0,41,3,122,125,67,97,108,108,32, + 116,104,101,32,105,110,118,97,108,105,100,97,116,101,95,99, + 97,99,104,101,115,40,41,32,109,101,116,104,111,100,32,111, + 110,32,97,108,108,32,112,97,116,104,32,101,110,116,114,121, + 32,102,105,110,100,101,114,115,10,32,32,32,32,32,32,32, + 32,115,116,111,114,101,100,32,105,110,32,115,121,115,46,112, + 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, + 104,101,115,32,40,119,104,101,114,101,32,105,109,112,108,101, + 109,101,110,116,101,100,41,46,78,218,17,105,110,118,97,108, + 105,100,97,116,101,95,99,97,99,104,101,115,41,6,218,4, + 108,105,115,116,114,6,0,0,0,218,19,112,97,116,104,95, + 105,109,112,111,114,116,101,114,95,99,97,99,104,101,218,5, + 105,116,101,109,115,114,116,0,0,0,114,11,1,0,0,41, + 3,114,177,0,0,0,114,106,0,0,0,218,6,102,105,110, + 100,101,114,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,11,1,0,0,206,4,0,0,115,10,0,0,0, + 0,4,22,1,8,1,10,1,10,1,122,28,80,97,116,104, + 70,105,110,100,101,114,46,105,110,118,97,108,105,100,97,116, + 101,95,99,97,99,104,101,115,99,2,0,0,0,0,0,0, + 0,3,0,0,0,9,0,0,0,67,0,0,0,115,84,0, + 0,0,116,0,106,1,100,1,107,9,114,28,116,0,106,1, + 115,28,116,2,160,3,100,2,116,4,161,2,1,0,116,0, + 106,1,68,0,93,44,125,2,122,14,124,2,124,1,131,1, + 87,0,2,0,1,0,83,0,4,0,116,5,107,10,114,76, + 1,0,1,0,1,0,89,0,113,34,89,0,113,34,88,0, + 113,34,100,1,83,0,41,3,122,46,83,101,97,114,99,104, + 32,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, + 102,111,114,32,97,32,102,105,110,100,101,114,32,102,111,114, + 32,39,112,97,116,104,39,46,78,122,23,115,121,115,46,112, + 97,116,104,95,104,111,111,107,115,32,105,115,32,101,109,112, + 116,121,41,6,114,6,0,0,0,218,10,112,97,116,104,95, + 104,111,111,107,115,114,66,0,0,0,114,67,0,0,0,114, + 126,0,0,0,114,107,0,0,0,41,3,114,177,0,0,0, + 114,39,0,0,0,90,4,104,111,111,107,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,218,11,95,112,97,116, + 104,95,104,111,111,107,115,216,4,0,0,115,16,0,0,0, + 0,3,16,1,12,1,10,1,2,1,14,1,14,1,12,2, + 122,22,80,97,116,104,70,105,110,100,101,114,46,95,112,97, + 116,104,95,104,111,111,107,115,99,2,0,0,0,0,0,0, + 0,3,0,0,0,8,0,0,0,67,0,0,0,115,104,0, + 0,0,124,1,100,1,107,2,114,44,122,12,116,0,160,1, + 161,0,125,1,87,0,110,22,4,0,116,2,107,10,114,42, + 1,0,1,0,1,0,89,0,100,2,83,0,88,0,122,14, + 116,3,106,4,124,1,25,0,125,2,87,0,110,40,4,0, + 116,5,107,10,114,98,1,0,1,0,1,0,124,0,160,6, + 124,1,161,1,125,2,124,2,116,3,106,4,124,1,60,0, + 89,0,110,2,88,0,124,2,83,0,41,3,122,210,71,101, + 116,32,116,104,101,32,102,105,110,100,101,114,32,102,111,114, + 32,116,104,101,32,112,97,116,104,32,101,110,116,114,121,32, + 102,114,111,109,32,115,121,115,46,112,97,116,104,95,105,109, + 112,111,114,116,101,114,95,99,97,99,104,101,46,10,10,32, + 32,32,32,32,32,32,32,73,102,32,116,104,101,32,112,97, + 116,104,32,101,110,116,114,121,32,105,115,32,110,111,116,32, + 105,110,32,116,104,101,32,99,97,99,104,101,44,32,102,105, + 110,100,32,116,104,101,32,97,112,112,114,111,112,114,105,97, + 116,101,32,102,105,110,100,101,114,10,32,32,32,32,32,32, + 32,32,97,110,100,32,99,97,99,104,101,32,105,116,46,32, + 73,102,32,110,111,32,102,105,110,100,101,114,32,105,115,32, + 97,118,97,105,108,97,98,108,101,44,32,115,116,111,114,101, + 32,78,111,110,101,46,10,10,32,32,32,32,32,32,32,32, + 114,35,0,0,0,78,41,7,114,1,0,0,0,114,49,0, + 0,0,114,229,0,0,0,114,6,0,0,0,114,13,1,0, + 0,218,8,75,101,121,69,114,114,111,114,114,17,1,0,0, + 41,3,114,177,0,0,0,114,39,0,0,0,114,15,1,0, 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,192,0,0,0,181,4,0,0,115,2,0,0,0,0,1, - 122,30,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,46,99,114,101,97,116,101,95,109,111,100,117,108,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,4,0,0,0,100,0,83,0,41,1, - 78,114,2,0,0,0,41,2,114,108,0,0,0,114,196,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,197,0,0,0,184,4,0,0,115,2,0,0,0,0, - 1,122,28,95,78,97,109,101,115,112,97,99,101,76,111,97, - 100,101,114,46,101,120,101,99,95,109,111,100,117,108,101,99, - 2,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 67,0,0,0,115,26,0,0,0,116,0,160,1,100,1,124, - 0,106,2,161,2,1,0,116,0,160,3,124,0,124,1,161, - 2,83,0,41,2,122,98,76,111,97,100,32,97,32,110,97, - 109,101,115,112,97,99,101,32,109,111,100,117,108,101,46,10, + 218,20,95,112,97,116,104,95,105,109,112,111,114,116,101,114, + 95,99,97,99,104,101,229,4,0,0,115,22,0,0,0,0, + 8,8,1,2,1,12,1,14,3,8,1,2,1,14,1,14, + 1,10,1,16,1,122,31,80,97,116,104,70,105,110,100,101, + 114,46,95,112,97,116,104,95,105,109,112,111,114,116,101,114, + 95,99,97,99,104,101,99,3,0,0,0,0,0,0,0,6, + 0,0,0,4,0,0,0,67,0,0,0,115,82,0,0,0, + 116,0,124,2,100,1,131,2,114,26,124,2,160,1,124,1, + 161,1,92,2,125,3,125,4,110,14,124,2,160,2,124,1, + 161,1,125,3,103,0,125,4,124,3,100,0,107,9,114,60, + 116,3,160,4,124,1,124,3,161,2,83,0,116,3,160,5, + 124,1,100,0,161,2,125,5,124,4,124,5,95,6,124,5, + 83,0,41,2,78,114,125,0,0,0,41,7,114,116,0,0, + 0,114,125,0,0,0,114,188,0,0,0,114,122,0,0,0, + 114,185,0,0,0,114,167,0,0,0,114,163,0,0,0,41, + 6,114,177,0,0,0,114,127,0,0,0,114,15,1,0,0, + 114,128,0,0,0,114,129,0,0,0,114,171,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,16, + 95,108,101,103,97,99,121,95,103,101,116,95,115,112,101,99, + 251,4,0,0,115,18,0,0,0,0,4,10,1,16,2,10, + 1,4,1,8,1,12,1,12,1,6,1,122,27,80,97,116, + 104,70,105,110,100,101,114,46,95,108,101,103,97,99,121,95, + 103,101,116,95,115,112,101,99,78,99,4,0,0,0,0,0, + 0,0,9,0,0,0,5,0,0,0,67,0,0,0,115,166, + 0,0,0,103,0,125,4,124,2,68,0,93,134,125,5,116, + 0,124,5,116,1,116,2,102,2,131,2,115,28,113,8,124, + 0,160,3,124,5,161,1,125,6,124,6,100,1,107,9,114, + 8,116,4,124,6,100,2,131,2,114,70,124,6,160,5,124, + 1,124,3,161,2,125,7,110,12,124,0,160,6,124,1,124, + 6,161,2,125,7,124,7,100,1,107,8,114,92,113,8,124, + 7,106,7,100,1,107,9,114,110,124,7,2,0,1,0,83, + 0,124,7,106,8,125,8,124,8,100,1,107,8,114,132,116, + 9,100,3,131,1,130,1,124,4,160,10,124,8,161,1,1, + 0,113,8,116,11,160,12,124,1,100,1,161,2,125,7,124, + 4,124,7,95,8,124,7,83,0,41,4,122,63,70,105,110, + 100,32,116,104,101,32,108,111,97,100,101,114,32,111,114,32, + 110,97,109,101,115,112,97,99,101,95,112,97,116,104,32,102, + 111,114,32,116,104,105,115,32,109,111,100,117,108,101,47,112, + 97,99,107,97,103,101,32,110,97,109,101,46,78,114,187,0, + 0,0,122,19,115,112,101,99,32,109,105,115,115,105,110,103, + 32,108,111,97,100,101,114,41,13,114,147,0,0,0,114,76, + 0,0,0,218,5,98,121,116,101,115,114,19,1,0,0,114, + 116,0,0,0,114,187,0,0,0,114,20,1,0,0,114,128, + 0,0,0,114,163,0,0,0,114,107,0,0,0,114,153,0, + 0,0,114,122,0,0,0,114,167,0,0,0,41,9,114,177, + 0,0,0,114,127,0,0,0,114,39,0,0,0,114,186,0, + 0,0,218,14,110,97,109,101,115,112,97,99,101,95,112,97, + 116,104,90,5,101,110,116,114,121,114,15,1,0,0,114,171, + 0,0,0,114,129,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,218,9,95,103,101,116,95,115,112, + 101,99,10,5,0,0,115,40,0,0,0,0,5,4,1,8, + 1,14,1,2,1,10,1,8,1,10,1,14,2,12,1,8, + 1,2,1,10,1,8,1,6,1,8,1,8,5,12,2,12, + 1,6,1,122,20,80,97,116,104,70,105,110,100,101,114,46, + 95,103,101,116,95,115,112,101,99,99,4,0,0,0,0,0, + 0,0,6,0,0,0,5,0,0,0,67,0,0,0,115,100, + 0,0,0,124,2,100,1,107,8,114,14,116,0,106,1,125, + 2,124,0,160,2,124,1,124,2,124,3,161,3,125,4,124, + 4,100,1,107,8,114,40,100,1,83,0,124,4,106,3,100, + 1,107,8,114,92,124,4,106,4,125,5,124,5,114,86,100, + 1,124,4,95,5,116,6,124,1,124,5,124,0,106,2,131, + 3,124,4,95,4,124,4,83,0,100,1,83,0,110,4,124, + 4,83,0,100,1,83,0,41,2,122,141,84,114,121,32,116, + 111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,111, + 114,32,39,102,117,108,108,110,97,109,101,39,32,111,110,32, + 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, + 104,39,46,10,10,32,32,32,32,32,32,32,32,84,104,101, + 32,115,101,97,114,99,104,32,105,115,32,98,97,115,101,100, + 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111, + 107,115,32,97,110,100,32,115,121,115,46,112,97,116,104,95, + 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, + 32,32,32,32,32,32,32,32,78,41,7,114,6,0,0,0, + 114,39,0,0,0,114,23,1,0,0,114,128,0,0,0,114, + 163,0,0,0,114,165,0,0,0,114,246,0,0,0,41,6, + 114,177,0,0,0,114,127,0,0,0,114,39,0,0,0,114, + 186,0,0,0,114,171,0,0,0,114,22,1,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,187,0, + 0,0,42,5,0,0,115,26,0,0,0,0,6,8,1,6, + 1,14,1,8,1,4,1,10,1,6,1,4,3,6,1,16, + 1,4,2,6,2,122,20,80,97,116,104,70,105,110,100,101, + 114,46,102,105,110,100,95,115,112,101,99,99,3,0,0,0, + 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, + 115,30,0,0,0,124,0,160,0,124,1,124,2,161,2,125, + 3,124,3,100,1,107,8,114,24,100,1,83,0,124,3,106, + 1,83,0,41,2,122,170,102,105,110,100,32,116,104,101,32, + 109,111,100,117,108,101,32,111,110,32,115,121,115,46,112,97, + 116,104,32,111,114,32,39,112,97,116,104,39,32,98,97,115, + 101,100,32,111,110,32,115,121,115,46,112,97,116,104,95,104, + 111,111,107,115,32,97,110,100,10,32,32,32,32,32,32,32, + 32,115,121,115,46,112,97,116,104,95,105,109,112,111,114,116, + 101,114,95,99,97,99,104,101,46,10,10,32,32,32,32,32, + 32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,105, + 115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85, + 115,101,32,102,105,110,100,95,115,112,101,99,40,41,32,105, + 110,115,116,101,97,100,46,10,10,32,32,32,32,32,32,32, + 32,78,41,2,114,187,0,0,0,114,128,0,0,0,41,4, + 114,177,0,0,0,114,127,0,0,0,114,39,0,0,0,114, + 171,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,188,0,0,0,66,5,0,0,115,8,0,0, + 0,0,8,12,1,8,1,4,1,122,22,80,97,116,104,70, + 105,110,100,101,114,46,102,105,110,100,95,109,111,100,117,108, + 101,41,12,114,113,0,0,0,114,112,0,0,0,114,114,0, + 0,0,114,115,0,0,0,114,189,0,0,0,114,11,1,0, + 0,114,17,1,0,0,114,19,1,0,0,114,20,1,0,0, + 114,23,1,0,0,114,187,0,0,0,114,188,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,10,1,0,0,202,4,0,0,115,30,0,0, + 0,8,2,4,2,12,10,12,13,12,22,12,15,2,1,2, + 255,12,32,2,1,2,0,2,255,12,24,2,1,2,255,114, + 10,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,64,0,0,0,115,90,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, + 90,4,100,4,100,5,132,0,90,5,101,6,90,7,100,6, + 100,7,132,0,90,8,100,8,100,9,132,0,90,9,100,19, + 100,11,100,12,132,1,90,10,100,13,100,14,132,0,90,11, + 101,12,100,15,100,16,132,0,131,1,90,13,100,17,100,18, + 132,0,90,14,100,10,83,0,41,20,218,10,70,105,108,101, + 70,105,110,100,101,114,122,172,70,105,108,101,45,98,97,115, + 101,100,32,102,105,110,100,101,114,46,10,10,32,32,32,32, + 73,110,116,101,114,97,99,116,105,111,110,115,32,119,105,116, + 104,32,116,104,101,32,102,105,108,101,32,115,121,115,116,101, + 109,32,97,114,101,32,99,97,99,104,101,100,32,102,111,114, + 32,112,101,114,102,111,114,109,97,110,99,101,44,32,98,101, + 105,110,103,10,32,32,32,32,114,101,102,114,101,115,104,101, + 100,32,119,104,101,110,32,116,104,101,32,100,105,114,101,99, + 116,111,114,121,32,116,104,101,32,102,105,110,100,101,114,32, + 105,115,32,104,97,110,100,108,105,110,103,32,104,97,115,32, + 98,101,101,110,32,109,111,100,105,102,105,101,100,46,10,10, + 32,32,32,32,99,2,0,0,0,0,0,0,0,5,0,0, + 0,6,0,0,0,7,0,0,0,115,84,0,0,0,103,0, + 125,3,124,2,68,0,93,32,92,2,137,0,125,4,124,3, + 160,0,135,0,102,1,100,1,100,2,132,8,124,4,68,0, + 131,1,161,1,1,0,113,8,124,3,124,0,95,1,124,1, + 112,54,100,3,124,0,95,2,100,4,124,0,95,3,116,4, + 131,0,124,0,95,5,116,4,131,0,124,0,95,6,100,5, + 83,0,41,6,122,154,73,110,105,116,105,97,108,105,122,101, + 32,119,105,116,104,32,116,104,101,32,112,97,116,104,32,116, + 111,32,115,101,97,114,99,104,32,111,110,32,97,110,100,32, + 97,32,118,97,114,105,97,98,108,101,32,110,117,109,98,101, + 114,32,111,102,10,32,32,32,32,32,32,32,32,50,45,116, + 117,112,108,101,115,32,99,111,110,116,97,105,110,105,110,103, + 32,116,104,101,32,108,111,97,100,101,114,32,97,110,100,32, + 116,104,101,32,102,105,108,101,32,115,117,102,102,105,120,101, + 115,32,116,104,101,32,108,111,97,100,101,114,10,32,32,32, + 32,32,32,32,32,114,101,99,111,103,110,105,122,101,115,46, + 99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,0, + 0,51,0,0,0,115,22,0,0,0,124,0,93,14,125,1, + 124,1,136,0,102,2,86,0,1,0,113,2,100,0,83,0, + 41,1,78,114,2,0,0,0,41,2,114,27,0,0,0,114, + 241,0,0,0,41,1,114,128,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,243,0,0,0,95,5,0,0,115,4, + 0,0,0,4,0,2,0,122,38,70,105,108,101,70,105,110, + 100,101,114,46,95,95,105,110,105,116,95,95,46,60,108,111, + 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, + 63,0,0,0,114,96,0,0,0,78,41,7,114,153,0,0, + 0,218,8,95,108,111,97,100,101,114,115,114,39,0,0,0, + 218,11,95,112,97,116,104,95,109,116,105,109,101,218,3,115, + 101,116,218,11,95,112,97,116,104,95,99,97,99,104,101,218, + 19,95,114,101,108,97,120,101,100,95,112,97,116,104,95,99, + 97,99,104,101,41,5,114,108,0,0,0,114,39,0,0,0, + 218,14,108,111,97,100,101,114,95,100,101,116,97,105,108,115, + 90,7,108,111,97,100,101,114,115,114,173,0,0,0,114,2, + 0,0,0,41,1,114,128,0,0,0,114,4,0,0,0,114, + 191,0,0,0,89,5,0,0,115,16,0,0,0,0,4,4, + 1,12,1,26,1,6,2,10,1,6,1,8,1,122,19,70, + 105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116, + 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,2, + 0,0,0,67,0,0,0,115,10,0,0,0,100,1,124,0, + 95,0,100,2,83,0,41,3,122,31,73,110,118,97,108,105, + 100,97,116,101,32,116,104,101,32,100,105,114,101,99,116,111, + 114,121,32,109,116,105,109,101,46,114,96,0,0,0,78,41, + 1,114,26,1,0,0,41,1,114,108,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,11,1,0, + 0,103,5,0,0,115,2,0,0,0,0,2,122,28,70,105, + 108,101,70,105,110,100,101,114,46,105,110,118,97,108,105,100, + 97,116,101,95,99,97,99,104,101,115,99,2,0,0,0,0, + 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, + 42,0,0,0,124,0,160,0,124,1,161,1,125,2,124,2, + 100,1,107,8,114,26,100,1,103,0,102,2,83,0,124,2, + 106,1,124,2,106,2,112,38,103,0,102,2,83,0,41,2, + 122,197,84,114,121,32,116,111,32,102,105,110,100,32,97,32, + 108,111,97,100,101,114,32,102,111,114,32,116,104,101,32,115, + 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,44, + 32,111,114,32,116,104,101,32,110,97,109,101,115,112,97,99, + 101,10,32,32,32,32,32,32,32,32,112,97,99,107,97,103, + 101,32,112,111,114,116,105,111,110,115,46,32,82,101,116,117, + 114,110,115,32,40,108,111,97,100,101,114,44,32,108,105,115, + 116,45,111,102,45,112,111,114,116,105,111,110,115,41,46,10, 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, - 101,100,46,32,32,85,115,101,32,101,120,101,99,95,109,111, - 100,117,108,101,40,41,32,105,110,115,116,101,97,100,46,10, - 10,32,32,32,32,32,32,32,32,122,38,110,97,109,101,115, - 112,97,99,101,32,109,111,100,117,108,101,32,108,111,97,100, - 101,100,32,119,105,116,104,32,112,97,116,104,32,123,33,114, - 125,41,4,114,122,0,0,0,114,136,0,0,0,114,248,0, - 0,0,114,198,0,0,0,41,2,114,108,0,0,0,114,127, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,199,0,0,0,187,4,0,0,115,8,0,0,0, - 0,7,6,1,4,255,4,2,122,28,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,46,108,111,97,100,95, - 109,111,100,117,108,101,78,41,12,114,113,0,0,0,114,112, - 0,0,0,114,114,0,0,0,114,191,0,0,0,114,189,0, - 0,0,114,9,1,0,0,114,166,0,0,0,114,207,0,0, - 0,114,193,0,0,0,114,192,0,0,0,114,197,0,0,0, - 114,199,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,8,1,0,0,159,4, - 0,0,115,16,0,0,0,8,1,8,3,12,9,8,3,8, - 3,8,3,8,3,8,3,114,8,1,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, - 0,115,114,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,101,4,100,2,100,3,132,0,131,1,90,5,101,4, - 100,4,100,5,132,0,131,1,90,6,101,4,100,6,100,7, - 132,0,131,1,90,7,101,4,100,8,100,9,132,0,131,1, - 90,8,101,4,100,10,102,1,100,11,100,12,132,1,131,1, - 90,9,101,4,100,10,100,10,102,2,100,13,100,14,132,1, - 131,1,90,10,101,4,100,10,102,1,100,15,100,16,132,1, - 131,1,90,11,100,10,83,0,41,17,218,10,80,97,116,104, - 70,105,110,100,101,114,122,62,77,101,116,97,32,112,97,116, - 104,32,102,105,110,100,101,114,32,102,111,114,32,115,121,115, - 46,112,97,116,104,32,97,110,100,32,112,97,99,107,97,103, - 101,32,95,95,112,97,116,104,95,95,32,97,116,116,114,105, - 98,117,116,101,115,46,99,1,0,0,0,0,0,0,0,3, - 0,0,0,4,0,0,0,67,0,0,0,115,64,0,0,0, - 116,0,116,1,106,2,160,3,161,0,131,1,68,0,93,44, - 92,2,125,1,125,2,124,2,100,1,107,8,114,40,116,1, - 106,2,124,1,61,0,113,14,116,4,124,2,100,2,131,2, - 114,14,124,2,160,5,161,0,1,0,113,14,100,1,83,0, - 41,3,122,125,67,97,108,108,32,116,104,101,32,105,110,118, - 97,108,105,100,97,116,101,95,99,97,99,104,101,115,40,41, - 32,109,101,116,104,111,100,32,111,110,32,97,108,108,32,112, - 97,116,104,32,101,110,116,114,121,32,102,105,110,100,101,114, - 115,10,32,32,32,32,32,32,32,32,115,116,111,114,101,100, - 32,105,110,32,115,121,115,46,112,97,116,104,95,105,109,112, - 111,114,116,101,114,95,99,97,99,104,101,115,32,40,119,104, - 101,114,101,32,105,109,112,108,101,109,101,110,116,101,100,41, - 46,78,218,17,105,110,118,97,108,105,100,97,116,101,95,99, - 97,99,104,101,115,41,6,218,4,108,105,115,116,114,6,0, - 0,0,218,19,112,97,116,104,95,105,109,112,111,114,116,101, - 114,95,99,97,99,104,101,218,5,105,116,101,109,115,114,116, - 0,0,0,114,11,1,0,0,41,3,114,177,0,0,0,114, - 106,0,0,0,218,6,102,105,110,100,101,114,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,11,1,0,0, - 205,4,0,0,115,10,0,0,0,0,4,22,1,8,1,10, - 1,10,1,122,28,80,97,116,104,70,105,110,100,101,114,46, - 105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,101, - 115,99,2,0,0,0,0,0,0,0,3,0,0,0,9,0, - 0,0,67,0,0,0,115,84,0,0,0,116,0,106,1,100, - 1,107,9,114,28,116,0,106,1,115,28,116,2,160,3,100, - 2,116,4,161,2,1,0,116,0,106,1,68,0,93,44,125, - 2,122,14,124,2,124,1,131,1,87,0,2,0,1,0,83, - 0,4,0,116,5,107,10,114,76,1,0,1,0,1,0,89, - 0,113,34,89,0,113,34,88,0,113,34,100,1,83,0,41, - 3,122,46,83,101,97,114,99,104,32,115,121,115,46,112,97, - 116,104,95,104,111,111,107,115,32,102,111,114,32,97,32,102, - 105,110,100,101,114,32,102,111,114,32,39,112,97,116,104,39, - 46,78,122,23,115,121,115,46,112,97,116,104,95,104,111,111, - 107,115,32,105,115,32,101,109,112,116,121,41,6,114,6,0, - 0,0,218,10,112,97,116,104,95,104,111,111,107,115,114,66, - 0,0,0,114,67,0,0,0,114,126,0,0,0,114,107,0, - 0,0,41,3,114,177,0,0,0,114,39,0,0,0,90,4, - 104,111,111,107,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,11,95,112,97,116,104,95,104,111,111,107,115, - 215,4,0,0,115,16,0,0,0,0,3,16,1,12,1,10, - 1,2,1,14,1,14,1,12,2,122,22,80,97,116,104,70, - 105,110,100,101,114,46,95,112,97,116,104,95,104,111,111,107, - 115,99,2,0,0,0,0,0,0,0,3,0,0,0,8,0, - 0,0,67,0,0,0,115,104,0,0,0,124,1,100,1,107, - 2,114,44,122,12,116,0,160,1,161,0,125,1,87,0,110, - 22,4,0,116,2,107,10,114,42,1,0,1,0,1,0,89, - 0,100,2,83,0,88,0,122,14,116,3,106,4,124,1,25, - 0,125,2,87,0,110,40,4,0,116,5,107,10,114,98,1, - 0,1,0,1,0,124,0,160,6,124,1,161,1,125,2,124, - 2,116,3,106,4,124,1,60,0,89,0,110,2,88,0,124, - 2,83,0,41,3,122,210,71,101,116,32,116,104,101,32,102, - 105,110,100,101,114,32,102,111,114,32,116,104,101,32,112,97, - 116,104,32,101,110,116,114,121,32,102,114,111,109,32,115,121, - 115,46,112,97,116,104,95,105,109,112,111,114,116,101,114,95, - 99,97,99,104,101,46,10,10,32,32,32,32,32,32,32,32, - 73,102,32,116,104,101,32,112,97,116,104,32,101,110,116,114, - 121,32,105,115,32,110,111,116,32,105,110,32,116,104,101,32, - 99,97,99,104,101,44,32,102,105,110,100,32,116,104,101,32, - 97,112,112,114,111,112,114,105,97,116,101,32,102,105,110,100, - 101,114,10,32,32,32,32,32,32,32,32,97,110,100,32,99, - 97,99,104,101,32,105,116,46,32,73,102,32,110,111,32,102, - 105,110,100,101,114,32,105,115,32,97,118,97,105,108,97,98, - 108,101,44,32,115,116,111,114,101,32,78,111,110,101,46,10, - 10,32,32,32,32,32,32,32,32,114,35,0,0,0,78,41, - 7,114,1,0,0,0,114,49,0,0,0,114,229,0,0,0, - 114,6,0,0,0,114,13,1,0,0,218,8,75,101,121,69, - 114,114,111,114,114,17,1,0,0,41,3,114,177,0,0,0, - 114,39,0,0,0,114,15,1,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,20,95,112,97,116,104, - 95,105,109,112,111,114,116,101,114,95,99,97,99,104,101,228, - 4,0,0,115,22,0,0,0,0,8,8,1,2,1,12,1, - 14,3,8,1,2,1,14,1,14,1,10,1,16,1,122,31, - 80,97,116,104,70,105,110,100,101,114,46,95,112,97,116,104, - 95,105,109,112,111,114,116,101,114,95,99,97,99,104,101,99, - 3,0,0,0,0,0,0,0,6,0,0,0,4,0,0,0, - 67,0,0,0,115,82,0,0,0,116,0,124,2,100,1,131, - 2,114,26,124,2,160,1,124,1,161,1,92,2,125,3,125, - 4,110,14,124,2,160,2,124,1,161,1,125,3,103,0,125, - 4,124,3,100,0,107,9,114,60,116,3,160,4,124,1,124, - 3,161,2,83,0,116,3,160,5,124,1,100,0,161,2,125, - 5,124,4,124,5,95,6,124,5,83,0,41,2,78,114,125, - 0,0,0,41,7,114,116,0,0,0,114,125,0,0,0,114, - 188,0,0,0,114,122,0,0,0,114,185,0,0,0,114,167, - 0,0,0,114,163,0,0,0,41,6,114,177,0,0,0,114, - 127,0,0,0,114,15,1,0,0,114,128,0,0,0,114,129, - 0,0,0,114,171,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,218,16,95,108,101,103,97,99,121, - 95,103,101,116,95,115,112,101,99,250,4,0,0,115,18,0, - 0,0,0,4,10,1,16,2,10,1,4,1,8,1,12,1, - 12,1,6,1,122,27,80,97,116,104,70,105,110,100,101,114, - 46,95,108,101,103,97,99,121,95,103,101,116,95,115,112,101, - 99,78,99,4,0,0,0,0,0,0,0,9,0,0,0,5, - 0,0,0,67,0,0,0,115,166,0,0,0,103,0,125,4, - 124,2,68,0,93,134,125,5,116,0,124,5,116,1,116,2, - 102,2,131,2,115,28,113,8,124,0,160,3,124,5,161,1, - 125,6,124,6,100,1,107,9,114,8,116,4,124,6,100,2, - 131,2,114,70,124,6,160,5,124,1,124,3,161,2,125,7, - 110,12,124,0,160,6,124,1,124,6,161,2,125,7,124,7, - 100,1,107,8,114,92,113,8,124,7,106,7,100,1,107,9, - 114,110,124,7,2,0,1,0,83,0,124,7,106,8,125,8, - 124,8,100,1,107,8,114,132,116,9,100,3,131,1,130,1, - 124,4,160,10,124,8,161,1,1,0,113,8,116,11,160,12, - 124,1,100,1,161,2,125,7,124,4,124,7,95,8,124,7, - 83,0,41,4,122,63,70,105,110,100,32,116,104,101,32,108, - 111,97,100,101,114,32,111,114,32,110,97,109,101,115,112,97, - 99,101,95,112,97,116,104,32,102,111,114,32,116,104,105,115, - 32,109,111,100,117,108,101,47,112,97,99,107,97,103,101,32, - 110,97,109,101,46,78,114,187,0,0,0,122,19,115,112,101, - 99,32,109,105,115,115,105,110,103,32,108,111,97,100,101,114, - 41,13,114,147,0,0,0,114,76,0,0,0,218,5,98,121, - 116,101,115,114,19,1,0,0,114,116,0,0,0,114,187,0, - 0,0,114,20,1,0,0,114,128,0,0,0,114,163,0,0, - 0,114,107,0,0,0,114,153,0,0,0,114,122,0,0,0, - 114,167,0,0,0,41,9,114,177,0,0,0,114,127,0,0, - 0,114,39,0,0,0,114,186,0,0,0,218,14,110,97,109, - 101,115,112,97,99,101,95,112,97,116,104,90,5,101,110,116, - 114,121,114,15,1,0,0,114,171,0,0,0,114,129,0,0, + 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, + 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, + 32,32,32,32,32,32,32,78,41,3,114,187,0,0,0,114, + 128,0,0,0,114,163,0,0,0,41,3,114,108,0,0,0, + 114,127,0,0,0,114,171,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,125,0,0,0,109,5, + 0,0,115,8,0,0,0,0,7,10,1,8,1,8,1,122, + 22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100, + 95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,0, + 7,0,0,0,6,0,0,0,67,0,0,0,115,26,0,0, + 0,124,1,124,2,124,3,131,2,125,6,116,0,124,2,124, + 3,124,6,124,4,100,1,141,4,83,0,41,2,78,41,2, + 114,128,0,0,0,114,163,0,0,0,41,1,114,174,0,0, + 0,41,7,114,108,0,0,0,114,172,0,0,0,114,127,0, + 0,0,114,39,0,0,0,90,4,115,109,115,108,114,186,0, + 0,0,114,128,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,23,1,0,0,121,5,0,0,115, + 8,0,0,0,0,1,10,1,8,1,2,255,122,20,70,105, + 108,101,70,105,110,100,101,114,46,95,103,101,116,95,115,112, + 101,99,78,99,3,0,0,0,0,0,0,0,14,0,0,0, + 8,0,0,0,67,0,0,0,115,102,1,0,0,100,1,125, + 3,124,1,160,0,100,2,161,1,100,3,25,0,125,4,122, + 24,116,1,124,0,106,2,112,34,116,3,160,4,161,0,131, + 1,106,5,125,5,87,0,110,24,4,0,116,6,107,10,114, + 66,1,0,1,0,1,0,100,4,125,5,89,0,110,2,88, + 0,124,5,124,0,106,7,107,3,114,92,124,0,160,8,161, + 0,1,0,124,5,124,0,95,7,116,9,131,0,114,114,124, + 0,106,10,125,6,124,4,160,11,161,0,125,7,110,10,124, + 0,106,12,125,6,124,4,125,7,124,7,124,6,107,6,114, + 218,116,13,124,0,106,2,124,4,131,2,125,8,124,0,106, + 14,68,0,93,58,92,2,125,9,125,10,100,5,124,9,23, + 0,125,11,116,13,124,8,124,11,131,2,125,12,116,15,124, + 12,131,1,114,208,124,0,160,16,124,10,124,1,124,12,124, + 8,103,1,124,2,161,5,2,0,1,0,83,0,113,150,116, + 17,124,8,131,1,125,3,124,0,106,14,68,0,93,86,92, + 2,125,9,125,10,116,13,124,0,106,2,124,4,124,9,23, + 0,131,2,125,12,116,18,106,19,100,6,124,12,100,3,100, + 7,141,3,1,0,124,7,124,9,23,0,124,6,107,6,144, + 1,114,54,116,15,124,12,131,1,144,1,114,54,124,0,160, + 16,124,10,124,1,124,12,100,8,124,2,161,5,2,0,1, + 0,83,0,113,224,124,3,144,1,114,98,116,18,160,19,100, + 9,124,8,161,2,1,0,116,18,160,20,124,1,100,8,161, + 2,125,13,124,8,103,1,124,13,95,21,124,13,83,0,100, + 8,83,0,41,10,122,111,84,114,121,32,116,111,32,102,105, + 110,100,32,97,32,115,112,101,99,32,102,111,114,32,116,104, + 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, + 108,101,46,10,10,32,32,32,32,32,32,32,32,82,101,116, + 117,114,110,115,32,116,104,101,32,109,97,116,99,104,105,110, + 103,32,115,112,101,99,44,32,111,114,32,78,111,110,101,32, + 105,102,32,110,111,116,32,102,111,117,110,100,46,10,32,32, + 32,32,32,32,32,32,70,114,63,0,0,0,114,23,0,0, + 0,114,96,0,0,0,114,191,0,0,0,122,9,116,114,121, + 105,110,103,32,123,125,41,1,90,9,118,101,114,98,111,115, + 105,116,121,78,122,25,112,111,115,115,105,98,108,101,32,110, + 97,109,101,115,112,97,99,101,32,102,111,114,32,123,125,41, + 22,114,36,0,0,0,114,43,0,0,0,114,39,0,0,0, + 114,1,0,0,0,114,49,0,0,0,114,235,0,0,0,114, + 44,0,0,0,114,26,1,0,0,218,11,95,102,105,108,108, + 95,99,97,99,104,101,114,5,0,0,0,114,29,1,0,0, + 114,97,0,0,0,114,28,1,0,0,114,33,0,0,0,114, + 25,1,0,0,114,48,0,0,0,114,23,1,0,0,114,50, + 0,0,0,114,122,0,0,0,114,136,0,0,0,114,167,0, + 0,0,114,163,0,0,0,41,14,114,108,0,0,0,114,127, + 0,0,0,114,186,0,0,0,90,12,105,115,95,110,97,109, + 101,115,112,97,99,101,90,11,116,97,105,108,95,109,111,100, + 117,108,101,114,155,0,0,0,90,5,99,97,99,104,101,90, + 12,99,97,99,104,101,95,109,111,100,117,108,101,90,9,98, + 97,115,101,95,112,97,116,104,114,241,0,0,0,114,172,0, + 0,0,90,13,105,110,105,116,95,102,105,108,101,110,97,109, + 101,90,9,102,117,108,108,95,112,97,116,104,114,171,0,0, 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,9,95,103,101,116,95,115,112,101,99,9,5,0,0,115, - 40,0,0,0,0,5,4,1,8,1,14,1,2,1,10,1, - 8,1,10,1,14,2,12,1,8,1,2,1,10,1,8,1, - 6,1,8,1,8,5,12,2,12,1,6,1,122,20,80,97, - 116,104,70,105,110,100,101,114,46,95,103,101,116,95,115,112, - 101,99,99,4,0,0,0,0,0,0,0,6,0,0,0,5, - 0,0,0,67,0,0,0,115,100,0,0,0,124,2,100,1, - 107,8,114,14,116,0,106,1,125,2,124,0,160,2,124,1, - 124,2,124,3,161,3,125,4,124,4,100,1,107,8,114,40, - 100,1,83,0,124,4,106,3,100,1,107,8,114,92,124,4, - 106,4,125,5,124,5,114,86,100,1,124,4,95,5,116,6, - 124,1,124,5,124,0,106,2,131,3,124,4,95,4,124,4, - 83,0,100,1,83,0,110,4,124,4,83,0,100,1,83,0, - 41,2,122,141,84,114,121,32,116,111,32,102,105,110,100,32, - 97,32,115,112,101,99,32,102,111,114,32,39,102,117,108,108, - 110,97,109,101,39,32,111,110,32,115,121,115,46,112,97,116, - 104,32,111,114,32,39,112,97,116,104,39,46,10,10,32,32, - 32,32,32,32,32,32,84,104,101,32,115,101,97,114,99,104, - 32,105,115,32,98,97,115,101,100,32,111,110,32,115,121,115, - 46,112,97,116,104,95,104,111,111,107,115,32,97,110,100,32, - 115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101, - 114,95,99,97,99,104,101,46,10,32,32,32,32,32,32,32, - 32,78,41,7,114,6,0,0,0,114,39,0,0,0,114,23, - 1,0,0,114,128,0,0,0,114,163,0,0,0,114,165,0, - 0,0,114,246,0,0,0,41,6,114,177,0,0,0,114,127, - 0,0,0,114,39,0,0,0,114,186,0,0,0,114,171,0, - 0,0,114,22,1,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,187,0,0,0,41,5,0,0,115, - 26,0,0,0,0,6,8,1,6,1,14,1,8,1,4,1, - 10,1,6,1,4,3,6,1,16,1,4,2,6,2,122,20, - 80,97,116,104,70,105,110,100,101,114,46,102,105,110,100,95, - 115,112,101,99,99,3,0,0,0,0,0,0,0,4,0,0, - 0,4,0,0,0,67,0,0,0,115,30,0,0,0,124,0, - 160,0,124,1,124,2,161,2,125,3,124,3,100,1,107,8, - 114,24,100,1,83,0,124,3,106,1,83,0,41,2,122,170, - 102,105,110,100,32,116,104,101,32,109,111,100,117,108,101,32, - 111,110,32,115,121,115,46,112,97,116,104,32,111,114,32,39, - 112,97,116,104,39,32,98,97,115,101,100,32,111,110,32,115, - 121,115,46,112,97,116,104,95,104,111,111,107,115,32,97,110, - 100,10,32,32,32,32,32,32,32,32,115,121,115,46,112,97, - 116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104, - 101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,115, - 32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,101, - 99,97,116,101,100,46,32,32,85,115,101,32,102,105,110,100, - 95,115,112,101,99,40,41,32,105,110,115,116,101,97,100,46, - 10,10,32,32,32,32,32,32,32,32,78,41,2,114,187,0, - 0,0,114,128,0,0,0,41,4,114,177,0,0,0,114,127, - 0,0,0,114,39,0,0,0,114,171,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,188,0,0, - 0,65,5,0,0,115,8,0,0,0,0,8,12,1,8,1, - 4,1,122,22,80,97,116,104,70,105,110,100,101,114,46,102, - 105,110,100,95,109,111,100,117,108,101,41,12,114,113,0,0, - 0,114,112,0,0,0,114,114,0,0,0,114,115,0,0,0, - 114,189,0,0,0,114,11,1,0,0,114,17,1,0,0,114, - 19,1,0,0,114,20,1,0,0,114,23,1,0,0,114,187, - 0,0,0,114,188,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,10,1,0, - 0,201,4,0,0,115,30,0,0,0,8,2,4,2,12,10, - 12,13,12,22,12,15,2,1,2,255,12,32,2,1,2,0, - 2,255,12,24,2,1,2,255,114,10,1,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,3,0,0,0,64,0, - 0,0,115,90,0,0,0,101,0,90,1,100,0,90,2,100, - 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, - 0,90,5,101,6,90,7,100,6,100,7,132,0,90,8,100, - 8,100,9,132,0,90,9,100,19,100,11,100,12,132,1,90, - 10,100,13,100,14,132,0,90,11,101,12,100,15,100,16,132, - 0,131,1,90,13,100,17,100,18,132,0,90,14,100,10,83, - 0,41,20,218,10,70,105,108,101,70,105,110,100,101,114,122, - 172,70,105,108,101,45,98,97,115,101,100,32,102,105,110,100, - 101,114,46,10,10,32,32,32,32,73,110,116,101,114,97,99, - 116,105,111,110,115,32,119,105,116,104,32,116,104,101,32,102, - 105,108,101,32,115,121,115,116,101,109,32,97,114,101,32,99, - 97,99,104,101,100,32,102,111,114,32,112,101,114,102,111,114, - 109,97,110,99,101,44,32,98,101,105,110,103,10,32,32,32, - 32,114,101,102,114,101,115,104,101,100,32,119,104,101,110,32, - 116,104,101,32,100,105,114,101,99,116,111,114,121,32,116,104, - 101,32,102,105,110,100,101,114,32,105,115,32,104,97,110,100, - 108,105,110,103,32,104,97,115,32,98,101,101,110,32,109,111, - 100,105,102,105,101,100,46,10,10,32,32,32,32,99,2,0, - 0,0,0,0,0,0,5,0,0,0,6,0,0,0,7,0, - 0,0,115,84,0,0,0,103,0,125,3,124,2,68,0,93, - 32,92,2,137,0,125,4,124,3,160,0,135,0,102,1,100, - 1,100,2,132,8,124,4,68,0,131,1,161,1,1,0,113, - 8,124,3,124,0,95,1,124,1,112,54,100,3,124,0,95, - 2,100,4,124,0,95,3,116,4,131,0,124,0,95,5,116, - 4,131,0,124,0,95,6,100,5,83,0,41,6,122,154,73, - 110,105,116,105,97,108,105,122,101,32,119,105,116,104,32,116, - 104,101,32,112,97,116,104,32,116,111,32,115,101,97,114,99, - 104,32,111,110,32,97,110,100,32,97,32,118,97,114,105,97, - 98,108,101,32,110,117,109,98,101,114,32,111,102,10,32,32, - 32,32,32,32,32,32,50,45,116,117,112,108,101,115,32,99, - 111,110,116,97,105,110,105,110,103,32,116,104,101,32,108,111, - 97,100,101,114,32,97,110,100,32,116,104,101,32,102,105,108, - 101,32,115,117,102,102,105,120,101,115,32,116,104,101,32,108, - 111,97,100,101,114,10,32,32,32,32,32,32,32,32,114,101, - 99,111,103,110,105,122,101,115,46,99,1,0,0,0,0,0, - 0,0,2,0,0,0,3,0,0,0,51,0,0,0,115,22, - 0,0,0,124,0,93,14,125,1,124,1,136,0,102,2,86, - 0,1,0,113,2,100,0,83,0,41,1,78,114,2,0,0, - 0,41,2,114,27,0,0,0,114,241,0,0,0,41,1,114, - 128,0,0,0,114,2,0,0,0,114,4,0,0,0,114,243, - 0,0,0,94,5,0,0,115,4,0,0,0,4,0,2,0, - 122,38,70,105,108,101,70,105,110,100,101,114,46,95,95,105, - 110,105,116,95,95,46,60,108,111,99,97,108,115,62,46,60, - 103,101,110,101,120,112,114,62,114,63,0,0,0,114,96,0, - 0,0,78,41,7,114,153,0,0,0,218,8,95,108,111,97, - 100,101,114,115,114,39,0,0,0,218,11,95,112,97,116,104, - 95,109,116,105,109,101,218,3,115,101,116,218,11,95,112,97, - 116,104,95,99,97,99,104,101,218,19,95,114,101,108,97,120, - 101,100,95,112,97,116,104,95,99,97,99,104,101,41,5,114, - 108,0,0,0,114,39,0,0,0,218,14,108,111,97,100,101, - 114,95,100,101,116,97,105,108,115,90,7,108,111,97,100,101, - 114,115,114,173,0,0,0,114,2,0,0,0,41,1,114,128, - 0,0,0,114,4,0,0,0,114,191,0,0,0,88,5,0, - 0,115,16,0,0,0,0,4,4,1,12,1,26,1,6,2, - 10,1,6,1,8,1,122,19,70,105,108,101,70,105,110,100, - 101,114,46,95,95,105,110,105,116,95,95,99,1,0,0,0, - 0,0,0,0,1,0,0,0,2,0,0,0,67,0,0,0, - 115,10,0,0,0,100,1,124,0,95,0,100,2,83,0,41, - 3,122,31,73,110,118,97,108,105,100,97,116,101,32,116,104, - 101,32,100,105,114,101,99,116,111,114,121,32,109,116,105,109, - 101,46,114,96,0,0,0,78,41,1,114,26,1,0,0,41, - 1,114,108,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,11,1,0,0,102,5,0,0,115,2, - 0,0,0,0,2,122,28,70,105,108,101,70,105,110,100,101, - 114,46,105,110,118,97,108,105,100,97,116,101,95,99,97,99, - 104,101,115,99,2,0,0,0,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,42,0,0,0,124,0,160, - 0,124,1,161,1,125,2,124,2,100,1,107,8,114,26,100, - 1,103,0,102,2,83,0,124,2,106,1,124,2,106,2,112, - 38,103,0,102,2,83,0,41,2,122,197,84,114,121,32,116, - 111,32,102,105,110,100,32,97,32,108,111,97,100,101,114,32, - 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, - 100,32,109,111,100,117,108,101,44,32,111,114,32,116,104,101, - 32,110,97,109,101,115,112,97,99,101,10,32,32,32,32,32, - 32,32,32,112,97,99,107,97,103,101,32,112,111,114,116,105, - 111,110,115,46,32,82,101,116,117,114,110,115,32,40,108,111, - 97,100,101,114,44,32,108,105,115,116,45,111,102,45,112,111, - 114,116,105,111,110,115,41,46,10,10,32,32,32,32,32,32, - 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, - 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, - 101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,110, - 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, - 78,41,3,114,187,0,0,0,114,128,0,0,0,114,163,0, - 0,0,41,3,114,108,0,0,0,114,127,0,0,0,114,171, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,125,0,0,0,108,5,0,0,115,8,0,0,0, - 0,7,10,1,8,1,8,1,122,22,70,105,108,101,70,105, - 110,100,101,114,46,102,105,110,100,95,108,111,97,100,101,114, - 99,6,0,0,0,0,0,0,0,7,0,0,0,6,0,0, - 0,67,0,0,0,115,26,0,0,0,124,1,124,2,124,3, - 131,2,125,6,116,0,124,2,124,3,124,6,124,4,100,1, - 141,4,83,0,41,2,78,41,2,114,128,0,0,0,114,163, - 0,0,0,41,1,114,174,0,0,0,41,7,114,108,0,0, - 0,114,172,0,0,0,114,127,0,0,0,114,39,0,0,0, - 90,4,115,109,115,108,114,186,0,0,0,114,128,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 23,1,0,0,120,5,0,0,115,8,0,0,0,0,1,10, - 1,8,1,2,255,122,20,70,105,108,101,70,105,110,100,101, - 114,46,95,103,101,116,95,115,112,101,99,78,99,3,0,0, - 0,0,0,0,0,14,0,0,0,8,0,0,0,67,0,0, - 0,115,102,1,0,0,100,1,125,3,124,1,160,0,100,2, - 161,1,100,3,25,0,125,4,122,24,116,1,124,0,106,2, - 112,34,116,3,160,4,161,0,131,1,106,5,125,5,87,0, - 110,24,4,0,116,6,107,10,114,66,1,0,1,0,1,0, - 100,4,125,5,89,0,110,2,88,0,124,5,124,0,106,7, - 107,3,114,92,124,0,160,8,161,0,1,0,124,5,124,0, - 95,7,116,9,131,0,114,114,124,0,106,10,125,6,124,4, - 160,11,161,0,125,7,110,10,124,0,106,12,125,6,124,4, - 125,7,124,7,124,6,107,6,114,218,116,13,124,0,106,2, - 124,4,131,2,125,8,124,0,106,14,68,0,93,58,92,2, - 125,9,125,10,100,5,124,9,23,0,125,11,116,13,124,8, - 124,11,131,2,125,12,116,15,124,12,131,1,114,208,124,0, - 160,16,124,10,124,1,124,12,124,8,103,1,124,2,161,5, - 2,0,1,0,83,0,113,150,116,17,124,8,131,1,125,3, - 124,0,106,14,68,0,93,86,92,2,125,9,125,10,116,13, - 124,0,106,2,124,4,124,9,23,0,131,2,125,12,116,18, - 106,19,100,6,124,12,100,3,100,7,141,3,1,0,124,7, - 124,9,23,0,124,6,107,6,144,1,114,54,116,15,124,12, - 131,1,144,1,114,54,124,0,160,16,124,10,124,1,124,12, - 100,8,124,2,161,5,2,0,1,0,83,0,113,224,124,3, - 144,1,114,98,116,18,160,19,100,9,124,8,161,2,1,0, - 116,18,160,20,124,1,100,8,161,2,125,13,124,8,103,1, - 124,13,95,21,124,13,83,0,100,8,83,0,41,10,122,111, - 84,114,121,32,116,111,32,102,105,110,100,32,97,32,115,112, - 101,99,32,102,111,114,32,116,104,101,32,115,112,101,99,105, - 102,105,101,100,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,32,32,32,32,82,101,116,117,114,110,115,32,116,104, - 101,32,109,97,116,99,104,105,110,103,32,115,112,101,99,44, - 32,111,114,32,78,111,110,101,32,105,102,32,110,111,116,32, - 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,70, - 114,63,0,0,0,114,23,0,0,0,114,96,0,0,0,114, - 191,0,0,0,122,9,116,114,121,105,110,103,32,123,125,41, - 1,90,9,118,101,114,98,111,115,105,116,121,78,122,25,112, - 111,115,115,105,98,108,101,32,110,97,109,101,115,112,97,99, - 101,32,102,111,114,32,123,125,41,22,114,36,0,0,0,114, - 43,0,0,0,114,39,0,0,0,114,1,0,0,0,114,49, - 0,0,0,114,235,0,0,0,114,44,0,0,0,114,26,1, - 0,0,218,11,95,102,105,108,108,95,99,97,99,104,101,114, - 5,0,0,0,114,29,1,0,0,114,97,0,0,0,114,28, - 1,0,0,114,33,0,0,0,114,25,1,0,0,114,48,0, - 0,0,114,23,1,0,0,114,50,0,0,0,114,122,0,0, - 0,114,136,0,0,0,114,167,0,0,0,114,163,0,0,0, - 41,14,114,108,0,0,0,114,127,0,0,0,114,186,0,0, - 0,90,12,105,115,95,110,97,109,101,115,112,97,99,101,90, - 11,116,97,105,108,95,109,111,100,117,108,101,114,155,0,0, - 0,90,5,99,97,99,104,101,90,12,99,97,99,104,101,95, - 109,111,100,117,108,101,90,9,98,97,115,101,95,112,97,116, - 104,114,241,0,0,0,114,172,0,0,0,90,13,105,110,105, - 116,95,102,105,108,101,110,97,109,101,90,9,102,117,108,108, - 95,112,97,116,104,114,171,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,187,0,0,0,125,5, - 0,0,115,74,0,0,0,0,5,4,1,14,1,2,1,24, - 1,14,1,10,1,10,1,8,1,6,2,6,1,6,1,10, - 2,6,1,4,2,8,1,12,1,14,1,8,1,10,1,8, - 1,26,4,8,2,14,1,16,1,16,1,14,1,10,1,10, - 1,2,0,2,255,10,2,6,1,12,1,12,1,8,1,4, - 1,122,20,70,105,108,101,70,105,110,100,101,114,46,102,105, - 110,100,95,115,112,101,99,99,1,0,0,0,0,0,0,0, - 9,0,0,0,10,0,0,0,67,0,0,0,115,190,0,0, - 0,124,0,106,0,125,1,122,22,116,1,160,2,124,1,112, - 22,116,1,160,3,161,0,161,1,125,2,87,0,110,30,4, - 0,116,4,116,5,116,6,102,3,107,10,114,58,1,0,1, - 0,1,0,103,0,125,2,89,0,110,2,88,0,116,7,106, - 8,160,9,100,1,161,1,115,84,116,10,124,2,131,1,124, - 0,95,11,110,74,116,10,131,0,125,3,124,2,68,0,93, - 56,125,4,124,4,160,12,100,2,161,1,92,3,125,5,125, - 6,125,7,124,6,114,136,100,3,160,13,124,5,124,7,160, - 14,161,0,161,2,125,8,110,4,124,5,125,8,124,3,160, - 15,124,8,161,1,1,0,113,94,124,3,124,0,95,11,116, - 7,106,8,160,9,116,16,161,1,114,186,100,4,100,5,132, - 0,124,2,68,0,131,1,124,0,95,17,100,6,83,0,41, - 7,122,68,70,105,108,108,32,116,104,101,32,99,97,99,104, - 101,32,111,102,32,112,111,116,101,110,116,105,97,108,32,109, - 111,100,117,108,101,115,32,97,110,100,32,112,97,99,107,97, - 103,101,115,32,102,111,114,32,116,104,105,115,32,100,105,114, - 101,99,116,111,114,121,46,114,0,0,0,0,114,63,0,0, - 0,122,5,123,125,46,123,125,99,1,0,0,0,0,0,0, - 0,2,0,0,0,4,0,0,0,83,0,0,0,115,20,0, - 0,0,104,0,124,0,93,12,125,1,124,1,160,0,161,0, - 146,2,113,4,83,0,114,2,0,0,0,41,1,114,97,0, - 0,0,41,2,114,27,0,0,0,90,2,102,110,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,9,60,115, - 101,116,99,111,109,112,62,202,5,0,0,115,4,0,0,0, - 6,0,2,0,122,41,70,105,108,101,70,105,110,100,101,114, - 46,95,102,105,108,108,95,99,97,99,104,101,46,60,108,111, - 99,97,108,115,62,46,60,115,101,116,99,111,109,112,62,78, - 41,18,114,39,0,0,0,114,1,0,0,0,114,232,0,0, - 0,114,49,0,0,0,114,229,0,0,0,218,15,80,101,114, - 109,105,115,115,105,111,110,69,114,114,111,114,218,18,78,111, - 116,65,68,105,114,101,99,116,111,114,121,69,114,114,111,114, - 114,6,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 27,1,0,0,114,28,1,0,0,114,92,0,0,0,114,54, - 0,0,0,114,97,0,0,0,218,3,97,100,100,114,9,0, - 0,0,114,29,1,0,0,41,9,114,108,0,0,0,114,39, - 0,0,0,114,233,0,0,0,90,21,108,111,119,101,114,95, - 115,117,102,102,105,120,95,99,111,110,116,101,110,116,115,114, - 6,1,0,0,114,106,0,0,0,114,253,0,0,0,114,241, - 0,0,0,90,8,110,101,119,95,110,97,109,101,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,31,1,0, - 0,173,5,0,0,115,34,0,0,0,0,2,6,1,2,1, - 22,1,20,3,10,3,12,1,12,7,6,1,8,1,16,1, - 4,1,18,2,4,1,12,1,6,1,12,1,122,22,70,105, - 108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,99, - 97,99,104,101,99,1,0,0,0,0,0,0,0,3,0,0, - 0,3,0,0,0,7,0,0,0,115,18,0,0,0,135,0, - 135,1,102,2,100,1,100,2,132,8,125,2,124,2,83,0, - 41,3,97,20,1,0,0,65,32,99,108,97,115,115,32,109, - 101,116,104,111,100,32,119,104,105,99,104,32,114,101,116,117, - 114,110,115,32,97,32,99,108,111,115,117,114,101,32,116,111, - 32,117,115,101,32,111,110,32,115,121,115,46,112,97,116,104, - 95,104,111,111,107,10,32,32,32,32,32,32,32,32,119,104, - 105,99,104,32,119,105,108,108,32,114,101,116,117,114,110,32, - 97,110,32,105,110,115,116,97,110,99,101,32,117,115,105,110, - 103,32,116,104,101,32,115,112,101,99,105,102,105,101,100,32, - 108,111,97,100,101,114,115,32,97,110,100,32,116,104,101,32, - 112,97,116,104,10,32,32,32,32,32,32,32,32,99,97,108, - 108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,117, - 114,101,46,10,10,32,32,32,32,32,32,32,32,73,102,32, - 116,104,101,32,112,97,116,104,32,99,97,108,108,101,100,32, - 111,110,32,116,104,101,32,99,108,111,115,117,114,101,32,105, - 115,32,110,111,116,32,97,32,100,105,114,101,99,116,111,114, - 121,44,32,73,109,112,111,114,116,69,114,114,111,114,32,105, - 115,10,32,32,32,32,32,32,32,32,114,97,105,115,101,100, - 46,10,10,32,32,32,32,32,32,32,32,99,1,0,0,0, - 0,0,0,0,1,0,0,0,4,0,0,0,19,0,0,0, - 115,34,0,0,0,116,0,124,0,131,1,115,20,116,1,100, - 1,124,0,100,2,141,2,130,1,136,0,124,0,102,1,136, - 1,158,2,142,0,83,0,41,3,122,45,80,97,116,104,32, - 104,111,111,107,32,102,111,114,32,105,109,112,111,114,116,108, - 105,98,46,109,97,99,104,105,110,101,114,121,46,70,105,108, - 101,70,105,110,100,101,114,46,122,30,111,110,108,121,32,100, - 105,114,101,99,116,111,114,105,101,115,32,97,114,101,32,115, - 117,112,112,111,114,116,101,100,41,1,114,39,0,0,0,41, - 2,114,50,0,0,0,114,107,0,0,0,41,1,114,39,0, - 0,0,41,2,114,177,0,0,0,114,30,1,0,0,114,2, - 0,0,0,114,4,0,0,0,218,24,112,97,116,104,95,104, - 111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,100, - 101,114,214,5,0,0,115,6,0,0,0,0,2,8,1,12, - 1,122,54,70,105,108,101,70,105,110,100,101,114,46,112,97, - 116,104,95,104,111,111,107,46,60,108,111,99,97,108,115,62, - 46,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, - 105,108,101,70,105,110,100,101,114,114,2,0,0,0,41,3, - 114,177,0,0,0,114,30,1,0,0,114,36,1,0,0,114, - 2,0,0,0,41,2,114,177,0,0,0,114,30,1,0,0, - 114,4,0,0,0,218,9,112,97,116,104,95,104,111,111,107, - 204,5,0,0,115,4,0,0,0,0,10,14,6,122,20,70, - 105,108,101,70,105,110,100,101,114,46,112,97,116,104,95,104, - 111,111,107,99,1,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,67,0,0,0,115,12,0,0,0,100,1,160, - 0,124,0,106,1,161,1,83,0,41,2,78,122,16,70,105, - 108,101,70,105,110,100,101,114,40,123,33,114,125,41,41,2, - 114,54,0,0,0,114,39,0,0,0,41,1,114,108,0,0, + 114,187,0,0,0,126,5,0,0,115,74,0,0,0,0,5, + 4,1,14,1,2,1,24,1,14,1,10,1,10,1,8,1, + 6,2,6,1,6,1,10,2,6,1,4,2,8,1,12,1, + 14,1,8,1,10,1,8,1,26,4,8,2,14,1,16,1, + 16,1,14,1,10,1,10,1,2,0,2,255,10,2,6,1, + 12,1,12,1,8,1,4,1,122,20,70,105,108,101,70,105, + 110,100,101,114,46,102,105,110,100,95,115,112,101,99,99,1, + 0,0,0,0,0,0,0,9,0,0,0,10,0,0,0,67, + 0,0,0,115,190,0,0,0,124,0,106,0,125,1,122,22, + 116,1,160,2,124,1,112,22,116,1,160,3,161,0,161,1, + 125,2,87,0,110,30,4,0,116,4,116,5,116,6,102,3, + 107,10,114,58,1,0,1,0,1,0,103,0,125,2,89,0, + 110,2,88,0,116,7,106,8,160,9,100,1,161,1,115,84, + 116,10,124,2,131,1,124,0,95,11,110,74,116,10,131,0, + 125,3,124,2,68,0,93,56,125,4,124,4,160,12,100,2, + 161,1,92,3,125,5,125,6,125,7,124,6,114,136,100,3, + 160,13,124,5,124,7,160,14,161,0,161,2,125,8,110,4, + 124,5,125,8,124,3,160,15,124,8,161,1,1,0,113,94, + 124,3,124,0,95,11,116,7,106,8,160,9,116,16,161,1, + 114,186,100,4,100,5,132,0,124,2,68,0,131,1,124,0, + 95,17,100,6,83,0,41,7,122,68,70,105,108,108,32,116, + 104,101,32,99,97,99,104,101,32,111,102,32,112,111,116,101, + 110,116,105,97,108,32,109,111,100,117,108,101,115,32,97,110, + 100,32,112,97,99,107,97,103,101,115,32,102,111,114,32,116, + 104,105,115,32,100,105,114,101,99,116,111,114,121,46,114,0, + 0,0,0,114,63,0,0,0,122,5,123,125,46,123,125,99, + 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, + 83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,125, + 1,124,1,160,0,161,0,146,2,113,4,83,0,114,2,0, + 0,0,41,1,114,97,0,0,0,41,2,114,27,0,0,0, + 90,2,102,110,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,9,60,115,101,116,99,111,109,112,62,203,5, + 0,0,115,4,0,0,0,6,0,2,0,122,41,70,105,108, + 101,70,105,110,100,101,114,46,95,102,105,108,108,95,99,97, + 99,104,101,46,60,108,111,99,97,108,115,62,46,60,115,101, + 116,99,111,109,112,62,78,41,18,114,39,0,0,0,114,1, + 0,0,0,114,232,0,0,0,114,49,0,0,0,114,229,0, + 0,0,218,15,80,101,114,109,105,115,115,105,111,110,69,114, + 114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,111, + 114,121,69,114,114,111,114,114,6,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,27,1,0,0,114,28,1,0,0, + 114,92,0,0,0,114,54,0,0,0,114,97,0,0,0,218, + 3,97,100,100,114,9,0,0,0,114,29,1,0,0,41,9, + 114,108,0,0,0,114,39,0,0,0,114,233,0,0,0,90, + 21,108,111,119,101,114,95,115,117,102,102,105,120,95,99,111, + 110,116,101,110,116,115,114,6,1,0,0,114,106,0,0,0, + 114,253,0,0,0,114,241,0,0,0,90,8,110,101,119,95, + 110,97,109,101,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,31,1,0,0,174,5,0,0,115,34,0,0, + 0,0,2,6,1,2,1,22,1,20,3,10,3,12,1,12, + 7,6,1,8,1,16,1,4,1,18,2,4,1,12,1,6, + 1,12,1,122,22,70,105,108,101,70,105,110,100,101,114,46, + 95,102,105,108,108,95,99,97,99,104,101,99,1,0,0,0, + 0,0,0,0,3,0,0,0,3,0,0,0,7,0,0,0, + 115,18,0,0,0,135,0,135,1,102,2,100,1,100,2,132, + 8,125,2,124,2,83,0,41,3,97,20,1,0,0,65,32, + 99,108,97,115,115,32,109,101,116,104,111,100,32,119,104,105, + 99,104,32,114,101,116,117,114,110,115,32,97,32,99,108,111, + 115,117,114,101,32,116,111,32,117,115,101,32,111,110,32,115, + 121,115,46,112,97,116,104,95,104,111,111,107,10,32,32,32, + 32,32,32,32,32,119,104,105,99,104,32,119,105,108,108,32, + 114,101,116,117,114,110,32,97,110,32,105,110,115,116,97,110, + 99,101,32,117,115,105,110,103,32,116,104,101,32,115,112,101, + 99,105,102,105,101,100,32,108,111,97,100,101,114,115,32,97, + 110,100,32,116,104,101,32,112,97,116,104,10,32,32,32,32, + 32,32,32,32,99,97,108,108,101,100,32,111,110,32,116,104, + 101,32,99,108,111,115,117,114,101,46,10,10,32,32,32,32, + 32,32,32,32,73,102,32,116,104,101,32,112,97,116,104,32, + 99,97,108,108,101,100,32,111,110,32,116,104,101,32,99,108, + 111,115,117,114,101,32,105,115,32,110,111,116,32,97,32,100, + 105,114,101,99,116,111,114,121,44,32,73,109,112,111,114,116, + 69,114,114,111,114,32,105,115,10,32,32,32,32,32,32,32, + 32,114,97,105,115,101,100,46,10,10,32,32,32,32,32,32, + 32,32,99,1,0,0,0,0,0,0,0,1,0,0,0,4, + 0,0,0,19,0,0,0,115,34,0,0,0,116,0,124,0, + 131,1,115,20,116,1,100,1,124,0,100,2,141,2,130,1, + 136,0,124,0,102,1,136,1,158,2,142,0,83,0,41,3, + 122,45,80,97,116,104,32,104,111,111,107,32,102,111,114,32, + 105,109,112,111,114,116,108,105,98,46,109,97,99,104,105,110, + 101,114,121,46,70,105,108,101,70,105,110,100,101,114,46,122, + 30,111,110,108,121,32,100,105,114,101,99,116,111,114,105,101, + 115,32,97,114,101,32,115,117,112,112,111,114,116,101,100,41, + 1,114,39,0,0,0,41,2,114,50,0,0,0,114,107,0, + 0,0,41,1,114,39,0,0,0,41,2,114,177,0,0,0, + 114,30,1,0,0,114,2,0,0,0,114,4,0,0,0,218, + 24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, + 105,108,101,70,105,110,100,101,114,215,5,0,0,115,6,0, + 0,0,0,2,8,1,12,1,122,54,70,105,108,101,70,105, + 110,100,101,114,46,112,97,116,104,95,104,111,111,107,46,60, + 108,111,99,97,108,115,62,46,112,97,116,104,95,104,111,111, + 107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,114, + 114,2,0,0,0,41,3,114,177,0,0,0,114,30,1,0, + 0,114,36,1,0,0,114,2,0,0,0,41,2,114,177,0, + 0,0,114,30,1,0,0,114,4,0,0,0,218,9,112,97, + 116,104,95,104,111,111,107,205,5,0,0,115,4,0,0,0, + 0,10,14,6,122,20,70,105,108,101,70,105,110,100,101,114, + 46,112,97,116,104,95,104,111,111,107,99,1,0,0,0,0, + 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, + 12,0,0,0,100,1,160,0,124,0,106,1,161,1,83,0, + 41,2,78,122,16,70,105,108,101,70,105,110,100,101,114,40, + 123,33,114,125,41,41,2,114,54,0,0,0,114,39,0,0, + 0,41,1,114,108,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,5,1,0,0,223,5,0,0, + 115,2,0,0,0,0,1,122,19,70,105,108,101,70,105,110, + 100,101,114,46,95,95,114,101,112,114,95,95,41,1,78,41, + 15,114,113,0,0,0,114,112,0,0,0,114,114,0,0,0, + 114,115,0,0,0,114,191,0,0,0,114,11,1,0,0,114, + 131,0,0,0,114,188,0,0,0,114,125,0,0,0,114,23, + 1,0,0,114,187,0,0,0,114,31,1,0,0,114,189,0, + 0,0,114,37,1,0,0,114,5,1,0,0,114,2,0,0, 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,5,1,0,0,222,5,0,0,115,2,0,0,0,0,1, - 122,19,70,105,108,101,70,105,110,100,101,114,46,95,95,114, - 101,112,114,95,95,41,1,78,41,15,114,113,0,0,0,114, - 112,0,0,0,114,114,0,0,0,114,115,0,0,0,114,191, - 0,0,0,114,11,1,0,0,114,131,0,0,0,114,188,0, - 0,0,114,125,0,0,0,114,23,1,0,0,114,187,0,0, - 0,114,31,1,0,0,114,189,0,0,0,114,37,1,0,0, - 114,5,1,0,0,114,2,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,24,1,0,0,79,5, - 0,0,115,20,0,0,0,8,7,4,2,8,14,8,4,4, - 2,8,12,8,5,10,48,8,31,12,18,114,24,1,0,0, - 99,4,0,0,0,0,0,0,0,6,0,0,0,8,0,0, - 0,67,0,0,0,115,146,0,0,0,124,0,160,0,100,1, - 161,1,125,4,124,0,160,0,100,2,161,1,125,5,124,4, - 115,66,124,5,114,36,124,5,106,1,125,4,110,30,124,2, - 124,3,107,2,114,56,116,2,124,1,124,2,131,2,125,4, - 110,10,116,3,124,1,124,2,131,2,125,4,124,5,115,84, - 116,4,124,1,124,2,124,4,100,3,141,3,125,5,122,36, - 124,5,124,0,100,2,60,0,124,4,124,0,100,1,60,0, - 124,2,124,0,100,4,60,0,124,3,124,0,100,5,60,0, - 87,0,110,20,4,0,116,5,107,10,114,140,1,0,1,0, - 1,0,89,0,110,2,88,0,100,0,83,0,41,6,78,218, - 10,95,95,108,111,97,100,101,114,95,95,218,8,95,95,115, - 112,101,99,95,95,41,1,114,128,0,0,0,90,8,95,95, - 102,105,108,101,95,95,90,10,95,95,99,97,99,104,101,100, - 95,95,41,6,218,3,103,101,116,114,128,0,0,0,114,239, - 0,0,0,114,234,0,0,0,114,174,0,0,0,218,9,69, - 120,99,101,112,116,105,111,110,41,6,90,2,110,115,114,106, - 0,0,0,90,8,112,97,116,104,110,97,109,101,90,9,99, - 112,97,116,104,110,97,109,101,114,128,0,0,0,114,171,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,218,14,95,102,105,120,95,117,112,95,109,111,100,117,108, - 101,228,5,0,0,115,34,0,0,0,0,2,10,1,10,1, - 4,1,4,1,8,1,8,1,12,2,10,1,4,1,14,1, - 2,1,8,1,8,1,8,1,12,1,14,2,114,42,1,0, - 0,99,0,0,0,0,0,0,0,0,3,0,0,0,3,0, - 0,0,67,0,0,0,115,38,0,0,0,116,0,116,1,160, - 2,161,0,102,2,125,0,116,3,116,4,102,2,125,1,116, - 5,116,6,102,2,125,2,124,0,124,1,124,2,103,3,83, - 0,41,1,122,95,82,101,116,117,114,110,115,32,97,32,108, - 105,115,116,32,111,102,32,102,105,108,101,45,98,97,115,101, - 100,32,109,111,100,117,108,101,32,108,111,97,100,101,114,115, - 46,10,10,32,32,32,32,69,97,99,104,32,105,116,101,109, - 32,105,115,32,97,32,116,117,112,108,101,32,40,108,111,97, - 100,101,114,44,32,115,117,102,102,105,120,101,115,41,46,10, - 32,32,32,32,41,7,114,240,0,0,0,114,149,0,0,0, - 218,18,101,120,116,101,110,115,105,111,110,95,115,117,102,102, - 105,120,101,115,114,234,0,0,0,114,93,0,0,0,114,239, - 0,0,0,114,80,0,0,0,41,3,90,10,101,120,116,101, - 110,115,105,111,110,115,90,6,115,111,117,114,99,101,90,8, - 98,121,116,101,99,111,100,101,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,168,0,0,0,251,5,0,0, - 115,8,0,0,0,0,5,12,1,8,1,8,1,114,168,0, - 0,0,99,1,0,0,0,0,0,0,0,12,0,0,0,9, - 0,0,0,67,0,0,0,115,178,1,0,0,124,0,97,0, - 116,0,106,1,97,1,116,0,106,2,97,2,116,1,106,3, - 116,4,25,0,125,1,100,1,68,0,93,48,125,2,124,2, - 116,1,106,3,107,7,114,56,116,0,160,5,124,2,161,1, - 125,3,110,10,116,1,106,3,124,2,25,0,125,3,116,6, - 124,1,124,2,124,3,131,3,1,0,113,30,100,2,100,3, - 103,1,102,2,100,4,100,5,100,3,103,2,102,2,102,2, - 125,4,124,4,68,0,93,110,92,2,125,5,125,6,116,7, - 100,6,100,7,132,0,124,6,68,0,131,1,131,1,115,136, - 116,8,130,1,124,6,100,8,25,0,125,7,124,5,116,1, - 106,3,107,6,114,170,116,1,106,3,124,5,25,0,125,8, - 1,0,113,226,113,106,122,20,116,0,160,5,124,5,161,1, - 125,8,87,0,1,0,113,226,87,0,113,106,4,0,116,9, - 107,10,114,214,1,0,1,0,1,0,89,0,113,106,89,0, - 113,106,88,0,113,106,116,9,100,9,131,1,130,1,116,6, - 124,1,100,10,124,8,131,3,1,0,116,6,124,1,100,11, - 124,7,131,3,1,0,116,6,124,1,100,12,100,13,160,10, - 124,6,161,1,131,3,1,0,116,6,124,1,100,14,100,15, - 100,16,132,0,124,6,68,0,131,1,131,3,1,0,116,0, - 160,5,100,17,161,1,125,9,116,6,124,1,100,17,124,9, - 131,3,1,0,116,0,160,5,100,18,161,1,125,10,116,6, - 124,1,100,18,124,10,131,3,1,0,124,5,100,4,107,2, - 144,1,114,110,116,0,160,5,100,19,161,1,125,11,116,6, - 124,1,100,20,124,11,131,3,1,0,116,6,124,1,100,21, - 116,11,131,0,131,3,1,0,116,12,160,13,116,2,160,14, - 161,0,161,1,1,0,124,5,100,4,107,2,144,1,114,174, - 116,15,160,16,100,22,161,1,1,0,100,23,116,12,107,6, - 144,1,114,174,100,24,116,17,95,18,100,25,83,0,41,26, - 122,205,83,101,116,117,112,32,116,104,101,32,112,97,116,104, - 45,98,97,115,101,100,32,105,109,112,111,114,116,101,114,115, - 32,102,111,114,32,105,109,112,111,114,116,108,105,98,32,98, - 121,32,105,109,112,111,114,116,105,110,103,32,110,101,101,100, - 101,100,10,32,32,32,32,98,117,105,108,116,45,105,110,32, - 109,111,100,117,108,101,115,32,97,110,100,32,105,110,106,101, - 99,116,105,110,103,32,116,104,101,109,32,105,110,116,111,32, - 116,104,101,32,103,108,111,98,97,108,32,110,97,109,101,115, - 112,97,99,101,46,10,10,32,32,32,32,79,116,104,101,114, - 32,99,111,109,112,111,110,101,110,116,115,32,97,114,101,32, - 101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,116, - 104,101,32,99,111,114,101,32,98,111,111,116,115,116,114,97, - 112,32,109,111,100,117,108,101,46,10,10,32,32,32,32,41, - 4,114,56,0,0,0,114,66,0,0,0,218,8,98,117,105, - 108,116,105,110,115,114,146,0,0,0,90,5,112,111,115,105, - 120,250,1,47,90,2,110,116,250,1,92,99,1,0,0,0, - 0,0,0,0,2,0,0,0,3,0,0,0,115,0,0,0, - 115,26,0,0,0,124,0,93,18,125,1,116,0,124,1,131, - 1,100,0,107,2,86,0,1,0,113,2,100,1,83,0,41, - 2,114,34,0,0,0,78,41,1,114,18,0,0,0,41,2, - 114,27,0,0,0,114,86,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,243,0,0,0,31,6, - 0,0,115,4,0,0,0,4,0,2,0,122,25,95,115,101, - 116,117,112,46,60,108,111,99,97,108,115,62,46,60,103,101, - 110,101,120,112,114,62,114,64,0,0,0,122,30,105,109,112, - 111,114,116,108,105,98,32,114,101,113,117,105,114,101,115,32, - 112,111,115,105,120,32,111,114,32,110,116,114,1,0,0,0, - 114,30,0,0,0,114,26,0,0,0,114,35,0,0,0,114, - 52,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, - 0,4,0,0,0,83,0,0,0,115,22,0,0,0,104,0, - 124,0,93,14,125,1,100,0,124,1,155,0,157,2,146,2, - 113,4,83,0,41,1,114,65,0,0,0,114,2,0,0,0, - 41,2,114,27,0,0,0,218,1,115,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,32,1,0,0,47,6, - 0,0,115,4,0,0,0,6,0,2,0,122,25,95,115,101, - 116,117,112,46,60,108,111,99,97,108,115,62,46,60,115,101, - 116,99,111,109,112,62,90,7,95,116,104,114,101,97,100,90, - 8,95,119,101,97,107,114,101,102,90,6,119,105,110,114,101, - 103,114,176,0,0,0,114,5,0,0,0,122,4,46,112,121, - 119,122,6,95,100,46,112,121,100,84,78,41,19,114,122,0, - 0,0,114,6,0,0,0,114,149,0,0,0,114,255,0,0, - 0,114,113,0,0,0,90,18,95,98,117,105,108,116,105,110, - 95,102,114,111,109,95,110,97,109,101,114,117,0,0,0,218, - 3,97,108,108,114,19,0,0,0,114,107,0,0,0,114,31, - 0,0,0,114,11,0,0,0,114,245,0,0,0,114,153,0, - 0,0,114,43,1,0,0,114,93,0,0,0,114,170,0,0, - 0,114,175,0,0,0,114,179,0,0,0,41,12,218,17,95, - 98,111,111,116,115,116,114,97,112,95,109,111,100,117,108,101, - 90,11,115,101,108,102,95,109,111,100,117,108,101,90,12,98, - 117,105,108,116,105,110,95,110,97,109,101,90,14,98,117,105, - 108,116,105,110,95,109,111,100,117,108,101,90,10,111,115,95, - 100,101,116,97,105,108,115,90,10,98,117,105,108,116,105,110, - 95,111,115,114,26,0,0,0,114,30,0,0,0,90,9,111, - 115,95,109,111,100,117,108,101,90,13,116,104,114,101,97,100, - 95,109,111,100,117,108,101,90,14,119,101,97,107,114,101,102, - 95,109,111,100,117,108,101,90,13,119,105,110,114,101,103,95, - 109,111,100,117,108,101,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,6,95,115,101,116,117,112,6,6,0, - 0,115,78,0,0,0,0,8,4,1,6,1,6,3,10,1, - 8,1,10,1,12,2,10,1,14,3,22,1,12,2,22,1, - 8,1,10,1,10,1,6,2,2,1,10,1,10,1,14,1, - 12,2,8,1,12,1,12,1,18,1,22,3,10,1,12,3, - 10,1,12,3,10,1,10,1,12,3,14,1,14,1,10,1, - 10,1,10,1,114,50,1,0,0,99,1,0,0,0,0,0, - 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,50, - 0,0,0,116,0,124,0,131,1,1,0,116,1,131,0,125, - 1,116,2,106,3,160,4,116,5,106,6,124,1,142,0,103, - 1,161,1,1,0,116,2,106,7,160,8,116,9,161,1,1, - 0,100,1,83,0,41,2,122,41,73,110,115,116,97,108,108, - 32,116,104,101,32,112,97,116,104,45,98,97,115,101,100,32, - 105,109,112,111,114,116,32,99,111,109,112,111,110,101,110,116, - 115,46,78,41,10,114,50,1,0,0,114,168,0,0,0,114, - 6,0,0,0,114,16,1,0,0,114,153,0,0,0,114,24, - 1,0,0,114,37,1,0,0,218,9,109,101,116,97,95,112, - 97,116,104,114,170,0,0,0,114,10,1,0,0,41,2,114, - 49,1,0,0,90,17,115,117,112,112,111,114,116,101,100,95, - 108,111,97,100,101,114,115,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,8,95,105,110,115,116,97,108,108, - 71,6,0,0,115,8,0,0,0,0,2,8,1,6,1,20, - 1,114,52,1,0,0,41,63,114,115,0,0,0,114,10,0, - 0,0,90,37,95,67,65,83,69,95,73,78,83,69,78,83, - 73,84,73,86,69,95,80,76,65,84,70,79,82,77,83,95, - 66,89,84,69,83,95,75,69,89,114,9,0,0,0,114,11, - 0,0,0,114,17,0,0,0,114,22,0,0,0,114,24,0, - 0,0,114,33,0,0,0,114,42,0,0,0,114,43,0,0, - 0,114,47,0,0,0,114,48,0,0,0,114,50,0,0,0, - 114,53,0,0,0,114,61,0,0,0,218,4,116,121,112,101, - 218,8,95,95,99,111,100,101,95,95,114,148,0,0,0,114, - 15,0,0,0,114,135,0,0,0,114,14,0,0,0,114,20, - 0,0,0,114,214,0,0,0,114,83,0,0,0,114,79,0, - 0,0,114,93,0,0,0,114,80,0,0,0,90,23,68,69, - 66,85,71,95,66,89,84,69,67,79,68,69,95,83,85,70, - 70,73,88,69,83,90,27,79,80,84,73,77,73,90,69,68, - 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, - 69,83,114,89,0,0,0,114,94,0,0,0,114,100,0,0, - 0,114,103,0,0,0,114,105,0,0,0,114,124,0,0,0, - 114,131,0,0,0,114,139,0,0,0,114,143,0,0,0,114, - 145,0,0,0,114,151,0,0,0,114,156,0,0,0,114,157, - 0,0,0,114,162,0,0,0,218,6,111,98,106,101,99,116, - 114,169,0,0,0,114,174,0,0,0,114,175,0,0,0,114, - 190,0,0,0,114,200,0,0,0,114,217,0,0,0,114,234, - 0,0,0,114,239,0,0,0,114,245,0,0,0,114,240,0, - 0,0,114,246,0,0,0,114,8,1,0,0,114,10,1,0, - 0,114,24,1,0,0,114,42,1,0,0,114,168,0,0,0, - 114,50,1,0,0,114,52,1,0,0,114,2,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,8, - 60,109,111,100,117,108,101,62,8,0,0,0,115,126,0,0, - 0,4,15,4,1,4,1,2,1,2,255,4,4,8,17,8, - 5,8,5,8,6,8,6,8,12,8,10,8,9,8,5,8, - 7,8,9,12,22,10,127,0,7,16,1,12,2,4,1,4, - 2,6,2,6,2,8,2,18,71,8,40,8,19,8,12,8, - 12,8,28,8,17,8,33,8,28,8,24,16,13,14,10,12, - 11,8,14,6,3,6,1,2,255,12,68,14,64,14,29,16, - 127,0,17,14,68,18,45,18,26,4,3,18,53,14,60,14, - 42,14,127,0,7,14,127,0,22,12,23,8,11,8,65, + 114,24,1,0,0,80,5,0,0,115,20,0,0,0,8,7, + 4,2,8,14,8,4,4,2,8,12,8,5,10,48,8,31, + 12,18,114,24,1,0,0,99,4,0,0,0,0,0,0,0, + 6,0,0,0,8,0,0,0,67,0,0,0,115,146,0,0, + 0,124,0,160,0,100,1,161,1,125,4,124,0,160,0,100, + 2,161,1,125,5,124,4,115,66,124,5,114,36,124,5,106, + 1,125,4,110,30,124,2,124,3,107,2,114,56,116,2,124, + 1,124,2,131,2,125,4,110,10,116,3,124,1,124,2,131, + 2,125,4,124,5,115,84,116,4,124,1,124,2,124,4,100, + 3,141,3,125,5,122,36,124,5,124,0,100,2,60,0,124, + 4,124,0,100,1,60,0,124,2,124,0,100,4,60,0,124, + 3,124,0,100,5,60,0,87,0,110,20,4,0,116,5,107, + 10,114,140,1,0,1,0,1,0,89,0,110,2,88,0,100, + 0,83,0,41,6,78,218,10,95,95,108,111,97,100,101,114, + 95,95,218,8,95,95,115,112,101,99,95,95,41,1,114,128, + 0,0,0,90,8,95,95,102,105,108,101,95,95,90,10,95, + 95,99,97,99,104,101,100,95,95,41,6,218,3,103,101,116, + 114,128,0,0,0,114,239,0,0,0,114,234,0,0,0,114, + 174,0,0,0,218,9,69,120,99,101,112,116,105,111,110,41, + 6,90,2,110,115,114,106,0,0,0,90,8,112,97,116,104, + 110,97,109,101,90,9,99,112,97,116,104,110,97,109,101,114, + 128,0,0,0,114,171,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,218,14,95,102,105,120,95,117, + 112,95,109,111,100,117,108,101,229,5,0,0,115,34,0,0, + 0,0,2,10,1,10,1,4,1,4,1,8,1,8,1,12, + 2,10,1,4,1,14,1,2,1,8,1,8,1,8,1,12, + 1,14,2,114,42,1,0,0,99,0,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0, + 0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,3, + 116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,0, + 124,1,124,2,103,3,83,0,41,1,122,95,82,101,116,117, + 114,110,115,32,97,32,108,105,115,116,32,111,102,32,102,105, + 108,101,45,98,97,115,101,100,32,109,111,100,117,108,101,32, + 108,111,97,100,101,114,115,46,10,10,32,32,32,32,69,97, + 99,104,32,105,116,101,109,32,105,115,32,97,32,116,117,112, + 108,101,32,40,108,111,97,100,101,114,44,32,115,117,102,102, + 105,120,101,115,41,46,10,32,32,32,32,41,7,114,240,0, + 0,0,114,149,0,0,0,218,18,101,120,116,101,110,115,105, + 111,110,95,115,117,102,102,105,120,101,115,114,234,0,0,0, + 114,93,0,0,0,114,239,0,0,0,114,80,0,0,0,41, + 3,90,10,101,120,116,101,110,115,105,111,110,115,90,6,115, + 111,117,114,99,101,90,8,98,121,116,101,99,111,100,101,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,168, + 0,0,0,252,5,0,0,115,8,0,0,0,0,5,12,1, + 8,1,8,1,114,168,0,0,0,99,1,0,0,0,0,0, + 0,0,12,0,0,0,9,0,0,0,67,0,0,0,115,178, + 1,0,0,124,0,97,0,116,0,106,1,97,1,116,0,106, + 2,97,2,116,1,106,3,116,4,25,0,125,1,100,1,68, + 0,93,48,125,2,124,2,116,1,106,3,107,7,114,56,116, + 0,160,5,124,2,161,1,125,3,110,10,116,1,106,3,124, + 2,25,0,125,3,116,6,124,1,124,2,124,3,131,3,1, + 0,113,30,100,2,100,3,103,1,102,2,100,4,100,5,100, + 3,103,2,102,2,102,2,125,4,124,4,68,0,93,110,92, + 2,125,5,125,6,116,7,100,6,100,7,132,0,124,6,68, + 0,131,1,131,1,115,136,116,8,130,1,124,6,100,8,25, + 0,125,7,124,5,116,1,106,3,107,6,114,170,116,1,106, + 3,124,5,25,0,125,8,1,0,113,226,113,106,122,20,116, + 0,160,5,124,5,161,1,125,8,87,0,1,0,113,226,87, + 0,113,106,4,0,116,9,107,10,114,214,1,0,1,0,1, + 0,89,0,113,106,89,0,113,106,88,0,113,106,116,9,100, + 9,131,1,130,1,116,6,124,1,100,10,124,8,131,3,1, + 0,116,6,124,1,100,11,124,7,131,3,1,0,116,6,124, + 1,100,12,100,13,160,10,124,6,161,1,131,3,1,0,116, + 6,124,1,100,14,100,15,100,16,132,0,124,6,68,0,131, + 1,131,3,1,0,116,0,160,5,100,17,161,1,125,9,116, + 6,124,1,100,17,124,9,131,3,1,0,116,0,160,5,100, + 18,161,1,125,10,116,6,124,1,100,18,124,10,131,3,1, + 0,124,5,100,4,107,2,144,1,114,110,116,0,160,5,100, + 19,161,1,125,11,116,6,124,1,100,20,124,11,131,3,1, + 0,116,6,124,1,100,21,116,11,131,0,131,3,1,0,116, + 12,160,13,116,2,160,14,161,0,161,1,1,0,124,5,100, + 4,107,2,144,1,114,174,116,15,160,16,100,22,161,1,1, + 0,100,23,116,12,107,6,144,1,114,174,100,24,116,17,95, + 18,100,25,83,0,41,26,122,205,83,101,116,117,112,32,116, + 104,101,32,112,97,116,104,45,98,97,115,101,100,32,105,109, + 112,111,114,116,101,114,115,32,102,111,114,32,105,109,112,111, + 114,116,108,105,98,32,98,121,32,105,109,112,111,114,116,105, + 110,103,32,110,101,101,100,101,100,10,32,32,32,32,98,117, + 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97, + 110,100,32,105,110,106,101,99,116,105,110,103,32,116,104,101, + 109,32,105,110,116,111,32,116,104,101,32,103,108,111,98,97, + 108,32,110,97,109,101,115,112,97,99,101,46,10,10,32,32, + 32,32,79,116,104,101,114,32,99,111,109,112,111,110,101,110, + 116,115,32,97,114,101,32,101,120,116,114,97,99,116,101,100, + 32,102,114,111,109,32,116,104,101,32,99,111,114,101,32,98, + 111,111,116,115,116,114,97,112,32,109,111,100,117,108,101,46, + 10,10,32,32,32,32,41,4,114,56,0,0,0,114,66,0, + 0,0,218,8,98,117,105,108,116,105,110,115,114,146,0,0, + 0,90,5,112,111,115,105,120,250,1,47,90,2,110,116,250, + 1,92,99,1,0,0,0,0,0,0,0,2,0,0,0,3, + 0,0,0,115,0,0,0,115,26,0,0,0,124,0,93,18, + 125,1,116,0,124,1,131,1,100,0,107,2,86,0,1,0, + 113,2,100,1,83,0,41,2,114,34,0,0,0,78,41,1, + 114,18,0,0,0,41,2,114,27,0,0,0,114,86,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,243,0,0,0,32,6,0,0,115,4,0,0,0,4,0, + 2,0,122,25,95,115,101,116,117,112,46,60,108,111,99,97, + 108,115,62,46,60,103,101,110,101,120,112,114,62,114,64,0, + 0,0,122,30,105,109,112,111,114,116,108,105,98,32,114,101, + 113,117,105,114,101,115,32,112,111,115,105,120,32,111,114,32, + 110,116,114,1,0,0,0,114,30,0,0,0,114,26,0,0, + 0,114,35,0,0,0,114,52,0,0,0,99,1,0,0,0, + 0,0,0,0,2,0,0,0,4,0,0,0,83,0,0,0, + 115,22,0,0,0,104,0,124,0,93,14,125,1,100,0,124, + 1,155,0,157,2,146,2,113,4,83,0,41,1,114,65,0, + 0,0,114,2,0,0,0,41,2,114,27,0,0,0,218,1, + 115,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,32,1,0,0,48,6,0,0,115,4,0,0,0,6,0, + 2,0,122,25,95,115,101,116,117,112,46,60,108,111,99,97, + 108,115,62,46,60,115,101,116,99,111,109,112,62,90,7,95, + 116,104,114,101,97,100,90,8,95,119,101,97,107,114,101,102, + 90,6,119,105,110,114,101,103,114,176,0,0,0,114,5,0, + 0,0,122,4,46,112,121,119,122,6,95,100,46,112,121,100, + 84,78,41,19,114,122,0,0,0,114,6,0,0,0,114,149, + 0,0,0,114,255,0,0,0,114,113,0,0,0,90,18,95, + 98,117,105,108,116,105,110,95,102,114,111,109,95,110,97,109, + 101,114,117,0,0,0,218,3,97,108,108,114,19,0,0,0, + 114,107,0,0,0,114,31,0,0,0,114,11,0,0,0,114, + 245,0,0,0,114,153,0,0,0,114,43,1,0,0,114,93, + 0,0,0,114,170,0,0,0,114,175,0,0,0,114,179,0, + 0,0,41,12,218,17,95,98,111,111,116,115,116,114,97,112, + 95,109,111,100,117,108,101,90,11,115,101,108,102,95,109,111, + 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, + 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, + 108,101,90,10,111,115,95,100,101,116,97,105,108,115,90,10, + 98,117,105,108,116,105,110,95,111,115,114,26,0,0,0,114, + 30,0,0,0,90,9,111,115,95,109,111,100,117,108,101,90, + 13,116,104,114,101,97,100,95,109,111,100,117,108,101,90,14, + 119,101,97,107,114,101,102,95,109,111,100,117,108,101,90,13, + 119,105,110,114,101,103,95,109,111,100,117,108,101,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,6,95,115, + 101,116,117,112,7,6,0,0,115,78,0,0,0,0,8,4, + 1,6,1,6,3,10,1,8,1,10,1,12,2,10,1,14, + 3,22,1,12,2,22,1,8,1,10,1,10,1,6,2,2, + 1,10,1,10,1,14,1,12,2,8,1,12,1,12,1,18, + 1,22,3,10,1,12,3,10,1,12,3,10,1,10,1,12, + 3,14,1,14,1,10,1,10,1,10,1,114,50,1,0,0, + 99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0, + 0,67,0,0,0,115,50,0,0,0,116,0,124,0,131,1, + 1,0,116,1,131,0,125,1,116,2,106,3,160,4,116,5, + 106,6,124,1,142,0,103,1,161,1,1,0,116,2,106,7, + 160,8,116,9,161,1,1,0,100,1,83,0,41,2,122,41, + 73,110,115,116,97,108,108,32,116,104,101,32,112,97,116,104, + 45,98,97,115,101,100,32,105,109,112,111,114,116,32,99,111, + 109,112,111,110,101,110,116,115,46,78,41,10,114,50,1,0, + 0,114,168,0,0,0,114,6,0,0,0,114,16,1,0,0, + 114,153,0,0,0,114,24,1,0,0,114,37,1,0,0,218, + 9,109,101,116,97,95,112,97,116,104,114,170,0,0,0,114, + 10,1,0,0,41,2,114,49,1,0,0,90,17,115,117,112, + 112,111,114,116,101,100,95,108,111,97,100,101,114,115,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,8,95, + 105,110,115,116,97,108,108,72,6,0,0,115,8,0,0,0, + 0,2,8,1,6,1,20,1,114,52,1,0,0,41,63,114, + 115,0,0,0,114,10,0,0,0,90,37,95,67,65,83,69, + 95,73,78,83,69,78,83,73,84,73,86,69,95,80,76,65, + 84,70,79,82,77,83,95,66,89,84,69,83,95,75,69,89, + 114,9,0,0,0,114,11,0,0,0,114,17,0,0,0,114, + 22,0,0,0,114,24,0,0,0,114,33,0,0,0,114,42, + 0,0,0,114,43,0,0,0,114,47,0,0,0,114,48,0, + 0,0,114,50,0,0,0,114,53,0,0,0,114,61,0,0, + 0,218,4,116,121,112,101,218,8,95,95,99,111,100,101,95, + 95,114,148,0,0,0,114,15,0,0,0,114,135,0,0,0, + 114,14,0,0,0,114,20,0,0,0,114,214,0,0,0,114, + 83,0,0,0,114,79,0,0,0,114,93,0,0,0,114,80, + 0,0,0,90,23,68,69,66,85,71,95,66,89,84,69,67, + 79,68,69,95,83,85,70,70,73,88,69,83,90,27,79,80, + 84,73,77,73,90,69,68,95,66,89,84,69,67,79,68,69, + 95,83,85,70,70,73,88,69,83,114,89,0,0,0,114,94, + 0,0,0,114,100,0,0,0,114,103,0,0,0,114,105,0, + 0,0,114,124,0,0,0,114,131,0,0,0,114,139,0,0, + 0,114,143,0,0,0,114,145,0,0,0,114,151,0,0,0, + 114,156,0,0,0,114,157,0,0,0,114,162,0,0,0,218, + 6,111,98,106,101,99,116,114,169,0,0,0,114,174,0,0, + 0,114,175,0,0,0,114,190,0,0,0,114,200,0,0,0, + 114,217,0,0,0,114,234,0,0,0,114,239,0,0,0,114, + 245,0,0,0,114,240,0,0,0,114,246,0,0,0,114,8, + 1,0,0,114,10,1,0,0,114,24,1,0,0,114,42,1, + 0,0,114,168,0,0,0,114,50,1,0,0,114,52,1,0, + 0,114,2,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,218,8,60,109,111,100,117,108,101,62,8, + 0,0,0,115,126,0,0,0,4,15,4,1,4,1,2,1, + 2,255,4,4,8,17,8,5,8,5,8,6,8,6,8,12, + 8,10,8,9,8,5,8,7,8,9,12,22,10,127,0,7, + 16,1,12,2,4,1,4,2,6,2,6,2,8,2,18,71, + 8,40,8,19,8,12,8,12,8,28,8,17,8,33,8,28, + 8,24,16,13,14,10,12,11,8,14,6,3,6,1,2,255, + 12,68,14,64,14,29,16,127,0,18,14,68,18,45,18,26, + 4,3,18,53,14,60,14,42,14,127,0,7,14,127,0,22, + 12,23,8,11,8,65, }; From webhook-mailer at python.org Thu Oct 25 07:31:19 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 11:31:19 -0000 Subject: [Python-checkins] bpo-35053: Enhance tracemalloc to trace free lists (GH-10063) Message-ID: https://github.com/python/cpython/commit/9e00e80e213ebc37eff89ce72102c1f928ebc133 commit: 9e00e80e213ebc37eff89ce72102c1f928ebc133 branch: master author: Victor Stinner committer: GitHub date: 2018-10-25T13:31:16+02:00 summary: bpo-35053: Enhance tracemalloc to trace free lists (GH-10063) tracemalloc now tries to update the traceback when an object is reused from a "free list" (optimization for faster object creation, used by the builtin list type for example). Changes: * Add _PyTraceMalloc_NewReference() function which tries to update the Python traceback of a Python object. * _Py_NewReference() now calls _PyTraceMalloc_NewReference(). * Add an unit test. files: A Misc/NEWS.d/next/Library/2018-10-23-18-58-12.bpo-35053.G82qwh.rst M Include/object.h M Include/pymem.h M Lib/test/test_tracemalloc.py M Modules/_tracemalloc.c M Objects/object.c M Objects/obmalloc.c diff --git a/Include/object.h b/Include/object.h index bcf78afe6bbb..8cd57d21a40f 100644 --- a/Include/object.h +++ b/Include/object.h @@ -776,6 +776,9 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); * inline. */ #define _Py_NewReference(op) ( \ + (_Py_tracemalloc_config.tracing \ + ? _PyTraceMalloc_NewReference(op) \ + : 0), \ _Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \ _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ Py_REFCNT(op) = 1) diff --git a/Include/pymem.h b/Include/pymem.h index ef6e0bb5e25f..6299ab405a05 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -36,6 +36,10 @@ PyAPI_FUNC(int) PyTraceMalloc_Track( uintptr_t ptr, size_t size); +/* Update the Python traceback of an object. + This function can be used when a memory block is reused from a free list. */ +PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op); + /* Untrack an allocated memory block in the tracemalloc module. Do nothing if the block was not tracked. @@ -239,6 +243,40 @@ PyAPI_FUNC(int) _PyMem_SetDefaultAllocator( PyMemAllocatorEx *old_alloc); #endif + +/* bpo-35053: expose _Py_tracemalloc_config for performance: + _Py_NewReference() needs an efficient check to test if tracemalloc is + tracing. */ +struct _PyTraceMalloc_Config { + /* Module initialized? + Variable protected by the GIL */ + enum { + TRACEMALLOC_NOT_INITIALIZED, + TRACEMALLOC_INITIALIZED, + TRACEMALLOC_FINALIZED + } initialized; + + /* Is tracemalloc tracing memory allocations? + Variable protected by the GIL */ + int tracing; + + /* limit of the number of frames in a traceback, 1 by default. + Variable protected by the GIL. */ + int max_nframe; + + /* use domain in trace key? + Variable protected by the GIL. */ + int use_domain; +}; + +PyAPI_DATA(struct _PyTraceMalloc_Config) _Py_tracemalloc_config; + +#define _PyTraceMalloc_Config_INIT \ + {.initialized = TRACEMALLOC_NOT_INITIALIZED, \ + .tracing = 0, \ + .max_nframe = 1, \ + .use_domain = 0} + #ifdef __cplusplus } #endif diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index 76a6159c7aa4..c3866483b8aa 100644 --- a/Lib/test/test_tracemalloc.py +++ b/Lib/test/test_tracemalloc.py @@ -111,6 +111,26 @@ def test_get_object_traceback(self): traceback = tracemalloc.get_object_traceback(obj) self.assertEqual(traceback, obj_traceback) + def test_new_reference(self): + tracemalloc.clear_traces() + # gc.collect() indirectly calls PyList_ClearFreeList() + support.gc_collect() + + # Create a list and "destroy it": put it in the PyListObject free list + obj = [] + obj = None + + # Create a list which should reuse the previously created empty list + obj = [] + + nframe = tracemalloc.get_traceback_limit() + frames = get_frames(nframe, -3) + obj_traceback = tracemalloc.Traceback(frames) + + traceback = tracemalloc.get_object_traceback(obj) + self.assertIsNotNone(traceback) + self.assertEqual(traceback, obj_traceback) + def test_set_traceback_limit(self): obj_size = 10 diff --git a/Misc/NEWS.d/next/Library/2018-10-23-18-58-12.bpo-35053.G82qwh.rst b/Misc/NEWS.d/next/Library/2018-10-23-18-58-12.bpo-35053.G82qwh.rst new file mode 100644 index 000000000000..d96ac119aa82 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-23-18-58-12.bpo-35053.G82qwh.rst @@ -0,0 +1,3 @@ +tracemalloc now tries to update the traceback when an object is reused from a +"free list" (optimization for faster object creation, used by the builtin list +type for example). diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index e07022cce2bc..d736b240fc2d 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -29,27 +29,6 @@ static struct { PyMemAllocatorEx obj; } allocators; -static struct { - /* Module initialized? - Variable protected by the GIL */ - enum { - TRACEMALLOC_NOT_INITIALIZED, - TRACEMALLOC_INITIALIZED, - TRACEMALLOC_FINALIZED - } initialized; - - /* Is tracemalloc tracing memory allocations? - Variable protected by the GIL */ - int tracing; - - /* limit of the number of frames in a traceback, 1 by default. - Variable protected by the GIL. */ - int max_nframe; - - /* use domain in trace key? - Variable protected by the GIL. */ - int use_domain; -} tracemalloc_config = {TRACEMALLOC_NOT_INITIALIZED, 0, 1, 0}; #if defined(TRACE_RAW_MALLOC) /* This lock is needed because tracemalloc_free() is called without @@ -459,7 +438,7 @@ traceback_get_frames(traceback_t *traceback) tracemalloc_get_frame(pyframe, &traceback->frames[traceback->nframe]); assert(traceback->frames[traceback->nframe].filename != NULL); traceback->nframe++; - if (traceback->nframe == tracemalloc_config.max_nframe) + if (traceback->nframe == _Py_tracemalloc_config.max_nframe) break; } } @@ -540,7 +519,7 @@ tracemalloc_use_domain(void) { _Py_hashtable_t *new_traces = NULL; - assert(!tracemalloc_config.use_domain); + assert(!_Py_tracemalloc_config.use_domain); new_traces = hashtable_new(sizeof(pointer_t), sizeof(trace_t), @@ -560,7 +539,7 @@ tracemalloc_use_domain(void) _Py_hashtable_destroy(tracemalloc_traces); tracemalloc_traces = new_traces; - tracemalloc_config.use_domain = 1; + _Py_tracemalloc_config.use_domain = 1; return 0; } @@ -572,9 +551,9 @@ tracemalloc_remove_trace(unsigned int domain, uintptr_t ptr) trace_t trace; int removed; - assert(tracemalloc_config.tracing); + assert(_Py_tracemalloc_config.tracing); - if (tracemalloc_config.use_domain) { + if (_Py_tracemalloc_config.use_domain) { pointer_t key = {ptr, domain}; removed = _Py_HASHTABLE_POP(tracemalloc_traces, key, trace); } @@ -603,14 +582,14 @@ tracemalloc_add_trace(unsigned int domain, uintptr_t ptr, _Py_hashtable_entry_t* entry; int res; - assert(tracemalloc_config.tracing); + assert(_Py_tracemalloc_config.tracing); traceback = traceback_new(); if (traceback == NULL) { return -1; } - if (!tracemalloc_config.use_domain && domain != DEFAULT_DOMAIN) { + if (!_Py_tracemalloc_config.use_domain && domain != DEFAULT_DOMAIN) { /* first trace using a non-zero domain whereas traces use compact (uintptr_t) keys: switch to pointer_t keys. */ if (tracemalloc_use_domain() < 0) { @@ -618,7 +597,7 @@ tracemalloc_add_trace(unsigned int domain, uintptr_t ptr, } } - if (tracemalloc_config.use_domain) { + if (_Py_tracemalloc_config.use_domain) { entry = _Py_HASHTABLE_GET_ENTRY(tracemalloc_traces, key); } else { @@ -639,7 +618,7 @@ tracemalloc_add_trace(unsigned int domain, uintptr_t ptr, trace.size = size; trace.traceback = traceback; - if (tracemalloc_config.use_domain) { + if (_Py_tracemalloc_config.use_domain) { res = _Py_HASHTABLE_SET(tracemalloc_traces, key, trace); } else { @@ -956,13 +935,13 @@ tracemalloc_clear_traces(void) static int tracemalloc_init(void) { - if (tracemalloc_config.initialized == TRACEMALLOC_FINALIZED) { + if (_Py_tracemalloc_config.initialized == TRACEMALLOC_FINALIZED) { PyErr_SetString(PyExc_RuntimeError, "the tracemalloc module has been unloaded"); return -1; } - if (tracemalloc_config.initialized == TRACEMALLOC_INITIALIZED) + if (_Py_tracemalloc_config.initialized == TRACEMALLOC_INITIALIZED) return 0; PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &allocators.raw); @@ -996,7 +975,7 @@ tracemalloc_init(void) hashtable_hash_traceback, hashtable_compare_traceback); - if (tracemalloc_config.use_domain) { + if (_Py_tracemalloc_config.use_domain) { tracemalloc_traces = hashtable_new(sizeof(pointer_t), sizeof(trace_t), hashtable_hash_pointer_t, @@ -1026,7 +1005,7 @@ tracemalloc_init(void) tracemalloc_empty_traceback.frames[0].lineno = 0; tracemalloc_empty_traceback.hash = traceback_hash(&tracemalloc_empty_traceback); - tracemalloc_config.initialized = TRACEMALLOC_INITIALIZED; + _Py_tracemalloc_config.initialized = TRACEMALLOC_INITIALIZED; return 0; } @@ -1034,9 +1013,9 @@ tracemalloc_init(void) static void tracemalloc_deinit(void) { - if (tracemalloc_config.initialized != TRACEMALLOC_INITIALIZED) + if (_Py_tracemalloc_config.initialized != TRACEMALLOC_INITIALIZED) return; - tracemalloc_config.initialized = TRACEMALLOC_FINALIZED; + _Py_tracemalloc_config.initialized = TRACEMALLOC_FINALIZED; tracemalloc_stop(); @@ -1077,13 +1056,13 @@ tracemalloc_start(int max_nframe) return -1; } - if (tracemalloc_config.tracing) { + if (_Py_tracemalloc_config.tracing) { /* hook already installed: do nothing */ return 0; } assert(1 <= max_nframe && max_nframe <= MAX_NFRAME); - tracemalloc_config.max_nframe = max_nframe; + _Py_tracemalloc_config.max_nframe = max_nframe; /* allocate a buffer to store a new traceback */ size = TRACEBACK_SIZE(max_nframe); @@ -1119,7 +1098,7 @@ tracemalloc_start(int max_nframe) PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &alloc); /* everything is ready: start tracing Python memory allocations */ - tracemalloc_config.tracing = 1; + _Py_tracemalloc_config.tracing = 1; return 0; } @@ -1128,11 +1107,11 @@ tracemalloc_start(int max_nframe) static void tracemalloc_stop(void) { - if (!tracemalloc_config.tracing) + if (!_Py_tracemalloc_config.tracing) return; /* stop tracing Python memory allocations */ - tracemalloc_config.tracing = 0; + _Py_tracemalloc_config.tracing = 0; /* unregister the hook on memory allocators */ #ifdef TRACE_RAW_MALLOC @@ -1160,7 +1139,7 @@ static PyObject * _tracemalloc_is_tracing_impl(PyObject *module) /*[clinic end generated code: output=2d763b42601cd3ef input=af104b0a00192f63]*/ { - return PyBool_FromLong(tracemalloc_config.tracing); + return PyBool_FromLong(_Py_tracemalloc_config.tracing); } @@ -1174,7 +1153,7 @@ static PyObject * _tracemalloc_clear_traces_impl(PyObject *module) /*[clinic end generated code: output=a86080ee41b84197 input=0dab5b6c785183a5]*/ { - if (!tracemalloc_config.tracing) + if (!_Py_tracemalloc_config.tracing) Py_RETURN_NONE; set_reentrant(1); @@ -1299,7 +1278,7 @@ tracemalloc_get_traces_fill(_Py_hashtable_t *traces, _Py_hashtable_entry_t *entr PyObject *tracemalloc_obj; int res; - if (tracemalloc_config.use_domain) { + if (_Py_tracemalloc_config.use_domain) { pointer_t key; _Py_HASHTABLE_ENTRY_READ_KEY(traces, entry, key); domain = key.domain; @@ -1359,7 +1338,7 @@ _tracemalloc__get_traces_impl(PyObject *module) if (get_traces.list == NULL) goto error; - if (!tracemalloc_config.tracing) + if (!_Py_tracemalloc_config.tracing) return get_traces.list; /* the traceback hash table is used temporarily to intern traceback tuple @@ -1414,11 +1393,11 @@ tracemalloc_get_traceback(unsigned int domain, uintptr_t ptr) trace_t trace; int found; - if (!tracemalloc_config.tracing) + if (!_Py_tracemalloc_config.tracing) return NULL; TABLES_LOCK(); - if (tracemalloc_config.use_domain) { + if (_Py_tracemalloc_config.use_domain) { pointer_t key = {ptr, domain}; found = _Py_HASHTABLE_GET(tracemalloc_traces, key, trace); } @@ -1558,7 +1537,7 @@ static PyObject * _tracemalloc_get_traceback_limit_impl(PyObject *module) /*[clinic end generated code: output=d556d9306ba95567 input=da3cd977fc68ae3b]*/ { - return PyLong_FromLong(tracemalloc_config.max_nframe); + return PyLong_FromLong(_Py_tracemalloc_config.max_nframe); } @@ -1603,7 +1582,7 @@ _tracemalloc_get_traced_memory_impl(PyObject *module) { Py_ssize_t size, peak_size; - if (!tracemalloc_config.tracing) + if (!_Py_tracemalloc_config.tracing) return Py_BuildValue("ii", 0, 0); TABLES_LOCK(); @@ -1681,7 +1660,7 @@ PyTraceMalloc_Track(unsigned int domain, uintptr_t ptr, int res; PyGILState_STATE gil_state; - if (!tracemalloc_config.tracing) { + if (!_Py_tracemalloc_config.tracing) { /* tracemalloc is not tracing: do nothing */ return -2; } @@ -1700,7 +1679,7 @@ PyTraceMalloc_Track(unsigned int domain, uintptr_t ptr, int PyTraceMalloc_Untrack(unsigned int domain, uintptr_t ptr) { - if (!tracemalloc_config.tracing) { + if (!_Py_tracemalloc_config.tracing) { /* tracemalloc is not tracing: do nothing */ return -2; } @@ -1713,6 +1692,60 @@ PyTraceMalloc_Untrack(unsigned int domain, uintptr_t ptr) } +/* If the object memory block is already traced, update its trace + with the current Python traceback. + + Do nothing if tracemalloc is not tracing memory allocations + or if the object memory block is not already traced. */ +int +_PyTraceMalloc_NewReference(PyObject *op) +{ + assert(PyGILState_Check()); + + if (!_Py_tracemalloc_config.tracing) { + /* tracemalloc is not tracing: do nothing */ + return -1; + } + + uintptr_t ptr; + PyTypeObject *type = Py_TYPE(op); + if (PyType_IS_GC(type)) { + ptr = (uintptr_t)((char *)op - sizeof(PyGC_Head)); + } + else { + ptr = (uintptr_t)op; + } + + _Py_hashtable_entry_t* entry; + int res = -1; + + TABLES_LOCK(); + if (_Py_tracemalloc_config.use_domain) { + pointer_t key = {ptr, DEFAULT_DOMAIN}; + entry = _Py_HASHTABLE_GET_ENTRY(tracemalloc_traces, key); + } + else { + entry = _Py_HASHTABLE_GET_ENTRY(tracemalloc_traces, ptr); + } + + if (entry != NULL) { + /* update the traceback of the memory block */ + traceback_t *traceback = traceback_new(); + if (traceback != NULL) { + trace_t trace; + _Py_HASHTABLE_ENTRY_READ_DATA(tracemalloc_traces, entry, trace); + trace.traceback = traceback; + _Py_HASHTABLE_ENTRY_WRITE_DATA(tracemalloc_traces, entry, trace); + res = 0; + } + } + /* else: cannot track the object, its memory block size is unknown */ + TABLES_UNLOCK(); + + return res; +} + + PyObject* _PyTraceMalloc_GetTraceback(unsigned int domain, uintptr_t ptr) { diff --git a/Objects/object.c b/Objects/object.c index 00c0bad86152..4597b1266ae8 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1919,6 +1919,9 @@ _Py_ReadyTypes(void) void _Py_NewReference(PyObject *op) { + if (_Py_tracemalloc_config.tracing) { + _PyTraceMalloc_NewReference(op); + } _Py_INC_REFTOTAL; op->ob_refcnt = 1; _Py_AddToAllObjects(op, 1); diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index d58da35952de..fbc947806908 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -63,6 +63,12 @@ static void* _PyObject_Realloc(void *ctx, void *ptr, size_t size); #endif +/* bpo-35053: Declare tracemalloc configuration here rather than + Modules/_tracemalloc.c because _tracemalloc can be compiled as dynamic + library, whereas _Py_NewReference() requires it. */ +struct _PyTraceMalloc_Config _Py_tracemalloc_config = _PyTraceMalloc_Config_INIT; + + static void * _PyMem_RawMalloc(void *ctx, size_t size) { From webhook-mailer at python.org Thu Oct 25 09:54:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 13:54:25 -0000 Subject: [Python-checkins] bpo-35053: Add Include/tracemalloc.h (GH-10091) Message-ID: https://github.com/python/cpython/commit/6279c1c5003cd94b5e04e568ce3df7c4e8f1eaa3 commit: 6279c1c5003cd94b5e04e568ce3df7c4e8f1eaa3 branch: master author: Victor Stinner committer: GitHub date: 2018-10-25T15:54:13+02:00 summary: bpo-35053: Add Include/tracemalloc.h (GH-10091) * Modify object.h to ensure that pymem.h is included, to get _Py_tracemalloc_config variable. * Move _PyTraceMalloc_XXX() functions to tracemalloc.h, they need PyObject type. Break circular dependency between pymem.h and object.h. files: A Include/tracemalloc.h M Include/Python.h M Include/object.h M Include/pymem.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 1bac5bd54287..80200feb9033 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -137,5 +137,6 @@ #include "dtoa.h" #include "fileutils.h" #include "pyfpe.h" +#include "tracemalloc.h" #endif /* !Py_PYTHON_H */ diff --git a/Include/object.h b/Include/object.h index 8cd57d21a40f..c0371c829067 100644 --- a/Include/object.h +++ b/Include/object.h @@ -1,5 +1,8 @@ #ifndef Py_OBJECT_H #define Py_OBJECT_H + +#include "pymem.h" /* _Py_tracemalloc_config */ + #ifdef __cplusplus extern "C" { #endif diff --git a/Include/pymem.h b/Include/pymem.h index 6299ab405a05..e993628a21ee 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -24,42 +24,6 @@ PyAPI_FUNC(int) _PyMem_SetupAllocators(const char *opt); /* Try to get the allocators name set by _PyMem_SetupAllocators(). */ PyAPI_FUNC(const char*) _PyMem_GetAllocatorsName(void); -/* Track an allocated memory block in the tracemalloc module. - Return 0 on success, return -1 on error (failed to allocate memory to store - the trace). - - Return -2 if tracemalloc is disabled. - - If memory block is already tracked, update the existing trace. */ -PyAPI_FUNC(int) PyTraceMalloc_Track( - unsigned int domain, - uintptr_t ptr, - size_t size); - -/* Update the Python traceback of an object. - This function can be used when a memory block is reused from a free list. */ -PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op); - -/* Untrack an allocated memory block in the tracemalloc module. - Do nothing if the block was not tracked. - - Return -2 if tracemalloc is disabled, otherwise return 0. */ -PyAPI_FUNC(int) PyTraceMalloc_Untrack( - unsigned int domain, - uintptr_t ptr); - -/* Get the traceback where a memory block was allocated. - - Return a tuple of (filename: str, lineno: int) tuples. - - Return None if the tracemalloc module is disabled or if the memory block - is not tracked by tracemalloc. - - Raise an exception and return NULL on error. */ -PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback( - unsigned int domain, - uintptr_t ptr); - PyAPI_FUNC(int) _PyMem_IsFreed(void *ptr, size_t size); #endif /* !defined(Py_LIMITED_API) */ @@ -246,7 +210,9 @@ PyAPI_FUNC(int) _PyMem_SetDefaultAllocator( /* bpo-35053: expose _Py_tracemalloc_config for performance: _Py_NewReference() needs an efficient check to test if tracemalloc is - tracing. */ + tracing. + + It has to be defined in pymem.h, before object.h is included. */ struct _PyTraceMalloc_Config { /* Module initialized? Variable protected by the GIL */ diff --git a/Include/tracemalloc.h b/Include/tracemalloc.h new file mode 100644 index 000000000000..cf5bb54ea08a --- /dev/null +++ b/Include/tracemalloc.h @@ -0,0 +1,42 @@ +#ifndef Py_TRACEMALLOC_H +#define Py_TRACEMALLOC_H + +#ifndef Py_LIMITED_API +/* Track an allocated memory block in the tracemalloc module. + Return 0 on success, return -1 on error (failed to allocate memory to store + the trace). + + Return -2 if tracemalloc is disabled. + + If memory block is already tracked, update the existing trace. */ +PyAPI_FUNC(int) PyTraceMalloc_Track( + unsigned int domain, + uintptr_t ptr, + size_t size); + +/* Update the Python traceback of an object. + This function can be used when a memory block is reused from a free list. */ +PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op); + +/* Untrack an allocated memory block in the tracemalloc module. + Do nothing if the block was not tracked. + + Return -2 if tracemalloc is disabled, otherwise return 0. */ +PyAPI_FUNC(int) PyTraceMalloc_Untrack( + unsigned int domain, + uintptr_t ptr); + +/* Get the traceback where a memory block was allocated. + + Return a tuple of (filename: str, lineno: int) tuples. + + Return None if the tracemalloc module is disabled or if the memory block + is not tracked by tracemalloc. + + Raise an exception and return NULL on error. */ +PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback( + unsigned int domain, + uintptr_t ptr); +#endif + +#endif /* !Py_TRACEMALLOC_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 333ab9b38240..61b469d4504e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1017,6 +1017,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/symtable.h \ $(srcdir)/Include/sysmodule.h \ $(srcdir)/Include/traceback.h \ + $(srcdir)/Include/tracemalloc.h \ $(srcdir)/Include/tupleobject.h \ $(srcdir)/Include/ucnhash.h \ $(srcdir)/Include/unicodeobject.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 4a05d590be5c..cb835390ee13 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 25b1011340a2..510a9c2b2e4e 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -321,6 +321,9 @@ Include + + Include + Include From webhook-mailer at python.org Thu Oct 25 10:02:17 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 14:02:17 -0000 Subject: [Python-checkins] bpo-32321: Add pure Python fallback for functools.reduce (GH-8548) Message-ID: https://github.com/python/cpython/commit/e25d5fc18e6c4b0062cd71b2eb1fd2d5eb5e2d3d commit: e25d5fc18e6c4b0062cd71b2eb1fd2d5eb5e2d3d branch: master author: madman-bob committer: Victor Stinner date: 2018-10-25T16:02:10+02:00 summary: bpo-32321: Add pure Python fallback for functools.reduce (GH-8548) files: A Misc/NEWS.d/next/Library/2018-07-29-13-50-32.bpo-32321.hDoNKC.rst M Lib/functools.py M Lib/test/test_functools.py diff --git a/Lib/functools.py b/Lib/functools.py index 51048f5946c3..39a4af81d051 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -13,10 +13,6 @@ 'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial', 'partialmethod', 'singledispatch', 'singledispatchmethod'] -try: - from _functools import reduce -except ImportError: - pass from abc import get_cache_token from collections import namedtuple # import types, weakref # Deferred to single_dispatch() @@ -226,6 +222,45 @@ def __ge__(self, other): pass +################################################################################ +### reduce() sequence to a single item +################################################################################ + +_initial_missing = object() + +def reduce(function, sequence, initial=_initial_missing): + """ + reduce(function, sequence[, initial]) -> value + + Apply a function of two arguments cumulatively to the items of a sequence, + from left to right, so as to reduce the sequence to a single value. + For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates + ((((1+2)+3)+4)+5). If initial is present, it is placed before the items + of the sequence in the calculation, and serves as a default when the + sequence is empty. + """ + + it = iter(sequence) + + if initial is _initial_missing: + try: + value = next(it) + except StopIteration: + raise TypeError("reduce() of empty sequence with no initial value") from None + else: + value = initial + + for element in it: + value = function(value, element) + + return value + +try: + from _functools import reduce +except ImportError: + pass + + ################################################################################ ### partial() argument application ################################################################################ diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index 200a5eb4955c..ffbd0fcf2d80 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -746,11 +746,8 @@ def wrapper(): self.assertEqual(wrapper.attr, 'This is a different test') self.assertEqual(wrapper.dict_attr, f.dict_attr) - at unittest.skipUnless(c_functools, 'requires the C _functools module') -class TestReduce(unittest.TestCase): - if c_functools: - func = c_functools.reduce +class TestReduce: def test_reduce(self): class Squares: def __init__(self, max): @@ -769,42 +766,42 @@ def __getitem__(self, i): return self.sofar[i] def add(x, y): return x + y - self.assertEqual(self.func(add, ['a', 'b', 'c'], ''), 'abc') + self.assertEqual(self.reduce(add, ['a', 'b', 'c'], ''), 'abc') self.assertEqual( - self.func(add, [['a', 'c'], [], ['d', 'w']], []), + self.reduce(add, [['a', 'c'], [], ['d', 'w']], []), ['a','c','d','w'] ) - self.assertEqual(self.func(lambda x, y: x*y, range(2,8), 1), 5040) + self.assertEqual(self.reduce(lambda x, y: x*y, range(2,8), 1), 5040) self.assertEqual( - self.func(lambda x, y: x*y, range(2,21), 1), + self.reduce(lambda x, y: x*y, range(2,21), 1), 2432902008176640000 ) - self.assertEqual(self.func(add, Squares(10)), 285) - self.assertEqual(self.func(add, Squares(10), 0), 285) - self.assertEqual(self.func(add, Squares(0), 0), 0) - self.assertRaises(TypeError, self.func) - self.assertRaises(TypeError, self.func, 42, 42) - self.assertRaises(TypeError, self.func, 42, 42, 42) - self.assertEqual(self.func(42, "1"), "1") # func is never called with one item - self.assertEqual(self.func(42, "", "1"), "1") # func is never called with one item - self.assertRaises(TypeError, self.func, 42, (42, 42)) - self.assertRaises(TypeError, self.func, add, []) # arg 2 must not be empty sequence with no initial value - self.assertRaises(TypeError, self.func, add, "") - self.assertRaises(TypeError, self.func, add, ()) - self.assertRaises(TypeError, self.func, add, object()) + self.assertEqual(self.reduce(add, Squares(10)), 285) + self.assertEqual(self.reduce(add, Squares(10), 0), 285) + self.assertEqual(self.reduce(add, Squares(0), 0), 0) + self.assertRaises(TypeError, self.reduce) + self.assertRaises(TypeError, self.reduce, 42, 42) + self.assertRaises(TypeError, self.reduce, 42, 42, 42) + self.assertEqual(self.reduce(42, "1"), "1") # func is never called with one item + self.assertEqual(self.reduce(42, "", "1"), "1") # func is never called with one item + self.assertRaises(TypeError, self.reduce, 42, (42, 42)) + self.assertRaises(TypeError, self.reduce, add, []) # arg 2 must not be empty sequence with no initial value + self.assertRaises(TypeError, self.reduce, add, "") + self.assertRaises(TypeError, self.reduce, add, ()) + self.assertRaises(TypeError, self.reduce, add, object()) class TestFailingIter: def __iter__(self): raise RuntimeError - self.assertRaises(RuntimeError, self.func, add, TestFailingIter()) + self.assertRaises(RuntimeError, self.reduce, add, TestFailingIter()) - self.assertEqual(self.func(add, [], None), None) - self.assertEqual(self.func(add, [], 42), 42) + self.assertEqual(self.reduce(add, [], None), None) + self.assertEqual(self.reduce(add, [], 42), 42) class BadSeq: def __getitem__(self, index): raise ValueError - self.assertRaises(ValueError, self.func, 42, BadSeq()) + self.assertRaises(ValueError, self.reduce, 42, BadSeq()) # Test reduce()'s use of iterators. def test_iterator_usage(self): @@ -818,15 +815,25 @@ def __getitem__(self, i): raise IndexError from operator import add - self.assertEqual(self.func(add, SequenceClass(5)), 10) - self.assertEqual(self.func(add, SequenceClass(5), 42), 52) - self.assertRaises(TypeError, self.func, add, SequenceClass(0)) - self.assertEqual(self.func(add, SequenceClass(0), 42), 42) - self.assertEqual(self.func(add, SequenceClass(1)), 0) - self.assertEqual(self.func(add, SequenceClass(1), 42), 42) + self.assertEqual(self.reduce(add, SequenceClass(5)), 10) + self.assertEqual(self.reduce(add, SequenceClass(5), 42), 52) + self.assertRaises(TypeError, self.reduce, add, SequenceClass(0)) + self.assertEqual(self.reduce(add, SequenceClass(0), 42), 42) + self.assertEqual(self.reduce(add, SequenceClass(1)), 0) + self.assertEqual(self.reduce(add, SequenceClass(1), 42), 42) d = {"one": 1, "two": 2, "three": 3} - self.assertEqual(self.func(add, d), "".join(d.keys())) + self.assertEqual(self.reduce(add, d), "".join(d.keys())) + + + at unittest.skipUnless(c_functools, 'requires the C _functools module') +class TestReduceC(TestReduce, unittest.TestCase): + if c_functools: + reduce = c_functools.reduce + + +class TestReducePy(TestReduce, unittest.TestCase): + reduce = staticmethod(py_functools.reduce) class TestCmpToKey: diff --git a/Misc/NEWS.d/next/Library/2018-07-29-13-50-32.bpo-32321.hDoNKC.rst b/Misc/NEWS.d/next/Library/2018-07-29-13-50-32.bpo-32321.hDoNKC.rst new file mode 100644 index 000000000000..82ee39fa76c4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-29-13-50-32.bpo-32321.hDoNKC.rst @@ -0,0 +1,2 @@ +Add pure Python fallback for functools.reduce. +Patch by Robert Wright. From webhook-mailer at python.org Thu Oct 25 11:26:43 2018 From: webhook-mailer at python.org (Steve Dower) Date: Thu, 25 Oct 2018 15:26:43 -0000 Subject: [Python-checkins] bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) Message-ID: https://github.com/python/cpython/commit/d03b7757811ae51277f8ed399a9a0fd78dfd3425 commit: d03b7757811ae51277f8ed399a9a0fd78dfd3425 branch: master author: Tim Graham committer: Steve Dower date: 2018-10-25T11:26:37-04:00 summary: bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) Regression in b0bf51b32240369ccb736dc32ff82bb96f375402. files: A Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst M Lib/ntpath.py M Lib/test/test_ntpath.py diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 0e6de2829f32..11bb297e16bf 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -523,7 +523,7 @@ def _abspath_fallback(path): def abspath(path): """Return the absolute version of a path.""" try: - return _getfullpathname(path) + return normpath(_getfullpathname(path)) except (OSError, ValueError): return _abspath_fallback(path) diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index f37a9945ffda..223e50f12c6d 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -284,6 +284,8 @@ def test_abspath(self): tester('ntpath.abspath("")', cwd_dir) tester('ntpath.abspath(" ")', cwd_dir + "\\ ") tester('ntpath.abspath("?")', cwd_dir + "\\?") + drive, _ = ntpath.splitdrive(cwd_dir) + tester('ntpath.abspath("/abc/")', drive + "\\abc") def test_relpath(self): tester('ntpath.relpath("a")', 'a') diff --git a/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst b/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst new file mode 100644 index 000000000000..1e47bf4174e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst @@ -0,0 +1,2 @@ +Fix ``ntpath.abspath`` regression where it didn't remove a trailing +separator on Windows. Patch by Tim Graham. From webhook-mailer at python.org Thu Oct 25 11:28:21 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 15:28:21 -0000 Subject: [Python-checkins] bpo-35059: Add Py_STATIC_INLINE() macro (GH-10093) Message-ID: https://github.com/python/cpython/commit/18618e652c56e61a134e596b315a13c7cb997a89 commit: 18618e652c56e61a134e596b315a13c7cb997a89 branch: master author: Victor Stinner committer: GitHub date: 2018-10-25T17:28:11+02:00 summary: bpo-35059: Add Py_STATIC_INLINE() macro (GH-10093) * Add Py_STATIC_INLINE() macro to declare a "static inline" function. If the compiler supports it, try to always inline the function even if no optimization level was specified. * Modify pydtrace.h to use Py_STATIC_INLINE() when WITH_DTRACE is not defined. * Add an unit test on Py_DECREF() to make sure that _Py_NegativeRefcount() reports the correct filename. files: M Include/object.h M Include/pydtrace.h M Include/pyport.h M Lib/test/test_capi.py M Modules/_testcapimodule.c M Objects/object.c diff --git a/Include/object.h b/Include/object.h index c0371c829067..8b2afc2bc5be 100644 --- a/Include/object.h +++ b/Include/object.h @@ -729,8 +729,8 @@ you can count such references to the type object.) */ #ifdef Py_REF_DEBUG PyAPI_DATA(Py_ssize_t) _Py_RefTotal; -PyAPI_FUNC(void) _Py_NegativeRefcount(const char *fname, - int lineno, PyObject *op); +PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno, + PyObject *op); PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void); #define _Py_INC_REFTOTAL _Py_RefTotal++ #define _Py_DEC_REFTOTAL _Py_RefTotal-- diff --git a/Include/pydtrace.h b/Include/pydtrace.h index 037961d429c6..cfe192fc5d29 100644 --- a/Include/pydtrace.h +++ b/Include/pydtrace.h @@ -25,29 +25,29 @@ extern "C" { /* Without DTrace, compile to nothing. */ -static inline void PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {} -static inline void PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {} -static inline void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {} -static inline void PyDTrace_GC_START(int arg0) {} -static inline void PyDTrace_GC_DONE(int arg0) {} -static inline void PyDTrace_INSTANCE_NEW_START(int arg0) {} -static inline void PyDTrace_INSTANCE_NEW_DONE(int arg0) {} -static inline void PyDTrace_INSTANCE_DELETE_START(int arg0) {} -static inline void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {} -static inline void PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {} -static inline void PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {} - -static inline int PyDTrace_LINE_ENABLED(void) { return 0; } -static inline int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; } -static inline int PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; } -static inline int PyDTrace_GC_START_ENABLED(void) { return 0; } -static inline int PyDTrace_GC_DONE_ENABLED(void) { return 0; } -static inline int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; } -static inline int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; } -static inline int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; } -static inline int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; } -static inline int PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; } -static inline int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; } +Py_STATIC_INLINE(void) PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {} +Py_STATIC_INLINE(void) PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {} +Py_STATIC_INLINE(void) PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {} +Py_STATIC_INLINE(void) PyDTrace_GC_START(int arg0) {} +Py_STATIC_INLINE(void) PyDTrace_GC_DONE(int arg0) {} +Py_STATIC_INLINE(void) PyDTrace_INSTANCE_NEW_START(int arg0) {} +Py_STATIC_INLINE(void) PyDTrace_INSTANCE_NEW_DONE(int arg0) {} +Py_STATIC_INLINE(void) PyDTrace_INSTANCE_DELETE_START(int arg0) {} +Py_STATIC_INLINE(void) PyDTrace_INSTANCE_DELETE_DONE(int arg0) {} +Py_STATIC_INLINE(void) PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {} +Py_STATIC_INLINE(void) PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {} + +Py_STATIC_INLINE(int) PyDTrace_LINE_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_GC_START_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_GC_DONE_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; } +Py_STATIC_INLINE(int) PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; } #endif /* !WITH_DTRACE */ diff --git a/Include/pyport.h b/Include/pyport.h index f4b547a50b85..2f87f53700af 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -164,20 +164,37 @@ typedef int Py_ssize_clean_t; */ #if defined(_MSC_VER) -#if defined(PY_LOCAL_AGGRESSIVE) -/* enable more aggressive optimization for visual studio */ -#pragma optimize("agtw", on) -#endif -/* ignore warnings if the compiler decides not to inline a function */ -#pragma warning(disable: 4710) -/* fastest possible local call under MSVC */ -#define Py_LOCAL(type) static type __fastcall -#define Py_LOCAL_INLINE(type) static __inline type __fastcall +# if defined(PY_LOCAL_AGGRESSIVE) + /* enable more aggressive optimization for visual studio */ +# pragma optimize("agtw", on) +#endif + /* ignore warnings if the compiler decides not to inline a function */ +# pragma warning(disable: 4710) + /* fastest possible local call under MSVC */ +# define Py_LOCAL(type) static type __fastcall +# define Py_LOCAL_INLINE(type) static __inline type __fastcall #else -#define Py_LOCAL(type) static type -#define Py_LOCAL_INLINE(type) static inline type +# define Py_LOCAL(type) static type +# define Py_LOCAL_INLINE(type) static inline type #endif +/* Declare a "static inline" function. Typical usage: + + Py_STATIC_INLINE(int) add(int a, int b) { return a + b; } + + If the compiler supports it, try to always inline the function even if no + optimization level was specified. */ +#if defined(__GNUC__) || defined(__clang__) +# define Py_STATIC_INLINE(TYPE) \ + __attribute__((always_inline)) static inline TYPE +#elif defined(_MSC_VER) +# define Py_STATIC_INLINE(TYPE) \ + static __forceinline TYPE +#else +# define Py_STATIC_INLINE(TYPE) static inline TYPE +#endif + + /* Py_MEMCPY is kept for backwards compatibility, * see https://bugs.python.org/issue28126 */ #define Py_MEMCPY memcpy diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 49297f461dac..a732f4f82f31 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -315,6 +315,23 @@ def items(self): self.assertRaises(TypeError, _testcapi.get_mapping_values, bad_mapping) self.assertRaises(TypeError, _testcapi.get_mapping_items, bad_mapping) + @unittest.skipUnless(hasattr(_testcapi, 'negative_refcount'), + 'need _testcapi.negative_refcount') + def test_negative_refcount(self): + # bpo-35059: Check that Py_DECREF() reports the correct filename + # when calling _Py_NegativeRefcount() to abort Python. + code = textwrap.dedent(""" + import _testcapi + from test import support + + with support.SuppressCrashReport(): + _testcapi.negative_refcount() + """) + rc, out, err = assert_python_failure('-c', code) + self.assertRegex(err, + br'_testcapimodule\.c:[0-9]+ object at .* ' + br'has negative ref count', err) + class TestPendingCalls(unittest.TestCase): diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 4381e93ca913..b2cda5142308 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4818,6 +4818,25 @@ get_coreconfig(PyObject *self, PyObject *Py_UNUSED(args)) } +#ifdef Py_REF_DEBUG +static PyObject * +negative_refcount(PyObject *self, PyObject *Py_UNUSED(args)) +{ + PyObject *obj = PyUnicode_FromString("negative_refcount"); + if (obj == NULL) { + return NULL; + } + assert(Py_REFCNT(obj) == 1); + + Py_REFCNT(obj) = 0; + /* Py_DECREF() must call _Py_NegativeRefcount() and abort Python */ + Py_DECREF(obj); + + Py_RETURN_NONE; +} +#endif + + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"raise_memoryerror", raise_memoryerror, METH_NOARGS}, @@ -5043,6 +5062,9 @@ static PyMethodDef TestMethods[] = { {"EncodeLocaleEx", encode_locale_ex, METH_VARARGS}, {"DecodeLocaleEx", decode_locale_ex, METH_VARARGS}, {"get_coreconfig", get_coreconfig, METH_NOARGS}, +#ifdef Py_REF_DEBUG + {"negative_refcount", negative_refcount, METH_NOARGS}, +#endif {NULL, NULL} /* sentinel */ }; diff --git a/Objects/object.c b/Objects/object.c index 4597b1266ae8..825607104526 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -200,14 +200,14 @@ void dec_count(PyTypeObject *tp) #ifdef Py_REF_DEBUG /* Log a fatal error; doesn't return. */ void -_Py_NegativeRefcount(const char *fname, int lineno, PyObject *op) +_Py_NegativeRefcount(const char *filename, int lineno, PyObject *op) { char buf[300]; PyOS_snprintf(buf, sizeof(buf), "%s:%i object at %p has negative ref count " "%" PY_FORMAT_SIZE_T "d", - fname, lineno, op, op->ob_refcnt); + filename, lineno, op, op->ob_refcnt); Py_FatalError(buf); } From webhook-mailer at python.org Thu Oct 25 11:31:16 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 15:31:16 -0000 Subject: [Python-checkins] bpo-9263: Dump Python object on GC assertion failure (GH-10062) Message-ID: https://github.com/python/cpython/commit/626bff856840f471e98ec627043f780c111a063d commit: 626bff856840f471e98ec627043f780c111a063d branch: master author: Victor Stinner committer: GitHub date: 2018-10-25T17:31:10+02:00 summary: bpo-9263: Dump Python object on GC assertion failure (GH-10062) Changes: * Add _PyObject_AssertFailed() function. * Add _PyObject_ASSERT() and _PyObject_ASSERT_WITH_MSG() macros. * gc_decref(): replace assert() with _PyObject_ASSERT_WITH_MSG() to dump the faulty object if the assertion fails. _PyObject_AssertFailed() calls: * _PyMem_DumpTraceback(): try to log the traceback where the object memory has been allocated if tracemalloc is enabled. * _PyObject_Dump(): log repr(obj). * Py_FatalError(): log the current Python traceback. _PyObject_AssertFailed() uses _PyObject_IsFreed() heuristic to check if the object memory has been freed by a debug hook on Python memory allocators. Initial patch written by David Malcolm. Co-Authored-By: David Malcolm files: M Include/object.h M Include/pymem.h M Lib/test/test_gc.py M Modules/_tracemalloc.c M Modules/gcmodule.c M Objects/object.c diff --git a/Include/object.h b/Include/object.h index 8b2afc2bc5be..4a49609c72c3 100644 --- a/Include/object.h +++ b/Include/object.h @@ -1105,6 +1105,53 @@ PyAPI_FUNC(void) _PyObject_DebugTypeStats(FILE *out); #endif /* ifndef Py_LIMITED_API */ + +#ifndef Py_LIMITED_API +/* Define a pair of assertion macros: + _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). + + These work like the regular C assert(), in that they will abort the + process with a message on stderr if the given condition fails to hold, + but compile away to nothing if NDEBUG is defined. + + However, before aborting, Python will also try to call _PyObject_Dump() on + the given object. This may be of use when investigating bugs in which a + particular object is corrupt (e.g. buggy a tp_visit method in an extension + module breaking the garbage collector), to help locate the broken objects. + + The WITH_MSG variant allows you to supply an additional message that Python + will attempt to print to stderr, after the object dump. */ +#ifdef NDEBUG + /* No debugging: compile away the assertions: */ +# define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) ((void)0) +#else + /* With debugging: generate checks: */ +# define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ + ((expr) \ + ? (void)(0) \ + : _PyObject_AssertFailed((obj), \ + (msg), \ + Py_STRINGIFY(expr), \ + __FILE__, \ + __LINE__, \ + __func__)) +#endif + +#define _PyObject_ASSERT(obj, expr) _PyObject_ASSERT_WITH_MSG(obj, expr, NULL) + +/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, + to avoid causing compiler/linker errors when building extensions without + NDEBUG against a Python built with NDEBUG defined. */ +PyAPI_FUNC(void) _PyObject_AssertFailed( + PyObject *obj, + const char *msg, + const char *expr, + const char *file, + int line, + const char *function); +#endif /* ifndef Py_LIMITED_API */ + + #ifdef __cplusplus } #endif diff --git a/Include/pymem.h b/Include/pymem.h index e993628a21ee..19f0c8a2d9bf 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -196,7 +196,7 @@ PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, The function does nothing if Python is not compiled is debug mode. */ PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); -#endif +#endif /* Py_LIMITED_API */ #ifdef Py_BUILD_CORE /* Set the memory allocator of the specified domain to the default. diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py index 8d806db3ba57..16b22422528f 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -1,14 +1,17 @@ import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, - temp_dir, requires_type_collecting, TESTFN, unlink) + temp_dir, requires_type_collecting, TESTFN, unlink, + import_module) from test.support.script_helper import assert_python_ok, make_script +import gc import sys +import sysconfig +import textwrap +import threading import time -import gc import weakref -import threading try: from _testcapi import with_tp_del @@ -62,6 +65,14 @@ def __init__(self, partner=None): def __tp_del__(self): pass +if sysconfig.get_config_vars().get('PY_CFLAGS', ''): + BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS']) +else: + # Usually, sys.gettotalrefcount() is only present if Python has been + # compiled in debug mode. If it's missing, expect that Python has + # been released in release mode: with NDEBUG defined. + BUILD_WITH_NDEBUG = (not hasattr(sys, 'gettotalrefcount')) + ### Tests ############################################################################### @@ -878,6 +889,58 @@ def test_collect_garbage(self): self.assertEqual(len(gc.garbage), 0) + @unittest.skipIf(BUILD_WITH_NDEBUG, + 'built with -NDEBUG') + def test_refcount_errors(self): + self.preclean() + # Verify the "handling" of objects with broken refcounts + + # Skip the test if ctypes is not available + import_module("ctypes") + + import subprocess + code = textwrap.dedent(''' + from test.support import gc_collect, SuppressCrashReport + + a = [1, 2, 3] + b = [a] + + # Avoid coredump when Py_FatalError() calls abort() + SuppressCrashReport().__enter__() + + # Simulate the refcount of "a" being too low (compared to the + # references held on it by live data), but keeping it above zero + # (to avoid deallocating it): + import ctypes + ctypes.pythonapi.Py_DecRef(ctypes.py_object(a)) + + # The garbage collector should now have a fatal error + # when it reaches the broken object + gc_collect() + ''') + p = subprocess.Popen([sys.executable, "-c", code], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + p.stdout.close() + p.stderr.close() + # Verify that stderr has a useful error message: + self.assertRegex(stderr, + br'gcmodule\.c:[0-9]+: gc_decref: Assertion "gc_get_refs\(g\) > 0" failed.') + self.assertRegex(stderr, + br'refcount is too small') + self.assertRegex(stderr, + br'object : \[1, 2, 3\]') + self.assertRegex(stderr, + br'type : list') + self.assertRegex(stderr, + br'refcount: 1') + # "address : 0x7fb5062efc18" + # "address : 7FB5062EFC18" + self.assertRegex(stderr, + br'address : [0-9a-fA-Fx]+') + + class GCTogglingTests(unittest.TestCase): def setUp(self): gc.enable() diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index d736b240fc2d..1005f2ea4d87 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -1436,10 +1436,12 @@ _tracemalloc__get_object_traceback(PyObject *module, PyObject *obj) traceback_t *traceback; type = Py_TYPE(obj); - if (PyType_IS_GC(type)) + if (PyType_IS_GC(type)) { ptr = (void *)((char *)obj - sizeof(PyGC_Head)); - else + } + else { ptr = (void *)obj; + } traceback = tracemalloc_get_traceback(DEFAULT_DOMAIN, (uintptr_t)ptr); if (traceback == NULL) diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 7cddabafbc46..2e19fe4b3646 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -62,6 +62,12 @@ module gc // most gc_list_* functions for it. #define NEXT_MASK_UNREACHABLE (1) +/* Get an object's GC head */ +#define AS_GC(o) ((PyGC_Head *)(o)-1) + +/* Get the object given the GC head */ +#define FROM_GC(g) ((PyObject *)(((PyGC_Head *)g)+1)) + static inline int gc_is_collecting(PyGC_Head *g) { @@ -98,16 +104,12 @@ gc_reset_refs(PyGC_Head *g, Py_ssize_t refs) static inline void gc_decref(PyGC_Head *g) { - assert(gc_get_refs(g) > 0); + _PyObject_ASSERT_WITH_MSG(FROM_GC(g), + gc_get_refs(g) > 0, + "refcount is too small"); g->_gc_prev -= 1 << _PyGC_PREV_SHIFT; } -/* Get an object's GC head */ -#define AS_GC(o) ((PyGC_Head *)(o)-1) - -/* Get the object given the GC head */ -#define FROM_GC(g) ((PyObject *)(((PyGC_Head *)g)+1)) - /* Python string to use if unhandled exception occurs */ static PyObject *gc_str = NULL; diff --git a/Objects/object.c b/Objects/object.c index 825607104526..2252f9834756 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -10,6 +10,9 @@ extern "C" { #endif +/* Defined in tracemalloc.c */ +extern void _PyMem_DumpTraceback(int fd, const void *ptr); + _Py_IDENTIFIER(Py_Repr); _Py_IDENTIFIER(__bytes__); _Py_IDENTIFIER(__dir__); @@ -2212,6 +2215,55 @@ _PyTrash_thread_destroy_chain(void) --tstate->trash_delete_nesting; } + +void +_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr, + const char *file, int line, const char *function) +{ + fprintf(stderr, + "%s:%d: %s: Assertion \"%s\" failed", + file, line, function, expr); + fflush(stderr); + + if (msg) { + fprintf(stderr, "; %s.\n", msg); + } + else { + fprintf(stderr, ".\n"); + } + fflush(stderr); + + if (obj == NULL) { + fprintf(stderr, "\n"); + } + else if (_PyObject_IsFreed(obj)) { + /* It seems like the object memory has been freed: + don't access it to prevent a segmentation fault. */ + fprintf(stderr, "\n"); + } + else { + /* Diplay the traceback where the object has been allocated. + Do it before dumping repr(obj), since repr() is more likely + to crash than dumping the traceback. */ + void *ptr; + PyTypeObject *type = Py_TYPE(obj); + if (PyType_IS_GC(type)) { + ptr = (void *)((char *)obj - sizeof(PyGC_Head)); + } + else { + ptr = (void *)obj; + } + _PyMem_DumpTraceback(fileno(stderr), ptr); + + /* This might succeed or fail, but we're about to abort, so at least + try to provide any extra info we can: */ + _PyObject_Dump(obj); + } + fflush(stderr); + + Py_FatalError("_PyObject_AssertFailed"); +} + #ifndef Py_TRACE_REFS /* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. Define this here, so we can undefine the macro. */ From webhook-mailer at python.org Thu Oct 25 11:32:35 2018 From: webhook-mailer at python.org (Zachary Ware) Date: Thu, 25 Oct 2018 15:32:35 -0000 Subject: [Python-checkins] Fix grammar in using/unix build instruction docs (GH-10009) Message-ID: https://github.com/python/cpython/commit/9e95eb0d609cee23e6c9915c0bef243585b8c14b commit: 9e95eb0d609cee23e6c9915c0bef243585b8c14b branch: master author: St?phane Wirtel committer: Zachary Ware date: 2018-10-25T10:32:30-05:00 summary: Fix grammar in using/unix build instruction docs (GH-10009) files: M Doc/using/unix.rst diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst index 8b392f8a56c4..4403180a0e27 100644 --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -72,15 +72,15 @@ latest release's source or just grab a fresh `clone `_. (If you want to contribute patches, you will need a clone.) -The build process consists in the usual :: +The build process consists of the usual commands:: ./configure make make install -invocations. Configuration options and caveats for specific Unix platforms are -extensively documented in the :source:`README.rst` file in the root of the Python -source tree. +Configuration options and caveats for specific Unix platforms are extensively +documented in the :source:`README.rst` file in the root of the Python source +tree. .. warning:: From webhook-mailer at python.org Thu Oct 25 13:46:28 2018 From: webhook-mailer at python.org (Steve Dower) Date: Thu, 25 Oct 2018 17:46:28 -0000 Subject: [Python-checkins] [3.7] bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) Message-ID: https://github.com/python/cpython/commit/a7ffb663953bc84452af1e5f4089359d54e226b5 commit: a7ffb663953bc84452af1e5f4089359d54e226b5 branch: 3.7 author: Steve Dower committer: GitHub date: 2018-10-25T13:46:23-04:00 summary: [3.7] bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) files: A Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst M Lib/ntpath.py M Lib/test/test_ntpath.py diff --git a/Lib/ntpath.py b/Lib/ntpath.py index f0e03a2f496a..3c820b5d0eb7 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -523,8 +523,8 @@ def _abspath_fallback(path): def abspath(path): """Return the absolute version of a path.""" try: - return _getfullpathname(path) - except OSError: + return normpath(_getfullpathname(path)) + except (OSError, ValueError): return _abspath_fallback(path) # realpath is a no-op on systems without islink support diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 907ca7edbead..6e31b6441122 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -284,6 +284,8 @@ def test_abspath(self): tester('ntpath.abspath("")', cwd_dir) tester('ntpath.abspath(" ")', cwd_dir + "\\ ") tester('ntpath.abspath("?")', cwd_dir + "\\?") + drive, _ = ntpath.splitdrive(cwd_dir) + tester('ntpath.abspath("/abc/")', drive + "\\abc") def test_relpath(self): tester('ntpath.relpath("a")', 'a') diff --git a/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst b/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst new file mode 100644 index 000000000000..1e47bf4174e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst @@ -0,0 +1,2 @@ +Fix ``ntpath.abspath`` regression where it didn't remove a trailing +separator on Windows. Patch by Tim Graham. From webhook-mailer at python.org Thu Oct 25 13:46:37 2018 From: webhook-mailer at python.org (Steve Dower) Date: Thu, 25 Oct 2018 17:46:37 -0000 Subject: [Python-checkins] bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) Message-ID: https://github.com/python/cpython/commit/4aa1fda7069642c21c1ee570c4ba44442a657e5e commit: 4aa1fda7069642c21c1ee570c4ba44442a657e5e branch: 3.6 author: Steve Dower committer: GitHub date: 2018-10-25T13:46:33-04:00 summary: bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082) files: A Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst M Lib/ntpath.py M Lib/test/test_ntpath.py diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 24113e701d11..1b23a15a945a 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -545,8 +545,8 @@ def _abspath_fallback(path): def abspath(path): """Return the absolute version of a path.""" try: - return _getfullpathname(path) - except OSError: + return normpath(_getfullpathname(path)) + except (OSError, ValueError): return _abspath_fallback(path) # realpath is a no-op on systems without islink support diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index f93d902d32fa..bba1712ccef5 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -307,6 +307,8 @@ def test_abspath(self): tester('ntpath.abspath("")', cwd_dir) tester('ntpath.abspath(" ")', cwd_dir + "\\ ") tester('ntpath.abspath("?")', cwd_dir + "\\?") + drive, _ = ntpath.splitdrive(cwd_dir) + tester('ntpath.abspath("/abc/")', drive + "\\abc") except ImportError: self.skipTest('nt module not available') diff --git a/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst b/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst new file mode 100644 index 000000000000..1e47bf4174e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst @@ -0,0 +1,2 @@ +Fix ``ntpath.abspath`` regression where it didn't remove a trailing +separator on Windows. Patch by Tim Graham. From webhook-mailer at python.org Thu Oct 25 17:13:49 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 25 Oct 2018 21:13:49 -0000 Subject: [Python-checkins] bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098) Message-ID: https://github.com/python/cpython/commit/1770d1c5121ed6c64d7072875738f97e07eede8a commit: 1770d1c5121ed6c64d7072875738f97e07eede8a branch: master author: St?phane Wirtel committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-25T14:13:45-07:00 summary: bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098) https://bugs.python.org/issue35038 files: A Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst M Doc/library/inspect.rst diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 523a5f34179b..50cd00367a1b 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -132,9 +132,6 @@ attributes: | | f_locals | local namespace seen by | | | | this frame | +-----------+-------------------+---------------------------+ -| | f_restricted | 0 or 1 if frame is in | -| | | restricted execution mode | -+-----------+-------------------+---------------------------+ | | f_trace | tracing function for this | | | | frame, or ``None`` | +-----------+-------------------+---------------------------+ diff --git a/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst b/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst new file mode 100644 index 000000000000..3558cf47d5d5 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst @@ -0,0 +1,2 @@ +Fix the documentation about an unexisting `f_restricted` attribute in the +frame object. Patch by St?phane Wirtel From webhook-mailer at python.org Thu Oct 25 17:19:34 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 25 Oct 2018 21:19:34 -0000 Subject: [Python-checkins] bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098) Message-ID: https://github.com/python/cpython/commit/c64c4056c1fce0a18e5810fc6352712612a64010 commit: c64c4056c1fce0a18e5810fc6352712612a64010 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-25T14:19:31-07:00 summary: bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098) https://bugs.python.org/issue35038 (cherry picked from commit 1770d1c5121ed6c64d7072875738f97e07eede8a) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst M Doc/library/inspect.rst diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 300b3e76b25f..f985eeb4f53b 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -132,9 +132,6 @@ attributes: | | f_locals | local namespace seen by | | | | this frame | +-----------+-------------------+---------------------------+ -| | f_restricted | 0 or 1 if frame is in | -| | | restricted execution mode | -+-----------+-------------------+---------------------------+ | | f_trace | tracing function for this | | | | frame, or ``None`` | +-----------+-------------------+---------------------------+ diff --git a/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst b/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst new file mode 100644 index 000000000000..3558cf47d5d5 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst @@ -0,0 +1,2 @@ +Fix the documentation about an unexisting `f_restricted` attribute in the +frame object. Patch by St?phane Wirtel From webhook-mailer at python.org Thu Oct 25 17:22:04 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 25 Oct 2018 21:22:04 -0000 Subject: [Python-checkins] bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098) Message-ID: https://github.com/python/cpython/commit/3b87151879adb795c3c0372832c87da84ee93974 commit: 3b87151879adb795c3c0372832c87da84ee93974 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-25T14:21:59-07:00 summary: bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098) https://bugs.python.org/issue35038 (cherry picked from commit 1770d1c5121ed6c64d7072875738f97e07eede8a) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst M Doc/library/inspect.rst diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 6be28a2b31cb..891dedd9b02d 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -129,9 +129,6 @@ attributes: | | f_locals | local namespace seen by | | | | this frame | +-----------+-------------------+---------------------------+ -| | f_restricted | 0 or 1 if frame is in | -| | | restricted execution mode | -+-----------+-------------------+---------------------------+ | | f_trace | tracing function for this | | | | frame, or ``None`` | +-----------+-------------------+---------------------------+ diff --git a/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst b/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst new file mode 100644 index 000000000000..3558cf47d5d5 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-25-17-45-09.bpo-35038.2eVOYS.rst @@ -0,0 +1,2 @@ +Fix the documentation about an unexisting `f_restricted` attribute in the +frame object. Patch by St?phane Wirtel From webhook-mailer at python.org Thu Oct 25 17:49:02 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 21:49:02 -0000 Subject: [Python-checkins] bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960) Message-ID: https://github.com/python/cpython/commit/6c83d9f4a72905d968418bef670bb3091d2744db commit: 6c83d9f4a72905d968418bef670bb3091d2744db branch: master author: Max B?langer committer: Victor Stinner date: 2018-10-25T23:48:58+02:00 summary: bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960) The MagicMock class supports many magic methods, but not __fspath__. To ease testing with modules such as os.path, this function is now supported by default. files: A Misc/NEWS.d/next/Library/2018-10-18-17-57-28.bpo-35022.KeEF4T.rst M Doc/library/unittest.mock.rst M Lib/unittest/mock.py M Lib/unittest/test/testmock/testmagicmethods.py diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 136804cfc2c8..0ae29546586a 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -1699,6 +1699,10 @@ The full list of supported magic methods is: * Descriptor methods: ``__get__``, ``__set__`` and ``__delete__`` * Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__`` +* File system path representation: ``__fspath__`` + +.. versionchanged:: 3.8 + Added support for :func:`os.PathLike.__fspath__`. The following methods exist but are *not* supported as they are either in use diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 6b7f293bc5e0..1a6c1a606c5a 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1713,6 +1713,7 @@ def _patch_stopall(): "complex int float index " "round trunc floor ceil " "bool next " + "fspath " ) numerics = ( @@ -1760,6 +1761,7 @@ def method(self, *args, **kw): '__hash__': lambda self: object.__hash__(self), '__str__': lambda self: object.__str__(self), '__sizeof__': lambda self: object.__sizeof__(self), + '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}", } _return_values = { diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/unittest/test/testmock/testmagicmethods.py index 5ab95978f60d..69dfe60f7eae 100644 --- a/Lib/unittest/test/testmock/testmagicmethods.py +++ b/Lib/unittest/test/testmock/testmagicmethods.py @@ -1,5 +1,6 @@ import math import unittest +import os import sys from unittest.mock import Mock, MagicMock, _magics @@ -293,6 +294,15 @@ def test_magicmock_defaults(self): # how to test __sizeof__ ? + def test_magic_methods_fspath(self): + mock = MagicMock() + expected_path = mock.__fspath__() + mock.reset_mock() + + self.assertEqual(os.fspath(mock), expected_path) + mock.__fspath__.assert_called_once() + + def test_magic_methods_and_spec(self): class Iterable(object): def __iter__(self): diff --git a/Misc/NEWS.d/next/Library/2018-10-18-17-57-28.bpo-35022.KeEF4T.rst b/Misc/NEWS.d/next/Library/2018-10-18-17-57-28.bpo-35022.KeEF4T.rst new file mode 100644 index 000000000000..426be70ceacf --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-18-17-57-28.bpo-35022.KeEF4T.rst @@ -0,0 +1,2 @@ +:class:`unittest.mock.MagicMock` now supports the ``__fspath__`` method +(from :class:`os.PathLike`). From webhook-mailer at python.org Thu Oct 25 18:02:01 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 25 Oct 2018 22:02:01 -0000 Subject: [Python-checkins] bpo-35053: Define _PyTraceMalloc_NewReference in object.h (GH-10107) Message-ID: https://github.com/python/cpython/commit/c89a93271447ec65e83a1dc7605e62dbf272cafd commit: c89a93271447ec65e83a1dc7605e62dbf272cafd branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T00:01:56+02:00 summary: bpo-35053: Define _PyTraceMalloc_NewReference in object.h (GH-10107) _PyTraceMalloc_NewReference() is now called by _Py_NewReference(), so move its definition to object.h. Moreover, define it even if Py_LIMITED_API is defined, since _Py_NewReference() is also exposed even if Py_LIMITED_API is defined. files: M Include/object.h M Include/tracemalloc.h M Modules/Setup diff --git a/Include/object.h b/Include/object.h index 4a49609c72c3..2809d3af182f 100644 --- a/Include/object.h +++ b/Include/object.h @@ -765,6 +765,10 @@ PyAPI_FUNC(void) dec_count(PyTypeObject *); #define _Py_COUNT_ALLOCS_COMMA #endif /* COUNT_ALLOCS */ +/* Update the Python traceback of an object. This function must be called + when a memory block is reused from a free list. */ +PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op); + #ifdef Py_TRACE_REFS /* Py_TRACE_REFS is such major surgery that we call external routines. */ PyAPI_FUNC(void) _Py_NewReference(PyObject *); diff --git a/Include/tracemalloc.h b/Include/tracemalloc.h index cf5bb54ea08a..bd14217c199c 100644 --- a/Include/tracemalloc.h +++ b/Include/tracemalloc.h @@ -14,10 +14,6 @@ PyAPI_FUNC(int) PyTraceMalloc_Track( uintptr_t ptr, size_t size); -/* Update the Python traceback of an object. - This function can be used when a memory block is reused from a free list. */ -PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op); - /* Untrack an allocated memory block in the tracemalloc module. Do nothing if the block was not tracked. diff --git a/Modules/Setup b/Modules/Setup index a0622cc8c647..fb16698d2fc1 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -129,6 +129,9 @@ _io -DPy_BUILD_CORE -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fil faulthandler faulthandler.c # debug tool to trace memory blocks allocated by Python +# +# bpo-35053: The module must be builtin since _Py_NewReference() +# can call _PyTraceMalloc_NewReference(). _tracemalloc _tracemalloc.c hashtable.c # The rest of the modules listed in this file are all commented out by From webhook-mailer at python.org Thu Oct 25 20:12:39 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 00:12:39 -0000 Subject: [Python-checkins] bpo-9263: _Py_NegativeRefcount() use _PyObject_AssertFailed() (GH-10109) Message-ID: https://github.com/python/cpython/commit/3ec9af75f6825a32f369ee182a388c365db241b6 commit: 3ec9af75f6825a32f369ee182a388c365db241b6 branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T02:12:34+02:00 summary: bpo-9263: _Py_NegativeRefcount() use _PyObject_AssertFailed() (GH-10109) _Py_NegativeRefcount() now uses _PyObject_AssertFailed() to dump the object to help debugging. files: M Lib/test/test_capi.py M Objects/object.c diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index a732f4f82f31..b3600ebe993d 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -329,8 +329,9 @@ def test_negative_refcount(self): """) rc, out, err = assert_python_failure('-c', code) self.assertRegex(err, - br'_testcapimodule\.c:[0-9]+ object at .* ' - br'has negative ref count', err) + br'_testcapimodule\.c:[0-9]+: ' + br'_Py_NegativeRefcount: Assertion ".*" failed; ' + br'object has negative ref count') class TestPendingCalls(unittest.TestCase): diff --git a/Objects/object.c b/Objects/object.c index 2252f9834756..d6f27ff9487f 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -205,13 +205,9 @@ void dec_count(PyTypeObject *tp) void _Py_NegativeRefcount(const char *filename, int lineno, PyObject *op) { - char buf[300]; - - PyOS_snprintf(buf, sizeof(buf), - "%s:%i object at %p has negative ref count " - "%" PY_FORMAT_SIZE_T "d", - filename, lineno, op, op->ob_refcnt); - Py_FatalError(buf); + _PyObject_AssertFailed(op, "object has negative ref count", + "op->ob_refcnt >= 0", + filename, lineno, __func__); } #endif /* Py_REF_DEBUG */ @@ -356,13 +352,14 @@ PyObject_Print(PyObject *op, FILE *fp, int flags) Py_END_ALLOW_THREADS } else { - if (op->ob_refcnt <= 0) + if (op->ob_refcnt <= 0) { /* XXX(twouters) cast refcount to long until %zd is universally available */ Py_BEGIN_ALLOW_THREADS fprintf(fp, "", (long)op->ob_refcnt, op); Py_END_ALLOW_THREADS + } else { PyObject *s; if (flags & Py_PRINT_RAW) From webhook-mailer at python.org Fri Oct 26 01:37:12 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 26 Oct 2018 05:37:12 -0000 Subject: [Python-checkins] [2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080) Message-ID: https://github.com/python/cpython/commit/e131c7cf7893cdddc74caba2ca649b600dc6760b commit: e131c7cf7893cdddc74caba2ca649b600dc6760b branch: 2.7 author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-26T08:37:07+03:00 summary: [2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080) Don't leak a reference if PyDict_Update() fails, check the PyList_New() call in treebuilder_new(), and properly handle failures in xmlparser(). (cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654) files: M Modules/_elementtree.c diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index b38e0ab329c7..bbaf99410485 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -499,8 +499,10 @@ element(PyObject* self, PyObject* args, PyObject* kw) attrib = (attrib) ? PyDict_Copy(attrib) : PyDict_New(); if (!attrib) return NULL; - if (kw) - PyDict_Update(attrib, kw); + if (kw != NULL && PyDict_Update(attrib, kw) < 0) { + Py_DECREF(attrib); + return NULL; + } } else { Py_INCREF(Py_None); attrib = Py_None; @@ -530,8 +532,10 @@ subelement(PyObject* self, PyObject* args, PyObject* kw) attrib = (attrib) ? PyDict_Copy(attrib) : PyDict_New(); if (!attrib) return NULL; - if (kw) - PyDict_Update(attrib, kw); + if (kw != NULL && PyDict_Update(attrib, kw) < 0) { + Py_DECREF(attrib); + return NULL; + } } else { Py_INCREF(Py_None); attrib = Py_None; @@ -1727,12 +1731,16 @@ treebuilder_new(void) self->data = NULL; - self->stack = PyList_New(20); self->index = 0; self->events = NULL; self->start_event_obj = self->end_event_obj = NULL; self->start_ns_event_obj = self->end_ns_event_obj = NULL; + self->stack = PyList_New(20); + if (self->stack == NULL) { + Py_DECREF(self); + return NULL; + } ALLOC(sizeof(TreeBuilderObject), "create treebuilder"); @@ -1756,7 +1764,7 @@ treebuilder_dealloc(TreeBuilderObject* self) Py_XDECREF(self->end_event_obj); Py_XDECREF(self->start_event_obj); Py_XDECREF(self->events); - Py_DECREF(self->stack); + Py_XDECREF(self->stack); Py_XDECREF(self->data); Py_DECREF(self->last); Py_DECREF(self->this); @@ -2549,16 +2557,28 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw) if (self == NULL) return NULL; + /* Init to NULL to keep the error handling below manageable. */ + self->parser = NULL; + self->names = + self->target = + self->handle_xml = + self->handle_start = + self->handle_data = + self->handle_end = + self->handle_comment = + self->handle_pi = + self->handle_close = + NULL; + self->entity = PyDict_New(); if (!self->entity) { - PyObject_Del(self); + Py_DECREF(self); return NULL; } - + self->names = PyDict_New(); if (!self->names) { - PyObject_Del(self->entity); - PyObject_Del(self); + Py_DECREF(self); return NULL; } @@ -2568,9 +2588,7 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw) self->parser = EXPAT(ParserCreate_MM)(encoding, &memory_handler, "}"); if (!self->parser) { - PyObject_Del(self->names); - PyObject_Del(self->entity); - PyObject_Del(self); + Py_DECREF(self); PyErr_NoMemory(); return NULL; } @@ -2582,17 +2600,6 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw) ALLOC(sizeof(XMLParserObject), "create expatparser"); - /* Init to NULL to keep the error handling below manageable. */ - self->target = - self->handle_xml = - self->handle_start = - self->handle_data = - self->handle_end = - self->handle_comment = - self->handle_pi = - self->handle_close = - NULL; - /* setup target handlers */ if (!target) { target = treebuilder_new(); @@ -2678,7 +2685,9 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw) static void xmlparser_dealloc(XMLParserObject* self) { - EXPAT(ParserFree)(self->parser); + if (self->parser != NULL) { + EXPAT(ParserFree)(self->parser); + } Py_XDECREF(self->handle_close); Py_XDECREF(self->handle_pi); @@ -2688,9 +2697,9 @@ xmlparser_dealloc(XMLParserObject* self) Py_XDECREF(self->handle_start); Py_XDECREF(self->handle_xml); - Py_DECREF(self->target); - Py_DECREF(self->entity); - Py_DECREF(self->names); + Py_XDECREF(self->target); + Py_XDECREF(self->entity); + Py_XDECREF(self->names); RELEASE(sizeof(XMLParserObject), "destroy expatparser"); From webhook-mailer at python.org Fri Oct 26 02:00:54 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 26 Oct 2018 06:00:54 -0000 Subject: [Python-checkins] bpo-35054: Add more index entries for symbols. (GH-10064) Message-ID: https://github.com/python/cpython/commit/ddb961d2abe5d5fde76d85b21a77e4e91e0043ad commit: ddb961d2abe5d5fde76d85b21a77e4e91e0043ad branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-26T09:00:49+03:00 summary: bpo-35054: Add more index entries for symbols. (GH-10064) files: M Doc/library/configparser.rst M Doc/library/constants.rst M Doc/library/datetime.rst M Doc/library/doctest.rst M Doc/library/gettext.rst M Doc/library/os.path.rst M Doc/library/os.rst M Doc/library/re.rst M Doc/library/site.rst M Doc/library/stdtypes.rst M Doc/library/string.rst M Doc/library/struct.rst M Doc/library/sys.rst M Doc/library/time.rst M Doc/library/traceback.rst M Doc/library/urllib.request.rst M Doc/library/winreg.rst M Doc/reference/compound_stmts.rst M Doc/reference/datamodel.rst M Doc/reference/executionmodel.rst M Doc/reference/expressions.rst M Doc/reference/import.rst M Doc/reference/lexical_analysis.rst M Doc/reference/simple_stmts.rst M Doc/tutorial/controlflow.rst M Doc/tutorial/introduction.rst diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 47d61723099f..fcca97aeff75 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -295,6 +295,8 @@ On top of the core functionality, :class:`ConfigParser` supports interpolation. This means values can be preprocessed before returning them from ``get()`` calls. +.. index:: single: %; interpolation in configuration files + .. class:: BasicInterpolation() The default implementation used by :class:`ConfigParser`. It enables @@ -323,6 +325,8 @@ from ``get()`` calls. ``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/lumberjack`` as the value of ``my_dir``. +.. index:: single: $; interpolation in configuration files + .. class:: ExtendedInterpolation() An alternative handler for interpolation which implements a more advanced diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index a698ff8d5a5b..501715980f95 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -51,9 +51,10 @@ A small number of constants live in the built-in namespace. They are: See :exc:`NotImplementedError` for details on when to use it. +.. index:: single: ...; ellipsis literal .. data:: Ellipsis - The same as the ellipsis literal "...". Special value used mostly in conjunction + The same as the ellipsis literal "``...``". Special value used mostly in conjunction with extended slicing syntax for user-defined container data types. diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 7a276b139f5e..e7a0fdbc67a3 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1999,6 +1999,9 @@ Class attributes: The UTC timezone, ``timezone(timedelta(0))``. +.. index:: + single: %; datetime format + .. _strftime-strptime-behavior: :meth:`strftime` and :meth:`strptime` Behavior diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index bc5a40424967..99884298c9e5 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -321,6 +321,10 @@ but doctest isn't trying to do an exact emulation of any specific Python shell. NO!!! >>> +.. index:: + single: >>>; interpreter prompt + single: ...; interpreter prompt + Any expected output must immediately follow the final ``'>>> '`` or ``'... '`` line containing the code, and the expected output (if any) extends to the next ``'>>> '`` or all-whitespace line. @@ -481,6 +485,8 @@ Some details you should read once, but won't need to remember: to test a :exc:`SyntaxError` that omits the traceback header, you will need to manually add the traceback header line to your test example. +.. index:: single: ^; caret + * For some :exc:`SyntaxError`\ s, Python displays the character position of the syntax error, using a ``^`` marker:: @@ -532,6 +538,7 @@ doctest decides whether actual output matches an example's expected output: option will probably go away, but not for several years. +.. index:: single: .. data:: DONT_ACCEPT_BLANKLINE By default, if an expected output block contains a line containing only the @@ -551,6 +558,7 @@ doctest decides whether actual output matches an example's expected output: your source. +.. index:: single: ...; in doctests .. data:: ELLIPSIS When specified, an ellipsis marker (``...``) in the expected output can match @@ -686,6 +694,10 @@ useful unless you intend to extend :mod:`doctest` internals via subclassing: MY_FLAG = register_optionflag('MY_FLAG') +.. index:: + single: #; in doctests + single: +; in doctests + single: -; in doctests .. _doctest-directives: Directives diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index 407853c2d7ef..93748a2e4726 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -61,6 +61,7 @@ class-based API instead. *domain*, which is returned. +.. index:: single: _; gettext .. function:: gettext(message) Return the localized translation of *message*, based on the current global diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index f68fe61c0c2c..379308c2af30 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -160,6 +160,8 @@ the :mod:`glob` module.) Accepts a :term:`path-like object`. +.. index:: single: ~; home directory expansion + .. function:: expanduser(path) On Unix and Windows, return the argument with an initial component of ``~`` or @@ -183,6 +185,9 @@ the :mod:`glob` module.) .. versionchanged:: 3.6 Accepts a :term:`path-like object`. +.. index:: + single: $; environment variables expansion + single: %; environment variables expansion (Windows) .. function:: expandvars(path) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 75d473c00d5c..b174b9df70d5 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -4086,6 +4086,7 @@ are defined for all platforms. Higher-level operations on pathnames are defined in the :mod:`os.path` module. +.. index:: single: .; in pathnames .. data:: curdir The constant string used by the operating system to refer to the current @@ -4093,6 +4094,7 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: ..; in pathnames .. data:: pardir The constant string used by the operating system to refer to the parent @@ -4100,6 +4102,8 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: /; in pathnames +.. index:: single: \; in pathnames (Windows) .. data:: sep The character used by the operating system to separate pathname components. @@ -4109,6 +4113,7 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. useful. Also available via :mod:`os.path`. +.. index:: single: /; in pathnames .. data:: altsep An alternative character used by the operating system to separate pathname @@ -4117,12 +4122,14 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: .; in pathnames .. data:: extsep The character which separates the base filename from the extension; for example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`. +.. index:: single: :; path separator (POSIX) .. data:: pathsep The character conventionally used by the operating system to separate search diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 67f85705169b..57d7402779cf 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -93,15 +93,21 @@ the expression ``(?:a{6})*`` matches any multiple of six ``'a'`` characters. The special characters are: +.. index:: single: .; in regular expressions + ``.`` (Dot.) In the default mode, this matches any character except a newline. If the :const:`DOTALL` flag has been specified, this matches any character including a newline. +.. index:: single: ^; in regular expressions + ``^`` (Caret.) Matches the start of the string, and in :const:`MULTILINE` mode also matches immediately after each newline. +.. index:: single: $; in regular expressions + ``$`` Matches the end of the string or just before the newline at the end of the string, and in :const:`MULTILINE` mode also matches before a newline. ``foo`` @@ -111,20 +117,31 @@ The special characters are: a single ``$`` in ``'foo\n'`` will find two (empty) matches: one just before the newline, and one at the end of the string. +.. index:: single: *; in regular expressions + ``*`` Causes the resulting RE to match 0 or more repetitions of the preceding RE, as many repetitions as are possible. ``ab*`` will match 'a', 'ab', or 'a' followed by any number of 'b's. +.. index:: single: +; in regular expressions + ``+`` Causes the resulting RE to match 1 or more repetitions of the preceding RE. ``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not match just 'a'. +.. index:: single: ?; in regular expressions + ``?`` Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. ``ab?`` will match either 'a' or 'ab'. +.. index:: + single: *?; in regular expressions + single: +?; in regular expressions + single: ??; in regular expressions + ``*?``, ``+?``, ``??`` The ``'*'``, ``'+'``, and ``'?'`` qualifiers are all :dfn:`greedy`; they match as much text as possible. Sometimes this behaviour isn't desired; if the RE @@ -134,6 +151,10 @@ The special characters are: characters as possible will be matched. Using the RE ``<.*?>`` will match only ``''``. +.. index:: + single: {; in regular expressions + single: }; in regular expressions + ``{m}`` Specifies that exactly *m* copies of the previous RE should be matched; fewer matches cause the entire RE not to match. For example, ``a{6}`` will match @@ -155,6 +176,8 @@ The special characters are: 6-character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters, while ``a{3,5}?`` will only match 3 characters. +.. index:: single: \; in regular expressions + ``\`` Either escapes special characters (permitting you to match characters like ``'*'``, ``'?'``, and so forth), or signals a special sequence; special @@ -168,12 +191,18 @@ The special characters are: is complicated and hard to understand, so it's highly recommended that you use raw strings for all but the simplest expressions. +.. index:: + single: [; in regular expressions + single: ]; in regular expressions + ``[]`` Used to indicate a set of characters. In a set: * Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, ``'m'``, or ``'k'``. + .. index:: single: -; in regular expressions + * Ranges of characters can be indicated by giving two characters and separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from ``00`` to ``59``, and @@ -185,10 +214,14 @@ The special characters are: ``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, ``'*'``, or ``')'``. + .. index:: single: \; in regular expressions + * Character classes such as ``\w`` or ``\S`` (defined below) are also accepted inside a set, although the characters they match depends on whether :const:`ASCII` or :const:`LOCALE` mode is in force. + .. index:: single: ^; in regular expressions + * Characters that are not within a range can be matched by :dfn:`complementing` the set. If the first character of the set is ``'^'``, all the characters that are *not* in the set will be matched. For example, ``[^5]`` will match @@ -200,6 +233,11 @@ The special characters are: place it at the beginning of the set. For example, both ``[()[\]{}]`` and ``[]()[{}]`` will both match a parenthesis. + .. .. index:: single: --; in regular expressions + .. .. index:: single: &&; in regular expressions + .. .. index:: single: ~~; in regular expressions + .. .. index:: single: ||; in regular expressions + * Support of nested sets and set operations as in `Unicode Technical Standard #18`_ might be added in the future. This would change the syntax, so to facilitate this change a :exc:`FutureWarning` will be raised @@ -214,6 +252,8 @@ The special characters are: :exc:`FutureWarning` is raised if a character set contains constructs that will change semantically in the future. +.. index:: single: |; in regular expressions + ``|`` ``A|B``, where *A* and *B* can be arbitrary REs, creates a regular expression that will match either *A* or *B*. An arbitrary number of REs can be separated by the @@ -225,6 +265,10 @@ The special characters are: greedy. To match a literal ``'|'``, use ``\|``, or enclose it inside a character class, as in ``[|]``. +.. index:: + single: (; in regular expressions + single: ); in regular expressions + ``(...)`` Matches whatever regular expression is inside the parentheses, and indicates the start and end of a group; the contents of a group can be retrieved after a match @@ -232,6 +276,8 @@ The special characters are: special sequence, described below. To match the literals ``'('`` or ``')'``, use ``\(`` or ``\)``, or enclose them inside a character class: ``[(]``, ``[)]``. +.. index:: single: (?; in regular expressions + ``(?...)`` This is an extension notation (a ``'?'`` following a ``'('`` is not meaningful otherwise). The first character after the ``'?'`` determines what the meaning @@ -253,6 +299,8 @@ The special characters are: :func:`re.compile` function. Flags should be used first in the expression string. +.. index:: single: (?:; in regular expressions + ``(?:...)`` A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group @@ -285,6 +333,8 @@ The special characters are: .. versionchanged:: 3.7 The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group. +.. index:: single: (?P<; in regular expressions + ``(?P...)`` Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group name *name*. Group names must be valid @@ -310,10 +360,14 @@ The special characters are: | | * ``\1`` | +---------------------------------------+----------------------------------+ +.. index:: single: (?P=; in regular expressions + ``(?P=name)`` A backreference to a named group; it matches whatever text was matched by the earlier group named *name*. +.. index:: single: (?#; in regular expressions + ``(?#...)`` A comment; the contents of the parentheses are simply ignored. @@ -322,11 +376,15 @@ The special characters are: called a :dfn:`lookahead assertion`. For example, ``Isaac (?=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``. +.. index:: single: (?!; in regular expressions + ``(?!...)`` Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only if it's *not* followed by ``'Asimov'``. +.. index:: single: (?<=; in regular expressions + ``(?<=...)`` Matches if the current position in the string is preceded by a match for ``...`` that ends at the current position. This is called a :dfn:`positive lookbehind @@ -352,6 +410,8 @@ The special characters are: .. versionchanged:: 3.5 Added support for group references of fixed length. +.. index:: single: (?`` will use the substring matched by the group named ``name``, as diff --git a/Doc/library/site.rst b/Doc/library/site.rst index 5b5ed93a1b7b..e6a2980953d8 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -49,6 +49,10 @@ the key "include-system-site-packages" set to anything other than "false" (case-insensitive), the system-level prefixes will still also be searched for site-packages; otherwise they won't. +.. index:: + single: #; comment + statement: import + A path configuration file is a file whose name has the form :file:`{name}.pth` and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added to ``sys.path``. Non-existing items diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 01fb5d5e15cd..381374cb7c26 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -246,8 +246,12 @@ and imaginary parts. builtin: int builtin: float builtin: complex - operator: + - operator: - + single: operator; + + single: +; unary operator + single: +; binary operator + single: operator; - + single: -; unary operator + single: -; binary operator operator: * operator: / operator: // @@ -2115,8 +2119,7 @@ expression support in the :mod:`re` module). single: string; interpolation, printf single: printf-style formatting single: sprintf-style formatting - single: % formatting - single: % interpolation + single: %; printf-style formatting .. note:: @@ -2144,16 +2147,24 @@ components, which must occur in this order: #. The ``'%'`` character, which marks the start of the specifier. +.. index:: + single: (; in printf-style formatting + single: ); in printf-style formatting + #. Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``). #. Conversion flags (optional), which affect the result of some conversion types. +.. index:: single: *; in printf-style formatting + #. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. +.. index:: single: .; in printf-style formatting + #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the @@ -2177,6 +2188,12 @@ sequential parameter list). The conversion flag characters are: +.. index:: + single: #; in printf-style formatting + single: -; in printf-style formatting + single: +; in printf-style formatting + single: space; in printf-style formatting + +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+=====================================================================+ @@ -3229,18 +3246,17 @@ place, and instead produce new objects. ---------------------------------- .. index:: - single: formatting, bytes (%) - single: formatting, bytearray (%) - single: interpolation, bytes (%) - single: interpolation, bytearray (%) + single: formatting; bytes (%) + single: formatting; bytearray (%) + single: interpolation; bytes (%) + single: interpolation; bytearray (%) single: bytes; formatting single: bytearray; formatting single: bytes; interpolation single: bytearray; interpolation single: printf-style formatting single: sprintf-style formatting - single: % formatting - single: % interpolation + single: %; printf-style formatting .. note:: @@ -3266,16 +3282,24 @@ components, which must occur in this order: #. The ``'%'`` character, which marks the start of the specifier. +.. index:: + single: (; in printf-style formatting + single: ); in printf-style formatting + #. Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``). #. Conversion flags (optional), which affect the result of some conversion types. +.. index:: single: *; in printf-style formatting + #. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. +.. index:: single: .; in printf-style formatting + #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the @@ -3299,6 +3323,12 @@ sequential parameter list). The conversion flag characters are: +.. index:: + single: #; in printf-style formatting + single: -; in printf-style formatting + single: +; in printf-style formatting + single: space; in printf-style formatting + +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+=====================================================================+ @@ -4620,6 +4650,7 @@ supports no special operations. There is exactly one null object, named It is written as ``None``. +.. index:: single: ...; ellipsis literal .. _bltin-ellipsis-object: The Ellipsis Object diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 0fec3df3e3c1..55913f8c07f5 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -192,6 +192,15 @@ subclasses can define their own format string syntax). The syntax is related to that of :ref:`formatted string literals `, but there are differences. +.. index:: + single: {; in string formatting + single: }; in string formatting + single: .; in string formatting + single: [; in string formatting + single: ]; in string formatting + single: !; in string formatting + single: :; in string formatting + Format strings contain "replacement fields" surrounded by curly braces ``{}``. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output. If you need to include a brace character in the @@ -323,6 +332,12 @@ affect the :func:`format` function. The meaning of the various alignment options is as follows: + .. index:: + single: <; in string formatting + single: >; in string formatting + single: =; in string formatting + single: ^; in string formatting + +---------+----------------------------------------------------------+ | Option | Meaning | +=========+==========================================================+ @@ -349,6 +364,11 @@ meaning in this case. The *sign* option is only valid for number types, and can be one of the following: + .. index:: + single: +; in string formatting + single: -; in string formatting + single: space; in string formatting + +---------+----------------------------------------------------------+ | Option | Meaning | +=========+==========================================================+ @@ -363,6 +383,8 @@ following: +---------+----------------------------------------------------------+ +.. index:: single: #; in string formatting + The ``'#'`` option causes the "alternate form" to be used for the conversion. The alternate form is defined differently for different types. This option is only valid for integer, float, complex and @@ -375,6 +397,8 @@ decimal-point character appears in the result of these conversions only if a digit follows it. In addition, for ``'g'`` and ``'G'`` conversions, trailing zeros are not removed from the result. +.. index:: single: ,; in string formatting + The ``','`` option signals the use of a comma for a thousands separator. For a locale aware separator, use the ``'n'`` integer presentation type instead. @@ -382,6 +406,8 @@ instead. .. versionchanged:: 3.1 Added the ``','`` option (see also :pep:`378`). +.. index:: single: _; in string formatting + The ``'_'`` option signals the use of an underscore for a thousands separator for floating point presentation types and for integer presentation type ``'d'``. For integer presentation types ``'b'``, @@ -668,6 +694,8 @@ formatting facilities in Python. As an example of a library built on template strings for i18n, see the `flufl.i18n `_ package. +.. index:: single: $; in template strings + Template strings support ``$``-based substitutions, using the following rules: * ``$$`` is an escape; it is replaced with a single ``$``. diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index bad33ac666ed..9ba404760a7b 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -117,6 +117,13 @@ By default, C types are represented in the machine's native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler). +.. index:: + single: @; in struct format strings + single: =; in struct format strings + single: <; in struct format strings + single: >; in struct format strings + single: !; in struct format strings + Alternatively, the first character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table: diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 46d8db0230b8..c7d26866fd80 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1064,6 +1064,8 @@ always available. .. index:: single: interpreter prompts single: prompts, interpreter + single: >>>; interpreter prompt + single: ...; interpreter prompt Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is in interactive mode. Their initial diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 56f972c9d032..d76e089c23b4 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -369,6 +369,9 @@ Functions :pep:`475` for the rationale). +.. index:: + single: %; datetime format + .. function:: strftime(format[, t]) Convert a tuple or :class:`struct_time` representing a time as returned by @@ -500,6 +503,9 @@ Functions it is 3. +.. index:: + single: %; datetime format + .. function:: strptime(string[, format]) Parse a string representing a time according to a format. The return value diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 7ac3cacd3d1c..a21ef8ed9f36 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -44,7 +44,11 @@ The module defines the following functions: * if *tb* is not ``None``, it prints a header ``Traceback (most recent call last):`` + * it prints the exception *etype* and *value* after the stack trace + + .. index:: single: ^; caret + * if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error. diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index cbbec0cd8311..982f57f1fe61 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -297,7 +297,7 @@ The following classes are provided: Cause requests to go through a proxy. If *proxies* is given, it must be a dictionary mapping protocol names to URLs of proxies. The default is to read the list of proxies from the environment variables - :envvar:`_proxy`. If no proxy environment variables are set, then + ``_proxy``. If no proxy environment variables are set, then in a Windows environment proxy settings are obtained from the registry's Internet Settings section, and in a Mac OS X environment proxy information is retrieved from the OS X System Configuration Framework. diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst index 14f7896f840e..99be47fb4b9c 100644 --- a/Doc/library/winreg.rst +++ b/Doc/library/winreg.rst @@ -224,6 +224,9 @@ This module offers the following functions: See :ref:`above `. +.. index:: + single: %; environment variables expansion (Windows) + .. function:: ExpandEnvironmentStrings(str) Expands environment variable placeholders ``%NAME%`` in strings like diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 638e1604c167..592d6caf7b85 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -21,6 +21,7 @@ also syntactically compound statements. .. index:: single: clause single: suite + single: ; A compound statement consists of one or more 'clauses.' A clause consists of a header and a 'suite.' The clause headers of a particular compound statement are @@ -84,8 +85,7 @@ The :keyword:`if` statement statement: if keyword: elif keyword: else - keyword: elif - keyword: else + single: :; compound statement The :keyword:`if` statement is used for conditional execution: @@ -111,6 +111,7 @@ The :keyword:`while` statement keyword: else pair: loop; statement keyword: else + single: :; compound statement The :keyword:`while` statement is used for repeated execution as long as an expression is true: @@ -149,6 +150,7 @@ The :keyword:`for` statement keyword: else pair: target; list object: sequence + single: :; compound statement The :keyword:`for` statement is used to iterate over the elements of a sequence (such as a string, tuple or list) or other iterable object: @@ -229,7 +231,9 @@ The :keyword:`try` statement statement: try keyword: except keyword: finally -.. index:: keyword: except + keyword: else + keyword: as + single: :; compound statement The :keyword:`try` statement specifies exception handlers and/or cleanup code for a group of statements: @@ -263,6 +267,8 @@ exception, the original search for a handler is canceled and a search starts for the new exception in the surrounding code and on the call stack (it is treated as if the entire :keyword:`try` statement raised the exception). +.. index:: single: as; except clause + When a matching except clause is found, the exception is assigned to the target specified after the :keyword:`as` keyword in that except clause, if present, and the except clause's suite is executed. All except clauses must have an @@ -375,8 +381,11 @@ The :keyword:`with` statement ============================= .. index:: - statement: with - single: as; with statement + statement: with + keyword: as + single: as; with statement + single: ,; with statement + single: :; compound statement The :keyword:`with` statement is used to wrap the execution of a block with methods defined by a context manager (see section :ref:`context-managers`). @@ -463,6 +472,10 @@ Function definitions object: function pair: function; name pair: name; binding + single: (; function definition + single: ); function definition + single: ,; parameter list + single: :; compound statement A function definition defines a user-defined function object (see section :ref:`types`): @@ -492,7 +505,7 @@ The function definition does not execute the function body; this gets executed only when the function is called. [#]_ .. index:: - statement: @ + single: @; function definition A function definition may be wrapped by one or more :term:`decorator` expressions. Decorator expressions are evaluated when the function is defined, in the scope @@ -515,6 +528,7 @@ except that the original function is not temporarily bound to the name ``func``. .. index:: triple: default; parameter; value single: argument; function definition + single: =; function definition When one or more :term:`parameters ` have the form *parameter* ``=`` *expression*, the function is said to have "default parameter values." For a @@ -541,8 +555,8 @@ e.g.:: return penguin .. index:: - statement: * - statement: ** + single: *; function definition + single: **; function definition Function call semantics are described in more detail in section :ref:`calls`. A function call always assigns values to all parameters mentioned in the parameter @@ -555,7 +569,10 @@ new empty mapping of the same type. Parameters after "``*``" or "``*identifier``" are keyword-only parameters and may only be passed used keyword arguments. -.. index:: pair: function; annotations +.. index:: + pair: function; annotations + single: ->; function annotations + single: :; function annotations Parameters may have annotations of the form "``: expression``" following the parameter name. Any parameter may have an annotation even those of the form @@ -617,6 +634,10 @@ Class definitions pair: execution; frame single: inheritance single: docstring + single: (; class definition + single: ); class definition + single: ,; expression list + single: :; compound statement A class definition defines a class object (see section :ref:`types`): @@ -655,6 +676,9 @@ the definition syntax. Class creation can be customized heavily using :ref:`metaclasses `. +.. index:: + single: @; class definition + Classes can also be decorated: just like when decorating functions, :: @f1(arg) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 81467d096bc5..efbc872ba900 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -165,7 +165,9 @@ NotImplemented Ellipsis - .. index:: object: Ellipsis + .. index:: + object: Ellipsis + single: ...; ellipsis literal This type has a single value. There is a single object with this value. This object is accessed through the literal ``...`` or the built-in name @@ -1831,8 +1833,9 @@ Metaclasses ^^^^^^^^^^^ .. index:: - single: metaclass - builtin: type + single: metaclass + builtin: type + single: =; class definition By default, classes are constructed using :func:`type`. The class body is executed in a new namespace and the class name is bound locally to the diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index d08abdf3343f..5c83181440bc 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -52,7 +52,7 @@ Binding of names :dfn:`Names` refer to objects. Names are introduced by name binding operations. -.. index:: statement: from +.. index:: single: from; import statement The following constructs bind names: formal parameters to functions, :keyword:`import` statements, class and function definitions (these bind the diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index f4b16182829d..fdbbba123b60 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -128,7 +128,10 @@ value. Parenthesized forms ------------------- -.. index:: single: parenthesized form +.. index:: + single: parenthesized form + single: (; tuple display + single: ); tuple display A parenthesized form is an optional expression list enclosed in parentheses: @@ -146,8 +149,9 @@ immutable, the rules for literals apply (i.e., two occurrences of the empty tuple may or may not yield the same object). .. index:: - single: comma + single: comma; tuple display pair: tuple; display + single: ,; tuple display Note that tuples are not formed by the parentheses, but rather by use of the comma operator. The exception is the empty tuple, for which parentheses *are* @@ -168,6 +172,11 @@ called "displays", each of them in two flavors: * they are computed via a set of looping and filtering instructions, called a :dfn:`comprehension`. +.. index:: + single: for; in comprehensions + single: if; in comprehensions + single: async for; in comprehensions + Common syntax elements for comprehensions are: .. productionlist:: @@ -198,6 +207,9 @@ To ensure the comprehension always results in a container of the appropriate type, ``yield`` and ``yield from`` expressions are prohibited in the implicitly nested scope. +.. index:: + single: await; in comprehensions + Since Python 3.6, in an :keyword:`async def` function, an :keyword:`async for` clause may be used to iterate over a :term:`asynchronous iterator`. A comprehension in an :keyword:`async def` function may consist of either a @@ -227,6 +239,9 @@ List displays pair: list; comprehensions pair: empty; list object: list + single: [; list expression + single: ]; list expression + single: ,; expression list A list display is a possibly empty series of expressions enclosed in square brackets: @@ -246,8 +261,12 @@ the list is constructed from the elements resulting from the comprehension. Set displays ------------ -.. index:: pair: set; display - object: set +.. index:: + pair: set; display + object: set + single: {; set expression + single: }; set expression + single: ,; expression list A set display is denoted by curly braces and distinguishable from dictionary displays by the lack of colons separating keys and values: @@ -270,9 +289,14 @@ dictionary. Dictionary displays ------------------- -.. index:: pair: dictionary; display - key, datum, key/datum pair - object: dictionary +.. index:: + pair: dictionary; display + key, datum, key/datum pair + object: dictionary + single: {; dictionary expression + single: }; dictionary expression + single: :; in dictionary expressions + single: ,; in dictionary displays A dictionary display is a possibly empty series of key/datum pairs enclosed in curly braces: @@ -291,7 +315,9 @@ used as a key into the dictionary to store the corresponding datum. This means that you can specify the same key multiple times in the key/datum list, and the final dictionary's value for that key will be the last one given. -.. index:: unpacking; dictionary, **; in dictionary displays +.. index:: + unpacking; dictionary + single: **; in dictionary displays A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand must be a :term:`mapping`. Each mapping item is added @@ -321,8 +347,11 @@ prevails. Generator expressions --------------------- -.. index:: pair: generator; expression - object: generator +.. index:: + pair: generator; expression + object: generator + single: (; generator expression + single: ); generator expression A generator expression is a compact generator notation in parentheses: @@ -376,6 +405,7 @@ Yield expressions .. index:: keyword: yield + keyword: from pair: yield; expression pair: generator; function @@ -439,6 +469,9 @@ finalized (by reaching a zero reference count or by being garbage collected), the generator-iterator's :meth:`~generator.close` method will be called, allowing any pending :keyword:`finally` clauses to execute. +.. index:: + single: from; yield from expression + When ``yield from `` is used, it treats the supplied expression as a subiterator. All values produced by that subiterator are passed directly to the caller of the current generator's methods. Any values passed in with @@ -718,7 +751,9 @@ syntax is: Attribute references -------------------- -.. index:: pair: attribute; reference +.. index:: + pair: attribute; reference + single: .; attribute reference An attribute reference is a primary followed by a period and a name: @@ -744,7 +779,10 @@ same attribute reference may yield different objects. Subscriptions ------------- -.. index:: single: subscription +.. index:: + single: subscription + single: [; subscription + single: ]; subscription .. index:: object: sequence @@ -801,6 +839,8 @@ Slicings .. index:: single: slicing single: slice + single: :; slicing + single: ,; slicing .. index:: object: sequence @@ -850,6 +890,10 @@ substituting ``None`` for missing expressions. object: callable single: call single: argument; call semantics + single: (; call + single: ); call + single: ,; argument list + single: =; in function calls .. _calls: @@ -1032,6 +1076,7 @@ a class instance: if that method was called. +.. index:: keyword: await .. _await: Await expression @@ -1051,6 +1096,10 @@ Can only be used inside a :term:`coroutine function`. The power operator ================== +.. index:: + pair: power; operation + operator: ** + The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right. The syntax is: @@ -1093,15 +1142,21 @@ All unary arithmetic and bitwise operations have the same priority: .. index:: single: negation single: minus + single: operator; - + single: -; unary operator The unary ``-`` (minus) operator yields the negation of its numeric argument. -.. index:: single: plus +.. index:: + single: plus + single: operator; + + single: +; unary operator The unary ``+`` (plus) operator yields its numeric argument unchanged. -.. index:: single: inversion - +.. index:: + single: inversion + operator: ~ The unary ``~`` (invert) operator yields the bitwise inversion of its integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. It only @@ -1131,7 +1186,9 @@ operators and one for additive operators: : `m_expr` "%" `u_expr` a_expr: `m_expr` | `a_expr` "+" `m_expr` | `a_expr` "-" `m_expr` -.. index:: single: multiplication +.. index:: + single: multiplication + operator: * The ``*`` (multiplication) operator yields the product of its arguments. The arguments must either both be numbers, or one argument must be an integer and @@ -1151,6 +1208,8 @@ builtin Python types implement this operator. .. index:: exception: ZeroDivisionError single: division + operator: / + operator: // The ``/`` (division) and ``//`` (floor division) operators yield the quotient of their arguments. The numeric arguments are first converted to a common type. @@ -1159,7 +1218,9 @@ integer; the result is that of mathematical division with the 'floor' function applied to the result. Division by zero raises the :exc:`ZeroDivisionError` exception. -.. index:: single: modulo +.. index:: + single: modulo + operator: % The ``%`` (modulo) operator yields the remainder from the division of the first argument by the second. The numeric arguments are first converted to a common @@ -1184,14 +1245,20 @@ The floor division operator, the modulo operator, and the :func:`divmod` function are not defined for complex numbers. Instead, convert to a floating point number using the :func:`abs` function if appropriate. -.. index:: single: addition +.. index:: + single: addition + single: operator; + + single: +; binary operator The ``+`` (addition) operator yields the sum of its arguments. The arguments must either both be numbers or both be sequences of the same type. In the former case, the numbers are converted to a common type and then added together. In the latter case, the sequences are concatenated. -.. index:: single: subtraction +.. index:: + single: subtraction + single: operator; - + single: -; binary operator The ``-`` (subtraction) operator yields the difference of its arguments. The numeric arguments are first converted to a common type. @@ -1202,7 +1269,10 @@ numeric arguments are first converted to a common type. Shifting operations =================== -.. index:: pair: shifting; operation +.. index:: + pair: shifting; operation + operator: << + operator: >> The shifting operations have lower priority than the arithmetic operations: @@ -1232,7 +1302,9 @@ Each of the three bitwise operations has a different priority level: xor_expr: `and_expr` | `xor_expr` "^" `and_expr` or_expr: `xor_expr` | `or_expr` "|" `xor_expr` -.. index:: pair: bitwise; and +.. index:: + pair: bitwise; and + operator: & The ``&`` operator yields the bitwise AND of its arguments, which must be integers. @@ -1240,6 +1312,7 @@ integers. .. index:: pair: bitwise; xor pair: exclusive; or + operator: ^ The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, which must be integers. @@ -1247,6 +1320,7 @@ must be integers. .. index:: pair: bitwise; or pair: inclusive; or + operator: | The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which must be integers. @@ -1257,9 +1331,15 @@ must be integers. Comparisons =========== -.. index:: single: comparison - -.. index:: pair: C; language +.. index:: + single: comparison + pair: C; language + operator: < + operator: > + operator: <= + operator: >= + operator: == + operator: != Unlike C, all comparison operations in Python have the same priority, which is lower than that of any arithmetic, shifting or bitwise operation. Also unlike @@ -1577,6 +1657,8 @@ Conditional expressions .. index:: pair: conditional; expression pair: ternary; operator + single: if; conditional expression + single: else; conditional expression .. productionlist:: conditional_expression: `or_test` ["if" `or_test` "else" `expression`] @@ -1603,10 +1685,11 @@ Lambdas pair: lambda; expression pair: lambda; form pair: anonymous; function + single: :; lambda expression .. productionlist:: - lambda_expr: "lambda" [`parameter_list`]: `expression` - lambda_expr_nocond: "lambda" [`parameter_list`]: `expression_nocond` + lambda_expr: "lambda" [`parameter_list`] ":" `expression` + lambda_expr_nocond: "lambda" [`parameter_list`] ":" `expression_nocond` Lambda expressions (sometimes called lambda forms) are used to create anonymous functions. The expression ``lambda parameters: expression`` yields a function @@ -1627,7 +1710,10 @@ annotations. Expression lists ================ -.. index:: pair: expression; list +.. index:: + pair: expression; list + single: comma; expression list + single: ,; expression list .. productionlist:: expression_list: `expression` ("," `expression`)* [","] @@ -1689,7 +1775,8 @@ their suffixes:: Operator precedence =================== -.. index:: pair: operator; precedence +.. index:: + pair: operator; precedence The following table summarizes the operator precedence in Python, from lowest precedence (least binding) to highest precedence (most binding). Operators in @@ -1737,7 +1824,7 @@ precedence and have a left-to-right chaining feature as described in the +-----------------------------------------------+-------------------------------------+ | ``**`` | Exponentiation [#]_ | +-----------------------------------------------+-------------------------------------+ -| ``await`` ``x`` | Await expression | +| :keyword:`await` ``x`` | Await expression | +-----------------------------------------------+-------------------------------------+ | ``x[index]``, ``x[index:index]``, | Subscription, slicing, | | ``x(arguments...)``, ``x.attribute`` | call, attribute reference | diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 44b5b818aa82..7c4f275a4342 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -127,8 +127,8 @@ Namespace packages ------------------ .. index:: - pair:: package; namespace - pair:: package; portion + pair: package; namespace + pair: package; portion A namespace package is a composite of various :term:`portions `, where each portion contributes a subpackage to the parent package. Portions diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index e1d88eff959f..b197f239616b 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -65,6 +65,7 @@ Comments -------- .. index:: comment, hash character + single: #; comment A comment starts with a hash character (``#``) that is not part of a string literal, and ends at the end of the physical line. A comment signifies the end @@ -78,6 +79,7 @@ Encoding declarations --------------------- .. index:: source character set, encoding declarations (source file) + single: #; source encoding declaration If a comment in the first or second line of the Python script matches the regular expression ``coding[=:]\s*([-\w.]+)``, this comment is processed as an @@ -349,6 +351,9 @@ exactly as written here: assert del global not with async elif if or yield +.. index:: + single: _, identifiers + single: __, identifiers .. _id-classes: Reserved classes of identifiers @@ -395,13 +400,16 @@ Literals Literals are notations for constant values of some built-in types. +.. index:: string literal, bytes literal, ASCII + single: '; string literal + single: "; string literal + single: u'; string literal + single: u"; string literal .. _strings: String and Bytes literals ------------------------- -.. index:: string literal, bytes literal, ASCII - String literals are described by the following lexical definitions: .. productionlist:: @@ -434,6 +442,8 @@ declaration; it is UTF-8 if no encoding declaration is given in the source file; see section :ref:`encodings`. .. index:: triple-quoted string, Unicode Consortium, raw string + single: """; string literal + single: '''; string literal In plain English: Both types of literals can be enclosed in matching single quotes (``'``) or double quotes (``"``). They can also be enclosed in matching groups @@ -442,11 +452,19 @@ of three single or double quotes (these are generally referred to as characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character. +.. index:: + single: b'; bytes literal + single: b"; bytes literal + Bytes literals are always prefixed with ``'b'`` or ``'B'``; they produce an instance of the :class:`bytes` type instead of the :class:`str` type. They may only contain ASCII characters; bytes with a numeric value of 128 or greater must be expressed with escapes. +.. index:: + single: r'; raw string literal + single: r"; raw string literal + Both string and bytes literals may optionally be prefixed with a letter ``'r'`` or ``'R'``; such strings are called :dfn:`raw strings` and treat backslashes as literal characters. As a result, in string literals, ``'\U'`` and ``'\u'`` @@ -463,6 +481,10 @@ is not supported. to simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:`414` for more information. +.. index:: + single: f'; formatted string literal + single: f"; formatted string literal + A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with ``'r'``, but not with ``'b'`` or ``'u'``, therefore raw @@ -473,6 +495,19 @@ retained), except that three unescaped quotes in a row terminate the literal. ( "quote" is the character used to open the literal, i.e. either ``'`` or ``"``.) .. index:: physical line, escape sequence, Standard C, C + single: \; escape sequence + single: \\; escape sequence + single: \a; escape sequence + single: \b; escape sequence + single: \f; escape sequence + single: \n; escape sequence + single: \r; escape sequence + single: \t; escape sequence + single: \v; escape sequence + single: \x; escape sequence + single: \N; escape sequence + single: \u; escape sequence + single: \U; escape sequence Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string and bytes literals are interpreted according to rules similar to those used by @@ -604,6 +639,10 @@ and formatted string literals may be concatenated with plain string literals. single: string; formatted literal single: string; interpolated literal single: f-string + single: {; in formatted string literal + single: }; in formatted string literal + single: !; in formatted string literal + single: :; in formatted string literal .. _f-strings: Formatted string literals @@ -738,6 +777,12 @@ actually an expression composed of the unary operator '``-``' and the literal ``1``. +.. index:: + single: 0b; integer literal + single: 0o; integer literal + single: 0x; integer literal + single: _; in numeric literal + .. _integers: Integer literals @@ -778,6 +823,10 @@ Some examples of integer literals:: Underscores are now allowed for grouping purposes in literals. +.. index:: + single: .; in numeric literal + single: e; in numeric literal + single: _; in numeric literal .. _floating: Floating point literals @@ -806,6 +855,8 @@ Some examples of floating point literals:: Underscores are now allowed for grouping purposes in literals. +.. index:: + single: j; in numeric literal .. _imaginary: Imaginary literals diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index f98721cd6552..0ac795367bf4 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -112,6 +112,12 @@ unacceptable. The rules observed by various types and the exceptions raised are given with the definition of the object types (see section :ref:`types`). .. index:: triple: target; list; assignment + single: ,; in target list + single: *; in assignment target list + single: [; in assignment target list + single: ]; in assignment target list + single: (; in assignment target list + single: ); in assignment target list Assignment of an object to a target list, optionally enclosed in parentheses or square brackets, is recursively defined as follows. @@ -321,6 +327,7 @@ Annotated assignment statements .. index:: pair: annotated; assignment single: statement; assignment, annotated + single: :; annotated variable Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement: @@ -372,6 +379,7 @@ The :keyword:`assert` statement .. index:: statement: assert pair: debugging; assertions + single: ,; expression list Assert statements are a convenient way to insert debugging assertions into a program: @@ -712,6 +720,9 @@ The :keyword:`import` statement single: module; importing pair: name; binding keyword: from + keyword: as + exception: ImportError + single: ,; import statement .. productionlist:: import_stmt: "import" `module` ["as" `identifier`] ("," `module` ["as" `identifier`])* @@ -761,8 +772,7 @@ available in the local namespace in one of three ways: .. index:: pair: name; binding - keyword: from - exception: ImportError + single: from; import statement The :keyword:`from` form uses a slightly more complex process: @@ -786,6 +796,8 @@ Examples:: from foo.bar import baz # foo.bar.baz imported and bound as baz from foo import attr # foo imported and foo.attr bound as attr +.. index:: single: *; import statement + If the list of identifiers is replaced by a star (``'*'``), all public names defined in the module are bound in the local namespace for the scope where the :keyword:`import` statement occurs. @@ -831,7 +843,9 @@ determine dynamically the modules to be loaded. Future statements ----------------- -.. index:: pair: future; statement +.. index:: + pair: future; statement + single: __future__; future statement A :dfn:`future statement` is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a @@ -918,6 +932,7 @@ The :keyword:`global` statement .. index:: statement: global triple: global; name; binding + single: ,; identifier list .. productionlist:: global_stmt: "global" `identifier` ("," `identifier`)* @@ -962,6 +977,7 @@ The :keyword:`nonlocal` statement ================================= .. index:: statement: nonlocal + single: ,; identifier list .. productionlist:: nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)* diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 4bcdafd73352..f87cd4decd02 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -526,7 +526,7 @@ Arbitrary Argument Lists ------------------------ .. index:: - statement: * + single: *; in function calls Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -570,7 +570,7 @@ or tuple:: [3, 4, 5] .. index:: - statement: ** + single: **; in function calls In the same fashion, dictionaries can deliver keyword arguments with the ``**``\ -operator:: @@ -675,7 +675,8 @@ Function Annotations .. sectionauthor:: Zachary Ware .. index:: pair: function; annotations - single: -> (return annotation assignment) + single: ->; function annotations + single: :; function annotations :ref:`Function annotations ` are completely optional metadata information about the types used by user-defined functions (see :pep:`3107` and diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst index e68c9b10d03e..f5a394ad4008 100644 --- a/Doc/tutorial/introduction.rst +++ b/Doc/tutorial/introduction.rst @@ -11,6 +11,8 @@ with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command. +.. index:: single: #; comment + Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, ``#``, and extend to the end of the physical line. A comment may appear at the From webhook-mailer at python.org Fri Oct 26 04:18:55 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 26 Oct 2018 08:18:55 -0000 Subject: [Python-checkins] [3.7] bpo-35054: Add more index entries for symbols. (GH-10064). (GH-10120) Message-ID: https://github.com/python/cpython/commit/9a75b8470a2e0de5406edcabba140f023c99c6a9 commit: 9a75b8470a2e0de5406edcabba140f023c99c6a9 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-26T11:18:42+03:00 summary: [3.7] bpo-35054: Add more index entries for symbols. (GH-10064). (GH-10120) (cherry picked from commit ddb961d2abe5d5fde76d85b21a77e4e91e0043ad) Co-authored-by: Serhiy Storchaka files: M Doc/library/configparser.rst M Doc/library/constants.rst M Doc/library/datetime.rst M Doc/library/doctest.rst M Doc/library/gettext.rst M Doc/library/os.path.rst M Doc/library/os.rst M Doc/library/re.rst M Doc/library/site.rst M Doc/library/stdtypes.rst M Doc/library/string.rst M Doc/library/struct.rst M Doc/library/sys.rst M Doc/library/time.rst M Doc/library/traceback.rst M Doc/library/urllib.request.rst M Doc/library/winreg.rst M Doc/reference/compound_stmts.rst M Doc/reference/datamodel.rst M Doc/reference/executionmodel.rst M Doc/reference/expressions.rst M Doc/reference/import.rst M Doc/reference/lexical_analysis.rst M Doc/reference/simple_stmts.rst M Doc/tutorial/controlflow.rst M Doc/tutorial/introduction.rst diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 4430e39b7c5b..1c479bf9080a 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -295,6 +295,8 @@ On top of the core functionality, :class:`ConfigParser` supports interpolation. This means values can be preprocessed before returning them from ``get()`` calls. +.. index:: single: %; interpolation in configuration files + .. class:: BasicInterpolation() The default implementation used by :class:`ConfigParser`. It enables @@ -323,6 +325,8 @@ from ``get()`` calls. ``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/lumberjack`` as the value of ``my_dir``. +.. index:: single: $; interpolation in configuration files + .. class:: ExtendedInterpolation() An alternative handler for interpolation which implements a more advanced diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index 78f161963698..634ff00035b3 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -51,10 +51,11 @@ A small number of constants live in the built-in namespace. They are: See :exc:`NotImplementedError` for details on when to use it. +.. index:: single: ...; ellipsis literal .. data:: Ellipsis - The same as ``...``. Special value used mostly in conjunction with extended - slicing syntax for user-defined container data types. + The same as the ellipsis literal "``...``". Special value used mostly in conjunction + with extended slicing syntax for user-defined container data types. .. data:: __debug__ diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 7a276b139f5e..e7a0fdbc67a3 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1999,6 +1999,9 @@ Class attributes: The UTC timezone, ``timezone(timedelta(0))``. +.. index:: + single: %; datetime format + .. _strftime-strptime-behavior: :meth:`strftime` and :meth:`strptime` Behavior diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 587a0a09a947..d463356e7adc 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -321,6 +321,10 @@ but doctest isn't trying to do an exact emulation of any specific Python shell. NO!!! >>> +.. index:: + single: >>>; interpreter prompt + single: ...; interpreter prompt + Any expected output must immediately follow the final ``'>>> '`` or ``'... '`` line containing the code, and the expected output (if any) extends to the next ``'>>> '`` or all-whitespace line. @@ -481,6 +485,8 @@ Some details you should read once, but won't need to remember: to test a :exc:`SyntaxError` that omits the traceback header, you will need to manually add the traceback header line to your test example. +.. index:: single: ^; caret + * For some :exc:`SyntaxError`\ s, Python displays the character position of the syntax error, using a ``^`` marker:: @@ -532,6 +538,7 @@ doctest decides whether actual output matches an example's expected output: option will probably go away, but not for several years. +.. index:: single: .. data:: DONT_ACCEPT_BLANKLINE By default, if an expected output block contains a line containing only the @@ -551,6 +558,7 @@ doctest decides whether actual output matches an example's expected output: your source. +.. index:: single: ...; in doctests .. data:: ELLIPSIS When specified, an ellipsis marker (``...``) in the expected output can match @@ -686,6 +694,10 @@ useful unless you intend to extend :mod:`doctest` internals via subclassing: MY_FLAG = register_optionflag('MY_FLAG') +.. index:: + single: #; in doctests + single: +; in doctests + single: -; in doctests .. _doctest-directives: Directives diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index 407853c2d7ef..93748a2e4726 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -61,6 +61,7 @@ class-based API instead. *domain*, which is returned. +.. index:: single: _; gettext .. function:: gettext(message) Return the localized translation of *message*, based on the current global diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 75e7e5be9121..1f767170b5a5 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -152,6 +152,8 @@ the :mod:`glob` module.) Accepts a :term:`path-like object`. +.. index:: single: ~; home directory expansion + .. function:: expanduser(path) On Unix and Windows, return the argument with an initial component of ``~`` or @@ -175,6 +177,9 @@ the :mod:`glob` module.) .. versionchanged:: 3.6 Accepts a :term:`path-like object`. +.. index:: + single: $; environment variables expansion + single: %; environment variables expansion (Windows) .. function:: expandvars(path) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 907c6c307fb1..899780d140a1 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -4012,6 +4012,7 @@ are defined for all platforms. Higher-level operations on pathnames are defined in the :mod:`os.path` module. +.. index:: single: .; in pathnames .. data:: curdir The constant string used by the operating system to refer to the current @@ -4019,6 +4020,7 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: ..; in pathnames .. data:: pardir The constant string used by the operating system to refer to the parent @@ -4026,6 +4028,8 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: /; in pathnames +.. index:: single: \; in pathnames (Windows) .. data:: sep The character used by the operating system to separate pathname components. @@ -4035,6 +4039,7 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. useful. Also available via :mod:`os.path`. +.. index:: single: /; in pathnames .. data:: altsep An alternative character used by the operating system to separate pathname @@ -4043,12 +4048,14 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: .; in pathnames .. data:: extsep The character which separates the base filename from the extension; for example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`. +.. index:: single: :; path separator (POSIX) .. data:: pathsep The character conventionally used by the operating system to separate search diff --git a/Doc/library/re.rst b/Doc/library/re.rst index cc3516acfae7..f25d3d679a23 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -93,15 +93,21 @@ the expression ``(?:a{6})*`` matches any multiple of six ``'a'`` characters. The special characters are: +.. index:: single: .; in regular expressions + ``.`` (Dot.) In the default mode, this matches any character except a newline. If the :const:`DOTALL` flag has been specified, this matches any character including a newline. +.. index:: single: ^; in regular expressions + ``^`` (Caret.) Matches the start of the string, and in :const:`MULTILINE` mode also matches immediately after each newline. +.. index:: single: $; in regular expressions + ``$`` Matches the end of the string or just before the newline at the end of the string, and in :const:`MULTILINE` mode also matches before a newline. ``foo`` @@ -111,20 +117,31 @@ The special characters are: a single ``$`` in ``'foo\n'`` will find two (empty) matches: one just before the newline, and one at the end of the string. +.. index:: single: *; in regular expressions + ``*`` Causes the resulting RE to match 0 or more repetitions of the preceding RE, as many repetitions as are possible. ``ab*`` will match 'a', 'ab', or 'a' followed by any number of 'b's. +.. index:: single: +; in regular expressions + ``+`` Causes the resulting RE to match 1 or more repetitions of the preceding RE. ``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not match just 'a'. +.. index:: single: ?; in regular expressions + ``?`` Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. ``ab?`` will match either 'a' or 'ab'. +.. index:: + single: *?; in regular expressions + single: +?; in regular expressions + single: ??; in regular expressions + ``*?``, ``+?``, ``??`` The ``'*'``, ``'+'``, and ``'?'`` qualifiers are all :dfn:`greedy`; they match as much text as possible. Sometimes this behaviour isn't desired; if the RE @@ -134,6 +151,10 @@ The special characters are: characters as possible will be matched. Using the RE ``<.*?>`` will match only ``''``. +.. index:: + single: {; in regular expressions + single: }; in regular expressions + ``{m}`` Specifies that exactly *m* copies of the previous RE should be matched; fewer matches cause the entire RE not to match. For example, ``a{6}`` will match @@ -155,6 +176,8 @@ The special characters are: 6-character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters, while ``a{3,5}?`` will only match 3 characters. +.. index:: single: \; in regular expressions + ``\`` Either escapes special characters (permitting you to match characters like ``'*'``, ``'?'``, and so forth), or signals a special sequence; special @@ -168,12 +191,18 @@ The special characters are: is complicated and hard to understand, so it's highly recommended that you use raw strings for all but the simplest expressions. +.. index:: + single: [; in regular expressions + single: ]; in regular expressions + ``[]`` Used to indicate a set of characters. In a set: * Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, ``'m'``, or ``'k'``. + .. index:: single: -; in regular expressions + * Ranges of characters can be indicated by giving two characters and separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from ``00`` to ``59``, and @@ -185,10 +214,14 @@ The special characters are: ``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, ``'*'``, or ``')'``. + .. index:: single: \; in regular expressions + * Character classes such as ``\w`` or ``\S`` (defined below) are also accepted inside a set, although the characters they match depends on whether :const:`ASCII` or :const:`LOCALE` mode is in force. + .. index:: single: ^; in regular expressions + * Characters that are not within a range can be matched by :dfn:`complementing` the set. If the first character of the set is ``'^'``, all the characters that are *not* in the set will be matched. For example, ``[^5]`` will match @@ -200,6 +233,11 @@ The special characters are: place it at the beginning of the set. For example, both ``[()[\]{}]`` and ``[]()[{}]`` will both match a parenthesis. + .. .. index:: single: --; in regular expressions + .. .. index:: single: &&; in regular expressions + .. .. index:: single: ~~; in regular expressions + .. .. index:: single: ||; in regular expressions + * Support of nested sets and set operations as in `Unicode Technical Standard #18`_ might be added in the future. This would change the syntax, so to facilitate this change a :exc:`FutureWarning` will be raised @@ -214,6 +252,8 @@ The special characters are: :exc:`FutureWarning` is raised if a character set contains constructs that will change semantically in the future. +.. index:: single: |; in regular expressions + ``|`` ``A|B``, where *A* and *B* can be arbitrary REs, creates a regular expression that will match either *A* or *B*. An arbitrary number of REs can be separated by the @@ -225,6 +265,10 @@ The special characters are: greedy. To match a literal ``'|'``, use ``\|``, or enclose it inside a character class, as in ``[|]``. +.. index:: + single: (; in regular expressions + single: ); in regular expressions + ``(...)`` Matches whatever regular expression is inside the parentheses, and indicates the start and end of a group; the contents of a group can be retrieved after a match @@ -232,6 +276,8 @@ The special characters are: special sequence, described below. To match the literals ``'('`` or ``')'``, use ``\(`` or ``\)``, or enclose them inside a character class: ``[(]``, ``[)]``. +.. index:: single: (?; in regular expressions + ``(?...)`` This is an extension notation (a ``'?'`` following a ``'('`` is not meaningful otherwise). The first character after the ``'?'`` determines what the meaning @@ -253,6 +299,8 @@ The special characters are: :func:`re.compile` function. Flags should be used first in the expression string. +.. index:: single: (?:; in regular expressions + ``(?:...)`` A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group @@ -285,6 +333,8 @@ The special characters are: .. versionchanged:: 3.7 The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group. +.. index:: single: (?P<; in regular expressions + ``(?P...)`` Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group name *name*. Group names must be valid @@ -310,10 +360,14 @@ The special characters are: | | * ``\1`` | +---------------------------------------+----------------------------------+ +.. index:: single: (?P=; in regular expressions + ``(?P=name)`` A backreference to a named group; it matches whatever text was matched by the earlier group named *name*. +.. index:: single: (?#; in regular expressions + ``(?#...)`` A comment; the contents of the parentheses are simply ignored. @@ -322,11 +376,15 @@ The special characters are: called a :dfn:`lookahead assertion`. For example, ``Isaac (?=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``. +.. index:: single: (?!; in regular expressions + ``(?!...)`` Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only if it's *not* followed by ``'Asimov'``. +.. index:: single: (?<=; in regular expressions + ``(?<=...)`` Matches if the current position in the string is preceded by a match for ``...`` that ends at the current position. This is called a :dfn:`positive lookbehind @@ -352,6 +410,8 @@ The special characters are: .. versionchanged:: 3.5 Added support for group references of fixed length. +.. index:: single: (?`` will use the substring matched by the group named ``name``, as diff --git a/Doc/library/site.rst b/Doc/library/site.rst index 5b5ed93a1b7b..e6a2980953d8 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -49,6 +49,10 @@ the key "include-system-site-packages" set to anything other than "false" (case-insensitive), the system-level prefixes will still also be searched for site-packages; otherwise they won't. +.. index:: + single: #; comment + statement: import + A path configuration file is a file whose name has the form :file:`{name}.pth` and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added to ``sys.path``. Non-existing items diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index efa0a89490e1..130e58fa7ab9 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -248,8 +248,12 @@ and imaginary parts. builtin: int builtin: float builtin: complex - operator: + - operator: - + single: operator; + + single: +; unary operator + single: +; binary operator + single: operator; - + single: -; unary operator + single: -; binary operator operator: * operator: / operator: // @@ -2096,8 +2100,7 @@ expression support in the :mod:`re` module). single: string; interpolation, printf single: printf-style formatting single: sprintf-style formatting - single: % formatting - single: % interpolation + single: %; printf-style formatting .. note:: @@ -2125,16 +2128,24 @@ components, which must occur in this order: #. The ``'%'`` character, which marks the start of the specifier. +.. index:: + single: (; in printf-style formatting + single: ); in printf-style formatting + #. Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``). #. Conversion flags (optional), which affect the result of some conversion types. +.. index:: single: *; in printf-style formatting + #. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. +.. index:: single: .; in printf-style formatting + #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the @@ -2158,6 +2169,12 @@ sequential parameter list). The conversion flag characters are: +.. index:: + single: #; in printf-style formatting + single: -; in printf-style formatting + single: +; in printf-style formatting + single: space; in printf-style formatting + +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+=====================================================================+ @@ -3210,18 +3227,17 @@ place, and instead produce new objects. ---------------------------------- .. index:: - single: formatting, bytes (%) - single: formatting, bytearray (%) - single: interpolation, bytes (%) - single: interpolation, bytearray (%) + single: formatting; bytes (%) + single: formatting; bytearray (%) + single: interpolation; bytes (%) + single: interpolation; bytearray (%) single: bytes; formatting single: bytearray; formatting single: bytes; interpolation single: bytearray; interpolation single: printf-style formatting single: sprintf-style formatting - single: % formatting - single: % interpolation + single: %; printf-style formatting .. note:: @@ -3247,16 +3263,24 @@ components, which must occur in this order: #. The ``'%'`` character, which marks the start of the specifier. +.. index:: + single: (; in printf-style formatting + single: ); in printf-style formatting + #. Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``). #. Conversion flags (optional), which affect the result of some conversion types. +.. index:: single: *; in printf-style formatting + #. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. +.. index:: single: .; in printf-style formatting + #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the @@ -3280,6 +3304,12 @@ sequential parameter list). The conversion flag characters are: +.. index:: + single: #; in printf-style formatting + single: -; in printf-style formatting + single: +; in printf-style formatting + single: space; in printf-style formatting + +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+=====================================================================+ @@ -4582,6 +4612,7 @@ supports no special operations. There is exactly one null object, named It is written as ``None``. +.. index:: single: ...; ellipsis literal .. _bltin-ellipsis-object: The Ellipsis Object diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 0fec3df3e3c1..55913f8c07f5 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -192,6 +192,15 @@ subclasses can define their own format string syntax). The syntax is related to that of :ref:`formatted string literals `, but there are differences. +.. index:: + single: {; in string formatting + single: }; in string formatting + single: .; in string formatting + single: [; in string formatting + single: ]; in string formatting + single: !; in string formatting + single: :; in string formatting + Format strings contain "replacement fields" surrounded by curly braces ``{}``. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output. If you need to include a brace character in the @@ -323,6 +332,12 @@ affect the :func:`format` function. The meaning of the various alignment options is as follows: + .. index:: + single: <; in string formatting + single: >; in string formatting + single: =; in string formatting + single: ^; in string formatting + +---------+----------------------------------------------------------+ | Option | Meaning | +=========+==========================================================+ @@ -349,6 +364,11 @@ meaning in this case. The *sign* option is only valid for number types, and can be one of the following: + .. index:: + single: +; in string formatting + single: -; in string formatting + single: space; in string formatting + +---------+----------------------------------------------------------+ | Option | Meaning | +=========+==========================================================+ @@ -363,6 +383,8 @@ following: +---------+----------------------------------------------------------+ +.. index:: single: #; in string formatting + The ``'#'`` option causes the "alternate form" to be used for the conversion. The alternate form is defined differently for different types. This option is only valid for integer, float, complex and @@ -375,6 +397,8 @@ decimal-point character appears in the result of these conversions only if a digit follows it. In addition, for ``'g'`` and ``'G'`` conversions, trailing zeros are not removed from the result. +.. index:: single: ,; in string formatting + The ``','`` option signals the use of a comma for a thousands separator. For a locale aware separator, use the ``'n'`` integer presentation type instead. @@ -382,6 +406,8 @@ instead. .. versionchanged:: 3.1 Added the ``','`` option (see also :pep:`378`). +.. index:: single: _; in string formatting + The ``'_'`` option signals the use of an underscore for a thousands separator for floating point presentation types and for integer presentation type ``'d'``. For integer presentation types ``'b'``, @@ -668,6 +694,8 @@ formatting facilities in Python. As an example of a library built on template strings for i18n, see the `flufl.i18n `_ package. +.. index:: single: $; in template strings + Template strings support ``$``-based substitutions, using the following rules: * ``$$`` is an escape; it is replaced with a single ``$``. diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index f10fbe4fc0df..3b15158f3f8c 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -117,6 +117,13 @@ By default, C types are represented in the machine's native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler). +.. index:: + single: @; in struct format strings + single: =; in struct format strings + single: <; in struct format strings + single: >; in struct format strings + single: !; in struct format strings + Alternatively, the first character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table: diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 33a7b692ddec..358b11820c62 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1044,6 +1044,8 @@ always available. .. index:: single: interpreter prompts single: prompts, interpreter + single: >>>; interpreter prompt + single: ...; interpreter prompt Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is in interactive mode. Their initial diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 56f972c9d032..d76e089c23b4 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -369,6 +369,9 @@ Functions :pep:`475` for the rationale). +.. index:: + single: %; datetime format + .. function:: strftime(format[, t]) Convert a tuple or :class:`struct_time` representing a time as returned by @@ -500,6 +503,9 @@ Functions it is 3. +.. index:: + single: %; datetime format + .. function:: strptime(string[, format]) Parse a string representing a time according to a format. The return value diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 7ac3cacd3d1c..a21ef8ed9f36 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -44,7 +44,11 @@ The module defines the following functions: * if *tb* is not ``None``, it prints a header ``Traceback (most recent call last):`` + * it prints the exception *etype* and *value* after the stack trace + + .. index:: single: ^; caret + * if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error. diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index cbbec0cd8311..982f57f1fe61 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -297,7 +297,7 @@ The following classes are provided: Cause requests to go through a proxy. If *proxies* is given, it must be a dictionary mapping protocol names to URLs of proxies. The default is to read the list of proxies from the environment variables - :envvar:`_proxy`. If no proxy environment variables are set, then + ``_proxy``. If no proxy environment variables are set, then in a Windows environment proxy settings are obtained from the registry's Internet Settings section, and in a Mac OS X environment proxy information is retrieved from the OS X System Configuration Framework. diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst index 14f7896f840e..99be47fb4b9c 100644 --- a/Doc/library/winreg.rst +++ b/Doc/library/winreg.rst @@ -224,6 +224,9 @@ This module offers the following functions: See :ref:`above `. +.. index:: + single: %; environment variables expansion (Windows) + .. function:: ExpandEnvironmentStrings(str) Expands environment variable placeholders ``%NAME%`` in strings like diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index c49efa5889f2..812a7de483c6 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -21,6 +21,7 @@ also syntactically compound statements. .. index:: single: clause single: suite + single: ; A compound statement consists of one or more 'clauses.' A clause consists of a header and a 'suite.' The clause headers of a particular compound statement are @@ -84,8 +85,7 @@ The :keyword:`if` statement statement: if keyword: elif keyword: else - keyword: elif - keyword: else + single: :; compound statement The :keyword:`if` statement is used for conditional execution: @@ -111,6 +111,7 @@ The :keyword:`while` statement keyword: else pair: loop; statement keyword: else + single: :; compound statement The :keyword:`while` statement is used for repeated execution as long as an expression is true: @@ -149,6 +150,7 @@ The :keyword:`for` statement keyword: else pair: target; list object: sequence + single: :; compound statement The :keyword:`for` statement is used to iterate over the elements of a sequence (such as a string, tuple or list) or other iterable object: @@ -229,7 +231,9 @@ The :keyword:`try` statement statement: try keyword: except keyword: finally -.. index:: keyword: except + keyword: else + keyword: as + single: :; compound statement The :keyword:`try` statement specifies exception handlers and/or cleanup code for a group of statements: @@ -263,6 +267,8 @@ exception, the original search for a handler is canceled and a search starts for the new exception in the surrounding code and on the call stack (it is treated as if the entire :keyword:`try` statement raised the exception). +.. index:: single: as; except clause + When a matching except clause is found, the exception is assigned to the target specified after the :keyword:`as` keyword in that except clause, if present, and the except clause's suite is executed. All except clauses must have an @@ -374,8 +380,11 @@ The :keyword:`with` statement ============================= .. index:: - statement: with - single: as; with statement + statement: with + keyword: as + single: as; with statement + single: ,; with statement + single: :; compound statement The :keyword:`with` statement is used to wrap the execution of a block with methods defined by a context manager (see section :ref:`context-managers`). @@ -462,6 +471,10 @@ Function definitions object: function pair: function; name pair: name; binding + single: (; function definition + single: ); function definition + single: ,; parameter list + single: :; compound statement A function definition defines a user-defined function object (see section :ref:`types`): @@ -491,7 +504,7 @@ The function definition does not execute the function body; this gets executed only when the function is called. [#]_ .. index:: - statement: @ + single: @; function definition A function definition may be wrapped by one or more :term:`decorator` expressions. Decorator expressions are evaluated when the function is defined, in the scope @@ -514,6 +527,7 @@ except that the original function is not temporarily bound to the name ``func``. .. index:: triple: default; parameter; value single: argument; function definition + single: =; function definition When one or more :term:`parameters ` have the form *parameter* ``=`` *expression*, the function is said to have "default parameter values." For a @@ -540,8 +554,8 @@ e.g.:: return penguin .. index:: - statement: * - statement: ** + single: *; function definition + single: **; function definition Function call semantics are described in more detail in section :ref:`calls`. A function call always assigns values to all parameters mentioned in the parameter @@ -554,7 +568,10 @@ new empty mapping of the same type. Parameters after "``*``" or "``*identifier``" are keyword-only parameters and may only be passed used keyword arguments. -.. index:: pair: function; annotations +.. index:: + pair: function; annotations + single: ->; function annotations + single: :; function annotations Parameters may have annotations of the form "``: expression``" following the parameter name. Any parameter may have an annotation even those of the form @@ -616,6 +633,10 @@ Class definitions pair: execution; frame single: inheritance single: docstring + single: (; class definition + single: ); class definition + single: ,; expression list + single: :; compound statement A class definition defines a class object (see section :ref:`types`): @@ -654,6 +675,9 @@ the definition syntax. Class creation can be customized heavily using :ref:`metaclasses `. +.. index:: + single: @; class definition + Classes can also be decorated: just like when decorating functions, :: @f1(arg) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 735ecbf66939..55783506aa64 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -165,7 +165,9 @@ NotImplemented Ellipsis - .. index:: object: Ellipsis + .. index:: + object: Ellipsis + single: ...; ellipsis literal This type has a single value. There is a single object with this value. This object is accessed through the literal ``...`` or the built-in name @@ -1831,8 +1833,9 @@ Metaclasses ^^^^^^^^^^^ .. index:: - single: metaclass - builtin: type + single: metaclass + builtin: type + single: =; class definition By default, classes are constructed using :func:`type`. The class body is executed in a new namespace and the class name is bound locally to the diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index d08abdf3343f..5c83181440bc 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -52,7 +52,7 @@ Binding of names :dfn:`Names` refer to objects. Names are introduced by name binding operations. -.. index:: statement: from +.. index:: single: from; import statement The following constructs bind names: formal parameters to functions, :keyword:`import` statements, class and function definitions (these bind the diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 4bacac33ae7b..d210769225d4 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -128,7 +128,10 @@ value. Parenthesized forms ------------------- -.. index:: single: parenthesized form +.. index:: + single: parenthesized form + single: (; tuple display + single: ); tuple display A parenthesized form is an optional expression list enclosed in parentheses: @@ -146,8 +149,9 @@ immutable, the rules for literals apply (i.e., two occurrences of the empty tuple may or may not yield the same object). .. index:: - single: comma + single: comma; tuple display pair: tuple; display + single: ,; tuple display Note that tuples are not formed by the parentheses, but rather by use of the comma operator. The exception is the empty tuple, for which parentheses *are* @@ -168,6 +172,11 @@ called "displays", each of them in two flavors: * they are computed via a set of looping and filtering instructions, called a :dfn:`comprehension`. +.. index:: + single: for; in comprehensions + single: if; in comprehensions + single: async for; in comprehensions + Common syntax elements for comprehensions are: .. productionlist:: @@ -199,6 +208,9 @@ type, ``yield`` and ``yield from`` expressions are prohibited in the implicitly nested scope (in Python 3.7, such expressions emit :exc:`DeprecationWarning` when compiled, in Python 3.8+ they will emit :exc:`SyntaxError`). +.. index:: + single: await; in comprehensions + Since Python 3.6, in an :keyword:`async def` function, an :keyword:`async for` clause may be used to iterate over a :term:`asynchronous iterator`. A comprehension in an :keyword:`async def` function may consist of either a @@ -228,6 +240,9 @@ List displays pair: list; comprehensions pair: empty; list object: list + single: [; list expression + single: ]; list expression + single: ,; expression list A list display is a possibly empty series of expressions enclosed in square brackets: @@ -247,8 +262,12 @@ the list is constructed from the elements resulting from the comprehension. Set displays ------------ -.. index:: pair: set; display - object: set +.. index:: + pair: set; display + object: set + single: {; set expression + single: }; set expression + single: ,; expression list A set display is denoted by curly braces and distinguishable from dictionary displays by the lack of colons separating keys and values: @@ -271,9 +290,14 @@ dictionary. Dictionary displays ------------------- -.. index:: pair: dictionary; display - key, datum, key/datum pair - object: dictionary +.. index:: + pair: dictionary; display + key, datum, key/datum pair + object: dictionary + single: {; dictionary expression + single: }; dictionary expression + single: :; in dictionary expressions + single: ,; in dictionary displays A dictionary display is a possibly empty series of key/datum pairs enclosed in curly braces: @@ -292,7 +316,9 @@ used as a key into the dictionary to store the corresponding datum. This means that you can specify the same key multiple times in the key/datum list, and the final dictionary's value for that key will be the last one given. -.. index:: unpacking; dictionary, **; in dictionary displays +.. index:: + unpacking; dictionary + single: **; in dictionary displays A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand must be a :term:`mapping`. Each mapping item is added @@ -322,8 +348,11 @@ prevails. Generator expressions --------------------- -.. index:: pair: generator; expression - object: generator +.. index:: + pair: generator; expression + object: generator + single: (; generator expression + single: ); generator expression A generator expression is a compact generator notation in parentheses: @@ -379,6 +408,7 @@ Yield expressions .. index:: keyword: yield + keyword: from pair: yield; expression pair: generator; function @@ -444,6 +474,9 @@ finalized (by reaching a zero reference count or by being garbage collected), the generator-iterator's :meth:`~generator.close` method will be called, allowing any pending :keyword:`finally` clauses to execute. +.. index:: + single: from; yield from expression + When ``yield from `` is used, it treats the supplied expression as a subiterator. All values produced by that subiterator are passed directly to the caller of the current generator's methods. Any values passed in with @@ -723,7 +756,9 @@ syntax is: Attribute references -------------------- -.. index:: pair: attribute; reference +.. index:: + pair: attribute; reference + single: .; attribute reference An attribute reference is a primary followed by a period and a name: @@ -749,7 +784,10 @@ same attribute reference may yield different objects. Subscriptions ------------- -.. index:: single: subscription +.. index:: + single: subscription + single: [; subscription + single: ]; subscription .. index:: object: sequence @@ -806,6 +844,8 @@ Slicings .. index:: single: slicing single: slice + single: :; slicing + single: ,; slicing .. index:: object: sequence @@ -855,6 +895,10 @@ substituting ``None`` for missing expressions. object: callable single: call single: argument; call semantics + single: (; call + single: ); call + single: ,; argument list + single: =; in function calls .. _calls: @@ -1037,6 +1081,7 @@ a class instance: if that method was called. +.. index:: keyword: await .. _await: Await expression @@ -1056,6 +1101,10 @@ Can only be used inside a :term:`coroutine function`. The power operator ================== +.. index:: + pair: power; operation + operator: ** + The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right. The syntax is: @@ -1098,15 +1147,21 @@ All unary arithmetic and bitwise operations have the same priority: .. index:: single: negation single: minus + single: operator; - + single: -; unary operator The unary ``-`` (minus) operator yields the negation of its numeric argument. -.. index:: single: plus +.. index:: + single: plus + single: operator; + + single: +; unary operator The unary ``+`` (plus) operator yields its numeric argument unchanged. -.. index:: single: inversion - +.. index:: + single: inversion + operator: ~ The unary ``~`` (invert) operator yields the bitwise inversion of its integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. It only @@ -1136,7 +1191,9 @@ operators and one for additive operators: : `m_expr` "%" `u_expr` a_expr: `m_expr` | `a_expr` "+" `m_expr` | `a_expr` "-" `m_expr` -.. index:: single: multiplication +.. index:: + single: multiplication + operator: * The ``*`` (multiplication) operator yields the product of its arguments. The arguments must either both be numbers, or one argument must be an integer and @@ -1156,6 +1213,8 @@ builtin Python types implement this operator. .. index:: exception: ZeroDivisionError single: division + operator: / + operator: // The ``/`` (division) and ``//`` (floor division) operators yield the quotient of their arguments. The numeric arguments are first converted to a common type. @@ -1164,7 +1223,9 @@ integer; the result is that of mathematical division with the 'floor' function applied to the result. Division by zero raises the :exc:`ZeroDivisionError` exception. -.. index:: single: modulo +.. index:: + single: modulo + operator: % The ``%`` (modulo) operator yields the remainder from the division of the first argument by the second. The numeric arguments are first converted to a common @@ -1189,14 +1250,20 @@ The floor division operator, the modulo operator, and the :func:`divmod` function are not defined for complex numbers. Instead, convert to a floating point number using the :func:`abs` function if appropriate. -.. index:: single: addition +.. index:: + single: addition + single: operator; + + single: +; binary operator The ``+`` (addition) operator yields the sum of its arguments. The arguments must either both be numbers or both be sequences of the same type. In the former case, the numbers are converted to a common type and then added together. In the latter case, the sequences are concatenated. -.. index:: single: subtraction +.. index:: + single: subtraction + single: operator; - + single: -; binary operator The ``-`` (subtraction) operator yields the difference of its arguments. The numeric arguments are first converted to a common type. @@ -1207,7 +1274,10 @@ numeric arguments are first converted to a common type. Shifting operations =================== -.. index:: pair: shifting; operation +.. index:: + pair: shifting; operation + operator: << + operator: >> The shifting operations have lower priority than the arithmetic operations: @@ -1237,7 +1307,9 @@ Each of the three bitwise operations has a different priority level: xor_expr: `and_expr` | `xor_expr` "^" `and_expr` or_expr: `xor_expr` | `or_expr` "|" `xor_expr` -.. index:: pair: bitwise; and +.. index:: + pair: bitwise; and + operator: & The ``&`` operator yields the bitwise AND of its arguments, which must be integers. @@ -1245,6 +1317,7 @@ integers. .. index:: pair: bitwise; xor pair: exclusive; or + operator: ^ The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, which must be integers. @@ -1252,6 +1325,7 @@ must be integers. .. index:: pair: bitwise; or pair: inclusive; or + operator: | The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which must be integers. @@ -1262,9 +1336,15 @@ must be integers. Comparisons =========== -.. index:: single: comparison - -.. index:: pair: C; language +.. index:: + single: comparison + pair: C; language + operator: < + operator: > + operator: <= + operator: >= + operator: == + operator: != Unlike C, all comparison operations in Python have the same priority, which is lower than that of any arithmetic, shifting or bitwise operation. Also unlike @@ -1582,6 +1662,8 @@ Conditional expressions .. index:: pair: conditional; expression pair: ternary; operator + single: if; conditional expression + single: else; conditional expression .. productionlist:: conditional_expression: `or_test` ["if" `or_test` "else" `expression`] @@ -1608,10 +1690,11 @@ Lambdas pair: lambda; expression pair: lambda; form pair: anonymous; function + single: :; lambda expression .. productionlist:: - lambda_expr: "lambda" [`parameter_list`]: `expression` - lambda_expr_nocond: "lambda" [`parameter_list`]: `expression_nocond` + lambda_expr: "lambda" [`parameter_list`] ":" `expression` + lambda_expr_nocond: "lambda" [`parameter_list`] ":" `expression_nocond` Lambda expressions (sometimes called lambda forms) are used to create anonymous functions. The expression ``lambda parameters: expression`` yields a function @@ -1632,7 +1715,10 @@ annotations. Expression lists ================ -.. index:: pair: expression; list +.. index:: + pair: expression; list + single: comma; expression list + single: ,; expression list .. productionlist:: expression_list: `expression` ("," `expression`)* [","] @@ -1694,7 +1780,8 @@ their suffixes:: Operator precedence =================== -.. index:: pair: operator; precedence +.. index:: + pair: operator; precedence The following table summarizes the operator precedence in Python, from lowest precedence (least binding) to highest precedence (most binding). Operators in @@ -1742,7 +1829,7 @@ precedence and have a left-to-right chaining feature as described in the +-----------------------------------------------+-------------------------------------+ | ``**`` | Exponentiation [#]_ | +-----------------------------------------------+-------------------------------------+ -| ``await`` ``x`` | Await expression | +| :keyword:`await` ``x`` | Await expression | +-----------------------------------------------+-------------------------------------+ | ``x[index]``, ``x[index:index]``, | Subscription, slicing, | | ``x(arguments...)``, ``x.attribute`` | call, attribute reference | diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 44b5b818aa82..7c4f275a4342 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -127,8 +127,8 @@ Namespace packages ------------------ .. index:: - pair:: package; namespace - pair:: package; portion + pair: package; namespace + pair: package; portion A namespace package is a composite of various :term:`portions `, where each portion contributes a subpackage to the parent package. Portions diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index 84e8c783838b..72da30a3773f 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -65,6 +65,7 @@ Comments -------- .. index:: comment, hash character + single: #; comment A comment starts with a hash character (``#``) that is not part of a string literal, and ends at the end of the physical line. A comment signifies the end @@ -78,6 +79,7 @@ Encoding declarations --------------------- .. index:: source character set, encoding declarations (source file) + single: #; source encoding declaration If a comment in the first or second line of the Python script matches the regular expression ``coding[=:]\s*([-\w.]+)``, this comment is processed as an @@ -349,6 +351,9 @@ exactly as written here: assert del global not with async elif if or yield +.. index:: + single: _, identifiers + single: __, identifiers .. _id-classes: Reserved classes of identifiers @@ -395,13 +400,16 @@ Literals Literals are notations for constant values of some built-in types. +.. index:: string literal, bytes literal, ASCII + single: '; string literal + single: "; string literal + single: u'; string literal + single: u"; string literal .. _strings: String and Bytes literals ------------------------- -.. index:: string literal, bytes literal, ASCII - String literals are described by the following lexical definitions: .. productionlist:: @@ -434,6 +442,8 @@ declaration; it is UTF-8 if no encoding declaration is given in the source file; see section :ref:`encodings`. .. index:: triple-quoted string, Unicode Consortium, raw string + single: """; string literal + single: '''; string literal In plain English: Both types of literals can be enclosed in matching single quotes (``'``) or double quotes (``"``). They can also be enclosed in matching groups @@ -442,11 +452,19 @@ of three single or double quotes (these are generally referred to as characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character. +.. index:: + single: b'; bytes literal + single: b"; bytes literal + Bytes literals are always prefixed with ``'b'`` or ``'B'``; they produce an instance of the :class:`bytes` type instead of the :class:`str` type. They may only contain ASCII characters; bytes with a numeric value of 128 or greater must be expressed with escapes. +.. index:: + single: r'; raw string literal + single: r"; raw string literal + Both string and bytes literals may optionally be prefixed with a letter ``'r'`` or ``'R'``; such strings are called :dfn:`raw strings` and treat backslashes as literal characters. As a result, in string literals, ``'\U'`` and ``'\u'`` @@ -463,6 +481,10 @@ is not supported. to simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:`414` for more information. +.. index:: + single: f'; formatted string literal + single: f"; formatted string literal + A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with ``'r'``, but not with ``'b'`` or ``'u'``, therefore raw @@ -473,6 +495,19 @@ retained), except that three unescaped quotes in a row terminate the literal. ( "quote" is the character used to open the literal, i.e. either ``'`` or ``"``.) .. index:: physical line, escape sequence, Standard C, C + single: \; escape sequence + single: \\; escape sequence + single: \a; escape sequence + single: \b; escape sequence + single: \f; escape sequence + single: \n; escape sequence + single: \r; escape sequence + single: \t; escape sequence + single: \v; escape sequence + single: \x; escape sequence + single: \N; escape sequence + single: \u; escape sequence + single: \U; escape sequence Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string and bytes literals are interpreted according to rules similar to those used by @@ -601,6 +636,10 @@ and formatted string literals may be concatenated with plain string literals. single: string; formatted literal single: string; interpolated literal single: f-string + single: {; in formatted string literal + single: }; in formatted string literal + single: !; in formatted string literal + single: :; in formatted string literal .. _f-strings: Formatted string literals @@ -735,6 +774,12 @@ actually an expression composed of the unary operator '``-``' and the literal ``1``. +.. index:: + single: 0b; integer literal + single: 0o; integer literal + single: 0x; integer literal + single: _; in numeric literal + .. _integers: Integer literals @@ -775,6 +820,10 @@ Some examples of integer literals:: Underscores are now allowed for grouping purposes in literals. +.. index:: + single: .; in numeric literal + single: e; in numeric literal + single: _; in numeric literal .. _floating: Floating point literals @@ -803,6 +852,8 @@ Some examples of floating point literals:: Underscores are now allowed for grouping purposes in literals. +.. index:: + single: j; in numeric literal .. _imaginary: Imaginary literals diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 9b93601135de..04ed499701c1 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -112,6 +112,12 @@ unacceptable. The rules observed by various types and the exceptions raised are given with the definition of the object types (see section :ref:`types`). .. index:: triple: target; list; assignment + single: ,; in target list + single: *; in assignment target list + single: [; in assignment target list + single: ]; in assignment target list + single: (; in assignment target list + single: ); in assignment target list Assignment of an object to a target list, optionally enclosed in parentheses or square brackets, is recursively defined as follows. @@ -321,6 +327,7 @@ Annotated assignment statements .. index:: pair: annotated; assignment single: statement; assignment, annotated + single: :; annotated variable Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement: @@ -372,6 +379,7 @@ The :keyword:`assert` statement .. index:: statement: assert pair: debugging; assertions + single: ,; expression list Assert statements are a convenient way to insert debugging assertions into a program: @@ -713,6 +721,9 @@ The :keyword:`import` statement single: module; importing pair: name; binding keyword: from + keyword: as + exception: ImportError + single: ,; import statement .. productionlist:: import_stmt: "import" `module` ["as" `identifier`] ("," `module` ["as" `identifier`])* @@ -762,8 +773,7 @@ available in the local namespace in one of three ways: .. index:: pair: name; binding - keyword: from - exception: ImportError + single: from; import statement The :keyword:`from` form uses a slightly more complex process: @@ -787,6 +797,8 @@ Examples:: from foo.bar import baz # foo.bar.baz imported and bound as baz from foo import attr # foo imported and foo.attr bound as attr +.. index:: single: *; import statement + If the list of identifiers is replaced by a star (``'*'``), all public names defined in the module are bound in the local namespace for the scope where the :keyword:`import` statement occurs. @@ -832,7 +844,9 @@ determine dynamically the modules to be loaded. Future statements ----------------- -.. index:: pair: future; statement +.. index:: + pair: future; statement + single: __future__; future statement A :dfn:`future statement` is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a @@ -919,6 +933,7 @@ The :keyword:`global` statement .. index:: statement: global triple: global; name; binding + single: ,; identifier list .. productionlist:: global_stmt: "global" `identifier` ("," `identifier`)* @@ -963,6 +978,7 @@ The :keyword:`nonlocal` statement ================================= .. index:: statement: nonlocal + single: ,; identifier list .. productionlist:: nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)* diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 4bcdafd73352..f87cd4decd02 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -526,7 +526,7 @@ Arbitrary Argument Lists ------------------------ .. index:: - statement: * + single: *; in function calls Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -570,7 +570,7 @@ or tuple:: [3, 4, 5] .. index:: - statement: ** + single: **; in function calls In the same fashion, dictionaries can deliver keyword arguments with the ``**``\ -operator:: @@ -675,7 +675,8 @@ Function Annotations .. sectionauthor:: Zachary Ware .. index:: pair: function; annotations - single: -> (return annotation assignment) + single: ->; function annotations + single: :; function annotations :ref:`Function annotations ` are completely optional metadata information about the types used by user-defined functions (see :pep:`3107` and diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst index e68c9b10d03e..f5a394ad4008 100644 --- a/Doc/tutorial/introduction.rst +++ b/Doc/tutorial/introduction.rst @@ -11,6 +11,8 @@ with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command. +.. index:: single: #; comment + Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, ``#``, and extend to the end of the physical line. A comment may appear at the From webhook-mailer at python.org Fri Oct 26 04:19:01 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 26 Oct 2018 08:19:01 -0000 Subject: [Python-checkins] [3.6] bpo-35054: Add more index entries for symbols. (GH-10064). (GH-10119) Message-ID: https://github.com/python/cpython/commit/e825b4e1a9bbe1d4c561f4cbbe6857653ef13a15 commit: e825b4e1a9bbe1d4c561f4cbbe6857653ef13a15 branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-10-26T11:18:57+03:00 summary: [3.6] bpo-35054: Add more index entries for symbols. (GH-10064). (GH-10119) (cherry picked from commit ddb961d2abe5d5fde76d85b21a77e4e91e0043ad) Co-authored-by: Serhiy Storchaka files: M Doc/library/configparser.rst M Doc/library/constants.rst M Doc/library/datetime.rst M Doc/library/doctest.rst M Doc/library/gettext.rst M Doc/library/os.path.rst M Doc/library/os.rst M Doc/library/re.rst M Doc/library/site.rst M Doc/library/stdtypes.rst M Doc/library/string.rst M Doc/library/struct.rst M Doc/library/sys.rst M Doc/library/time.rst M Doc/library/traceback.rst M Doc/library/urllib.request.rst M Doc/library/winreg.rst M Doc/reference/compound_stmts.rst M Doc/reference/datamodel.rst M Doc/reference/executionmodel.rst M Doc/reference/expressions.rst M Doc/reference/import.rst M Doc/reference/lexical_analysis.rst M Doc/reference/simple_stmts.rst M Doc/tutorial/controlflow.rst M Doc/tutorial/introduction.rst diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 4885863e8ee8..88dd50c7db32 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -291,6 +291,8 @@ On top of the core functionality, :class:`ConfigParser` supports interpolation. This means values can be preprocessed before returning them from ``get()`` calls. +.. index:: single: %; interpolation in configuration files + .. class:: BasicInterpolation() The default implementation used by :class:`ConfigParser`. It enables @@ -319,6 +321,8 @@ from ``get()`` calls. ``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/lumberjack`` as the value of ``my_dir``. +.. index:: single: $; interpolation in configuration files + .. class:: ExtendedInterpolation() An alternative handler for interpolation which implements a more advanced diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index 78f161963698..634ff00035b3 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -51,10 +51,11 @@ A small number of constants live in the built-in namespace. They are: See :exc:`NotImplementedError` for details on when to use it. +.. index:: single: ...; ellipsis literal .. data:: Ellipsis - The same as ``...``. Special value used mostly in conjunction with extended - slicing syntax for user-defined container data types. + The same as the ellipsis literal "``...``". Special value used mostly in conjunction + with extended slicing syntax for user-defined container data types. .. data:: __debug__ diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 88bc328e3a1d..c2a2928fca7f 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1927,6 +1927,9 @@ Class attributes: The UTC timezone, ``timezone(timedelta(0))``. +.. index:: + single: %; datetime format + .. _strftime-strptime-behavior: :meth:`strftime` and :meth:`strptime` Behavior diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 587a0a09a947..d463356e7adc 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -321,6 +321,10 @@ but doctest isn't trying to do an exact emulation of any specific Python shell. NO!!! >>> +.. index:: + single: >>>; interpreter prompt + single: ...; interpreter prompt + Any expected output must immediately follow the final ``'>>> '`` or ``'... '`` line containing the code, and the expected output (if any) extends to the next ``'>>> '`` or all-whitespace line. @@ -481,6 +485,8 @@ Some details you should read once, but won't need to remember: to test a :exc:`SyntaxError` that omits the traceback header, you will need to manually add the traceback header line to your test example. +.. index:: single: ^; caret + * For some :exc:`SyntaxError`\ s, Python displays the character position of the syntax error, using a ``^`` marker:: @@ -532,6 +538,7 @@ doctest decides whether actual output matches an example's expected output: option will probably go away, but not for several years. +.. index:: single: .. data:: DONT_ACCEPT_BLANKLINE By default, if an expected output block contains a line containing only the @@ -551,6 +558,7 @@ doctest decides whether actual output matches an example's expected output: your source. +.. index:: single: ...; in doctests .. data:: ELLIPSIS When specified, an ellipsis marker (``...``) in the expected output can match @@ -686,6 +694,10 @@ useful unless you intend to extend :mod:`doctest` internals via subclassing: MY_FLAG = register_optionflag('MY_FLAG') +.. index:: + single: #; in doctests + single: +; in doctests + single: -; in doctests .. _doctest-directives: Directives diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index 407853c2d7ef..93748a2e4726 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -61,6 +61,7 @@ class-based API instead. *domain*, which is returned. +.. index:: single: _; gettext .. function:: gettext(message) Return the localized translation of *message*, based on the current global diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 06493f9505d3..0bcc85691a96 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -152,6 +152,8 @@ the :mod:`glob` module.) Accepts a :term:`path-like object`. +.. index:: single: ~; home directory expansion + .. function:: expanduser(path) On Unix and Windows, return the argument with an initial component of ``~`` or @@ -175,6 +177,9 @@ the :mod:`glob` module.) .. versionchanged:: 3.6 Accepts a :term:`path-like object`. +.. index:: + single: $; environment variables expansion + single: %; environment variables expansion (Windows) .. function:: expandvars(path) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index e9ee51416bc0..c88ce23646cd 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3867,6 +3867,7 @@ are defined for all platforms. Higher-level operations on pathnames are defined in the :mod:`os.path` module. +.. index:: single: .; in pathnames .. data:: curdir The constant string used by the operating system to refer to the current @@ -3874,6 +3875,7 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: ..; in pathnames .. data:: pardir The constant string used by the operating system to refer to the parent @@ -3881,6 +3883,8 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: /; in pathnames +.. index:: single: \; in pathnames (Windows) .. data:: sep The character used by the operating system to separate pathname components. @@ -3890,6 +3894,7 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. useful. Also available via :mod:`os.path`. +.. index:: single: /; in pathnames .. data:: altsep An alternative character used by the operating system to separate pathname @@ -3898,12 +3903,14 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module. :mod:`os.path`. +.. index:: single: .; in pathnames .. data:: extsep The character which separates the base filename from the extension; for example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`. +.. index:: single: :; path separator (POSIX) .. data:: pathsep The character conventionally used by the operating system to separate search diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 82632b9232b3..7390298df30d 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -93,15 +93,21 @@ the expression ``(?:a{6})*`` matches any multiple of six ``'a'`` characters. The special characters are: +.. index:: single: .; in regular expressions + ``.`` (Dot.) In the default mode, this matches any character except a newline. If the :const:`DOTALL` flag has been specified, this matches any character including a newline. +.. index:: single: ^; in regular expressions + ``^`` (Caret.) Matches the start of the string, and in :const:`MULTILINE` mode also matches immediately after each newline. +.. index:: single: $; in regular expressions + ``$`` Matches the end of the string or just before the newline at the end of the string, and in :const:`MULTILINE` mode also matches before a newline. ``foo`` @@ -111,20 +117,31 @@ The special characters are: a single ``$`` in ``'foo\n'`` will find two (empty) matches: one just before the newline, and one at the end of the string. +.. index:: single: *; in regular expressions + ``*`` Causes the resulting RE to match 0 or more repetitions of the preceding RE, as many repetitions as are possible. ``ab*`` will match 'a', 'ab', or 'a' followed by any number of 'b's. +.. index:: single: +; in regular expressions + ``+`` Causes the resulting RE to match 1 or more repetitions of the preceding RE. ``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not match just 'a'. +.. index:: single: ?; in regular expressions + ``?`` Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. ``ab?`` will match either 'a' or 'ab'. +.. index:: + single: *?; in regular expressions + single: +?; in regular expressions + single: ??; in regular expressions + ``*?``, ``+?``, ``??`` The ``'*'``, ``'+'``, and ``'?'`` qualifiers are all :dfn:`greedy`; they match as much text as possible. Sometimes this behaviour isn't desired; if the RE @@ -134,6 +151,10 @@ The special characters are: characters as possible will be matched. Using the RE ``<.*?>`` will match only ``''``. +.. index:: + single: {; in regular expressions + single: }; in regular expressions + ``{m}`` Specifies that exactly *m* copies of the previous RE should be matched; fewer matches cause the entire RE not to match. For example, ``a{6}`` will match @@ -155,6 +176,8 @@ The special characters are: 6-character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters, while ``a{3,5}?`` will only match 3 characters. +.. index:: single: \; in regular expressions + ``\`` Either escapes special characters (permitting you to match characters like ``'*'``, ``'?'``, and so forth), or signals a special sequence; special @@ -168,12 +191,18 @@ The special characters are: is complicated and hard to understand, so it's highly recommended that you use raw strings for all but the simplest expressions. +.. index:: + single: [; in regular expressions + single: ]; in regular expressions + ``[]`` Used to indicate a set of characters. In a set: * Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, ``'m'``, or ``'k'``. + .. index:: single: -; in regular expressions + * Ranges of characters can be indicated by giving two characters and separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from ``00`` to ``59``, and @@ -185,10 +214,14 @@ The special characters are: ``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, ``'*'``, or ``')'``. + .. index:: single: \; in regular expressions + * Character classes such as ``\w`` or ``\S`` (defined below) are also accepted inside a set, although the characters they match depends on whether :const:`ASCII` or :const:`LOCALE` mode is in force. + .. index:: single: ^; in regular expressions + * Characters that are not within a range can be matched by :dfn:`complementing` the set. If the first character of the set is ``'^'``, all the characters that are *not* in the set will be matched. For example, ``[^5]`` will match @@ -200,6 +233,8 @@ The special characters are: place it at the beginning of the set. For example, both ``[()[\]{}]`` and ``[]()[{}]`` will both match a parenthesis. +.. index:: single: |; in regular expressions + ``|`` ``A|B``, where *A* and *B* can be arbitrary REs, creates a regular expression that will match either *A* or *B*. An arbitrary number of REs can be separated by the @@ -211,6 +246,10 @@ The special characters are: greedy. To match a literal ``'|'``, use ``\|``, or enclose it inside a character class, as in ``[|]``. +.. index:: + single: (; in regular expressions + single: ); in regular expressions + ``(...)`` Matches whatever regular expression is inside the parentheses, and indicates the start and end of a group; the contents of a group can be retrieved after a match @@ -218,6 +257,8 @@ The special characters are: special sequence, described below. To match the literals ``'('`` or ``')'``, use ``\(`` or ``\)``, or enclose them inside a character class: ``[(]``, ``[)]``. +.. index:: single: (?; in regular expressions + ``(?...)`` This is an extension notation (a ``'?'`` following a ``'('`` is not meaningful otherwise). The first character after the ``'?'`` determines what the meaning @@ -239,6 +280,8 @@ The special characters are: :func:`re.compile` function. Flags should be used first in the expression string. +.. index:: single: (?:; in regular expressions + ``(?:...)`` A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group @@ -255,6 +298,8 @@ The special characters are: .. versionadded:: 3.6 +.. index:: single: (?P<; in regular expressions + ``(?P...)`` Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group name *name*. Group names must be valid @@ -280,10 +325,14 @@ The special characters are: | | * ``\1`` | +---------------------------------------+----------------------------------+ +.. index:: single: (?P=; in regular expressions + ``(?P=name)`` A backreference to a named group; it matches whatever text was matched by the earlier group named *name*. +.. index:: single: (?#; in regular expressions + ``(?#...)`` A comment; the contents of the parentheses are simply ignored. @@ -292,11 +341,15 @@ The special characters are: called a :dfn:`lookahead assertion`. For example, ``Isaac (?=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``. +.. index:: single: (?!; in regular expressions + ``(?!...)`` Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only if it's *not* followed by ``'Asimov'``. +.. index:: single: (?<=; in regular expressions + ``(?<=...)`` Matches if the current position in the string is preceded by a match for ``...`` that ends at the current position. This is called a :dfn:`positive lookbehind @@ -322,6 +375,8 @@ The special characters are: .. versionchanged:: 3.5 Added support for group references of fixed length. +.. index:: single: (?`` will use the substring matched by the group named ``name``, as diff --git a/Doc/library/site.rst b/Doc/library/site.rst index dabb4fee514c..fa69997e950c 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -49,6 +49,10 @@ the key "include-system-site-packages" set to anything other than "false" (case-insensitive), the system-level prefixes will still also be searched for site-packages; otherwise they won't. +.. index:: + single: #; comment + statement: import + A path configuration file is a file whose name has the form :file:`{name}.pth` and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added to ``sys.path``. Non-existing items diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 6de7e1a2df5a..0799e5a7997c 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -248,8 +248,12 @@ and imaginary parts. builtin: int builtin: float builtin: complex - operator: + - operator: - + single: operator; + + single: +; unary operator + single: +; binary operator + single: operator; - + single: -; unary operator + single: -; binary operator operator: * operator: / operator: // @@ -2087,8 +2091,7 @@ expression support in the :mod:`re` module). single: string; interpolation, printf single: printf-style formatting single: sprintf-style formatting - single: % formatting - single: % interpolation + single: %; printf-style formatting .. note:: @@ -2115,16 +2118,24 @@ components, which must occur in this order: #. The ``'%'`` character, which marks the start of the specifier. +.. index:: + single: (; in printf-style formatting + single: ); in printf-style formatting + #. Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``). #. Conversion flags (optional), which affect the result of some conversion types. +.. index:: single: *; in printf-style formatting + #. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. +.. index:: single: .; in printf-style formatting + #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the @@ -2148,6 +2159,12 @@ sequential parameter list). The conversion flag characters are: +.. index:: + single: #; in printf-style formatting + single: -; in printf-style formatting + single: +; in printf-style formatting + single: space; in printf-style formatting + +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+=====================================================================+ @@ -3182,18 +3199,17 @@ place, and instead produce new objects. ---------------------------------- .. index:: - single: formatting, bytes (%) - single: formatting, bytearray (%) - single: interpolation, bytes (%) - single: interpolation, bytearray (%) + single: formatting; bytes (%) + single: formatting; bytearray (%) + single: interpolation; bytes (%) + single: interpolation; bytearray (%) single: bytes; formatting single: bytearray; formatting single: bytes; interpolation single: bytearray; interpolation single: printf-style formatting single: sprintf-style formatting - single: % formatting - single: % interpolation + single: %; printf-style formatting .. note:: @@ -3219,16 +3235,24 @@ components, which must occur in this order: #. The ``'%'`` character, which marks the start of the specifier. +.. index:: + single: (; in printf-style formatting + single: ); in printf-style formatting + #. Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``). #. Conversion flags (optional), which affect the result of some conversion types. +.. index:: single: *; in printf-style formatting + #. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. +.. index:: single: .; in printf-style formatting + #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the @@ -3252,6 +3276,12 @@ sequential parameter list). The conversion flag characters are: +.. index:: + single: #; in printf-style formatting + single: -; in printf-style formatting + single: +; in printf-style formatting + single: space; in printf-style formatting + +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+=====================================================================+ @@ -4527,6 +4557,7 @@ supports no special operations. There is exactly one null object, named It is written as ``None``. +.. index:: single: ...; ellipsis literal .. _bltin-ellipsis-object: The Ellipsis Object diff --git a/Doc/library/string.rst b/Doc/library/string.rst index a87d285e0d27..674b48b49e72 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -192,6 +192,15 @@ subclasses can define their own format string syntax). The syntax is related to that of :ref:`formatted string literals `, but there are differences. +.. index:: + single: {; in string formatting + single: }; in string formatting + single: .; in string formatting + single: [; in string formatting + single: ]; in string formatting + single: !; in string formatting + single: :; in string formatting + Format strings contain "replacement fields" surrounded by curly braces ``{}``. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output. If you need to include a brace character in the @@ -323,6 +332,12 @@ affect the :func:`format` function. The meaning of the various alignment options is as follows: + .. index:: + single: <; in string formatting + single: >; in string formatting + single: =; in string formatting + single: ^; in string formatting + +---------+----------------------------------------------------------+ | Option | Meaning | +=========+==========================================================+ @@ -349,6 +364,11 @@ meaning in this case. The *sign* option is only valid for number types, and can be one of the following: + .. index:: + single: +; in string formatting + single: -; in string formatting + single: space; in string formatting + +---------+----------------------------------------------------------+ | Option | Meaning | +=========+==========================================================+ @@ -363,6 +383,8 @@ following: +---------+----------------------------------------------------------+ +.. index:: single: #; in string formatting + The ``'#'`` option causes the "alternate form" to be used for the conversion. The alternate form is defined differently for different types. This option is only valid for integer, float, complex and @@ -375,6 +397,8 @@ decimal-point character appears in the result of these conversions only if a digit follows it. In addition, for ``'g'`` and ``'G'`` conversions, trailing zeros are not removed from the result. +.. index:: single: ,; in string formatting + The ``','`` option signals the use of a comma for a thousands separator. For a locale aware separator, use the ``'n'`` integer presentation type instead. @@ -382,6 +406,8 @@ instead. .. versionchanged:: 3.1 Added the ``','`` option (see also :pep:`378`). +.. index:: single: _; in string formatting + The ``'_'`` option signals the use of an underscore for a thousands separator for floating point presentation types and for integer presentation type ``'d'``. For integer presentation types ``'b'``, @@ -660,9 +686,17 @@ Nesting arguments and more complex examples:: Template strings ---------------- -Templates provide simpler string substitutions as described in :pep:`292`. -Instead of the normal ``%``\ -based substitutions, Templates support ``$``\ --based substitutions, using the following rules: +Template strings provide simpler string substitutions as described in +:pep:`292`. A primary use case for template strings is for +internationalization (i18n) since in that context, the simpler syntax and +functionality makes it easier to translate than other built-in string +formatting facilities in Python. As an example of a library built on template +strings for i18n, see the +`flufl.i18n `_ package. + +.. index:: single: $; in template strings + +Template strings support ``$``-based substitutions, using the following rules: * ``$$`` is an escape; it is replaced with a single ``$``. diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index cc3017b5fcb3..a0679f374409 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -116,6 +116,13 @@ By default, C types are represented in the machine's native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler). +.. index:: + single: @; in struct format strings + single: =; in struct format strings + single: <; in struct format strings + single: >; in struct format strings + single: !; in struct format strings + Alternatively, the first character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table: diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index f419c4501e0a..91984667bf2f 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -963,6 +963,8 @@ always available. .. index:: single: interpreter prompts single: prompts, interpreter + single: >>>; interpreter prompt + single: ...; interpreter prompt Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is in interactive mode. Their initial diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 0624099f6752..7839f43278f3 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -308,6 +308,9 @@ Functions :pep:`475` for the rationale). +.. index:: + single: %; datetime format + .. function:: strftime(format[, t]) Convert a tuple or :class:`struct_time` representing a time as returned by @@ -439,6 +442,9 @@ Functions it is 3. +.. index:: + single: %; datetime format + .. function:: strptime(string[, format]) Parse a string representing a time according to a format. The return value diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 7ac3cacd3d1c..a21ef8ed9f36 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -44,7 +44,11 @@ The module defines the following functions: * if *tb* is not ``None``, it prints a header ``Traceback (most recent call last):`` + * it prints the exception *etype* and *value* after the stack trace + + .. index:: single: ^; caret + * if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error. diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index 0890f74ca793..8af97f0746df 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -297,7 +297,7 @@ The following classes are provided: Cause requests to go through a proxy. If *proxies* is given, it must be a dictionary mapping protocol names to URLs of proxies. The default is to read the list of proxies from the environment variables - :envvar:`_proxy`. If no proxy environment variables are set, then + ``_proxy``. If no proxy environment variables are set, then in a Windows environment proxy settings are obtained from the registry's Internet Settings section, and in a Mac OS X environment proxy information is retrieved from the OS X System Configuration Framework. diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst index 14f7896f840e..99be47fb4b9c 100644 --- a/Doc/library/winreg.rst +++ b/Doc/library/winreg.rst @@ -224,6 +224,9 @@ This module offers the following functions: See :ref:`above `. +.. index:: + single: %; environment variables expansion (Windows) + .. function:: ExpandEnvironmentStrings(str) Expands environment variable placeholders ``%NAME%`` in strings like diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index bd5cb104a0f5..605b919fe4af 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -21,6 +21,7 @@ also syntactically compound statements. .. index:: single: clause single: suite + single: ; A compound statement consists of one or more 'clauses.' A clause consists of a header and a 'suite.' The clause headers of a particular compound statement are @@ -84,8 +85,7 @@ The :keyword:`if` statement statement: if keyword: elif keyword: else - keyword: elif - keyword: else + single: :; compound statement The :keyword:`if` statement is used for conditional execution: @@ -111,6 +111,7 @@ The :keyword:`while` statement keyword: else pair: loop; statement keyword: else + single: :; compound statement The :keyword:`while` statement is used for repeated execution as long as an expression is true: @@ -149,6 +150,7 @@ The :keyword:`for` statement keyword: else pair: target; list object: sequence + single: :; compound statement The :keyword:`for` statement is used to iterate over the elements of a sequence (such as a string, tuple or list) or other iterable object: @@ -229,7 +231,9 @@ The :keyword:`try` statement statement: try keyword: except keyword: finally -.. index:: keyword: except + keyword: else + keyword: as + single: :; compound statement The :keyword:`try` statement specifies exception handlers and/or cleanup code for a group of statements: @@ -263,6 +267,8 @@ exception, the original search for a handler is canceled and a search starts for the new exception in the surrounding code and on the call stack (it is treated as if the entire :keyword:`try` statement raised the exception). +.. index:: single: as; except clause + When a matching except clause is found, the exception is assigned to the target specified after the :keyword:`as` keyword in that except clause, if present, and the except clause's suite is executed. All except clauses must have an @@ -374,8 +380,11 @@ The :keyword:`with` statement ============================= .. index:: - statement: with - single: as; with statement + statement: with + keyword: as + single: as; with statement + single: ,; with statement + single: :; compound statement The :keyword:`with` statement is used to wrap the execution of a block with methods defined by a context manager (see section :ref:`context-managers`). @@ -462,6 +471,10 @@ Function definitions object: function pair: function; name pair: name; binding + single: (; function definition + single: ); function definition + single: ,; parameter list + single: :; compound statement A function definition defines a user-defined function object (see section :ref:`types`): @@ -491,7 +504,7 @@ The function definition does not execute the function body; this gets executed only when the function is called. [#]_ .. index:: - statement: @ + single: @; function definition A function definition may be wrapped by one or more :term:`decorator` expressions. Decorator expressions are evaluated when the function is defined, in the scope @@ -514,6 +527,7 @@ except that the original function is not temporarily bound to the name ``func``. .. index:: triple: default; parameter; value single: argument; function definition + single: =; function definition When one or more :term:`parameters ` have the form *parameter* ``=`` *expression*, the function is said to have "default parameter values." For a @@ -540,8 +554,8 @@ e.g.:: return penguin .. index:: - statement: * - statement: ** + single: *; function definition + single: **; function definition Function call semantics are described in more detail in section :ref:`calls`. A function call always assigns values to all parameters mentioned in the parameter @@ -554,7 +568,10 @@ new empty mapping of the same type. Parameters after "``*``" or "``*identifier``" are keyword-only parameters and may only be passed used keyword arguments. -.. index:: pair: function; annotations +.. index:: + pair: function; annotations + single: ->; function annotations + single: :; function annotations Parameters may have annotations of the form "``: expression``" following the parameter name. Any parameter may have an annotation even those of the form @@ -603,6 +620,10 @@ Class definitions pair: execution; frame single: inheritance single: docstring + single: (; class definition + single: ); class definition + single: ,; expression list + single: :; compound statement A class definition defines a class object (see section :ref:`types`): @@ -641,6 +662,9 @@ the definition syntax. Class creation can be customized heavily using :ref:`metaclasses `. +.. index:: + single: @; class definition + Classes can also be decorated: just like when decorating functions, :: @f1(arg) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 8386df148217..9c0048e113cc 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -165,7 +165,9 @@ NotImplemented Ellipsis - .. index:: object: Ellipsis + .. index:: + object: Ellipsis + single: ...; ellipsis literal This type has a single value. There is a single object with this value. This object is accessed through the literal ``...`` or the built-in name @@ -1766,8 +1768,9 @@ Metaclasses ^^^^^^^^^^^ .. index:: - single: metaclass - builtin: type + single: metaclass + builtin: type + single: =; class definition By default, classes are constructed using :func:`type`. The class body is executed in a new namespace and the class name is bound locally to the diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index d08abdf3343f..5c83181440bc 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -52,7 +52,7 @@ Binding of names :dfn:`Names` refer to objects. Names are introduced by name binding operations. -.. index:: statement: from +.. index:: single: from; import statement The following constructs bind names: formal parameters to functions, :keyword:`import` statements, class and function definitions (these bind the diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 3f929bf09287..287e5ceff955 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -128,7 +128,10 @@ value. Parenthesized forms ------------------- -.. index:: single: parenthesized form +.. index:: + single: parenthesized form + single: (; tuple display + single: ); tuple display A parenthesized form is an optional expression list enclosed in parentheses: @@ -146,8 +149,9 @@ immutable, the rules for literals apply (i.e., two occurrences of the empty tuple may or may not yield the same object). .. index:: - single: comma + single: comma; tuple display pair: tuple; display + single: ,; tuple display Note that tuples are not formed by the parentheses, but rather by use of the comma operator. The exception is the empty tuple, for which parentheses *are* @@ -168,6 +172,11 @@ called "displays", each of them in two flavors: * they are computed via a set of looping and filtering instructions, called a :dfn:`comprehension`. +.. index:: + single: for; in comprehensions + single: if; in comprehensions + single: async for; in comprehensions + Common syntax elements for comprehensions are: .. productionlist:: @@ -186,6 +195,9 @@ each time the innermost block is reached. Note that the comprehension is executed in a separate scope, so names assigned to in the target list don't "leak" into the enclosing scope. +.. index:: + single: await; in comprehensions + Since Python 3.6, in an :keyword:`async def` function, an :keyword:`async for` clause may be used to iterate over a :term:`asynchronous iterator`. A comprehension in an :keyword:`async def` function may consist of either a @@ -208,6 +220,9 @@ List displays pair: list; comprehensions pair: empty; list object: list + single: [; list expression + single: ]; list expression + single: ,; expression list A list display is a possibly empty series of expressions enclosed in square brackets: @@ -227,8 +242,12 @@ the list is constructed from the elements resulting from the comprehension. Set displays ------------ -.. index:: pair: set; display - object: set +.. index:: + pair: set; display + object: set + single: {; set expression + single: }; set expression + single: ,; expression list A set display is denoted by curly braces and distinguishable from dictionary displays by the lack of colons separating keys and values: @@ -251,9 +270,14 @@ dictionary. Dictionary displays ------------------- -.. index:: pair: dictionary; display - key, datum, key/datum pair - object: dictionary +.. index:: + pair: dictionary; display + key, datum, key/datum pair + object: dictionary + single: {; dictionary expression + single: }; dictionary expression + single: :; in dictionary expressions + single: ,; in dictionary displays A dictionary display is a possibly empty series of key/datum pairs enclosed in curly braces: @@ -272,7 +296,9 @@ used as a key into the dictionary to store the corresponding datum. This means that you can specify the same key multiple times in the key/datum list, and the final dictionary's value for that key will be the last one given. -.. index:: unpacking; dictionary, **; in dictionary displays +.. index:: + unpacking; dictionary + single: **; in dictionary displays A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand must be a :term:`mapping`. Each mapping item is added @@ -302,8 +328,11 @@ prevails. Generator expressions --------------------- -.. index:: pair: generator; expression - object: generator +.. index:: + pair: generator; expression + object: generator + single: (; generator expression + single: ); generator expression A generator expression is a compact generator notation in parentheses: @@ -342,6 +371,7 @@ Yield expressions .. index:: keyword: yield + keyword: from pair: yield; expression pair: generator; function @@ -397,6 +427,9 @@ finalized (by reaching a zero reference count or by being garbage collected), the generator-iterator's :meth:`~generator.close` method will be called, allowing any pending :keyword:`finally` clauses to execute. +.. index:: + single: from; yield from expression + When ``yield from `` is used, it treats the supplied expression as a subiterator. All values produced by that subiterator are passed directly to the caller of the current generator's methods. Any values passed in with @@ -676,7 +709,9 @@ syntax is: Attribute references -------------------- -.. index:: pair: attribute; reference +.. index:: + pair: attribute; reference + single: .; attribute reference An attribute reference is a primary followed by a period and a name: @@ -702,7 +737,10 @@ same attribute reference may yield different objects. Subscriptions ------------- -.. index:: single: subscription +.. index:: + single: subscription + single: [; subscription + single: ]; subscription .. index:: object: sequence @@ -759,6 +797,8 @@ Slicings .. index:: single: slicing single: slice + single: :; slicing + single: ,; slicing .. index:: object: sequence @@ -808,6 +848,10 @@ substituting ``None`` for missing expressions. object: callable single: call single: argument; call semantics + single: (; call + single: ); call + single: ,; argument list + single: =; in function calls .. _calls: @@ -990,6 +1034,7 @@ a class instance: if that method was called. +.. index:: keyword: await .. _await: Await expression @@ -1009,6 +1054,10 @@ Can only be used inside a :term:`coroutine function`. The power operator ================== +.. index:: + pair: power; operation + operator: ** + The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right. The syntax is: @@ -1051,15 +1100,21 @@ All unary arithmetic and bitwise operations have the same priority: .. index:: single: negation single: minus + single: operator; - + single: -; unary operator The unary ``-`` (minus) operator yields the negation of its numeric argument. -.. index:: single: plus +.. index:: + single: plus + single: operator; + + single: +; unary operator The unary ``+`` (plus) operator yields its numeric argument unchanged. -.. index:: single: inversion - +.. index:: + single: inversion + operator: ~ The unary ``~`` (invert) operator yields the bitwise inversion of its integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. It only @@ -1089,7 +1144,9 @@ operators and one for additive operators: : `m_expr` "%" `u_expr` a_expr: `m_expr` | `a_expr` "+" `m_expr` | `a_expr` "-" `m_expr` -.. index:: single: multiplication +.. index:: + single: multiplication + operator: * The ``*`` (multiplication) operator yields the product of its arguments. The arguments must either both be numbers, or one argument must be an integer and @@ -1109,6 +1166,8 @@ builtin Python types implement this operator. .. index:: exception: ZeroDivisionError single: division + operator: / + operator: // The ``/`` (division) and ``//`` (floor division) operators yield the quotient of their arguments. The numeric arguments are first converted to a common type. @@ -1117,7 +1176,9 @@ integer; the result is that of mathematical division with the 'floor' function applied to the result. Division by zero raises the :exc:`ZeroDivisionError` exception. -.. index:: single: modulo +.. index:: + single: modulo + operator: % The ``%`` (modulo) operator yields the remainder from the division of the first argument by the second. The numeric arguments are first converted to a common @@ -1142,14 +1203,20 @@ The floor division operator, the modulo operator, and the :func:`divmod` function are not defined for complex numbers. Instead, convert to a floating point number using the :func:`abs` function if appropriate. -.. index:: single: addition +.. index:: + single: addition + single: operator; + + single: +; binary operator The ``+`` (addition) operator yields the sum of its arguments. The arguments must either both be numbers or both be sequences of the same type. In the former case, the numbers are converted to a common type and then added together. In the latter case, the sequences are concatenated. -.. index:: single: subtraction +.. index:: + single: subtraction + single: operator; - + single: -; binary operator The ``-`` (subtraction) operator yields the difference of its arguments. The numeric arguments are first converted to a common type. @@ -1160,7 +1227,10 @@ numeric arguments are first converted to a common type. Shifting operations =================== -.. index:: pair: shifting; operation +.. index:: + pair: shifting; operation + operator: << + operator: >> The shifting operations have lower priority than the arithmetic operations: @@ -1195,7 +1265,9 @@ Each of the three bitwise operations has a different priority level: xor_expr: `and_expr` | `xor_expr` "^" `and_expr` or_expr: `xor_expr` | `or_expr` "|" `xor_expr` -.. index:: pair: bitwise; and +.. index:: + pair: bitwise; and + operator: & The ``&`` operator yields the bitwise AND of its arguments, which must be integers. @@ -1203,6 +1275,7 @@ integers. .. index:: pair: bitwise; xor pair: exclusive; or + operator: ^ The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, which must be integers. @@ -1210,6 +1283,7 @@ must be integers. .. index:: pair: bitwise; or pair: inclusive; or + operator: | The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which must be integers. @@ -1220,9 +1294,15 @@ must be integers. Comparisons =========== -.. index:: single: comparison - -.. index:: pair: C; language +.. index:: + single: comparison + pair: C; language + operator: < + operator: > + operator: <= + operator: >= + operator: == + operator: != Unlike C, all comparison operations in Python have the same priority, which is lower than that of any arithmetic, shifting or bitwise operation. Also unlike @@ -1541,6 +1621,8 @@ Conditional expressions .. index:: pair: conditional; expression pair: ternary; operator + single: if; conditional expression + single: else; conditional expression .. productionlist:: conditional_expression: `or_test` ["if" `or_test` "else" `expression`] @@ -1567,10 +1649,11 @@ Lambdas pair: lambda; expression pair: lambda; form pair: anonymous; function + single: :; lambda expression .. productionlist:: - lambda_expr: "lambda" [`parameter_list`]: `expression` - lambda_expr_nocond: "lambda" [`parameter_list`]: `expression_nocond` + lambda_expr: "lambda" [`parameter_list`] ":" `expression` + lambda_expr_nocond: "lambda" [`parameter_list`] ":" `expression_nocond` Lambda expressions (sometimes called lambda forms) are used to create anonymous functions. The expression ``lambda parameters: expression`` yields a function @@ -1591,7 +1674,10 @@ annotations. Expression lists ================ -.. index:: pair: expression; list +.. index:: + pair: expression; list + single: comma; expression list + single: ,; expression list .. productionlist:: expression_list: `expression` ("," `expression`)* [","] @@ -1653,7 +1739,8 @@ their suffixes:: Operator precedence =================== -.. index:: pair: operator; precedence +.. index:: + pair: operator; precedence The following table summarizes the operator precedence in Python, from lowest precedence (least binding) to highest precedence (most binding). Operators in @@ -1701,7 +1788,7 @@ precedence and have a left-to-right chaining feature as described in the +-----------------------------------------------+-------------------------------------+ | ``**`` | Exponentiation [#]_ | +-----------------------------------------------+-------------------------------------+ -| ``await`` ``x`` | Await expression | +| :keyword:`await` ``x`` | Await expression | +-----------------------------------------------+-------------------------------------+ | ``x[index]``, ``x[index:index]``, | Subscription, slicing, | | ``x(arguments...)``, ``x.attribute`` | call, attribute reference | diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 61f58539fe82..c3a20314f79d 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -128,8 +128,8 @@ Namespace packages ------------------ .. index:: - pair:: package; namespace - pair:: package; portion + pair: package; namespace + pair: package; portion A namespace package is a composite of various :term:`portions `, where each portion contributes a subpackage to the parent package. Portions diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index a8619967e79d..4a6052589004 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -65,6 +65,7 @@ Comments -------- .. index:: comment, hash character + single: #; comment A comment starts with a hash character (``#``) that is not part of a string literal, and ends at the end of the physical line. A comment signifies the end @@ -78,6 +79,7 @@ Encoding declarations --------------------- .. index:: source character set, encoding declarations (source file) + single: #; source encoding declaration If a comment in the first or second line of the Python script matches the regular expression ``coding[=:]\s*([-\w.]+)``, this comment is processed as an @@ -349,6 +351,9 @@ exactly as written here: assert else import pass break except in raise +.. index:: + single: _, identifiers + single: __, identifiers .. _id-classes: Reserved classes of identifiers @@ -395,13 +400,16 @@ Literals Literals are notations for constant values of some built-in types. +.. index:: string literal, bytes literal, ASCII + single: '; string literal + single: "; string literal + single: u'; string literal + single: u"; string literal .. _strings: String and Bytes literals ------------------------- -.. index:: string literal, bytes literal, ASCII - String literals are described by the following lexical definitions: .. productionlist:: @@ -434,6 +442,8 @@ declaration; it is UTF-8 if no encoding declaration is given in the source file; see section :ref:`encodings`. .. index:: triple-quoted string, Unicode Consortium, raw string + single: """; string literal + single: '''; string literal In plain English: Both types of literals can be enclosed in matching single quotes (``'``) or double quotes (``"``). They can also be enclosed in matching groups @@ -442,11 +452,19 @@ of three single or double quotes (these are generally referred to as characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character. +.. index:: + single: b'; bytes literal + single: b"; bytes literal + Bytes literals are always prefixed with ``'b'`` or ``'B'``; they produce an instance of the :class:`bytes` type instead of the :class:`str` type. They may only contain ASCII characters; bytes with a numeric value of 128 or greater must be expressed with escapes. +.. index:: + single: r'; raw string literal + single: r"; raw string literal + Both string and bytes literals may optionally be prefixed with a letter ``'r'`` or ``'R'``; such strings are called :dfn:`raw strings` and treat backslashes as literal characters. As a result, in string literals, ``'\U'`` and ``'\u'`` @@ -463,6 +481,10 @@ is not supported. to simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:`414` for more information. +.. index:: + single: f'; formatted string literal + single: f"; formatted string literal + A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with ``'r'``, but not with ``'b'`` or ``'u'``, therefore raw @@ -473,6 +495,19 @@ retained), except that three unescaped quotes in a row terminate the literal. ( "quote" is the character used to open the literal, i.e. either ``'`` or ``"``.) .. index:: physical line, escape sequence, Standard C, C + single: \; escape sequence + single: \\; escape sequence + single: \a; escape sequence + single: \b; escape sequence + single: \f; escape sequence + single: \n; escape sequence + single: \r; escape sequence + single: \t; escape sequence + single: \v; escape sequence + single: \x; escape sequence + single: \N; escape sequence + single: \u; escape sequence + single: \U; escape sequence Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string and bytes literals are interpreted according to rules similar to those used by @@ -601,6 +636,10 @@ and formatted string literals may be concatenated with plain string literals. single: string; formatted literal single: string; interpolated literal single: f-string + single: {; in formatted string literal + single: }; in formatted string literal + single: !; in formatted string literal + single: :; in formatted string literal .. _f-strings: Formatted string literals @@ -735,6 +774,12 @@ actually an expression composed of the unary operator '``-``' and the literal ``1``. +.. index:: + single: 0b; integer literal + single: 0o; integer literal + single: 0x; integer literal + single: _; in numeric literal + .. _integers: Integer literals @@ -775,6 +820,10 @@ Some examples of integer literals:: Underscores are now allowed for grouping purposes in literals. +.. index:: + single: .; in numeric literal + single: e; in numeric literal + single: _; in numeric literal .. _floating: Floating point literals @@ -803,6 +852,8 @@ Some examples of floating point literals:: Underscores are now allowed for grouping purposes in literals. +.. index:: + single: j; in numeric literal .. _imaginary: Imaginary literals diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index f54e2c9d3f06..fb55138775a4 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -112,6 +112,12 @@ unacceptable. The rules observed by various types and the exceptions raised are given with the definition of the object types (see section :ref:`types`). .. index:: triple: target; list; assignment + single: ,; in target list + single: *; in assignment target list + single: [; in assignment target list + single: ]; in assignment target list + single: (; in assignment target list + single: ); in assignment target list Assignment of an object to a target list, optionally enclosed in parentheses or square brackets, is recursively defined as follows. @@ -321,6 +327,7 @@ Annotated assignment statements .. index:: pair: annotated; assignment single: statement; assignment, annotated + single: :; annotated variable Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement: @@ -372,6 +379,7 @@ The :keyword:`assert` statement .. index:: statement: assert pair: debugging; assertions + single: ,; expression list Assert statements are a convenient way to insert debugging assertions into a program: @@ -713,6 +721,9 @@ The :keyword:`import` statement single: module; importing pair: name; binding keyword: from + keyword: as + exception: ImportError + single: ,; import statement .. productionlist:: import_stmt: "import" `module` ["as" `identifier`] ("," `module` ["as" `identifier`])* @@ -762,8 +773,7 @@ available in the local namespace in one of three ways: .. index:: pair: name; binding - keyword: from - exception: ImportError + single: from; import statement The :keyword:`from` form uses a slightly more complex process: @@ -787,6 +797,8 @@ Examples:: from foo.bar import baz # foo.bar.baz imported and bound as baz from foo import attr # foo imported and foo.attr bound as attr +.. index:: single: *; import statement + If the list of identifiers is replaced by a star (``'*'``), all public names defined in the module are bound in the local namespace for the scope where the :keyword:`import` statement occurs. @@ -832,7 +844,9 @@ determine dynamically the modules to be loaded. Future statements ----------------- -.. index:: pair: future; statement +.. index:: + pair: future; statement + single: __future__; future statement A :dfn:`future statement` is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a @@ -916,6 +930,7 @@ The :keyword:`global` statement .. index:: statement: global triple: global; name; binding + single: ,; identifier list .. productionlist:: global_stmt: "global" `identifier` ("," `identifier`)* @@ -960,6 +975,7 @@ The :keyword:`nonlocal` statement ================================= .. index:: statement: nonlocal + single: ,; identifier list .. productionlist:: nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)* diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 4bcdafd73352..f87cd4decd02 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -526,7 +526,7 @@ Arbitrary Argument Lists ------------------------ .. index:: - statement: * + single: *; in function calls Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped @@ -570,7 +570,7 @@ or tuple:: [3, 4, 5] .. index:: - statement: ** + single: **; in function calls In the same fashion, dictionaries can deliver keyword arguments with the ``**``\ -operator:: @@ -675,7 +675,8 @@ Function Annotations .. sectionauthor:: Zachary Ware .. index:: pair: function; annotations - single: -> (return annotation assignment) + single: ->; function annotations + single: :; function annotations :ref:`Function annotations ` are completely optional metadata information about the types used by user-defined functions (see :pep:`3107` and diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst index 2454bf0b0528..0663af12d939 100644 --- a/Doc/tutorial/introduction.rst +++ b/Doc/tutorial/introduction.rst @@ -11,6 +11,8 @@ with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command. +.. index:: single: #; comment + Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, ``#``, and extend to the end of the physical line. A comment may appear at the From webhook-mailer at python.org Fri Oct 26 04:27:14 2018 From: webhook-mailer at python.org (Senthil Kumaran) Date: Fri, 26 Oct 2018 08:27:14 -0000 Subject: [Python-checkins] [2.7] bpo-34576 : Backport eeab510 2.7 (#10115) Message-ID: https://github.com/python/cpython/commit/971089fc2a09e4bcb872efac52c1b014af16fff9 commit: 971089fc2a09e4bcb872efac52c1b014af16fff9 branch: 2.7 author: Senthil Kumaran committer: GitHub date: 2018-10-26T01:27:09-07:00 summary: [2.7] bpo-34576 : Backport eeab510 2.7 (#10115) * bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005) * Address review comment.. (cherry picked from commit eeab510bb7e51802c18b3770cbb23ae0ca91da6b) Co-authored-by: Senthil Kumaran files: M Doc/library/simplehttpserver.rst diff --git a/Doc/library/simplehttpserver.rst b/Doc/library/simplehttpserver.rst index 2e7e97ace6d7..df8699e11455 100644 --- a/Doc/library/simplehttpserver.rst +++ b/Doc/library/simplehttpserver.rst @@ -11,6 +11,10 @@ Python 3. The :term:`2to3` tool will automatically adapt imports when converting your sources to Python 3. +.. warning:: + + mod:`SimpleHTTServer` is not recommended for production. It only implements + basic security checks. The :mod:`SimpleHTTPServer` module defines a single class, :class:`SimpleHTTPRequestHandler`, which is interface-compatible with From solipsis at pitrou.net Fri Oct 26 05:08:43 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 26 Oct 2018 09:08:43 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=11 Message-ID: <20181026090843.1.237194280A1915B3@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 7, 0] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogbp1I_U', '--timeout', '7200'] From webhook-mailer at python.org Fri Oct 26 06:52:16 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 10:52:16 -0000 Subject: [Python-checkins] bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037) Message-ID: https://github.com/python/cpython/commit/e483f02423917dc4dfd25f46e5b9e6fce304777d commit: e483f02423917dc4dfd25f46e5b9e6fce304777d branch: master author: St?phane Wirtel committer: Victor Stinner date: 2018-10-26T12:52:11+02:00 summary: bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037) files: A Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst M Doc/c-api/conversion.rst M Doc/faq/design.rst M Doc/faq/extending.rst M Doc/glossary.rst M Doc/library/configparser.rst M Doc/library/imp.rst M Doc/library/importlib.rst M Doc/library/io.rst M Doc/library/os.path.rst M Doc/library/ssl.rst M Doc/library/typing.rst M Doc/library/unittest.rst M Doc/tutorial/datastructures.rst M Doc/whatsnew/3.5.rst M Doc/whatsnew/3.6.rst M Doc/whatsnew/3.7.rst diff --git a/Doc/c-api/conversion.rst b/Doc/c-api/conversion.rst index 9566d9d79200..c46722d782a2 100644 --- a/Doc/c-api/conversion.rst +++ b/Doc/c-api/conversion.rst @@ -60,7 +60,7 @@ The following functions provide locale-independent string to number conversions. The conversion is independent of the current locale. If ``endptr`` is ``NULL``, convert the whole string. Raise - ValueError and return ``-1.0`` if the string is not a valid + :exc:`ValueError` and return ``-1.0`` if the string is not a valid representation of a floating-point number. If endptr is not ``NULL``, convert as much of the string as diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 5e54df61bda9..e2d63a0323da 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -528,7 +528,7 @@ Some unacceptable solutions that have been proposed: mydict = {[1, 2]: '12'} print(mydict[[1, 2]]) - would raise a KeyError exception because the id of the ``[1, 2]`` used in the + would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` used in the second line differs from that in the first line. In other words, dictionary keys should be compared using ``==``, not using :keyword:`is`. diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst index fd04a83df33c..b611bb48012a 100644 --- a/Doc/faq/extending.rst +++ b/Doc/faq/extending.rst @@ -63,7 +63,7 @@ How can I execute arbitrary Python statements from C? The highest-level function to do this is :c:func:`PyRun_SimpleString` which takes a single string argument to be executed in the context of the module ``__main__`` and returns ``0`` for success and ``-1`` when an exception occurred -(including ``SyntaxError``). If you want more control, use +(including :exc:`SyntaxError`). If you want more control, use :c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in ``Python/pythonrun.c``. diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 16fc7f0783c8..b8e773741ce7 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -200,7 +200,7 @@ Glossary ``int(3.15)`` converts the floating point number to the integer ``3``, but in ``3+4.5``, each argument is of a different type (one int, one float), and both must be converted to the same type before they can be added or it - will raise a ``TypeError``. Without coercion, all arguments of even + will raise a :exc:`TypeError`. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index fcca97aeff75..1a5417f89304 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -401,11 +401,11 @@ However, there are a few differences that should be taken into account: because default values cannot be deleted from the section (because technically they are not there). If they are overridden in the section, deleting causes the default value to be visible again. Trying to delete a default value - causes a ``KeyError``. + causes a :exc:`KeyError`. * ``DEFAULTSECT`` cannot be removed from the parser: - * trying to delete it raises ``ValueError``, + * trying to delete it raises :exc:`ValueError`, * ``parser.clear()`` leaves it intact, diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst index ccf5f92d1636..1bd6f12b915f 100644 --- a/Doc/library/imp.rst +++ b/Doc/library/imp.rst @@ -229,7 +229,7 @@ file paths. file path. For example, if *path* is ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be ``/foo/bar/baz.py``. *path* need not exist, however if it does not conform - to :pep:`3147` format, a ``ValueError`` is raised. If + to :pep:`3147` format, a :exc:`ValueError` is raised. If :attr:`sys.implementation.cache_tag` is not defined, :exc:`NotImplementedError` is raised. diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 09d5989c2f8b..c6c7160a9d15 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1407,7 +1407,7 @@ an :term:`importer`. file path. For example, if *path* is ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be ``/foo/bar/baz.py``. *path* need not exist, however if it does not conform - to :pep:`3147` or :pep:`488` format, a ``ValueError`` is raised. If + to :pep:`3147` or :pep:`488` format, a :exc:`ValueError` is raised. If :attr:`sys.implementation.cache_tag` is not defined, :exc:`NotImplementedError` is raised. diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 98649de7310f..2536c37e772b 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -39,7 +39,7 @@ pipe). All streams are careful about the type of data you give to them. For example giving a :class:`str` object to the ``write()`` method of a binary stream -will raise a ``TypeError``. So will giving a :class:`bytes` object to the +will raise a :exc:`TypeError`. So will giving a :class:`bytes` object to the ``write()`` method of a text stream. .. versionchanged:: 3.3 diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 379308c2af30..03644e236659 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -325,7 +325,7 @@ the :mod:`glob` module.) Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward slashes. - Raise a TypeError if the type of *path* is not ``str`` or ``bytes`` (directly + Raise a :exc:`TypeError` if the type of *path* is not ``str`` or ``bytes`` (directly or indirectly through the :class:`os.PathLike` interface). .. versionchanged:: 3.6 diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 5b0ef2e1d361..4817bba7d4f2 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1941,7 +1941,7 @@ to speed up repeated connections from the same clients. .. note:: With versions of OpenSSL older than 0.9.8m, it is only possible to set options, not to clear them. Attempting to clear an option - (by resetting the corresponding bits) will raise a ``ValueError``. + (by resetting the corresponding bits) will raise a :exc:`ValueError`. .. versionchanged:: 3.6 :attr:`SSLContext.options` returns :class:`Options` flags: diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 268adc0c9de5..9861da8d7073 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -899,7 +899,7 @@ The module defines the following classes, functions and decorators: non-``@overload``-decorated definition, while the latter is used at runtime but should be ignored by a type checker. At runtime, calling a ``@overload``-decorated function directly will raise - ``NotImplementedError``. An example of overload that gives a more + :exc:`NotImplementedError`. An example of overload that gives a more precise type than can be expressed using a union or a type variable:: @overload diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 83aee1b02621..b35a724fc540 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1161,7 +1161,7 @@ Test cases If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*. - Supplying both *delta* and *places* raises a ``TypeError``. + Supplying both *delta* and *places* raises a :exc:`TypeError`. .. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 95dc0f98ba51..b291d11595a8 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -41,7 +41,7 @@ objects: :noindex: Remove the first item from the list whose value is equal to *x*. It raises a - ``ValueError`` if there is no such item. + :exc:`ValueError` if there is no such item. .. method:: list.pop([i]) diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 4eddf841dcbe..b4540ac1dd90 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -593,7 +593,7 @@ a :term:`__future__` import is necessary:: RuntimeError: generator raised StopIteration Without a ``__future__`` import, a :exc:`PendingDeprecationWarning` will be -raised whenever a ``StopIteration`` exception is raised inside a generator. +raised whenever a :exc:`StopIteration` exception is raised inside a generator. .. seealso:: diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index bba16543686c..936ea2dc321e 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -741,7 +741,7 @@ Some smaller changes made to the core Python language are: * A ``global`` or ``nonlocal`` statement must now textually appear before the first use of the affected name in the same scope. - Previously this was a ``SyntaxWarning``. + Previously this was a :exc:`SyntaxWarning`. * It is now possible to set a :ref:`special method ` to ``None`` to indicate that the corresponding operation is not available. diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index d4daf8f71f9c..55cf74f71449 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1030,7 +1030,7 @@ support the loading of resources from packages. See also lacks a spec. (Contributed by Garvit Khatri in :issue:`29851`.) -:func:`importlib.find_spec` now raises ``ModuleNotFoundError`` instead of +:func:`importlib.find_spec` now raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if the specified parent module is not a package (i.e. lacks a ``__path__`` attribute). (Contributed by Milan Oberkirch in :issue:`30436`.) diff --git a/Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst b/Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst new file mode 100644 index 000000000000..05e67e51a73a --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst @@ -0,0 +1,2 @@ +Fix the documentation with the role ``exc`` for the appropriated exception. Patch by +St?phane Wirtel From webhook-mailer at python.org Fri Oct 26 06:56:32 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 10:56:32 -0000 Subject: [Python-checkins] bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037) Message-ID: https://github.com/python/cpython/commit/ec10b70ea66e738ccb5c28f75a9c5d2b1c197de7 commit: ec10b70ea66e738ccb5c28f75a9c5d2b1c197de7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T03:56:28-07:00 summary: bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037) (cherry picked from commit e483f02423917dc4dfd25f46e5b9e6fce304777d) Co-authored-by: St?phane Wirtel files: A Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst M Doc/c-api/conversion.rst M Doc/faq/design.rst M Doc/faq/extending.rst M Doc/glossary.rst M Doc/library/configparser.rst M Doc/library/imp.rst M Doc/library/importlib.rst M Doc/library/io.rst M Doc/library/os.path.rst M Doc/library/ssl.rst M Doc/library/typing.rst M Doc/library/unittest.rst M Doc/tutorial/datastructures.rst M Doc/whatsnew/3.5.rst M Doc/whatsnew/3.6.rst M Doc/whatsnew/3.7.rst diff --git a/Doc/c-api/conversion.rst b/Doc/c-api/conversion.rst index 9566d9d79200..c46722d782a2 100644 --- a/Doc/c-api/conversion.rst +++ b/Doc/c-api/conversion.rst @@ -60,7 +60,7 @@ The following functions provide locale-independent string to number conversions. The conversion is independent of the current locale. If ``endptr`` is ``NULL``, convert the whole string. Raise - ValueError and return ``-1.0`` if the string is not a valid + :exc:`ValueError` and return ``-1.0`` if the string is not a valid representation of a floating-point number. If endptr is not ``NULL``, convert as much of the string as diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 5e54df61bda9..e2d63a0323da 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -528,7 +528,7 @@ Some unacceptable solutions that have been proposed: mydict = {[1, 2]: '12'} print(mydict[[1, 2]]) - would raise a KeyError exception because the id of the ``[1, 2]`` used in the + would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` used in the second line differs from that in the first line. In other words, dictionary keys should be compared using ``==``, not using :keyword:`is`. diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst index fd04a83df33c..b611bb48012a 100644 --- a/Doc/faq/extending.rst +++ b/Doc/faq/extending.rst @@ -63,7 +63,7 @@ How can I execute arbitrary Python statements from C? The highest-level function to do this is :c:func:`PyRun_SimpleString` which takes a single string argument to be executed in the context of the module ``__main__`` and returns ``0`` for success and ``-1`` when an exception occurred -(including ``SyntaxError``). If you want more control, use +(including :exc:`SyntaxError`). If you want more control, use :c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in ``Python/pythonrun.c``. diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 16fc7f0783c8..b8e773741ce7 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -200,7 +200,7 @@ Glossary ``int(3.15)`` converts the floating point number to the integer ``3``, but in ``3+4.5``, each argument is of a different type (one int, one float), and both must be converted to the same type before they can be added or it - will raise a ``TypeError``. Without coercion, all arguments of even + will raise a :exc:`TypeError`. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 1c479bf9080a..8f6b5a792d3d 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -401,11 +401,11 @@ However, there are a few differences that should be taken into account: because default values cannot be deleted from the section (because technically they are not there). If they are overridden in the section, deleting causes the default value to be visible again. Trying to delete a default value - causes a ``KeyError``. + causes a :exc:`KeyError`. * ``DEFAULTSECT`` cannot be removed from the parser: - * trying to delete it raises ``ValueError``, + * trying to delete it raises :exc:`ValueError`, * ``parser.clear()`` leaves it intact, diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst index ccf5f92d1636..1bd6f12b915f 100644 --- a/Doc/library/imp.rst +++ b/Doc/library/imp.rst @@ -229,7 +229,7 @@ file paths. file path. For example, if *path* is ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be ``/foo/bar/baz.py``. *path* need not exist, however if it does not conform - to :pep:`3147` format, a ``ValueError`` is raised. If + to :pep:`3147` format, a :exc:`ValueError` is raised. If :attr:`sys.implementation.cache_tag` is not defined, :exc:`NotImplementedError` is raised. diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 09d5989c2f8b..c6c7160a9d15 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1407,7 +1407,7 @@ an :term:`importer`. file path. For example, if *path* is ``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be ``/foo/bar/baz.py``. *path* need not exist, however if it does not conform - to :pep:`3147` or :pep:`488` format, a ``ValueError`` is raised. If + to :pep:`3147` or :pep:`488` format, a :exc:`ValueError` is raised. If :attr:`sys.implementation.cache_tag` is not defined, :exc:`NotImplementedError` is raised. diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 98649de7310f..2536c37e772b 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -39,7 +39,7 @@ pipe). All streams are careful about the type of data you give to them. For example giving a :class:`str` object to the ``write()`` method of a binary stream -will raise a ``TypeError``. So will giving a :class:`bytes` object to the +will raise a :exc:`TypeError`. So will giving a :class:`bytes` object to the ``write()`` method of a text stream. .. versionchanged:: 3.3 diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 1f767170b5a5..edcbb3aa8b0b 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -317,7 +317,7 @@ the :mod:`glob` module.) Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward slashes. - Raise a TypeError if the type of *path* is not ``str`` or ``bytes`` (directly + Raise a :exc:`TypeError` if the type of *path* is not ``str`` or ``bytes`` (directly or indirectly through the :class:`os.PathLike` interface). .. versionchanged:: 3.6 diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 175ea17ff138..0835e9ae04e6 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1941,7 +1941,7 @@ to speed up repeated connections from the same clients. .. note:: With versions of OpenSSL older than 0.9.8m, it is only possible to set options, not to clear them. Attempting to clear an option - (by resetting the corresponding bits) will raise a ``ValueError``. + (by resetting the corresponding bits) will raise a :exc:`ValueError`. .. versionchanged:: 3.6 :attr:`SSLContext.options` returns :class:`Options` flags: diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 268adc0c9de5..9861da8d7073 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -899,7 +899,7 @@ The module defines the following classes, functions and decorators: non-``@overload``-decorated definition, while the latter is used at runtime but should be ignored by a type checker. At runtime, calling a ``@overload``-decorated function directly will raise - ``NotImplementedError``. An example of overload that gives a more + :exc:`NotImplementedError`. An example of overload that gives a more precise type than can be expressed using a union or a type variable:: @overload diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 83aee1b02621..b35a724fc540 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1161,7 +1161,7 @@ Test cases If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*. - Supplying both *delta* and *places* raises a ``TypeError``. + Supplying both *delta* and *places* raises a :exc:`TypeError`. .. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 95dc0f98ba51..b291d11595a8 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -41,7 +41,7 @@ objects: :noindex: Remove the first item from the list whose value is equal to *x*. It raises a - ``ValueError`` if there is no such item. + :exc:`ValueError` if there is no such item. .. method:: list.pop([i]) diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 4eddf841dcbe..b4540ac1dd90 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -593,7 +593,7 @@ a :term:`__future__` import is necessary:: RuntimeError: generator raised StopIteration Without a ``__future__`` import, a :exc:`PendingDeprecationWarning` will be -raised whenever a ``StopIteration`` exception is raised inside a generator. +raised whenever a :exc:`StopIteration` exception is raised inside a generator. .. seealso:: diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index bba16543686c..936ea2dc321e 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -741,7 +741,7 @@ Some smaller changes made to the core Python language are: * A ``global`` or ``nonlocal`` statement must now textually appear before the first use of the affected name in the same scope. - Previously this was a ``SyntaxWarning``. + Previously this was a :exc:`SyntaxWarning`. * It is now possible to set a :ref:`special method ` to ``None`` to indicate that the corresponding operation is not available. diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 9a13dae13eab..9fc0f2398369 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1030,7 +1030,7 @@ support the loading of resources from packages. See also lacks a spec. (Contributed by Garvit Khatri in :issue:`29851`.) -:func:`importlib.find_spec` now raises ``ModuleNotFoundError`` instead of +:func:`importlib.find_spec` now raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if the specified parent module is not a package (i.e. lacks a ``__path__`` attribute). (Contributed by Milan Oberkirch in :issue:`30436`.) diff --git a/Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst b/Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst new file mode 100644 index 000000000000..05e67e51a73a --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-22-14-09-58.bpo-35044.qjvNtI.rst @@ -0,0 +1,2 @@ +Fix the documentation with the role ``exc`` for the appropriated exception. Patch by +St?phane Wirtel From webhook-mailer at python.org Fri Oct 26 07:19:19 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 26 Oct 2018 11:19:19 -0000 Subject: [Python-checkins] bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903) Message-ID: https://github.com/python/cpython/commit/7cd25434164882c2093ea41ccfc7b95a05cd5cbd commit: 7cd25434164882c2093ea41ccfc7b95a05cd5cbd branch: master author: Pablo Galindo committer: GitHub date: 2018-10-26T12:19:14+01:00 summary: bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903) inspect.isfunction() processes both inspect.isfunction(func) and inspect.isfunction(partial(func, arg)) correctly but some other functions in the inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction) lack this functionality. This commits adds a new check in the mentioned functions in the inspect module so they can work correctly with arbitrarily nested partial functions. files: A Misc/NEWS.d/next/Library/2018-10-15-23-10-41.bpo-34890.77E770.rst M Doc/library/inspect.rst M Lib/functools.py M Lib/inspect.py M Lib/test/test_asyncio/test_tasks.py M Lib/test/test_inspect.py diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 50cd00367a1b..dfd78a97145c 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -298,6 +298,10 @@ attributes: Return true if the object is a Python generator function. + .. versionchanged:: 3.8 + Functions wrapped in :func:`functools.partial` now return true if the + wrapped function is a Python generator function. + .. function:: isgenerator(object) @@ -311,6 +315,10 @@ attributes: .. versionadded:: 3.5 + .. versionchanged:: 3.8 + Functions wrapped in :func:`functools.partial` now return true if the + wrapped function is a :term:`coroutine function`. + .. function:: iscoroutine(object) @@ -352,6 +360,10 @@ attributes: .. versionadded:: 3.6 + .. versionchanged:: 3.8 + Functions wrapped in :func:`functools.partial` now return true if the + wrapped function is a :term:`asynchronous generator` function. + .. function:: isasyncgen(object) diff --git a/Lib/functools.py b/Lib/functools.py index 39a4af81d051..ab7d71e126bd 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -423,6 +423,12 @@ def __get__(self, obj, cls): def __isabstractmethod__(self): return getattr(self.func, "__isabstractmethod__", False) +# Helper functions + +def _unwrap_partial(func): + while isinstance(func, partial): + func = func.func + return func ################################################################################ ### LRU Cache function decorator diff --git a/Lib/inspect.py b/Lib/inspect.py index 3edf97d389ea..b8a142232b88 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -168,30 +168,33 @@ def isfunction(object): __kwdefaults__ dict of keyword only parameters with defaults""" return isinstance(object, types.FunctionType) -def isgeneratorfunction(object): +def isgeneratorfunction(obj): """Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.""" - return bool((isfunction(object) or ismethod(object)) and - object.__code__.co_flags & CO_GENERATOR) + obj = functools._unwrap_partial(obj) + return bool((isfunction(obj) or ismethod(obj)) and + obj.__code__.co_flags & CO_GENERATOR) -def iscoroutinefunction(object): +def iscoroutinefunction(obj): """Return true if the object is a coroutine function. Coroutine functions are defined with "async def" syntax. """ - return bool((isfunction(object) or ismethod(object)) and - object.__code__.co_flags & CO_COROUTINE) + obj = functools._unwrap_partial(obj) + return bool(((isfunction(obj) or ismethod(obj)) and + obj.__code__.co_flags & CO_COROUTINE)) -def isasyncgenfunction(object): +def isasyncgenfunction(obj): """Return true if the object is an asynchronous generator function. Asynchronous generator functions are defined with "async def" syntax and have "yield" expressions in their body. """ - return bool((isfunction(object) or ismethod(object)) and - object.__code__.co_flags & CO_ASYNC_GENERATOR) + obj = functools._unwrap_partial(obj) + return bool((isfunction(obj) or ismethod(obj)) and + obj.__code__.co_flags & CO_ASYNC_GENERATOR) def isasyncgen(object): """Return true if the object is an asynchronous generator.""" diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 0fe767630f1a..c65d1f2440d2 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -440,8 +440,8 @@ def test_task_repr_partial_corowrapper(self): coro_repr = repr(task._coro) expected = ( - r'\.func\(1\)\(\) running, ' + r'\.func at' ) self.assertRegex(coro_repr, expected) diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 134b0cd0b735..b9072e0137eb 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -166,26 +166,51 @@ def test_excluding_predicates(self): self.assertFalse(inspect.ismemberdescriptor(datetime.timedelta.days)) def test_iscoroutine(self): + async_gen_coro = async_generator_function_example(1) gen_coro = gen_coroutine_function_example(1) coro = coroutine_function_example(1) self.assertFalse( inspect.iscoroutinefunction(gen_coroutine_function_example)) + self.assertFalse( + inspect.iscoroutinefunction( + functools.partial(functools.partial( + gen_coroutine_function_example)))) self.assertFalse(inspect.iscoroutine(gen_coro)) self.assertTrue( inspect.isgeneratorfunction(gen_coroutine_function_example)) + self.assertTrue( + inspect.isgeneratorfunction( + functools.partial(functools.partial( + gen_coroutine_function_example)))) self.assertTrue(inspect.isgenerator(gen_coro)) self.assertTrue( inspect.iscoroutinefunction(coroutine_function_example)) + self.assertTrue( + inspect.iscoroutinefunction( + functools.partial(functools.partial( + coroutine_function_example)))) self.assertTrue(inspect.iscoroutine(coro)) self.assertFalse( inspect.isgeneratorfunction(coroutine_function_example)) + self.assertFalse( + inspect.isgeneratorfunction( + functools.partial(functools.partial( + coroutine_function_example)))) self.assertFalse(inspect.isgenerator(coro)) - coro.close(); gen_coro.close() # silence warnings + self.assertTrue( + inspect.isasyncgenfunction(async_generator_function_example)) + self.assertTrue( + inspect.isasyncgenfunction( + functools.partial(functools.partial( + async_generator_function_example)))) + self.assertTrue(inspect.isasyncgen(async_gen_coro)) + + coro.close(); gen_coro.close(); # silence warnings def test_isawaitable(self): def gen(): yield diff --git a/Misc/NEWS.d/next/Library/2018-10-15-23-10-41.bpo-34890.77E770.rst b/Misc/NEWS.d/next/Library/2018-10-15-23-10-41.bpo-34890.77E770.rst new file mode 100644 index 000000000000..58745b289591 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-15-23-10-41.bpo-34890.77E770.rst @@ -0,0 +1,3 @@ +Make :func:`inspect.iscoroutinefunction`, +:func:`inspect.isgeneratorfunction` and :func:`inspect.isasyncgenfunction` +work with :func:`functools.partial`. Patch by Pablo Galindo. From webhook-mailer at python.org Fri Oct 26 08:35:08 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 12:35:08 -0000 Subject: [Python-checkins] bpo-35059: Convert PyObject_INIT() to function (GH-10077) Message-ID: https://github.com/python/cpython/commit/b4435e20a92af474f117b78b98ddc6f515363af5 commit: b4435e20a92af474f117b78b98ddc6f515363af5 branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T14:35:00+02:00 summary: bpo-35059: Convert PyObject_INIT() to function (GH-10077) * Convert PyObject_INIT() and PyObject_INIT_VAR() macros to static inline functions. * Fix usage of these functions: cast to PyObject* or PyVarObject*. files: M Include/objimpl.h M Objects/bytesobject.c M Objects/classobject.c M Objects/complexobject.c M Objects/floatobject.c M Objects/longobject.c M Objects/methodobject.c M PC/winreg.c diff --git a/Include/objimpl.h b/Include/objimpl.h index 4eeb8dfe50cd..6ce64550401a 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -138,12 +138,29 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); #define PyObject_NewVar(type, typeobj, n) \ ( (type *) _PyObject_NewVar((typeobj), (n)) ) -/* Macros trading binary compatibility for speed. See also pymem.h. - Note that these macros expect non-NULL object pointers.*/ -#define PyObject_INIT(op, typeobj) \ - ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) -#define PyObject_INIT_VAR(op, typeobj, size) \ - ( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) ) +/* 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. + See also pymem.h. + + These inline functions expect non-NULL object pointers. */ +Py_STATIC_INLINE(PyObject*) +PyObject_INIT(PyObject *op, PyTypeObject *typeobj) +{ + assert(op != NULL); + Py_TYPE(op) = typeobj; + _Py_NewReference(op); + return op; +} + +Py_STATIC_INLINE(PyVarObject*) +PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) +{ + assert(op != NULL); + Py_SIZE(op) = size; + PyObject_INIT((PyObject *)op, typeobj); + return op; +} #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index c412393e6c5e..9a0881450cc4 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -85,7 +85,7 @@ _PyBytes_FromSize(Py_ssize_t size, int use_calloc) op = (PyBytesObject *)PyObject_Malloc(PyBytesObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); + (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size); op->ob_shash = -1; if (!use_calloc) op->ob_sval[size] = '\0'; @@ -163,7 +163,7 @@ PyBytes_FromString(const char *str) op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); + (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size); op->ob_shash = -1; memcpy(op->ob_sval, str, size+1); /* share short strings */ @@ -1508,7 +1508,7 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n) op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); + (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size); op->ob_shash = -1; op->ob_sval[size] = '\0'; if (Py_SIZE(a) == 1 && n > 0) { diff --git a/Objects/classobject.c b/Objects/classobject.c index a193ada6d44c..c4efaf282020 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -55,7 +55,7 @@ PyMethod_New(PyObject *func, PyObject *self) im = free_list; if (im != NULL) { free_list = (PyMethodObject *)(im->im_self); - (void)PyObject_INIT(im, &PyMethod_Type); + (void)PyObject_INIT((PyObject *)im, &PyMethod_Type); numfree--; } else { diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 6e3d47b62d19..eecdb5250653 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -228,7 +228,7 @@ PyComplex_FromCComplex(Py_complex cval) op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject)); if (op == NULL) return PyErr_NoMemory(); - (void)PyObject_INIT(op, &PyComplex_Type); + (void)PyObject_INIT((PyObject *)op, &PyComplex_Type); op->cval = cval; return (PyObject *) op; } diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 67f9e5d5b4ef..8d83f00452e5 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -124,7 +124,7 @@ PyFloat_FromDouble(double fval) return PyErr_NoMemory(); } /* Inline PyObject_New */ - (void)PyObject_INIT(op, &PyFloat_Type); + (void)PyObject_INIT((PyObject *)op, &PyFloat_Type); op->ob_fval = fval; return (PyObject *) op; } diff --git a/Objects/longobject.c b/Objects/longobject.c index 6f7fe335d9f2..ab5ac3456b69 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -211,7 +211,7 @@ _PyLong_New(Py_ssize_t size) PyErr_NoMemory(); return NULL; } - return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size); + return (PyLongObject*)PyObject_INIT_VAR((PyVarObject *)result, &PyLong_Type, size); } PyObject * @@ -5620,7 +5620,7 @@ _PyLong_Init(void) assert(v->ob_digit[0] == (digit)abs(ival)); } else { - (void)PyObject_INIT(v, &PyLong_Type); + (void)PyObject_INIT((PyObject *)v, &PyLong_Type); } Py_SIZE(v) = size; v->ob_digit[0] = (digit)abs(ival); diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 5ad283104ff3..9176e39234f7 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -31,7 +31,7 @@ PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) op = free_list; if (op != NULL) { free_list = (PyCFunctionObject *)(op->m_self); - (void)PyObject_INIT(op, &PyCFunction_Type); + (void)PyObject_INIT((PyObject *)op, &PyCFunction_Type); numfree--; } else { diff --git a/PC/winreg.c b/PC/winreg.c index 78864b1a69cf..4f5a676f10b5 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -459,7 +459,7 @@ PyHKEY_FromHKEY(HKEY h) op = (PyHKEYObject *) PyObject_MALLOC(sizeof(PyHKEYObject)); if (op == NULL) return PyErr_NoMemory(); - PyObject_INIT(op, &PyHKEY_Type); + PyObject_INIT((PyObject *)op, &PyHKEY_Type); op->hkey = h; return (PyObject *)op; } From webhook-mailer at python.org Fri Oct 26 09:10:35 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 13:10:35 -0000 Subject: [Python-checkins] bpo-35059, PCbuild: Expand inline funcs in Debug (GH-10094) Message-ID: https://github.com/python/cpython/commit/a05bef4f5be1bcd0df63ec0eb88b64fdde593a86 commit: a05bef4f5be1bcd0df63ec0eb88b64fdde593a86 branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T15:10:29+02:00 summary: bpo-35059, PCbuild: Expand inline funcs in Debug (GH-10094) Visual Studio solution: Set InlineFunctionExpansion to OnlyExplicitInline ("/Ob1" option) on all projects (in pyproject.props) in Debug mode on Win32 and x64 platforms to expand functions marked as inline. This change should make Python compiled in Debug mode a little bit faster on Windows. On Unix, GCC uses -Og optimization level for ./configure --with-pydebug. files: A Misc/NEWS.d/next/Build/2018-10-26-14-49-19.bpo-35059.PKsBxP.rst M PCbuild/pyproject.props diff --git a/Misc/NEWS.d/next/Build/2018-10-26-14-49-19.bpo-35059.PKsBxP.rst b/Misc/NEWS.d/next/Build/2018-10-26-14-49-19.bpo-35059.PKsBxP.rst new file mode 100644 index 000000000000..262161637b13 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-10-26-14-49-19.bpo-35059.PKsBxP.rst @@ -0,0 +1,4 @@ +PCbuild: Set InlineFunctionExpansion to OnlyExplicitInline ("/Ob1" option) +in pyproject.props in Debug mode to expand functions marked as inline. This +change should make Python compiled in Debug mode a little bit faster on +Windows. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 6d36977456e0..95b349c077e5 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -42,6 +42,8 @@ true true NoExtensions + OnlyExplicitInline + OnlyExplicitInline Disabled From webhook-mailer at python.org Fri Oct 26 09:12:06 2018 From: webhook-mailer at python.org (Tal Einat) Date: Fri, 26 Oct 2018 13:12:06 -0000 Subject: [Python-checkins] [3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542) Message-ID: https://github.com/python/cpython/commit/1487b651caa62647f8f8c9e8432e475e3566130c commit: 1487b651caa62647f8f8c9e8432e475e3566130c branch: 3.7 author: Andr?s Delfino committer: Tal Einat date: 2018-10-26T16:12:02+03:00 summary: [3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542) files: M Doc/library/xml.sax.rst diff --git a/Doc/library/xml.sax.rst b/Doc/library/xml.sax.rst index 952090c339f4..e3460e51bd8d 100644 --- a/Doc/library/xml.sax.rst +++ b/Doc/library/xml.sax.rst @@ -40,7 +40,7 @@ The convenience functions are: Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object. The first parser found will - be used. If *parser_list* is provided, it must be a sequence of strings which + be used. If *parser_list* is provided, it must be a list of strings which name modules that have a function named :func:`create_parser`. Modules listed in *parser_list* will be used before modules in the default list of parsers. From webhook-mailer at python.org Fri Oct 26 09:27:21 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 13:27:21 -0000 Subject: [Python-checkins] [3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542) Message-ID: https://github.com/python/cpython/commit/38d7620baab96c702243cfa193377a38888ec10f commit: 38d7620baab96c702243cfa193377a38888ec10f branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T06:27:15-07:00 summary: [3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542) (cherry picked from commit 1487b651caa62647f8f8c9e8432e475e3566130c) Co-authored-by: Andr?s Delfino files: M Doc/library/xml.sax.rst diff --git a/Doc/library/xml.sax.rst b/Doc/library/xml.sax.rst index 1a8f183a945f..254b539e74db 100644 --- a/Doc/library/xml.sax.rst +++ b/Doc/library/xml.sax.rst @@ -40,7 +40,7 @@ The convenience functions are: Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object. The first parser found will - be used. If *parser_list* is provided, it must be a sequence of strings which + be used. If *parser_list* is provided, it must be a list of strings which name modules that have a function named :func:`create_parser`. Modules listed in *parser_list* will be used before modules in the default list of parsers. From webhook-mailer at python.org Fri Oct 26 09:29:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 13:29:45 -0000 Subject: [Python-checkins] [3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542) Message-ID: https://github.com/python/cpython/commit/9dcb517f8ebba16a46ec2a6a97bb3e4a97daeae9 commit: 9dcb517f8ebba16a46ec2a6a97bb3e4a97daeae9 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T06:29:42-07:00 summary: [3.7] bpo-34789: xml.sax.make_parser expects a list not just any sequence (GH-9542) (cherry picked from commit 1487b651caa62647f8f8c9e8432e475e3566130c) Co-authored-by: Andr?s Delfino files: M Doc/library/xml.sax.rst diff --git a/Doc/library/xml.sax.rst b/Doc/library/xml.sax.rst index 25e4fa903246..9ec96967094e 100644 --- a/Doc/library/xml.sax.rst +++ b/Doc/library/xml.sax.rst @@ -31,7 +31,7 @@ The convenience functions are: Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object. The first parser found will - be used. If *parser_list* is provided, it must be a sequence of strings which + be used. If *parser_list* is provided, it must be a list of strings which name modules that have a function named :func:`create_parser`. Modules listed in *parser_list* will be used before modules in the default list of parsers. From webhook-mailer at python.org Fri Oct 26 09:43:40 2018 From: webhook-mailer at python.org (Senthil Kumaran) Date: Fri, 26 Oct 2018 13:43:40 -0000 Subject: [Python-checkins] Simplify the warning for http.server. (#10116) Message-ID: https://github.com/python/cpython/commit/25a525bf5a9c630a992d2048d863841481004465 commit: 25a525bf5a9c630a992d2048d863841481004465 branch: master author: Senthil Kumaran committer: GitHub date: 2018-10-26T06:43:37-07:00 summary: Simplify the warning for http.server. (#10116) files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 45bb529f8c07..29f6e7da3bde 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -19,10 +19,8 @@ This module defines classes for implementing HTTP servers (Web servers). .. warning:: - :mod:`http.server` is meant for demo purposes and does not implement the - stringent security checks needed of a real HTTP server. We do not recommend - using this module directly in production. - + :mod:`http.server` is not recommended for production. It only implements + basic security checks. One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. It creates and listens at the HTTP socket, dispatching the requests to a From webhook-mailer at python.org Fri Oct 26 09:46:20 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 13:46:20 -0000 Subject: [Python-checkins] bpo-35017, socketserver: don't accept request after shutdown (GH-9952) Message-ID: https://github.com/python/cpython/commit/10cb3760e8631a27f5db1e51b05494e29306c671 commit: 10cb3760e8631a27f5db1e51b05494e29306c671 branch: master author: Denis Ledoux committer: Victor Stinner date: 2018-10-26T15:46:17+02:00 summary: bpo-35017, socketserver: don't accept request after shutdown (GH-9952) Prior to this revision, after the shutdown of a `BaseServer`, the server accepted a last single request if it was sent between the server socket polling and the polling timeout. This can be problematic for instance for a server restart for which you do not want to interrupt the service, by not closing the listening socket during the restart. One request failed because of this behavior. Note that only one request failed, following requests were not accepted, as expected. files: A Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst M Lib/socketserver.py diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 9dfd21bab9b6..f0377918e894 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -230,6 +230,9 @@ def serve_forever(self, poll_interval=0.5): while not self.__shutdown_request: ready = selector.select(poll_interval) + # bpo-35017: shutdown() called during select(), exit immediately. + if self.__shutdown_request: + break if ready: self._handle_request_noblock() diff --git a/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst new file mode 100644 index 000000000000..5682717adf70 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst @@ -0,0 +1,3 @@ +:meth:`socketserver.BaseServer.serve_forever` now exits immediately if it's +:meth:`~socketserver.BaseServer.shutdown` method is called while it is +polling for new events. From webhook-mailer at python.org Fri Oct 26 10:06:43 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 14:06:43 -0000 Subject: [Python-checkins] bpo-35017, socketserver: don't accept request after shutdown (GH-9952) Message-ID: https://github.com/python/cpython/commit/908082451382b8b3ba09ebba638db660edbf5d8e commit: 908082451382b8b3ba09ebba638db660edbf5d8e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T07:06:39-07:00 summary: bpo-35017, socketserver: don't accept request after shutdown (GH-9952) Prior to this revision, after the shutdown of a `BaseServer`, the server accepted a last single request if it was sent between the server socket polling and the polling timeout. This can be problematic for instance for a server restart for which you do not want to interrupt the service, by not closing the listening socket during the restart. One request failed because of this behavior. Note that only one request failed, following requests were not accepted, as expected. (cherry picked from commit 10cb3760e8631a27f5db1e51b05494e29306c671) Co-authored-by: Denis Ledoux files: A Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst M Lib/socketserver.py diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 9dfd21bab9b6..f0377918e894 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -230,6 +230,9 @@ def serve_forever(self, poll_interval=0.5): while not self.__shutdown_request: ready = selector.select(poll_interval) + # bpo-35017: shutdown() called during select(), exit immediately. + if self.__shutdown_request: + break if ready: self._handle_request_noblock() diff --git a/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst new file mode 100644 index 000000000000..5682717adf70 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst @@ -0,0 +1,3 @@ +:meth:`socketserver.BaseServer.serve_forever` now exits immediately if it's +:meth:`~socketserver.BaseServer.shutdown` method is called while it is +polling for new events. From webhook-mailer at python.org Fri Oct 26 10:10:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 14:10:45 -0000 Subject: [Python-checkins] bpo-35017, socketserver: don't accept request after shutdown (GH-9952) Message-ID: https://github.com/python/cpython/commit/8b1f52b5a93403acd7d112cd1c1bc716b31a418a commit: 8b1f52b5a93403acd7d112cd1c1bc716b31a418a branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T07:10:41-07:00 summary: bpo-35017, socketserver: don't accept request after shutdown (GH-9952) Prior to this revision, after the shutdown of a `BaseServer`, the server accepted a last single request if it was sent between the server socket polling and the polling timeout. This can be problematic for instance for a server restart for which you do not want to interrupt the service, by not closing the listening socket during the restart. One request failed because of this behavior. Note that only one request failed, following requests were not accepted, as expected. (cherry picked from commit 10cb3760e8631a27f5db1e51b05494e29306c671) Co-authored-by: Denis Ledoux files: A Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst M Lib/socketserver.py diff --git a/Lib/socketserver.py b/Lib/socketserver.py index c4d544b372da..6a0aeee0c342 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -234,6 +234,9 @@ def serve_forever(self, poll_interval=0.5): while not self.__shutdown_request: ready = selector.select(poll_interval) + # bpo-35017: shutdown() called during select(), exit immediately. + if self.__shutdown_request: + break if ready: self._handle_request_noblock() diff --git a/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst new file mode 100644 index 000000000000..5682717adf70 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst @@ -0,0 +1,3 @@ +:meth:`socketserver.BaseServer.serve_forever` now exits immediately if it's +:meth:`~socketserver.BaseServer.shutdown` method is called while it is +polling for new events. From webhook-mailer at python.org Fri Oct 26 10:57:02 2018 From: webhook-mailer at python.org (Tal Einat) Date: Fri, 26 Oct 2018 14:57:02 -0000 Subject: [Python-checkins] bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576) Message-ID: https://github.com/python/cpython/commit/a6dc531063efe3a8d47ff4639729060c72a3688c commit: a6dc531063efe3a8d47ff4639729060c72a3688c branch: master author: Andr?s Delfino committer: Tal Einat date: 2018-10-26T17:56:57+03:00 summary: bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576) files: A Misc/NEWS.d/next/Library/2018-09-25-15-48-50.bpo-34789.rPOEj5.rst M Doc/library/xml.sax.rst M Lib/test/test_sax.py M Lib/xml/sax/__init__.py diff --git a/Doc/library/xml.sax.rst b/Doc/library/xml.sax.rst index aa3ea9bfc55a..0b6973b8c8a8 100644 --- a/Doc/library/xml.sax.rst +++ b/Doc/library/xml.sax.rst @@ -40,10 +40,13 @@ The convenience functions are: Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object. The first parser found will - be used. If *parser_list* is provided, it must be a sequence of strings which + be used. If *parser_list* is provided, it must be an iterable of strings which name modules that have a function named :func:`create_parser`. Modules listed in *parser_list* will be used before modules in the default list of parsers. + .. versionchanged:: 3.8 + The *parser_list* argument can be any iterable, not just a list. + .. function:: parse(filename_or_stream, handler, error_handler=handler.ErrorHandler()) diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py index 3044960a0ed1..894d86ac71f0 100644 --- a/Lib/test/test_sax.py +++ b/Lib/test/test_sax.py @@ -254,6 +254,34 @@ def test_make_parser2(self): from xml.sax import make_parser p = make_parser() + def test_make_parser3(self): + # Testing that make_parser can handle different types of + # iterables. + make_parser(['module']) + make_parser(('module', )) + make_parser({'module'}) + make_parser(frozenset({'module'})) + make_parser({'module': None}) + make_parser(iter(['module'])) + + def test_make_parser4(self): + # Testing that make_parser can handle empty iterables. + make_parser([]) + make_parser(tuple()) + make_parser(set()) + make_parser(frozenset()) + make_parser({}) + make_parser(iter([])) + + def test_make_parser5(self): + # Testing that make_parser can handle iterables with more than + # one item. + make_parser(['module1', 'module2']) + make_parser(('module1', 'module2')) + make_parser({'module1', 'module2'}) + make_parser(frozenset({'module1', 'module2'})) + make_parser({'module1': None, 'module2': None}) + make_parser(iter(['module1', 'module2'])) # =========================================================================== # diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py index 13f6cf58d0d2..a0f5d40b2000 100644 --- a/Lib/xml/sax/__init__.py +++ b/Lib/xml/sax/__init__.py @@ -67,15 +67,15 @@ def parseString(string, handler, errorHandler=ErrorHandler()): default_parser_list = sys.registry.getProperty(_key).split(",") -def make_parser(parser_list = []): +def make_parser(parser_list=()): """Creates and returns a SAX parser. Creates the first parser it is able to instantiate of the ones - given in the list created by doing parser_list + - default_parser_list. The lists must contain the names of Python + given in the iterable created by chaining parser_list and + default_parser_list. The iterables must contain the names of Python modules containing both a SAX parser and a create_parser function.""" - for parser_name in parser_list + default_parser_list: + for parser_name in list(parser_list) + default_parser_list: try: return _create_parser(parser_name) except ImportError as e: diff --git a/Misc/NEWS.d/next/Library/2018-09-25-15-48-50.bpo-34789.rPOEj5.rst b/Misc/NEWS.d/next/Library/2018-09-25-15-48-50.bpo-34789.rPOEj5.rst new file mode 100644 index 000000000000..28f15c3f4122 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-25-15-48-50.bpo-34789.rPOEj5.rst @@ -0,0 +1,2 @@ +:func:`xml.sax.make_parser` now accepts any iterable as its *parser_list* +argument. Patch by Andr?s Delfino. From webhook-mailer at python.org Fri Oct 26 11:07:01 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 15:07:01 -0000 Subject: [Python-checkins] bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128) Message-ID: https://github.com/python/cpython/commit/3b1cba3701fd1321a9bdafa9e683f891369f0cfd commit: 3b1cba3701fd1321a9bdafa9e683f891369f0cfd branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T17:06:57+02:00 summary: bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128) Declare functions with EXTINLINE: * mpd_del() * mpd_uint_zero() * mpd_qresize() * mpd_qresize_zero() * mpd_minalloc() These functions are implemented with "inline" or "ALWAYS_INLINE", but declared without inline which cause linker error on Visual Studio in Debug mode when using /Ob1. files: M Modules/_decimal/libmpdec/mpdecimal.h diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index daf2b9da38b8..a67dd9bc126c 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -818,12 +818,12 @@ void *mpd_sh_alloc(mpd_size_t struct_size, mpd_size_t nmemb, mpd_size_t size); mpd_t *mpd_qnew(void); mpd_t *mpd_new(mpd_context_t *ctx); mpd_t *mpd_qnew_size(mpd_ssize_t size); -void mpd_del(mpd_t *dec); +EXTINLINE void mpd_del(mpd_t *dec); -void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); -int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); -void mpd_minalloc(mpd_t *result); +EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); +EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE void mpd_minalloc(mpd_t *result); int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); From webhook-mailer at python.org Fri Oct 26 11:15:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 15:15:25 -0000 Subject: [Python-checkins] bpo-35017, socketserver: don't accept request after shutdown (GH-9952) (GH-10129) Message-ID: https://github.com/python/cpython/commit/6f97a50c86737458c6bed9970c8dc31a465eff22 commit: 6f97a50c86737458c6bed9970c8dc31a465eff22 branch: 2.7 author: Denis Ledoux committer: Victor Stinner date: 2018-10-26T17:15:22+02:00 summary: bpo-35017, socketserver: don't accept request after shutdown (GH-9952) (GH-10129) Prior to this revision, after the shutdown of a `BaseServer`, the server accepted a last single request if it was sent between the server socket polling and the polling timeout. This can be problematic for instance for a server restart for which you do not want to interrupt the service, by not closing the listening socket during the restart. One request failed because of this behavior. Note that only one request failed, following requests were not accepted, as expected. (cherry picked from commit 10cb3760e8631a27f5db1e51b05494e29306c671) files: A Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst M Lib/SocketServer.py diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index 122430e362df..df56830f0550 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -229,6 +229,9 @@ def serve_forever(self, poll_interval=0.5): # shutdown request and wastes cpu at all other times. r, w, e = _eintr_retry(select.select, [self], [], [], poll_interval) + # bpo-35017: shutdown() called during select(), exit immediately. + if self.__shutdown_request: + break if self in r: self._handle_request_noblock() finally: diff --git a/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst new file mode 100644 index 000000000000..5682717adf70 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-00-11-21.bpo-35017.6Ez4Cv.rst @@ -0,0 +1,3 @@ +:meth:`socketserver.BaseServer.serve_forever` now exits immediately if it's +:meth:`~socketserver.BaseServer.shutdown` method is called while it is +polling for new events. From webhook-mailer at python.org Fri Oct 26 11:16:40 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 15:16:40 -0000 Subject: [Python-checkins] bpo-9263: Use _PyObject_ASSERT() in object.c (GH-10110) Message-ID: https://github.com/python/cpython/commit/24702044afb1d4ad7568bf6aa7450b14dc44a38f commit: 24702044afb1d4ad7568bf6aa7450b14dc44a38f branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T17:16:37+02:00 summary: bpo-9263: Use _PyObject_ASSERT() in object.c (GH-10110) Replace assert() with _PyObject_ASSERT() in Objects/object.c to dump the faulty object on assertion failure to ease debugging. files: M Objects/object.c diff --git a/Objects/object.c b/Objects/object.c index d6f27ff9487f..0e75014878c8 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -72,7 +72,7 @@ _Py_AddToAllObjects(PyObject *op, int force) /* If it's initialized memory, op must be in or out of * the list unambiguously. */ - assert((op->_ob_prev == NULL) == (op->_ob_next == NULL)); + _PyObject_ASSERT(op, (op->_ob_prev == NULL) == (op->_ob_next == NULL)); } #endif if (force || op->_ob_prev == NULL) { @@ -305,7 +305,9 @@ PyObject_CallFinalizerFromDealloc(PyObject *self) /* Undo the temporary resurrection; can't use DECREF here, it would * cause a recursive call. */ - assert(self->ob_refcnt > 0); + _PyObject_ASSERT_WITH_MSG(self, + self->ob_refcnt > 0, + "refcount is too small"); if (--self->ob_refcnt == 0) return 0; /* this is the normal path out */ @@ -316,7 +318,9 @@ PyObject_CallFinalizerFromDealloc(PyObject *self) _Py_NewReference(self); self->ob_refcnt = refcnt; - assert(!PyType_IS_GC(Py_TYPE(self)) || _PyObject_GC_IS_TRACKED(self)); + _PyObject_ASSERT(self, + (!PyType_IS_GC(Py_TYPE(self)) + || _PyObject_GC_IS_TRACKED(self))); /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so * we need to undo that. */ _Py_DEC_REFTOTAL; @@ -1020,7 +1024,7 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value) return err; } Py_DECREF(name); - assert(name->ob_refcnt >= 1); + _PyObject_ASSERT(name, name->ob_refcnt >= 1); if (tp->tp_getattr == NULL && tp->tp_getattro == NULL) PyErr_Format(PyExc_TypeError, "'%.100s' object has no attributes " @@ -1059,8 +1063,8 @@ _PyObject_GetDictPtr(PyObject *obj) size = _PyObject_VAR_SIZE(tp, tsize); dictoffset += (long)size; - assert(dictoffset > 0); - assert(dictoffset % SIZEOF_VOID_P == 0); + _PyObject_ASSERT(obj, dictoffset > 0); + _PyObject_ASSERT(obj, dictoffset % SIZEOF_VOID_P == 0); } return (PyObject **) ((char *)obj + dictoffset); } @@ -1247,11 +1251,11 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name, if (tsize < 0) tsize = -tsize; size = _PyObject_VAR_SIZE(tp, tsize); - assert(size <= PY_SSIZE_T_MAX); + _PyObject_ASSERT(obj, size <= PY_SSIZE_T_MAX); dictoffset += (Py_ssize_t)size; - assert(dictoffset > 0); - assert(dictoffset % SIZEOF_VOID_P == 0); + _PyObject_ASSERT(obj, dictoffset > 0); + _PyObject_ASSERT(obj, dictoffset % SIZEOF_VOID_P == 0); } dictptr = (PyObject **) ((char *)obj + dictoffset); dict = *dictptr; @@ -1486,7 +1490,7 @@ _dir_object(PyObject *obj) PyObject *result, *sorted; PyObject *dirfunc = _PyObject_LookupSpecial(obj, &PyId___dir__); - assert(obj); + assert(obj != NULL); if (dirfunc == NULL) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_TypeError, "object does not provide __dir__"); @@ -2129,9 +2133,9 @@ Py_ReprLeave(PyObject *obj) void _PyTrash_deposit_object(PyObject *op) { - assert(PyObject_IS_GC(op)); - assert(!_PyObject_GC_IS_TRACKED(op)); - assert(op->ob_refcnt == 0); + _PyObject_ASSERT(op, PyObject_IS_GC(op)); + _PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op)); + _PyObject_ASSERT(op, op->ob_refcnt == 0); _PyGCHead_SET_PREV(_Py_AS_GC(op), _PyRuntime.gc.trash_delete_later); _PyRuntime.gc.trash_delete_later = op; } @@ -2141,9 +2145,9 @@ void _PyTrash_thread_deposit_object(PyObject *op) { PyThreadState *tstate = PyThreadState_GET(); - assert(PyObject_IS_GC(op)); - assert(!_PyObject_GC_IS_TRACKED(op)); - assert(op->ob_refcnt == 0); + _PyObject_ASSERT(op, PyObject_IS_GC(op)); + _PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op)); + _PyObject_ASSERT(op, op->ob_refcnt == 0); _PyGCHead_SET_PREV(_Py_AS_GC(op), tstate->trash_delete_later); tstate->trash_delete_later = op; } @@ -2167,7 +2171,7 @@ _PyTrash_destroy_chain(void) * assorted non-release builds calling Py_DECREF again ends * up distorting allocation statistics. */ - assert(op->ob_refcnt == 0); + _PyObject_ASSERT(op, op->ob_refcnt == 0); ++_PyRuntime.gc.trash_delete_nesting; (*dealloc)(op); --_PyRuntime.gc.trash_delete_nesting; @@ -2205,7 +2209,7 @@ _PyTrash_thread_destroy_chain(void) * assorted non-release builds calling Py_DECREF again ends * up distorting allocation statistics. */ - assert(op->ob_refcnt == 0); + _PyObject_ASSERT(op, op->ob_refcnt == 0); (*dealloc)(op); assert(tstate->trash_delete_nesting == 1); } From webhook-mailer at python.org Fri Oct 26 12:00:18 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 16:00:18 -0000 Subject: [Python-checkins] bpo-9263: Use _PyObject_ASSERT() in gcmodule.c (GH-10112) Message-ID: https://github.com/python/cpython/commit/a4b2bc70f69d93d8252861b455052c051b7167ae commit: a4b2bc70f69d93d8252861b455052c051b7167ae branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T18:00:13+02:00 summary: bpo-9263: Use _PyObject_ASSERT() in gcmodule.c (GH-10112) Replace assert() with _PyObject_ASSERT() in Modules/gcmodule.c to dump the faulty object on assertion failure to ease debugging. Fix also indentation of a large comment. Initial patch written by David Malcolm. Co-Authored-By: David Malcolm files: M Modules/gcmodule.c diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 2e19fe4b3646..4773c79b5328 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -366,7 +366,7 @@ update_refs(PyGC_Head *containers) * so serious that maybe this should be a release-build * check instead of an assert? */ - assert(gc_get_refs(gc) != 0); + _PyObject_ASSERT(FROM_GC(gc), gc_get_refs(gc) != 0); } } @@ -432,8 +432,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) // Manually unlink gc from unreachable list because PyGC_Head *prev = GC_PREV(gc); PyGC_Head *next = (PyGC_Head*)(gc->_gc_next & ~NEXT_MASK_UNREACHABLE); - assert(prev->_gc_next & NEXT_MASK_UNREACHABLE); - assert(next->_gc_next & NEXT_MASK_UNREACHABLE); + _PyObject_ASSERT(FROM_GC(prev), + prev->_gc_next & NEXT_MASK_UNREACHABLE); + _PyObject_ASSERT(FROM_GC(next), + next->_gc_next & NEXT_MASK_UNREACHABLE); prev->_gc_next = gc->_gc_next; // copy NEXT_MASK_UNREACHABLE _PyGCHead_SET_PREV(next, prev); @@ -453,7 +455,7 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) * list, and move_unreachable will eventually get to it. */ else { - assert(gc_refs > 0); + _PyObject_ASSERT_WITH_MSG(op, gc_refs > 0, "refcount is too small"); } return 0; } @@ -498,7 +500,8 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) */ PyObject *op = FROM_GC(gc); traverseproc traverse = Py_TYPE(op)->tp_traverse; - assert(gc_get_refs(gc) > 0); + _PyObject_ASSERT_WITH_MSG(op, gc_get_refs(gc) > 0, + "refcount is too small"); // NOTE: visit_reachable may change gc->_gc_next when // young->_gc_prev == gc. Don't do gc = GC_NEXT(gc) before! (void) traverse(op, @@ -593,7 +596,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) for (gc = GC_NEXT(unreachable); gc != unreachable; gc = next) { PyObject *op = FROM_GC(gc); - assert(gc->_gc_next & NEXT_MASK_UNREACHABLE); + _PyObject_ASSERT(op, gc->_gc_next & NEXT_MASK_UNREACHABLE); gc->_gc_next &= ~NEXT_MASK_UNREACHABLE; next = (PyGC_Head*)gc->_gc_next; @@ -690,40 +693,42 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) * the callback pointer intact. Obscure: it also * changes *wrlist. */ - assert(wr->wr_object == op); + _PyObject_ASSERT((PyObject *)wr, wr->wr_object == op); _PyWeakref_ClearRef(wr); - assert(wr->wr_object == Py_None); - if (wr->wr_callback == NULL) - continue; /* no callback */ + _PyObject_ASSERT((PyObject *)wr, wr->wr_object == Py_None); + if (wr->wr_callback == NULL) { + /* no callback */ + continue; + } - /* Headache time. `op` is going away, and is weakly referenced by - * `wr`, which has a callback. Should the callback be invoked? If wr - * is also trash, no: - * - * 1. There's no need to call it. The object and the weakref are - * both going away, so it's legitimate to pretend the weakref is - * going away first. The user has to ensure a weakref outlives its - * referent if they want a guarantee that the wr callback will get - * invoked. - * - * 2. It may be catastrophic to call it. If the callback is also in - * cyclic trash (CT), then although the CT is unreachable from - * outside the current generation, CT may be reachable from the - * callback. Then the callback could resurrect insane objects. - * - * Since the callback is never needed and may be unsafe in this case, - * wr is simply left in the unreachable set. Note that because we - * already called _PyWeakref_ClearRef(wr), its callback will never - * trigger. - * - * OTOH, if wr isn't part of CT, we should invoke the callback: the - * weakref outlived the trash. Note that since wr isn't CT in this - * case, its callback can't be CT either -- wr acted as an external - * root to this generation, and therefore its callback did too. So - * nothing in CT is reachable from the callback either, so it's hard - * to imagine how calling it later could create a problem for us. wr - * is moved to wrcb_to_call in this case. - */ + /* Headache time. `op` is going away, and is weakly referenced by + * `wr`, which has a callback. Should the callback be invoked? If wr + * is also trash, no: + * + * 1. There's no need to call it. The object and the weakref are + * both going away, so it's legitimate to pretend the weakref is + * going away first. The user has to ensure a weakref outlives its + * referent if they want a guarantee that the wr callback will get + * invoked. + * + * 2. It may be catastrophic to call it. If the callback is also in + * cyclic trash (CT), then although the CT is unreachable from + * outside the current generation, CT may be reachable from the + * callback. Then the callback could resurrect insane objects. + * + * Since the callback is never needed and may be unsafe in this case, + * wr is simply left in the unreachable set. Note that because we + * already called _PyWeakref_ClearRef(wr), its callback will never + * trigger. + * + * OTOH, if wr isn't part of CT, we should invoke the callback: the + * weakref outlived the trash. Note that since wr isn't CT in this + * case, its callback can't be CT either -- wr acted as an external + * root to this generation, and therefore its callback did too. So + * nothing in CT is reachable from the callback either, so it's hard + * to imagine how calling it later could create a problem for us. wr + * is moved to wrcb_to_call in this case. + */ if (gc_is_collecting(AS_GC(wr))) { continue; } @@ -751,10 +756,10 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) gc = (PyGC_Head*)wrcb_to_call._gc_next; op = FROM_GC(gc); - assert(PyWeakref_Check(op)); + _PyObject_ASSERT(op, PyWeakref_Check(op)); wr = (PyWeakReference *)op; callback = wr->wr_callback; - assert(callback != NULL); + _PyObject_ASSERT(op, callback != NULL); /* copy-paste of weakrefobject.c's handle_callback() */ temp = PyObject_CallFunctionObjArgs(callback, wr, NULL); @@ -874,12 +879,14 @@ check_garbage(PyGC_Head *collectable) for (gc = GC_NEXT(collectable); gc != collectable; gc = GC_NEXT(gc)) { // Use gc_refs and break gc_prev again. gc_set_refs(gc, Py_REFCNT(FROM_GC(gc))); - assert(gc_get_refs(gc) != 0); + _PyObject_ASSERT(FROM_GC(gc), gc_get_refs(gc) != 0); } subtract_refs(collectable); PyGC_Head *prev = collectable; for (gc = GC_NEXT(collectable); gc != collectable; gc = GC_NEXT(gc)) { - assert(gc_get_refs(gc) >= 0); + _PyObject_ASSERT_WITH_MSG(FROM_GC(gc), + gc_get_refs(gc) >= 0, + "refcount is too small"); if (gc_get_refs(gc) != 0) { ret = -1; } @@ -905,7 +912,8 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old) PyGC_Head *gc = GC_NEXT(collectable); PyObject *op = FROM_GC(gc); - assert(Py_REFCNT(FROM_GC(gc)) > 0); + _PyObject_ASSERT_WITH_MSG(op, Py_REFCNT(op) > 0, + "refcount is too small"); if (_PyRuntime.gc.debug & DEBUG_SAVEALL) { assert(_PyRuntime.gc.garbage != NULL); @@ -1933,10 +1941,12 @@ PyVarObject * _PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems) { const size_t basicsize = _PyObject_VAR_SIZE(Py_TYPE(op), nitems); - PyGC_Head *g = AS_GC(op); - assert(!_PyObject_GC_IS_TRACKED(op)); - if (basicsize > PY_SSIZE_T_MAX - sizeof(PyGC_Head)) + _PyObject_ASSERT((PyObject *)op, !_PyObject_GC_IS_TRACKED(op)); + if (basicsize > PY_SSIZE_T_MAX - sizeof(PyGC_Head)) { return (PyVarObject *)PyErr_NoMemory(); + } + + PyGC_Head *g = AS_GC(op); g = (PyGC_Head *)PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize); if (g == NULL) return (PyVarObject *)PyErr_NoMemory(); From webhook-mailer at python.org Fri Oct 26 12:39:23 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 16:39:23 -0000 Subject: [Python-checkins] bpo-9263: Use _PyObject_ASSERT() in typeobject.c (GH-10111) Message-ID: https://github.com/python/cpython/commit/0862505a0377c12e8004b2eb8de0555f26ce9530 commit: 0862505a0377c12e8004b2eb8de0555f26ce9530 branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T18:39:11+02:00 summary: bpo-9263: Use _PyObject_ASSERT() in typeobject.c (GH-10111) Replace assert() with _PyObject_ASSERT() in Objects/typeobject.c to dump the faulty object on assertion failure to ease debugging. files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b9e69bf1bd1d..3b70e6952e0f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1116,7 +1116,7 @@ subtype_dealloc(PyObject *self) /* Extract the type; we expect it to be a heap type */ type = Py_TYPE(self); - assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE); + _PyObject_ASSERT((PyObject *)type, type->tp_flags & Py_TPFLAGS_HEAPTYPE); /* Test whether the type has GC exactly once */ @@ -2208,17 +2208,19 @@ subtype_getweakref(PyObject *obj, void *context) { PyObject **weaklistptr; PyObject *result; + PyTypeObject *type = Py_TYPE(obj); - if (Py_TYPE(obj)->tp_weaklistoffset == 0) { + if (type->tp_weaklistoffset == 0) { PyErr_SetString(PyExc_AttributeError, "This object has no __weakref__"); return NULL; } - assert(Py_TYPE(obj)->tp_weaklistoffset > 0); - assert(Py_TYPE(obj)->tp_weaklistoffset + sizeof(PyObject *) <= - (size_t)(Py_TYPE(obj)->tp_basicsize)); - weaklistptr = (PyObject **) - ((char *)obj + Py_TYPE(obj)->tp_weaklistoffset); + _PyObject_ASSERT((PyObject *)type, + type->tp_weaklistoffset > 0); + _PyObject_ASSERT((PyObject *)type, + ((type->tp_weaklistoffset + sizeof(PyObject *)) + <= (size_t)(type->tp_basicsize))); + weaklistptr = (PyObject **)((char *)obj + type->tp_weaklistoffset); if (*weaklistptr == NULL) result = Py_None; else @@ -3279,7 +3281,7 @@ type_dealloc(PyTypeObject *type) PyObject *tp, *val, *tb; /* Assert this is a heap-allocated type object */ - assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE); + _PyObject_ASSERT((PyObject *)type, type->tp_flags & Py_TPFLAGS_HEAPTYPE); _PyObject_GC_UNTRACK(type); PyErr_Fetch(&tp, &val, &tb); remove_all_subclasses(type, type->tp_bases); @@ -3503,7 +3505,7 @@ type_clear(PyTypeObject *type) PyDictKeysObject *cached_keys; /* Because of type_is_gc(), the collector only calls this for heaptypes. */ - assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE); + _PyObject_ASSERT((PyObject *)type, type->tp_flags & Py_TPFLAGS_HEAPTYPE); /* We need to invalidate the method cache carefully before clearing the dict, so that other objects caught in a reference cycle @@ -5117,7 +5119,8 @@ PyType_Ready(PyTypeObject *type) assert(_PyType_CheckConsistency(type)); return 0; } - assert((type->tp_flags & Py_TPFLAGS_READYING) == 0); + _PyObject_ASSERT((PyObject *)type, + (type->tp_flags & Py_TPFLAGS_READYING) == 0); type->tp_flags |= Py_TPFLAGS_READYING; From webhook-mailer at python.org Fri Oct 26 12:47:22 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 26 Oct 2018 16:47:22 -0000 Subject: [Python-checkins] bpo-9263: _PyXXX_CheckConsistency() use _PyObject_ASSERT() (GH-10108) Message-ID: https://github.com/python/cpython/commit/50fe3f8913c503e63f4cfb8ddcf8641ef7ad0722 commit: 50fe3f8913c503e63f4cfb8ddcf8641ef7ad0722 branch: master author: Victor Stinner committer: GitHub date: 2018-10-26T18:47:15+02:00 summary: bpo-9263: _PyXXX_CheckConsistency() use _PyObject_ASSERT() (GH-10108) Use _PyObject_ASSERT() in: * _PyDict_CheckConsistency() * _PyType_CheckConsistency() * _PyUnicode_CheckConsistency() _PyObject_ASSERT() dumps the faulty object if the assertion fails to help debugging. files: M Objects/dictobject.c M Objects/typeobject.c M Objects/unicodeobject.c diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 370895d6bcc8..ee656953e072 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -439,6 +439,8 @@ static PyObject *empty_values[1] = { NULL }; static int _PyDict_CheckConsistency(PyDictObject *mp) { +#define ASSERT(expr) _PyObject_ASSERT((PyObject *)mp, (expr)) + PyDictKeysObject *keys = mp->ma_keys; int splitted = _PyDict_HasSplitTable(mp); Py_ssize_t usable = USABLE_FRACTION(keys->dk_size); @@ -447,23 +449,23 @@ _PyDict_CheckConsistency(PyDictObject *mp) Py_ssize_t i; #endif - assert(0 <= mp->ma_used && mp->ma_used <= usable); - assert(IS_POWER_OF_2(keys->dk_size)); - assert(0 <= keys->dk_usable + ASSERT(0 <= mp->ma_used && mp->ma_used <= usable); + ASSERT(IS_POWER_OF_2(keys->dk_size)); + ASSERT(0 <= keys->dk_usable && keys->dk_usable <= usable); - assert(0 <= keys->dk_nentries + ASSERT(0 <= keys->dk_nentries && keys->dk_nentries <= usable); - assert(keys->dk_usable + keys->dk_nentries <= usable); + ASSERT(keys->dk_usable + keys->dk_nentries <= usable); if (!splitted) { /* combined table */ - assert(keys->dk_refcnt == 1); + ASSERT(keys->dk_refcnt == 1); } #ifdef DEBUG_PYDICT for (i=0; i < keys->dk_size; i++) { Py_ssize_t ix = dk_get_index(keys, i); - assert(DKIX_DUMMY <= ix && ix <= usable); + ASSERT(DKIX_DUMMY <= ix && ix <= usable); } for (i=0; i < usable; i++) { @@ -473,32 +475,34 @@ _PyDict_CheckConsistency(PyDictObject *mp) if (key != NULL) { if (PyUnicode_CheckExact(key)) { Py_hash_t hash = ((PyASCIIObject *)key)->hash; - assert(hash != -1); - assert(entry->me_hash == hash); + ASSERT(hash != -1); + ASSERT(entry->me_hash == hash); } else { /* test_dict fails if PyObject_Hash() is called again */ - assert(entry->me_hash != -1); + ASSERT(entry->me_hash != -1); } if (!splitted) { - assert(entry->me_value != NULL); + ASSERT(entry->me_value != NULL); } } if (splitted) { - assert(entry->me_value == NULL); + ASSERT(entry->me_value == NULL); } } if (splitted) { /* splitted table */ for (i=0; i < mp->ma_used; i++) { - assert(mp->ma_values[i] != NULL); + ASSERT(mp->ma_values[i] != NULL); } } #endif return 1; + +#undef ASSERT } #endif diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 3b70e6952e0f..8e91e33d2d10 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -134,15 +134,19 @@ skip_signature(const char *doc) static int _PyType_CheckConsistency(PyTypeObject *type) { +#define ASSERT(expr) _PyObject_ASSERT((PyObject *)type, (expr)) + if (!(type->tp_flags & Py_TPFLAGS_READY)) { /* don't check types before PyType_Ready() */ return 1; } - assert(!(type->tp_flags & Py_TPFLAGS_READYING)); - assert(type->tp_mro != NULL && PyTuple_Check(type->tp_mro)); - assert(type->tp_dict != NULL); + ASSERT(!(type->tp_flags & Py_TPFLAGS_READYING)); + ASSERT(type->tp_mro != NULL && PyTuple_Check(type->tp_mro)); + ASSERT(type->tp_dict != NULL); return 1; + +#undef ASSERT } #endif diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 31703d37ddbd..f3f940ac9ef5 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -363,17 +363,19 @@ PyUnicode_GetMax(void) int _PyUnicode_CheckConsistency(PyObject *op, int check_content) { +#define ASSERT(expr) _PyObject_ASSERT(op, (expr)) + PyASCIIObject *ascii; unsigned int kind; - assert(PyUnicode_Check(op)); + ASSERT(PyUnicode_Check(op)); ascii = (PyASCIIObject *)op; kind = ascii->state.kind; if (ascii->state.ascii == 1 && ascii->state.compact == 1) { - assert(kind == PyUnicode_1BYTE_KIND); - assert(ascii->state.ready == 1); + ASSERT(kind == PyUnicode_1BYTE_KIND); + ASSERT(ascii->state.ready == 1); } else { PyCompactUnicodeObject *compact = (PyCompactUnicodeObject *)op; @@ -381,41 +383,41 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) if (ascii->state.compact == 1) { data = compact + 1; - assert(kind == PyUnicode_1BYTE_KIND + ASSERT(kind == PyUnicode_1BYTE_KIND || kind == PyUnicode_2BYTE_KIND || kind == PyUnicode_4BYTE_KIND); - assert(ascii->state.ascii == 0); - assert(ascii->state.ready == 1); - assert (compact->utf8 != data); + ASSERT(ascii->state.ascii == 0); + ASSERT(ascii->state.ready == 1); + ASSERT (compact->utf8 != data); } else { PyUnicodeObject *unicode = (PyUnicodeObject *)op; data = unicode->data.any; if (kind == PyUnicode_WCHAR_KIND) { - assert(ascii->length == 0); - assert(ascii->hash == -1); - assert(ascii->state.compact == 0); - assert(ascii->state.ascii == 0); - assert(ascii->state.ready == 0); - assert(ascii->state.interned == SSTATE_NOT_INTERNED); - assert(ascii->wstr != NULL); - assert(data == NULL); - assert(compact->utf8 == NULL); + ASSERT(ascii->length == 0); + ASSERT(ascii->hash == -1); + ASSERT(ascii->state.compact == 0); + ASSERT(ascii->state.ascii == 0); + ASSERT(ascii->state.ready == 0); + ASSERT(ascii->state.interned == SSTATE_NOT_INTERNED); + ASSERT(ascii->wstr != NULL); + ASSERT(data == NULL); + ASSERT(compact->utf8 == NULL); } else { - assert(kind == PyUnicode_1BYTE_KIND + ASSERT(kind == PyUnicode_1BYTE_KIND || kind == PyUnicode_2BYTE_KIND || kind == PyUnicode_4BYTE_KIND); - assert(ascii->state.compact == 0); - assert(ascii->state.ready == 1); - assert(data != NULL); + ASSERT(ascii->state.compact == 0); + ASSERT(ascii->state.ready == 1); + ASSERT(data != NULL); if (ascii->state.ascii) { - assert (compact->utf8 == data); - assert (compact->utf8_length == ascii->length); + ASSERT (compact->utf8 == data); + ASSERT (compact->utf8_length == ascii->length); } else - assert (compact->utf8 != data); + ASSERT (compact->utf8 != data); } } if (kind != PyUnicode_WCHAR_KIND) { @@ -427,16 +429,16 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) #endif ) { - assert(ascii->wstr == data); - assert(compact->wstr_length == ascii->length); + ASSERT(ascii->wstr == data); + ASSERT(compact->wstr_length == ascii->length); } else - assert(ascii->wstr != data); + ASSERT(ascii->wstr != data); } if (compact->utf8 == NULL) - assert(compact->utf8_length == 0); + ASSERT(compact->utf8_length == 0); if (ascii->wstr == NULL) - assert(compact->wstr_length == 0); + ASSERT(compact->wstr_length == 0); } /* check that the best kind is used */ if (check_content && kind != PyUnicode_WCHAR_KIND) @@ -455,23 +457,25 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) } if (kind == PyUnicode_1BYTE_KIND) { if (ascii->state.ascii == 0) { - assert(maxchar >= 128); - assert(maxchar <= 255); + ASSERT(maxchar >= 128); + ASSERT(maxchar <= 255); } else - assert(maxchar < 128); + ASSERT(maxchar < 128); } else if (kind == PyUnicode_2BYTE_KIND) { - assert(maxchar >= 0x100); - assert(maxchar <= 0xFFFF); + ASSERT(maxchar >= 0x100); + ASSERT(maxchar <= 0xFFFF); } else { - assert(maxchar >= 0x10000); - assert(maxchar <= MAX_UNICODE); + ASSERT(maxchar >= 0x10000); + ASSERT(maxchar <= MAX_UNICODE); } - assert(PyUnicode_READ(kind, data, ascii->length) == 0); + ASSERT(PyUnicode_READ(kind, data, ascii->length) == 0); } return 1; + +#undef ASSERT } #endif From webhook-mailer at python.org Fri Oct 26 13:11:43 2018 From: webhook-mailer at python.org (Senthil Kumaran) Date: Fri, 26 Oct 2018 17:11:43 -0000 Subject: [Python-checkins] [3.7] bpo-34576 : Backport eeab510 (#10114) Message-ID: https://github.com/python/cpython/commit/bb1876acd815a05744cea4a7d4098231ef499e52 commit: bb1876acd815a05744cea4a7d4098231ef499e52 branch: 3.7 author: Senthil Kumaran committer: GitHub date: 2018-10-26T10:11:39-07:00 summary: [3.7] bpo-34576 : Backport eeab510 (#10114) * bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005) (cherry picked from commit eeab510bb7e51802c18b3770cbb23ae0ca91da6b) files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index 0bd7f778cec0..7e317cd8bc2b 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -16,6 +16,11 @@ This module defines classes for implementing HTTP servers (Web servers). +.. warning:: + + :mod:`http.server` is not recommended for production. It only implements + basic security checks. + One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. It creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:: From webhook-mailer at python.org Fri Oct 26 13:12:34 2018 From: webhook-mailer at python.org (Senthil Kumaran) Date: Fri, 26 Oct 2018 17:12:34 -0000 Subject: [Python-checkins] [3.6] - bpo-34576 : Backport eeab510 3.6 (GH-10113) Message-ID: https://github.com/python/cpython/commit/8be1c043a6d10d375f7a73c681cb2d7ec2f2d361 commit: 8be1c043a6d10d375f7a73c681cb2d7ec2f2d361 branch: 3.6 author: Senthil Kumaran committer: GitHub date: 2018-10-26T10:12:29-07:00 summary: [3.6] - bpo-34576 : Backport eeab510 3.6 (GH-10113) * bpo-34576 - Fix the formatting for security considerations in http.server.rst (GH-10005) (cherry picked from commit eeab510bb7e51802c18b3770cbb23ae0ca91da6b) files: M Doc/library/http.server.rst diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst index b29020bc7ca5..2d1a96d7bba4 100644 --- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -16,6 +16,11 @@ This module defines classes for implementing HTTP servers (Web servers). +.. warning:: + + :mod:`http.server` is not recommended for production. It only implements + only basic security checks. + One class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer` subclass. It creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:: From webhook-mailer at python.org Fri Oct 26 13:14:09 2018 From: webhook-mailer at python.org (Benjamin Peterson) Date: Fri, 26 Oct 2018 17:14:09 -0000 Subject: [Python-checkins] Fix a typo in asyncio-dev.rst. (GH-10133) Message-ID: https://github.com/python/cpython/commit/4e3a53bceefe4803c08a025523d8658862cb31c0 commit: 4e3a53bceefe4803c08a025523d8658862cb31c0 branch: master author: Benjamin Peterson committer: GitHub date: 2018-10-26T10:14:04-07:00 summary: Fix a typo in asyncio-dev.rst. (GH-10133) "threadsafe" files: M Doc/library/asyncio-dev.rst diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index 5f926fceb22d..b72880361929 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -50,7 +50,7 @@ When the debug mode is enabled: ` and logs them; this mitigates the "forgotten await" pitfall. -* Many non-treadsafe asyncio APIs (such as :meth:`loop.call_soon` and +* Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:`loop.call_at` methods) raise an exception if they are called from a wrong thread. From webhook-mailer at python.org Fri Oct 26 13:28:30 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 17:28:30 -0000 Subject: [Python-checkins] bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128) Message-ID: https://github.com/python/cpython/commit/95cfb818eaffba41333d4bc93253f4e0c6237ca8 commit: 95cfb818eaffba41333d4bc93253f4e0c6237ca8 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T10:28:26-07:00 summary: bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128) Declare functions with EXTINLINE: * mpd_del() * mpd_uint_zero() * mpd_qresize() * mpd_qresize_zero() * mpd_minalloc() These functions are implemented with "inline" or "ALWAYS_INLINE", but declared without inline which cause linker error on Visual Studio in Debug mode when using /Ob1. (cherry picked from commit 3b1cba3701fd1321a9bdafa9e683f891369f0cfd) Co-authored-by: Victor Stinner files: M Modules/_decimal/libmpdec/mpdecimal.h diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index daf2b9da38b8..a67dd9bc126c 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -818,12 +818,12 @@ void *mpd_sh_alloc(mpd_size_t struct_size, mpd_size_t nmemb, mpd_size_t size); mpd_t *mpd_qnew(void); mpd_t *mpd_new(mpd_context_t *ctx); mpd_t *mpd_qnew_size(mpd_ssize_t size); -void mpd_del(mpd_t *dec); +EXTINLINE void mpd_del(mpd_t *dec); -void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); -int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); -void mpd_minalloc(mpd_t *result); +EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); +EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE void mpd_minalloc(mpd_t *result); int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); From webhook-mailer at python.org Fri Oct 26 13:30:33 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 17:30:33 -0000 Subject: [Python-checkins] bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128) Message-ID: https://github.com/python/cpython/commit/7eac88afd2e39d05a0ed3bc8c0787a2e755a6072 commit: 7eac88afd2e39d05a0ed3bc8c0787a2e755a6072 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T10:30:29-07:00 summary: bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128) Declare functions with EXTINLINE: * mpd_del() * mpd_uint_zero() * mpd_qresize() * mpd_qresize_zero() * mpd_minalloc() These functions are implemented with "inline" or "ALWAYS_INLINE", but declared without inline which cause linker error on Visual Studio in Debug mode when using /Ob1. (cherry picked from commit 3b1cba3701fd1321a9bdafa9e683f891369f0cfd) Co-authored-by: Victor Stinner files: M Modules/_decimal/libmpdec/mpdecimal.h diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index daf2b9da38b8..a67dd9bc126c 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -818,12 +818,12 @@ void *mpd_sh_alloc(mpd_size_t struct_size, mpd_size_t nmemb, mpd_size_t size); mpd_t *mpd_qnew(void); mpd_t *mpd_new(mpd_context_t *ctx); mpd_t *mpd_qnew_size(mpd_ssize_t size); -void mpd_del(mpd_t *dec); +EXTINLINE void mpd_del(mpd_t *dec); -void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); -int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); -void mpd_minalloc(mpd_t *result); +EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); +EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE void mpd_minalloc(mpd_t *result); int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); From webhook-mailer at python.org Fri Oct 26 13:42:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 17:42:54 -0000 Subject: [Python-checkins] Fix a typo in asyncio-dev.rst. (GH-10133) Message-ID: https://github.com/python/cpython/commit/f2b5b4f2594efabaf4f3fd20453ae8a9a607a01e commit: f2b5b4f2594efabaf4f3fd20453ae8a9a607a01e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T10:42:49-07:00 summary: Fix a typo in asyncio-dev.rst. (GH-10133) "threadsafe" (cherry picked from commit 4e3a53bceefe4803c08a025523d8658862cb31c0) Co-authored-by: Benjamin Peterson files: M Doc/library/asyncio-dev.rst diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index 5f926fceb22d..b72880361929 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -50,7 +50,7 @@ When the debug mode is enabled: ` and logs them; this mitigates the "forgotten await" pitfall. -* Many non-treadsafe asyncio APIs (such as :meth:`loop.call_soon` and +* Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:`loop.call_at` methods) raise an exception if they are called from a wrong thread. From webhook-mailer at python.org Fri Oct 26 14:36:36 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 26 Oct 2018 18:36:36 -0000 Subject: [Python-checkins] bpo-35024: Remove redundant and possibly incorrect verbose message after writing '.pyc' (GH-9998) Message-ID: https://github.com/python/cpython/commit/9e14e49f13ef1a726f31efe6689285463332db6e commit: 9e14e49f13ef1a726f31efe6689285463332db6e branch: master author: Quentin Agren committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-26T11:36:30-07:00 summary: bpo-35024: Remove redundant and possibly incorrect verbose message after writing '.pyc' (GH-9998) Since `SourceFileLoader.set_data()` catches exceptions raised by `_write_atomic()` and logs an informative message consequently, always logging successful outcome in 'SourceLoader.get_code()' seems redundant. https://bugs.python.org/issue35024 files: A Misc/NEWS.d/next/Library/2018-10-25-15-43-32.bpo-35024.ltSrtr.rst M Lib/importlib/_bootstrap_external.py M Python/importlib_external.h diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 0b742baa37c2..71fdd0cb59fe 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -920,7 +920,6 @@ def get_code(self, fullname): len(source_bytes)) try: self._cache_bytecode(source_path, bytecode_path, data) - _bootstrap._verbose_message('wrote {!r}', bytecode_path) except NotImplementedError: pass return code_object diff --git a/Misc/NEWS.d/next/Library/2018-10-25-15-43-32.bpo-35024.ltSrtr.rst b/Misc/NEWS.d/next/Library/2018-10-25-15-43-32.bpo-35024.ltSrtr.rst new file mode 100644 index 000000000000..ef156435d3f7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-25-15-43-32.bpo-35024.ltSrtr.rst @@ -0,0 +1,3 @@ +`importlib` no longer logs `wrote ` redundantly after +`(created|could not create) ` is already logged. +Patch by Quentin Agren. diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 5121ec57c2ba..8596671343be 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1291,7 +1291,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 111,117,114,99,101,76,111,97,100,101,114,46,115,111,117,114, 99,101,95,116,111,95,99,111,100,101,99,2,0,0,0,0, 0,0,0,15,0,0,0,9,0,0,0,67,0,0,0,115, - 46,2,0,0,124,0,160,0,124,1,161,1,125,2,100,1, + 34,2,0,0,124,0,160,0,124,1,161,1,125,2,100,1, 125,3,100,1,125,4,100,1,125,5,100,2,125,6,100,3, 125,7,122,12,116,1,124,2,131,1,125,8,87,0,110,26, 4,0,116,2,107,10,114,68,1,0,1,0,1,0,100,1, @@ -1317,1368 +1317,1366 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 124,2,100,14,141,4,83,0,124,4,100,1,107,8,144,1, 114,136,124,0,160,6,124,2,161,1,125,4,124,0,160,20, 124,4,124,2,161,2,125,14,116,17,160,18,100,15,124,2, - 161,2,1,0,116,21,106,22,144,2,115,42,124,8,100,1, - 107,9,144,2,114,42,124,3,100,1,107,9,144,2,114,42, + 161,2,1,0,116,21,106,22,144,2,115,30,124,8,100,1, + 107,9,144,2,114,30,124,3,100,1,107,9,144,2,114,30, 124,6,144,1,114,228,124,5,100,1,107,8,144,1,114,214, 116,9,160,11,124,4,161,1,125,5,116,23,124,14,124,5, 124,7,131,3,125,10,110,16,116,24,124,14,124,3,116,25, - 124,4,131,1,131,3,125,10,122,30,124,0,160,26,124,2, - 124,8,124,10,161,3,1,0,116,17,160,18,100,16,124,8, - 161,2,1,0,87,0,110,22,4,0,116,2,107,10,144,2, - 114,40,1,0,1,0,1,0,89,0,110,2,88,0,124,14, - 83,0,41,17,122,190,67,111,110,99,114,101,116,101,32,105, - 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, - 32,73,110,115,112,101,99,116,76,111,97,100,101,114,46,103, - 101,116,95,99,111,100,101,46,10,10,32,32,32,32,32,32, - 32,32,82,101,97,100,105,110,103,32,111,102,32,98,121,116, - 101,99,111,100,101,32,114,101,113,117,105,114,101,115,32,112, - 97,116,104,95,115,116,97,116,115,32,116,111,32,98,101,32, - 105,109,112,108,101,109,101,110,116,101,100,46,32,84,111,32, - 119,114,105,116,101,10,32,32,32,32,32,32,32,32,98,121, - 116,101,99,111,100,101,44,32,115,101,116,95,100,97,116,97, - 32,109,117,115,116,32,97,108,115,111,32,98,101,32,105,109, - 112,108,101,109,101,110,116,101,100,46,10,10,32,32,32,32, - 32,32,32,32,78,70,84,114,155,0,0,0,41,2,114,106, - 0,0,0,114,39,0,0,0,114,132,0,0,0,114,34,0, - 0,0,114,64,0,0,0,114,23,0,0,0,90,5,110,101, - 118,101,114,90,6,97,108,119,97,121,115,218,4,115,105,122, - 101,122,13,123,125,32,109,97,116,99,104,101,115,32,123,125, - 41,3,114,106,0,0,0,114,98,0,0,0,114,99,0,0, - 0,122,19,99,111,100,101,32,111,98,106,101,99,116,32,102, - 114,111,109,32,123,125,122,10,119,114,111,116,101,32,123,33, - 114,125,41,27,114,164,0,0,0,114,89,0,0,0,114,73, - 0,0,0,114,202,0,0,0,114,44,0,0,0,114,14,0, - 0,0,114,205,0,0,0,114,139,0,0,0,218,10,109,101, - 109,111,114,121,118,105,101,119,114,149,0,0,0,90,21,99, - 104,101,99,107,95,104,97,115,104,95,98,97,115,101,100,95, - 112,121,99,115,114,144,0,0,0,218,17,95,82,65,87,95, - 77,65,71,73,67,95,78,85,77,66,69,82,114,145,0,0, - 0,114,143,0,0,0,114,107,0,0,0,114,137,0,0,0, - 114,122,0,0,0,114,136,0,0,0,114,151,0,0,0,114, - 211,0,0,0,114,6,0,0,0,218,19,100,111,110,116,95, - 119,114,105,116,101,95,98,121,116,101,99,111,100,101,114,157, - 0,0,0,114,156,0,0,0,114,18,0,0,0,114,204,0, - 0,0,41,15,114,108,0,0,0,114,127,0,0,0,114,99, - 0,0,0,114,141,0,0,0,114,160,0,0,0,114,144,0, - 0,0,90,10,104,97,115,104,95,98,97,115,101,100,90,12, - 99,104,101,99,107,95,115,111,117,114,99,101,114,98,0,0, - 0,218,2,115,116,114,21,0,0,0,114,138,0,0,0,114, - 74,0,0,0,90,10,98,121,116,101,115,95,100,97,116,97, - 90,11,99,111,100,101,95,111,98,106,101,99,116,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,193,0,0, - 0,75,3,0,0,115,154,0,0,0,0,7,10,1,4,1, - 4,1,4,1,4,1,4,1,2,1,12,1,14,1,12,2, - 2,1,14,1,14,1,8,2,12,1,2,1,14,1,14,1, - 6,3,2,1,2,254,6,4,2,1,12,1,16,1,12,1, - 6,1,12,1,12,1,2,255,2,2,8,254,4,3,10,1, - 4,1,2,1,2,254,4,4,8,1,2,255,6,3,2,1, - 2,1,2,1,6,1,2,1,2,251,8,7,20,1,6,2, - 8,1,2,255,4,2,6,1,2,1,2,254,6,3,10,1, - 10,1,12,1,12,1,18,1,6,255,4,2,6,1,10,1, - 10,1,14,2,6,1,6,255,4,2,2,1,14,1,16,1, - 16,1,6,1,122,21,83,111,117,114,99,101,76,111,97,100, - 101,114,46,103,101,116,95,99,111,100,101,78,41,10,114,113, - 0,0,0,114,112,0,0,0,114,114,0,0,0,114,201,0, - 0,0,114,202,0,0,0,114,204,0,0,0,114,203,0,0, - 0,114,207,0,0,0,114,211,0,0,0,114,193,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,200,0,0,0,16,3,0,0,115,14,0, - 0,0,8,2,8,8,8,14,8,10,8,7,8,10,14,8, - 114,200,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,0,0,0,0,115,124,0,0,0,101, - 0,90,1,100,0,90,2,100,1,90,3,100,2,100,3,132, - 0,90,4,100,4,100,5,132,0,90,5,100,6,100,7,132, - 0,90,6,101,7,135,0,102,1,100,8,100,9,132,8,131, - 1,90,8,101,7,100,10,100,11,132,0,131,1,90,9,100, - 12,100,13,132,0,90,10,101,7,100,14,100,15,132,0,131, - 1,90,11,100,16,100,17,132,0,90,12,100,18,100,19,132, - 0,90,13,100,20,100,21,132,0,90,14,100,22,100,23,132, - 0,90,15,135,0,4,0,90,16,83,0,41,24,218,10,70, - 105,108,101,76,111,97,100,101,114,122,103,66,97,115,101,32, - 102,105,108,101,32,108,111,97,100,101,114,32,99,108,97,115, - 115,32,119,104,105,99,104,32,105,109,112,108,101,109,101,110, - 116,115,32,116,104,101,32,108,111,97,100,101,114,32,112,114, - 111,116,111,99,111,108,32,109,101,116,104,111,100,115,32,116, - 104,97,116,10,32,32,32,32,114,101,113,117,105,114,101,32, - 102,105,108,101,32,115,121,115,116,101,109,32,117,115,97,103, - 101,46,99,3,0,0,0,0,0,0,0,3,0,0,0,2, - 0,0,0,67,0,0,0,115,16,0,0,0,124,1,124,0, - 95,0,124,2,124,0,95,1,100,1,83,0,41,2,122,75, - 67,97,99,104,101,32,116,104,101,32,109,111,100,117,108,101, - 32,110,97,109,101,32,97,110,100,32,116,104,101,32,112,97, - 116,104,32,116,111,32,116,104,101,32,102,105,108,101,32,102, - 111,117,110,100,32,98,121,32,116,104,101,10,32,32,32,32, - 32,32,32,32,102,105,110,100,101,114,46,78,41,2,114,106, - 0,0,0,114,39,0,0,0,41,3,114,108,0,0,0,114, - 127,0,0,0,114,39,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,191,0,0,0,166,3,0, - 0,115,4,0,0,0,0,3,6,1,122,19,70,105,108,101, - 76,111,97,100,101,114,46,95,95,105,110,105,116,95,95,99, - 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, - 67,0,0,0,115,24,0,0,0,124,0,106,0,124,1,106, - 0,107,2,111,22,124,0,106,1,124,1,106,1,107,2,83, - 0,41,1,78,41,2,218,9,95,95,99,108,97,115,115,95, - 95,114,119,0,0,0,41,2,114,108,0,0,0,218,5,111, - 116,104,101,114,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,6,95,95,101,113,95,95,172,3,0,0,115, - 6,0,0,0,0,1,12,1,10,255,122,17,70,105,108,101, - 76,111,97,100,101,114,46,95,95,101,113,95,95,99,1,0, - 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, - 0,0,115,20,0,0,0,116,0,124,0,106,1,131,1,116, - 0,124,0,106,2,131,1,65,0,83,0,41,1,78,41,3, - 218,4,104,97,115,104,114,106,0,0,0,114,39,0,0,0, - 41,1,114,108,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,8,95,95,104,97,115,104,95,95, - 176,3,0,0,115,2,0,0,0,0,1,122,19,70,105,108, - 101,76,111,97,100,101,114,46,95,95,104,97,115,104,95,95, - 99,2,0,0,0,0,0,0,0,2,0,0,0,3,0,0, - 0,3,0,0,0,115,16,0,0,0,116,0,116,1,124,0, - 131,2,160,2,124,1,161,1,83,0,41,1,122,100,76,111, - 97,100,32,97,32,109,111,100,117,108,101,32,102,114,111,109, - 32,97,32,102,105,108,101,46,10,10,32,32,32,32,32,32, - 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, - 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, - 101,32,101,120,101,99,95,109,111,100,117,108,101,40,41,32, - 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32, - 32,32,41,3,218,5,115,117,112,101,114,114,217,0,0,0, - 114,199,0,0,0,41,2,114,108,0,0,0,114,127,0,0, - 0,41,1,114,218,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,199,0,0,0,179,3,0,0,115,2,0,0,0, - 0,10,122,22,70,105,108,101,76,111,97,100,101,114,46,108, - 111,97,100,95,109,111,100,117,108,101,99,2,0,0,0,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 6,0,0,0,124,0,106,0,83,0,41,1,122,58,82,101, - 116,117,114,110,32,116,104,101,32,112,97,116,104,32,116,111, - 32,116,104,101,32,115,111,117,114,99,101,32,102,105,108,101, - 32,97,115,32,102,111,117,110,100,32,98,121,32,116,104,101, - 32,102,105,110,100,101,114,46,41,1,114,39,0,0,0,41, - 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,164,0,0,0,191, - 3,0,0,115,2,0,0,0,0,3,122,23,70,105,108,101, - 76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110, - 97,109,101,99,2,0,0,0,0,0,0,0,3,0,0,0, - 10,0,0,0,67,0,0,0,115,44,0,0,0,116,0,160, - 1,124,1,100,1,161,2,143,22,125,2,124,2,160,2,161, - 0,87,0,2,0,53,0,81,0,82,0,163,0,83,0,81, - 0,82,0,88,0,100,2,83,0,41,3,122,39,82,101,116, - 117,114,110,32,116,104,101,32,100,97,116,97,32,102,114,111, - 109,32,112,97,116,104,32,97,115,32,114,97,119,32,98,121, - 116,101,115,46,218,1,114,78,41,3,114,56,0,0,0,114, - 57,0,0,0,90,4,114,101,97,100,41,3,114,108,0,0, - 0,114,39,0,0,0,114,60,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,205,0,0,0,196, - 3,0,0,115,4,0,0,0,0,2,14,1,122,19,70,105, - 108,101,76,111,97,100,101,114,46,103,101,116,95,100,97,116, - 97,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,67,0,0,0,115,18,0,0,0,124,0,160,0,124, - 1,161,1,114,14,124,0,83,0,100,0,83,0,41,1,78, - 41,1,114,166,0,0,0,41,2,114,108,0,0,0,114,196, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,19,103,101,116,95,114,101,115,111,117,114,99,101, - 95,114,101,97,100,101,114,203,3,0,0,115,6,0,0,0, - 0,2,10,1,4,1,122,30,70,105,108,101,76,111,97,100, - 101,114,46,103,101,116,95,114,101,115,111,117,114,99,101,95, - 114,101,97,100,101,114,99,2,0,0,0,0,0,0,0,3, - 0,0,0,4,0,0,0,67,0,0,0,115,32,0,0,0, - 116,0,116,1,124,0,106,2,131,1,100,1,25,0,124,1, - 131,2,125,2,116,3,160,4,124,2,100,2,161,2,83,0, - 41,3,78,114,64,0,0,0,114,224,0,0,0,41,5,114, - 33,0,0,0,114,42,0,0,0,114,39,0,0,0,114,56, - 0,0,0,114,57,0,0,0,41,3,114,108,0,0,0,218, - 8,114,101,115,111,117,114,99,101,114,39,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,13,111, - 112,101,110,95,114,101,115,111,117,114,99,101,209,3,0,0, - 115,4,0,0,0,0,1,20,1,122,24,70,105,108,101,76, - 111,97,100,101,114,46,111,112,101,110,95,114,101,115,111,117, - 114,99,101,99,2,0,0,0,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,38,0,0,0,124,0,160, - 0,124,1,161,1,115,14,116,1,130,1,116,2,116,3,124, - 0,106,4,131,1,100,1,25,0,124,1,131,2,125,2,124, - 2,83,0,41,2,78,114,64,0,0,0,41,5,218,11,105, - 115,95,114,101,115,111,117,114,99,101,218,17,70,105,108,101, - 78,111,116,70,111,117,110,100,69,114,114,111,114,114,33,0, - 0,0,114,42,0,0,0,114,39,0,0,0,41,3,114,108, - 0,0,0,114,226,0,0,0,114,39,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,13,114,101, - 115,111,117,114,99,101,95,112,97,116,104,213,3,0,0,115, - 8,0,0,0,0,1,10,1,4,1,20,1,122,24,70,105, - 108,101,76,111,97,100,101,114,46,114,101,115,111,117,114,99, - 101,95,112,97,116,104,99,2,0,0,0,0,0,0,0,3, - 0,0,0,3,0,0,0,67,0,0,0,115,40,0,0,0, - 116,0,124,1,107,6,114,12,100,1,83,0,116,1,116,2, - 124,0,106,3,131,1,100,2,25,0,124,1,131,2,125,2, - 116,4,124,2,131,1,83,0,41,3,78,70,114,64,0,0, - 0,41,5,114,30,0,0,0,114,33,0,0,0,114,42,0, - 0,0,114,39,0,0,0,114,48,0,0,0,41,3,114,108, - 0,0,0,114,106,0,0,0,114,39,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,228,0,0, - 0,219,3,0,0,115,8,0,0,0,0,1,8,1,4,1, - 20,1,122,22,70,105,108,101,76,111,97,100,101,114,46,105, - 115,95,114,101,115,111,117,114,99,101,99,1,0,0,0,0, - 0,0,0,1,0,0,0,5,0,0,0,67,0,0,0,115, - 24,0,0,0,116,0,116,1,160,2,116,3,124,0,106,4, - 131,1,100,1,25,0,161,1,131,1,83,0,41,2,78,114, - 64,0,0,0,41,5,218,4,105,116,101,114,114,1,0,0, - 0,218,7,108,105,115,116,100,105,114,114,42,0,0,0,114, - 39,0,0,0,41,1,114,108,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,8,99,111,110,116, - 101,110,116,115,225,3,0,0,115,2,0,0,0,0,1,122, - 19,70,105,108,101,76,111,97,100,101,114,46,99,111,110,116, - 101,110,116,115,41,17,114,113,0,0,0,114,112,0,0,0, - 114,114,0,0,0,114,115,0,0,0,114,191,0,0,0,114, - 220,0,0,0,114,222,0,0,0,114,124,0,0,0,114,199, - 0,0,0,114,164,0,0,0,114,205,0,0,0,114,225,0, - 0,0,114,227,0,0,0,114,230,0,0,0,114,228,0,0, - 0,114,233,0,0,0,90,13,95,95,99,108,97,115,115,99, - 101,108,108,95,95,114,2,0,0,0,114,2,0,0,0,41, - 1,114,218,0,0,0,114,4,0,0,0,114,217,0,0,0, - 161,3,0,0,115,24,0,0,0,8,3,4,2,8,6,8, - 4,8,3,16,12,12,5,8,7,12,6,8,4,8,6,8, - 6,114,217,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,3,0,0,0,64,0,0,0,115,46,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, - 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, - 156,1,100,8,100,9,132,2,90,6,100,10,83,0,41,11, - 218,16,83,111,117,114,99,101,70,105,108,101,76,111,97,100, - 101,114,122,62,67,111,110,99,114,101,116,101,32,105,109,112, - 108,101,109,101,110,116,97,116,105,111,110,32,111,102,32,83, - 111,117,114,99,101,76,111,97,100,101,114,32,117,115,105,110, - 103,32,116,104,101,32,102,105,108,101,32,115,121,115,116,101, - 109,46,99,2,0,0,0,0,0,0,0,3,0,0,0,3, - 0,0,0,67,0,0,0,115,22,0,0,0,116,0,124,1, - 131,1,125,2,124,2,106,1,124,2,106,2,100,1,156,2, - 83,0,41,2,122,33,82,101,116,117,114,110,32,116,104,101, - 32,109,101,116,97,100,97,116,97,32,102,111,114,32,116,104, - 101,32,112,97,116,104,46,41,2,114,155,0,0,0,114,212, - 0,0,0,41,3,114,43,0,0,0,218,8,115,116,95,109, - 116,105,109,101,90,7,115,116,95,115,105,122,101,41,3,114, - 108,0,0,0,114,39,0,0,0,114,216,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,202,0, - 0,0,233,3,0,0,115,4,0,0,0,0,2,8,1,122, - 27,83,111,117,114,99,101,70,105,108,101,76,111,97,100,101, - 114,46,112,97,116,104,95,115,116,97,116,115,99,4,0,0, - 0,0,0,0,0,5,0,0,0,5,0,0,0,67,0,0, - 0,115,24,0,0,0,116,0,124,1,131,1,125,4,124,0, - 106,1,124,2,124,3,124,4,100,1,141,3,83,0,41,2, - 78,41,1,218,5,95,109,111,100,101,41,2,114,105,0,0, - 0,114,203,0,0,0,41,5,114,108,0,0,0,114,99,0, - 0,0,114,98,0,0,0,114,21,0,0,0,114,46,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,204,0,0,0,238,3,0,0,115,4,0,0,0,0,2, - 8,1,122,32,83,111,117,114,99,101,70,105,108,101,76,111, - 97,100,101,114,46,95,99,97,99,104,101,95,98,121,116,101, - 99,111,100,101,105,182,1,0,0,41,1,114,236,0,0,0, - 99,3,0,0,0,1,0,0,0,9,0,0,0,11,0,0, - 0,67,0,0,0,115,0,1,0,0,116,0,124,1,131,1, - 92,2,125,4,125,5,103,0,125,6,124,4,114,52,116,1, - 124,4,131,1,115,52,116,0,124,4,131,1,92,2,125,4, - 125,7,124,6,160,2,124,7,161,1,1,0,113,16,116,3, - 124,6,131,1,68,0,93,112,125,7,116,4,124,4,124,7, - 131,2,125,4,122,14,116,5,160,6,124,4,161,1,1,0, - 87,0,110,82,4,0,116,7,107,10,114,112,1,0,1,0, - 1,0,89,0,113,60,89,0,110,60,4,0,116,8,107,10, - 114,170,1,0,125,8,1,0,122,30,116,9,160,10,100,1, - 124,4,124,8,161,3,1,0,87,0,89,0,162,10,1,0, - 100,2,83,0,87,0,53,0,100,2,125,8,126,8,88,0, - 89,0,110,2,88,0,113,60,122,28,116,11,124,1,124,2, - 124,3,131,3,1,0,116,9,160,10,100,3,124,1,161,2, - 1,0,87,0,110,48,4,0,116,8,107,10,114,250,1,0, - 125,8,1,0,122,18,116,9,160,10,100,1,124,1,124,8, - 161,3,1,0,87,0,53,0,100,2,125,8,126,8,88,0, - 89,0,110,2,88,0,100,2,83,0,41,4,122,27,87,114, - 105,116,101,32,98,121,116,101,115,32,100,97,116,97,32,116, - 111,32,97,32,102,105,108,101,46,122,27,99,111,117,108,100, - 32,110,111,116,32,99,114,101,97,116,101,32,123,33,114,125, - 58,32,123,33,114,125,78,122,12,99,114,101,97,116,101,100, - 32,123,33,114,125,41,12,114,42,0,0,0,114,50,0,0, - 0,114,170,0,0,0,114,37,0,0,0,114,33,0,0,0, - 114,1,0,0,0,90,5,109,107,100,105,114,218,15,70,105, - 108,101,69,120,105,115,116,115,69,114,114,111,114,114,44,0, - 0,0,114,122,0,0,0,114,136,0,0,0,114,61,0,0, - 0,41,9,114,108,0,0,0,114,39,0,0,0,114,21,0, - 0,0,114,236,0,0,0,218,6,112,97,114,101,110,116,114, - 88,0,0,0,114,32,0,0,0,114,28,0,0,0,114,206, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,203,0,0,0,243,3,0,0,115,48,0,0,0, - 0,2,12,1,4,2,12,1,12,1,12,2,12,1,10,1, - 2,1,14,1,14,2,8,1,16,3,6,1,2,0,2,255, - 4,2,32,1,2,1,12,1,16,1,16,2,8,1,2,255, - 122,25,83,111,117,114,99,101,70,105,108,101,76,111,97,100, - 101,114,46,115,101,116,95,100,97,116,97,78,41,7,114,113, - 0,0,0,114,112,0,0,0,114,114,0,0,0,114,115,0, - 0,0,114,202,0,0,0,114,204,0,0,0,114,203,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,234,0,0,0,229,3,0,0,115,8, - 0,0,0,8,2,4,2,8,5,8,5,114,234,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,64,0,0,0,115,32,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, - 100,5,132,0,90,5,100,6,83,0,41,7,218,20,83,111, - 117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,100, - 101,114,122,45,76,111,97,100,101,114,32,119,104,105,99,104, - 32,104,97,110,100,108,101,115,32,115,111,117,114,99,101,108, - 101,115,115,32,102,105,108,101,32,105,109,112,111,114,116,115, - 46,99,2,0,0,0,0,0,0,0,5,0,0,0,5,0, - 0,0,67,0,0,0,115,68,0,0,0,124,0,160,0,124, - 1,161,1,125,2,124,0,160,1,124,2,161,1,125,3,124, - 1,124,2,100,1,156,2,125,4,116,2,124,3,124,1,124, - 4,131,3,1,0,116,3,116,4,124,3,131,1,100,2,100, - 0,133,2,25,0,124,1,124,2,100,3,141,3,83,0,41, - 4,78,41,2,114,106,0,0,0,114,39,0,0,0,114,132, - 0,0,0,41,2,114,106,0,0,0,114,98,0,0,0,41, - 5,114,164,0,0,0,114,205,0,0,0,114,139,0,0,0, - 114,151,0,0,0,114,213,0,0,0,41,5,114,108,0,0, - 0,114,127,0,0,0,114,39,0,0,0,114,21,0,0,0, - 114,138,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,193,0,0,0,22,4,0,0,115,22,0, - 0,0,0,1,10,1,10,4,2,1,2,254,6,4,12,1, - 2,1,14,1,2,1,2,253,122,29,83,111,117,114,99,101, - 108,101,115,115,70,105,108,101,76,111,97,100,101,114,46,103, - 101,116,95,99,111,100,101,99,2,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,1,83,0,41,2,122,39,82,101,116,117,114,110,32, - 78,111,110,101,32,97,115,32,116,104,101,114,101,32,105,115, - 32,110,111,32,115,111,117,114,99,101,32,99,111,100,101,46, - 78,114,2,0,0,0,41,2,114,108,0,0,0,114,127,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,207,0,0,0,38,4,0,0,115,2,0,0,0,0, - 2,122,31,83,111,117,114,99,101,108,101,115,115,70,105,108, - 101,76,111,97,100,101,114,46,103,101,116,95,115,111,117,114, - 99,101,78,41,6,114,113,0,0,0,114,112,0,0,0,114, - 114,0,0,0,114,115,0,0,0,114,193,0,0,0,114,207, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,239,0,0,0,18,4,0,0, - 115,6,0,0,0,8,2,4,2,8,16,114,239,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,64,0,0,0,115,92,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, - 100,5,132,0,90,5,100,6,100,7,132,0,90,6,100,8, - 100,9,132,0,90,7,100,10,100,11,132,0,90,8,100,12, - 100,13,132,0,90,9,100,14,100,15,132,0,90,10,100,16, - 100,17,132,0,90,11,101,12,100,18,100,19,132,0,131,1, - 90,13,100,20,83,0,41,21,218,19,69,120,116,101,110,115, - 105,111,110,70,105,108,101,76,111,97,100,101,114,122,93,76, - 111,97,100,101,114,32,102,111,114,32,101,120,116,101,110,115, - 105,111,110,32,109,111,100,117,108,101,115,46,10,10,32,32, - 32,32,84,104,101,32,99,111,110,115,116,114,117,99,116,111, - 114,32,105,115,32,100,101,115,105,103,110,101,100,32,116,111, - 32,119,111,114,107,32,119,105,116,104,32,70,105,108,101,70, - 105,110,100,101,114,46,10,10,32,32,32,32,99,3,0,0, - 0,0,0,0,0,3,0,0,0,2,0,0,0,67,0,0, - 0,115,16,0,0,0,124,1,124,0,95,0,124,2,124,0, - 95,1,100,0,83,0,41,1,78,41,2,114,106,0,0,0, - 114,39,0,0,0,41,3,114,108,0,0,0,114,106,0,0, - 0,114,39,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,191,0,0,0,55,4,0,0,115,4, - 0,0,0,0,1,6,1,122,28,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,105, + 124,4,131,1,131,3,125,10,122,18,124,0,160,26,124,2, + 124,8,124,10,161,3,1,0,87,0,110,22,4,0,116,2, + 107,10,144,2,114,28,1,0,1,0,1,0,89,0,110,2, + 88,0,124,14,83,0,41,16,122,190,67,111,110,99,114,101, + 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,32,111,102,32,73,110,115,112,101,99,116,76,111,97,100, + 101,114,46,103,101,116,95,99,111,100,101,46,10,10,32,32, + 32,32,32,32,32,32,82,101,97,100,105,110,103,32,111,102, + 32,98,121,116,101,99,111,100,101,32,114,101,113,117,105,114, + 101,115,32,112,97,116,104,95,115,116,97,116,115,32,116,111, + 32,98,101,32,105,109,112,108,101,109,101,110,116,101,100,46, + 32,84,111,32,119,114,105,116,101,10,32,32,32,32,32,32, + 32,32,98,121,116,101,99,111,100,101,44,32,115,101,116,95, + 100,97,116,97,32,109,117,115,116,32,97,108,115,111,32,98, + 101,32,105,109,112,108,101,109,101,110,116,101,100,46,10,10, + 32,32,32,32,32,32,32,32,78,70,84,114,155,0,0,0, + 41,2,114,106,0,0,0,114,39,0,0,0,114,132,0,0, + 0,114,34,0,0,0,114,64,0,0,0,114,23,0,0,0, + 90,5,110,101,118,101,114,90,6,97,108,119,97,121,115,218, + 4,115,105,122,101,122,13,123,125,32,109,97,116,99,104,101, + 115,32,123,125,41,3,114,106,0,0,0,114,98,0,0,0, + 114,99,0,0,0,122,19,99,111,100,101,32,111,98,106,101, + 99,116,32,102,114,111,109,32,123,125,41,27,114,164,0,0, + 0,114,89,0,0,0,114,73,0,0,0,114,202,0,0,0, + 114,44,0,0,0,114,14,0,0,0,114,205,0,0,0,114, + 139,0,0,0,218,10,109,101,109,111,114,121,118,105,101,119, + 114,149,0,0,0,90,21,99,104,101,99,107,95,104,97,115, + 104,95,98,97,115,101,100,95,112,121,99,115,114,144,0,0, + 0,218,17,95,82,65,87,95,77,65,71,73,67,95,78,85, + 77,66,69,82,114,145,0,0,0,114,143,0,0,0,114,107, + 0,0,0,114,137,0,0,0,114,122,0,0,0,114,136,0, + 0,0,114,151,0,0,0,114,211,0,0,0,114,6,0,0, + 0,218,19,100,111,110,116,95,119,114,105,116,101,95,98,121, + 116,101,99,111,100,101,114,157,0,0,0,114,156,0,0,0, + 114,18,0,0,0,114,204,0,0,0,41,15,114,108,0,0, + 0,114,127,0,0,0,114,99,0,0,0,114,141,0,0,0, + 114,160,0,0,0,114,144,0,0,0,90,10,104,97,115,104, + 95,98,97,115,101,100,90,12,99,104,101,99,107,95,115,111, + 117,114,99,101,114,98,0,0,0,218,2,115,116,114,21,0, + 0,0,114,138,0,0,0,114,74,0,0,0,90,10,98,121, + 116,101,115,95,100,97,116,97,90,11,99,111,100,101,95,111, + 98,106,101,99,116,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,193,0,0,0,75,3,0,0,115,152,0, + 0,0,0,7,10,1,4,1,4,1,4,1,4,1,4,1, + 2,1,12,1,14,1,12,2,2,1,14,1,14,1,8,2, + 12,1,2,1,14,1,14,1,6,3,2,1,2,254,6,4, + 2,1,12,1,16,1,12,1,6,1,12,1,12,1,2,255, + 2,2,8,254,4,3,10,1,4,1,2,1,2,254,4,4, + 8,1,2,255,6,3,2,1,2,1,2,1,6,1,2,1, + 2,251,8,7,20,1,6,2,8,1,2,255,4,2,6,1, + 2,1,2,254,6,3,10,1,10,1,12,1,12,1,18,1, + 6,255,4,2,6,1,10,1,10,1,14,2,6,1,6,255, + 4,2,2,1,18,1,16,1,6,1,122,21,83,111,117,114, + 99,101,76,111,97,100,101,114,46,103,101,116,95,99,111,100, + 101,78,41,10,114,113,0,0,0,114,112,0,0,0,114,114, + 0,0,0,114,201,0,0,0,114,202,0,0,0,114,204,0, + 0,0,114,203,0,0,0,114,207,0,0,0,114,211,0,0, + 0,114,193,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,200,0,0,0,16, + 3,0,0,115,14,0,0,0,8,2,8,8,8,14,8,10, + 8,7,8,10,14,8,114,200,0,0,0,99,0,0,0,0, + 0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0, + 115,124,0,0,0,101,0,90,1,100,0,90,2,100,1,90, + 3,100,2,100,3,132,0,90,4,100,4,100,5,132,0,90, + 5,100,6,100,7,132,0,90,6,101,7,135,0,102,1,100, + 8,100,9,132,8,131,1,90,8,101,7,100,10,100,11,132, + 0,131,1,90,9,100,12,100,13,132,0,90,10,101,7,100, + 14,100,15,132,0,131,1,90,11,100,16,100,17,132,0,90, + 12,100,18,100,19,132,0,90,13,100,20,100,21,132,0,90, + 14,100,22,100,23,132,0,90,15,135,0,4,0,90,16,83, + 0,41,24,218,10,70,105,108,101,76,111,97,100,101,114,122, + 103,66,97,115,101,32,102,105,108,101,32,108,111,97,100,101, + 114,32,99,108,97,115,115,32,119,104,105,99,104,32,105,109, + 112,108,101,109,101,110,116,115,32,116,104,101,32,108,111,97, + 100,101,114,32,112,114,111,116,111,99,111,108,32,109,101,116, + 104,111,100,115,32,116,104,97,116,10,32,32,32,32,114,101, + 113,117,105,114,101,32,102,105,108,101,32,115,121,115,116,101, + 109,32,117,115,97,103,101,46,99,3,0,0,0,0,0,0, + 0,3,0,0,0,2,0,0,0,67,0,0,0,115,16,0, + 0,0,124,1,124,0,95,0,124,2,124,0,95,1,100,1, + 83,0,41,2,122,75,67,97,99,104,101,32,116,104,101,32, + 109,111,100,117,108,101,32,110,97,109,101,32,97,110,100,32, + 116,104,101,32,112,97,116,104,32,116,111,32,116,104,101,32, + 102,105,108,101,32,102,111,117,110,100,32,98,121,32,116,104, + 101,10,32,32,32,32,32,32,32,32,102,105,110,100,101,114, + 46,78,41,2,114,106,0,0,0,114,39,0,0,0,41,3, + 114,108,0,0,0,114,127,0,0,0,114,39,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,191, + 0,0,0,165,3,0,0,115,4,0,0,0,0,3,6,1, + 122,19,70,105,108,101,76,111,97,100,101,114,46,95,95,105, 110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,0, 0,0,2,0,0,0,67,0,0,0,115,24,0,0,0,124, 0,106,0,124,1,106,0,107,2,111,22,124,0,106,1,124, - 1,106,1,107,2,83,0,41,1,78,41,2,114,218,0,0, - 0,114,119,0,0,0,41,2,114,108,0,0,0,114,219,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,220,0,0,0,59,4,0,0,115,6,0,0,0,0, - 1,12,1,10,255,122,26,69,120,116,101,110,115,105,111,110, - 70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,95, - 95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, - 0,0,67,0,0,0,115,20,0,0,0,116,0,124,0,106, - 1,131,1,116,0,124,0,106,2,131,1,65,0,83,0,41, - 1,78,41,3,114,221,0,0,0,114,106,0,0,0,114,39, - 0,0,0,41,1,114,108,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,222,0,0,0,63,4, - 0,0,115,2,0,0,0,0,1,122,28,69,120,116,101,110, - 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,95, - 95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,0, - 3,0,0,0,5,0,0,0,67,0,0,0,115,36,0,0, - 0,116,0,160,1,116,2,106,3,124,1,161,2,125,2,116, - 0,160,4,100,1,124,1,106,5,124,0,106,6,161,3,1, - 0,124,2,83,0,41,2,122,38,67,114,101,97,116,101,32, - 97,110,32,117,110,105,116,105,97,108,105,122,101,100,32,101, - 120,116,101,110,115,105,111,110,32,109,111,100,117,108,101,122, - 38,101,120,116,101,110,115,105,111,110,32,109,111,100,117,108, - 101,32,123,33,114,125,32,108,111,97,100,101,100,32,102,114, - 111,109,32,123,33,114,125,41,7,114,122,0,0,0,114,194, - 0,0,0,114,149,0,0,0,90,14,99,114,101,97,116,101, - 95,100,121,110,97,109,105,99,114,136,0,0,0,114,106,0, - 0,0,114,39,0,0,0,41,3,114,108,0,0,0,114,171, - 0,0,0,114,196,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,192,0,0,0,66,4,0,0, - 115,18,0,0,0,0,2,4,1,4,0,2,255,4,2,6, - 1,4,0,4,255,4,2,122,33,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,99,114,101, - 97,116,101,95,109,111,100,117,108,101,99,2,0,0,0,0, - 0,0,0,2,0,0,0,5,0,0,0,67,0,0,0,115, - 36,0,0,0,116,0,160,1,116,2,106,3,124,1,161,2, - 1,0,116,0,160,4,100,1,124,0,106,5,124,0,106,6, - 161,3,1,0,100,2,83,0,41,3,122,30,73,110,105,116, - 105,97,108,105,122,101,32,97,110,32,101,120,116,101,110,115, - 105,111,110,32,109,111,100,117,108,101,122,40,101,120,116,101, - 110,115,105,111,110,32,109,111,100,117,108,101,32,123,33,114, - 125,32,101,120,101,99,117,116,101,100,32,102,114,111,109,32, - 123,33,114,125,78,41,7,114,122,0,0,0,114,194,0,0, - 0,114,149,0,0,0,90,12,101,120,101,99,95,100,121,110, - 97,109,105,99,114,136,0,0,0,114,106,0,0,0,114,39, - 0,0,0,41,2,114,108,0,0,0,114,196,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,197, - 0,0,0,74,4,0,0,115,10,0,0,0,0,2,14,1, - 6,1,4,0,4,255,122,31,69,120,116,101,110,115,105,111, - 110,70,105,108,101,76,111,97,100,101,114,46,101,120,101,99, - 95,109,111,100,117,108,101,99,2,0,0,0,0,0,0,0, - 2,0,0,0,4,0,0,0,3,0,0,0,115,36,0,0, - 0,116,0,124,0,106,1,131,1,100,1,25,0,137,0,116, - 2,135,0,102,1,100,2,100,3,132,8,116,3,68,0,131, - 1,131,1,83,0,41,4,122,49,82,101,116,117,114,110,32, - 84,114,117,101,32,105,102,32,116,104,101,32,101,120,116,101, - 110,115,105,111,110,32,109,111,100,117,108,101,32,105,115,32, - 97,32,112,97,99,107,97,103,101,46,114,34,0,0,0,99, - 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 51,0,0,0,115,26,0,0,0,124,0,93,18,125,1,136, - 0,100,0,124,1,23,0,107,2,86,0,1,0,113,2,100, - 1,83,0,41,2,114,191,0,0,0,78,114,2,0,0,0, - 41,2,114,27,0,0,0,218,6,115,117,102,102,105,120,41, - 1,218,9,102,105,108,101,95,110,97,109,101,114,2,0,0, - 0,114,4,0,0,0,218,9,60,103,101,110,101,120,112,114, - 62,83,4,0,0,115,4,0,0,0,4,1,2,255,122,49, + 1,106,1,107,2,83,0,41,1,78,41,2,218,9,95,95, + 99,108,97,115,115,95,95,114,119,0,0,0,41,2,114,108, + 0,0,0,218,5,111,116,104,101,114,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,218,6,95,95,101,113,95, + 95,171,3,0,0,115,6,0,0,0,0,1,12,1,10,255, + 122,17,70,105,108,101,76,111,97,100,101,114,46,95,95,101, + 113,95,95,99,1,0,0,0,0,0,0,0,1,0,0,0, + 3,0,0,0,67,0,0,0,115,20,0,0,0,116,0,124, + 0,106,1,131,1,116,0,124,0,106,2,131,1,65,0,83, + 0,41,1,78,41,3,218,4,104,97,115,104,114,106,0,0, + 0,114,39,0,0,0,41,1,114,108,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,8,95,95, + 104,97,115,104,95,95,175,3,0,0,115,2,0,0,0,0, + 1,122,19,70,105,108,101,76,111,97,100,101,114,46,95,95, + 104,97,115,104,95,95,99,2,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,3,0,0,0,115,16,0,0,0, + 116,0,116,1,124,0,131,2,160,2,124,1,161,1,83,0, + 41,1,122,100,76,111,97,100,32,97,32,109,111,100,117,108, + 101,32,102,114,111,109,32,97,32,102,105,108,101,46,10,10, + 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, + 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, + 100,46,32,32,85,115,101,32,101,120,101,99,95,109,111,100, + 117,108,101,40,41,32,105,110,115,116,101,97,100,46,10,10, + 32,32,32,32,32,32,32,32,41,3,218,5,115,117,112,101, + 114,114,217,0,0,0,114,199,0,0,0,41,2,114,108,0, + 0,0,114,127,0,0,0,41,1,114,218,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,199,0,0,0,178,3,0, + 0,115,2,0,0,0,0,10,122,22,70,105,108,101,76,111, + 97,100,101,114,46,108,111,97,100,95,109,111,100,117,108,101, + 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,6,0,0,0,124,0,106,0,83,0, + 41,1,122,58,82,101,116,117,114,110,32,116,104,101,32,112, + 97,116,104,32,116,111,32,116,104,101,32,115,111,117,114,99, + 101,32,102,105,108,101,32,97,115,32,102,111,117,110,100,32, + 98,121,32,116,104,101,32,102,105,110,100,101,114,46,41,1, + 114,39,0,0,0,41,2,114,108,0,0,0,114,127,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,164,0,0,0,190,3,0,0,115,2,0,0,0,0,3, + 122,23,70,105,108,101,76,111,97,100,101,114,46,103,101,116, + 95,102,105,108,101,110,97,109,101,99,2,0,0,0,0,0, + 0,0,3,0,0,0,10,0,0,0,67,0,0,0,115,44, + 0,0,0,116,0,160,1,124,1,100,1,161,2,143,22,125, + 2,124,2,160,2,161,0,87,0,2,0,53,0,81,0,82, + 0,163,0,83,0,81,0,82,0,88,0,100,2,83,0,41, + 3,122,39,82,101,116,117,114,110,32,116,104,101,32,100,97, + 116,97,32,102,114,111,109,32,112,97,116,104,32,97,115,32, + 114,97,119,32,98,121,116,101,115,46,218,1,114,78,41,3, + 114,56,0,0,0,114,57,0,0,0,90,4,114,101,97,100, + 41,3,114,108,0,0,0,114,39,0,0,0,114,60,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,205,0,0,0,195,3,0,0,115,4,0,0,0,0,2, + 14,1,122,19,70,105,108,101,76,111,97,100,101,114,46,103, + 101,116,95,100,97,116,97,99,2,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,67,0,0,0,115,18,0,0, + 0,124,0,160,0,124,1,161,1,114,14,124,0,83,0,100, + 0,83,0,41,1,78,41,1,114,166,0,0,0,41,2,114, + 108,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,218,19,103,101,116,95,114,101, + 115,111,117,114,99,101,95,114,101,97,100,101,114,202,3,0, + 0,115,6,0,0,0,0,2,10,1,4,1,122,30,70,105, + 108,101,76,111,97,100,101,114,46,103,101,116,95,114,101,115, + 111,117,114,99,101,95,114,101,97,100,101,114,99,2,0,0, + 0,0,0,0,0,3,0,0,0,4,0,0,0,67,0,0, + 0,115,32,0,0,0,116,0,116,1,124,0,106,2,131,1, + 100,1,25,0,124,1,131,2,125,2,116,3,160,4,124,2, + 100,2,161,2,83,0,41,3,78,114,64,0,0,0,114,224, + 0,0,0,41,5,114,33,0,0,0,114,42,0,0,0,114, + 39,0,0,0,114,56,0,0,0,114,57,0,0,0,41,3, + 114,108,0,0,0,218,8,114,101,115,111,117,114,99,101,114, + 39,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,13,111,112,101,110,95,114,101,115,111,117,114, + 99,101,208,3,0,0,115,4,0,0,0,0,1,20,1,122, + 24,70,105,108,101,76,111,97,100,101,114,46,111,112,101,110, + 95,114,101,115,111,117,114,99,101,99,2,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38, + 0,0,0,124,0,160,0,124,1,161,1,115,14,116,1,130, + 1,116,2,116,3,124,0,106,4,131,1,100,1,25,0,124, + 1,131,2,125,2,124,2,83,0,41,2,78,114,64,0,0, + 0,41,5,218,11,105,115,95,114,101,115,111,117,114,99,101, + 218,17,70,105,108,101,78,111,116,70,111,117,110,100,69,114, + 114,111,114,114,33,0,0,0,114,42,0,0,0,114,39,0, + 0,0,41,3,114,108,0,0,0,114,226,0,0,0,114,39, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,218,13,114,101,115,111,117,114,99,101,95,112,97,116, + 104,212,3,0,0,115,8,0,0,0,0,1,10,1,4,1, + 20,1,122,24,70,105,108,101,76,111,97,100,101,114,46,114, + 101,115,111,117,114,99,101,95,112,97,116,104,99,2,0,0, + 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, + 0,115,40,0,0,0,116,0,124,1,107,6,114,12,100,1, + 83,0,116,1,116,2,124,0,106,3,131,1,100,2,25,0, + 124,1,131,2,125,2,116,4,124,2,131,1,83,0,41,3, + 78,70,114,64,0,0,0,41,5,114,30,0,0,0,114,33, + 0,0,0,114,42,0,0,0,114,39,0,0,0,114,48,0, + 0,0,41,3,114,108,0,0,0,114,106,0,0,0,114,39, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,228,0,0,0,218,3,0,0,115,8,0,0,0, + 0,1,8,1,4,1,20,1,122,22,70,105,108,101,76,111, + 97,100,101,114,46,105,115,95,114,101,115,111,117,114,99,101, + 99,1,0,0,0,0,0,0,0,1,0,0,0,5,0,0, + 0,67,0,0,0,115,24,0,0,0,116,0,116,1,160,2, + 116,3,124,0,106,4,131,1,100,1,25,0,161,1,131,1, + 83,0,41,2,78,114,64,0,0,0,41,5,218,4,105,116, + 101,114,114,1,0,0,0,218,7,108,105,115,116,100,105,114, + 114,42,0,0,0,114,39,0,0,0,41,1,114,108,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 218,8,99,111,110,116,101,110,116,115,224,3,0,0,115,2, + 0,0,0,0,1,122,19,70,105,108,101,76,111,97,100,101, + 114,46,99,111,110,116,101,110,116,115,41,17,114,113,0,0, + 0,114,112,0,0,0,114,114,0,0,0,114,115,0,0,0, + 114,191,0,0,0,114,220,0,0,0,114,222,0,0,0,114, + 124,0,0,0,114,199,0,0,0,114,164,0,0,0,114,205, + 0,0,0,114,225,0,0,0,114,227,0,0,0,114,230,0, + 0,0,114,228,0,0,0,114,233,0,0,0,90,13,95,95, + 99,108,97,115,115,99,101,108,108,95,95,114,2,0,0,0, + 114,2,0,0,0,41,1,114,218,0,0,0,114,4,0,0, + 0,114,217,0,0,0,160,3,0,0,115,24,0,0,0,8, + 3,4,2,8,6,8,4,8,3,16,12,12,5,8,7,12, + 6,8,4,8,6,8,6,114,217,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, + 0,115,46,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, + 90,5,100,6,100,7,156,1,100,8,100,9,132,2,90,6, + 100,10,83,0,41,11,218,16,83,111,117,114,99,101,70,105, + 108,101,76,111,97,100,101,114,122,62,67,111,110,99,114,101, + 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,32,111,102,32,83,111,117,114,99,101,76,111,97,100,101, + 114,32,117,115,105,110,103,32,116,104,101,32,102,105,108,101, + 32,115,121,115,116,101,109,46,99,2,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,22,0, + 0,0,116,0,124,1,131,1,125,2,124,2,106,1,124,2, + 106,2,100,1,156,2,83,0,41,2,122,33,82,101,116,117, + 114,110,32,116,104,101,32,109,101,116,97,100,97,116,97,32, + 102,111,114,32,116,104,101,32,112,97,116,104,46,41,2,114, + 155,0,0,0,114,212,0,0,0,41,3,114,43,0,0,0, + 218,8,115,116,95,109,116,105,109,101,90,7,115,116,95,115, + 105,122,101,41,3,114,108,0,0,0,114,39,0,0,0,114, + 216,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,202,0,0,0,232,3,0,0,115,4,0,0, + 0,0,2,8,1,122,27,83,111,117,114,99,101,70,105,108, + 101,76,111,97,100,101,114,46,112,97,116,104,95,115,116,97, + 116,115,99,4,0,0,0,0,0,0,0,5,0,0,0,5, + 0,0,0,67,0,0,0,115,24,0,0,0,116,0,124,1, + 131,1,125,4,124,0,106,1,124,2,124,3,124,4,100,1, + 141,3,83,0,41,2,78,41,1,218,5,95,109,111,100,101, + 41,2,114,105,0,0,0,114,203,0,0,0,41,5,114,108, + 0,0,0,114,99,0,0,0,114,98,0,0,0,114,21,0, + 0,0,114,46,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,204,0,0,0,237,3,0,0,115, + 4,0,0,0,0,2,8,1,122,32,83,111,117,114,99,101, + 70,105,108,101,76,111,97,100,101,114,46,95,99,97,99,104, + 101,95,98,121,116,101,99,111,100,101,105,182,1,0,0,41, + 1,114,236,0,0,0,99,3,0,0,0,1,0,0,0,9, + 0,0,0,11,0,0,0,67,0,0,0,115,0,1,0,0, + 116,0,124,1,131,1,92,2,125,4,125,5,103,0,125,6, + 124,4,114,52,116,1,124,4,131,1,115,52,116,0,124,4, + 131,1,92,2,125,4,125,7,124,6,160,2,124,7,161,1, + 1,0,113,16,116,3,124,6,131,1,68,0,93,112,125,7, + 116,4,124,4,124,7,131,2,125,4,122,14,116,5,160,6, + 124,4,161,1,1,0,87,0,110,82,4,0,116,7,107,10, + 114,112,1,0,1,0,1,0,89,0,113,60,89,0,110,60, + 4,0,116,8,107,10,114,170,1,0,125,8,1,0,122,30, + 116,9,160,10,100,1,124,4,124,8,161,3,1,0,87,0, + 89,0,162,10,1,0,100,2,83,0,87,0,53,0,100,2, + 125,8,126,8,88,0,89,0,110,2,88,0,113,60,122,28, + 116,11,124,1,124,2,124,3,131,3,1,0,116,9,160,10, + 100,3,124,1,161,2,1,0,87,0,110,48,4,0,116,8, + 107,10,114,250,1,0,125,8,1,0,122,18,116,9,160,10, + 100,1,124,1,124,8,161,3,1,0,87,0,53,0,100,2, + 125,8,126,8,88,0,89,0,110,2,88,0,100,2,83,0, + 41,4,122,27,87,114,105,116,101,32,98,121,116,101,115,32, + 100,97,116,97,32,116,111,32,97,32,102,105,108,101,46,122, + 27,99,111,117,108,100,32,110,111,116,32,99,114,101,97,116, + 101,32,123,33,114,125,58,32,123,33,114,125,78,122,12,99, + 114,101,97,116,101,100,32,123,33,114,125,41,12,114,42,0, + 0,0,114,50,0,0,0,114,170,0,0,0,114,37,0,0, + 0,114,33,0,0,0,114,1,0,0,0,90,5,109,107,100, + 105,114,218,15,70,105,108,101,69,120,105,115,116,115,69,114, + 114,111,114,114,44,0,0,0,114,122,0,0,0,114,136,0, + 0,0,114,61,0,0,0,41,9,114,108,0,0,0,114,39, + 0,0,0,114,21,0,0,0,114,236,0,0,0,218,6,112, + 97,114,101,110,116,114,88,0,0,0,114,32,0,0,0,114, + 28,0,0,0,114,206,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,203,0,0,0,242,3,0, + 0,115,48,0,0,0,0,2,12,1,4,2,12,1,12,1, + 12,2,12,1,10,1,2,1,14,1,14,2,8,1,16,3, + 6,1,2,0,2,255,4,2,32,1,2,1,12,1,16,1, + 16,2,8,1,2,255,122,25,83,111,117,114,99,101,70,105, + 108,101,76,111,97,100,101,114,46,115,101,116,95,100,97,116, + 97,78,41,7,114,113,0,0,0,114,112,0,0,0,114,114, + 0,0,0,114,115,0,0,0,114,202,0,0,0,114,204,0, + 0,0,114,203,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,234,0,0,0, + 228,3,0,0,115,8,0,0,0,8,2,4,2,8,5,8, + 5,114,234,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,64,0,0,0,115,32,0,0,0, + 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, + 132,0,90,4,100,4,100,5,132,0,90,5,100,6,83,0, + 41,7,218,20,83,111,117,114,99,101,108,101,115,115,70,105, + 108,101,76,111,97,100,101,114,122,45,76,111,97,100,101,114, + 32,119,104,105,99,104,32,104,97,110,100,108,101,115,32,115, + 111,117,114,99,101,108,101,115,115,32,102,105,108,101,32,105, + 109,112,111,114,116,115,46,99,2,0,0,0,0,0,0,0, + 5,0,0,0,5,0,0,0,67,0,0,0,115,68,0,0, + 0,124,0,160,0,124,1,161,1,125,2,124,0,160,1,124, + 2,161,1,125,3,124,1,124,2,100,1,156,2,125,4,116, + 2,124,3,124,1,124,4,131,3,1,0,116,3,116,4,124, + 3,131,1,100,2,100,0,133,2,25,0,124,1,124,2,100, + 3,141,3,83,0,41,4,78,41,2,114,106,0,0,0,114, + 39,0,0,0,114,132,0,0,0,41,2,114,106,0,0,0, + 114,98,0,0,0,41,5,114,164,0,0,0,114,205,0,0, + 0,114,139,0,0,0,114,151,0,0,0,114,213,0,0,0, + 41,5,114,108,0,0,0,114,127,0,0,0,114,39,0,0, + 0,114,21,0,0,0,114,138,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,193,0,0,0,21, + 4,0,0,115,22,0,0,0,0,1,10,1,10,4,2,1, + 2,254,6,4,12,1,2,1,14,1,2,1,2,253,122,29, + 83,111,117,114,99,101,108,101,115,115,70,105,108,101,76,111, + 97,100,101,114,46,103,101,116,95,99,111,100,101,99,2,0, + 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,115,4,0,0,0,100,1,83,0,41,2,122,39,82, + 101,116,117,114,110,32,78,111,110,101,32,97,115,32,116,104, + 101,114,101,32,105,115,32,110,111,32,115,111,117,114,99,101, + 32,99,111,100,101,46,78,114,2,0,0,0,41,2,114,108, + 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,207,0,0,0,37,4,0,0, + 115,2,0,0,0,0,2,122,31,83,111,117,114,99,101,108, + 101,115,115,70,105,108,101,76,111,97,100,101,114,46,103,101, + 116,95,115,111,117,114,99,101,78,41,6,114,113,0,0,0, + 114,112,0,0,0,114,114,0,0,0,114,115,0,0,0,114, + 193,0,0,0,114,207,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,239,0, + 0,0,17,4,0,0,115,6,0,0,0,8,2,4,2,8, + 16,114,239,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,64,0,0,0,115,92,0,0,0, + 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, + 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, + 132,0,90,6,100,8,100,9,132,0,90,7,100,10,100,11, + 132,0,90,8,100,12,100,13,132,0,90,9,100,14,100,15, + 132,0,90,10,100,16,100,17,132,0,90,11,101,12,100,18, + 100,19,132,0,131,1,90,13,100,20,83,0,41,21,218,19, 69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97, - 100,101,114,46,105,115,95,112,97,99,107,97,103,101,46,60, - 108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114, - 62,41,4,114,42,0,0,0,114,39,0,0,0,218,3,97, - 110,121,218,18,69,88,84,69,78,83,73,79,78,95,83,85, - 70,70,73,88,69,83,41,2,114,108,0,0,0,114,127,0, - 0,0,114,2,0,0,0,41,1,114,242,0,0,0,114,4, - 0,0,0,114,166,0,0,0,80,4,0,0,115,8,0,0, - 0,0,2,14,1,12,1,2,255,122,30,69,120,116,101,110, - 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,105, - 115,95,112,97,99,107,97,103,101,99,2,0,0,0,0,0, - 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, - 0,0,0,100,1,83,0,41,2,122,63,82,101,116,117,114, - 110,32,78,111,110,101,32,97,115,32,97,110,32,101,120,116, - 101,110,115,105,111,110,32,109,111,100,117,108,101,32,99,97, - 110,110,111,116,32,99,114,101,97,116,101,32,97,32,99,111, - 100,101,32,111,98,106,101,99,116,46,78,114,2,0,0,0, - 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,193,0,0,0, - 86,4,0,0,115,2,0,0,0,0,2,122,28,69,120,116, + 100,101,114,122,93,76,111,97,100,101,114,32,102,111,114,32, + 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, + 115,46,10,10,32,32,32,32,84,104,101,32,99,111,110,115, + 116,114,117,99,116,111,114,32,105,115,32,100,101,115,105,103, + 110,101,100,32,116,111,32,119,111,114,107,32,119,105,116,104, + 32,70,105,108,101,70,105,110,100,101,114,46,10,10,32,32, + 32,32,99,3,0,0,0,0,0,0,0,3,0,0,0,2, + 0,0,0,67,0,0,0,115,16,0,0,0,124,1,124,0, + 95,0,124,2,124,0,95,1,100,0,83,0,41,1,78,41, + 2,114,106,0,0,0,114,39,0,0,0,41,3,114,108,0, + 0,0,114,106,0,0,0,114,39,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,191,0,0,0, + 54,4,0,0,115,4,0,0,0,0,1,6,1,122,28,69, + 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, + 101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,0, + 0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0, + 115,24,0,0,0,124,0,106,0,124,1,106,0,107,2,111, + 22,124,0,106,1,124,1,106,1,107,2,83,0,41,1,78, + 41,2,114,218,0,0,0,114,119,0,0,0,41,2,114,108, + 0,0,0,114,219,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,220,0,0,0,58,4,0,0, + 115,6,0,0,0,0,1,12,1,10,255,122,26,69,120,116, 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, - 46,103,101,116,95,99,111,100,101,99,2,0,0,0,0,0, - 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, - 0,0,0,100,1,83,0,41,2,122,53,82,101,116,117,114, - 110,32,78,111,110,101,32,97,115,32,101,120,116,101,110,115, - 105,111,110,32,109,111,100,117,108,101,115,32,104,97,118,101, - 32,110,111,32,115,111,117,114,99,101,32,99,111,100,101,46, + 46,95,95,101,113,95,95,99,1,0,0,0,0,0,0,0, + 1,0,0,0,3,0,0,0,67,0,0,0,115,20,0,0, + 0,116,0,124,0,106,1,131,1,116,0,124,0,106,2,131, + 1,65,0,83,0,41,1,78,41,3,114,221,0,0,0,114, + 106,0,0,0,114,39,0,0,0,41,1,114,108,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, + 222,0,0,0,62,4,0,0,115,2,0,0,0,0,1,122, + 28,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, + 97,100,101,114,46,95,95,104,97,115,104,95,95,99,2,0, + 0,0,0,0,0,0,3,0,0,0,5,0,0,0,67,0, + 0,0,115,36,0,0,0,116,0,160,1,116,2,106,3,124, + 1,161,2,125,2,116,0,160,4,100,1,124,1,106,5,124, + 0,106,6,161,3,1,0,124,2,83,0,41,2,122,38,67, + 114,101,97,116,101,32,97,110,32,117,110,105,116,105,97,108, + 105,122,101,100,32,101,120,116,101,110,115,105,111,110,32,109, + 111,100,117,108,101,122,38,101,120,116,101,110,115,105,111,110, + 32,109,111,100,117,108,101,32,123,33,114,125,32,108,111,97, + 100,101,100,32,102,114,111,109,32,123,33,114,125,41,7,114, + 122,0,0,0,114,194,0,0,0,114,149,0,0,0,90,14, + 99,114,101,97,116,101,95,100,121,110,97,109,105,99,114,136, + 0,0,0,114,106,0,0,0,114,39,0,0,0,41,3,114, + 108,0,0,0,114,171,0,0,0,114,196,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,192,0, + 0,0,65,4,0,0,115,18,0,0,0,0,2,4,1,4, + 0,2,255,4,2,6,1,4,0,4,255,4,2,122,33,69, + 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, + 101,114,46,99,114,101,97,116,101,95,109,111,100,117,108,101, + 99,2,0,0,0,0,0,0,0,2,0,0,0,5,0,0, + 0,67,0,0,0,115,36,0,0,0,116,0,160,1,116,2, + 106,3,124,1,161,2,1,0,116,0,160,4,100,1,124,0, + 106,5,124,0,106,6,161,3,1,0,100,2,83,0,41,3, + 122,30,73,110,105,116,105,97,108,105,122,101,32,97,110,32, + 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, + 122,40,101,120,116,101,110,115,105,111,110,32,109,111,100,117, + 108,101,32,123,33,114,125,32,101,120,101,99,117,116,101,100, + 32,102,114,111,109,32,123,33,114,125,78,41,7,114,122,0, + 0,0,114,194,0,0,0,114,149,0,0,0,90,12,101,120, + 101,99,95,100,121,110,97,109,105,99,114,136,0,0,0,114, + 106,0,0,0,114,39,0,0,0,41,2,114,108,0,0,0, + 114,196,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,197,0,0,0,73,4,0,0,115,10,0, + 0,0,0,2,14,1,6,1,4,0,4,255,122,31,69,120, + 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, + 114,46,101,120,101,99,95,109,111,100,117,108,101,99,2,0, + 0,0,0,0,0,0,2,0,0,0,4,0,0,0,3,0, + 0,0,115,36,0,0,0,116,0,124,0,106,1,131,1,100, + 1,25,0,137,0,116,2,135,0,102,1,100,2,100,3,132, + 8,116,3,68,0,131,1,131,1,83,0,41,4,122,49,82, + 101,116,117,114,110,32,84,114,117,101,32,105,102,32,116,104, + 101,32,101,120,116,101,110,115,105,111,110,32,109,111,100,117, + 108,101,32,105,115,32,97,32,112,97,99,107,97,103,101,46, + 114,34,0,0,0,99,1,0,0,0,0,0,0,0,2,0, + 0,0,4,0,0,0,51,0,0,0,115,26,0,0,0,124, + 0,93,18,125,1,136,0,100,0,124,1,23,0,107,2,86, + 0,1,0,113,2,100,1,83,0,41,2,114,191,0,0,0, + 78,114,2,0,0,0,41,2,114,27,0,0,0,218,6,115, + 117,102,102,105,120,41,1,218,9,102,105,108,101,95,110,97, + 109,101,114,2,0,0,0,114,4,0,0,0,218,9,60,103, + 101,110,101,120,112,114,62,82,4,0,0,115,4,0,0,0, + 4,1,2,255,122,49,69,120,116,101,110,115,105,111,110,70, + 105,108,101,76,111,97,100,101,114,46,105,115,95,112,97,99, + 107,97,103,101,46,60,108,111,99,97,108,115,62,46,60,103, + 101,110,101,120,112,114,62,41,4,114,42,0,0,0,114,39, + 0,0,0,218,3,97,110,121,218,18,69,88,84,69,78,83, + 73,79,78,95,83,85,70,70,73,88,69,83,41,2,114,108, + 0,0,0,114,127,0,0,0,114,2,0,0,0,41,1,114, + 242,0,0,0,114,4,0,0,0,114,166,0,0,0,79,4, + 0,0,115,8,0,0,0,0,2,14,1,12,1,2,255,122, + 30,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, + 97,100,101,114,46,105,115,95,112,97,99,107,97,103,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, + 63,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, + 97,110,32,101,120,116,101,110,115,105,111,110,32,109,111,100, + 117,108,101,32,99,97,110,110,111,116,32,99,114,101,97,116, + 101,32,97,32,99,111,100,101,32,111,98,106,101,99,116,46, 78,114,2,0,0,0,41,2,114,108,0,0,0,114,127,0, 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,207,0,0,0,90,4,0,0,115,2,0,0,0,0, - 2,122,30,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, - 0,0,67,0,0,0,115,6,0,0,0,124,0,106,0,83, - 0,41,1,122,58,82,101,116,117,114,110,32,116,104,101,32, - 112,97,116,104,32,116,111,32,116,104,101,32,115,111,117,114, - 99,101,32,102,105,108,101,32,97,115,32,102,111,117,110,100, - 32,98,121,32,116,104,101,32,102,105,110,100,101,114,46,41, - 1,114,39,0,0,0,41,2,114,108,0,0,0,114,127,0, + 0,114,193,0,0,0,85,4,0,0,115,2,0,0,0,0, + 2,122,28,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, + 53,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, + 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, + 115,32,104,97,118,101,32,110,111,32,115,111,117,114,99,101, + 32,99,111,100,101,46,78,114,2,0,0,0,41,2,114,108, + 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,207,0,0,0,89,4,0,0, + 115,2,0,0,0,0,2,122,30,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,103,101,116, + 95,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,6,0,0, + 0,124,0,106,0,83,0,41,1,122,58,82,101,116,117,114, + 110,32,116,104,101,32,112,97,116,104,32,116,111,32,116,104, + 101,32,115,111,117,114,99,101,32,102,105,108,101,32,97,115, + 32,102,111,117,110,100,32,98,121,32,116,104,101,32,102,105, + 110,100,101,114,46,41,1,114,39,0,0,0,41,2,114,108, + 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,164,0,0,0,93,4,0,0, + 115,2,0,0,0,0,3,122,32,69,120,116,101,110,115,105, + 111,110,70,105,108,101,76,111,97,100,101,114,46,103,101,116, + 95,102,105,108,101,110,97,109,101,78,41,14,114,113,0,0, + 0,114,112,0,0,0,114,114,0,0,0,114,115,0,0,0, + 114,191,0,0,0,114,220,0,0,0,114,222,0,0,0,114, + 192,0,0,0,114,197,0,0,0,114,166,0,0,0,114,193, + 0,0,0,114,207,0,0,0,114,124,0,0,0,114,164,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,240,0,0,0,46,4,0,0,115, + 20,0,0,0,8,6,4,2,8,4,8,4,8,3,8,8, + 8,6,8,6,8,4,8,4,114,240,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, + 0,0,115,96,0,0,0,101,0,90,1,100,0,90,2,100, + 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, + 0,90,5,100,6,100,7,132,0,90,6,100,8,100,9,132, + 0,90,7,100,10,100,11,132,0,90,8,100,12,100,13,132, + 0,90,9,100,14,100,15,132,0,90,10,100,16,100,17,132, + 0,90,11,100,18,100,19,132,0,90,12,100,20,100,21,132, + 0,90,13,100,22,83,0,41,23,218,14,95,78,97,109,101, + 115,112,97,99,101,80,97,116,104,97,38,1,0,0,82,101, + 112,114,101,115,101,110,116,115,32,97,32,110,97,109,101,115, + 112,97,99,101,32,112,97,99,107,97,103,101,39,115,32,112, + 97,116,104,46,32,32,73,116,32,117,115,101,115,32,116,104, + 101,32,109,111,100,117,108,101,32,110,97,109,101,10,32,32, + 32,32,116,111,32,102,105,110,100,32,105,116,115,32,112,97, + 114,101,110,116,32,109,111,100,117,108,101,44,32,97,110,100, + 32,102,114,111,109,32,116,104,101,114,101,32,105,116,32,108, + 111,111,107,115,32,117,112,32,116,104,101,32,112,97,114,101, + 110,116,39,115,10,32,32,32,32,95,95,112,97,116,104,95, + 95,46,32,32,87,104,101,110,32,116,104,105,115,32,99,104, + 97,110,103,101,115,44,32,116,104,101,32,109,111,100,117,108, + 101,39,115,32,111,119,110,32,112,97,116,104,32,105,115,32, + 114,101,99,111,109,112,117,116,101,100,44,10,32,32,32,32, + 117,115,105,110,103,32,112,97,116,104,95,102,105,110,100,101, + 114,46,32,32,70,111,114,32,116,111,112,45,108,101,118,101, + 108,32,109,111,100,117,108,101,115,44,32,116,104,101,32,112, + 97,114,101,110,116,32,109,111,100,117,108,101,39,115,32,112, + 97,116,104,10,32,32,32,32,105,115,32,115,121,115,46,112, + 97,116,104,46,99,4,0,0,0,0,0,0,0,4,0,0, + 0,3,0,0,0,67,0,0,0,115,36,0,0,0,124,1, + 124,0,95,0,124,2,124,0,95,1,116,2,124,0,160,3, + 161,0,131,1,124,0,95,4,124,3,124,0,95,5,100,0, + 83,0,41,1,78,41,6,218,5,95,110,97,109,101,218,5, + 95,112,97,116,104,114,102,0,0,0,218,16,95,103,101,116, + 95,112,97,114,101,110,116,95,112,97,116,104,218,17,95,108, + 97,115,116,95,112,97,114,101,110,116,95,112,97,116,104,218, + 12,95,112,97,116,104,95,102,105,110,100,101,114,41,4,114, + 108,0,0,0,114,106,0,0,0,114,39,0,0,0,218,11, + 112,97,116,104,95,102,105,110,100,101,114,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,191,0,0,0,106, + 4,0,0,115,8,0,0,0,0,1,6,1,6,1,14,1, + 122,23,95,78,97,109,101,115,112,97,99,101,80,97,116,104, + 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, + 0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,38, + 0,0,0,124,0,106,0,160,1,100,1,161,1,92,3,125, + 1,125,2,125,3,124,2,100,2,107,2,114,30,100,3,83, + 0,124,1,100,4,102,2,83,0,41,5,122,62,82,101,116, + 117,114,110,115,32,97,32,116,117,112,108,101,32,111,102,32, + 40,112,97,114,101,110,116,45,109,111,100,117,108,101,45,110, + 97,109,101,44,32,112,97,114,101,110,116,45,112,97,116,104, + 45,97,116,116,114,45,110,97,109,101,41,114,63,0,0,0, + 114,35,0,0,0,41,2,114,6,0,0,0,114,39,0,0, + 0,90,8,95,95,112,97,116,104,95,95,41,2,114,247,0, + 0,0,114,36,0,0,0,41,4,114,108,0,0,0,114,238, + 0,0,0,218,3,100,111,116,90,2,109,101,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,218,23,95,102,105, + 110,100,95,112,97,114,101,110,116,95,112,97,116,104,95,110, + 97,109,101,115,112,4,0,0,115,8,0,0,0,0,2,18, + 1,8,2,4,3,122,38,95,78,97,109,101,115,112,97,99, + 101,80,97,116,104,46,95,102,105,110,100,95,112,97,114,101, + 110,116,95,112,97,116,104,95,110,97,109,101,115,99,1,0, + 0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,0, + 0,0,115,28,0,0,0,124,0,160,0,161,0,92,2,125, + 1,125,2,116,1,116,2,106,3,124,1,25,0,124,2,131, + 2,83,0,41,1,78,41,4,114,254,0,0,0,114,118,0, + 0,0,114,6,0,0,0,218,7,109,111,100,117,108,101,115, + 41,3,114,108,0,0,0,90,18,112,97,114,101,110,116,95, + 109,111,100,117,108,101,95,110,97,109,101,90,14,112,97,116, + 104,95,97,116,116,114,95,110,97,109,101,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,249,0,0,0,122, + 4,0,0,115,4,0,0,0,0,1,12,1,122,31,95,78, + 97,109,101,115,112,97,99,101,80,97,116,104,46,95,103,101, + 116,95,112,97,114,101,110,116,95,112,97,116,104,99,1,0, + 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, + 0,0,115,80,0,0,0,116,0,124,0,160,1,161,0,131, + 1,125,1,124,1,124,0,106,2,107,3,114,74,124,0,160, + 3,124,0,106,4,124,1,161,2,125,2,124,2,100,0,107, + 9,114,68,124,2,106,5,100,0,107,8,114,68,124,2,106, + 6,114,68,124,2,106,6,124,0,95,7,124,1,124,0,95, + 2,124,0,106,7,83,0,41,1,78,41,8,114,102,0,0, + 0,114,249,0,0,0,114,250,0,0,0,114,251,0,0,0, + 114,247,0,0,0,114,128,0,0,0,114,163,0,0,0,114, + 248,0,0,0,41,3,114,108,0,0,0,90,11,112,97,114, + 101,110,116,95,112,97,116,104,114,171,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,12,95,114, + 101,99,97,108,99,117,108,97,116,101,126,4,0,0,115,16, + 0,0,0,0,2,12,1,10,1,14,3,18,1,6,1,8, + 1,6,1,122,27,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,46,95,114,101,99,97,108,99,117,108,97,116,101, + 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, + 0,67,0,0,0,115,12,0,0,0,116,0,124,0,160,1, + 161,0,131,1,83,0,41,1,78,41,2,114,231,0,0,0, + 114,0,1,0,0,41,1,114,108,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,218,8,95,95,105, + 116,101,114,95,95,139,4,0,0,115,2,0,0,0,0,1, + 122,23,95,78,97,109,101,115,112,97,99,101,80,97,116,104, + 46,95,95,105,116,101,114,95,95,99,3,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,14, + 0,0,0,124,2,124,0,106,0,124,1,60,0,100,0,83, + 0,41,1,78,41,1,114,248,0,0,0,41,3,114,108,0, + 0,0,218,5,105,110,100,101,120,114,39,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,11,95, + 95,115,101,116,105,116,101,109,95,95,142,4,0,0,115,2, + 0,0,0,0,1,122,26,95,78,97,109,101,115,112,97,99, + 101,80,97,116,104,46,95,95,115,101,116,105,116,101,109,95, + 95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, + 0,0,67,0,0,0,115,12,0,0,0,116,0,124,0,160, + 1,161,0,131,1,83,0,41,1,78,41,2,114,18,0,0, + 0,114,0,1,0,0,41,1,114,108,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,7,95,95, + 108,101,110,95,95,145,4,0,0,115,2,0,0,0,0,1, + 122,22,95,78,97,109,101,115,112,97,99,101,80,97,116,104, + 46,95,95,108,101,110,95,95,99,1,0,0,0,0,0,0, + 0,1,0,0,0,3,0,0,0,67,0,0,0,115,12,0, + 0,0,100,1,160,0,124,0,106,1,161,1,83,0,41,2, + 78,122,20,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,40,123,33,114,125,41,41,2,114,54,0,0,0,114,248, + 0,0,0,41,1,114,108,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,218,8,95,95,114,101,112, + 114,95,95,148,4,0,0,115,2,0,0,0,0,1,122,23, + 95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,95, + 95,114,101,112,114,95,95,99,2,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0, + 0,124,1,124,0,160,0,161,0,107,6,83,0,41,1,78, + 41,1,114,0,1,0,0,41,2,114,108,0,0,0,218,4, + 105,116,101,109,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,12,95,95,99,111,110,116,97,105,110,115,95, + 95,151,4,0,0,115,2,0,0,0,0,1,122,27,95,78, + 97,109,101,115,112,97,99,101,80,97,116,104,46,95,95,99, + 111,110,116,97,105,110,115,95,95,99,2,0,0,0,0,0, + 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,16, + 0,0,0,124,0,106,0,160,1,124,1,161,1,1,0,100, + 0,83,0,41,1,78,41,2,114,248,0,0,0,114,170,0, + 0,0,41,2,114,108,0,0,0,114,6,1,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,170,0, + 0,0,154,4,0,0,115,2,0,0,0,0,1,122,21,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,46,97,112, + 112,101,110,100,78,41,14,114,113,0,0,0,114,112,0,0, + 0,114,114,0,0,0,114,115,0,0,0,114,191,0,0,0, + 114,254,0,0,0,114,249,0,0,0,114,0,1,0,0,114, + 1,1,0,0,114,3,1,0,0,114,4,1,0,0,114,5, + 1,0,0,114,7,1,0,0,114,170,0,0,0,114,2,0, 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,164,0,0,0,94,4,0,0,115,2,0,0,0,0, - 3,122,32,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110, - 97,109,101,78,41,14,114,113,0,0,0,114,112,0,0,0, - 114,114,0,0,0,114,115,0,0,0,114,191,0,0,0,114, - 220,0,0,0,114,222,0,0,0,114,192,0,0,0,114,197, - 0,0,0,114,166,0,0,0,114,193,0,0,0,114,207,0, - 0,0,114,124,0,0,0,114,164,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,240,0,0,0,47,4,0,0,115,20,0,0,0,8,6, - 4,2,8,4,8,4,8,3,8,8,8,6,8,6,8,4, - 8,4,114,240,0,0,0,99,0,0,0,0,0,0,0,0, - 0,0,0,0,2,0,0,0,64,0,0,0,115,96,0,0, - 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, - 3,132,0,90,4,100,4,100,5,132,0,90,5,100,6,100, - 7,132,0,90,6,100,8,100,9,132,0,90,7,100,10,100, - 11,132,0,90,8,100,12,100,13,132,0,90,9,100,14,100, - 15,132,0,90,10,100,16,100,17,132,0,90,11,100,18,100, - 19,132,0,90,12,100,20,100,21,132,0,90,13,100,22,83, - 0,41,23,218,14,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,97,38,1,0,0,82,101,112,114,101,115,101,110, - 116,115,32,97,32,110,97,109,101,115,112,97,99,101,32,112, - 97,99,107,97,103,101,39,115,32,112,97,116,104,46,32,32, - 73,116,32,117,115,101,115,32,116,104,101,32,109,111,100,117, - 108,101,32,110,97,109,101,10,32,32,32,32,116,111,32,102, - 105,110,100,32,105,116,115,32,112,97,114,101,110,116,32,109, - 111,100,117,108,101,44,32,97,110,100,32,102,114,111,109,32, - 116,104,101,114,101,32,105,116,32,108,111,111,107,115,32,117, - 112,32,116,104,101,32,112,97,114,101,110,116,39,115,10,32, - 32,32,32,95,95,112,97,116,104,95,95,46,32,32,87,104, - 101,110,32,116,104,105,115,32,99,104,97,110,103,101,115,44, - 32,116,104,101,32,109,111,100,117,108,101,39,115,32,111,119, - 110,32,112,97,116,104,32,105,115,32,114,101,99,111,109,112, - 117,116,101,100,44,10,32,32,32,32,117,115,105,110,103,32, - 112,97,116,104,95,102,105,110,100,101,114,46,32,32,70,111, - 114,32,116,111,112,45,108,101,118,101,108,32,109,111,100,117, - 108,101,115,44,32,116,104,101,32,112,97,114,101,110,116,32, - 109,111,100,117,108,101,39,115,32,112,97,116,104,10,32,32, - 32,32,105,115,32,115,121,115,46,112,97,116,104,46,99,4, - 0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,67, - 0,0,0,115,36,0,0,0,124,1,124,0,95,0,124,2, - 124,0,95,1,116,2,124,0,160,3,161,0,131,1,124,0, - 95,4,124,3,124,0,95,5,100,0,83,0,41,1,78,41, - 6,218,5,95,110,97,109,101,218,5,95,112,97,116,104,114, - 102,0,0,0,218,16,95,103,101,116,95,112,97,114,101,110, - 116,95,112,97,116,104,218,17,95,108,97,115,116,95,112,97, - 114,101,110,116,95,112,97,116,104,218,12,95,112,97,116,104, - 95,102,105,110,100,101,114,41,4,114,108,0,0,0,114,106, - 0,0,0,114,39,0,0,0,218,11,112,97,116,104,95,102, - 105,110,100,101,114,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,191,0,0,0,107,4,0,0,115,8,0, - 0,0,0,1,6,1,6,1,14,1,122,23,95,78,97,109, - 101,115,112,97,99,101,80,97,116,104,46,95,95,105,110,105, - 116,95,95,99,1,0,0,0,0,0,0,0,4,0,0,0, - 3,0,0,0,67,0,0,0,115,38,0,0,0,124,0,106, - 0,160,1,100,1,161,1,92,3,125,1,125,2,125,3,124, - 2,100,2,107,2,114,30,100,3,83,0,124,1,100,4,102, - 2,83,0,41,5,122,62,82,101,116,117,114,110,115,32,97, - 32,116,117,112,108,101,32,111,102,32,40,112,97,114,101,110, - 116,45,109,111,100,117,108,101,45,110,97,109,101,44,32,112, - 97,114,101,110,116,45,112,97,116,104,45,97,116,116,114,45, - 110,97,109,101,41,114,63,0,0,0,114,35,0,0,0,41, - 2,114,6,0,0,0,114,39,0,0,0,90,8,95,95,112, - 97,116,104,95,95,41,2,114,247,0,0,0,114,36,0,0, - 0,41,4,114,108,0,0,0,114,238,0,0,0,218,3,100, - 111,116,90,2,109,101,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,23,95,102,105,110,100,95,112,97,114, - 101,110,116,95,112,97,116,104,95,110,97,109,101,115,113,4, - 0,0,115,8,0,0,0,0,2,18,1,8,2,4,3,122, - 38,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, - 95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,116, - 104,95,110,97,109,101,115,99,1,0,0,0,0,0,0,0, - 3,0,0,0,3,0,0,0,67,0,0,0,115,28,0,0, - 0,124,0,160,0,161,0,92,2,125,1,125,2,116,1,116, - 2,106,3,124,1,25,0,124,2,131,2,83,0,41,1,78, - 41,4,114,254,0,0,0,114,118,0,0,0,114,6,0,0, - 0,218,7,109,111,100,117,108,101,115,41,3,114,108,0,0, - 0,90,18,112,97,114,101,110,116,95,109,111,100,117,108,101, - 95,110,97,109,101,90,14,112,97,116,104,95,97,116,116,114, - 95,110,97,109,101,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,249,0,0,0,123,4,0,0,115,4,0, - 0,0,0,1,12,1,122,31,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,46,95,103,101,116,95,112,97,114,101, - 110,116,95,112,97,116,104,99,1,0,0,0,0,0,0,0, - 3,0,0,0,4,0,0,0,67,0,0,0,115,80,0,0, - 0,116,0,124,0,160,1,161,0,131,1,125,1,124,1,124, - 0,106,2,107,3,114,74,124,0,160,3,124,0,106,4,124, - 1,161,2,125,2,124,2,100,0,107,9,114,68,124,2,106, - 5,100,0,107,8,114,68,124,2,106,6,114,68,124,2,106, - 6,124,0,95,7,124,1,124,0,95,2,124,0,106,7,83, - 0,41,1,78,41,8,114,102,0,0,0,114,249,0,0,0, - 114,250,0,0,0,114,251,0,0,0,114,247,0,0,0,114, - 128,0,0,0,114,163,0,0,0,114,248,0,0,0,41,3, - 114,108,0,0,0,90,11,112,97,114,101,110,116,95,112,97, - 116,104,114,171,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,12,95,114,101,99,97,108,99,117, - 108,97,116,101,127,4,0,0,115,16,0,0,0,0,2,12, - 1,10,1,14,3,18,1,6,1,8,1,6,1,122,27,95, - 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,114, - 101,99,97,108,99,117,108,97,116,101,99,1,0,0,0,0, - 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, - 12,0,0,0,116,0,124,0,160,1,161,0,131,1,83,0, - 41,1,78,41,2,114,231,0,0,0,114,0,1,0,0,41, - 1,114,108,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,8,95,95,105,116,101,114,95,95,140, - 4,0,0,115,2,0,0,0,0,1,122,23,95,78,97,109, - 101,115,112,97,99,101,80,97,116,104,46,95,95,105,116,101, - 114,95,95,99,3,0,0,0,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,14,0,0,0,124,2,124, - 0,106,0,124,1,60,0,100,0,83,0,41,1,78,41,1, - 114,248,0,0,0,41,3,114,108,0,0,0,218,5,105,110, - 100,101,120,114,39,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,218,11,95,95,115,101,116,105,116, - 101,109,95,95,143,4,0,0,115,2,0,0,0,0,1,122, - 26,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, - 95,95,115,101,116,105,116,101,109,95,95,99,1,0,0,0, - 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, - 115,12,0,0,0,116,0,124,0,160,1,161,0,131,1,83, - 0,41,1,78,41,2,114,18,0,0,0,114,0,1,0,0, - 41,1,114,108,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,218,7,95,95,108,101,110,95,95,146, - 4,0,0,115,2,0,0,0,0,1,122,22,95,78,97,109, - 101,115,112,97,99,101,80,97,116,104,46,95,95,108,101,110, - 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,115,12,0,0,0,100,1,160,0, - 124,0,106,1,161,1,83,0,41,2,78,122,20,95,78,97, - 109,101,115,112,97,99,101,80,97,116,104,40,123,33,114,125, - 41,41,2,114,54,0,0,0,114,248,0,0,0,41,1,114, - 108,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,8,95,95,114,101,112,114,95,95,149,4,0, - 0,115,2,0,0,0,0,1,122,23,95,78,97,109,101,115, - 112,97,99,101,80,97,116,104,46,95,95,114,101,112,114,95, - 95,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,67,0,0,0,115,12,0,0,0,124,1,124,0,160, - 0,161,0,107,6,83,0,41,1,78,41,1,114,0,1,0, - 0,41,2,114,108,0,0,0,218,4,105,116,101,109,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,12,95, - 95,99,111,110,116,97,105,110,115,95,95,152,4,0,0,115, - 2,0,0,0,0,1,122,27,95,78,97,109,101,115,112,97, - 99,101,80,97,116,104,46,95,95,99,111,110,116,97,105,110, - 115,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,67,0,0,0,115,16,0,0,0,124,0,106, - 0,160,1,124,1,161,1,1,0,100,0,83,0,41,1,78, - 41,2,114,248,0,0,0,114,170,0,0,0,41,2,114,108, - 0,0,0,114,6,1,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,170,0,0,0,155,4,0,0, - 115,2,0,0,0,0,1,122,21,95,78,97,109,101,115,112, - 97,99,101,80,97,116,104,46,97,112,112,101,110,100,78,41, - 14,114,113,0,0,0,114,112,0,0,0,114,114,0,0,0, - 114,115,0,0,0,114,191,0,0,0,114,254,0,0,0,114, - 249,0,0,0,114,0,1,0,0,114,1,1,0,0,114,3, - 1,0,0,114,4,1,0,0,114,5,1,0,0,114,7,1, - 0,0,114,170,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,246,0,0,0, - 100,4,0,0,115,22,0,0,0,8,5,4,2,8,6,8, - 10,8,4,8,13,8,3,8,3,8,3,8,3,8,3,114, - 246,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,64,0,0,0,115,80,0,0,0,101,0, - 90,1,100,0,90,2,100,1,100,2,132,0,90,3,101,4, - 100,3,100,4,132,0,131,1,90,5,100,5,100,6,132,0, - 90,6,100,7,100,8,132,0,90,7,100,9,100,10,132,0, - 90,8,100,11,100,12,132,0,90,9,100,13,100,14,132,0, - 90,10,100,15,100,16,132,0,90,11,100,17,83,0,41,18, - 218,16,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,99,4,0,0,0,0,0,0,0,4,0,0,0,4, - 0,0,0,67,0,0,0,115,18,0,0,0,116,0,124,1, - 124,2,124,3,131,3,124,0,95,1,100,0,83,0,41,1, - 78,41,2,114,246,0,0,0,114,248,0,0,0,41,4,114, - 108,0,0,0,114,106,0,0,0,114,39,0,0,0,114,252, + 0,114,246,0,0,0,99,4,0,0,115,22,0,0,0,8, + 5,4,2,8,6,8,10,8,4,8,13,8,3,8,3,8, + 3,8,3,8,3,114,246,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, + 80,0,0,0,101,0,90,1,100,0,90,2,100,1,100,2, + 132,0,90,3,101,4,100,3,100,4,132,0,131,1,90,5, + 100,5,100,6,132,0,90,6,100,7,100,8,132,0,90,7, + 100,9,100,10,132,0,90,8,100,11,100,12,132,0,90,9, + 100,13,100,14,132,0,90,10,100,15,100,16,132,0,90,11, + 100,17,83,0,41,18,218,16,95,78,97,109,101,115,112,97, + 99,101,76,111,97,100,101,114,99,4,0,0,0,0,0,0, + 0,4,0,0,0,4,0,0,0,67,0,0,0,115,18,0, + 0,0,116,0,124,1,124,2,124,3,131,3,124,0,95,1, + 100,0,83,0,41,1,78,41,2,114,246,0,0,0,114,248, + 0,0,0,41,4,114,108,0,0,0,114,106,0,0,0,114, + 39,0,0,0,114,252,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,191,0,0,0,160,4,0, + 0,115,2,0,0,0,0,1,122,25,95,78,97,109,101,115, + 112,97,99,101,76,111,97,100,101,114,46,95,95,105,110,105, + 116,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,67,0,0,0,115,12,0,0,0,100,1,160, + 0,124,1,106,1,161,1,83,0,41,2,122,115,82,101,116, + 117,114,110,32,114,101,112,114,32,102,111,114,32,116,104,101, + 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32, + 32,32,84,104,101,32,109,101,116,104,111,100,32,105,115,32, + 100,101,112,114,101,99,97,116,101,100,46,32,32,84,104,101, + 32,105,109,112,111,114,116,32,109,97,99,104,105,110,101,114, + 121,32,100,111,101,115,32,116,104,101,32,106,111,98,32,105, + 116,115,101,108,102,46,10,10,32,32,32,32,32,32,32,32, + 122,25,60,109,111,100,117,108,101,32,123,33,114,125,32,40, + 110,97,109,101,115,112,97,99,101,41,62,41,2,114,54,0, + 0,0,114,113,0,0,0,41,2,114,177,0,0,0,114,196, 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,191,0,0,0,161,4,0,0,115,2,0,0,0, - 0,1,122,25,95,78,97,109,101,115,112,97,99,101,76,111, - 97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,12,0,0,0,100,1,160,0,124,1,106,1,161, - 1,83,0,41,2,122,115,82,101,116,117,114,110,32,114,101, - 112,114,32,102,111,114,32,116,104,101,32,109,111,100,117,108, - 101,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, - 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, - 97,116,101,100,46,32,32,84,104,101,32,105,109,112,111,114, - 116,32,109,97,99,104,105,110,101,114,121,32,100,111,101,115, - 32,116,104,101,32,106,111,98,32,105,116,115,101,108,102,46, - 10,10,32,32,32,32,32,32,32,32,122,25,60,109,111,100, - 117,108,101,32,123,33,114,125,32,40,110,97,109,101,115,112, - 97,99,101,41,62,41,2,114,54,0,0,0,114,113,0,0, - 0,41,2,114,177,0,0,0,114,196,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,11,109,111, - 100,117,108,101,95,114,101,112,114,164,4,0,0,115,2,0, - 0,0,0,7,122,28,95,78,97,109,101,115,112,97,99,101, - 76,111,97,100,101,114,46,109,111,100,117,108,101,95,114,101, - 112,114,99,2,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, - 41,2,78,84,114,2,0,0,0,41,2,114,108,0,0,0, - 114,127,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,166,0,0,0,173,4,0,0,115,2,0, - 0,0,0,1,122,27,95,78,97,109,101,115,112,97,99,101, - 76,111,97,100,101,114,46,105,115,95,112,97,99,107,97,103, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, - 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, - 2,78,114,35,0,0,0,114,2,0,0,0,41,2,114,108, - 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,207,0,0,0,176,4,0,0, - 115,2,0,0,0,0,1,122,27,95,78,97,109,101,115,112, - 97,99,101,76,111,97,100,101,114,46,103,101,116,95,115,111, - 117,114,99,101,99,2,0,0,0,0,0,0,0,2,0,0, - 0,6,0,0,0,67,0,0,0,115,16,0,0,0,116,0, - 100,1,100,2,100,3,100,4,100,5,141,4,83,0,41,6, - 78,114,35,0,0,0,122,8,60,115,116,114,105,110,103,62, - 114,195,0,0,0,84,41,1,114,209,0,0,0,41,1,114, - 210,0,0,0,41,2,114,108,0,0,0,114,127,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 193,0,0,0,179,4,0,0,115,2,0,0,0,0,1,122, - 25,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, - 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 4,0,0,0,100,1,83,0,41,2,122,42,85,115,101,32, - 100,101,102,97,117,108,116,32,115,101,109,97,110,116,105,99, - 115,32,102,111,114,32,109,111,100,117,108,101,32,99,114,101, - 97,116,105,111,110,46,78,114,2,0,0,0,41,2,114,108, - 0,0,0,114,171,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,192,0,0,0,182,4,0,0, - 115,2,0,0,0,0,1,122,30,95,78,97,109,101,115,112, - 97,99,101,76,111,97,100,101,114,46,99,114,101,97,116,101, - 95,109,111,100,117,108,101,99,2,0,0,0,0,0,0,0, + 0,0,218,11,109,111,100,117,108,101,95,114,101,112,114,163, + 4,0,0,115,2,0,0,0,0,7,122,28,95,78,97,109, + 101,115,112,97,99,101,76,111,97,100,101,114,46,109,111,100, + 117,108,101,95,114,101,112,114,99,2,0,0,0,0,0,0, + 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, + 0,0,100,1,83,0,41,2,78,84,114,2,0,0,0,41, + 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,166,0,0,0,172, + 4,0,0,115,2,0,0,0,0,1,122,27,95,78,97,109, + 101,115,112,97,99,101,76,111,97,100,101,114,46,105,115,95, + 112,97,99,107,97,103,101,99,2,0,0,0,0,0,0,0, 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,0,83,0,41,1,78,114,2,0,0,0,41,2,114, - 108,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,197,0,0,0,185,4,0, - 0,115,2,0,0,0,0,1,122,28,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,46,101,120,101,99,95, - 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,67,0,0,0,115,26,0,0,0, - 116,0,160,1,100,1,124,0,106,2,161,2,1,0,116,0, - 160,3,124,0,124,1,161,2,83,0,41,2,122,98,76,111, - 97,100,32,97,32,110,97,109,101,115,112,97,99,101,32,109, - 111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,32, - 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, - 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, - 101,120,101,99,95,109,111,100,117,108,101,40,41,32,105,110, - 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, - 122,38,110,97,109,101,115,112,97,99,101,32,109,111,100,117, - 108,101,32,108,111,97,100,101,100,32,119,105,116,104,32,112, - 97,116,104,32,123,33,114,125,41,4,114,122,0,0,0,114, - 136,0,0,0,114,248,0,0,0,114,198,0,0,0,41,2, - 114,108,0,0,0,114,127,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,199,0,0,0,188,4, - 0,0,115,8,0,0,0,0,7,6,1,4,255,4,2,122, - 28,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, - 114,46,108,111,97,100,95,109,111,100,117,108,101,78,41,12, - 114,113,0,0,0,114,112,0,0,0,114,114,0,0,0,114, - 191,0,0,0,114,189,0,0,0,114,9,1,0,0,114,166, - 0,0,0,114,207,0,0,0,114,193,0,0,0,114,192,0, - 0,0,114,197,0,0,0,114,199,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,8,1,0,0,160,4,0,0,115,16,0,0,0,8,1, - 8,3,12,9,8,3,8,3,8,3,8,3,8,3,114,8, - 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, - 4,0,0,0,64,0,0,0,115,114,0,0,0,101,0,90, - 1,100,0,90,2,100,1,90,3,101,4,100,2,100,3,132, - 0,131,1,90,5,101,4,100,4,100,5,132,0,131,1,90, - 6,101,4,100,6,100,7,132,0,131,1,90,7,101,4,100, - 8,100,9,132,0,131,1,90,8,101,4,100,10,102,1,100, - 11,100,12,132,1,131,1,90,9,101,4,100,10,100,10,102, - 2,100,13,100,14,132,1,131,1,90,10,101,4,100,10,102, - 1,100,15,100,16,132,1,131,1,90,11,100,10,83,0,41, - 17,218,10,80,97,116,104,70,105,110,100,101,114,122,62,77, - 101,116,97,32,112,97,116,104,32,102,105,110,100,101,114,32, - 102,111,114,32,115,121,115,46,112,97,116,104,32,97,110,100, - 32,112,97,99,107,97,103,101,32,95,95,112,97,116,104,95, - 95,32,97,116,116,114,105,98,117,116,101,115,46,99,1,0, - 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, - 0,0,115,64,0,0,0,116,0,116,1,106,2,160,3,161, - 0,131,1,68,0,93,44,92,2,125,1,125,2,124,2,100, - 1,107,8,114,40,116,1,106,2,124,1,61,0,113,14,116, - 4,124,2,100,2,131,2,114,14,124,2,160,5,161,0,1, - 0,113,14,100,1,83,0,41,3,122,125,67,97,108,108,32, - 116,104,101,32,105,110,118,97,108,105,100,97,116,101,95,99, - 97,99,104,101,115,40,41,32,109,101,116,104,111,100,32,111, - 110,32,97,108,108,32,112,97,116,104,32,101,110,116,114,121, - 32,102,105,110,100,101,114,115,10,32,32,32,32,32,32,32, - 32,115,116,111,114,101,100,32,105,110,32,115,121,115,46,112, + 0,100,1,83,0,41,2,78,114,35,0,0,0,114,2,0, + 0,0,41,2,114,108,0,0,0,114,127,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,207,0, + 0,0,175,4,0,0,115,2,0,0,0,0,1,122,27,95, + 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46, + 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,6,0,0,0,67,0,0,0,115, + 16,0,0,0,116,0,100,1,100,2,100,3,100,4,100,5, + 141,4,83,0,41,6,78,114,35,0,0,0,122,8,60,115, + 116,114,105,110,103,62,114,195,0,0,0,84,41,1,114,209, + 0,0,0,41,1,114,210,0,0,0,41,2,114,108,0,0, + 0,114,127,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,193,0,0,0,178,4,0,0,115,2, + 0,0,0,0,1,122,25,95,78,97,109,101,115,112,97,99, + 101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101, + 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, + 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, + 122,42,85,115,101,32,100,101,102,97,117,108,116,32,115,101, + 109,97,110,116,105,99,115,32,102,111,114,32,109,111,100,117, + 108,101,32,99,114,101,97,116,105,111,110,46,78,114,2,0, + 0,0,41,2,114,108,0,0,0,114,171,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,192,0, + 0,0,181,4,0,0,115,2,0,0,0,0,1,122,30,95, + 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46, + 99,114,101,97,116,101,95,109,111,100,117,108,101,99,2,0, + 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,115,4,0,0,0,100,0,83,0,41,1,78,114,2, + 0,0,0,41,2,114,108,0,0,0,114,196,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,197, + 0,0,0,184,4,0,0,115,2,0,0,0,0,1,122,28, + 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, + 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, + 0,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, + 0,115,26,0,0,0,116,0,160,1,100,1,124,0,106,2, + 161,2,1,0,116,0,160,3,124,0,124,1,161,2,83,0, + 41,2,122,98,76,111,97,100,32,97,32,110,97,109,101,115, + 112,97,99,101,32,109,111,100,117,108,101,46,10,10,32,32, + 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, + 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, + 32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,108, + 101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, + 32,32,32,32,32,32,122,38,110,97,109,101,115,112,97,99, + 101,32,109,111,100,117,108,101,32,108,111,97,100,101,100,32, + 119,105,116,104,32,112,97,116,104,32,123,33,114,125,41,4, + 114,122,0,0,0,114,136,0,0,0,114,248,0,0,0,114, + 198,0,0,0,41,2,114,108,0,0,0,114,127,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, + 199,0,0,0,187,4,0,0,115,8,0,0,0,0,7,6, + 1,4,255,4,2,122,28,95,78,97,109,101,115,112,97,99, + 101,76,111,97,100,101,114,46,108,111,97,100,95,109,111,100, + 117,108,101,78,41,12,114,113,0,0,0,114,112,0,0,0, + 114,114,0,0,0,114,191,0,0,0,114,189,0,0,0,114, + 9,1,0,0,114,166,0,0,0,114,207,0,0,0,114,193, + 0,0,0,114,192,0,0,0,114,197,0,0,0,114,199,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,8,1,0,0,159,4,0,0,115, + 16,0,0,0,8,1,8,3,12,9,8,3,8,3,8,3, + 8,3,8,3,114,8,1,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,4,0,0,0,64,0,0,0,115,114, + 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,101, + 4,100,2,100,3,132,0,131,1,90,5,101,4,100,4,100, + 5,132,0,131,1,90,6,101,4,100,6,100,7,132,0,131, + 1,90,7,101,4,100,8,100,9,132,0,131,1,90,8,101, + 4,100,10,102,1,100,11,100,12,132,1,131,1,90,9,101, + 4,100,10,100,10,102,2,100,13,100,14,132,1,131,1,90, + 10,101,4,100,10,102,1,100,15,100,16,132,1,131,1,90, + 11,100,10,83,0,41,17,218,10,80,97,116,104,70,105,110, + 100,101,114,122,62,77,101,116,97,32,112,97,116,104,32,102, + 105,110,100,101,114,32,102,111,114,32,115,121,115,46,112,97, + 116,104,32,97,110,100,32,112,97,99,107,97,103,101,32,95, + 95,112,97,116,104,95,95,32,97,116,116,114,105,98,117,116, + 101,115,46,99,1,0,0,0,0,0,0,0,3,0,0,0, + 4,0,0,0,67,0,0,0,115,64,0,0,0,116,0,116, + 1,106,2,160,3,161,0,131,1,68,0,93,44,92,2,125, + 1,125,2,124,2,100,1,107,8,114,40,116,1,106,2,124, + 1,61,0,113,14,116,4,124,2,100,2,131,2,114,14,124, + 2,160,5,161,0,1,0,113,14,100,1,83,0,41,3,122, + 125,67,97,108,108,32,116,104,101,32,105,110,118,97,108,105, + 100,97,116,101,95,99,97,99,104,101,115,40,41,32,109,101, + 116,104,111,100,32,111,110,32,97,108,108,32,112,97,116,104, + 32,101,110,116,114,121,32,102,105,110,100,101,114,115,10,32, + 32,32,32,32,32,32,32,115,116,111,114,101,100,32,105,110, + 32,115,121,115,46,112,97,116,104,95,105,109,112,111,114,116, + 101,114,95,99,97,99,104,101,115,32,40,119,104,101,114,101, + 32,105,109,112,108,101,109,101,110,116,101,100,41,46,78,218, + 17,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104, + 101,115,41,6,218,4,108,105,115,116,114,6,0,0,0,218, + 19,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, + 97,99,104,101,218,5,105,116,101,109,115,114,116,0,0,0, + 114,11,1,0,0,41,3,114,177,0,0,0,114,106,0,0, + 0,218,6,102,105,110,100,101,114,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,11,1,0,0,205,4,0, + 0,115,10,0,0,0,0,4,22,1,8,1,10,1,10,1, + 122,28,80,97,116,104,70,105,110,100,101,114,46,105,110,118, + 97,108,105,100,97,116,101,95,99,97,99,104,101,115,99,2, + 0,0,0,0,0,0,0,3,0,0,0,9,0,0,0,67, + 0,0,0,115,84,0,0,0,116,0,106,1,100,1,107,9, + 114,28,116,0,106,1,115,28,116,2,160,3,100,2,116,4, + 161,2,1,0,116,0,106,1,68,0,93,44,125,2,122,14, + 124,2,124,1,131,1,87,0,2,0,1,0,83,0,4,0, + 116,5,107,10,114,76,1,0,1,0,1,0,89,0,113,34, + 89,0,113,34,88,0,113,34,100,1,83,0,41,3,122,46, + 83,101,97,114,99,104,32,115,121,115,46,112,97,116,104,95, + 104,111,111,107,115,32,102,111,114,32,97,32,102,105,110,100, + 101,114,32,102,111,114,32,39,112,97,116,104,39,46,78,122, + 23,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, + 105,115,32,101,109,112,116,121,41,6,114,6,0,0,0,218, + 10,112,97,116,104,95,104,111,111,107,115,114,66,0,0,0, + 114,67,0,0,0,114,126,0,0,0,114,107,0,0,0,41, + 3,114,177,0,0,0,114,39,0,0,0,90,4,104,111,111, + 107,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 218,11,95,112,97,116,104,95,104,111,111,107,115,215,4,0, + 0,115,16,0,0,0,0,3,16,1,12,1,10,1,2,1, + 14,1,14,1,12,2,122,22,80,97,116,104,70,105,110,100, + 101,114,46,95,112,97,116,104,95,104,111,111,107,115,99,2, + 0,0,0,0,0,0,0,3,0,0,0,8,0,0,0,67, + 0,0,0,115,104,0,0,0,124,1,100,1,107,2,114,44, + 122,12,116,0,160,1,161,0,125,1,87,0,110,22,4,0, + 116,2,107,10,114,42,1,0,1,0,1,0,89,0,100,2, + 83,0,88,0,122,14,116,3,106,4,124,1,25,0,125,2, + 87,0,110,40,4,0,116,5,107,10,114,98,1,0,1,0, + 1,0,124,0,160,6,124,1,161,1,125,2,124,2,116,3, + 106,4,124,1,60,0,89,0,110,2,88,0,124,2,83,0, + 41,3,122,210,71,101,116,32,116,104,101,32,102,105,110,100, + 101,114,32,102,111,114,32,116,104,101,32,112,97,116,104,32, + 101,110,116,114,121,32,102,114,111,109,32,115,121,115,46,112, 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, - 104,101,115,32,40,119,104,101,114,101,32,105,109,112,108,101, - 109,101,110,116,101,100,41,46,78,218,17,105,110,118,97,108, - 105,100,97,116,101,95,99,97,99,104,101,115,41,6,218,4, - 108,105,115,116,114,6,0,0,0,218,19,112,97,116,104,95, - 105,109,112,111,114,116,101,114,95,99,97,99,104,101,218,5, - 105,116,101,109,115,114,116,0,0,0,114,11,1,0,0,41, - 3,114,177,0,0,0,114,106,0,0,0,218,6,102,105,110, - 100,101,114,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,11,1,0,0,206,4,0,0,115,10,0,0,0, - 0,4,22,1,8,1,10,1,10,1,122,28,80,97,116,104, - 70,105,110,100,101,114,46,105,110,118,97,108,105,100,97,116, - 101,95,99,97,99,104,101,115,99,2,0,0,0,0,0,0, - 0,3,0,0,0,9,0,0,0,67,0,0,0,115,84,0, - 0,0,116,0,106,1,100,1,107,9,114,28,116,0,106,1, - 115,28,116,2,160,3,100,2,116,4,161,2,1,0,116,0, - 106,1,68,0,93,44,125,2,122,14,124,2,124,1,131,1, - 87,0,2,0,1,0,83,0,4,0,116,5,107,10,114,76, - 1,0,1,0,1,0,89,0,113,34,89,0,113,34,88,0, - 113,34,100,1,83,0,41,3,122,46,83,101,97,114,99,104, - 32,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, - 102,111,114,32,97,32,102,105,110,100,101,114,32,102,111,114, - 32,39,112,97,116,104,39,46,78,122,23,115,121,115,46,112, - 97,116,104,95,104,111,111,107,115,32,105,115,32,101,109,112, - 116,121,41,6,114,6,0,0,0,218,10,112,97,116,104,95, - 104,111,111,107,115,114,66,0,0,0,114,67,0,0,0,114, - 126,0,0,0,114,107,0,0,0,41,3,114,177,0,0,0, - 114,39,0,0,0,90,4,104,111,111,107,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,218,11,95,112,97,116, - 104,95,104,111,111,107,115,216,4,0,0,115,16,0,0,0, - 0,3,16,1,12,1,10,1,2,1,14,1,14,1,12,2, - 122,22,80,97,116,104,70,105,110,100,101,114,46,95,112,97, - 116,104,95,104,111,111,107,115,99,2,0,0,0,0,0,0, - 0,3,0,0,0,8,0,0,0,67,0,0,0,115,104,0, - 0,0,124,1,100,1,107,2,114,44,122,12,116,0,160,1, - 161,0,125,1,87,0,110,22,4,0,116,2,107,10,114,42, - 1,0,1,0,1,0,89,0,100,2,83,0,88,0,122,14, - 116,3,106,4,124,1,25,0,125,2,87,0,110,40,4,0, - 116,5,107,10,114,98,1,0,1,0,1,0,124,0,160,6, - 124,1,161,1,125,2,124,2,116,3,106,4,124,1,60,0, - 89,0,110,2,88,0,124,2,83,0,41,3,122,210,71,101, - 116,32,116,104,101,32,102,105,110,100,101,114,32,102,111,114, - 32,116,104,101,32,112,97,116,104,32,101,110,116,114,121,32, - 102,114,111,109,32,115,121,115,46,112,97,116,104,95,105,109, - 112,111,114,116,101,114,95,99,97,99,104,101,46,10,10,32, - 32,32,32,32,32,32,32,73,102,32,116,104,101,32,112,97, - 116,104,32,101,110,116,114,121,32,105,115,32,110,111,116,32, - 105,110,32,116,104,101,32,99,97,99,104,101,44,32,102,105, - 110,100,32,116,104,101,32,97,112,112,114,111,112,114,105,97, - 116,101,32,102,105,110,100,101,114,10,32,32,32,32,32,32, - 32,32,97,110,100,32,99,97,99,104,101,32,105,116,46,32, - 73,102,32,110,111,32,102,105,110,100,101,114,32,105,115,32, - 97,118,97,105,108,97,98,108,101,44,32,115,116,111,114,101, - 32,78,111,110,101,46,10,10,32,32,32,32,32,32,32,32, - 114,35,0,0,0,78,41,7,114,1,0,0,0,114,49,0, - 0,0,114,229,0,0,0,114,6,0,0,0,114,13,1,0, - 0,218,8,75,101,121,69,114,114,111,114,114,17,1,0,0, - 41,3,114,177,0,0,0,114,39,0,0,0,114,15,1,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,20,95,112,97,116,104,95,105,109,112,111,114,116,101,114, - 95,99,97,99,104,101,229,4,0,0,115,22,0,0,0,0, - 8,8,1,2,1,12,1,14,3,8,1,2,1,14,1,14, - 1,10,1,16,1,122,31,80,97,116,104,70,105,110,100,101, - 114,46,95,112,97,116,104,95,105,109,112,111,114,116,101,114, - 95,99,97,99,104,101,99,3,0,0,0,0,0,0,0,6, - 0,0,0,4,0,0,0,67,0,0,0,115,82,0,0,0, - 116,0,124,2,100,1,131,2,114,26,124,2,160,1,124,1, - 161,1,92,2,125,3,125,4,110,14,124,2,160,2,124,1, - 161,1,125,3,103,0,125,4,124,3,100,0,107,9,114,60, - 116,3,160,4,124,1,124,3,161,2,83,0,116,3,160,5, - 124,1,100,0,161,2,125,5,124,4,124,5,95,6,124,5, - 83,0,41,2,78,114,125,0,0,0,41,7,114,116,0,0, - 0,114,125,0,0,0,114,188,0,0,0,114,122,0,0,0, - 114,185,0,0,0,114,167,0,0,0,114,163,0,0,0,41, - 6,114,177,0,0,0,114,127,0,0,0,114,15,1,0,0, - 114,128,0,0,0,114,129,0,0,0,114,171,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,16, - 95,108,101,103,97,99,121,95,103,101,116,95,115,112,101,99, - 251,4,0,0,115,18,0,0,0,0,4,10,1,16,2,10, - 1,4,1,8,1,12,1,12,1,6,1,122,27,80,97,116, - 104,70,105,110,100,101,114,46,95,108,101,103,97,99,121,95, - 103,101,116,95,115,112,101,99,78,99,4,0,0,0,0,0, - 0,0,9,0,0,0,5,0,0,0,67,0,0,0,115,166, - 0,0,0,103,0,125,4,124,2,68,0,93,134,125,5,116, - 0,124,5,116,1,116,2,102,2,131,2,115,28,113,8,124, - 0,160,3,124,5,161,1,125,6,124,6,100,1,107,9,114, - 8,116,4,124,6,100,2,131,2,114,70,124,6,160,5,124, - 1,124,3,161,2,125,7,110,12,124,0,160,6,124,1,124, - 6,161,2,125,7,124,7,100,1,107,8,114,92,113,8,124, - 7,106,7,100,1,107,9,114,110,124,7,2,0,1,0,83, - 0,124,7,106,8,125,8,124,8,100,1,107,8,114,132,116, - 9,100,3,131,1,130,1,124,4,160,10,124,8,161,1,1, - 0,113,8,116,11,160,12,124,1,100,1,161,2,125,7,124, - 4,124,7,95,8,124,7,83,0,41,4,122,63,70,105,110, - 100,32,116,104,101,32,108,111,97,100,101,114,32,111,114,32, - 110,97,109,101,115,112,97,99,101,95,112,97,116,104,32,102, - 111,114,32,116,104,105,115,32,109,111,100,117,108,101,47,112, - 97,99,107,97,103,101,32,110,97,109,101,46,78,114,187,0, - 0,0,122,19,115,112,101,99,32,109,105,115,115,105,110,103, - 32,108,111,97,100,101,114,41,13,114,147,0,0,0,114,76, - 0,0,0,218,5,98,121,116,101,115,114,19,1,0,0,114, - 116,0,0,0,114,187,0,0,0,114,20,1,0,0,114,128, - 0,0,0,114,163,0,0,0,114,107,0,0,0,114,153,0, - 0,0,114,122,0,0,0,114,167,0,0,0,41,9,114,177, - 0,0,0,114,127,0,0,0,114,39,0,0,0,114,186,0, - 0,0,218,14,110,97,109,101,115,112,97,99,101,95,112,97, - 116,104,90,5,101,110,116,114,121,114,15,1,0,0,114,171, - 0,0,0,114,129,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,218,9,95,103,101,116,95,115,112, - 101,99,10,5,0,0,115,40,0,0,0,0,5,4,1,8, - 1,14,1,2,1,10,1,8,1,10,1,14,2,12,1,8, - 1,2,1,10,1,8,1,6,1,8,1,8,5,12,2,12, - 1,6,1,122,20,80,97,116,104,70,105,110,100,101,114,46, - 95,103,101,116,95,115,112,101,99,99,4,0,0,0,0,0, - 0,0,6,0,0,0,5,0,0,0,67,0,0,0,115,100, - 0,0,0,124,2,100,1,107,8,114,14,116,0,106,1,125, - 2,124,0,160,2,124,1,124,2,124,3,161,3,125,4,124, - 4,100,1,107,8,114,40,100,1,83,0,124,4,106,3,100, - 1,107,8,114,92,124,4,106,4,125,5,124,5,114,86,100, - 1,124,4,95,5,116,6,124,1,124,5,124,0,106,2,131, - 3,124,4,95,4,124,4,83,0,100,1,83,0,110,4,124, - 4,83,0,100,1,83,0,41,2,122,141,84,114,121,32,116, - 111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,111, - 114,32,39,102,117,108,108,110,97,109,101,39,32,111,110,32, + 104,101,46,10,10,32,32,32,32,32,32,32,32,73,102,32, + 116,104,101,32,112,97,116,104,32,101,110,116,114,121,32,105, + 115,32,110,111,116,32,105,110,32,116,104,101,32,99,97,99, + 104,101,44,32,102,105,110,100,32,116,104,101,32,97,112,112, + 114,111,112,114,105,97,116,101,32,102,105,110,100,101,114,10, + 32,32,32,32,32,32,32,32,97,110,100,32,99,97,99,104, + 101,32,105,116,46,32,73,102,32,110,111,32,102,105,110,100, + 101,114,32,105,115,32,97,118,97,105,108,97,98,108,101,44, + 32,115,116,111,114,101,32,78,111,110,101,46,10,10,32,32, + 32,32,32,32,32,32,114,35,0,0,0,78,41,7,114,1, + 0,0,0,114,49,0,0,0,114,229,0,0,0,114,6,0, + 0,0,114,13,1,0,0,218,8,75,101,121,69,114,114,111, + 114,114,17,1,0,0,41,3,114,177,0,0,0,114,39,0, + 0,0,114,15,1,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,218,20,95,112,97,116,104,95,105,109, + 112,111,114,116,101,114,95,99,97,99,104,101,228,4,0,0, + 115,22,0,0,0,0,8,8,1,2,1,12,1,14,3,8, + 1,2,1,14,1,14,1,10,1,16,1,122,31,80,97,116, + 104,70,105,110,100,101,114,46,95,112,97,116,104,95,105,109, + 112,111,114,116,101,114,95,99,97,99,104,101,99,3,0,0, + 0,0,0,0,0,6,0,0,0,4,0,0,0,67,0,0, + 0,115,82,0,0,0,116,0,124,2,100,1,131,2,114,26, + 124,2,160,1,124,1,161,1,92,2,125,3,125,4,110,14, + 124,2,160,2,124,1,161,1,125,3,103,0,125,4,124,3, + 100,0,107,9,114,60,116,3,160,4,124,1,124,3,161,2, + 83,0,116,3,160,5,124,1,100,0,161,2,125,5,124,4, + 124,5,95,6,124,5,83,0,41,2,78,114,125,0,0,0, + 41,7,114,116,0,0,0,114,125,0,0,0,114,188,0,0, + 0,114,122,0,0,0,114,185,0,0,0,114,167,0,0,0, + 114,163,0,0,0,41,6,114,177,0,0,0,114,127,0,0, + 0,114,15,1,0,0,114,128,0,0,0,114,129,0,0,0, + 114,171,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,218,16,95,108,101,103,97,99,121,95,103,101, + 116,95,115,112,101,99,250,4,0,0,115,18,0,0,0,0, + 4,10,1,16,2,10,1,4,1,8,1,12,1,12,1,6, + 1,122,27,80,97,116,104,70,105,110,100,101,114,46,95,108, + 101,103,97,99,121,95,103,101,116,95,115,112,101,99,78,99, + 4,0,0,0,0,0,0,0,9,0,0,0,5,0,0,0, + 67,0,0,0,115,166,0,0,0,103,0,125,4,124,2,68, + 0,93,134,125,5,116,0,124,5,116,1,116,2,102,2,131, + 2,115,28,113,8,124,0,160,3,124,5,161,1,125,6,124, + 6,100,1,107,9,114,8,116,4,124,6,100,2,131,2,114, + 70,124,6,160,5,124,1,124,3,161,2,125,7,110,12,124, + 0,160,6,124,1,124,6,161,2,125,7,124,7,100,1,107, + 8,114,92,113,8,124,7,106,7,100,1,107,9,114,110,124, + 7,2,0,1,0,83,0,124,7,106,8,125,8,124,8,100, + 1,107,8,114,132,116,9,100,3,131,1,130,1,124,4,160, + 10,124,8,161,1,1,0,113,8,116,11,160,12,124,1,100, + 1,161,2,125,7,124,4,124,7,95,8,124,7,83,0,41, + 4,122,63,70,105,110,100,32,116,104,101,32,108,111,97,100, + 101,114,32,111,114,32,110,97,109,101,115,112,97,99,101,95, + 112,97,116,104,32,102,111,114,32,116,104,105,115,32,109,111, + 100,117,108,101,47,112,97,99,107,97,103,101,32,110,97,109, + 101,46,78,114,187,0,0,0,122,19,115,112,101,99,32,109, + 105,115,115,105,110,103,32,108,111,97,100,101,114,41,13,114, + 147,0,0,0,114,76,0,0,0,218,5,98,121,116,101,115, + 114,19,1,0,0,114,116,0,0,0,114,187,0,0,0,114, + 20,1,0,0,114,128,0,0,0,114,163,0,0,0,114,107, + 0,0,0,114,153,0,0,0,114,122,0,0,0,114,167,0, + 0,0,41,9,114,177,0,0,0,114,127,0,0,0,114,39, + 0,0,0,114,186,0,0,0,218,14,110,97,109,101,115,112, + 97,99,101,95,112,97,116,104,90,5,101,110,116,114,121,114, + 15,1,0,0,114,171,0,0,0,114,129,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,9,95, + 103,101,116,95,115,112,101,99,9,5,0,0,115,40,0,0, + 0,0,5,4,1,8,1,14,1,2,1,10,1,8,1,10, + 1,14,2,12,1,8,1,2,1,10,1,8,1,6,1,8, + 1,8,5,12,2,12,1,6,1,122,20,80,97,116,104,70, + 105,110,100,101,114,46,95,103,101,116,95,115,112,101,99,99, + 4,0,0,0,0,0,0,0,6,0,0,0,5,0,0,0, + 67,0,0,0,115,100,0,0,0,124,2,100,1,107,8,114, + 14,116,0,106,1,125,2,124,0,160,2,124,1,124,2,124, + 3,161,3,125,4,124,4,100,1,107,8,114,40,100,1,83, + 0,124,4,106,3,100,1,107,8,114,92,124,4,106,4,125, + 5,124,5,114,86,100,1,124,4,95,5,116,6,124,1,124, + 5,124,0,106,2,131,3,124,4,95,4,124,4,83,0,100, + 1,83,0,110,4,124,4,83,0,100,1,83,0,41,2,122, + 141,84,114,121,32,116,111,32,102,105,110,100,32,97,32,115, + 112,101,99,32,102,111,114,32,39,102,117,108,108,110,97,109, + 101,39,32,111,110,32,115,121,115,46,112,97,116,104,32,111, + 114,32,39,112,97,116,104,39,46,10,10,32,32,32,32,32, + 32,32,32,84,104,101,32,115,101,97,114,99,104,32,105,115, + 32,98,97,115,101,100,32,111,110,32,115,121,115,46,112,97, + 116,104,95,104,111,111,107,115,32,97,110,100,32,115,121,115, + 46,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, + 97,99,104,101,46,10,32,32,32,32,32,32,32,32,78,41, + 7,114,6,0,0,0,114,39,0,0,0,114,23,1,0,0, + 114,128,0,0,0,114,163,0,0,0,114,165,0,0,0,114, + 246,0,0,0,41,6,114,177,0,0,0,114,127,0,0,0, + 114,39,0,0,0,114,186,0,0,0,114,171,0,0,0,114, + 22,1,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,187,0,0,0,41,5,0,0,115,26,0,0, + 0,0,6,8,1,6,1,14,1,8,1,4,1,10,1,6, + 1,4,3,6,1,16,1,4,2,6,2,122,20,80,97,116, + 104,70,105,110,100,101,114,46,102,105,110,100,95,115,112,101, + 99,99,3,0,0,0,0,0,0,0,4,0,0,0,4,0, + 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, + 1,124,2,161,2,125,3,124,3,100,1,107,8,114,24,100, + 1,83,0,124,3,106,1,83,0,41,2,122,170,102,105,110, + 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32, 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, - 104,39,46,10,10,32,32,32,32,32,32,32,32,84,104,101, - 32,115,101,97,114,99,104,32,105,115,32,98,97,115,101,100, - 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111, - 107,115,32,97,110,100,32,115,121,115,46,112,97,116,104,95, + 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46, + 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32, + 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95, 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, - 32,32,32,32,32,32,32,32,78,41,7,114,6,0,0,0, - 114,39,0,0,0,114,23,1,0,0,114,128,0,0,0,114, - 163,0,0,0,114,165,0,0,0,114,246,0,0,0,41,6, - 114,177,0,0,0,114,127,0,0,0,114,39,0,0,0,114, - 186,0,0,0,114,171,0,0,0,114,22,1,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,187,0, - 0,0,42,5,0,0,115,26,0,0,0,0,6,8,1,6, - 1,14,1,8,1,4,1,10,1,6,1,4,3,6,1,16, - 1,4,2,6,2,122,20,80,97,116,104,70,105,110,100,101, - 114,46,102,105,110,100,95,115,112,101,99,99,3,0,0,0, - 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, - 115,30,0,0,0,124,0,160,0,124,1,124,2,161,2,125, - 3,124,3,100,1,107,8,114,24,100,1,83,0,124,3,106, - 1,83,0,41,2,122,170,102,105,110,100,32,116,104,101,32, - 109,111,100,117,108,101,32,111,110,32,115,121,115,46,112,97, - 116,104,32,111,114,32,39,112,97,116,104,39,32,98,97,115, - 101,100,32,111,110,32,115,121,115,46,112,97,116,104,95,104, - 111,111,107,115,32,97,110,100,10,32,32,32,32,32,32,32, - 32,115,121,115,46,112,97,116,104,95,105,109,112,111,114,116, - 101,114,95,99,97,99,104,101,46,10,10,32,32,32,32,32, - 32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,105, - 115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85, - 115,101,32,102,105,110,100,95,115,112,101,99,40,41,32,105, - 110,115,116,101,97,100,46,10,10,32,32,32,32,32,32,32, - 32,78,41,2,114,187,0,0,0,114,128,0,0,0,41,4, - 114,177,0,0,0,114,127,0,0,0,114,39,0,0,0,114, - 171,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,188,0,0,0,66,5,0,0,115,8,0,0, - 0,0,8,12,1,8,1,4,1,122,22,80,97,116,104,70, - 105,110,100,101,114,46,102,105,110,100,95,109,111,100,117,108, - 101,41,12,114,113,0,0,0,114,112,0,0,0,114,114,0, - 0,0,114,115,0,0,0,114,189,0,0,0,114,11,1,0, - 0,114,17,1,0,0,114,19,1,0,0,114,20,1,0,0, - 114,23,1,0,0,114,187,0,0,0,114,188,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,10,1,0,0,202,4,0,0,115,30,0,0, - 0,8,2,4,2,12,10,12,13,12,22,12,15,2,1,2, - 255,12,32,2,1,2,0,2,255,12,24,2,1,2,255,114, - 10,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,64,0,0,0,115,90,0,0,0,101,0, - 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, - 90,4,100,4,100,5,132,0,90,5,101,6,90,7,100,6, - 100,7,132,0,90,8,100,8,100,9,132,0,90,9,100,19, - 100,11,100,12,132,1,90,10,100,13,100,14,132,0,90,11, - 101,12,100,15,100,16,132,0,131,1,90,13,100,17,100,18, - 132,0,90,14,100,10,83,0,41,20,218,10,70,105,108,101, - 70,105,110,100,101,114,122,172,70,105,108,101,45,98,97,115, - 101,100,32,102,105,110,100,101,114,46,10,10,32,32,32,32, - 73,110,116,101,114,97,99,116,105,111,110,115,32,119,105,116, - 104,32,116,104,101,32,102,105,108,101,32,115,121,115,116,101, - 109,32,97,114,101,32,99,97,99,104,101,100,32,102,111,114, - 32,112,101,114,102,111,114,109,97,110,99,101,44,32,98,101, - 105,110,103,10,32,32,32,32,114,101,102,114,101,115,104,101, - 100,32,119,104,101,110,32,116,104,101,32,100,105,114,101,99, - 116,111,114,121,32,116,104,101,32,102,105,110,100,101,114,32, - 105,115,32,104,97,110,100,108,105,110,103,32,104,97,115,32, - 98,101,101,110,32,109,111,100,105,102,105,101,100,46,10,10, - 32,32,32,32,99,2,0,0,0,0,0,0,0,5,0,0, - 0,6,0,0,0,7,0,0,0,115,84,0,0,0,103,0, - 125,3,124,2,68,0,93,32,92,2,137,0,125,4,124,3, - 160,0,135,0,102,1,100,1,100,2,132,8,124,4,68,0, - 131,1,161,1,1,0,113,8,124,3,124,0,95,1,124,1, - 112,54,100,3,124,0,95,2,100,4,124,0,95,3,116,4, - 131,0,124,0,95,5,116,4,131,0,124,0,95,6,100,5, - 83,0,41,6,122,154,73,110,105,116,105,97,108,105,122,101, - 32,119,105,116,104,32,116,104,101,32,112,97,116,104,32,116, - 111,32,115,101,97,114,99,104,32,111,110,32,97,110,100,32, - 97,32,118,97,114,105,97,98,108,101,32,110,117,109,98,101, - 114,32,111,102,10,32,32,32,32,32,32,32,32,50,45,116, - 117,112,108,101,115,32,99,111,110,116,97,105,110,105,110,103, - 32,116,104,101,32,108,111,97,100,101,114,32,97,110,100,32, - 116,104,101,32,102,105,108,101,32,115,117,102,102,105,120,101, - 115,32,116,104,101,32,108,111,97,100,101,114,10,32,32,32, - 32,32,32,32,32,114,101,99,111,103,110,105,122,101,115,46, - 99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,0, - 0,51,0,0,0,115,22,0,0,0,124,0,93,14,125,1, - 124,1,136,0,102,2,86,0,1,0,113,2,100,0,83,0, - 41,1,78,114,2,0,0,0,41,2,114,27,0,0,0,114, - 241,0,0,0,41,1,114,128,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,243,0,0,0,95,5,0,0,115,4, - 0,0,0,4,0,2,0,122,38,70,105,108,101,70,105,110, - 100,101,114,46,95,95,105,110,105,116,95,95,46,60,108,111, - 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, - 63,0,0,0,114,96,0,0,0,78,41,7,114,153,0,0, - 0,218,8,95,108,111,97,100,101,114,115,114,39,0,0,0, - 218,11,95,112,97,116,104,95,109,116,105,109,101,218,3,115, - 101,116,218,11,95,112,97,116,104,95,99,97,99,104,101,218, - 19,95,114,101,108,97,120,101,100,95,112,97,116,104,95,99, - 97,99,104,101,41,5,114,108,0,0,0,114,39,0,0,0, - 218,14,108,111,97,100,101,114,95,100,101,116,97,105,108,115, - 90,7,108,111,97,100,101,114,115,114,173,0,0,0,114,2, - 0,0,0,41,1,114,128,0,0,0,114,4,0,0,0,114, - 191,0,0,0,89,5,0,0,115,16,0,0,0,0,4,4, - 1,12,1,26,1,6,2,10,1,6,1,8,1,122,19,70, - 105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116, - 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,2, - 0,0,0,67,0,0,0,115,10,0,0,0,100,1,124,0, - 95,0,100,2,83,0,41,3,122,31,73,110,118,97,108,105, - 100,97,116,101,32,116,104,101,32,100,105,114,101,99,116,111, - 114,121,32,109,116,105,109,101,46,114,96,0,0,0,78,41, - 1,114,26,1,0,0,41,1,114,108,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,11,1,0, - 0,103,5,0,0,115,2,0,0,0,0,2,122,28,70,105, - 108,101,70,105,110,100,101,114,46,105,110,118,97,108,105,100, - 97,116,101,95,99,97,99,104,101,115,99,2,0,0,0,0, - 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, - 42,0,0,0,124,0,160,0,124,1,161,1,125,2,124,2, - 100,1,107,8,114,26,100,1,103,0,102,2,83,0,124,2, - 106,1,124,2,106,2,112,38,103,0,102,2,83,0,41,2, - 122,197,84,114,121,32,116,111,32,102,105,110,100,32,97,32, - 108,111,97,100,101,114,32,102,111,114,32,116,104,101,32,115, - 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,44, - 32,111,114,32,116,104,101,32,110,97,109,101,115,112,97,99, - 101,10,32,32,32,32,32,32,32,32,112,97,99,107,97,103, - 101,32,112,111,114,116,105,111,110,115,46,32,82,101,116,117, - 114,110,115,32,40,108,111,97,100,101,114,44,32,108,105,115, - 116,45,111,102,45,112,111,114,116,105,111,110,115,41,46,10, 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,41,3,114,187,0,0,0,114, - 128,0,0,0,114,163,0,0,0,41,3,114,108,0,0,0, - 114,127,0,0,0,114,171,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,125,0,0,0,109,5, - 0,0,115,8,0,0,0,0,7,10,1,8,1,8,1,122, - 22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100, - 95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,0, - 7,0,0,0,6,0,0,0,67,0,0,0,115,26,0,0, - 0,124,1,124,2,124,3,131,2,125,6,116,0,124,2,124, - 3,124,6,124,4,100,1,141,4,83,0,41,2,78,41,2, - 114,128,0,0,0,114,163,0,0,0,41,1,114,174,0,0, - 0,41,7,114,108,0,0,0,114,172,0,0,0,114,127,0, - 0,0,114,39,0,0,0,90,4,115,109,115,108,114,186,0, - 0,0,114,128,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,23,1,0,0,121,5,0,0,115, - 8,0,0,0,0,1,10,1,8,1,2,255,122,20,70,105, - 108,101,70,105,110,100,101,114,46,95,103,101,116,95,115,112, - 101,99,78,99,3,0,0,0,0,0,0,0,14,0,0,0, - 8,0,0,0,67,0,0,0,115,102,1,0,0,100,1,125, - 3,124,1,160,0,100,2,161,1,100,3,25,0,125,4,122, - 24,116,1,124,0,106,2,112,34,116,3,160,4,161,0,131, - 1,106,5,125,5,87,0,110,24,4,0,116,6,107,10,114, - 66,1,0,1,0,1,0,100,4,125,5,89,0,110,2,88, - 0,124,5,124,0,106,7,107,3,114,92,124,0,160,8,161, - 0,1,0,124,5,124,0,95,7,116,9,131,0,114,114,124, - 0,106,10,125,6,124,4,160,11,161,0,125,7,110,10,124, - 0,106,12,125,6,124,4,125,7,124,7,124,6,107,6,114, - 218,116,13,124,0,106,2,124,4,131,2,125,8,124,0,106, - 14,68,0,93,58,92,2,125,9,125,10,100,5,124,9,23, - 0,125,11,116,13,124,8,124,11,131,2,125,12,116,15,124, - 12,131,1,114,208,124,0,160,16,124,10,124,1,124,12,124, - 8,103,1,124,2,161,5,2,0,1,0,83,0,113,150,116, - 17,124,8,131,1,125,3,124,0,106,14,68,0,93,86,92, - 2,125,9,125,10,116,13,124,0,106,2,124,4,124,9,23, - 0,131,2,125,12,116,18,106,19,100,6,124,12,100,3,100, - 7,141,3,1,0,124,7,124,9,23,0,124,6,107,6,144, - 1,114,54,116,15,124,12,131,1,144,1,114,54,124,0,160, - 16,124,10,124,1,124,12,100,8,124,2,161,5,2,0,1, - 0,83,0,113,224,124,3,144,1,114,98,116,18,160,19,100, - 9,124,8,161,2,1,0,116,18,160,20,124,1,100,8,161, - 2,125,13,124,8,103,1,124,13,95,21,124,13,83,0,100, - 8,83,0,41,10,122,111,84,114,121,32,116,111,32,102,105, - 110,100,32,97,32,115,112,101,99,32,102,111,114,32,116,104, - 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, - 108,101,46,10,10,32,32,32,32,32,32,32,32,82,101,116, - 117,114,110,115,32,116,104,101,32,109,97,116,99,104,105,110, - 103,32,115,112,101,99,44,32,111,114,32,78,111,110,101,32, - 105,102,32,110,111,116,32,102,111,117,110,100,46,10,32,32, - 32,32,32,32,32,32,70,114,63,0,0,0,114,23,0,0, - 0,114,96,0,0,0,114,191,0,0,0,122,9,116,114,121, - 105,110,103,32,123,125,41,1,90,9,118,101,114,98,111,115, - 105,116,121,78,122,25,112,111,115,115,105,98,108,101,32,110, - 97,109,101,115,112,97,99,101,32,102,111,114,32,123,125,41, - 22,114,36,0,0,0,114,43,0,0,0,114,39,0,0,0, - 114,1,0,0,0,114,49,0,0,0,114,235,0,0,0,114, - 44,0,0,0,114,26,1,0,0,218,11,95,102,105,108,108, - 95,99,97,99,104,101,114,5,0,0,0,114,29,1,0,0, - 114,97,0,0,0,114,28,1,0,0,114,33,0,0,0,114, - 25,1,0,0,114,48,0,0,0,114,23,1,0,0,114,50, - 0,0,0,114,122,0,0,0,114,136,0,0,0,114,167,0, - 0,0,114,163,0,0,0,41,14,114,108,0,0,0,114,127, - 0,0,0,114,186,0,0,0,90,12,105,115,95,110,97,109, - 101,115,112,97,99,101,90,11,116,97,105,108,95,109,111,100, - 117,108,101,114,155,0,0,0,90,5,99,97,99,104,101,90, - 12,99,97,99,104,101,95,109,111,100,117,108,101,90,9,98, - 97,115,101,95,112,97,116,104,114,241,0,0,0,114,172,0, - 0,0,90,13,105,110,105,116,95,102,105,108,101,110,97,109, - 101,90,9,102,117,108,108,95,112,97,116,104,114,171,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,187,0,0,0,126,5,0,0,115,74,0,0,0,0,5, - 4,1,14,1,2,1,24,1,14,1,10,1,10,1,8,1, - 6,2,6,1,6,1,10,2,6,1,4,2,8,1,12,1, - 14,1,8,1,10,1,8,1,26,4,8,2,14,1,16,1, - 16,1,14,1,10,1,10,1,2,0,2,255,10,2,6,1, - 12,1,12,1,8,1,4,1,122,20,70,105,108,101,70,105, - 110,100,101,114,46,102,105,110,100,95,115,112,101,99,99,1, - 0,0,0,0,0,0,0,9,0,0,0,10,0,0,0,67, - 0,0,0,115,190,0,0,0,124,0,106,0,125,1,122,22, - 116,1,160,2,124,1,112,22,116,1,160,3,161,0,161,1, - 125,2,87,0,110,30,4,0,116,4,116,5,116,6,102,3, - 107,10,114,58,1,0,1,0,1,0,103,0,125,2,89,0, - 110,2,88,0,116,7,106,8,160,9,100,1,161,1,115,84, - 116,10,124,2,131,1,124,0,95,11,110,74,116,10,131,0, - 125,3,124,2,68,0,93,56,125,4,124,4,160,12,100,2, - 161,1,92,3,125,5,125,6,125,7,124,6,114,136,100,3, - 160,13,124,5,124,7,160,14,161,0,161,2,125,8,110,4, - 124,5,125,8,124,3,160,15,124,8,161,1,1,0,113,94, - 124,3,124,0,95,11,116,7,106,8,160,9,116,16,161,1, - 114,186,100,4,100,5,132,0,124,2,68,0,131,1,124,0, - 95,17,100,6,83,0,41,7,122,68,70,105,108,108,32,116, - 104,101,32,99,97,99,104,101,32,111,102,32,112,111,116,101, - 110,116,105,97,108,32,109,111,100,117,108,101,115,32,97,110, - 100,32,112,97,99,107,97,103,101,115,32,102,111,114,32,116, - 104,105,115,32,100,105,114,101,99,116,111,114,121,46,114,0, - 0,0,0,114,63,0,0,0,122,5,123,125,46,123,125,99, - 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,125, - 1,124,1,160,0,161,0,146,2,113,4,83,0,114,2,0, - 0,0,41,1,114,97,0,0,0,41,2,114,27,0,0,0, - 90,2,102,110,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,9,60,115,101,116,99,111,109,112,62,203,5, - 0,0,115,4,0,0,0,6,0,2,0,122,41,70,105,108, - 101,70,105,110,100,101,114,46,95,102,105,108,108,95,99,97, - 99,104,101,46,60,108,111,99,97,108,115,62,46,60,115,101, - 116,99,111,109,112,62,78,41,18,114,39,0,0,0,114,1, - 0,0,0,114,232,0,0,0,114,49,0,0,0,114,229,0, - 0,0,218,15,80,101,114,109,105,115,115,105,111,110,69,114, - 114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,111, - 114,121,69,114,114,111,114,114,6,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,27,1,0,0,114,28,1,0,0, - 114,92,0,0,0,114,54,0,0,0,114,97,0,0,0,218, - 3,97,100,100,114,9,0,0,0,114,29,1,0,0,41,9, - 114,108,0,0,0,114,39,0,0,0,114,233,0,0,0,90, - 21,108,111,119,101,114,95,115,117,102,102,105,120,95,99,111, - 110,116,101,110,116,115,114,6,1,0,0,114,106,0,0,0, - 114,253,0,0,0,114,241,0,0,0,90,8,110,101,119,95, - 110,97,109,101,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,31,1,0,0,174,5,0,0,115,34,0,0, - 0,0,2,6,1,2,1,22,1,20,3,10,3,12,1,12, - 7,6,1,8,1,16,1,4,1,18,2,4,1,12,1,6, - 1,12,1,122,22,70,105,108,101,70,105,110,100,101,114,46, - 95,102,105,108,108,95,99,97,99,104,101,99,1,0,0,0, - 0,0,0,0,3,0,0,0,3,0,0,0,7,0,0,0, - 115,18,0,0,0,135,0,135,1,102,2,100,1,100,2,132, - 8,125,2,124,2,83,0,41,3,97,20,1,0,0,65,32, - 99,108,97,115,115,32,109,101,116,104,111,100,32,119,104,105, - 99,104,32,114,101,116,117,114,110,115,32,97,32,99,108,111, - 115,117,114,101,32,116,111,32,117,115,101,32,111,110,32,115, - 121,115,46,112,97,116,104,95,104,111,111,107,10,32,32,32, - 32,32,32,32,32,119,104,105,99,104,32,119,105,108,108,32, - 114,101,116,117,114,110,32,97,110,32,105,110,115,116,97,110, - 99,101,32,117,115,105,110,103,32,116,104,101,32,115,112,101, - 99,105,102,105,101,100,32,108,111,97,100,101,114,115,32,97, - 110,100,32,116,104,101,32,112,97,116,104,10,32,32,32,32, - 32,32,32,32,99,97,108,108,101,100,32,111,110,32,116,104, - 101,32,99,108,111,115,117,114,101,46,10,10,32,32,32,32, - 32,32,32,32,73,102,32,116,104,101,32,112,97,116,104,32, - 99,97,108,108,101,100,32,111,110,32,116,104,101,32,99,108, - 111,115,117,114,101,32,105,115,32,110,111,116,32,97,32,100, - 105,114,101,99,116,111,114,121,44,32,73,109,112,111,114,116, - 69,114,114,111,114,32,105,115,10,32,32,32,32,32,32,32, - 32,114,97,105,115,101,100,46,10,10,32,32,32,32,32,32, - 32,32,99,1,0,0,0,0,0,0,0,1,0,0,0,4, - 0,0,0,19,0,0,0,115,34,0,0,0,116,0,124,0, - 131,1,115,20,116,1,100,1,124,0,100,2,141,2,130,1, - 136,0,124,0,102,1,136,1,158,2,142,0,83,0,41,3, - 122,45,80,97,116,104,32,104,111,111,107,32,102,111,114,32, - 105,109,112,111,114,116,108,105,98,46,109,97,99,104,105,110, - 101,114,121,46,70,105,108,101,70,105,110,100,101,114,46,122, - 30,111,110,108,121,32,100,105,114,101,99,116,111,114,105,101, - 115,32,97,114,101,32,115,117,112,112,111,114,116,101,100,41, - 1,114,39,0,0,0,41,2,114,50,0,0,0,114,107,0, - 0,0,41,1,114,39,0,0,0,41,2,114,177,0,0,0, - 114,30,1,0,0,114,2,0,0,0,114,4,0,0,0,218, - 24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, - 105,108,101,70,105,110,100,101,114,215,5,0,0,115,6,0, - 0,0,0,2,8,1,12,1,122,54,70,105,108,101,70,105, - 110,100,101,114,46,112,97,116,104,95,104,111,111,107,46,60, - 108,111,99,97,108,115,62,46,112,97,116,104,95,104,111,111, - 107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,114, - 114,2,0,0,0,41,3,114,177,0,0,0,114,30,1,0, - 0,114,36,1,0,0,114,2,0,0,0,41,2,114,177,0, - 0,0,114,30,1,0,0,114,4,0,0,0,218,9,112,97, - 116,104,95,104,111,111,107,205,5,0,0,115,4,0,0,0, - 0,10,14,6,122,20,70,105,108,101,70,105,110,100,101,114, - 46,112,97,116,104,95,104,111,111,107,99,1,0,0,0,0, - 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, - 12,0,0,0,100,1,160,0,124,0,106,1,161,1,83,0, - 41,2,78,122,16,70,105,108,101,70,105,110,100,101,114,40, - 123,33,114,125,41,41,2,114,54,0,0,0,114,39,0,0, - 0,41,1,114,108,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,5,1,0,0,223,5,0,0, - 115,2,0,0,0,0,1,122,19,70,105,108,101,70,105,110, - 100,101,114,46,95,95,114,101,112,114,95,95,41,1,78,41, - 15,114,113,0,0,0,114,112,0,0,0,114,114,0,0,0, - 114,115,0,0,0,114,191,0,0,0,114,11,1,0,0,114, - 131,0,0,0,114,188,0,0,0,114,125,0,0,0,114,23, - 1,0,0,114,187,0,0,0,114,31,1,0,0,114,189,0, - 0,0,114,37,1,0,0,114,5,1,0,0,114,2,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,24,1,0,0,80,5,0,0,115,20,0,0,0,8,7, - 4,2,8,14,8,4,4,2,8,12,8,5,10,48,8,31, - 12,18,114,24,1,0,0,99,4,0,0,0,0,0,0,0, - 6,0,0,0,8,0,0,0,67,0,0,0,115,146,0,0, - 0,124,0,160,0,100,1,161,1,125,4,124,0,160,0,100, - 2,161,1,125,5,124,4,115,66,124,5,114,36,124,5,106, - 1,125,4,110,30,124,2,124,3,107,2,114,56,116,2,124, - 1,124,2,131,2,125,4,110,10,116,3,124,1,124,2,131, - 2,125,4,124,5,115,84,116,4,124,1,124,2,124,4,100, - 3,141,3,125,5,122,36,124,5,124,0,100,2,60,0,124, - 4,124,0,100,1,60,0,124,2,124,0,100,4,60,0,124, - 3,124,0,100,5,60,0,87,0,110,20,4,0,116,5,107, - 10,114,140,1,0,1,0,1,0,89,0,110,2,88,0,100, - 0,83,0,41,6,78,218,10,95,95,108,111,97,100,101,114, - 95,95,218,8,95,95,115,112,101,99,95,95,41,1,114,128, - 0,0,0,90,8,95,95,102,105,108,101,95,95,90,10,95, - 95,99,97,99,104,101,100,95,95,41,6,218,3,103,101,116, - 114,128,0,0,0,114,239,0,0,0,114,234,0,0,0,114, - 174,0,0,0,218,9,69,120,99,101,112,116,105,111,110,41, - 6,90,2,110,115,114,106,0,0,0,90,8,112,97,116,104, - 110,97,109,101,90,9,99,112,97,116,104,110,97,109,101,114, - 128,0,0,0,114,171,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,218,14,95,102,105,120,95,117, - 112,95,109,111,100,117,108,101,229,5,0,0,115,34,0,0, - 0,0,2,10,1,10,1,4,1,4,1,8,1,8,1,12, - 2,10,1,4,1,14,1,2,1,8,1,8,1,8,1,12, - 1,14,2,114,42,1,0,0,99,0,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0, - 0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,3, - 116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,0, - 124,1,124,2,103,3,83,0,41,1,122,95,82,101,116,117, - 114,110,115,32,97,32,108,105,115,116,32,111,102,32,102,105, - 108,101,45,98,97,115,101,100,32,109,111,100,117,108,101,32, - 108,111,97,100,101,114,115,46,10,10,32,32,32,32,69,97, - 99,104,32,105,116,101,109,32,105,115,32,97,32,116,117,112, - 108,101,32,40,108,111,97,100,101,114,44,32,115,117,102,102, - 105,120,101,115,41,46,10,32,32,32,32,41,7,114,240,0, - 0,0,114,149,0,0,0,218,18,101,120,116,101,110,115,105, - 111,110,95,115,117,102,102,105,120,101,115,114,234,0,0,0, - 114,93,0,0,0,114,239,0,0,0,114,80,0,0,0,41, - 3,90,10,101,120,116,101,110,115,105,111,110,115,90,6,115, - 111,117,114,99,101,90,8,98,121,116,101,99,111,100,101,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,168, - 0,0,0,252,5,0,0,115,8,0,0,0,0,5,12,1, - 8,1,8,1,114,168,0,0,0,99,1,0,0,0,0,0, - 0,0,12,0,0,0,9,0,0,0,67,0,0,0,115,178, - 1,0,0,124,0,97,0,116,0,106,1,97,1,116,0,106, - 2,97,2,116,1,106,3,116,4,25,0,125,1,100,1,68, - 0,93,48,125,2,124,2,116,1,106,3,107,7,114,56,116, - 0,160,5,124,2,161,1,125,3,110,10,116,1,106,3,124, - 2,25,0,125,3,116,6,124,1,124,2,124,3,131,3,1, - 0,113,30,100,2,100,3,103,1,102,2,100,4,100,5,100, - 3,103,2,102,2,102,2,125,4,124,4,68,0,93,110,92, - 2,125,5,125,6,116,7,100,6,100,7,132,0,124,6,68, - 0,131,1,131,1,115,136,116,8,130,1,124,6,100,8,25, - 0,125,7,124,5,116,1,106,3,107,6,114,170,116,1,106, - 3,124,5,25,0,125,8,1,0,113,226,113,106,122,20,116, - 0,160,5,124,5,161,1,125,8,87,0,1,0,113,226,87, - 0,113,106,4,0,116,9,107,10,114,214,1,0,1,0,1, - 0,89,0,113,106,89,0,113,106,88,0,113,106,116,9,100, - 9,131,1,130,1,116,6,124,1,100,10,124,8,131,3,1, - 0,116,6,124,1,100,11,124,7,131,3,1,0,116,6,124, - 1,100,12,100,13,160,10,124,6,161,1,131,3,1,0,116, - 6,124,1,100,14,100,15,100,16,132,0,124,6,68,0,131, - 1,131,3,1,0,116,0,160,5,100,17,161,1,125,9,116, - 6,124,1,100,17,124,9,131,3,1,0,116,0,160,5,100, - 18,161,1,125,10,116,6,124,1,100,18,124,10,131,3,1, - 0,124,5,100,4,107,2,144,1,114,110,116,0,160,5,100, - 19,161,1,125,11,116,6,124,1,100,20,124,11,131,3,1, - 0,116,6,124,1,100,21,116,11,131,0,131,3,1,0,116, - 12,160,13,116,2,160,14,161,0,161,1,1,0,124,5,100, - 4,107,2,144,1,114,174,116,15,160,16,100,22,161,1,1, - 0,100,23,116,12,107,6,144,1,114,174,100,24,116,17,95, - 18,100,25,83,0,41,26,122,205,83,101,116,117,112,32,116, - 104,101,32,112,97,116,104,45,98,97,115,101,100,32,105,109, - 112,111,114,116,101,114,115,32,102,111,114,32,105,109,112,111, - 114,116,108,105,98,32,98,121,32,105,109,112,111,114,116,105, - 110,103,32,110,101,101,100,101,100,10,32,32,32,32,98,117, - 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97, - 110,100,32,105,110,106,101,99,116,105,110,103,32,116,104,101, - 109,32,105,110,116,111,32,116,104,101,32,103,108,111,98,97, - 108,32,110,97,109,101,115,112,97,99,101,46,10,10,32,32, - 32,32,79,116,104,101,114,32,99,111,109,112,111,110,101,110, - 116,115,32,97,114,101,32,101,120,116,114,97,99,116,101,100, - 32,102,114,111,109,32,116,104,101,32,99,111,114,101,32,98, - 111,111,116,115,116,114,97,112,32,109,111,100,117,108,101,46, - 10,10,32,32,32,32,41,4,114,56,0,0,0,114,66,0, - 0,0,218,8,98,117,105,108,116,105,110,115,114,146,0,0, - 0,90,5,112,111,115,105,120,250,1,47,90,2,110,116,250, - 1,92,99,1,0,0,0,0,0,0,0,2,0,0,0,3, - 0,0,0,115,0,0,0,115,26,0,0,0,124,0,93,18, - 125,1,116,0,124,1,131,1,100,0,107,2,86,0,1,0, - 113,2,100,1,83,0,41,2,114,34,0,0,0,78,41,1, - 114,18,0,0,0,41,2,114,27,0,0,0,114,86,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,243,0,0,0,32,6,0,0,115,4,0,0,0,4,0, - 2,0,122,25,95,115,101,116,117,112,46,60,108,111,99,97, - 108,115,62,46,60,103,101,110,101,120,112,114,62,114,64,0, - 0,0,122,30,105,109,112,111,114,116,108,105,98,32,114,101, - 113,117,105,114,101,115,32,112,111,115,105,120,32,111,114,32, - 110,116,114,1,0,0,0,114,30,0,0,0,114,26,0,0, - 0,114,35,0,0,0,114,52,0,0,0,99,1,0,0,0, - 0,0,0,0,2,0,0,0,4,0,0,0,83,0,0,0, - 115,22,0,0,0,104,0,124,0,93,14,125,1,100,0,124, - 1,155,0,157,2,146,2,113,4,83,0,41,1,114,65,0, - 0,0,114,2,0,0,0,41,2,114,27,0,0,0,218,1, - 115,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,32,1,0,0,48,6,0,0,115,4,0,0,0,6,0, - 2,0,122,25,95,115,101,116,117,112,46,60,108,111,99,97, - 108,115,62,46,60,115,101,116,99,111,109,112,62,90,7,95, - 116,104,114,101,97,100,90,8,95,119,101,97,107,114,101,102, - 90,6,119,105,110,114,101,103,114,176,0,0,0,114,5,0, - 0,0,122,4,46,112,121,119,122,6,95,100,46,112,121,100, - 84,78,41,19,114,122,0,0,0,114,6,0,0,0,114,149, - 0,0,0,114,255,0,0,0,114,113,0,0,0,90,18,95, - 98,117,105,108,116,105,110,95,102,114,111,109,95,110,97,109, - 101,114,117,0,0,0,218,3,97,108,108,114,19,0,0,0, - 114,107,0,0,0,114,31,0,0,0,114,11,0,0,0,114, - 245,0,0,0,114,153,0,0,0,114,43,1,0,0,114,93, - 0,0,0,114,170,0,0,0,114,175,0,0,0,114,179,0, - 0,0,41,12,218,17,95,98,111,111,116,115,116,114,97,112, - 95,109,111,100,117,108,101,90,11,115,101,108,102,95,109,111, - 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, - 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, - 108,101,90,10,111,115,95,100,101,116,97,105,108,115,90,10, - 98,117,105,108,116,105,110,95,111,115,114,26,0,0,0,114, - 30,0,0,0,90,9,111,115,95,109,111,100,117,108,101,90, - 13,116,104,114,101,97,100,95,109,111,100,117,108,101,90,14, - 119,101,97,107,114,101,102,95,109,111,100,117,108,101,90,13, - 119,105,110,114,101,103,95,109,111,100,117,108,101,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,6,95,115, - 101,116,117,112,7,6,0,0,115,78,0,0,0,0,8,4, - 1,6,1,6,3,10,1,8,1,10,1,12,2,10,1,14, - 3,22,1,12,2,22,1,8,1,10,1,10,1,6,2,2, - 1,10,1,10,1,14,1,12,2,8,1,12,1,12,1,18, - 1,22,3,10,1,12,3,10,1,12,3,10,1,10,1,12, - 3,14,1,14,1,10,1,10,1,10,1,114,50,1,0,0, - 99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0, - 0,67,0,0,0,115,50,0,0,0,116,0,124,0,131,1, - 1,0,116,1,131,0,125,1,116,2,106,3,160,4,116,5, - 106,6,124,1,142,0,103,1,161,1,1,0,116,2,106,7, - 160,8,116,9,161,1,1,0,100,1,83,0,41,2,122,41, - 73,110,115,116,97,108,108,32,116,104,101,32,112,97,116,104, - 45,98,97,115,101,100,32,105,109,112,111,114,116,32,99,111, - 109,112,111,110,101,110,116,115,46,78,41,10,114,50,1,0, - 0,114,168,0,0,0,114,6,0,0,0,114,16,1,0,0, - 114,153,0,0,0,114,24,1,0,0,114,37,1,0,0,218, - 9,109,101,116,97,95,112,97,116,104,114,170,0,0,0,114, - 10,1,0,0,41,2,114,49,1,0,0,90,17,115,117,112, - 112,111,114,116,101,100,95,108,111,97,100,101,114,115,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,8,95, - 105,110,115,116,97,108,108,72,6,0,0,115,8,0,0,0, - 0,2,8,1,6,1,20,1,114,52,1,0,0,41,63,114, - 115,0,0,0,114,10,0,0,0,90,37,95,67,65,83,69, - 95,73,78,83,69,78,83,73,84,73,86,69,95,80,76,65, - 84,70,79,82,77,83,95,66,89,84,69,83,95,75,69,89, - 114,9,0,0,0,114,11,0,0,0,114,17,0,0,0,114, - 22,0,0,0,114,24,0,0,0,114,33,0,0,0,114,42, - 0,0,0,114,43,0,0,0,114,47,0,0,0,114,48,0, - 0,0,114,50,0,0,0,114,53,0,0,0,114,61,0,0, - 0,218,4,116,121,112,101,218,8,95,95,99,111,100,101,95, - 95,114,148,0,0,0,114,15,0,0,0,114,135,0,0,0, - 114,14,0,0,0,114,20,0,0,0,114,214,0,0,0,114, - 83,0,0,0,114,79,0,0,0,114,93,0,0,0,114,80, - 0,0,0,90,23,68,69,66,85,71,95,66,89,84,69,67, - 79,68,69,95,83,85,70,70,73,88,69,83,90,27,79,80, - 84,73,77,73,90,69,68,95,66,89,84,69,67,79,68,69, - 95,83,85,70,70,73,88,69,83,114,89,0,0,0,114,94, - 0,0,0,114,100,0,0,0,114,103,0,0,0,114,105,0, - 0,0,114,124,0,0,0,114,131,0,0,0,114,139,0,0, - 0,114,143,0,0,0,114,145,0,0,0,114,151,0,0,0, - 114,156,0,0,0,114,157,0,0,0,114,162,0,0,0,218, - 6,111,98,106,101,99,116,114,169,0,0,0,114,174,0,0, - 0,114,175,0,0,0,114,190,0,0,0,114,200,0,0,0, - 114,217,0,0,0,114,234,0,0,0,114,239,0,0,0,114, - 245,0,0,0,114,240,0,0,0,114,246,0,0,0,114,8, - 1,0,0,114,10,1,0,0,114,24,1,0,0,114,42,1, - 0,0,114,168,0,0,0,114,50,1,0,0,114,52,1,0, - 0,114,2,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,8,60,109,111,100,117,108,101,62,8, - 0,0,0,115,126,0,0,0,4,15,4,1,4,1,2,1, - 2,255,4,4,8,17,8,5,8,5,8,6,8,6,8,12, - 8,10,8,9,8,5,8,7,8,9,12,22,10,127,0,7, - 16,1,12,2,4,1,4,2,6,2,6,2,8,2,18,71, - 8,40,8,19,8,12,8,12,8,28,8,17,8,33,8,28, - 8,24,16,13,14,10,12,11,8,14,6,3,6,1,2,255, - 12,68,14,64,14,29,16,127,0,18,14,68,18,45,18,26, - 4,3,18,53,14,60,14,42,14,127,0,7,14,127,0,22, - 12,23,8,11,8,65, + 32,32,32,32,32,32,32,78,41,2,114,187,0,0,0,114, + 128,0,0,0,41,4,114,177,0,0,0,114,127,0,0,0, + 114,39,0,0,0,114,171,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,188,0,0,0,65,5, + 0,0,115,8,0,0,0,0,8,12,1,8,1,4,1,122, + 22,80,97,116,104,70,105,110,100,101,114,46,102,105,110,100, + 95,109,111,100,117,108,101,41,12,114,113,0,0,0,114,112, + 0,0,0,114,114,0,0,0,114,115,0,0,0,114,189,0, + 0,0,114,11,1,0,0,114,17,1,0,0,114,19,1,0, + 0,114,20,1,0,0,114,23,1,0,0,114,187,0,0,0, + 114,188,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,10,1,0,0,201,4, + 0,0,115,30,0,0,0,8,2,4,2,12,10,12,13,12, + 22,12,15,2,1,2,255,12,32,2,1,2,0,2,255,12, + 24,2,1,2,255,114,10,1,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, + 90,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, + 101,6,90,7,100,6,100,7,132,0,90,8,100,8,100,9, + 132,0,90,9,100,19,100,11,100,12,132,1,90,10,100,13, + 100,14,132,0,90,11,101,12,100,15,100,16,132,0,131,1, + 90,13,100,17,100,18,132,0,90,14,100,10,83,0,41,20, + 218,10,70,105,108,101,70,105,110,100,101,114,122,172,70,105, + 108,101,45,98,97,115,101,100,32,102,105,110,100,101,114,46, + 10,10,32,32,32,32,73,110,116,101,114,97,99,116,105,111, + 110,115,32,119,105,116,104,32,116,104,101,32,102,105,108,101, + 32,115,121,115,116,101,109,32,97,114,101,32,99,97,99,104, + 101,100,32,102,111,114,32,112,101,114,102,111,114,109,97,110, + 99,101,44,32,98,101,105,110,103,10,32,32,32,32,114,101, + 102,114,101,115,104,101,100,32,119,104,101,110,32,116,104,101, + 32,100,105,114,101,99,116,111,114,121,32,116,104,101,32,102, + 105,110,100,101,114,32,105,115,32,104,97,110,100,108,105,110, + 103,32,104,97,115,32,98,101,101,110,32,109,111,100,105,102, + 105,101,100,46,10,10,32,32,32,32,99,2,0,0,0,0, + 0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,115, + 84,0,0,0,103,0,125,3,124,2,68,0,93,32,92,2, + 137,0,125,4,124,3,160,0,135,0,102,1,100,1,100,2, + 132,8,124,4,68,0,131,1,161,1,1,0,113,8,124,3, + 124,0,95,1,124,1,112,54,100,3,124,0,95,2,100,4, + 124,0,95,3,116,4,131,0,124,0,95,5,116,4,131,0, + 124,0,95,6,100,5,83,0,41,6,122,154,73,110,105,116, + 105,97,108,105,122,101,32,119,105,116,104,32,116,104,101,32, + 112,97,116,104,32,116,111,32,115,101,97,114,99,104,32,111, + 110,32,97,110,100,32,97,32,118,97,114,105,97,98,108,101, + 32,110,117,109,98,101,114,32,111,102,10,32,32,32,32,32, + 32,32,32,50,45,116,117,112,108,101,115,32,99,111,110,116, + 97,105,110,105,110,103,32,116,104,101,32,108,111,97,100,101, + 114,32,97,110,100,32,116,104,101,32,102,105,108,101,32,115, + 117,102,102,105,120,101,115,32,116,104,101,32,108,111,97,100, + 101,114,10,32,32,32,32,32,32,32,32,114,101,99,111,103, + 110,105,122,101,115,46,99,1,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,51,0,0,0,115,22,0,0,0, + 124,0,93,14,125,1,124,1,136,0,102,2,86,0,1,0, + 113,2,100,0,83,0,41,1,78,114,2,0,0,0,41,2, + 114,27,0,0,0,114,241,0,0,0,41,1,114,128,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,243,0,0,0, + 94,5,0,0,115,4,0,0,0,4,0,2,0,122,38,70, + 105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116, + 95,95,46,60,108,111,99,97,108,115,62,46,60,103,101,110, + 101,120,112,114,62,114,63,0,0,0,114,96,0,0,0,78, + 41,7,114,153,0,0,0,218,8,95,108,111,97,100,101,114, + 115,114,39,0,0,0,218,11,95,112,97,116,104,95,109,116, + 105,109,101,218,3,115,101,116,218,11,95,112,97,116,104,95, + 99,97,99,104,101,218,19,95,114,101,108,97,120,101,100,95, + 112,97,116,104,95,99,97,99,104,101,41,5,114,108,0,0, + 0,114,39,0,0,0,218,14,108,111,97,100,101,114,95,100, + 101,116,97,105,108,115,90,7,108,111,97,100,101,114,115,114, + 173,0,0,0,114,2,0,0,0,41,1,114,128,0,0,0, + 114,4,0,0,0,114,191,0,0,0,88,5,0,0,115,16, + 0,0,0,0,4,4,1,12,1,26,1,6,2,10,1,6, + 1,8,1,122,19,70,105,108,101,70,105,110,100,101,114,46, + 95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,0, + 0,1,0,0,0,2,0,0,0,67,0,0,0,115,10,0, + 0,0,100,1,124,0,95,0,100,2,83,0,41,3,122,31, + 73,110,118,97,108,105,100,97,116,101,32,116,104,101,32,100, + 105,114,101,99,116,111,114,121,32,109,116,105,109,101,46,114, + 96,0,0,0,78,41,1,114,26,1,0,0,41,1,114,108, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,11,1,0,0,102,5,0,0,115,2,0,0,0, + 0,2,122,28,70,105,108,101,70,105,110,100,101,114,46,105, + 110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115, + 99,2,0,0,0,0,0,0,0,3,0,0,0,3,0,0, + 0,67,0,0,0,115,42,0,0,0,124,0,160,0,124,1, + 161,1,125,2,124,2,100,1,107,8,114,26,100,1,103,0, + 102,2,83,0,124,2,106,1,124,2,106,2,112,38,103,0, + 102,2,83,0,41,2,122,197,84,114,121,32,116,111,32,102, + 105,110,100,32,97,32,108,111,97,100,101,114,32,102,111,114, + 32,116,104,101,32,115,112,101,99,105,102,105,101,100,32,109, + 111,100,117,108,101,44,32,111,114,32,116,104,101,32,110,97, + 109,101,115,112,97,99,101,10,32,32,32,32,32,32,32,32, + 112,97,99,107,97,103,101,32,112,111,114,116,105,111,110,115, + 46,32,82,101,116,117,114,110,115,32,40,108,111,97,100,101, + 114,44,32,108,105,115,116,45,111,102,45,112,111,114,116,105, + 111,110,115,41,46,10,10,32,32,32,32,32,32,32,32,84, + 104,105,115,32,109,101,116,104,111,100,32,105,115,32,100,101, + 112,114,101,99,97,116,101,100,46,32,32,85,115,101,32,102, + 105,110,100,95,115,112,101,99,40,41,32,105,110,115,116,101, + 97,100,46,10,10,32,32,32,32,32,32,32,32,78,41,3, + 114,187,0,0,0,114,128,0,0,0,114,163,0,0,0,41, + 3,114,108,0,0,0,114,127,0,0,0,114,171,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, + 125,0,0,0,108,5,0,0,115,8,0,0,0,0,7,10, + 1,8,1,8,1,122,22,70,105,108,101,70,105,110,100,101, + 114,46,102,105,110,100,95,108,111,97,100,101,114,99,6,0, + 0,0,0,0,0,0,7,0,0,0,6,0,0,0,67,0, + 0,0,115,26,0,0,0,124,1,124,2,124,3,131,2,125, + 6,116,0,124,2,124,3,124,6,124,4,100,1,141,4,83, + 0,41,2,78,41,2,114,128,0,0,0,114,163,0,0,0, + 41,1,114,174,0,0,0,41,7,114,108,0,0,0,114,172, + 0,0,0,114,127,0,0,0,114,39,0,0,0,90,4,115, + 109,115,108,114,186,0,0,0,114,128,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,23,1,0, + 0,120,5,0,0,115,8,0,0,0,0,1,10,1,8,1, + 2,255,122,20,70,105,108,101,70,105,110,100,101,114,46,95, + 103,101,116,95,115,112,101,99,78,99,3,0,0,0,0,0, + 0,0,14,0,0,0,8,0,0,0,67,0,0,0,115,102, + 1,0,0,100,1,125,3,124,1,160,0,100,2,161,1,100, + 3,25,0,125,4,122,24,116,1,124,0,106,2,112,34,116, + 3,160,4,161,0,131,1,106,5,125,5,87,0,110,24,4, + 0,116,6,107,10,114,66,1,0,1,0,1,0,100,4,125, + 5,89,0,110,2,88,0,124,5,124,0,106,7,107,3,114, + 92,124,0,160,8,161,0,1,0,124,5,124,0,95,7,116, + 9,131,0,114,114,124,0,106,10,125,6,124,4,160,11,161, + 0,125,7,110,10,124,0,106,12,125,6,124,4,125,7,124, + 7,124,6,107,6,114,218,116,13,124,0,106,2,124,4,131, + 2,125,8,124,0,106,14,68,0,93,58,92,2,125,9,125, + 10,100,5,124,9,23,0,125,11,116,13,124,8,124,11,131, + 2,125,12,116,15,124,12,131,1,114,208,124,0,160,16,124, + 10,124,1,124,12,124,8,103,1,124,2,161,5,2,0,1, + 0,83,0,113,150,116,17,124,8,131,1,125,3,124,0,106, + 14,68,0,93,86,92,2,125,9,125,10,116,13,124,0,106, + 2,124,4,124,9,23,0,131,2,125,12,116,18,106,19,100, + 6,124,12,100,3,100,7,141,3,1,0,124,7,124,9,23, + 0,124,6,107,6,144,1,114,54,116,15,124,12,131,1,144, + 1,114,54,124,0,160,16,124,10,124,1,124,12,100,8,124, + 2,161,5,2,0,1,0,83,0,113,224,124,3,144,1,114, + 98,116,18,160,19,100,9,124,8,161,2,1,0,116,18,160, + 20,124,1,100,8,161,2,125,13,124,8,103,1,124,13,95, + 21,124,13,83,0,100,8,83,0,41,10,122,111,84,114,121, + 32,116,111,32,102,105,110,100,32,97,32,115,112,101,99,32, + 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, + 100,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, + 32,32,32,82,101,116,117,114,110,115,32,116,104,101,32,109, + 97,116,99,104,105,110,103,32,115,112,101,99,44,32,111,114, + 32,78,111,110,101,32,105,102,32,110,111,116,32,102,111,117, + 110,100,46,10,32,32,32,32,32,32,32,32,70,114,63,0, + 0,0,114,23,0,0,0,114,96,0,0,0,114,191,0,0, + 0,122,9,116,114,121,105,110,103,32,123,125,41,1,90,9, + 118,101,114,98,111,115,105,116,121,78,122,25,112,111,115,115, + 105,98,108,101,32,110,97,109,101,115,112,97,99,101,32,102, + 111,114,32,123,125,41,22,114,36,0,0,0,114,43,0,0, + 0,114,39,0,0,0,114,1,0,0,0,114,49,0,0,0, + 114,235,0,0,0,114,44,0,0,0,114,26,1,0,0,218, + 11,95,102,105,108,108,95,99,97,99,104,101,114,5,0,0, + 0,114,29,1,0,0,114,97,0,0,0,114,28,1,0,0, + 114,33,0,0,0,114,25,1,0,0,114,48,0,0,0,114, + 23,1,0,0,114,50,0,0,0,114,122,0,0,0,114,136, + 0,0,0,114,167,0,0,0,114,163,0,0,0,41,14,114, + 108,0,0,0,114,127,0,0,0,114,186,0,0,0,90,12, + 105,115,95,110,97,109,101,115,112,97,99,101,90,11,116,97, + 105,108,95,109,111,100,117,108,101,114,155,0,0,0,90,5, + 99,97,99,104,101,90,12,99,97,99,104,101,95,109,111,100, + 117,108,101,90,9,98,97,115,101,95,112,97,116,104,114,241, + 0,0,0,114,172,0,0,0,90,13,105,110,105,116,95,102, + 105,108,101,110,97,109,101,90,9,102,117,108,108,95,112,97, + 116,104,114,171,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,187,0,0,0,125,5,0,0,115, + 74,0,0,0,0,5,4,1,14,1,2,1,24,1,14,1, + 10,1,10,1,8,1,6,2,6,1,6,1,10,2,6,1, + 4,2,8,1,12,1,14,1,8,1,10,1,8,1,26,4, + 8,2,14,1,16,1,16,1,14,1,10,1,10,1,2,0, + 2,255,10,2,6,1,12,1,12,1,8,1,4,1,122,20, + 70,105,108,101,70,105,110,100,101,114,46,102,105,110,100,95, + 115,112,101,99,99,1,0,0,0,0,0,0,0,9,0,0, + 0,10,0,0,0,67,0,0,0,115,190,0,0,0,124,0, + 106,0,125,1,122,22,116,1,160,2,124,1,112,22,116,1, + 160,3,161,0,161,1,125,2,87,0,110,30,4,0,116,4, + 116,5,116,6,102,3,107,10,114,58,1,0,1,0,1,0, + 103,0,125,2,89,0,110,2,88,0,116,7,106,8,160,9, + 100,1,161,1,115,84,116,10,124,2,131,1,124,0,95,11, + 110,74,116,10,131,0,125,3,124,2,68,0,93,56,125,4, + 124,4,160,12,100,2,161,1,92,3,125,5,125,6,125,7, + 124,6,114,136,100,3,160,13,124,5,124,7,160,14,161,0, + 161,2,125,8,110,4,124,5,125,8,124,3,160,15,124,8, + 161,1,1,0,113,94,124,3,124,0,95,11,116,7,106,8, + 160,9,116,16,161,1,114,186,100,4,100,5,132,0,124,2, + 68,0,131,1,124,0,95,17,100,6,83,0,41,7,122,68, + 70,105,108,108,32,116,104,101,32,99,97,99,104,101,32,111, + 102,32,112,111,116,101,110,116,105,97,108,32,109,111,100,117, + 108,101,115,32,97,110,100,32,112,97,99,107,97,103,101,115, + 32,102,111,114,32,116,104,105,115,32,100,105,114,101,99,116, + 111,114,121,46,114,0,0,0,0,114,63,0,0,0,122,5, + 123,125,46,123,125,99,1,0,0,0,0,0,0,0,2,0, + 0,0,4,0,0,0,83,0,0,0,115,20,0,0,0,104, + 0,124,0,93,12,125,1,124,1,160,0,161,0,146,2,113, + 4,83,0,114,2,0,0,0,41,1,114,97,0,0,0,41, + 2,114,27,0,0,0,90,2,102,110,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,218,9,60,115,101,116,99, + 111,109,112,62,202,5,0,0,115,4,0,0,0,6,0,2, + 0,122,41,70,105,108,101,70,105,110,100,101,114,46,95,102, + 105,108,108,95,99,97,99,104,101,46,60,108,111,99,97,108, + 115,62,46,60,115,101,116,99,111,109,112,62,78,41,18,114, + 39,0,0,0,114,1,0,0,0,114,232,0,0,0,114,49, + 0,0,0,114,229,0,0,0,218,15,80,101,114,109,105,115, + 115,105,111,110,69,114,114,111,114,218,18,78,111,116,65,68, + 105,114,101,99,116,111,114,121,69,114,114,111,114,114,6,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,27,1,0, + 0,114,28,1,0,0,114,92,0,0,0,114,54,0,0,0, + 114,97,0,0,0,218,3,97,100,100,114,9,0,0,0,114, + 29,1,0,0,41,9,114,108,0,0,0,114,39,0,0,0, + 114,233,0,0,0,90,21,108,111,119,101,114,95,115,117,102, + 102,105,120,95,99,111,110,116,101,110,116,115,114,6,1,0, + 0,114,106,0,0,0,114,253,0,0,0,114,241,0,0,0, + 90,8,110,101,119,95,110,97,109,101,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,31,1,0,0,173,5, + 0,0,115,34,0,0,0,0,2,6,1,2,1,22,1,20, + 3,10,3,12,1,12,7,6,1,8,1,16,1,4,1,18, + 2,4,1,12,1,6,1,12,1,122,22,70,105,108,101,70, + 105,110,100,101,114,46,95,102,105,108,108,95,99,97,99,104, + 101,99,1,0,0,0,0,0,0,0,3,0,0,0,3,0, + 0,0,7,0,0,0,115,18,0,0,0,135,0,135,1,102, + 2,100,1,100,2,132,8,125,2,124,2,83,0,41,3,97, + 20,1,0,0,65,32,99,108,97,115,115,32,109,101,116,104, + 111,100,32,119,104,105,99,104,32,114,101,116,117,114,110,115, + 32,97,32,99,108,111,115,117,114,101,32,116,111,32,117,115, + 101,32,111,110,32,115,121,115,46,112,97,116,104,95,104,111, + 111,107,10,32,32,32,32,32,32,32,32,119,104,105,99,104, + 32,119,105,108,108,32,114,101,116,117,114,110,32,97,110,32, + 105,110,115,116,97,110,99,101,32,117,115,105,110,103,32,116, + 104,101,32,115,112,101,99,105,102,105,101,100,32,108,111,97, + 100,101,114,115,32,97,110,100,32,116,104,101,32,112,97,116, + 104,10,32,32,32,32,32,32,32,32,99,97,108,108,101,100, + 32,111,110,32,116,104,101,32,99,108,111,115,117,114,101,46, + 10,10,32,32,32,32,32,32,32,32,73,102,32,116,104,101, + 32,112,97,116,104,32,99,97,108,108,101,100,32,111,110,32, + 116,104,101,32,99,108,111,115,117,114,101,32,105,115,32,110, + 111,116,32,97,32,100,105,114,101,99,116,111,114,121,44,32, + 73,109,112,111,114,116,69,114,114,111,114,32,105,115,10,32, + 32,32,32,32,32,32,32,114,97,105,115,101,100,46,10,10, + 32,32,32,32,32,32,32,32,99,1,0,0,0,0,0,0, + 0,1,0,0,0,4,0,0,0,19,0,0,0,115,34,0, + 0,0,116,0,124,0,131,1,115,20,116,1,100,1,124,0, + 100,2,141,2,130,1,136,0,124,0,102,1,136,1,158,2, + 142,0,83,0,41,3,122,45,80,97,116,104,32,104,111,111, + 107,32,102,111,114,32,105,109,112,111,114,116,108,105,98,46, + 109,97,99,104,105,110,101,114,121,46,70,105,108,101,70,105, + 110,100,101,114,46,122,30,111,110,108,121,32,100,105,114,101, + 99,116,111,114,105,101,115,32,97,114,101,32,115,117,112,112, + 111,114,116,101,100,41,1,114,39,0,0,0,41,2,114,50, + 0,0,0,114,107,0,0,0,41,1,114,39,0,0,0,41, + 2,114,177,0,0,0,114,30,1,0,0,114,2,0,0,0, + 114,4,0,0,0,218,24,112,97,116,104,95,104,111,111,107, + 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,214, + 5,0,0,115,6,0,0,0,0,2,8,1,12,1,122,54, + 70,105,108,101,70,105,110,100,101,114,46,112,97,116,104,95, + 104,111,111,107,46,60,108,111,99,97,108,115,62,46,112,97, + 116,104,95,104,111,111,107,95,102,111,114,95,70,105,108,101, + 70,105,110,100,101,114,114,2,0,0,0,41,3,114,177,0, + 0,0,114,30,1,0,0,114,36,1,0,0,114,2,0,0, + 0,41,2,114,177,0,0,0,114,30,1,0,0,114,4,0, + 0,0,218,9,112,97,116,104,95,104,111,111,107,204,5,0, + 0,115,4,0,0,0,0,10,14,6,122,20,70,105,108,101, + 70,105,110,100,101,114,46,112,97,116,104,95,104,111,111,107, + 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, + 0,67,0,0,0,115,12,0,0,0,100,1,160,0,124,0, + 106,1,161,1,83,0,41,2,78,122,16,70,105,108,101,70, + 105,110,100,101,114,40,123,33,114,125,41,41,2,114,54,0, + 0,0,114,39,0,0,0,41,1,114,108,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,114,5,1, + 0,0,222,5,0,0,115,2,0,0,0,0,1,122,19,70, + 105,108,101,70,105,110,100,101,114,46,95,95,114,101,112,114, + 95,95,41,1,78,41,15,114,113,0,0,0,114,112,0,0, + 0,114,114,0,0,0,114,115,0,0,0,114,191,0,0,0, + 114,11,1,0,0,114,131,0,0,0,114,188,0,0,0,114, + 125,0,0,0,114,23,1,0,0,114,187,0,0,0,114,31, + 1,0,0,114,189,0,0,0,114,37,1,0,0,114,5,1, + 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,24,1,0,0,79,5,0,0,115, + 20,0,0,0,8,7,4,2,8,14,8,4,4,2,8,12, + 8,5,10,48,8,31,12,18,114,24,1,0,0,99,4,0, + 0,0,0,0,0,0,6,0,0,0,8,0,0,0,67,0, + 0,0,115,146,0,0,0,124,0,160,0,100,1,161,1,125, + 4,124,0,160,0,100,2,161,1,125,5,124,4,115,66,124, + 5,114,36,124,5,106,1,125,4,110,30,124,2,124,3,107, + 2,114,56,116,2,124,1,124,2,131,2,125,4,110,10,116, + 3,124,1,124,2,131,2,125,4,124,5,115,84,116,4,124, + 1,124,2,124,4,100,3,141,3,125,5,122,36,124,5,124, + 0,100,2,60,0,124,4,124,0,100,1,60,0,124,2,124, + 0,100,4,60,0,124,3,124,0,100,5,60,0,87,0,110, + 20,4,0,116,5,107,10,114,140,1,0,1,0,1,0,89, + 0,110,2,88,0,100,0,83,0,41,6,78,218,10,95,95, + 108,111,97,100,101,114,95,95,218,8,95,95,115,112,101,99, + 95,95,41,1,114,128,0,0,0,90,8,95,95,102,105,108, + 101,95,95,90,10,95,95,99,97,99,104,101,100,95,95,41, + 6,218,3,103,101,116,114,128,0,0,0,114,239,0,0,0, + 114,234,0,0,0,114,174,0,0,0,218,9,69,120,99,101, + 112,116,105,111,110,41,6,90,2,110,115,114,106,0,0,0, + 90,8,112,97,116,104,110,97,109,101,90,9,99,112,97,116, + 104,110,97,109,101,114,128,0,0,0,114,171,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,14, + 95,102,105,120,95,117,112,95,109,111,100,117,108,101,228,5, + 0,0,115,34,0,0,0,0,2,10,1,10,1,4,1,4, + 1,8,1,8,1,12,2,10,1,4,1,14,1,2,1,8, + 1,8,1,8,1,12,1,14,2,114,42,1,0,0,99,0, + 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, + 0,0,0,115,38,0,0,0,116,0,116,1,160,2,161,0, + 102,2,125,0,116,3,116,4,102,2,125,1,116,5,116,6, + 102,2,125,2,124,0,124,1,124,2,103,3,83,0,41,1, + 122,95,82,101,116,117,114,110,115,32,97,32,108,105,115,116, + 32,111,102,32,102,105,108,101,45,98,97,115,101,100,32,109, + 111,100,117,108,101,32,108,111,97,100,101,114,115,46,10,10, + 32,32,32,32,69,97,99,104,32,105,116,101,109,32,105,115, + 32,97,32,116,117,112,108,101,32,40,108,111,97,100,101,114, + 44,32,115,117,102,102,105,120,101,115,41,46,10,32,32,32, + 32,41,7,114,240,0,0,0,114,149,0,0,0,218,18,101, + 120,116,101,110,115,105,111,110,95,115,117,102,102,105,120,101, + 115,114,234,0,0,0,114,93,0,0,0,114,239,0,0,0, + 114,80,0,0,0,41,3,90,10,101,120,116,101,110,115,105, + 111,110,115,90,6,115,111,117,114,99,101,90,8,98,121,116, + 101,99,111,100,101,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,168,0,0,0,251,5,0,0,115,8,0, + 0,0,0,5,12,1,8,1,8,1,114,168,0,0,0,99, + 1,0,0,0,0,0,0,0,12,0,0,0,9,0,0,0, + 67,0,0,0,115,178,1,0,0,124,0,97,0,116,0,106, + 1,97,1,116,0,106,2,97,2,116,1,106,3,116,4,25, + 0,125,1,100,1,68,0,93,48,125,2,124,2,116,1,106, + 3,107,7,114,56,116,0,160,5,124,2,161,1,125,3,110, + 10,116,1,106,3,124,2,25,0,125,3,116,6,124,1,124, + 2,124,3,131,3,1,0,113,30,100,2,100,3,103,1,102, + 2,100,4,100,5,100,3,103,2,102,2,102,2,125,4,124, + 4,68,0,93,110,92,2,125,5,125,6,116,7,100,6,100, + 7,132,0,124,6,68,0,131,1,131,1,115,136,116,8,130, + 1,124,6,100,8,25,0,125,7,124,5,116,1,106,3,107, + 6,114,170,116,1,106,3,124,5,25,0,125,8,1,0,113, + 226,113,106,122,20,116,0,160,5,124,5,161,1,125,8,87, + 0,1,0,113,226,87,0,113,106,4,0,116,9,107,10,114, + 214,1,0,1,0,1,0,89,0,113,106,89,0,113,106,88, + 0,113,106,116,9,100,9,131,1,130,1,116,6,124,1,100, + 10,124,8,131,3,1,0,116,6,124,1,100,11,124,7,131, + 3,1,0,116,6,124,1,100,12,100,13,160,10,124,6,161, + 1,131,3,1,0,116,6,124,1,100,14,100,15,100,16,132, + 0,124,6,68,0,131,1,131,3,1,0,116,0,160,5,100, + 17,161,1,125,9,116,6,124,1,100,17,124,9,131,3,1, + 0,116,0,160,5,100,18,161,1,125,10,116,6,124,1,100, + 18,124,10,131,3,1,0,124,5,100,4,107,2,144,1,114, + 110,116,0,160,5,100,19,161,1,125,11,116,6,124,1,100, + 20,124,11,131,3,1,0,116,6,124,1,100,21,116,11,131, + 0,131,3,1,0,116,12,160,13,116,2,160,14,161,0,161, + 1,1,0,124,5,100,4,107,2,144,1,114,174,116,15,160, + 16,100,22,161,1,1,0,100,23,116,12,107,6,144,1,114, + 174,100,24,116,17,95,18,100,25,83,0,41,26,122,205,83, + 101,116,117,112,32,116,104,101,32,112,97,116,104,45,98,97, + 115,101,100,32,105,109,112,111,114,116,101,114,115,32,102,111, + 114,32,105,109,112,111,114,116,108,105,98,32,98,121,32,105, + 109,112,111,114,116,105,110,103,32,110,101,101,100,101,100,10, + 32,32,32,32,98,117,105,108,116,45,105,110,32,109,111,100, + 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, + 110,103,32,116,104,101,109,32,105,110,116,111,32,116,104,101, + 32,103,108,111,98,97,108,32,110,97,109,101,115,112,97,99, + 101,46,10,10,32,32,32,32,79,116,104,101,114,32,99,111, + 109,112,111,110,101,110,116,115,32,97,114,101,32,101,120,116, + 114,97,99,116,101,100,32,102,114,111,109,32,116,104,101,32, + 99,111,114,101,32,98,111,111,116,115,116,114,97,112,32,109, + 111,100,117,108,101,46,10,10,32,32,32,32,41,4,114,56, + 0,0,0,114,66,0,0,0,218,8,98,117,105,108,116,105, + 110,115,114,146,0,0,0,90,5,112,111,115,105,120,250,1, + 47,90,2,110,116,250,1,92,99,1,0,0,0,0,0,0, + 0,2,0,0,0,3,0,0,0,115,0,0,0,115,26,0, + 0,0,124,0,93,18,125,1,116,0,124,1,131,1,100,0, + 107,2,86,0,1,0,113,2,100,1,83,0,41,2,114,34, + 0,0,0,78,41,1,114,18,0,0,0,41,2,114,27,0, + 0,0,114,86,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,243,0,0,0,31,6,0,0,115, + 4,0,0,0,4,0,2,0,122,25,95,115,101,116,117,112, + 46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,120, + 112,114,62,114,64,0,0,0,122,30,105,109,112,111,114,116, + 108,105,98,32,114,101,113,117,105,114,101,115,32,112,111,115, + 105,120,32,111,114,32,110,116,114,1,0,0,0,114,30,0, + 0,0,114,26,0,0,0,114,35,0,0,0,114,52,0,0, + 0,99,1,0,0,0,0,0,0,0,2,0,0,0,4,0, + 0,0,83,0,0,0,115,22,0,0,0,104,0,124,0,93, + 14,125,1,100,0,124,1,155,0,157,2,146,2,113,4,83, + 0,41,1,114,65,0,0,0,114,2,0,0,0,41,2,114, + 27,0,0,0,218,1,115,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,32,1,0,0,47,6,0,0,115, + 4,0,0,0,6,0,2,0,122,25,95,115,101,116,117,112, + 46,60,108,111,99,97,108,115,62,46,60,115,101,116,99,111, + 109,112,62,90,7,95,116,104,114,101,97,100,90,8,95,119, + 101,97,107,114,101,102,90,6,119,105,110,114,101,103,114,176, + 0,0,0,114,5,0,0,0,122,4,46,112,121,119,122,6, + 95,100,46,112,121,100,84,78,41,19,114,122,0,0,0,114, + 6,0,0,0,114,149,0,0,0,114,255,0,0,0,114,113, + 0,0,0,90,18,95,98,117,105,108,116,105,110,95,102,114, + 111,109,95,110,97,109,101,114,117,0,0,0,218,3,97,108, + 108,114,19,0,0,0,114,107,0,0,0,114,31,0,0,0, + 114,11,0,0,0,114,245,0,0,0,114,153,0,0,0,114, + 43,1,0,0,114,93,0,0,0,114,170,0,0,0,114,175, + 0,0,0,114,179,0,0,0,41,12,218,17,95,98,111,111, + 116,115,116,114,97,112,95,109,111,100,117,108,101,90,11,115, + 101,108,102,95,109,111,100,117,108,101,90,12,98,117,105,108, + 116,105,110,95,110,97,109,101,90,14,98,117,105,108,116,105, + 110,95,109,111,100,117,108,101,90,10,111,115,95,100,101,116, + 97,105,108,115,90,10,98,117,105,108,116,105,110,95,111,115, + 114,26,0,0,0,114,30,0,0,0,90,9,111,115,95,109, + 111,100,117,108,101,90,13,116,104,114,101,97,100,95,109,111, + 100,117,108,101,90,14,119,101,97,107,114,101,102,95,109,111, + 100,117,108,101,90,13,119,105,110,114,101,103,95,109,111,100, + 117,108,101,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,218,6,95,115,101,116,117,112,6,6,0,0,115,78, + 0,0,0,0,8,4,1,6,1,6,3,10,1,8,1,10, + 1,12,2,10,1,14,3,22,1,12,2,22,1,8,1,10, + 1,10,1,6,2,2,1,10,1,10,1,14,1,12,2,8, + 1,12,1,12,1,18,1,22,3,10,1,12,3,10,1,12, + 3,10,1,10,1,12,3,14,1,14,1,10,1,10,1,10, + 1,114,50,1,0,0,99,1,0,0,0,0,0,0,0,2, + 0,0,0,4,0,0,0,67,0,0,0,115,50,0,0,0, + 116,0,124,0,131,1,1,0,116,1,131,0,125,1,116,2, + 106,3,160,4,116,5,106,6,124,1,142,0,103,1,161,1, + 1,0,116,2,106,7,160,8,116,9,161,1,1,0,100,1, + 83,0,41,2,122,41,73,110,115,116,97,108,108,32,116,104, + 101,32,112,97,116,104,45,98,97,115,101,100,32,105,109,112, + 111,114,116,32,99,111,109,112,111,110,101,110,116,115,46,78, + 41,10,114,50,1,0,0,114,168,0,0,0,114,6,0,0, + 0,114,16,1,0,0,114,153,0,0,0,114,24,1,0,0, + 114,37,1,0,0,218,9,109,101,116,97,95,112,97,116,104, + 114,170,0,0,0,114,10,1,0,0,41,2,114,49,1,0, + 0,90,17,115,117,112,112,111,114,116,101,100,95,108,111,97, + 100,101,114,115,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,8,95,105,110,115,116,97,108,108,71,6,0, + 0,115,8,0,0,0,0,2,8,1,6,1,20,1,114,52, + 1,0,0,41,63,114,115,0,0,0,114,10,0,0,0,90, + 37,95,67,65,83,69,95,73,78,83,69,78,83,73,84,73, + 86,69,95,80,76,65,84,70,79,82,77,83,95,66,89,84, + 69,83,95,75,69,89,114,9,0,0,0,114,11,0,0,0, + 114,17,0,0,0,114,22,0,0,0,114,24,0,0,0,114, + 33,0,0,0,114,42,0,0,0,114,43,0,0,0,114,47, + 0,0,0,114,48,0,0,0,114,50,0,0,0,114,53,0, + 0,0,114,61,0,0,0,218,4,116,121,112,101,218,8,95, + 95,99,111,100,101,95,95,114,148,0,0,0,114,15,0,0, + 0,114,135,0,0,0,114,14,0,0,0,114,20,0,0,0, + 114,214,0,0,0,114,83,0,0,0,114,79,0,0,0,114, + 93,0,0,0,114,80,0,0,0,90,23,68,69,66,85,71, + 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, + 69,83,90,27,79,80,84,73,77,73,90,69,68,95,66,89, + 84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,114, + 89,0,0,0,114,94,0,0,0,114,100,0,0,0,114,103, + 0,0,0,114,105,0,0,0,114,124,0,0,0,114,131,0, + 0,0,114,139,0,0,0,114,143,0,0,0,114,145,0,0, + 0,114,151,0,0,0,114,156,0,0,0,114,157,0,0,0, + 114,162,0,0,0,218,6,111,98,106,101,99,116,114,169,0, + 0,0,114,174,0,0,0,114,175,0,0,0,114,190,0,0, + 0,114,200,0,0,0,114,217,0,0,0,114,234,0,0,0, + 114,239,0,0,0,114,245,0,0,0,114,240,0,0,0,114, + 246,0,0,0,114,8,1,0,0,114,10,1,0,0,114,24, + 1,0,0,114,42,1,0,0,114,168,0,0,0,114,50,1, + 0,0,114,52,1,0,0,114,2,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,218,8,60,109,111, + 100,117,108,101,62,8,0,0,0,115,126,0,0,0,4,15, + 4,1,4,1,2,1,2,255,4,4,8,17,8,5,8,5, + 8,6,8,6,8,12,8,10,8,9,8,5,8,7,8,9, + 12,22,10,127,0,7,16,1,12,2,4,1,4,2,6,2, + 6,2,8,2,18,71,8,40,8,19,8,12,8,12,8,28, + 8,17,8,33,8,28,8,24,16,13,14,10,12,11,8,14, + 6,3,6,1,2,255,12,68,14,64,14,29,16,127,0,17, + 14,68,18,45,18,26,4,3,18,53,14,60,14,42,14,127, + 0,7,14,127,0,22,12,23,8,11,8,65, }; From webhook-mailer at python.org Fri Oct 26 18:58:35 2018 From: webhook-mailer at python.org (Brett Cannon) Date: Fri, 26 Oct 2018 22:58:35 -0000 Subject: [Python-checkins] bpo-35042: Use the :pep: role where a PEP is specified (#10036) Message-ID: https://github.com/python/cpython/commit/12e696b4f071ffe0d585b7f0d0d8020fd328bfdd commit: 12e696b4f071ffe0d585b7f0d0d8020fd328bfdd branch: master author: St?phane Wirtel committer: Brett Cannon date: 2018-10-26T15:58:26-07:00 summary: bpo-35042: Use the :pep: role where a PEP is specified (#10036) files: A Misc/NEWS.d/next/Documentation/2018-10-22-14-17-57.bpo-35042.1UGv1a.rst M Doc/distutils/apiref.rst M Doc/howto/clinic.rst M Doc/library/abc.rst M Doc/library/pkgutil.rst M Doc/library/test.rst M Doc/library/typing.rst M Doc/library/wsgiref.rst M Doc/library/zipimport.rst M Doc/whatsnew/2.0.rst M Doc/whatsnew/2.1.rst M Doc/whatsnew/2.5.rst M Doc/whatsnew/3.3.rst M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.0a2.rst M Misc/NEWS.d/3.5.0a4.rst M Misc/NEWS.d/3.5.0b2.rst M Misc/NEWS.d/3.5.0b3.rst M Misc/NEWS.d/3.5.0b4.rst M Misc/NEWS.d/3.5.0rc3.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.6.0a1.rst M Misc/NEWS.d/3.6.0a2.rst M Misc/NEWS.d/3.6.0a3.rst M Misc/NEWS.d/3.6.0a4.rst M Misc/NEWS.d/3.6.0b1.rst M Misc/NEWS.d/3.6.0rc1.rst M Misc/NEWS.d/3.6.1rc1.rst M Misc/NEWS.d/3.6.3rc1.rst M Misc/NEWS.d/3.6.6rc1.rst M Misc/NEWS.d/3.7.0a1.rst M Misc/NEWS.d/3.7.0a2.rst M Misc/NEWS.d/3.7.0a3.rst M Misc/NEWS.d/3.7.0b4.rst M Misc/NEWS.d/3.7.0b5.rst M Misc/NEWS.d/3.7.0rc1.rst M Misc/NEWS.d/next/Documentation/2018-05-23-11-59-51.bpo-32436.S1LGPa.rst M Misc/NEWS.d/next/Documentation/2018-06-08-23-46-01.bpo-33409.r4z9MM.rst M Misc/NEWS.d/next/Library/2018-04-04-23-41-30.bpo-33224.pyR0jB.rst diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index 3c89468220a4..9d5c2ab696ff 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -1393,11 +1393,11 @@ This module provides the :class:`FileList` class, used for poking about the filesystem and building lists of files. -:mod:`distutils.log` --- Simple PEP 282-style logging -===================================================== +:mod:`distutils.log` --- Simple :pep:`282`-style logging +======================================================== .. module:: distutils.log - :synopsis: A simple logging mechanism, 282-style + :synopsis: A simple logging mechanism, :pep:`282`-style :mod:`distutils.spawn` --- Spawn a sub-process diff --git a/Doc/howto/clinic.rst b/Doc/howto/clinic.rst index c75c31c98319..5b2457a1682b 100644 --- a/Doc/howto/clinic.rst +++ b/Doc/howto/clinic.rst @@ -765,7 +765,7 @@ All Argument Clinic converters accept the following arguments: ``annotation`` The annotation value for this parameter. Not currently supported, - because PEP 8 mandates that the Python library may not use + because :pep:`8` mandates that the Python library may not use annotations. In addition, some converters accept additional arguments. Here is a list diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst index 70710761a395..2aba02f8cb49 100644 --- a/Doc/library/abc.rst +++ b/Doc/library/abc.rst @@ -2,7 +2,7 @@ ==================================== .. module:: abc - :synopsis: Abstract base classes according to PEP 3119. + :synopsis: Abstract base classes according to :pep:`3119`. .. moduleauthor:: Guido van Rossum .. sectionauthor:: Georg Brandl diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst index fba0ea641d92..78a515734585 100644 --- a/Doc/library/pkgutil.rst +++ b/Doc/library/pkgutil.rst @@ -63,7 +63,7 @@ support. .. deprecated:: 3.3 This emulation is no longer needed, as the standard import mechanism - is now fully PEP 302 compliant and available in :mod:`importlib`. + is now fully :pep:`302` compliant and available in :mod:`importlib`. .. class:: ImpLoader(fullname, file, filename, etc) @@ -72,7 +72,7 @@ support. .. deprecated:: 3.3 This emulation is no longer needed, as the standard import mechanism - is now fully PEP 302 compliant and available in :mod:`importlib`. + is now fully :pep:`302` compliant and available in :mod:`importlib`. .. function:: find_loader(fullname) @@ -86,7 +86,7 @@ support. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying - on the package internal PEP 302 import emulation. + on the package internal :pep:`302` import emulation. .. versionchanged:: 3.4 Updated to be based on :pep:`451` @@ -103,7 +103,7 @@ support. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying - on the package internal PEP 302 import emulation. + on the package internal :pep:`302` import emulation. .. function:: get_loader(module_or_name) @@ -118,7 +118,7 @@ support. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying - on the package internal PEP 302 import emulation. + on the package internal :pep:`302` import emulation. .. versionchanged:: 3.4 Updated to be based on :pep:`451` @@ -139,7 +139,7 @@ support. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying - on the package internal PEP 302 import emulation. + on the package internal :pep:`302` import emulation. .. function:: iter_modules(path=None, prefix='') @@ -160,7 +160,7 @@ support. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying - on the package internal PEP 302 import emulation. + on the package internal :pep:`302` import emulation. .. function:: walk_packages(path=None, prefix='', onerror=None) @@ -199,7 +199,7 @@ support. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying - on the package internal PEP 302 import emulation. + on the package internal :pep:`302` import emulation. .. function:: get_data(package, resource) diff --git a/Doc/library/test.rst b/Doc/library/test.rst index 95d7f54ba442..6a10babe259c 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -392,7 +392,7 @@ The :mod:`test.support` module defines the following functions: .. function:: make_legacy_pyc(source) - Move a PEP 3147/488 pyc file to its legacy pyc location and return the file + Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return the file system path to the legacy pyc file. The *source* value is the file system path to the source file. It does not need to exist, however the PEP 3147/488 pyc file must exist. diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 9861da8d7073..06c1b8526c40 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -2,7 +2,7 @@ ======================================== .. module:: typing - :synopsis: Support for type hints (see PEP 484). + :synopsis: Support for type hints (see :pep:`484`). .. versionadded:: 3.5 diff --git a/Doc/library/wsgiref.rst b/Doc/library/wsgiref.rst index e0f745f810b9..ffca1fc8168f 100644 --- a/Doc/library/wsgiref.rst +++ b/Doc/library/wsgiref.rst @@ -739,7 +739,7 @@ input, output, and error streams. .. function:: read_environ() - Transcode CGI variables from ``os.environ`` to PEP 3333 "bytes in unicode" + Transcode CGI variables from ``os.environ`` to :pep:`3333` "bytes in unicode" strings, returning a new dictionary. This function is used by :class:`CGIHandler` and :class:`IISCGIHandler` in place of directly using ``os.environ``, which is not necessarily WSGI-compliant on all platforms diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst index 4fbd0e863c53..aa1831dbc60d 100644 --- a/Doc/library/zipimport.rst +++ b/Doc/library/zipimport.rst @@ -39,8 +39,8 @@ doesn't contain :file:`.pyc` files, importing may be rather slow. :pep:`273` - Import Modules from Zip Archives Written by James C. Ahlstrom, who also provided an implementation. Python 2.3 - follows the specification in PEP 273, but uses an implementation written by Just - van Rossum that uses the import hooks described in PEP 302. + follows the specification in :pep:`273`, but uses an implementation written by Just + van Rossum that uses the import hooks described in :pep:`302`. :pep:`302` - New Import Hooks The PEP to add the import hooks that help this module work. diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst index 5cbf50112385..8c740eefb098 100644 --- a/Doc/whatsnew/2.0.rst +++ b/Doc/whatsnew/2.0.rst @@ -111,7 +111,7 @@ python-dev. Therefore, a relatively formal process has been set up to write Python Enhancement Proposals (PEPs), modelled on the Internet RFC process. PEPs are draft documents that describe a proposed new feature, and are continually revised until the community reaches a consensus, either accepting or rejecting -the proposal. Quoting from the introduction to PEP 1, "PEP Purpose and +the proposal. Quoting from the introduction to :pep:`1`, "PEP Purpose and Guidelines": @@ -127,11 +127,11 @@ Guidelines": that have gone into Python. The PEP author is responsible for building consensus within the community and documenting dissenting opinions. -Read the rest of PEP 1 for the details of the PEP editorial process, style, and +Read the rest of :pep:`1` for the details of the PEP editorial process, style, and format. PEPs are kept in the Python CVS tree on SourceForge, though they're not part of the Python 2.0 distribution, and are also available in HTML form from https://www.python.org/dev/peps/. As of September 2000, there are 25 PEPS, ranging -from PEP 201, "Lockstep Iteration", to PEP 225, "Elementwise/Objectwise +from :pep:`201`, "Lockstep Iteration", to PEP 225, "Elementwise/Objectwise Operators". .. ====================================================================== diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst index 3486cddc05e9..12c028f24180 100644 --- a/Doc/whatsnew/2.1.rst +++ b/Doc/whatsnew/2.1.rst @@ -112,8 +112,8 @@ anyway). Compatibility concerns have led to nested scopes being introduced gradually; in Python 2.1, they aren't enabled by default, but can be turned on within a module -by using a future statement as described in PEP 236. (See the following section -for further discussion of PEP 236.) In Python 2.2, nested scopes will become +by using a future statement as described in :pep:`236`. (See the following section +for further discussion of :pep:`236`.) In Python 2.2, nested scopes will become the default and there will be no way to turn them off, but users will have had all of 2.1's lifetime to fix any breakage resulting from their introduction. @@ -213,7 +213,7 @@ otherwise it will call the appropriate method and can return any Python object. There are also corresponding changes of interest to C programmers; there's a new slot ``tp_richcmp`` in type objects and an API for performing a given rich -comparison. I won't cover the C API here, but will refer you to PEP 207, or to +comparison. I won't cover the C API here, but will refer you to :pep:`207`, or to 2.1's C API documentation, for the full list of related functions. @@ -548,7 +548,7 @@ registering software at the Vaults is optional, and many people don't bother. As a first small step toward fixing the problem, Python software packaged using the Distutils :command:`sdist` command will include a file named :file:`PKG-INFO` containing information about the package such as its name, -version, and author (metadata, in cataloguing terminology). PEP 241 contains +version, and author (metadata, in cataloguing terminology). :pep:`241` contains the full list of fields that can be present in the :file:`PKG-INFO` file. As people began to package their software using Python 2.1, more and more packages will include metadata, making it possible to build automated cataloguing systems @@ -561,7 +561,7 @@ package to a catalog server. You can start creating packages containing :file:`PKG-INFO` even if you're not using Python 2.1, since a new release of the Distutils will be made for users of earlier Python versions. Version 1.0.2 of the Distutils includes the changes -described in PEP 241, as well as various bugfixes and enhancements. It will be +described in :pep:`241`, as well as various bugfixes and enhancements. It will be available from the Distutils SIG at https://www.python.org/community/sigs/current/distutils-sig/. diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst index 79c5a73dcf2b..d70b64205818 100644 --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -256,7 +256,7 @@ Package uploading was implemented by Martin von L?wis and Richard Jones. PEP 328: Absolute and Relative Imports ====================================== -The simpler part of PEP 328 was implemented in Python 2.4: parentheses could now +The simpler part of :pep:`328` was implemented in Python 2.4: parentheses could now be used to enclose the names imported from a module using the ``from ... import ...`` statement, making it easier to import many different names. @@ -529,7 +529,7 @@ chance to run. The syntactic restriction that you couldn't mix :keyword:`yield` statements with a ``try...finally`` suite has therefore been removed. This seems like a minor bit of language trivia, but using generators and ``try...finally`` is actually necessary in order to implement the -:keyword:`with` statement described by PEP 343. I'll look at this new statement +:keyword:`with` statement described by :pep:`343`. I'll look at this new statement in the following section. Another even more esoteric effect of this change: previously, the @@ -1483,7 +1483,7 @@ complete list of changes, or look through the SVN logs for all the details. 2.4, so this completes the removal of the feature. * The :mod:`pkgutil` module, containing various utility functions for finding - packages, was enhanced to support PEP 302's import hooks and now also works for + packages, was enhanced to support :pep:`302`'s import hooks and now also works for packages stored in ZIP-format archives. (Contributed by Phillip J. Eby.) * The pybench benchmark suite by Marc-Andr? Lemburg is now included in the @@ -2043,7 +2043,7 @@ between web servers and Python web applications and is described in :pep:`333`. The :mod:`wsgiref` package is a reference implementation of the WSGI specification. -.. XXX should this be in a PEP 333 section instead? +.. XXX should this be in a :pep:`333` section instead? The package includes a basic HTTP server that will run a WSGI application; this server is useful for debugging but isn't intended for production use. Setting diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 8862b37e0628..ea036840d671 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -217,7 +217,7 @@ exist in parallel; over time, this compatibility should be phased out. On the Python side, there should be no downside to this change. -On the C API side, PEP 393 is fully backward compatible. The legacy API +On the C API side, :pep:`393` is fully backward compatible. The legacy API should remain available at least five years. Applications using the legacy API will not fully benefit of the memory reduction, or - worse - may use a bit more memory, because Python may have to maintain two versions of each @@ -2082,7 +2082,7 @@ Add a new :class:`types.MappingProxyType` class: Read-only proxy of a mapping. The new functions :func:`types.new_class` and :func:`types.prepare_class` provide support -for PEP 3115 compliant dynamic type creation. (:issue:`14588`) +for :pep:`3115` compliant dynamic type creation. (:issue:`14588`) unittest @@ -2396,7 +2396,7 @@ Porting Python code case of working with :term:`path entry finders `. * :mod:`pkgutil` has been converted to use :mod:`importlib` internally. This - eliminates many edge cases where the old behaviour of the PEP 302 import + eliminates many edge cases where the old behaviour of the :pep:`302` import emulation failed to match the behaviour of the real import system. The import emulation itself is still present, but is now deprecated. The :func:`pkgutil.iter_importers` and :func:`pkgutil.walk_packages` functions @@ -2472,7 +2472,7 @@ Porting C code functions using this type are deprecated (but will stay available for at least five years). If you were using low-level Unicode APIs to construct and access unicode objects and you want to benefit of the - memory footprint reduction provided by PEP 393, you have to convert + memory footprint reduction provided by :pep:`393`, you have to convert your code to the new :doc:`Unicode API <../c-api/unicode>`. However, if you only have been using high-level functions such as diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index 7eb8326a012f..31ec21fdd8fd 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -3555,7 +3555,7 @@ created for every test class. .. nonce: kfV0wm .. section: Library -Fix PEP 3118 format strings on ctypes objects with a nontrivial shape. +Fix :pep:`3118` format strings on ctypes objects with a nontrivial shape. .. @@ -4824,7 +4824,7 @@ tests. .. nonce: kqetng .. section: IDLE -Change default paragraph width to 72, the PEP 8 recommendation. +Change default paragraph width to 72, the :pep:`8` recommendation. .. @@ -5759,7 +5759,7 @@ Add support for ``yield from`` to 2to3. .. nonce: dpFbyZ .. section: Tools/Demos -Add support for the PEP 465 matrix multiplication operator to 2to3. +Add support for the :pep:`465` matrix multiplication operator to 2to3. .. diff --git a/Misc/NEWS.d/3.5.0a2.rst b/Misc/NEWS.d/3.5.0a2.rst index b16acdb3822d..861b23ede395 100644 --- a/Misc/NEWS.d/3.5.0a2.rst +++ b/Misc/NEWS.d/3.5.0a2.rst @@ -15,7 +15,7 @@ previous exception. .. nonce: Ks6_2x .. section: Library -New os.scandir() function, part of the PEP 471: "os.scandir() function -- a +New os.scandir() function, part of the :pep:`471`: "os.scandir() function -- a better and faster directory iterator". Patch written by Ben Hoyt. .. @@ -393,7 +393,7 @@ attribute. .. nonce: qBauCy .. section: Windows -Implement PEP 486 - Make the Python Launcher aware of virtual environments. +Implement :pep:`486` - Make the Python Launcher aware of virtual environments. Patch by Paul Moore. .. diff --git a/Misc/NEWS.d/3.5.0a4.rst b/Misc/NEWS.d/3.5.0a4.rst index eb63a834f07f..f60aa0a22d19 100644 --- a/Misc/NEWS.d/3.5.0a4.rst +++ b/Misc/NEWS.d/3.5.0a4.rst @@ -7,7 +7,7 @@ Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include the architecture triplet in the extension name, to make it easy to test builds for different ABIs in the same working tree. Under OS X, the extension name -now includes PEP 3149-style information. +now includes :pep:`3149`-style information. .. @@ -26,7 +26,7 @@ Joe Jevnik. .. nonce: FOXb37 .. section: Core and Builtins -Implement PEP 488: removal of .pyo files. +Implement :pep:`488`: removal of .pyo files. .. @@ -495,7 +495,7 @@ modules already mapped with full name mapping. select.select() is now retried automatically with the recomputed timeout when interrupted by a signal, except if the signal handler raises an -exception. This change is part of the PEP 475. +exception. This change is part of the :pep:`475`. .. diff --git a/Misc/NEWS.d/3.5.0b2.rst b/Misc/NEWS.d/3.5.0b2.rst index 21c75dd23522..43bf4a8b1150 100644 --- a/Misc/NEWS.d/3.5.0b2.rst +++ b/Misc/NEWS.d/3.5.0b2.rst @@ -62,7 +62,7 @@ Fix a crash in the StreamWriter.reset() of CJK codecs. .. nonce: M2rJNs .. section: Library -Add math.isclose() and cmath.isclose() functions as per PEP 485. Contributed +Add math.isclose() and cmath.isclose() functions as per :pep:`485`. Contributed by Chris Barker and Tal Einat. .. diff --git a/Misc/NEWS.d/3.5.0b3.rst b/Misc/NEWS.d/3.5.0b3.rst index bb4cc33cc990..5e981f8badd1 100644 --- a/Misc/NEWS.d/3.5.0b3.rst +++ b/Misc/NEWS.d/3.5.0b3.rst @@ -33,7 +33,7 @@ Add Py_tp_finalize slot for the stable ABI. .. nonce: 2mNeD8 .. section: Core and Builtins -Introduce a distinct type for PEP 492 coroutines; add types.CoroutineType, +Introduce a distinct type for :pep:`492` coroutines; add types.CoroutineType, inspect.getcoroutinestate, inspect.getcoroutinelocals; coroutines no longer use CO_GENERATOR flag; sys.set_coroutine_wrapper works only for 'async def' coroutines; inspect.iscoroutine no longer uses collections.abc.Coroutine, diff --git a/Misc/NEWS.d/3.5.0b4.rst b/Misc/NEWS.d/3.5.0b4.rst index bcc7345d8a7c..51cefe2a1f82 100644 --- a/Misc/NEWS.d/3.5.0b4.rst +++ b/Misc/NEWS.d/3.5.0b4.rst @@ -14,7 +14,7 @@ argument on Linux. .. nonce: bqh6PQ .. section: Core and Builtins -Make PEP 448 dictionary evaluation more consistent. +Make :pep:`448` dictionary evaluation more consistent. .. diff --git a/Misc/NEWS.d/3.5.0rc3.rst b/Misc/NEWS.d/3.5.0rc3.rst index c6976c0f0c28..2f770a01610e 100644 --- a/Misc/NEWS.d/3.5.0rc3.rst +++ b/Misc/NEWS.d/3.5.0rc3.rst @@ -23,7 +23,7 @@ Prevent __class__ assignment to immutable built-in objects. .. nonce: 2gLdfN .. section: Core and Builtins -Fix AST compilation for PEP 448 syntax. +Fix AST compilation for :pep:`448` syntax. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 3d513b3b9af8..23486e31116f 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -300,7 +300,7 @@ Fixed problem with in-place string concatenation and utf-8 cache. .. nonce: tCCgmH .. section: Core and Builtins -Mention PEP 420 in the importlib docs. +Mention :pep:`420` in the importlib docs. .. @@ -423,7 +423,7 @@ A new version of typing.py provides several new classes and features: @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some of the new features are not yet implemented in mypy or other static analyzers). -Also classes for PEP 492 (Awaitable, AsyncIterable, AsyncIterator) have been +Also classes for :pep:`492` (Awaitable, AsyncIterable, AsyncIterator) have been added (in fact they made it into 3.5.1 but were never mentioned). .. @@ -1816,7 +1816,7 @@ Patch by Ammar Askar. .. nonce: MUK0zK .. section: Documentation -Document the new PEP 448 unpacking syntax of 3.5. +Document the new :pep:`448` unpacking syntax of 3.5. .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index bca43c8f708f..3a51fad2472c 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -1402,7 +1402,7 @@ Zijlstra. When an exception is raised within the context being managed by a contextlib.ExitStack() and one of the exit stack generators catches and raises it in a chain, do not re-raise the original exception when exiting, -let the new chained one through. This avoids the PEP 479 bug described in +let the new chained one through. This avoids the :pep:`479` bug described in issue25782. .. diff --git a/Misc/NEWS.d/3.6.0a1.rst b/Misc/NEWS.d/3.6.0a1.rst index 254d36166450..2e259c59c168 100644 --- a/Misc/NEWS.d/3.6.0a1.rst +++ b/Misc/NEWS.d/3.6.0a1.rst @@ -144,7 +144,7 @@ Fix the doc comment for FileFinder.find_spec(). .. nonce: tCCgmH .. section: Core and Builtins -Mention PEP 420 in the importlib docs. +Mention :pep:`420` in the importlib docs. .. @@ -203,7 +203,7 @@ Add tests for reloading namespace packages. .. nonce: CuMWZJ .. section: Core and Builtins -Switch applicable importlib tests to use PEP 451 API. +Switch applicable importlib tests to use :pep:`451` API. .. @@ -782,7 +782,7 @@ Patch from Mark Dickinson. .. nonce: wfyxbB .. section: Core and Builtins -Implement PEP 498 "Literal String Interpolation". This allows you to embed +Implement :pep:`498` "Literal String Interpolation". This allows you to embed expressions inside f-strings, which are converted to normal strings at run time. Given x=3, then f'value={x}' == 'value=3'. Patch by Eric V. Smith. @@ -1011,7 +1011,7 @@ Patch by Stefan Krah. .. nonce: LR__VD .. section: Library -Add secrets module as described in PEP 506. +Add secrets module as described in :pep:`506`. .. diff --git a/Misc/NEWS.d/3.6.0a2.rst b/Misc/NEWS.d/3.6.0a2.rst index 9e7326bc5c2e..fa050dec27ff 100644 --- a/Misc/NEWS.d/3.6.0a2.rst +++ b/Misc/NEWS.d/3.6.0a2.rst @@ -44,7 +44,7 @@ Added BUILD_CONST_KEY_MAP opcode. .. nonce: EAnCS7 .. section: Core and Builtins -Add support for os.PathLike objects to open() (part of PEP 519). +Add support for os.PathLike objects to open() (part of :pep:`519`). .. @@ -215,7 +215,7 @@ bytes patterns. .. nonce: UYiwoh .. section: Library -Add os.PathLike support to DirEntry (part of PEP 519). Initial patch by +Add os.PathLike support to DirEntry (part of :pep:`519`). Initial patch by Jelle Zijlstra. .. @@ -246,7 +246,7 @@ PEP 519). Initial patch by Dusty Phillips. .. section: Library Add support for os.PathLike objects to os.fsencode() and os.fsdecode() (part -of PEP 519). +of :pep:`519`). .. @@ -255,7 +255,7 @@ of PEP 519). .. nonce: y7YRfj .. section: Library -Introduce os.PathLike and os.fspath() (part of PEP 519). +Introduce os.PathLike and os.fspath() (part of :pep:`519`). .. @@ -268,7 +268,7 @@ A new version of typing.py provides several new classes and features: @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some of the new features are not yet implemented in mypy or other static analyzers). -Also classes for PEP 492 (Awaitable, AsyncIterable, AsyncIterator) have been +Also classes for :pep:`492` (Awaitable, AsyncIterable, AsyncIterator) have been added (in fact they made it into 3.5.1 but were never mentioned). .. @@ -689,7 +689,7 @@ to use lowercase. Patch by Sean Rodman, test by Kaushik Nadikuditi. .. nonce: MUK0zK .. section: Documentation -Document the new PEP 448 unpacking syntax of 3.5. +Document the new :pep:`448` unpacking syntax of 3.5. .. @@ -770,7 +770,7 @@ https://github.com/python/pythondotorg/issues/945) .. nonce: Ll8R-t .. section: C API -Add the PyOS_FSPath() function (part of PEP 519). +Add the PyOS_FSPath() function (part of :pep:`519`). .. diff --git a/Misc/NEWS.d/3.6.0a3.rst b/Misc/NEWS.d/3.6.0a3.rst index 2ca258038bb8..4b0000b0e797 100644 --- a/Misc/NEWS.d/3.6.0a3.rst +++ b/Misc/NEWS.d/3.6.0a3.rst @@ -243,7 +243,7 @@ Zijlstra. When an exception is raised within the context being managed by a contextlib.ExitStack() and one of the exit stack generators catches and raises it in a chain, do not re-raise the original exception when exiting, -let the new chained one through. This avoids the PEP 479 bug described in +let the new chained one through. This avoids the :pep:`479` bug described in issue25782. .. diff --git a/Misc/NEWS.d/3.6.0a4.rst b/Misc/NEWS.d/3.6.0a4.rst index 0be9c8219777..d613fd5d928b 100644 --- a/Misc/NEWS.d/3.6.0a4.rst +++ b/Misc/NEWS.d/3.6.0a4.rst @@ -122,7 +122,7 @@ SystemError. .. nonce: VrInsj .. section: Core and Builtins -Implemented PEP 487 (Simpler customization of class creation). Upon +Implemented :pep:`487` (Simpler customization of class creation). Upon subclassing, the __init_subclass__ classmethod is called on the base class. Descriptors are initialized with __set_name__ after class creation. @@ -133,7 +133,7 @@ Descriptors are initialized with __set_name__ after class creation. .. nonce: nfVMKM .. section: Library -Add PEP 519/__fspath__() support to the os and os.path modules. Includes +Add :pep:`519`/__fspath__() support to the os and os.path modules. Includes code from Jelle Zijlstra. (See also: bpo-27524) .. @@ -197,7 +197,7 @@ keyword-only. .. nonce: nbAEM8 .. section: Library -Add mathematical constant tau to math and cmath. See also PEP 628. +Add mathematical constant tau to math and cmath. See also :pep:`628`. .. @@ -400,7 +400,7 @@ of 4 GiB. .. nonce: IDW05R .. section: Library -Implemented PEP 495 (Local Time Disambiguation). +Implemented :pep:`495` (Local Time Disambiguation). .. @@ -604,7 +604,7 @@ Update bundled Tcl/Tk to 8.6.6. .. nonce: O0o0mB .. section: Windows -Adds PEP 514 metadata to Windows installer +Adds :pep:`514` metadata to Windows installer .. diff --git a/Misc/NEWS.d/3.6.0b1.rst b/Misc/NEWS.d/3.6.0b1.rst index f151557dcc2c..bd0e0a7c58d1 100644 --- a/Misc/NEWS.d/3.6.0b1.rst +++ b/Misc/NEWS.d/3.6.0b1.rst @@ -26,7 +26,7 @@ NSMALLPOSINTS = 0. .. nonce: Te4Tjb .. section: Core and Builtins -Implement formatting support for PEP 515. Initial patch by Chris Angelico. +Implement formatting support for :pep:`515`. Initial patch by Chris Angelico. .. @@ -107,7 +107,7 @@ Serhiy Storchaka and Victor Stinner. .. nonce: TdJp8_ .. section: Core and Builtins -Implement tokenizing support for PEP 515. Patch by Georg Brandl. +Implement tokenizing support for :pep:`515`. Patch by Georg Brandl. .. @@ -126,7 +126,7 @@ Levkivskyi. .. nonce: noeoav .. section: Core and Builtins -Implement PEP 525 -- Asynchronous Generators. +Implement :pep:`525` -- Asynchronous Generators. .. @@ -135,7 +135,7 @@ Implement PEP 525 -- Asynchronous Generators. .. nonce: 0ayJ5k .. section: Core and Builtins -Implement PEP 526 -- Syntax for Variable Annotations. Patch by Ivan +Implement :pep:`526` -- Syntax for Variable Annotations. Patch by Ivan Levkivskyi. .. @@ -224,7 +224,7 @@ longer a relevant platform for Python. .. nonce: rdhhVw .. section: Core and Builtins -Implement PEP 523. +Implement :pep:`523`. .. @@ -410,7 +410,7 @@ Patch written by Xiang Zhang. .. nonce: 0DdIrA .. section: Core and Builtins -Implement PEP 530 -- asynchronous comprehensions. +Implement :pep:`530` -- asynchronous comprehensions. .. diff --git a/Misc/NEWS.d/3.6.0rc1.rst b/Misc/NEWS.d/3.6.0rc1.rst index 17220ca6df62..c44dec324d2f 100644 --- a/Misc/NEWS.d/3.6.0rc1.rst +++ b/Misc/NEWS.d/3.6.0rc1.rst @@ -110,7 +110,7 @@ PyUnicode_CompareWithASCIIString() now never raises exceptions. The data model reference and the porting section in the What's New guide now cover the additional ``__classcell__`` handling needed for custom -metaclasses to fully support PEP 487 and zero-argument ``super()``. +metaclasses to fully support :pep:`487` and zero-argument ``super()``. .. diff --git a/Misc/NEWS.d/3.6.1rc1.rst b/Misc/NEWS.d/3.6.1rc1.rst index 9137df6c1435..1f9fb13f6970 100644 --- a/Misc/NEWS.d/3.6.1rc1.rst +++ b/Misc/NEWS.d/3.6.1rc1.rst @@ -465,7 +465,7 @@ Patch written by Jiajun Huang. .. nonce: kN5S6v .. section: Library -functools.lru_cache() now respects PEP 468 and preserves the order of +functools.lru_cache() now respects :pep:`468` and preserves the order of keyword arguments. f(a=1, b=2) is now cached separately from f(b=2, a=1) since both calls could potentially give different results. @@ -689,7 +689,7 @@ Correctly handle special console filenames (patch by Eryk Sun) .. nonce: bhvrJ2 .. section: Windows -Implement PEP 529 for io.FileIO (Patch by Eryk Sun) +Implement :pep:`529` for io.FileIO (Patch by Eryk Sun) .. diff --git a/Misc/NEWS.d/3.6.3rc1.rst b/Misc/NEWS.d/3.6.3rc1.rst index ca812c63eed9..9c9eac635261 100644 --- a/Misc/NEWS.d/3.6.3rc1.rst +++ b/Misc/NEWS.d/3.6.3rc1.rst @@ -406,7 +406,7 @@ avoid keeping a reference to yielded objects. .. nonce: nmAvfu .. section: Library -Fix ctypes producing wrong PEP 3118 type codes for integer types. +Fix ctypes producing wrong :pep:`3118` type codes for integer types. .. @@ -1252,7 +1252,7 @@ by Cheryl Sabella. .. section: Tools/Demos gdb integration commands (py-bt, etc.) work on optimized shared builds now, -too. PEP 523 introduced _PyEval_EvalFrameDefault which inlines +too. :pep:`523` introduced _PyEval_EvalFrameDefault which inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the ability to use py-bt, py-up, and a few other Python-specific gdb integrations. The problem is fixed by only looking for _PyEval_EvalFrameDefault frames in diff --git a/Misc/NEWS.d/3.6.6rc1.rst b/Misc/NEWS.d/3.6.6rc1.rst index f6038768bd40..71a5c3ec595b 100644 --- a/Misc/NEWS.d/3.6.6rc1.rst +++ b/Misc/NEWS.d/3.6.6rc1.rst @@ -376,7 +376,7 @@ implementation. .. nonce: pyR0jB .. section: Library -Update difflib.mdiff() for PEP 479. Convert an uncaught StopIteration in a +Update difflib.mdiff() for :pep:`479`. Convert an uncaught StopIteration in a generator into a return-statement. .. diff --git a/Misc/NEWS.d/3.7.0a1.rst b/Misc/NEWS.d/3.7.0a1.rst index 0c13bf022e60..c8d061ee6b00 100644 --- a/Misc/NEWS.d/3.7.0a1.rst +++ b/Misc/NEWS.d/3.7.0a1.rst @@ -426,7 +426,7 @@ expression, and generator expressions and comprehensions. .. nonce: f_IHor .. section: Core and Builtins -Implement PEP 538 (legacy C locale coercion). This means that when a +Implement :pep:`538` (legacy C locale coercion). This means that when a suitable coercion target locale is available, both the core interpreter and locale-aware C extensions will assume the use of UTF-8 as the default text encoding, rather than ASCII. @@ -948,7 +948,7 @@ The preferred encoding is UTF-8 on Android. Patch written by Chi Hsuan Yen. .. nonce: 2a8zxB .. section: Core and Builtins -Clean up interpreter startup (see PEP 432). +Clean up interpreter startup (see :pep:`432`). .. @@ -1774,7 +1774,7 @@ Fix ``fileinput.FileInput(files, inplace=True)`` when ``files`` contain .. nonce: nmAvfu .. section: Library -Fix ctypes producing wrong PEP 3118 type codes for integer types. +Fix ctypes producing wrong :pep:`3118` type codes for integer types. .. @@ -4877,7 +4877,7 @@ Fix Python 2 syntax in code for building the documentation. The data model reference and the porting section in the 3.6 What's New guide now cover the additional ``__classcell__`` handling needed for custom -metaclasses to fully support PEP 487 and zero-argument ``super()``. +metaclasses to fully support :pep:`487` and zero-argument ``super()``. .. @@ -5106,7 +5106,7 @@ difficult to maintain low-level internal code. .. nonce: XLuZFk .. section: Build -Per PEP 11, support for the IRIX operating system was removed. +Per :pep:`11`, support for the IRIX operating system was removed. .. @@ -6225,7 +6225,7 @@ description of the configuration system. .. section: Tools/Demos gdb integration commands (py-bt, etc.) work on optimized shared builds now, -too. PEP 523 introduced _PyEval_EvalFrameDefault which inlines +too. :pep:`523` introduced _PyEval_EvalFrameDefault which inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the ability to use py-bt, py-up, and a few other Python-specific gdb integrations. The problem is fixed by only looking for _PyEval_EvalFrameDefault frames in diff --git a/Misc/NEWS.d/3.7.0a2.rst b/Misc/NEWS.d/3.7.0a2.rst index 363899eae6f9..b1b7c92f66a6 100644 --- a/Misc/NEWS.d/3.7.0a2.rst +++ b/Misc/NEWS.d/3.7.0a2.rst @@ -249,7 +249,7 @@ by Oren Milman. .. nonce: _kr47t .. section: Core and Builtins -Make ``async`` and ``await`` proper keywords, as specified in PEP 492. +Make ``async`` and ``await`` proper keywords, as specified in :pep:`492`. .. @@ -680,7 +680,7 @@ and Py_SetPath() .. nonce: vm8vGE .. section: C API -Implement PEP 539 for Thread Specific Storage (TSS) API: it is a new Thread +Implement :pep:`539` for Thread Specific Storage (TSS) API: it is a new Thread Local Storage (TLS) API to CPython which would supersede use of the existing TLS API within the CPython interpreter, while deprecating the existing API. PEP written by Erik M. Bray, patch by Masayuki Yamamoto. diff --git a/Misc/NEWS.d/3.7.0a3.rst b/Misc/NEWS.d/3.7.0a3.rst index 176441e2b0e7..307ea543051e 100644 --- a/Misc/NEWS.d/3.7.0a3.rst +++ b/Misc/NEWS.d/3.7.0a3.rst @@ -552,7 +552,7 @@ Patch by Dong-hee Na. .. nonce: YMQ7Q2 .. section: Library -inspect.signature should follow PEP 8, if the parameter has an annotation +inspect.signature should follow :pep:`8`, if the parameter has an annotation and a default value. Patch by Dong-hee Na. .. diff --git a/Misc/NEWS.d/3.7.0b4.rst b/Misc/NEWS.d/3.7.0b4.rst index a6cae2819182..55c606864943 100644 --- a/Misc/NEWS.d/3.7.0b4.rst +++ b/Misc/NEWS.d/3.7.0b4.rst @@ -216,7 +216,7 @@ implementation. .. nonce: pyR0jB .. section: Library -Update difflib.mdiff() for PEP 479. Convert an uncaught StopIteration in a +Update difflib.mdiff() for :pep:`479`. Convert an uncaught StopIteration in a generator into a return-statement. .. diff --git a/Misc/NEWS.d/3.7.0b5.rst b/Misc/NEWS.d/3.7.0b5.rst index 4fe3ed59fc9b..20476993b965 100644 --- a/Misc/NEWS.d/3.7.0b5.rst +++ b/Misc/NEWS.d/3.7.0b5.rst @@ -475,7 +475,7 @@ Document that `asyncio.wait()` does not cancel its futures on timeout. .. nonce: S1LGPa .. section: Documentation -Document PEP 567 changes to asyncio. +Document :pep:`567` changes to asyncio. .. diff --git a/Misc/NEWS.d/3.7.0rc1.rst b/Misc/NEWS.d/3.7.0rc1.rst index bc3cc8ee6a32..89457ef59ab3 100644 --- a/Misc/NEWS.d/3.7.0rc1.rst +++ b/Misc/NEWS.d/3.7.0rc1.rst @@ -168,7 +168,7 @@ Emit a deprecation warning for inspect.formatargspec .. nonce: r4z9MM .. section: Documentation -Clarified the relationship between PEP 538's PYTHONCOERCECLOCALE and PEP +Clarified the relationship between :pep:`538`'s PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode. .. diff --git a/Misc/NEWS.d/next/Documentation/2018-05-23-11-59-51.bpo-32436.S1LGPa.rst b/Misc/NEWS.d/next/Documentation/2018-05-23-11-59-51.bpo-32436.S1LGPa.rst index 8eeb561921a8..a4ecc23f8925 100644 --- a/Misc/NEWS.d/next/Documentation/2018-05-23-11-59-51.bpo-32436.S1LGPa.rst +++ b/Misc/NEWS.d/next/Documentation/2018-05-23-11-59-51.bpo-32436.S1LGPa.rst @@ -1 +1 @@ -Document PEP 567 changes to asyncio. +Document :pep:`567` changes to asyncio. diff --git a/Misc/NEWS.d/next/Documentation/2018-06-08-23-46-01.bpo-33409.r4z9MM.rst b/Misc/NEWS.d/next/Documentation/2018-06-08-23-46-01.bpo-33409.r4z9MM.rst index 5b1a018df55a..f26ddd82400e 100644 --- a/Misc/NEWS.d/next/Documentation/2018-06-08-23-46-01.bpo-33409.r4z9MM.rst +++ b/Misc/NEWS.d/next/Documentation/2018-06-08-23-46-01.bpo-33409.r4z9MM.rst @@ -1,2 +1,2 @@ -Clarified the relationship between PEP 538's PYTHONCOERCECLOCALE and PEP +Clarified the relationship between :pep:`538`'s PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode. diff --git a/Misc/NEWS.d/next/Documentation/2018-10-22-14-17-57.bpo-35042.1UGv1a.rst b/Misc/NEWS.d/next/Documentation/2018-10-22-14-17-57.bpo-35042.1UGv1a.rst new file mode 100644 index 000000000000..3ebbd3a8005a --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-22-14-17-57.bpo-35042.1UGv1a.rst @@ -0,0 +1 @@ +Replace PEP XYZ by the pep role and allow to use the direct links to the PEPs. diff --git a/Misc/NEWS.d/next/Library/2018-04-04-23-41-30.bpo-33224.pyR0jB.rst b/Misc/NEWS.d/next/Library/2018-04-04-23-41-30.bpo-33224.pyR0jB.rst index 87ff100da4b6..b0ddba9335e2 100644 --- a/Misc/NEWS.d/next/Library/2018-04-04-23-41-30.bpo-33224.pyR0jB.rst +++ b/Misc/NEWS.d/next/Library/2018-04-04-23-41-30.bpo-33224.pyR0jB.rst @@ -1,2 +1,2 @@ -Update difflib.mdiff() for PEP 479. Convert an uncaught StopIteration in a +Update difflib.mdiff() for :pep:`479`. Convert an uncaught StopIteration in a generator into a return-statement. From webhook-mailer at python.org Fri Oct 26 23:03:13 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sat, 27 Oct 2018 03:03:13 -0000 Subject: [Python-checkins] bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Message-ID: https://github.com/python/cpython/commit/d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713 commit: d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713 branch: master author: Terry Jan Reedy committer: GitHub date: 2018-10-26T23:03:08-04:00 summary: bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Specify that blocks are non-overlapping. Change '!=' to '<'. files: A Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst M Doc/library/difflib.rst diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 6743bdc1d87b..f044cb2d6e0a 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -457,14 +457,15 @@ The :class:`SequenceMatcher` class has this constructor: .. method:: get_matching_blocks() - Return list of triples describing matching subsequences. Each triple is of - the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j+n]``. The + Return list of triples describing non-overlapping matching subsequences. + Each triple is of the form ``(i, j, n)``, + and means that ``a[i:i+n] == b[j:j+n]``. The triples are monotonically increasing in *i* and *j*. The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` are adjacent triples in the list, and the second is not the last triple in - the list, then ``i+n != i'`` or ``j+n != j'``; in other words, adjacent + the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent triples always describe non-adjacent equal blocks. .. XXX Explain why a dummy is used! diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst new file mode 100644 index 000000000000..33f6dc4d8821 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -0,0 +1,2 @@ +Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- +overlapping' and changing '!=' to '<'. From webhook-mailer at python.org Fri Oct 26 23:07:45 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 03:07:45 -0000 Subject: [Python-checkins] bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Message-ID: https://github.com/python/cpython/commit/cb920c1442bf3b0899fee51915b4bf6614f2c1d7 commit: cb920c1442bf3b0899fee51915b4bf6614f2c1d7 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T20:07:42-07:00 summary: bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Specify that blocks are non-overlapping. Change '!=' to '<'. (cherry picked from commit d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst M Doc/library/difflib.rst diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 6743bdc1d87b..f044cb2d6e0a 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -457,14 +457,15 @@ The :class:`SequenceMatcher` class has this constructor: .. method:: get_matching_blocks() - Return list of triples describing matching subsequences. Each triple is of - the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j+n]``. The + Return list of triples describing non-overlapping matching subsequences. + Each triple is of the form ``(i, j, n)``, + and means that ``a[i:i+n] == b[j:j+n]``. The triples are monotonically increasing in *i* and *j*. The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` are adjacent triples in the list, and the second is not the last triple in - the list, then ``i+n != i'`` or ``j+n != j'``; in other words, adjacent + the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent triples always describe non-adjacent equal blocks. .. XXX Explain why a dummy is used! diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst new file mode 100644 index 000000000000..33f6dc4d8821 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -0,0 +1,2 @@ +Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- +overlapping' and changing '!=' to '<'. From webhook-mailer at python.org Fri Oct 26 23:08:59 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 03:08:59 -0000 Subject: [Python-checkins] bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Message-ID: https://github.com/python/cpython/commit/5282125650a70811f0d64ab231e2a6c8ac20c96b commit: 5282125650a70811f0d64ab231e2a6c8ac20c96b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T20:08:56-07:00 summary: bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Specify that blocks are non-overlapping. Change '!=' to '<'. (cherry picked from commit d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst M Doc/library/difflib.rst diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 6743bdc1d87b..f044cb2d6e0a 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -457,14 +457,15 @@ The :class:`SequenceMatcher` class has this constructor: .. method:: get_matching_blocks() - Return list of triples describing matching subsequences. Each triple is of - the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j+n]``. The + Return list of triples describing non-overlapping matching subsequences. + Each triple is of the form ``(i, j, n)``, + and means that ``a[i:i+n] == b[j:j+n]``. The triples are monotonically increasing in *i* and *j*. The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` are adjacent triples in the list, and the second is not the last triple in - the list, then ``i+n != i'`` or ``j+n != j'``; in other words, adjacent + the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent triples always describe non-adjacent equal blocks. .. XXX Explain why a dummy is used! diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst new file mode 100644 index 000000000000..33f6dc4d8821 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -0,0 +1,2 @@ +Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- +overlapping' and changing '!=' to '<'. From webhook-mailer at python.org Fri Oct 26 23:09:13 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 03:09:13 -0000 Subject: [Python-checkins] bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Message-ID: https://github.com/python/cpython/commit/e389de8e3e897fa5ba4f71b0f711355fb7158049 commit: e389de8e3e897fa5ba4f71b0f711355fb7158049 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-26T20:09:10-07:00 summary: bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144) Specify that blocks are non-overlapping. Change '!=' to '<'. (cherry picked from commit d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst M Doc/library/difflib.rst diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 01a3bfc2cd13..7b6cce4f8abc 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -431,14 +431,15 @@ The :class:`SequenceMatcher` class has this constructor: .. method:: get_matching_blocks() - Return list of triples describing matching subsequences. Each triple is of - the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j+n]``. The + Return list of triples describing non-overlapping matching subsequences. + Each triple is of the form ``(i, j, n)``, + and means that ``a[i:i+n] == b[j:j+n]``. The triples are monotonically increasing in *i* and *j*. The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` are adjacent triples in the list, and the second is not the last triple in - the list, then ``i+n != i'`` or ``j+n != j'``; in other words, adjacent + the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent triples always describe non-adjacent equal blocks. .. XXX Explain why a dummy is used! diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst new file mode 100644 index 000000000000..33f6dc4d8821 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -0,0 +1,2 @@ +Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- +overlapping' and changing '!=' to '<'. From webhook-mailer at python.org Sat Oct 27 01:00:44 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 27 Oct 2018 05:00:44 -0000 Subject: [Python-checkins] bpo-33710: Deprecate l*gettext() and related functions in the gettext module. (GH-10139) Message-ID: https://github.com/python/cpython/commit/fec35c99aa749bb90cb29349bed6b3393907c4c1 commit: fec35c99aa749bb90cb29349bed6b3393907c4c1 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-27T08:00:41+03:00 summary: bpo-33710: Deprecate l*gettext() and related functions in the gettext module. (GH-10139) They return encoded bytes and are Python 2 artifacts. files: A Misc/NEWS.d/next/Library/2018-10-26-21-12-55.bpo-33710.Q5oXc6.rst M Doc/library/gettext.rst M Doc/whatsnew/3.8.rst M Lib/gettext.py M Lib/test/test_gettext.py diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index 93748a2e4726..0a9456abe146 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -53,6 +53,8 @@ class-based API instead. and :func:`ldngettext` functions. If *codeset* is omitted, then the current binding is returned. + .. deprecated-removed:: 3.8 3.10 + .. function:: textdomain(domain=None) @@ -112,9 +114,9 @@ class-based API instead. Unicode strings instead, since most Python applications will want to manipulate human readable text as strings instead of bytes. Further, it's possible that you may get unexpected Unicode-related exceptions - if there are encoding problems with the translated strings. It is - possible that the ``l*()`` functions will be deprecated in future Python - versions due to their inherent problems and limitations. + if there are encoding problems with the translated strings. + + .. deprecated-removed:: 3.8 3.10 Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, but @@ -192,6 +194,9 @@ class can also install themselves in the built-in namespace as the function .. versionchanged:: 3.3 :exc:`IOError` used to be raised instead of :exc:`OSError`. + .. deprecated-removed:: 3.8 3.10 + The *codeset* parameter. + .. function:: install(domain, localedir=None, codeset=None, names=None) @@ -212,6 +217,9 @@ class can also install themselves in the built-in namespace as the function builtins namespace, so it is easily accessible in all modules of your application. + .. deprecated-removed:: 3.8 3.10 + The *codeset* parameter. + The :class:`NullTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -272,6 +280,8 @@ are the methods of :class:`!NullTranslations`: These methods should be avoided in Python 3. See the warning for the :func:`lgettext` function. + .. deprecated-removed:: 3.8 3.10 + .. method:: info() @@ -288,11 +298,15 @@ are the methods of :class:`!NullTranslations`: Return the encoding used to return translated messages in :meth:`.lgettext` and :meth:`.lngettext`. + .. deprecated-removed:: 3.8 3.10 + .. method:: set_output_charset(charset) Change the encoding used to return translated messages. + .. deprecated-removed:: 3.8 3.10 + .. method:: install(names=None) @@ -393,6 +407,8 @@ unexpected, or if other problems occur while reading the file, instantiating a These methods should be avoided in Python 3. See the warning for the :func:`lgettext` function. + .. deprecated-removed:: 3.8 3.10 + Solaris message catalog support ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a09492137e77..05b7d235cee8 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -295,6 +295,23 @@ Deprecated versions. :class:`~ast.Constant` should be used instead. (Contributed by Serhiy Storchaka in :issue:`32892`.) +* The following functions and methods are deprecated in the :mod:`gettext` + module: :func:`~gettext.lgettext`, :func:`~gettext.ldgettext`, + :func:`~gettext.lngettext` and :func:`~gettext.ldngettext`. + They return encoded bytes, and it's possible that you will get unexpected + Unicode-related exceptions if there are encoding problems with the + translated strings. It's much better to use alternatives which return + Unicode strings in Python 3. These functions have been broken for a long time. + + Function :func:`~gettext.bind_textdomain_codeset`, methods + :meth:`~gettext.NullTranslations.output_charset` and + :meth:`~gettext.NullTranslations.set_output_charset`, and the *codeset* + parameter of functions :func:`~gettext.translation` and + :func:`~gettext.install` are also deprecated, since they are only used for + for the ``l*gettext()`` functions. + + (Contributed by Serhiy Storchaka in :issue:`33710`.) + Removed ======= diff --git a/Lib/gettext.py b/Lib/gettext.py index 4c3b80b0239b..920742cabe88 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -274,8 +274,14 @@ def gettext(self, message): return message def lgettext(self, message): + import warnings + warnings.warn('lgettext() is deprecated, use gettext() instead', + DeprecationWarning, 2) if self._fallback: - return self._fallback.lgettext(message) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\blgettext\b.*', + DeprecationWarning) + return self._fallback.lgettext(message) if self._output_charset: return message.encode(self._output_charset) return message.encode(locale.getpreferredencoding()) @@ -289,8 +295,14 @@ def ngettext(self, msgid1, msgid2, n): return msgid2 def lngettext(self, msgid1, msgid2, n): + import warnings + warnings.warn('lngettext() is deprecated, use ngettext() instead', + DeprecationWarning, 2) if self._fallback: - return self._fallback.lngettext(msgid1, msgid2, n) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\blngettext\b.*', + DeprecationWarning) + return self._fallback.lngettext(msgid1, msgid2, n) if n == 1: tmsg = msgid1 else: @@ -306,9 +318,15 @@ def charset(self): return self._charset def output_charset(self): + import warnings + warnings.warn('output_charset() is deprecated', + DeprecationWarning, 2) return self._output_charset def set_output_charset(self, charset): + import warnings + warnings.warn('set_output_charset() is deprecated', + DeprecationWarning, 2) self._output_charset = charset def install(self, names=None): @@ -424,6 +442,9 @@ def _parse(self, fp): transidx += 8 def lgettext(self, message): + import warnings + warnings.warn('lgettext() is deprecated, use gettext() instead', + DeprecationWarning, 2) missing = object() tmsg = self._catalog.get(message, missing) if tmsg is missing: @@ -435,6 +456,9 @@ def lgettext(self, message): return tmsg.encode(locale.getpreferredencoding()) def lngettext(self, msgid1, msgid2, n): + import warnings + warnings.warn('lngettext() is deprecated, use ngettext() instead', + DeprecationWarning, 2) try: tmsg = self._catalog[(msgid1, self.plural(n))] except KeyError: @@ -510,9 +534,10 @@ def find(domain, localedir=None, languages=None, all=False): # a mapping between absolute .mo file path and Translation object _translations = {} +_unspecified = ['unspecified'] def translation(domain, localedir=None, languages=None, - class_=None, fallback=False, codeset=None): + class_=None, fallback=False, codeset=_unspecified): if class_ is None: class_ = GNUTranslations mofiles = find(domain, localedir, languages, all=True) @@ -538,8 +563,15 @@ def translation(domain, localedir=None, languages=None, # are not used. import copy t = copy.copy(t) - if codeset: - t.set_output_charset(codeset) + if codeset is not _unspecified: + import warnings + warnings.warn('parameter codeset is deprecated', + DeprecationWarning, 2) + if codeset: + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\bset_output_charset\b.*', + DeprecationWarning) + t.set_output_charset(codeset) if result is None: result = t else: @@ -547,7 +579,7 @@ def translation(domain, localedir=None, languages=None, return result -def install(domain, localedir=None, codeset=None, names=None): +def install(domain, localedir=None, codeset=_unspecified, names=None): t = translation(domain, localedir, fallback=True, codeset=codeset) t.install(names) @@ -576,6 +608,9 @@ def bindtextdomain(domain, localedir=None): def bind_textdomain_codeset(domain, codeset=None): + import warnings + warnings.warn('bind_textdomain_codeset() is deprecated', + DeprecationWarning, 2) global _localecodesets if codeset is not None: _localecodesets[domain] = codeset @@ -584,24 +619,31 @@ def bind_textdomain_codeset(domain, codeset=None): def dgettext(domain, message): try: - t = translation(domain, _localedirs.get(domain, None), - codeset=_localecodesets.get(domain)) + t = translation(domain, _localedirs.get(domain, None)) except OSError: return message return t.gettext(message) def ldgettext(domain, message): + import warnings + warnings.warn('ldgettext() is deprecated, use dgettext() instead', + DeprecationWarning, 2) codeset = _localecodesets.get(domain) try: - t = translation(domain, _localedirs.get(domain, None), codeset=codeset) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\bparameter codeset\b.*', + DeprecationWarning) + t = translation(domain, _localedirs.get(domain, None), codeset=codeset) except OSError: return message.encode(codeset or locale.getpreferredencoding()) - return t.lgettext(message) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\blgettext\b.*', + DeprecationWarning) + return t.lgettext(message) def dngettext(domain, msgid1, msgid2, n): try: - t = translation(domain, _localedirs.get(domain, None), - codeset=_localecodesets.get(domain)) + t = translation(domain, _localedirs.get(domain, None)) except OSError: if n == 1: return msgid1 @@ -610,28 +652,49 @@ def dngettext(domain, msgid1, msgid2, n): return t.ngettext(msgid1, msgid2, n) def ldngettext(domain, msgid1, msgid2, n): + import warnings + warnings.warn('ldngettext() is deprecated, use dngettext() instead', + DeprecationWarning, 2) codeset = _localecodesets.get(domain) try: - t = translation(domain, _localedirs.get(domain, None), codeset=codeset) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\bparameter codeset\b.*', + DeprecationWarning) + t = translation(domain, _localedirs.get(domain, None), codeset=codeset) except OSError: if n == 1: tmsg = msgid1 else: tmsg = msgid2 return tmsg.encode(codeset or locale.getpreferredencoding()) - return t.lngettext(msgid1, msgid2, n) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\blngettext\b.*', + DeprecationWarning) + return t.lngettext(msgid1, msgid2, n) def gettext(message): return dgettext(_current_domain, message) def lgettext(message): - return ldgettext(_current_domain, message) + import warnings + warnings.warn('lgettext() is deprecated, use gettext() instead', + DeprecationWarning, 2) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\bldgettext\b.*', + DeprecationWarning) + return ldgettext(_current_domain, message) def ngettext(msgid1, msgid2, n): return dngettext(_current_domain, msgid1, msgid2, n) def lngettext(msgid1, msgid2, n): - return ldngettext(_current_domain, msgid1, msgid2, n) + import warnings + warnings.warn('lngettext() is deprecated, use ngettext() instead', + DeprecationWarning, 2) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', r'.*\bldngettext\b.*', + DeprecationWarning) + return ldngettext(_current_domain, msgid1, msgid2, n) # dcgettext() has been deemed unnecessary and is not implemented. diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index b5ed05eab7bb..bbad1028dcd8 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -1,5 +1,6 @@ import os import base64 +import contextlib import gettext import locale import unittest @@ -461,116 +462,174 @@ def setUp(self): GettextBaseTest.setUp(self) self.mofile = MOFILE + @contextlib.contextmanager + def assertDeprecated(self, name): + with self.assertWarnsRegex(DeprecationWarning, + fr'^{name}\(\) is deprecated'): + yield + def test_lgettext(self): lgettext = gettext.lgettext ldgettext = gettext.ldgettext - self.assertEqual(lgettext('mullusk'), b'bacon') - self.assertEqual(lgettext('spam'), b'spam') - self.assertEqual(ldgettext('gettext', 'mullusk'), b'bacon') - self.assertEqual(ldgettext('gettext', 'spam'), b'spam') + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('mullusk'), b'bacon') + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('spam'), b'spam') + with self.assertDeprecated('ldgettext'): + self.assertEqual(ldgettext('gettext', 'mullusk'), b'bacon') + with self.assertDeprecated('ldgettext'): + self.assertEqual(ldgettext('gettext', 'spam'), b'spam') def test_lgettext_2(self): with open(self.mofile, 'rb') as fp: t = gettext.GNUTranslations(fp) lgettext = t.lgettext - self.assertEqual(lgettext('mullusk'), b'bacon') - self.assertEqual(lgettext('spam'), b'spam') + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('mullusk'), b'bacon') + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('spam'), b'spam') def test_lgettext_bind_textdomain_codeset(self): lgettext = gettext.lgettext ldgettext = gettext.ldgettext - saved_codeset = gettext.bind_textdomain_codeset('gettext') + with self.assertDeprecated('bind_textdomain_codeset'): + saved_codeset = gettext.bind_textdomain_codeset('gettext') try: - gettext.bind_textdomain_codeset('gettext', 'utf-16') - self.assertEqual(lgettext('mullusk'), 'bacon'.encode('utf-16')) - self.assertEqual(lgettext('spam'), 'spam'.encode('utf-16')) - self.assertEqual(ldgettext('gettext', 'mullusk'), 'bacon'.encode('utf-16')) - self.assertEqual(ldgettext('gettext', 'spam'), 'spam'.encode('utf-16')) + with self.assertDeprecated('bind_textdomain_codeset'): + gettext.bind_textdomain_codeset('gettext', 'utf-16') + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('mullusk'), 'bacon'.encode('utf-16')) + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('spam'), 'spam'.encode('utf-16')) + with self.assertDeprecated('ldgettext'): + self.assertEqual(ldgettext('gettext', 'mullusk'), 'bacon'.encode('utf-16')) + with self.assertDeprecated('ldgettext'): + self.assertEqual(ldgettext('gettext', 'spam'), 'spam'.encode('utf-16')) finally: del gettext._localecodesets['gettext'] - gettext.bind_textdomain_codeset('gettext', saved_codeset) + with self.assertDeprecated('bind_textdomain_codeset'): + gettext.bind_textdomain_codeset('gettext', saved_codeset) def test_lgettext_output_encoding(self): with open(self.mofile, 'rb') as fp: t = gettext.GNUTranslations(fp) lgettext = t.lgettext - t.set_output_charset('utf-16') - self.assertEqual(lgettext('mullusk'), 'bacon'.encode('utf-16')) - self.assertEqual(lgettext('spam'), 'spam'.encode('utf-16')) + with self.assertDeprecated('set_output_charset'): + t.set_output_charset('utf-16') + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('mullusk'), 'bacon'.encode('utf-16')) + with self.assertDeprecated('lgettext'): + self.assertEqual(lgettext('spam'), 'spam'.encode('utf-16')) def test_lngettext(self): lngettext = gettext.lngettext ldngettext = gettext.ldngettext - x = lngettext('There is %s file', 'There are %s files', 1) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 1) self.assertEqual(x, b'Hay %s fichero') - x = lngettext('There is %s file', 'There are %s files', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 2) self.assertEqual(x, b'Hay %s ficheros') - x = lngettext('There is %s directory', 'There are %s directories', 1) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 1) self.assertEqual(x, b'There is %s directory') - x = lngettext('There is %s directory', 'There are %s directories', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 2) self.assertEqual(x, b'There are %s directories') - x = ldngettext('gettext', 'There is %s file', 'There are %s files', 1) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s file', 'There are %s files', 1) self.assertEqual(x, b'Hay %s fichero') - x = ldngettext('gettext', 'There is %s file', 'There are %s files', 2) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s file', 'There are %s files', 2) self.assertEqual(x, b'Hay %s ficheros') - x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 1) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 1) self.assertEqual(x, b'There is %s directory') - x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 2) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 2) self.assertEqual(x, b'There are %s directories') def test_lngettext_2(self): with open(self.mofile, 'rb') as fp: t = gettext.GNUTranslations(fp) lngettext = t.lngettext - x = lngettext('There is %s file', 'There are %s files', 1) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 1) self.assertEqual(x, b'Hay %s fichero') - x = lngettext('There is %s file', 'There are %s files', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 2) self.assertEqual(x, b'Hay %s ficheros') - x = lngettext('There is %s directory', 'There are %s directories', 1) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 1) self.assertEqual(x, b'There is %s directory') - x = lngettext('There is %s directory', 'There are %s directories', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 2) self.assertEqual(x, b'There are %s directories') def test_lngettext_bind_textdomain_codeset(self): lngettext = gettext.lngettext ldngettext = gettext.ldngettext - saved_codeset = gettext.bind_textdomain_codeset('gettext') + with self.assertDeprecated('bind_textdomain_codeset'): + saved_codeset = gettext.bind_textdomain_codeset('gettext') try: - gettext.bind_textdomain_codeset('gettext', 'utf-16') - x = lngettext('There is %s file', 'There are %s files', 1) + with self.assertDeprecated('bind_textdomain_codeset'): + gettext.bind_textdomain_codeset('gettext', 'utf-16') + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 1) self.assertEqual(x, 'Hay %s fichero'.encode('utf-16')) - x = lngettext('There is %s file', 'There are %s files', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 2) self.assertEqual(x, 'Hay %s ficheros'.encode('utf-16')) - x = lngettext('There is %s directory', 'There are %s directories', 1) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 1) self.assertEqual(x, 'There is %s directory'.encode('utf-16')) - x = lngettext('There is %s directory', 'There are %s directories', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 2) self.assertEqual(x, 'There are %s directories'.encode('utf-16')) - x = ldngettext('gettext', 'There is %s file', 'There are %s files', 1) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s file', 'There are %s files', 1) self.assertEqual(x, 'Hay %s fichero'.encode('utf-16')) - x = ldngettext('gettext', 'There is %s file', 'There are %s files', 2) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s file', 'There are %s files', 2) self.assertEqual(x, 'Hay %s ficheros'.encode('utf-16')) - x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 1) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 1) self.assertEqual(x, 'There is %s directory'.encode('utf-16')) - x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 2) + with self.assertDeprecated('ldngettext'): + x = ldngettext('gettext', 'There is %s directory', 'There are %s directories', 2) self.assertEqual(x, 'There are %s directories'.encode('utf-16')) finally: del gettext._localecodesets['gettext'] - gettext.bind_textdomain_codeset('gettext', saved_codeset) + with self.assertDeprecated('bind_textdomain_codeset'): + gettext.bind_textdomain_codeset('gettext', saved_codeset) def test_lngettext_output_encoding(self): with open(self.mofile, 'rb') as fp: t = gettext.GNUTranslations(fp) lngettext = t.lngettext - t.set_output_charset('utf-16') - x = lngettext('There is %s file', 'There are %s files', 1) + with self.assertDeprecated('set_output_charset'): + t.set_output_charset('utf-16') + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 1) self.assertEqual(x, 'Hay %s fichero'.encode('utf-16')) - x = lngettext('There is %s file', 'There are %s files', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s file', 'There are %s files', 2) self.assertEqual(x, 'Hay %s ficheros'.encode('utf-16')) - x = lngettext('There is %s directory', 'There are %s directories', 1) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 1) self.assertEqual(x, 'There is %s directory'.encode('utf-16')) - x = lngettext('There is %s directory', 'There are %s directories', 2) + with self.assertDeprecated('lngettext'): + x = lngettext('There is %s directory', 'There are %s directories', 2) self.assertEqual(x, 'There are %s directories'.encode('utf-16')) + def test_output_encoding(self): + with open(self.mofile, 'rb') as fp: + t = gettext.GNUTranslations(fp) + with self.assertDeprecated('set_output_charset'): + t.set_output_charset('utf-16') + with self.assertDeprecated('output_charset'): + self.assertEqual(t.output_charset(), 'utf-16') + class GNUTranslationParsingTest(GettextBaseTest): def test_plural_form_error_issue17898(self): @@ -642,6 +701,16 @@ def test_cache(self): self.assertEqual(len(gettext._translations), 2) self.assertEqual(t.__class__, DummyGNUTranslations) + # Test deprecated parameter codeset + with self.assertWarnsRegex(DeprecationWarning, 'parameter codeset'): + t = gettext.translation('gettext', self.localedir, + class_=DummyGNUTranslations, + codeset='utf-16') + self.assertEqual(len(gettext._translations), 2) + self.assertEqual(t.__class__, DummyGNUTranslations) + with self.assertWarns(DeprecationWarning): + self.assertEqual(t.output_charset(), 'utf-16') + class MiscTestCase(unittest.TestCase): def test__all__(self): @@ -649,11 +718,8 @@ def test__all__(self): support.check__all__(self, gettext, blacklist=blacklist) -def test_main(): - support.run_unittest(__name__) - if __name__ == '__main__': - test_main() + unittest.main() # For reference, here's the .po file used to created the GNU_MO_DATA above. diff --git a/Misc/NEWS.d/next/Library/2018-10-26-21-12-55.bpo-33710.Q5oXc6.rst b/Misc/NEWS.d/next/Library/2018-10-26-21-12-55.bpo-33710.Q5oXc6.rst new file mode 100644 index 000000000000..25f0f8758083 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-26-21-12-55.bpo-33710.Q5oXc6.rst @@ -0,0 +1,4 @@ +Deprecated ``l*gettext()`` functions and methods in the :mod:`gettext` +module. They return encoded bytes instead of Unicode strings and are +artifacts from Python 2 times. Also deprecated functions and methods related +to setting the charset for ``l*gettext()`` functions and methods. From solipsis at pitrou.net Sat Oct 27 05:08:42 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 27 Oct 2018 09:08:42 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=0 Message-ID: <20181027090842.1.7141E737ED17BC31@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, -7, 1] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [2, 1, -1] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogwSK8SA', '--timeout', '7200'] From webhook-mailer at python.org Sat Oct 27 10:43:01 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 27 Oct 2018 14:43:01 -0000 Subject: [Python-checkins] Fix typo in zipfile documentation. (GH-10151) Message-ID: https://github.com/python/cpython/commit/40bf6cff22185b8ebaab14789e81cff22fbf2275 commit: 40bf6cff22185b8ebaab14789e81cff22fbf2275 branch: master author: nsrip committer: Serhiy Storchaka date: 2018-10-27T17:42:56+03:00 summary: Fix typo in zipfile documentation. (GH-10151) files: M Doc/library/zipfile.rst diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index e5872f31b6db..8d8612afa39b 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -372,7 +372,7 @@ ZipFile Objects Return the name of the first bad file, or else return ``None``. .. versionchanged:: 3.6 - Calling :meth:`testfile` on a closed ZipFile will raise a + Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` was raised. From webhook-mailer at python.org Sat Oct 27 14:09:16 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 18:09:16 -0000 Subject: [Python-checkins] unittest documentation: Spell pytest without the dot (GH-9820) Message-ID: https://github.com/python/cpython/commit/d855f2fdbd73016ece9b58e6f6ac26cf986fabf6 commit: d855f2fdbd73016ece9b58e6f6ac26cf986fabf6 branch: master author: Andreas Pelme committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-27T11:09:12-07:00 summary: unittest documentation: Spell pytest without the dot (GH-9820) Referring to ``pytest`` as ``py.test`` is deprecated. files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index b35a724fc540..1153459029ce 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -56,7 +56,7 @@ test runner Kent Beck's original paper on testing frameworks using the pattern shared by :mod:`unittest`. - `Nose `_ and `py.test `_ + `Nose `_ and `pytest `_ Third-party unittest frameworks with a lighter-weight syntax for writing tests. For example, ``assert func(10) == 42``. From webhook-mailer at python.org Sat Oct 27 14:17:19 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 18:17:19 -0000 Subject: [Python-checkins] unittest documentation: Spell pytest without the dot (GH-9820) Message-ID: https://github.com/python/cpython/commit/6f82bdc6e09379346b14f0aded3df894a7ef4a8c commit: 6f82bdc6e09379346b14f0aded3df894a7ef4a8c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-27T11:17:15-07:00 summary: unittest documentation: Spell pytest without the dot (GH-9820) Referring to ``pytest`` as ``py.test`` is deprecated. (cherry picked from commit d855f2fdbd73016ece9b58e6f6ac26cf986fabf6) Co-authored-by: Andreas Pelme files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index b35a724fc540..1153459029ce 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -56,7 +56,7 @@ test runner Kent Beck's original paper on testing frameworks using the pattern shared by :mod:`unittest`. - `Nose `_ and `py.test `_ + `Nose `_ and `pytest `_ Third-party unittest frameworks with a lighter-weight syntax for writing tests. For example, ``assert func(10) == 42``. From webhook-mailer at python.org Sat Oct 27 14:27:36 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 18:27:36 -0000 Subject: [Python-checkins] [2.7] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10157) Message-ID: https://github.com/python/cpython/commit/4704c33d9ccccd73582499640b51cb430e3bd4f2 commit: 4704c33d9ccccd73582499640b51cb430e3bd4f2 branch: 2.7 author: Mariatta committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-27T11:27:33-07:00 summary: [2.7] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10157) Referring to ``pytest`` as ``py.test`` is deprecated.. (cherry picked from commit d855f2fdbd73016ece9b58e6f6ac26cf986fabf6) Co-authored-by: Andreas Pelme files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 06368fcb3d1f..2638d6c68c6f 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -87,7 +87,7 @@ need to derive from a specific class. Kent Beck's original paper on testing frameworks using the pattern shared by :mod:`unittest`. - `Nose `_ and `py.test `_ + `Nose `_ and `pytest `_ Third-party unittest frameworks with a lighter-weight syntax for writing tests. For example, ``assert func(10) == 42``. From webhook-mailer at python.org Sat Oct 27 14:28:09 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 18:28:09 -0000 Subject: [Python-checkins] [3.6] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10156) Message-ID: https://github.com/python/cpython/commit/8e5e37e5de319e37b263fbea4b463b8ef0f834c4 commit: 8e5e37e5de319e37b263fbea4b463b8ef0f834c4 branch: 3.6 author: Mariatta committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-27T11:28:06-07:00 summary: [3.6] unittest documentation: Spell pytest without the dot (GH-9820) (GH-10156) Referring to ``pytest`` as ``py.test`` is deprecated.. (cherry picked from commit d855f2fdbd73016ece9b58e6f6ac26cf986fabf6) Co-authored-by: Andreas Pelme files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index dd85e9e33d9c..a43e9453239c 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -56,7 +56,7 @@ test runner Kent Beck's original paper on testing frameworks using the pattern shared by :mod:`unittest`. - `Nose `_ and `py.test `_ + `Nose `_ and `pytest `_ Third-party unittest frameworks with a lighter-weight syntax for writing tests. For example, ``assert func(10) == 42``. @@ -1142,7 +1142,7 @@ Test cases If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*. - Supplying both *delta* and *places* raises a ``TypeError``. + Supplying both *delta* and *places* raises a :exc:`TypeError`. .. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects From webhook-mailer at python.org Sat Oct 27 16:06:49 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 27 Oct 2018 20:06:49 -0000 Subject: [Python-checkins] Fix typo in zipfile documentation. (GH-10151) (GH-10153) Message-ID: https://github.com/python/cpython/commit/c73cd4e05a0f67ac086209bd289bf6d9c8132460 commit: c73cd4e05a0f67ac086209bd289bf6d9c8132460 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Serhiy Storchaka date: 2018-10-27T23:06:46+03:00 summary: Fix typo in zipfile documentation. (GH-10151) (GH-10153) (cherry picked from commit 40bf6cff22185b8ebaab14789e81cff22fbf2275) Co-authored-by: nsrip files: M Doc/library/zipfile.rst diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index c0f2a89a3a17..7804e92e5374 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -363,7 +363,7 @@ ZipFile Objects Return the name of the first bad file, or else return ``None``. .. versionchanged:: 3.6 - Calling :meth:`testfile` on a closed ZipFile will raise a + Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` was raised. From webhook-mailer at python.org Sat Oct 27 16:07:10 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 27 Oct 2018 20:07:10 -0000 Subject: [Python-checkins] Fix typo in zipfile documentation. (GH-10151) (GH-10154) Message-ID: https://github.com/python/cpython/commit/9dfbcf83c66ddcb2c8f2451cb3e65c5036bdec84 commit: 9dfbcf83c66ddcb2c8f2451cb3e65c5036bdec84 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Serhiy Storchaka date: 2018-10-27T23:07:07+03:00 summary: Fix typo in zipfile documentation. (GH-10151) (GH-10154) (cherry picked from commit 40bf6cff22185b8ebaab14789e81cff22fbf2275) Co-authored-by: nsrip files: M Doc/library/zipfile.rst diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index a5d42118ba51..b7563f662ddb 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -347,7 +347,7 @@ ZipFile Objects Return the name of the first bad file, or else return ``None``. .. versionchanged:: 3.6 - Calling :meth:`testfile` on a closed ZipFile will raise a + Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` was raised. From webhook-mailer at python.org Sat Oct 27 16:48:36 2018 From: webhook-mailer at python.org (Steve Dower) Date: Sat, 27 Oct 2018 20:48:36 -0000 Subject: [Python-checkins] bpo-35067: Remove _distutils_findvs and use vswhere.exe instead. (GH-10095) Message-ID: https://github.com/python/cpython/commit/53125a53f483db0af76249b6af6efcdc200eb421 commit: 53125a53f483db0af76249b6af6efcdc200eb421 branch: master author: Steve Dower committer: GitHub date: 2018-10-27T16:48:33-04:00 summary: bpo-35067: Remove _distutils_findvs and use vswhere.exe instead. (GH-10095) files: A Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst D PC/_findvs.cpp D PC/external/Externals.txt D PC/external/include/Setup.Configuration.h D PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PCbuild/_distutils_findvs.vcxproj D PCbuild/_distutils_findvs.vcxproj.filters M Lib/distutils/_msvccompiler.py M PCbuild/pcbuild.proj M PCbuild/pcbuild.sln M Tools/msi/lib/lib_files.wxs diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py index 30b3b4739851..84b4ef59599d 100644 --- a/Lib/distutils/_msvccompiler.py +++ b/Lib/distutils/_msvccompiler.py @@ -56,43 +56,43 @@ def _find_vc2015(): return best_version, best_dir def _find_vc2017(): - import _distutils_findvs - import threading + """Returns "15, path" based on the result of invoking vswhere.exe + If no install is found, returns "None, None" - best_version = 0, # tuple for full version comparisons - best_dir = None + The version is returned to avoid unnecessarily changing the function + result. It may be ignored when the path is not None. + + 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 - # We need to call findall() on its own thread because it will - # initialize COM. - all_packages = [] - def _getall(): - all_packages.extend(_distutils_findvs.findall()) - t = threading.Thread(target=_getall) - t.start() - t.join() - - for name, version_str, path, packages in all_packages: - if 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' in packages: - vc_dir = os.path.join(path, 'VC', 'Auxiliary', 'Build') - if not os.path.isdir(vc_dir): - continue - try: - version = tuple(int(i) for i in version_str.split('.')) - except (ValueError, TypeError): - continue - if version > best_version: - best_version, best_dir = version, vc_dir try: - best_version = best_version[0] - except IndexError: - best_version = None - return best_version, best_dir + path = subprocess.check_output([ + os.path.join(root, "Microsoft Visual Studio", "Installer", "vswhere.exe"), + "-latest", + "-prerelease", + "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "-property", "installationPath", + ], encoding="mbcs", errors="strict").strip() + except (subprocess.CalledProcessError, OSError, UnicodeDecodeError): + return None, None + + path = os.path.join(path, "VC", "Auxiliary", "Build") + if os.path.isdir(path): + return 15, path + + return None, None def _find_vcvarsall(plat_spec): - best_version, best_dir = _find_vc2017() + _, best_dir = _find_vc2017() vcruntime = None vcruntime_plat = 'x64' if 'amd64' in plat_spec else 'x86' - if best_version: + if best_dir: vcredist = os.path.join(best_dir, "..", "..", "redist", "MSVC", "**", "Microsoft.VC141.CRT", "vcruntime140.dll") try: @@ -101,13 +101,13 @@ def _find_vcvarsall(plat_spec): except (ImportError, OSError, LookupError): vcruntime = None - if not best_version: + if not best_dir: best_version, best_dir = _find_vc2015() if best_version: vcruntime = os.path.join(best_dir, 'redist', vcruntime_plat, "Microsoft.VC140.CRT", "vcruntime140.dll") - if not best_version: + if not best_dir: log.debug("No suitable Visual C++ version found") return None, None diff --git a/Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst b/Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst new file mode 100644 index 000000000000..2b8153b6ceea --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst @@ -0,0 +1 @@ +Remove _distutils_findvs module and use vswhere.exe instead. diff --git a/PC/_findvs.cpp b/PC/_findvs.cpp deleted file mode 100644 index ecc68e82e49f..000000000000 --- a/PC/_findvs.cpp +++ /dev/null @@ -1,259 +0,0 @@ -// -// Helper library for location Visual Studio installations -// using the COM-based query API. -// -// Copyright (c) Microsoft Corporation -// Licensed to PSF under a contributor agreement -// - -// Version history -// 2017-05: Initial contribution (Steve Dower) - -#include -#include -#include "external\include\Setup.Configuration.h" - -#include - -static PyObject *error_from_hr(HRESULT hr) -{ - if (FAILED(hr)) - PyErr_Format(PyExc_OSError, "Error %08x", hr); - assert(PyErr_Occurred()); - return nullptr; -} - -static PyObject *get_install_name(ISetupInstance2 *inst) -{ - HRESULT hr; - BSTR name; - PyObject *str = nullptr; - if (FAILED(hr = inst->GetDisplayName(LOCALE_USER_DEFAULT, &name))) - goto error; - str = PyUnicode_FromWideChar(name, SysStringLen(name)); - SysFreeString(name); - return str; -error: - - return error_from_hr(hr); -} - -static PyObject *get_install_version(ISetupInstance *inst) -{ - HRESULT hr; - BSTR ver; - PyObject *str = nullptr; - if (FAILED(hr = inst->GetInstallationVersion(&ver))) - goto error; - str = PyUnicode_FromWideChar(ver, SysStringLen(ver)); - SysFreeString(ver); - return str; -error: - - return error_from_hr(hr); -} - -static PyObject *get_install_path(ISetupInstance *inst) -{ - HRESULT hr; - BSTR path; - PyObject *str = nullptr; - if (FAILED(hr = inst->GetInstallationPath(&path))) - goto error; - str = PyUnicode_FromWideChar(path, SysStringLen(path)); - SysFreeString(path); - return str; -error: - - return error_from_hr(hr); -} - -static PyObject *get_installed_packages(ISetupInstance2 *inst) -{ - HRESULT hr; - PyObject *res = nullptr; - LPSAFEARRAY sa_packages = nullptr; - LONG ub = 0; - IUnknown **packages = nullptr; - PyObject *str = nullptr; - - if (FAILED(hr = inst->GetPackages(&sa_packages)) || - FAILED(hr = SafeArrayAccessData(sa_packages, (void**)&packages)) || - FAILED(SafeArrayGetUBound(sa_packages, 1, &ub)) || - !(res = PyList_New(0))) - goto error; - - for (LONG i = 0; i < ub; ++i) { - ISetupPackageReference *package = nullptr; - BSTR id = nullptr; - PyObject *str = nullptr; - - if (FAILED(hr = packages[i]->QueryInterface(&package)) || - FAILED(hr = package->GetId(&id))) - goto iter_error; - - str = PyUnicode_FromWideChar(id, SysStringLen(id)); - SysFreeString(id); - - if (!str || PyList_Append(res, str) < 0) - goto iter_error; - - Py_CLEAR(str); - package->Release(); - continue; - - iter_error: - if (package) package->Release(); - Py_XDECREF(str); - - goto error; - } - - SafeArrayUnaccessData(sa_packages); - SafeArrayDestroy(sa_packages); - - return res; -error: - if (sa_packages && packages) SafeArrayUnaccessData(sa_packages); - if (sa_packages) SafeArrayDestroy(sa_packages); - Py_XDECREF(res); - - return error_from_hr(hr); -} - -static PyObject *find_all_instances() -{ - ISetupConfiguration *sc = nullptr; - ISetupConfiguration2 *sc2 = nullptr; - IEnumSetupInstances *enm = nullptr; - ISetupInstance *inst = nullptr; - ISetupInstance2 *inst2 = nullptr; - PyObject *res = nullptr; - ULONG fetched; - HRESULT hr; - - if (!(res = PyList_New(0))) - goto error; - - if (FAILED(hr = CoCreateInstance( - __uuidof(SetupConfiguration), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(ISetupConfiguration), - (LPVOID*)&sc - )) && hr != REGDB_E_CLASSNOTREG) - goto error; - - // If the class is not registered, there are no VS instances installed - if (hr == REGDB_E_CLASSNOTREG) - return res; - - if (FAILED(hr = sc->QueryInterface(&sc2)) || - FAILED(hr = sc2->EnumAllInstances(&enm))) - goto error; - - while (SUCCEEDED(enm->Next(1, &inst, &fetched)) && fetched) { - PyObject *name = nullptr; - PyObject *version = nullptr; - PyObject *path = nullptr; - PyObject *packages = nullptr; - PyObject *tuple = nullptr; - - if (FAILED(hr = inst->QueryInterface(&inst2)) || - !(name = get_install_name(inst2)) || - !(version = get_install_version(inst)) || - !(path = get_install_path(inst)) || - !(packages = get_installed_packages(inst2)) || - !(tuple = PyTuple_Pack(4, name, version, path, packages)) || - PyList_Append(res, tuple) < 0) - goto iter_error; - - Py_DECREF(tuple); - Py_DECREF(packages); - Py_DECREF(path); - Py_DECREF(version); - Py_DECREF(name); - continue; - iter_error: - if (inst2) inst2->Release(); - Py_XDECREF(tuple); - Py_XDECREF(packages); - Py_XDECREF(path); - Py_XDECREF(version); - Py_XDECREF(name); - goto error; - } - - enm->Release(); - sc2->Release(); - sc->Release(); - return res; - -error: - if (enm) enm->Release(); - if (sc2) sc2->Release(); - if (sc) sc->Release(); - Py_XDECREF(res); - - return error_from_hr(hr); -} - -PyDoc_STRVAR(findvs_findall_doc, "findall()\ -\ -Finds all installed versions of Visual Studio.\ -\ -This function will initialize COM temporarily. To avoid impact on other parts\ -of your application, use a new thread to make this call."); - -static PyObject *findvs_findall(PyObject *self, PyObject *args, PyObject *kwargs) -{ - HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); - if (hr == RPC_E_CHANGED_MODE) - hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - if (FAILED(hr)) - return error_from_hr(hr); - PyObject *res = find_all_instances(); - CoUninitialize(); - return res; -} - -// List of functions to add to findvs in exec_findvs(). -static PyMethodDef findvs_functions[] = { - { "findall", (PyCFunction)findvs_findall, METH_VARARGS | METH_KEYWORDS, findvs_findall_doc }, - { NULL, NULL, 0, NULL } -}; - -// Initialize findvs. May be called multiple times, so avoid -// using static state. -static int exec_findvs(PyObject *module) -{ - PyModule_AddFunctions(module, findvs_functions); - - return 0; // success -} - -PyDoc_STRVAR(findvs_doc, "The _distutils_findvs helper module"); - -static PyModuleDef_Slot findvs_slots[] = { - { Py_mod_exec, exec_findvs }, - { 0, NULL } -}; - -static PyModuleDef findvs_def = { - PyModuleDef_HEAD_INIT, - "_distutils_findvs", - findvs_doc, - 0, // m_size - NULL, // m_methods - findvs_slots, - NULL, // m_traverse - NULL, // m_clear - NULL, // m_free -}; - -extern "C" { - PyMODINIT_FUNC PyInit__distutils_findvs(void) - { - return PyModuleDef_Init(&findvs_def); - } -} diff --git a/PC/external/Externals.txt b/PC/external/Externals.txt deleted file mode 100644 index 618fe16fd4cf..000000000000 --- a/PC/external/Externals.txt +++ /dev/null @@ -1,3 +0,0 @@ -The files in this folder are from the Microsoft.VisualStudio.Setup.Configuration.Native package on Nuget. - -They are licensed under the MIT license. diff --git a/PC/external/include/Setup.Configuration.h b/PC/external/include/Setup.Configuration.h deleted file mode 100644 index 1fb31878d7af..000000000000 --- a/PC/external/include/Setup.Configuration.h +++ /dev/null @@ -1,827 +0,0 @@ -// The MIT License(MIT) -// Copyright(C) Microsoft Corporation.All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// - -#pragma once - -// Constants -// -#ifndef E_NOTFOUND -#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) -#endif - -#ifndef E_FILENOTFOUND -#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) -#endif - -#ifndef E_NOTSUPPORTED -#define E_NOTSUPPORTED HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) -#endif - -// Enumerations -// -/// -/// The state of an instance. -/// -enum InstanceState -{ - /// - /// The instance state has not been determined. - /// - eNone = 0, - - /// - /// The instance installation path exists. - /// - eLocal = 1, - - /// - /// A product is registered to the instance. - /// - eRegistered = 2, - - /// - /// No reboot is required for the instance. - /// - eNoRebootRequired = 4, - - /// - /// No errors were reported for the instance. - /// - eNoErrors = 8, - - /// - /// The instance represents a complete install. - /// - eComplete = MAXUINT, -}; - -// Forward interface declarations -// -#ifndef __ISetupInstance_FWD_DEFINED__ -#define __ISetupInstance_FWD_DEFINED__ -typedef struct ISetupInstance ISetupInstance; -#endif - -#ifndef __ISetupInstance2_FWD_DEFINED__ -#define __ISetupInstance2_FWD_DEFINED__ -typedef struct ISetupInstance2 ISetupInstance2; -#endif - -#ifndef __ISetupLocalizedProperties_FWD_DEFINED__ -#define __ISetupLocalizedProperties_FWD_DEFINED__ -typedef struct ISetupLocalizedProperties ISetupLocalizedProperties; -#endif - -#ifndef __IEnumSetupInstances_FWD_DEFINED__ -#define __IEnumSetupInstances_FWD_DEFINED__ -typedef struct IEnumSetupInstances IEnumSetupInstances; -#endif - -#ifndef __ISetupConfiguration_FWD_DEFINED__ -#define __ISetupConfiguration_FWD_DEFINED__ -typedef struct ISetupConfiguration ISetupConfiguration; -#endif - -#ifndef __ISetupConfiguration2_FWD_DEFINED__ -#define __ISetupConfiguration2_FWD_DEFINED__ -typedef struct ISetupConfiguration2 ISetupConfiguration2; -#endif - -#ifndef __ISetupPackageReference_FWD_DEFINED__ -#define __ISetupPackageReference_FWD_DEFINED__ -typedef struct ISetupPackageReference ISetupPackageReference; -#endif - -#ifndef __ISetupHelper_FWD_DEFINED__ -#define __ISetupHelper_FWD_DEFINED__ -typedef struct ISetupHelper ISetupHelper; -#endif - -#ifndef __ISetupErrorState_FWD_DEFINED__ -#define __ISetupErrorState_FWD_DEFINED__ -typedef struct ISetupErrorState ISetupErrorState; -#endif - -#ifndef __ISetupErrorState2_FWD_DEFINED__ -#define __ISetupErrorState2_FWD_DEFINED__ -typedef struct ISetupErrorState2 ISetupErrorState2; -#endif - -#ifndef __ISetupFailedPackageReference_FWD_DEFINED__ -#define __ISetupFailedPackageReference_FWD_DEFINED__ -typedef struct ISetupFailedPackageReference ISetupFailedPackageReference; -#endif - -#ifndef __ISetupFailedPackageReference2_FWD_DEFINED__ -#define __ISetupFailedPackageReference2_FWD_DEFINED__ -typedef struct ISetupFailedPackageReference2 ISetupFailedPackageReference2; -#endif - -#ifndef __ISetupPropertyStore_FWD_DEFINED__ -#define __ISetupPropertyStore_FWD_DEFINED__ -typedef struct ISetupPropertyStore ISetupPropertyStore; -#endif - -#ifndef __ISetupLocalizedPropertyStore_FWD_DEFINED__ -#define __ISetupLocalizedPropertyStore_FWD_DEFINED__ -typedef struct ISetupLocalizedPropertyStore ISetupLocalizedPropertyStore; -#endif - -// Forward class declarations -// -#ifndef __SetupConfiguration_FWD_DEFINED__ -#define __SetupConfiguration_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SetupConfiguration SetupConfiguration; -#endif - -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// Interface definitions -// -EXTERN_C const IID IID_ISetupInstance; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about an instance of a product. -/// -struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown -{ - /// - /// Gets the instance identifier (should match the name of the parent instance directory). - /// - /// The instance identifier. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetInstanceId)( - _Out_ BSTR* pbstrInstanceId - ) = 0; - - /// - /// Gets the local date and time when the installation was originally installed. - /// - /// The local date and time when the installation was originally installed. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallDate)( - _Out_ LPFILETIME pInstallDate - ) = 0; - - /// - /// Gets the unique name of the installation, often indicating the branch and other information used for telemetry. - /// - /// The unique name of the installation, often indicating the branch and other information used for telemetry. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallationName)( - _Out_ BSTR* pbstrInstallationName - ) = 0; - - /// - /// Gets the path to the installation root of the product. - /// - /// The path to the installation root of the product. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallationPath)( - _Out_ BSTR* pbstrInstallationPath - ) = 0; - - /// - /// Gets the version of the product installed in this instance. - /// - /// The version of the product installed in this instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallationVersion)( - _Out_ BSTR* pbstrInstallationVersion - ) = 0; - - /// - /// Gets the display name (title) of the product installed in this instance. - /// - /// The LCID for the display name. - /// The display name (title) of the product installed in this instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetDisplayName)( - _In_ LCID lcid, - _Out_ BSTR* pbstrDisplayName - ) = 0; - - /// - /// Gets the description of the product installed in this instance. - /// - /// The LCID for the description. - /// The description of the product installed in this instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetDescription)( - _In_ LCID lcid, - _Out_ BSTR* pbstrDescription - ) = 0; - - /// - /// Resolves the optional relative path to the root path of the instance. - /// - /// A relative path within the instance to resolve, or NULL to get the root path. - /// The full path to the optional relative path within the instance. If the relative path is NULL, the root path will always terminate in a backslash. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(ResolvePath)( - _In_opt_z_ LPCOLESTR pwszRelativePath, - _Out_ BSTR* pbstrAbsolutePath - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupInstance2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about an instance of a product. -/// -struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance -{ - /// - /// Gets the state of the instance. - /// - /// The state of the instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetState)( - _Out_ InstanceState* pState - ) = 0; - - /// - /// Gets an array of package references registered to the instance. - /// - /// Pointer to an array of . - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined. - STDMETHOD(GetPackages)( - _Out_ LPSAFEARRAY* ppsaPackages - ) = 0; - - /// - /// Gets a pointer to the that represents the registered product. - /// - /// Pointer to an instance of . This may be NULL if does not return . - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined. - STDMETHOD(GetProduct)( - _Outptr_result_maybenull_ ISetupPackageReference** ppPackage - ) = 0; - - /// - /// Gets the relative path to the product application, if available. - /// - /// The relative path to the product application, if available. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetProductPath)( - _Outptr_result_maybenull_ BSTR* pbstrProductPath - ) = 0; - - /// - /// Gets the error state of the instance, if available. - /// - /// The error state of the instance, if available. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetErrors)( - _Outptr_result_maybenull_ ISetupErrorState** ppErrorState - ) = 0; - - /// - /// Gets a value indicating whether the instance can be launched. - /// - /// Whether the instance can be launched. - /// Standard HRESULT indicating success or failure. - /// - /// An instance could have had errors during install but still be launched. Some features may not work correctly, but others will. - /// - STDMETHOD(IsLaunchable)( - _Out_ VARIANT_BOOL* pfIsLaunchable - ) = 0; - - /// - /// Gets a value indicating whether the instance is complete. - /// - /// Whether the instance is complete. - /// Standard HRESULT indicating success or failure. - /// - /// An instance is complete if it had no errors during install, resume, or repair. - /// - STDMETHOD(IsComplete)( - _Out_ VARIANT_BOOL* pfIsComplete - ) = 0; - - /// - /// Gets product-specific properties. - /// - /// A pointer to an instance of . This may be NULL if no properties are defined. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetProperties)( - _Outptr_result_maybenull_ ISetupPropertyStore** ppProperties - ) = 0; - - /// - /// Gets the directory path to the setup engine that installed the instance. - /// - /// The directory path to the setup engine that installed the instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetEnginePath)( - _Outptr_result_maybenull_ BSTR* pbstrEnginePath - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupLocalizedProperties; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Provides localized properties of an instance of a product. -/// -struct DECLSPEC_UUID("F4BD7382-FE27-4AB4-B974-9905B2A148B0") DECLSPEC_NOVTABLE ISetupLocalizedProperties : public IUnknown -{ - /// - /// Gets localized product-specific properties. - /// - /// A pointer to an instance of . This may be NULL if no properties are defined. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLocalizedProperties)( - _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedProperties - ) = 0; - - /// - /// Gets localized channel-specific properties. - /// - /// A pointer to an instance of . This may be NULL if no channel properties are defined. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLocalizedChannelProperties)( - _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedChannelProperties - ) = 0; -}; -#endif - -EXTERN_C const IID IID_IEnumSetupInstances; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// An enumerator of installed objects. -/// -struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown -{ - /// - /// Retrieves the next set of product instances in the enumeration sequence. - /// - /// The number of product instances to retrieve. - /// A pointer to an array of . - /// A pointer to the number of product instances retrieved. If is 1 this parameter may be NULL. - /// S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an could not be allocated. - STDMETHOD(Next)( - _In_ ULONG celt, - _Out_writes_to_(celt, *pceltFetched) ISetupInstance** rgelt, - _Out_opt_ _Deref_out_range_(0, celt) ULONG* pceltFetched - ) = 0; - - /// - /// Skips the next set of product instances in the enumeration sequence. - /// - /// The number of product instances to skip. - /// S_OK if the number of elements could be skipped; otherwise, S_FALSE; - STDMETHOD(Skip)( - _In_ ULONG celt - ) = 0; - - /// - /// Resets the enumeration sequence to the beginning. - /// - /// Always returns S_OK; - STDMETHOD(Reset)(void) = 0; - - /// - /// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence. - /// - /// A pointer to a pointer to a new interface. If the method fails, this parameter is undefined. - /// S_OK if a clone was returned; otherwise, E_OUTOFMEMORY. - STDMETHOD(Clone)( - _Deref_out_opt_ IEnumSetupInstances** ppenum - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupConfiguration; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Gets information about product instances installed on the machine. -/// -struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown -{ - /// - /// Enumerates all launchable product instances installed. - /// - /// An enumeration of completed, installed product instances. - /// Standard HRESULT indicating success or failure. - STDMETHOD(EnumInstances)( - _Out_ IEnumSetupInstances** ppEnumInstances - ) = 0; - - /// - /// Gets the instance for the current process path. - /// - /// The instance for the current process path. - /// - /// The instance for the current process path, or E_NOTFOUND if not found. - /// The may indicate the instance is invalid. - /// - /// - /// The returned instance may not be launchable. - /// -STDMETHOD(GetInstanceForCurrentProcess)( - _Out_ ISetupInstance** ppInstance - ) = 0; - - /// - /// Gets the instance for the given path. - /// - /// The instance for the given path. - /// - /// The instance for the given path, or E_NOTFOUND if not found. - /// The may indicate the instance is invalid. - /// - /// - /// The returned instance may not be launchable. - /// -STDMETHOD(GetInstanceForPath)( - _In_z_ LPCWSTR wzPath, - _Out_ ISetupInstance** ppInstance - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupConfiguration2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Gets information about product instances. -/// -struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration -{ - /// - /// Enumerates all product instances. - /// - /// An enumeration of all product instances. - /// Standard HRESULT indicating success or failure. - STDMETHOD(EnumAllInstances)( - _Out_ IEnumSetupInstances** ppEnumInstances - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupPackageReference; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// A reference to a package. -/// -struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown -{ - /// - /// Gets the general package identifier. - /// - /// The general package identifier. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetId)( - _Out_ BSTR* pbstrId - ) = 0; - - /// - /// Gets the version of the package. - /// - /// The version of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetVersion)( - _Out_ BSTR* pbstrVersion - ) = 0; - - /// - /// Gets the target process architecture of the package. - /// - /// The target process architecture of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetChip)( - _Out_ BSTR* pbstrChip - ) = 0; - - /// - /// Gets the language and optional region identifier. - /// - /// The language and optional region identifier. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLanguage)( - _Out_ BSTR* pbstrLanguage - ) = 0; - - /// - /// Gets the build branch of the package. - /// - /// The build branch of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetBranch)( - _Out_ BSTR* pbstrBranch - ) = 0; - - /// - /// Gets the type of the package. - /// - /// The type of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetType)( - _Out_ BSTR* pbstrType - ) = 0; - - /// - /// Gets the unique identifier consisting of all defined tokens. - /// - /// The unique identifier consisting of all defined tokens. - /// Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required). - STDMETHOD(GetUniqueId)( - _Out_ BSTR* pbstrUniqueId - ) = 0; - - /// - /// Gets a value indicating whether the package refers to an external extension. - /// - /// A value indicating whether the package refers to an external extension. - /// Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required). - STDMETHOD(GetIsExtension)( - _Out_ VARIANT_BOOL* pfIsExtension - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupHelper; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Helper functions. -/// -/// -/// You can query for this interface from the class. -/// -struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown -{ - /// - /// Parses a dotted quad version string into a 64-bit unsigned integer. - /// - /// The dotted quad version string to parse, e.g. 1.2.3.4. - /// A 64-bit unsigned integer representing the version. You can compare this to other versions. - /// Standard HRESULT indicating success or failure, including E_INVALIDARG if the version is not valid. - STDMETHOD(ParseVersion)( - _In_ LPCOLESTR pwszVersion, - _Out_ PULONGLONG pullVersion - ) = 0; - - /// - /// Parses a dotted quad version string into a 64-bit unsigned integer. - /// - /// The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer. - /// A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions. - /// A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions. - /// Standard HRESULT indicating success or failure, including E_INVALIDARG if the version range is not valid. - STDMETHOD(ParseVersionRange)( - _In_ LPCOLESTR pwszVersionRange, - _Out_ PULONGLONG pullMinVersion, - _Out_ PULONGLONG pullMaxVersion - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupErrorState; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about the error state of an instance. -/// -struct DECLSPEC_UUID("46DCCD94-A287-476A-851E-DFBC2FFDBC20") DECLSPEC_NOVTABLE ISetupErrorState : public IUnknown -{ - /// - /// Gets an array of failed package references. - /// - /// Pointer to an array of , if packages have failed. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetFailedPackages)( - _Outptr_result_maybenull_ LPSAFEARRAY* ppsaFailedPackages - ) = 0; - - /// - /// Gets an array of skipped package references. - /// - /// Pointer to an array of , if packages have been skipped. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetSkippedPackages)( - _Outptr_result_maybenull_ LPSAFEARRAY* ppsaSkippedPackages - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupErrorState2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about the error state of an instance. -/// -struct DECLSPEC_UUID("9871385B-CA69-48F2-BC1F-7A37CBF0B1EF") DECLSPEC_NOVTABLE ISetupErrorState2 : public ISetupErrorState -{ - /// - /// Gets the path to the error log. - /// - /// The path to the error log. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetErrorLogFilePath)( - _Outptr_result_maybenull_ BSTR* pbstrErrorLogFilePath - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupFailedPackageReference; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// A reference to a failed package. -/// -struct DECLSPEC_UUID("E73559CD-7003-4022-B134-27DC650B280F") DECLSPEC_NOVTABLE ISetupFailedPackageReference : public ISetupPackageReference -{ -}; - -#endif - -EXTERN_C const IID IID_ISetupFailedPackageReference2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// A reference to a failed package. -/// -struct DECLSPEC_UUID("0FAD873E-E874-42E3-B268-4FE2F096B9CA") DECLSPEC_NOVTABLE ISetupFailedPackageReference2 : public ISetupFailedPackageReference -{ - /// - /// Gets the path to the optional package log. - /// - /// The path to the optional package log. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLogFilePath)( - _Outptr_result_maybenull_ BSTR* pbstrLogFilePath - ) = 0; - - /// - /// Gets the description of the package failure. - /// - /// The description of the package failure. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetDescription)( - _Outptr_result_maybenull_ BSTR* pbstrDescription - ) = 0; - - /// - /// Gets the signature to use for feedback reporting. - /// - /// The signature to use for feedback reporting. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetSignature)( - _Outptr_result_maybenull_ BSTR* pbstrSignature - ) = 0; - - /// - /// Gets the array of details for this package failure. - /// - /// Pointer to an array of details as BSTRs. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetDetails)( - _Out_ LPSAFEARRAY* ppsaDetails - ) = 0; - - /// - /// Gets an array of packages affected by this package failure. - /// - /// Pointer to an array of for packages affected by this package failure. This may be NULL. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetAffectedPackages)( - _Out_ LPSAFEARRAY* ppsaAffectedPackages - ) = 0; -}; - -#endif - -EXTERN_C const IID IID_ISetupPropertyStore; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Provides named properties. -/// -/// -/// You can get this from an , , or derivative. -/// -struct DECLSPEC_UUID("C601C175-A3BE-44BC-91F6-4568D230FC83") DECLSPEC_NOVTABLE ISetupPropertyStore : public IUnknown -{ - /// - /// Gets an array of property names in this property store. - /// - /// Pointer to an array of property names as BSTRs. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetNames)( - _Out_ LPSAFEARRAY* ppsaNames - ) = 0; - - /// - /// Gets the value of a named property in this property store. - /// - /// The name of the property to get. - /// The value of the property. - /// Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported. - STDMETHOD(GetValue)( - _In_ LPCOLESTR pwszName, - _Out_ LPVARIANT pvtValue - ) = 0; -}; - -#endif - -EXTERN_C const IID IID_ISetupLocalizedPropertyStore; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Provides localized named properties. -/// -/// -/// You can get this from an . -/// -struct DECLSPEC_UUID("5BB53126-E0D5-43DF-80F1-6B161E5C6F6C") DECLSPEC_NOVTABLE ISetupLocalizedPropertyStore : public IUnknown -{ - /// - /// Gets an array of property names in this property store. - /// - /// The LCID for the property names. - /// Pointer to an array of property names as BSTRs. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetNames)( - _In_ LCID lcid, - _Out_ LPSAFEARRAY* ppsaNames - ) = 0; - - /// - /// Gets the value of a named property in this property store. - /// - /// The name of the property to get. - /// The LCID for the property. - /// The value of the property. - /// Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported. - STDMETHOD(GetValue)( - _In_ LPCOLESTR pwszName, - _In_ LCID lcid, - _Out_ LPVARIANT pvtValue - ) = 0; -}; - -#endif - -// Class declarations -// -EXTERN_C const CLSID CLSID_SetupConfiguration; - -#ifdef __cplusplus -/// -/// This class implements , , and . -/// -class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration; -#endif - -// Function declarations -// -/// -/// Gets an that provides information about product instances installed on the machine. -/// -/// The that provides information about product instances installed on the machine. -/// Reserved for future use. -/// Standard HRESULT indicating success or failure. -STDMETHODIMP GetSetupConfiguration( - _Out_ ISetupConfiguration** ppConfiguration, - _Reserved_ LPVOID pReserved -); - -#ifdef __cplusplus -} -#endif diff --git a/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 675a501d8cb5..000000000000 Binary files a/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 40f70b2682d3..000000000000 Binary files a/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 675a501d8cb5..000000000000 Binary files a/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 40f70b2682d3..000000000000 Binary files a/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PCbuild/_distutils_findvs.vcxproj b/PCbuild/_distutils_findvs.vcxproj deleted file mode 100644 index 3db1280ac88c..000000000000 --- a/PCbuild/_distutils_findvs.vcxproj +++ /dev/null @@ -1,83 +0,0 @@ -? - - - - Debug - Win32 - - - Debug - x64 - - - PGInstrument - Win32 - - - PGInstrument - x64 - - - PGUpdate - Win32 - - - PGUpdate - x64 - - - Release - Win32 - - - Release - x64 - - - - {41ADEDF9-11D8-474E-B4D7-BB82332C878E} - _distutils_findvs - Win32Proj - - - - - DynamicLibrary - NotSet - - - - .pyd - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - - - - version.lib;ole32.lib;oleaut32.lib;Microsoft.VisualStudio.Setup.Configuration.Native.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName) - - - - - - - - - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - - - - - - diff --git a/PCbuild/_distutils_findvs.vcxproj.filters b/PCbuild/_distutils_findvs.vcxproj.filters deleted file mode 100644 index f48d74fd69fd..000000000000 --- a/PCbuild/_distutils_findvs.vcxproj.filters +++ /dev/null @@ -1,16 +0,0 @@ -? - - - - - - - {c56a5dd3-7838-48e9-a781-855d8be7370f} - - - - - Source Files - - - \ No newline at end of file diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index 5e341959bd3a..9e103e12103f 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -49,7 +49,7 @@ - + diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index 0443610331e7..59b3861ed406 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -93,8 +93,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj", "{12728250-16EC-4DC6-94D7-E21DD88947F8}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_distutils_findvs", "_distutils_findvs.vcxproj", "{41ADEDF9-11D8-474E-B4D7-BB82332C878E}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -695,22 +693,6 @@ Global {12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|Win32.Build.0 = Release|Win32 {12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.ActiveCfg = Release|x64 {12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.Build.0 = Release|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|Win32.ActiveCfg = Debug|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|Win32.Build.0 = Debug|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|x64.ActiveCfg = Debug|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|x64.Build.0 = Debug|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|Win32.Build.0 = PGInstrument|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|x64.ActiveCfg = PGInstrument|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|x64.Build.0 = PGInstrument|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|Win32.Build.0 = PGUpdate|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|x64.ActiveCfg = PGUpdate|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|x64.Build.0 = PGUpdate|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|Win32.ActiveCfg = Release|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|Win32.Build.0 = Release|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|x64.ActiveCfg = Release|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tools/msi/lib/lib_files.wxs b/Tools/msi/lib/lib_files.wxs index 46ddcb41e9aa..da9d1c9f346c 100644 --- a/Tools/msi/lib/lib_files.wxs +++ b/Tools/msi/lib/lib_files.wxs @@ -1,6 +1,6 @@ ? - + From webhook-mailer at python.org Sat Oct 27 17:06:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 27 Oct 2018 21:06:23 -0000 Subject: [Python-checkins] bpo-35067: Remove _distutils_findvs and use vswhere.exe instead. (GH-10095) Message-ID: https://github.com/python/cpython/commit/e2cf819539c836b670bf2ea4dd3c72ee39e084f1 commit: e2cf819539c836b670bf2ea4dd3c72ee39e084f1 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-27T14:06:20-07:00 summary: bpo-35067: Remove _distutils_findvs and use vswhere.exe instead. (GH-10095) (cherry picked from commit 53125a53f483db0af76249b6af6efcdc200eb421) Co-authored-by: Steve Dower files: A Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst D PC/_findvs.cpp D PC/external/Externals.txt D PC/external/include/Setup.Configuration.h D PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib D PCbuild/_distutils_findvs.vcxproj D PCbuild/_distutils_findvs.vcxproj.filters M Lib/distutils/_msvccompiler.py M PCbuild/pcbuild.proj M PCbuild/pcbuild.sln M Tools/msi/lib/lib_files.wxs diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py index 30b3b4739851..84b4ef59599d 100644 --- a/Lib/distutils/_msvccompiler.py +++ b/Lib/distutils/_msvccompiler.py @@ -56,43 +56,43 @@ def _find_vc2015(): return best_version, best_dir def _find_vc2017(): - import _distutils_findvs - import threading + """Returns "15, path" based on the result of invoking vswhere.exe + If no install is found, returns "None, None" - best_version = 0, # tuple for full version comparisons - best_dir = None + The version is returned to avoid unnecessarily changing the function + result. It may be ignored when the path is not None. + + 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 - # We need to call findall() on its own thread because it will - # initialize COM. - all_packages = [] - def _getall(): - all_packages.extend(_distutils_findvs.findall()) - t = threading.Thread(target=_getall) - t.start() - t.join() - - for name, version_str, path, packages in all_packages: - if 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' in packages: - vc_dir = os.path.join(path, 'VC', 'Auxiliary', 'Build') - if not os.path.isdir(vc_dir): - continue - try: - version = tuple(int(i) for i in version_str.split('.')) - except (ValueError, TypeError): - continue - if version > best_version: - best_version, best_dir = version, vc_dir try: - best_version = best_version[0] - except IndexError: - best_version = None - return best_version, best_dir + path = subprocess.check_output([ + os.path.join(root, "Microsoft Visual Studio", "Installer", "vswhere.exe"), + "-latest", + "-prerelease", + "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "-property", "installationPath", + ], encoding="mbcs", errors="strict").strip() + except (subprocess.CalledProcessError, OSError, UnicodeDecodeError): + return None, None + + path = os.path.join(path, "VC", "Auxiliary", "Build") + if os.path.isdir(path): + return 15, path + + return None, None def _find_vcvarsall(plat_spec): - best_version, best_dir = _find_vc2017() + _, best_dir = _find_vc2017() vcruntime = None vcruntime_plat = 'x64' if 'amd64' in plat_spec else 'x86' - if best_version: + if best_dir: vcredist = os.path.join(best_dir, "..", "..", "redist", "MSVC", "**", "Microsoft.VC141.CRT", "vcruntime140.dll") try: @@ -101,13 +101,13 @@ def _find_vcvarsall(plat_spec): except (ImportError, OSError, LookupError): vcruntime = None - if not best_version: + if not best_dir: best_version, best_dir = _find_vc2015() if best_version: vcruntime = os.path.join(best_dir, 'redist', vcruntime_plat, "Microsoft.VC140.CRT", "vcruntime140.dll") - if not best_version: + if not best_dir: log.debug("No suitable Visual C++ version found") return None, None diff --git a/Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst b/Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst new file mode 100644 index 000000000000..2b8153b6ceea --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-10-25-11-29-22.bpo-35067.RHWi7W.rst @@ -0,0 +1 @@ +Remove _distutils_findvs module and use vswhere.exe instead. diff --git a/PC/_findvs.cpp b/PC/_findvs.cpp deleted file mode 100644 index ecc68e82e49f..000000000000 --- a/PC/_findvs.cpp +++ /dev/null @@ -1,259 +0,0 @@ -// -// Helper library for location Visual Studio installations -// using the COM-based query API. -// -// Copyright (c) Microsoft Corporation -// Licensed to PSF under a contributor agreement -// - -// Version history -// 2017-05: Initial contribution (Steve Dower) - -#include -#include -#include "external\include\Setup.Configuration.h" - -#include - -static PyObject *error_from_hr(HRESULT hr) -{ - if (FAILED(hr)) - PyErr_Format(PyExc_OSError, "Error %08x", hr); - assert(PyErr_Occurred()); - return nullptr; -} - -static PyObject *get_install_name(ISetupInstance2 *inst) -{ - HRESULT hr; - BSTR name; - PyObject *str = nullptr; - if (FAILED(hr = inst->GetDisplayName(LOCALE_USER_DEFAULT, &name))) - goto error; - str = PyUnicode_FromWideChar(name, SysStringLen(name)); - SysFreeString(name); - return str; -error: - - return error_from_hr(hr); -} - -static PyObject *get_install_version(ISetupInstance *inst) -{ - HRESULT hr; - BSTR ver; - PyObject *str = nullptr; - if (FAILED(hr = inst->GetInstallationVersion(&ver))) - goto error; - str = PyUnicode_FromWideChar(ver, SysStringLen(ver)); - SysFreeString(ver); - return str; -error: - - return error_from_hr(hr); -} - -static PyObject *get_install_path(ISetupInstance *inst) -{ - HRESULT hr; - BSTR path; - PyObject *str = nullptr; - if (FAILED(hr = inst->GetInstallationPath(&path))) - goto error; - str = PyUnicode_FromWideChar(path, SysStringLen(path)); - SysFreeString(path); - return str; -error: - - return error_from_hr(hr); -} - -static PyObject *get_installed_packages(ISetupInstance2 *inst) -{ - HRESULT hr; - PyObject *res = nullptr; - LPSAFEARRAY sa_packages = nullptr; - LONG ub = 0; - IUnknown **packages = nullptr; - PyObject *str = nullptr; - - if (FAILED(hr = inst->GetPackages(&sa_packages)) || - FAILED(hr = SafeArrayAccessData(sa_packages, (void**)&packages)) || - FAILED(SafeArrayGetUBound(sa_packages, 1, &ub)) || - !(res = PyList_New(0))) - goto error; - - for (LONG i = 0; i < ub; ++i) { - ISetupPackageReference *package = nullptr; - BSTR id = nullptr; - PyObject *str = nullptr; - - if (FAILED(hr = packages[i]->QueryInterface(&package)) || - FAILED(hr = package->GetId(&id))) - goto iter_error; - - str = PyUnicode_FromWideChar(id, SysStringLen(id)); - SysFreeString(id); - - if (!str || PyList_Append(res, str) < 0) - goto iter_error; - - Py_CLEAR(str); - package->Release(); - continue; - - iter_error: - if (package) package->Release(); - Py_XDECREF(str); - - goto error; - } - - SafeArrayUnaccessData(sa_packages); - SafeArrayDestroy(sa_packages); - - return res; -error: - if (sa_packages && packages) SafeArrayUnaccessData(sa_packages); - if (sa_packages) SafeArrayDestroy(sa_packages); - Py_XDECREF(res); - - return error_from_hr(hr); -} - -static PyObject *find_all_instances() -{ - ISetupConfiguration *sc = nullptr; - ISetupConfiguration2 *sc2 = nullptr; - IEnumSetupInstances *enm = nullptr; - ISetupInstance *inst = nullptr; - ISetupInstance2 *inst2 = nullptr; - PyObject *res = nullptr; - ULONG fetched; - HRESULT hr; - - if (!(res = PyList_New(0))) - goto error; - - if (FAILED(hr = CoCreateInstance( - __uuidof(SetupConfiguration), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(ISetupConfiguration), - (LPVOID*)&sc - )) && hr != REGDB_E_CLASSNOTREG) - goto error; - - // If the class is not registered, there are no VS instances installed - if (hr == REGDB_E_CLASSNOTREG) - return res; - - if (FAILED(hr = sc->QueryInterface(&sc2)) || - FAILED(hr = sc2->EnumAllInstances(&enm))) - goto error; - - while (SUCCEEDED(enm->Next(1, &inst, &fetched)) && fetched) { - PyObject *name = nullptr; - PyObject *version = nullptr; - PyObject *path = nullptr; - PyObject *packages = nullptr; - PyObject *tuple = nullptr; - - if (FAILED(hr = inst->QueryInterface(&inst2)) || - !(name = get_install_name(inst2)) || - !(version = get_install_version(inst)) || - !(path = get_install_path(inst)) || - !(packages = get_installed_packages(inst2)) || - !(tuple = PyTuple_Pack(4, name, version, path, packages)) || - PyList_Append(res, tuple) < 0) - goto iter_error; - - Py_DECREF(tuple); - Py_DECREF(packages); - Py_DECREF(path); - Py_DECREF(version); - Py_DECREF(name); - continue; - iter_error: - if (inst2) inst2->Release(); - Py_XDECREF(tuple); - Py_XDECREF(packages); - Py_XDECREF(path); - Py_XDECREF(version); - Py_XDECREF(name); - goto error; - } - - enm->Release(); - sc2->Release(); - sc->Release(); - return res; - -error: - if (enm) enm->Release(); - if (sc2) sc2->Release(); - if (sc) sc->Release(); - Py_XDECREF(res); - - return error_from_hr(hr); -} - -PyDoc_STRVAR(findvs_findall_doc, "findall()\ -\ -Finds all installed versions of Visual Studio.\ -\ -This function will initialize COM temporarily. To avoid impact on other parts\ -of your application, use a new thread to make this call."); - -static PyObject *findvs_findall(PyObject *self, PyObject *args, PyObject *kwargs) -{ - HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); - if (hr == RPC_E_CHANGED_MODE) - hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - if (FAILED(hr)) - return error_from_hr(hr); - PyObject *res = find_all_instances(); - CoUninitialize(); - return res; -} - -// List of functions to add to findvs in exec_findvs(). -static PyMethodDef findvs_functions[] = { - { "findall", (PyCFunction)findvs_findall, METH_VARARGS | METH_KEYWORDS, findvs_findall_doc }, - { NULL, NULL, 0, NULL } -}; - -// Initialize findvs. May be called multiple times, so avoid -// using static state. -static int exec_findvs(PyObject *module) -{ - PyModule_AddFunctions(module, findvs_functions); - - return 0; // success -} - -PyDoc_STRVAR(findvs_doc, "The _distutils_findvs helper module"); - -static PyModuleDef_Slot findvs_slots[] = { - { Py_mod_exec, exec_findvs }, - { 0, NULL } -}; - -static PyModuleDef findvs_def = { - PyModuleDef_HEAD_INIT, - "_distutils_findvs", - findvs_doc, - 0, // m_size - NULL, // m_methods - findvs_slots, - NULL, // m_traverse - NULL, // m_clear - NULL, // m_free -}; - -extern "C" { - PyMODINIT_FUNC PyInit__distutils_findvs(void) - { - return PyModuleDef_Init(&findvs_def); - } -} diff --git a/PC/external/Externals.txt b/PC/external/Externals.txt deleted file mode 100644 index 618fe16fd4cf..000000000000 --- a/PC/external/Externals.txt +++ /dev/null @@ -1,3 +0,0 @@ -The files in this folder are from the Microsoft.VisualStudio.Setup.Configuration.Native package on Nuget. - -They are licensed under the MIT license. diff --git a/PC/external/include/Setup.Configuration.h b/PC/external/include/Setup.Configuration.h deleted file mode 100644 index 1fb31878d7af..000000000000 --- a/PC/external/include/Setup.Configuration.h +++ /dev/null @@ -1,827 +0,0 @@ -// The MIT License(MIT) -// Copyright(C) Microsoft Corporation.All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// - -#pragma once - -// Constants -// -#ifndef E_NOTFOUND -#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) -#endif - -#ifndef E_FILENOTFOUND -#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) -#endif - -#ifndef E_NOTSUPPORTED -#define E_NOTSUPPORTED HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) -#endif - -// Enumerations -// -/// -/// The state of an instance. -/// -enum InstanceState -{ - /// - /// The instance state has not been determined. - /// - eNone = 0, - - /// - /// The instance installation path exists. - /// - eLocal = 1, - - /// - /// A product is registered to the instance. - /// - eRegistered = 2, - - /// - /// No reboot is required for the instance. - /// - eNoRebootRequired = 4, - - /// - /// No errors were reported for the instance. - /// - eNoErrors = 8, - - /// - /// The instance represents a complete install. - /// - eComplete = MAXUINT, -}; - -// Forward interface declarations -// -#ifndef __ISetupInstance_FWD_DEFINED__ -#define __ISetupInstance_FWD_DEFINED__ -typedef struct ISetupInstance ISetupInstance; -#endif - -#ifndef __ISetupInstance2_FWD_DEFINED__ -#define __ISetupInstance2_FWD_DEFINED__ -typedef struct ISetupInstance2 ISetupInstance2; -#endif - -#ifndef __ISetupLocalizedProperties_FWD_DEFINED__ -#define __ISetupLocalizedProperties_FWD_DEFINED__ -typedef struct ISetupLocalizedProperties ISetupLocalizedProperties; -#endif - -#ifndef __IEnumSetupInstances_FWD_DEFINED__ -#define __IEnumSetupInstances_FWD_DEFINED__ -typedef struct IEnumSetupInstances IEnumSetupInstances; -#endif - -#ifndef __ISetupConfiguration_FWD_DEFINED__ -#define __ISetupConfiguration_FWD_DEFINED__ -typedef struct ISetupConfiguration ISetupConfiguration; -#endif - -#ifndef __ISetupConfiguration2_FWD_DEFINED__ -#define __ISetupConfiguration2_FWD_DEFINED__ -typedef struct ISetupConfiguration2 ISetupConfiguration2; -#endif - -#ifndef __ISetupPackageReference_FWD_DEFINED__ -#define __ISetupPackageReference_FWD_DEFINED__ -typedef struct ISetupPackageReference ISetupPackageReference; -#endif - -#ifndef __ISetupHelper_FWD_DEFINED__ -#define __ISetupHelper_FWD_DEFINED__ -typedef struct ISetupHelper ISetupHelper; -#endif - -#ifndef __ISetupErrorState_FWD_DEFINED__ -#define __ISetupErrorState_FWD_DEFINED__ -typedef struct ISetupErrorState ISetupErrorState; -#endif - -#ifndef __ISetupErrorState2_FWD_DEFINED__ -#define __ISetupErrorState2_FWD_DEFINED__ -typedef struct ISetupErrorState2 ISetupErrorState2; -#endif - -#ifndef __ISetupFailedPackageReference_FWD_DEFINED__ -#define __ISetupFailedPackageReference_FWD_DEFINED__ -typedef struct ISetupFailedPackageReference ISetupFailedPackageReference; -#endif - -#ifndef __ISetupFailedPackageReference2_FWD_DEFINED__ -#define __ISetupFailedPackageReference2_FWD_DEFINED__ -typedef struct ISetupFailedPackageReference2 ISetupFailedPackageReference2; -#endif - -#ifndef __ISetupPropertyStore_FWD_DEFINED__ -#define __ISetupPropertyStore_FWD_DEFINED__ -typedef struct ISetupPropertyStore ISetupPropertyStore; -#endif - -#ifndef __ISetupLocalizedPropertyStore_FWD_DEFINED__ -#define __ISetupLocalizedPropertyStore_FWD_DEFINED__ -typedef struct ISetupLocalizedPropertyStore ISetupLocalizedPropertyStore; -#endif - -// Forward class declarations -// -#ifndef __SetupConfiguration_FWD_DEFINED__ -#define __SetupConfiguration_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SetupConfiguration SetupConfiguration; -#endif - -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// Interface definitions -// -EXTERN_C const IID IID_ISetupInstance; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about an instance of a product. -/// -struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown -{ - /// - /// Gets the instance identifier (should match the name of the parent instance directory). - /// - /// The instance identifier. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetInstanceId)( - _Out_ BSTR* pbstrInstanceId - ) = 0; - - /// - /// Gets the local date and time when the installation was originally installed. - /// - /// The local date and time when the installation was originally installed. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallDate)( - _Out_ LPFILETIME pInstallDate - ) = 0; - - /// - /// Gets the unique name of the installation, often indicating the branch and other information used for telemetry. - /// - /// The unique name of the installation, often indicating the branch and other information used for telemetry. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallationName)( - _Out_ BSTR* pbstrInstallationName - ) = 0; - - /// - /// Gets the path to the installation root of the product. - /// - /// The path to the installation root of the product. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallationPath)( - _Out_ BSTR* pbstrInstallationPath - ) = 0; - - /// - /// Gets the version of the product installed in this instance. - /// - /// The version of the product installed in this instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetInstallationVersion)( - _Out_ BSTR* pbstrInstallationVersion - ) = 0; - - /// - /// Gets the display name (title) of the product installed in this instance. - /// - /// The LCID for the display name. - /// The display name (title) of the product installed in this instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetDisplayName)( - _In_ LCID lcid, - _Out_ BSTR* pbstrDisplayName - ) = 0; - - /// - /// Gets the description of the product installed in this instance. - /// - /// The LCID for the description. - /// The description of the product installed in this instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(GetDescription)( - _In_ LCID lcid, - _Out_ BSTR* pbstrDescription - ) = 0; - - /// - /// Resolves the optional relative path to the root path of the instance. - /// - /// A relative path within the instance to resolve, or NULL to get the root path. - /// The full path to the optional relative path within the instance. If the relative path is NULL, the root path will always terminate in a backslash. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined. - STDMETHOD(ResolvePath)( - _In_opt_z_ LPCOLESTR pwszRelativePath, - _Out_ BSTR* pbstrAbsolutePath - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupInstance2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about an instance of a product. -/// -struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance -{ - /// - /// Gets the state of the instance. - /// - /// The state of the instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetState)( - _Out_ InstanceState* pState - ) = 0; - - /// - /// Gets an array of package references registered to the instance. - /// - /// Pointer to an array of . - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined. - STDMETHOD(GetPackages)( - _Out_ LPSAFEARRAY* ppsaPackages - ) = 0; - - /// - /// Gets a pointer to the that represents the registered product. - /// - /// Pointer to an instance of . This may be NULL if does not return . - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined. - STDMETHOD(GetProduct)( - _Outptr_result_maybenull_ ISetupPackageReference** ppPackage - ) = 0; - - /// - /// Gets the relative path to the product application, if available. - /// - /// The relative path to the product application, if available. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetProductPath)( - _Outptr_result_maybenull_ BSTR* pbstrProductPath - ) = 0; - - /// - /// Gets the error state of the instance, if available. - /// - /// The error state of the instance, if available. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetErrors)( - _Outptr_result_maybenull_ ISetupErrorState** ppErrorState - ) = 0; - - /// - /// Gets a value indicating whether the instance can be launched. - /// - /// Whether the instance can be launched. - /// Standard HRESULT indicating success or failure. - /// - /// An instance could have had errors during install but still be launched. Some features may not work correctly, but others will. - /// - STDMETHOD(IsLaunchable)( - _Out_ VARIANT_BOOL* pfIsLaunchable - ) = 0; - - /// - /// Gets a value indicating whether the instance is complete. - /// - /// Whether the instance is complete. - /// Standard HRESULT indicating success or failure. - /// - /// An instance is complete if it had no errors during install, resume, or repair. - /// - STDMETHOD(IsComplete)( - _Out_ VARIANT_BOOL* pfIsComplete - ) = 0; - - /// - /// Gets product-specific properties. - /// - /// A pointer to an instance of . This may be NULL if no properties are defined. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetProperties)( - _Outptr_result_maybenull_ ISetupPropertyStore** ppProperties - ) = 0; - - /// - /// Gets the directory path to the setup engine that installed the instance. - /// - /// The directory path to the setup engine that installed the instance. - /// Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist. - STDMETHOD(GetEnginePath)( - _Outptr_result_maybenull_ BSTR* pbstrEnginePath - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupLocalizedProperties; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Provides localized properties of an instance of a product. -/// -struct DECLSPEC_UUID("F4BD7382-FE27-4AB4-B974-9905B2A148B0") DECLSPEC_NOVTABLE ISetupLocalizedProperties : public IUnknown -{ - /// - /// Gets localized product-specific properties. - /// - /// A pointer to an instance of . This may be NULL if no properties are defined. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLocalizedProperties)( - _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedProperties - ) = 0; - - /// - /// Gets localized channel-specific properties. - /// - /// A pointer to an instance of . This may be NULL if no channel properties are defined. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLocalizedChannelProperties)( - _Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedChannelProperties - ) = 0; -}; -#endif - -EXTERN_C const IID IID_IEnumSetupInstances; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// An enumerator of installed objects. -/// -struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown -{ - /// - /// Retrieves the next set of product instances in the enumeration sequence. - /// - /// The number of product instances to retrieve. - /// A pointer to an array of . - /// A pointer to the number of product instances retrieved. If is 1 this parameter may be NULL. - /// S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an could not be allocated. - STDMETHOD(Next)( - _In_ ULONG celt, - _Out_writes_to_(celt, *pceltFetched) ISetupInstance** rgelt, - _Out_opt_ _Deref_out_range_(0, celt) ULONG* pceltFetched - ) = 0; - - /// - /// Skips the next set of product instances in the enumeration sequence. - /// - /// The number of product instances to skip. - /// S_OK if the number of elements could be skipped; otherwise, S_FALSE; - STDMETHOD(Skip)( - _In_ ULONG celt - ) = 0; - - /// - /// Resets the enumeration sequence to the beginning. - /// - /// Always returns S_OK; - STDMETHOD(Reset)(void) = 0; - - /// - /// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence. - /// - /// A pointer to a pointer to a new interface. If the method fails, this parameter is undefined. - /// S_OK if a clone was returned; otherwise, E_OUTOFMEMORY. - STDMETHOD(Clone)( - _Deref_out_opt_ IEnumSetupInstances** ppenum - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupConfiguration; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Gets information about product instances installed on the machine. -/// -struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown -{ - /// - /// Enumerates all launchable product instances installed. - /// - /// An enumeration of completed, installed product instances. - /// Standard HRESULT indicating success or failure. - STDMETHOD(EnumInstances)( - _Out_ IEnumSetupInstances** ppEnumInstances - ) = 0; - - /// - /// Gets the instance for the current process path. - /// - /// The instance for the current process path. - /// - /// The instance for the current process path, or E_NOTFOUND if not found. - /// The may indicate the instance is invalid. - /// - /// - /// The returned instance may not be launchable. - /// -STDMETHOD(GetInstanceForCurrentProcess)( - _Out_ ISetupInstance** ppInstance - ) = 0; - - /// - /// Gets the instance for the given path. - /// - /// The instance for the given path. - /// - /// The instance for the given path, or E_NOTFOUND if not found. - /// The may indicate the instance is invalid. - /// - /// - /// The returned instance may not be launchable. - /// -STDMETHOD(GetInstanceForPath)( - _In_z_ LPCWSTR wzPath, - _Out_ ISetupInstance** ppInstance - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupConfiguration2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Gets information about product instances. -/// -struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration -{ - /// - /// Enumerates all product instances. - /// - /// An enumeration of all product instances. - /// Standard HRESULT indicating success or failure. - STDMETHOD(EnumAllInstances)( - _Out_ IEnumSetupInstances** ppEnumInstances - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupPackageReference; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// A reference to a package. -/// -struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown -{ - /// - /// Gets the general package identifier. - /// - /// The general package identifier. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetId)( - _Out_ BSTR* pbstrId - ) = 0; - - /// - /// Gets the version of the package. - /// - /// The version of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetVersion)( - _Out_ BSTR* pbstrVersion - ) = 0; - - /// - /// Gets the target process architecture of the package. - /// - /// The target process architecture of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetChip)( - _Out_ BSTR* pbstrChip - ) = 0; - - /// - /// Gets the language and optional region identifier. - /// - /// The language and optional region identifier. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLanguage)( - _Out_ BSTR* pbstrLanguage - ) = 0; - - /// - /// Gets the build branch of the package. - /// - /// The build branch of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetBranch)( - _Out_ BSTR* pbstrBranch - ) = 0; - - /// - /// Gets the type of the package. - /// - /// The type of the package. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetType)( - _Out_ BSTR* pbstrType - ) = 0; - - /// - /// Gets the unique identifier consisting of all defined tokens. - /// - /// The unique identifier consisting of all defined tokens. - /// Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required). - STDMETHOD(GetUniqueId)( - _Out_ BSTR* pbstrUniqueId - ) = 0; - - /// - /// Gets a value indicating whether the package refers to an external extension. - /// - /// A value indicating whether the package refers to an external extension. - /// Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required). - STDMETHOD(GetIsExtension)( - _Out_ VARIANT_BOOL* pfIsExtension - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupHelper; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Helper functions. -/// -/// -/// You can query for this interface from the class. -/// -struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown -{ - /// - /// Parses a dotted quad version string into a 64-bit unsigned integer. - /// - /// The dotted quad version string to parse, e.g. 1.2.3.4. - /// A 64-bit unsigned integer representing the version. You can compare this to other versions. - /// Standard HRESULT indicating success or failure, including E_INVALIDARG if the version is not valid. - STDMETHOD(ParseVersion)( - _In_ LPCOLESTR pwszVersion, - _Out_ PULONGLONG pullVersion - ) = 0; - - /// - /// Parses a dotted quad version string into a 64-bit unsigned integer. - /// - /// The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer. - /// A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions. - /// A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions. - /// Standard HRESULT indicating success or failure, including E_INVALIDARG if the version range is not valid. - STDMETHOD(ParseVersionRange)( - _In_ LPCOLESTR pwszVersionRange, - _Out_ PULONGLONG pullMinVersion, - _Out_ PULONGLONG pullMaxVersion - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupErrorState; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about the error state of an instance. -/// -struct DECLSPEC_UUID("46DCCD94-A287-476A-851E-DFBC2FFDBC20") DECLSPEC_NOVTABLE ISetupErrorState : public IUnknown -{ - /// - /// Gets an array of failed package references. - /// - /// Pointer to an array of , if packages have failed. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetFailedPackages)( - _Outptr_result_maybenull_ LPSAFEARRAY* ppsaFailedPackages - ) = 0; - - /// - /// Gets an array of skipped package references. - /// - /// Pointer to an array of , if packages have been skipped. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetSkippedPackages)( - _Outptr_result_maybenull_ LPSAFEARRAY* ppsaSkippedPackages - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupErrorState2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Information about the error state of an instance. -/// -struct DECLSPEC_UUID("9871385B-CA69-48F2-BC1F-7A37CBF0B1EF") DECLSPEC_NOVTABLE ISetupErrorState2 : public ISetupErrorState -{ - /// - /// Gets the path to the error log. - /// - /// The path to the error log. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetErrorLogFilePath)( - _Outptr_result_maybenull_ BSTR* pbstrErrorLogFilePath - ) = 0; -}; -#endif - -EXTERN_C const IID IID_ISetupFailedPackageReference; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// A reference to a failed package. -/// -struct DECLSPEC_UUID("E73559CD-7003-4022-B134-27DC650B280F") DECLSPEC_NOVTABLE ISetupFailedPackageReference : public ISetupPackageReference -{ -}; - -#endif - -EXTERN_C const IID IID_ISetupFailedPackageReference2; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// A reference to a failed package. -/// -struct DECLSPEC_UUID("0FAD873E-E874-42E3-B268-4FE2F096B9CA") DECLSPEC_NOVTABLE ISetupFailedPackageReference2 : public ISetupFailedPackageReference -{ - /// - /// Gets the path to the optional package log. - /// - /// The path to the optional package log. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetLogFilePath)( - _Outptr_result_maybenull_ BSTR* pbstrLogFilePath - ) = 0; - - /// - /// Gets the description of the package failure. - /// - /// The description of the package failure. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetDescription)( - _Outptr_result_maybenull_ BSTR* pbstrDescription - ) = 0; - - /// - /// Gets the signature to use for feedback reporting. - /// - /// The signature to use for feedback reporting. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetSignature)( - _Outptr_result_maybenull_ BSTR* pbstrSignature - ) = 0; - - /// - /// Gets the array of details for this package failure. - /// - /// Pointer to an array of details as BSTRs. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetDetails)( - _Out_ LPSAFEARRAY* ppsaDetails - ) = 0; - - /// - /// Gets an array of packages affected by this package failure. - /// - /// Pointer to an array of for packages affected by this package failure. This may be NULL. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetAffectedPackages)( - _Out_ LPSAFEARRAY* ppsaAffectedPackages - ) = 0; -}; - -#endif - -EXTERN_C const IID IID_ISetupPropertyStore; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Provides named properties. -/// -/// -/// You can get this from an , , or derivative. -/// -struct DECLSPEC_UUID("C601C175-A3BE-44BC-91F6-4568D230FC83") DECLSPEC_NOVTABLE ISetupPropertyStore : public IUnknown -{ - /// - /// Gets an array of property names in this property store. - /// - /// Pointer to an array of property names as BSTRs. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetNames)( - _Out_ LPSAFEARRAY* ppsaNames - ) = 0; - - /// - /// Gets the value of a named property in this property store. - /// - /// The name of the property to get. - /// The value of the property. - /// Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported. - STDMETHOD(GetValue)( - _In_ LPCOLESTR pwszName, - _Out_ LPVARIANT pvtValue - ) = 0; -}; - -#endif - -EXTERN_C const IID IID_ISetupLocalizedPropertyStore; - -#if defined(__cplusplus) && !defined(CINTERFACE) -/// -/// Provides localized named properties. -/// -/// -/// You can get this from an . -/// -struct DECLSPEC_UUID("5BB53126-E0D5-43DF-80F1-6B161E5C6F6C") DECLSPEC_NOVTABLE ISetupLocalizedPropertyStore : public IUnknown -{ - /// - /// Gets an array of property names in this property store. - /// - /// The LCID for the property names. - /// Pointer to an array of property names as BSTRs. - /// Standard HRESULT indicating success or failure. - STDMETHOD(GetNames)( - _In_ LCID lcid, - _Out_ LPSAFEARRAY* ppsaNames - ) = 0; - - /// - /// Gets the value of a named property in this property store. - /// - /// The name of the property to get. - /// The LCID for the property. - /// The value of the property. - /// Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported. - STDMETHOD(GetValue)( - _In_ LPCOLESTR pwszName, - _In_ LCID lcid, - _Out_ LPVARIANT pvtValue - ) = 0; -}; - -#endif - -// Class declarations -// -EXTERN_C const CLSID CLSID_SetupConfiguration; - -#ifdef __cplusplus -/// -/// This class implements , , and . -/// -class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration; -#endif - -// Function declarations -// -/// -/// Gets an that provides information about product instances installed on the machine. -/// -/// The that provides information about product instances installed on the machine. -/// Reserved for future use. -/// Standard HRESULT indicating success or failure. -STDMETHODIMP GetSetupConfiguration( - _Out_ ISetupConfiguration** ppConfiguration, - _Reserved_ LPVOID pReserved -); - -#ifdef __cplusplus -} -#endif diff --git a/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 675a501d8cb5..000000000000 Binary files a/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 40f70b2682d3..000000000000 Binary files a/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 675a501d8cb5..000000000000 Binary files a/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib b/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib deleted file mode 100644 index 40f70b2682d3..000000000000 Binary files a/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib and /dev/null differ diff --git a/PCbuild/_distutils_findvs.vcxproj b/PCbuild/_distutils_findvs.vcxproj deleted file mode 100644 index 3db1280ac88c..000000000000 --- a/PCbuild/_distutils_findvs.vcxproj +++ /dev/null @@ -1,83 +0,0 @@ -? - - - - Debug - Win32 - - - Debug - x64 - - - PGInstrument - Win32 - - - PGInstrument - x64 - - - PGUpdate - Win32 - - - PGUpdate - x64 - - - Release - Win32 - - - Release - x64 - - - - {41ADEDF9-11D8-474E-B4D7-BB82332C878E} - _distutils_findvs - Win32Proj - - - - - DynamicLibrary - NotSet - - - - .pyd - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - - - - version.lib;ole32.lib;oleaut32.lib;Microsoft.VisualStudio.Setup.Configuration.Native.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName) - - - - - - - - - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - - - - - - diff --git a/PCbuild/_distutils_findvs.vcxproj.filters b/PCbuild/_distutils_findvs.vcxproj.filters deleted file mode 100644 index f48d74fd69fd..000000000000 --- a/PCbuild/_distutils_findvs.vcxproj.filters +++ /dev/null @@ -1,16 +0,0 @@ -? - - - - - - - {c56a5dd3-7838-48e9-a781-855d8be7370f} - - - - - Source Files - - - \ No newline at end of file diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index 5e341959bd3a..9e103e12103f 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -49,7 +49,7 @@ - + diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index 0443610331e7..59b3861ed406 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -93,8 +93,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj", "{12728250-16EC-4DC6-94D7-E21DD88947F8}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_distutils_findvs", "_distutils_findvs.vcxproj", "{41ADEDF9-11D8-474E-B4D7-BB82332C878E}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -695,22 +693,6 @@ Global {12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|Win32.Build.0 = Release|Win32 {12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.ActiveCfg = Release|x64 {12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.Build.0 = Release|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|Win32.ActiveCfg = Debug|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|Win32.Build.0 = Debug|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|x64.ActiveCfg = Debug|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|x64.Build.0 = Debug|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|Win32.Build.0 = PGInstrument|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|x64.ActiveCfg = PGInstrument|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGInstrument|x64.Build.0 = PGInstrument|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|Win32.Build.0 = PGUpdate|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|x64.ActiveCfg = PGUpdate|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|x64.Build.0 = PGUpdate|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|Win32.ActiveCfg = Release|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|Win32.Build.0 = Release|Win32 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|x64.ActiveCfg = Release|x64 - {41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tools/msi/lib/lib_files.wxs b/Tools/msi/lib/lib_files.wxs index 46ddcb41e9aa..da9d1c9f346c 100644 --- a/Tools/msi/lib/lib_files.wxs +++ b/Tools/msi/lib/lib_files.wxs @@ -1,6 +1,6 @@ ? - + From webhook-mailer at python.org Sat Oct 27 20:06:41 2018 From: webhook-mailer at python.org (Raymond Hettinger) Date: Sun, 28 Oct 2018 00:06:41 -0000 Subject: [Python-checkins] bpo-34751: improved hash function for tuples (GH-9471) Message-ID: https://github.com/python/cpython/commit/aeb1be5868623c9cd9cf6d7de3015a43fb005815 commit: aeb1be5868623c9cd9cf6d7de3015a43fb005815 branch: master author: jdemeyer committer: Raymond Hettinger date: 2018-10-27T20:06:38-04:00 summary: bpo-34751: improved hash function for tuples (GH-9471) files: A Misc/NEWS.d/next/Core and Builtins/2018-09-20-15-41-58.bpo-34751.Yiv0pV.rst M Lib/test/test_tuple.py M Objects/tupleobject.c diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py index 84c064f19f2e..929f85316438 100644 --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -62,29 +62,104 @@ def f(): yield i self.assertEqual(list(tuple(f())), list(range(1000))) - def test_hash(self): - # See SF bug 942952: Weakness in tuple hash - # The hash should: - # be non-commutative - # should spread-out closely spaced values - # should not exhibit cancellation in tuples like (x,(x,y)) - # should be distinct from element hashes: hash(x)!=hash((x,)) - # This test exercises those cases. - # For a pure random hash and N=50, the expected number of occupied - # buckets when tossing 252,600 balls into 2**32 buckets - # is 252,592.6, or about 7.4 expected collisions. The - # standard deviation is 2.73. On a box with 64-bit hash - # codes, no collisions are expected. Here we accept no - # more than 15 collisions. Any worse and the hash function - # is sorely suspect. - + # Various tests for hashing of tuples to check that we get few collisions. + # + # Earlier versions of the tuple hash algorithm had collisions + # reported at: + # - https://bugs.python.org/issue942952 + # - https://bugs.python.org/issue34751 + # + # Notes: + # - The hash of tuples is deterministic: if the test passes once on a given + # system, it will always pass. So the probabilities mentioned in the + # test_hash functions below should be interpreted assuming that the + # hashes are random. + # - Due to the structure in the testsuite inputs, collisions are not + # independent. For example, if hash((a,b)) == hash((c,d)), then also + # hash((a,b,x)) == hash((c,d,x)). But the quoted probabilities assume + # independence anyway. + # - We limit the hash to 32 bits in the tests to have a good test on + # 64-bit systems too. Furthermore, this is also a sanity check that the + # lower 32 bits of a 64-bit hash are sufficiently random too. + def test_hash1(self): + # Check for hash collisions between small integers in range(50) and + # certain tuples and nested tuples of such integers. N=50 base = list(range(N)) xp = [(i, j) for i in base for j in base] inps = base + [(i, j) for i in base for j in xp] + \ [(i, j) for i in xp for j in base] + xp + list(zip(base)) - collisions = len(inps) - len(set(map(hash, inps))) - self.assertTrue(collisions <= 15) + self.assertEqual(len(inps), 252600) + hashes = set(hash(x) % 2**32 for x in inps) + collisions = len(inps) - len(hashes) + + # For a pure random 32-bit hash and N = 252,600 test items, the + # expected number of collisions equals + # + # 2**(-32) * N(N-1)/2 = 7.4 + # + # We allow up to 15 collisions, which suffices to make the test + # pass with 99.5% confidence. + self.assertLessEqual(collisions, 15) + + def test_hash2(self): + # Check for hash collisions between small integers (positive and + # negative), tuples and nested tuples of such integers. + + # All numbers in the interval [-n, ..., n] except -1 because + # hash(-1) == hash(-2). + n = 5 + A = [x for x in range(-n, n+1) if x != -1] + + B = A + [(a,) for a in A] + + L2 = [(a,b) for a in A for b in A] + L3 = L2 + [(a,b,c) for a in A for b in A for c in A] + L4 = L3 + [(a,b,c,d) for a in A for b in A for c in A for d in A] + + # T = list of testcases. These consist of all (possibly nested + # at most 2 levels deep) tuples containing at most 4 items from + # the set A. + T = A + T += [(a,) for a in B + L4] + T += [(a,b) for a in L3 for b in B] + T += [(a,b) for a in L2 for b in L2] + T += [(a,b) for a in B for b in L3] + T += [(a,b,c) for a in B for b in B for c in L2] + T += [(a,b,c) for a in B for b in L2 for c in B] + T += [(a,b,c) for a in L2 for b in B for c in B] + T += [(a,b,c,d) for a in B for b in B for c in B for d in B] + self.assertEqual(len(T), 345130) + hashes = set(hash(x) % 2**32 for x in T) + collisions = len(T) - len(hashes) + + # For a pure random 32-bit hash and N = 345,130 test items, the + # expected number of collisions equals + # + # 2**(-32) * N(N-1)/2 = 13.9 + # + # We allow up to 20 collisions, which suffices to make the test + # pass with 95.5% confidence. + self.assertLessEqual(collisions, 20) + + def test_hash3(self): + # Check for hash collisions between tuples containing 0.0 and 0.5. + # The hashes of 0.0 and 0.5 itself differ only in one high bit. + # So this implicitly tests propagation of high bits to low bits. + from itertools import product + T = list(product([0.0, 0.5], repeat=18)) + self.assertEqual(len(T), 262144) + hashes = set(hash(x) % 2**32 for x in T) + collisions = len(T) - len(hashes) + + # For a pure random 32-bit hash and N = 262,144 test items, the + # expected number of collisions equals + # + # 2**(-32) * N(N-1)/2 = 8.0 + # + # We allow up to 15 collisions, which suffices to make the test + # pass with 99.1% confidence. + self.assertLessEqual(collisions, 15) def test_repr(self): l0 = tuple() diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-20-15-41-58.bpo-34751.Yiv0pV.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-20-15-41-58.bpo-34751.Yiv0pV.rst new file mode 100644 index 000000000000..b2ba5144fe52 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-09-20-15-41-58.bpo-34751.Yiv0pV.rst @@ -0,0 +1,4 @@ +The hash function for tuples is now based on xxHash +which gives better collision results on (formerly) pathological cases. +Additionally, on 64-bit systems it improves tuple hashes in general. +Patch by Jeroen Demeyer with substantial contributions by Tim Peters. diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index eaf92d57f3f6..2e324060eaaa 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -333,39 +333,60 @@ tuplerepr(PyTupleObject *v) return NULL; } -/* The addend 82520, was selected from the range(0, 1000000) for - generating the greatest number of prime multipliers for tuples - up to length eight: - 1082527, 1165049, 1082531, 1165057, 1247581, 1330103, 1082533, - 1330111, 1412633, 1165069, 1247599, 1495177, 1577699 - - Tests have shown that it's not worth to cache the hash value, see - issue #9685. +/* Hash for tuples. This is a slightly simplified version of the xxHash + non-cryptographic hash: + - we do not use any parallellism, there is only 1 accumulator. + - we drop the final mixing since this is just a permutation of the + output space: it does not help against collisions. + - at the end, we mangle the length with a single constant. + For the xxHash specification, see + https://github.com/Cyan4973/xxHash/blob/master/doc/xxhash_spec.md + + Below are the official constants from the xxHash specification. Optimizing + compilers should emit a single "rotate" instruction for the + _PyHASH_XXROTATE() expansion. If that doesn't happen for some important + platform, the macro could be changed to expand to a platform-specific rotate + spelling instead. */ +#if SIZEOF_PY_UHASH_T > 4 +#define _PyHASH_XXPRIME_1 ((Py_uhash_t)11400714785074694791ULL) +#define _PyHASH_XXPRIME_2 ((Py_uhash_t)14029467366897019727ULL) +#define _PyHASH_XXPRIME_5 ((Py_uhash_t)2870177450012600261ULL) +#define _PyHASH_XXROTATE(x) ((x << 31) | (x >> 33)) /* Rotate left 31 bits */ +#else +#define _PyHASH_XXPRIME_1 ((Py_uhash_t)2654435761UL) +#define _PyHASH_XXPRIME_2 ((Py_uhash_t)2246822519UL) +#define _PyHASH_XXPRIME_5 ((Py_uhash_t)374761393UL) +#define _PyHASH_XXROTATE(x) ((x << 13) | (x >> 19)) /* Rotate left 13 bits */ +#endif +/* Tests have shown that it's not worth to cache the hash value, see + https://bugs.python.org/issue9685 */ static Py_hash_t tuplehash(PyTupleObject *v) { - Py_uhash_t x; /* Unsigned for defined overflow behavior. */ - Py_hash_t y; - Py_ssize_t len = Py_SIZE(v); - PyObject **p; - Py_uhash_t mult = _PyHASH_MULTIPLIER; - x = 0x345678UL; - p = v->ob_item; - while (--len >= 0) { - y = PyObject_Hash(*p++); - if (y == -1) + Py_ssize_t i, len = Py_SIZE(v); + PyObject **item = v->ob_item; + + Py_uhash_t acc = _PyHASH_XXPRIME_5; + for (i = 0; i < len; i++) { + Py_uhash_t lane = PyObject_Hash(item[i]); + if (lane == (Py_uhash_t)-1) { return -1; - x = (x ^ y) * mult; - /* the cast might truncate len; that doesn't change hash stability */ - mult += (Py_hash_t)(82520UL + len + len); + } + acc += lane * _PyHASH_XXPRIME_2; + acc = _PyHASH_XXROTATE(acc); + acc *= _PyHASH_XXPRIME_1; + } + + /* Add input length, mangled to keep the historical value of hash(()). */ + acc += len ^ (_PyHASH_XXPRIME_5 ^ 3527539UL); + + if (acc == (Py_uhash_t)-1) { + return 1546275796; } - x += 97531UL; - if (x == (Py_uhash_t)-1) - x = -2; - return x; + return acc; } static Py_ssize_t From webhook-mailer at python.org Sun Oct 28 01:21:39 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Sun, 28 Oct 2018 05:21:39 -0000 Subject: [Python-checkins] bpo-35087: Update idlelib help files for the current doc build. (GH-10162) Message-ID: https://github.com/python/cpython/commit/db40cb50eb823b8ef9040b1c9bf31a7475d94d39 commit: db40cb50eb823b8ef9040b1c9bf31a7475d94d39 branch: master author: Terry Jan Reedy committer: GitHub date: 2018-10-28T01:21:36-04:00 summary: bpo-35087: Update idlelib help files for the current doc build. (GH-10162) There is only one trivial change to idle.rst. Nearly all the changes to help.html are the elimination of chapter and section numbers on headers due to changes in the build system. help.py no longer requires header numbering. files: A Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst M Lib/idlelib/help.html M Lib/idlelib/help.py diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 5b4d0932f73a..32676195bb52 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -6,14 +6,18 @@ - 26.5. IDLE — Python 3.8.0a0 documentation + IDLE — Python 3.8.0a0 documentation - + + + + + @@ -21,14 +25,23 @@ - - + + + + + @@ -47,10 +60,10 @@

Navigation

modules |
  • - next |
  • - previous |
  • Navigation
  • - +
  • @@ -88,7 +101,7 @@

    Navigation

    -

    26.5. IDLE?

    +

    IDLE?

    Source code: Lib/idlelib/


    IDLE is Python?s Integrated Development and Learning Environment.

    @@ -107,7 +120,7 @@

    Navigation

  • configuration, browsers, and other dialogs
  • @@ -478,6 +485,8 @@

    Calltips

    Python Shell window?

    +

    The editing features described above work when entering code interactively. +IDLE?s Shell window also responds to the following keys.

    • C-c interrupts executing command

    • @@ -493,6 +502,14 @@

      Python Shell window

      Text colors?

      @@ -797,7 +814,7 @@

      Navigation



      - Last updated on Oct 27, 2018. + Last updated on Oct 28, 2018. Found a bug?
      From webhook-mailer at python.org Sun Oct 28 13:08:25 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 28 Oct 2018 17:08:25 -0000 Subject: [Python-checkins] bpo-1529353: Explain Shell text squeezing in the IDLE doc. (GH-10169) Message-ID: https://github.com/python/cpython/commit/69ab28d2a616ae0234b6e412a979400523b2a6d9 commit: 69ab28d2a616ae0234b6e412a979400523b2a6d9 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T10:08:22-07:00 summary: bpo-1529353: Explain Shell text squeezing in the IDLE doc. (GH-10169) (cherry picked from commit 68d6dc0770288075504635a8e42696070823fd69) Co-authored-by: Terry Jan Reedy files: M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 58e61931aaf4..ba0640dbef53 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -341,11 +341,18 @@ Set Breakpoint Clear Breakpoint Clear the breakpoint on that line. -Shell and Output windows have the following. +Shell and Output windows also have the following. Go to file/line Same as in Debug menu. +The Shell window also has an output squeezing facility explained in the +the *Python Shell window* subsection below. + +Squeeze + If the cursor is over an output line, squeeze all the output between + the code above and the prompt below down to a 'Squeezed text' label. + Editing and navigation ---------------------- @@ -477,6 +484,9 @@ or immediately run an existing file before editing. Python Shell window ^^^^^^^^^^^^^^^^^^^ +The editing features described above work when entering code interactively. +IDLE's Shell window also responds to the following keys. + * :kbd:`C-c` interrupts executing command * :kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt @@ -492,6 +502,15 @@ Python Shell window * :kbd:`Return` while on any previous command retrieves that command +Shell has a special facility for squeezing output lines down to a +'Squeezed text' label. This is done automatically for output over N lines +(N = 50 by default). N can be changed in the PyShell section of the General +page of the Settings dialog. Output with fewer lines can be squeezed by +right clicking on the output. This can be useful for extra long lines. + +Squeezed output is expanded in place by double-clicking the label. +It can also be sent to the clipboard or a separate view window by +right-clicking the label. Text colors ^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 32676195bb52..684d75d09ab9 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -364,11 +364,18 @@

      Help menu (Shell and Editor)
      Go to file/line
      Same as in Debug menu.
      +

      The Shell window also has an output squeezing facility explained in the +the Python Shell window subsection below.

      +
      +
      Squeeze
      +
      If the cursor is over an output line, squeeze all the output between +the code above and the prompt below down to a ?Squeezed text? label.
      +

    @@ -478,6 +485,8 @@

    Calltips

    Python Shell window?

    +

    The editing features described above work when entering code interactively. +IDLE?s Shell window also responds to the following keys.

  • Help and preferences diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst new file mode 100644 index 000000000000..a330b990761a --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst @@ -0,0 +1,2 @@ +Document the IDLE document viewer in the IDLE doc. Add a paragraph in "Help +and preferences", "Help sources" subsection. From webhook-mailer at python.org Sun Oct 28 16:37:13 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Sun, 28 Oct 2018 20:37:13 -0000 Subject: [Python-checkins] bpo-35047, unittest.mock: Better error messages on assert_called_xxx failures (GH-10090) Message-ID: https://github.com/python/cpython/commit/47d94241a383e2b8a2c40e81d12d40d5947fb170 commit: 47d94241a383e2b8a2c40e81d12d40d5947fb170 branch: master author: Petter Strandmark committer: Victor Stinner date: 2018-10-28T21:37:10+01:00 summary: bpo-35047, unittest.mock: Better error messages on assert_called_xxx failures (GH-10090) unittest.mock now includes mock calls in exception messages if assert_not_called, assert_called_once, or assert_called_once_with fails. files: A Misc/NEWS.d/next/Library/2018-10-25-09-59-00.bpo-35047.abbaa.rst M Lib/unittest/mock.py M Lib/unittest/test/testmock/testmock.py M Misc/ACKS diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 1a6c1a606c5a..1977b870834b 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -30,6 +30,7 @@ import sys import builtins from types import ModuleType +from unittest.util import safe_repr from functools import wraps, partial @@ -778,8 +779,10 @@ def assert_not_called(_mock_self): """ self = _mock_self if self.call_count != 0: - msg = ("Expected '%s' to not have been called. Called %s times." % - (self._mock_name or 'mock', self.call_count)) + msg = ("Expected '%s' to not have been called. Called %s times.%s" + % (self._mock_name or 'mock', + self.call_count, + self._calls_repr())) raise AssertionError(msg) def assert_called(_mock_self): @@ -796,8 +799,10 @@ def assert_called_once(_mock_self): """ self = _mock_self if not self.call_count == 1: - msg = ("Expected '%s' to have been called once. Called %s times." % - (self._mock_name or 'mock', self.call_count)) + msg = ("Expected '%s' to have been called once. Called %s times.%s" + % (self._mock_name or 'mock', + self.call_count, + self._calls_repr())) raise AssertionError(msg) def assert_called_with(_mock_self, *args, **kwargs): @@ -825,8 +830,10 @@ def assert_called_once_with(_mock_self, *args, **kwargs): with the specified arguments.""" self = _mock_self if not self.call_count == 1: - msg = ("Expected '%s' to be called once. Called %s times." % - (self._mock_name or 'mock', self.call_count)) + msg = ("Expected '%s' to be called once. Called %s times.%s" + % (self._mock_name or 'mock', + self.call_count, + self._calls_repr())) raise AssertionError(msg) return self.assert_called_with(*args, **kwargs) @@ -847,8 +854,8 @@ def assert_has_calls(self, calls, any_order=False): if not any_order: if expected not in all_calls: raise AssertionError( - 'Calls not found.\nExpected: %r\n' - 'Actual: %r' % (_CallList(calls), self.mock_calls) + 'Calls not found.\nExpected: %r%s' + % (_CallList(calls), self._calls_repr(prefix="Actual")) ) from cause return @@ -909,6 +916,19 @@ def _get_child_mock(self, **kw): return klass(**kw) + def _calls_repr(self, prefix="Calls"): + """Renders self.mock_calls as a string. + + Example: "\nCalls: [call(1), call(2)]." + + If self.mock_calls is empty, an empty string is returned. The + output will be truncated if very long. + """ + if not self.mock_calls: + return "" + return f"\n{prefix}: {safe_repr(self.mock_calls)}." + + def _try_iter(obj): if obj is None: diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py index c7bfa277b511..8cd284a6522d 100644 --- a/Lib/unittest/test/testmock/testmock.py +++ b/Lib/unittest/test/testmock/testmock.py @@ -1,4 +1,5 @@ import copy +import re import sys import tempfile @@ -407,6 +408,14 @@ def test_assert_called_once_with(self): lambda: mock.assert_called_once_with('bob', 'bar', baz=2) ) + def test_assert_called_once_with_call_list(self): + m = Mock() + m(1) + m(2) + self.assertRaisesRegex(AssertionError, + re.escape("Calls: [call(1), call(2)]"), + lambda: m.assert_called_once_with(2)) + def test_assert_called_once_with_function_spec(self): def f(a, b, c, d=None): @@ -1250,6 +1259,13 @@ def test_assert_not_called(self): with self.assertRaises(AssertionError): m.hello.assert_not_called() + def test_assert_not_called_message(self): + m = Mock() + m(1, 2) + self.assertRaisesRegex(AssertionError, + re.escape("Calls: [call(1, 2)]"), + m.assert_not_called) + def test_assert_called(self): m = Mock() with self.assertRaises(AssertionError): @@ -1271,6 +1287,20 @@ def test_assert_called_once(self): with self.assertRaises(AssertionError): m.hello.assert_called_once() + def test_assert_called_once_message(self): + m = Mock() + m(1, 2) + m(3) + self.assertRaisesRegex(AssertionError, + re.escape("Calls: [call(1, 2), call(3)]"), + m.assert_called_once) + + def test_assert_called_once_message_not_called(self): + m = Mock() + with self.assertRaises(AssertionError) as e: + m.assert_called_once() + self.assertNotIn("Calls:", str(e.exception)) + #Issue21256 printout of keyword args should be in deterministic order def test_sorted_call_signature(self): m = Mock() diff --git a/Misc/ACKS b/Misc/ACKS index 5014584b7bc0..043d604a3f96 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1570,6 +1570,7 @@ Daniel Stokes Michael Stone Serhiy Storchaka Ken Stox +Petter Strandmark Charalampos Stratakis Dan Stromberg Donald Stufft diff --git a/Misc/NEWS.d/next/Library/2018-10-25-09-59-00.bpo-35047.abbaa.rst b/Misc/NEWS.d/next/Library/2018-10-25-09-59-00.bpo-35047.abbaa.rst new file mode 100644 index 000000000000..12eda27527d8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-25-09-59-00.bpo-35047.abbaa.rst @@ -0,0 +1,3 @@ +``unittest.mock`` now includes mock calls in exception messages if +``assert_not_called``, ``assert_called_once``, or ``assert_called_once_with`` +fails. Patch by Petter Strandmark. \ No newline at end of file From webhook-mailer at python.org Sun Oct 28 16:39:41 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 28 Oct 2018 20:39:41 -0000 Subject: [Python-checkins] Issue 35093: Document the IDLE document viewer in the IDLE doc. (GH-10195) Message-ID: https://github.com/python/cpython/commit/ff8d626f3ac4ce0f83dca27453293a4d7e06b578 commit: ff8d626f3ac4ce0f83dca27453293a4d7e06b578 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T13:39:38-07:00 summary: Issue 35093: Document the IDLE document viewer in the IDLE doc. (GH-10195) Add a paragraph in "Help and preferences", "Help sources" subsection. (cherry picked from commit 18032632ab27eed51d705c2be7b64bac708279bf) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index aaf4e9e0d59a..22a82e15c9bc 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -295,7 +295,7 @@ About IDLE Display version, copyright, license, credits, and more. IDLE Help - Display a help file for IDLE detailing the menu options, basic editing and + Display this IDLE document, detailing the menu options, basic editing and navigation, and other tips. Python Docs @@ -306,7 +306,8 @@ Turtle Demo Run the turtledemo module with example Python code and turtle drawings. Additional help sources may be added here with the Configure IDLE dialog under -the General tab. +the General tab. See the "Help sources" subsection below for more +on Help menu choices. .. index:: single: Cut @@ -693,15 +694,25 @@ with the default subprocess if at all possible. Help and preferences -------------------- -Additional help sources -^^^^^^^^^^^^^^^^^^^^^^^ +Help sources +^^^^^^^^^^^^ -IDLE includes a help menu entry called "Python Docs" that will open the -extensive sources of help, including tutorials, available at docs.python.org. -Selected URLs can be added or removed from the help menu at any time using the -Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for -more information. +Help menu entry "IDLE Help" displays a formatted html version of the +IDLE chapter of the Library Reference. The result, in a read-only +tkinter text window, is close to what one sees in a web browser. +Navigate through the text with a mousewheel, +the scrollbar, or up and down arrow keys held down. +Or click the TOC (Table of Contents) button and select a section +header in the opened box. + +Help menu entry "Python Docs" opens the extensive sources of help, +including tutorials, available at docs.python.org/x.y, where 'x.y' +is the currently running Python version. If your system +has an off-line copy of the docs (this may be an installation option), +that will be opened instead. +Selected URLs can be added or removed from the help menu at any time using the +General tab of the Configure IDLE dialog . Setting preferences ^^^^^^^^^^^^^^^^^^^ @@ -711,7 +722,6 @@ changed via Configure IDLE on the Option menu. Keys can be user defined; IDLE ships with four built-in key sets. In addition, a user can create a custom key set in the Configure IDLE dialog under the keys tab. - Extensions ^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 684d75d09ab9..b8fecce0c9a2 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -332,7 +332,7 @@

    Help menu (Shell and Editor)

    Context Menus?

    @@ -666,13 +667,22 @@

    Running without a subprocess

    Help and preferences?

    -
    -

    Additional help sources?

    -

    IDLE includes a help menu entry called ?Python Docs? that will open the -extensive sources of help, including tutorials, available at docs.python.org. -Selected URLs can be added or removed from the help menu at any time using the -Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for -more information.

    +
    +

    Help sources?

    +

    Help menu entry ?IDLE Help? displays a formatted html version of the +IDLE chapter of the Library Reference. The result, in a read-only +tkinter text window, is close to what one sees in a web browser. +Navigate through the text with a mousewheel, +the scrollbar, or up and down arrow keys held down. +Or click the TOC (Table of Contents) button and select a section +header in the opened box.

    +

    Help menu entry ?Python Docs? opens the extensive sources of help, +including tutorials, available at docs.python.org/x.y, where ?x.y? +is the currently running Python version. If your system +has an off-line copy of the docs (this may be an installation option), +that will be opened instead.

    +

    Selected URLs can be added or removed from the help menu at any time using the +General tab of the Configure IDLE dialog .

    Setting preferences?

    @@ -731,7 +741,7 @@

    Table of Contents

  • Help and preferences diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst new file mode 100644 index 000000000000..a330b990761a --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst @@ -0,0 +1,2 @@ +Document the IDLE document viewer in the IDLE doc. Add a paragraph in "Help +and preferences", "Help sources" subsection. From webhook-mailer at python.org Sun Oct 28 16:43:23 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 28 Oct 2018 20:43:23 -0000 Subject: [Python-checkins] Issue 35093: Document the IDLE document viewer in the IDLE doc. (GH-10195) Message-ID: https://github.com/python/cpython/commit/5c0a9c4ac4afc9e160f81570c563a1ba91f0459b commit: 5c0a9c4ac4afc9e160f81570c563a1ba91f0459b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T13:43:20-07:00 summary: Issue 35093: Document the IDLE document viewer in the IDLE doc. (GH-10195) Add a paragraph in "Help and preferences", "Help sources" subsection. (cherry picked from commit 18032632ab27eed51d705c2be7b64bac708279bf) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index ba0640dbef53..3bf87c25a8d5 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -295,7 +295,7 @@ About IDLE Display version, copyright, license, credits, and more. IDLE Help - Display a help file for IDLE detailing the menu options, basic editing and + Display this IDLE document, detailing the menu options, basic editing and navigation, and other tips. Python Docs @@ -306,7 +306,8 @@ Turtle Demo Run the turtledemo module with example python code and turtle drawings. Additional help sources may be added here with the Configure IDLE dialog under -the General tab. +the General tab. See the "Help sources" subsection below for more +on Help menu choices. .. index:: single: Cut @@ -693,15 +694,25 @@ with the default subprocess if at all possible. Help and preferences -------------------- -Additional help sources -^^^^^^^^^^^^^^^^^^^^^^^ +Help sources +^^^^^^^^^^^^ -IDLE includes a help menu entry called "Python Docs" that will open the -extensive sources of help, including tutorials, available at docs.python.org. -Selected URLs can be added or removed from the help menu at any time using the -Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for -more information. +Help menu entry "IDLE Help" displays a formatted html version of the +IDLE chapter of the Library Reference. The result, in a read-only +tkinter text window, is close to what one sees in a web browser. +Navigate through the text with a mousewheel, +the scrollbar, or up and down arrow keys held down. +Or click the TOC (Table of Contents) button and select a section +header in the opened box. + +Help menu entry "Python Docs" opens the extensive sources of help, +including tutorials, available at docs.python.org/x.y, where 'x.y' +is the currently running Python version. If your system +has an off-line copy of the docs (this may be an installation option), +that will be opened instead. +Selected URLs can be added or removed from the help menu at any time using the +General tab of the Configure IDLE dialog . Setting preferences ^^^^^^^^^^^^^^^^^^^ @@ -711,7 +722,6 @@ changed via Configure IDLE on the Option menu. Keys can be user defined; IDLE ships with four built-in key sets. In addition, a user can create a custom key set in the Configure IDLE dialog under the keys tab. - Extensions ^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 684d75d09ab9..b8fecce0c9a2 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -332,7 +332,7 @@

    Help menu (Shell and Editor)

    Context Menus?

    @@ -666,13 +667,22 @@

    Running without a subprocess

    Help and preferences?

    -
    -

    Additional help sources?

    -

    IDLE includes a help menu entry called ?Python Docs? that will open the -extensive sources of help, including tutorials, available at docs.python.org. -Selected URLs can be added or removed from the help menu at any time using the -Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for -more information.

    +
    +

    Help sources?

    +

    Help menu entry ?IDLE Help? displays a formatted html version of the +IDLE chapter of the Library Reference. The result, in a read-only +tkinter text window, is close to what one sees in a web browser. +Navigate through the text with a mousewheel, +the scrollbar, or up and down arrow keys held down. +Or click the TOC (Table of Contents) button and select a section +header in the opened box.

    +

    Help menu entry ?Python Docs? opens the extensive sources of help, +including tutorials, available at docs.python.org/x.y, where ?x.y? +is the currently running Python version. If your system +has an off-line copy of the docs (this may be an installation option), +that will be opened instead.

    +

    Selected URLs can be added or removed from the help menu at any time using the +General tab of the Configure IDLE dialog .

    Setting preferences?

    @@ -731,7 +741,7 @@

    Table of Contents

  • Help and preferences diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst new file mode 100644 index 000000000000..a330b990761a --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-10-28-15-53-51.bpo-35093.cH-tli.rst @@ -0,0 +1,2 @@ +Document the IDLE document viewer in the IDLE doc. Add a paragraph in "Help +and preferences", "Help sources" subsection. From webhook-mailer at python.org Sun Oct 28 16:47:01 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 28 Oct 2018 20:47:01 -0000 Subject: [Python-checkins] bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174) Message-ID: https://github.com/python/cpython/commit/1d7d165e3c3f07518e6b5bfb57f1fd460cd4bbf2 commit: 1d7d165e3c3f07518e6b5bfb57f1fd460cd4bbf2 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T13:46:56-07:00 summary: bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174) * Fix potential division by zero in BZ2_Malloc() * Avoid division by zero in PyLzma_Malloc() * Avoid division by zero and integer overflow in PyZlib_Malloc() Reported by Svace static analyzer. (cherry picked from commit 3d4fabb2a424cb04ae446ebe4428090c386f45a5) Co-authored-by: Alexey Izbyshev files: M Modules/_bz2module.c M Modules/_lzmamodule.c M Modules/zlibmodule.c diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c index 3890b60b1b87..f0d9588fe55d 100644 --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -277,11 +277,11 @@ BZ2_Malloc(void* ctx, int items, int size) { if (items < 0 || size < 0) return NULL; - if ((size_t)items > (size_t)PY_SSIZE_T_MAX / (size_t)size) + if (size != 0 && (size_t)items > (size_t)PY_SSIZE_T_MAX / (size_t)size) return NULL; /* PyMem_Malloc() cannot be used: compress() and decompress() release the GIL */ - return PyMem_RawMalloc(items * size); + return PyMem_RawMalloc((size_t)items * (size_t)size); } static void diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index 7b501d8202d8..bb7a7ec50ce0 100644 --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -108,7 +108,7 @@ catch_lzma_error(lzma_ret lzret) static void* PyLzma_Malloc(void *opaque, size_t items, size_t size) { - if (items > (size_t)PY_SSIZE_T_MAX / size) + if (size != 0 && items > (size_t)PY_SSIZE_T_MAX / size) return NULL; /* PyMem_Malloc() cannot be used: the GIL is not held when lzma_code() is called */ diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index cd587b4ac9c7..21b5dc796c47 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -117,11 +117,11 @@ newcompobject(PyTypeObject *type) static void* PyZlib_Malloc(voidpf ctx, uInt items, uInt size) { - if (items > (size_t)PY_SSIZE_T_MAX / size) + if (size != 0 && items > (size_t)PY_SSIZE_T_MAX / size) return NULL; /* PyMem_Malloc() cannot be used: the GIL is not held when inflate() and deflate() are called */ - return PyMem_RawMalloc(items * size); + return PyMem_RawMalloc((size_t)items * (size_t)size); } static void From webhook-mailer at python.org Sun Oct 28 16:59:17 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 28 Oct 2018 20:59:17 -0000 Subject: [Python-checkins] bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174) Message-ID: https://github.com/python/cpython/commit/fd0a3bce6e917b5853c809a309c1513acc176f56 commit: fd0a3bce6e917b5853c809a309c1513acc176f56 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T13:59:13-07:00 summary: bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174) * Fix potential division by zero in BZ2_Malloc() * Avoid division by zero in PyLzma_Malloc() * Avoid division by zero and integer overflow in PyZlib_Malloc() Reported by Svace static analyzer. (cherry picked from commit 3d4fabb2a424cb04ae446ebe4428090c386f45a5) Co-authored-by: Alexey Izbyshev files: M Modules/_bz2module.c M Modules/_lzmamodule.c M Modules/zlibmodule.c diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c index 3f555992316d..fe06953ec48e 100644 --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -288,11 +288,11 @@ BZ2_Malloc(void* ctx, int items, int size) { if (items < 0 || size < 0) return NULL; - if ((size_t)items > (size_t)PY_SSIZE_T_MAX / (size_t)size) + if (size != 0 && (size_t)items > (size_t)PY_SSIZE_T_MAX / (size_t)size) return NULL; /* PyMem_Malloc() cannot be used: compress() and decompress() release the GIL */ - return PyMem_RawMalloc(items * size); + return PyMem_RawMalloc((size_t)items * (size_t)size); } static void diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index c265507ff58e..3d3645af9257 100644 --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -119,7 +119,7 @@ catch_lzma_error(lzma_ret lzret) static void* PyLzma_Malloc(void *opaque, size_t items, size_t size) { - if (items > (size_t)PY_SSIZE_T_MAX / size) + if (size != 0 && items > (size_t)PY_SSIZE_T_MAX / size) return NULL; /* PyMem_Malloc() cannot be used: the GIL is not held when lzma_code() is called */ diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index a20dcd6de51e..dd7eb4fb5219 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -126,11 +126,11 @@ newcompobject(PyTypeObject *type) static void* PyZlib_Malloc(voidpf ctx, uInt items, uInt size) { - if (items > (size_t)PY_SSIZE_T_MAX / size) + if (size != 0 && items > (size_t)PY_SSIZE_T_MAX / size) return NULL; /* PyMem_Malloc() cannot be used: the GIL is not held when inflate() and deflate() are called */ - return PyMem_RawMalloc(items * size); + return PyMem_RawMalloc((size_t)items * (size_t)size); } static void From webhook-mailer at python.org Sun Oct 28 18:03:23 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Sun, 28 Oct 2018 22:03:23 -0000 Subject: [Python-checkins] bpo-33234: Add exact allocation optimization to lists in What's New (GH-10200) Message-ID: https://github.com/python/cpython/commit/c61e229d2a4c54ffb4153e1f0f48126ba33c9cbf commit: c61e229d2a4c54ffb4153e1f0f48126ba33c9cbf branch: master author: Pablo Galindo committer: GitHub date: 2018-10-28T22:03:18Z summary: bpo-33234: Add exact allocation optimization to lists in What's New (GH-10200) In commit 372d705 a new optimization to the list() type was introduced but it was not added to the optimization section in What's new for Python 3.8. files: M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 05b7d235cee8..758d32e6e55a 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -242,6 +242,11 @@ Optimizations Note that this means that instances can no longer be weak-referenced and that arbitrary attributes can no longer be added to them. +* The :class:`list` constructor does not overallocate the internal item buffer + if the input iterable has a known length (the input implements ``__len__``). + This makes the created list 12% smaller on average. (Contributed by Pablo + Galindo in :issue:`33234`.) + Build and C API Changes ======================= From webhook-mailer at python.org Sun Oct 28 20:42:22 2018 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Mon, 29 Oct 2018 00:42:22 -0000 Subject: [Python-checkins] bpo-35097: Add IDLE doc subsection explaining editor windows. (#10206) Message-ID: https://github.com/python/cpython/commit/ea9c8bd44365ae8b0accc5286c7b52862528c0ec commit: ea9c8bd44365ae8b0accc5286c7b52862528c0ec branch: master author: Terry Jan Reedy committer: GitHub date: 2018-10-28T20:42:18-04:00 summary: bpo-35097: Add IDLE doc subsection explaining editor windows. (#10206) Topics include opening, title and status bar, .py* extension, and running. files: A Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 22a82e15c9bc..645bd612618b 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -358,6 +358,24 @@ Squeeze Editing and navigation ---------------------- +Editor windows +^^^^^^^^^^^^^^ + +IDLE may open editor windows when it starts, depending on settings +and how you start IDLE. Thereafter, use the File menu. There can be only +one open editor window for a given file. + +The title bar contains the name of the file, the full path, and the version +of Python and IDLE running the window. The status bar contains the line +number ('Ln') and column number ('Col'). Line numbers start with 1; +column numbers with 0. + +IDLE assumes that files with a known .py* extension contain Python code +and that other files do not. Run Python code with the Run menu. + +Key bindings +^^^^^^^^^^^^ + In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and the :kbd:`Command` key on Mac OSX. @@ -397,7 +415,6 @@ the :kbd:`Command` key on Mac OSX. Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) may work. Keybindings are selected in the Configure IDLE dialog. - Automatic indentation ^^^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index b8fecce0c9a2..24fd77da904e 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -381,6 +381,20 @@

    Help menu (Shell and Editor)

    Editing and navigation?

    +
    +

    Editor windows?

    +

    IDLE may open editor windows when it starts, depending on settings +and how you start IDLE. Thereafter, use the File menu. There can be only +one open editor window for a given file.

    +

    The title bar contains the name of the file, the full path, and the version +of Python and IDLE running the window. The status bar contains the line +number (?Ln?) and column number (?Col?). Line numbers start with 1; +column numbers with 0.

    +

    IDLE assumes that files with a known .py* extension contain Python code +and that other files do not. Run Python code with the Run menu.

    +
    +
    +

    Key bindings?

    In this section, ?C? refers to the Control key on Windows and Unix and the Command key on Mac OSX.

    Automatic indentation?

    After a block-opening statement, the next line is indented by 4 spaces (in the @@ -725,6 +740,8 @@

    Table of Contents

  • Editing and navigation
      +
    • Editor windows
    • +
    • Key bindings
    • Automatic indentation
    • Completions
    • Calltips
    • diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst new file mode 100644 index 000000000000..a1e58ee5983c --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst @@ -0,0 +1,2 @@ +Add IDLE doc subsection explaining editor windows. Topics include opening, +title and status bar, .py* extension, and running. From webhook-mailer at python.org Sun Oct 28 21:51:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 01:51:38 -0000 Subject: [Python-checkins] bpo-35097: Add IDLE doc subsection explaining editor windows. (GH-10206) Message-ID: https://github.com/python/cpython/commit/1a3f18e2c58367157d904f5c077ccf5a3e076f7d commit: 1a3f18e2c58367157d904f5c077ccf5a3e076f7d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T18:51:33-07:00 summary: bpo-35097: Add IDLE doc subsection explaining editor windows. (GH-10206) Topics include opening, title and status bar, .py* extension, and running. (cherry picked from commit ea9c8bd44365ae8b0accc5286c7b52862528c0ec) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 22a82e15c9bc..645bd612618b 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -358,6 +358,24 @@ Squeeze Editing and navigation ---------------------- +Editor windows +^^^^^^^^^^^^^^ + +IDLE may open editor windows when it starts, depending on settings +and how you start IDLE. Thereafter, use the File menu. There can be only +one open editor window for a given file. + +The title bar contains the name of the file, the full path, and the version +of Python and IDLE running the window. The status bar contains the line +number ('Ln') and column number ('Col'). Line numbers start with 1; +column numbers with 0. + +IDLE assumes that files with a known .py* extension contain Python code +and that other files do not. Run Python code with the Run menu. + +Key bindings +^^^^^^^^^^^^ + In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and the :kbd:`Command` key on Mac OSX. @@ -397,7 +415,6 @@ the :kbd:`Command` key on Mac OSX. Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) may work. Keybindings are selected in the Configure IDLE dialog. - Automatic indentation ^^^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index b8fecce0c9a2..24fd77da904e 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -381,6 +381,20 @@

      Help menu (Shell and Editor)

      Editing and navigation?

      +
      +

      Editor windows?

      +

      IDLE may open editor windows when it starts, depending on settings +and how you start IDLE. Thereafter, use the File menu. There can be only +one open editor window for a given file.

      +

      The title bar contains the name of the file, the full path, and the version +of Python and IDLE running the window. The status bar contains the line +number (?Ln?) and column number (?Col?). Line numbers start with 1; +column numbers with 0.

      +

      IDLE assumes that files with a known .py* extension contain Python code +and that other files do not. Run Python code with the Run menu.

      +
      +
      +

      Key bindings?

      In this section, ?C? refers to the Control key on Windows and Unix and the Command key on Mac OSX.

      Automatic indentation?

      After a block-opening statement, the next line is indented by 4 spaces (in the @@ -725,6 +740,8 @@

      Table of Contents

  • Editing and navigation
      +
    • Editor windows
    • +
    • Key bindings
    • Automatic indentation
    • Completions
    • Calltips
    • diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst new file mode 100644 index 000000000000..a1e58ee5983c --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst @@ -0,0 +1,2 @@ +Add IDLE doc subsection explaining editor windows. Topics include opening, +title and status bar, .py* extension, and running. From webhook-mailer at python.org Sun Oct 28 21:51:48 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 01:51:48 -0000 Subject: [Python-checkins] bpo-35097: Add IDLE doc subsection explaining editor windows. (GH-10206) Message-ID: https://github.com/python/cpython/commit/9bdadc163f306ddb4659c6732ea24401957488db commit: 9bdadc163f306ddb4659c6732ea24401957488db branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T18:51:45-07:00 summary: bpo-35097: Add IDLE doc subsection explaining editor windows. (GH-10206) Topics include opening, title and status bar, .py* extension, and running. (cherry picked from commit ea9c8bd44365ae8b0accc5286c7b52862528c0ec) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 3bf87c25a8d5..0826d99b6336 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -358,6 +358,24 @@ Squeeze Editing and navigation ---------------------- +Editor windows +^^^^^^^^^^^^^^ + +IDLE may open editor windows when it starts, depending on settings +and how you start IDLE. Thereafter, use the File menu. There can be only +one open editor window for a given file. + +The title bar contains the name of the file, the full path, and the version +of Python and IDLE running the window. The status bar contains the line +number ('Ln') and column number ('Col'). Line numbers start with 1; +column numbers with 0. + +IDLE assumes that files with a known .py* extension contain Python code +and that other files do not. Run Python code with the Run menu. + +Key bindings +^^^^^^^^^^^^ + In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and the :kbd:`Command` key on Mac OSX. @@ -397,7 +415,6 @@ the :kbd:`Command` key on Mac OSX. Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) may work. Keybindings are selected in the Configure IDLE dialog. - Automatic indentation ^^^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index b8fecce0c9a2..24fd77da904e 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -381,6 +381,20 @@

      Help menu (Shell and Editor)

      Editing and navigation?

      +
      +

      Editor windows?

      +

      IDLE may open editor windows when it starts, depending on settings +and how you start IDLE. Thereafter, use the File menu. There can be only +one open editor window for a given file.

      +

      The title bar contains the name of the file, the full path, and the version +of Python and IDLE running the window. The status bar contains the line +number (?Ln?) and column number (?Col?). Line numbers start with 1; +column numbers with 0.

      +

      IDLE assumes that files with a known .py* extension contain Python code +and that other files do not. Run Python code with the Run menu.

      +
      +
      +

      Key bindings?

      In this section, ?C? refers to the Control key on Windows and Unix and the Command key on Mac OSX.

      Automatic indentation?

      After a block-opening statement, the next line is indented by 4 spaces (in the @@ -725,6 +740,8 @@

      Table of Contents

  • Editing and navigation
      +
    • Editor windows
    • +
    • Key bindings
    • Automatic indentation
    • Completions
    • Calltips
    • diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst new file mode 100644 index 000000000000..a1e58ee5983c --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-10-28-20-17-14.bpo-35097.07tm66.rst @@ -0,0 +1,2 @@ +Add IDLE doc subsection explaining editor windows. Topics include opening, +title and status bar, .py* extension, and running. From webhook-mailer at python.org Mon Oct 29 00:55:28 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 29 Oct 2018 04:55:28 -0000 Subject: [Python-checkins] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) Message-ID: https://github.com/python/cpython/commit/53835e92d315340444e3dd083b3f69a590b00e07 commit: 53835e92d315340444e3dd083b3f69a590b00e07 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-29T06:55:20+02:00 summary: Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) files: M Modules/termios.c diff --git a/Modules/termios.c b/Modules/termios.c index b4aa77f89764..7601b68afda3 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -119,11 +119,11 @@ termios_tcgetattr(PyObject *self, PyObject *args) PyList_SetItem(v, 3, PyLong_FromLong((long)mode.c_lflag)); PyList_SetItem(v, 4, PyLong_FromLong((long)ispeed)); PyList_SetItem(v, 5, PyLong_FromLong((long)ospeed)); - PyList_SetItem(v, 6, cc); - if (PyErr_Occurred()){ + if (PyErr_Occurred()) { Py_DECREF(v); goto err; } + PyList_SetItem(v, 6, cc); return v; err: Py_DECREF(cc); From webhook-mailer at python.org Mon Oct 29 01:15:17 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 05:15:17 -0000 Subject: [Python-checkins] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) Message-ID: https://github.com/python/cpython/commit/86a0f222cedc580413dd25d3565beef51ee24e5b commit: 86a0f222cedc580413dd25d3565beef51ee24e5b branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T22:15:12-07:00 summary: Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (cherry picked from commit 53835e92d315340444e3dd083b3f69a590b00e07) Co-authored-by: Zackery Spytz files: M Modules/termios.c diff --git a/Modules/termios.c b/Modules/termios.c index b78d33e6889a..945d8e08e6a2 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -113,11 +113,11 @@ termios_tcgetattr(PyObject *self, PyObject *args) PyList_SetItem(v, 3, PyLong_FromLong((long)mode.c_lflag)); PyList_SetItem(v, 4, PyLong_FromLong((long)ispeed)); PyList_SetItem(v, 5, PyLong_FromLong((long)ospeed)); - PyList_SetItem(v, 6, cc); - if (PyErr_Occurred()){ + if (PyErr_Occurred()) { Py_DECREF(v); goto err; } + PyList_SetItem(v, 6, cc); return v; err: Py_DECREF(cc); From webhook-mailer at python.org Mon Oct 29 01:17:48 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 05:17:48 -0000 Subject: [Python-checkins] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) Message-ID: https://github.com/python/cpython/commit/f00703d29438b5f2e9524b04a247167f042a50ef commit: f00703d29438b5f2e9524b04a247167f042a50ef branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-28T22:17:45-07:00 summary: Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (cherry picked from commit 53835e92d315340444e3dd083b3f69a590b00e07) Co-authored-by: Zackery Spytz files: M Modules/termios.c diff --git a/Modules/termios.c b/Modules/termios.c index b4aa77f89764..7601b68afda3 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -119,11 +119,11 @@ termios_tcgetattr(PyObject *self, PyObject *args) PyList_SetItem(v, 3, PyLong_FromLong((long)mode.c_lflag)); PyList_SetItem(v, 4, PyLong_FromLong((long)ispeed)); PyList_SetItem(v, 5, PyLong_FromLong((long)ospeed)); - PyList_SetItem(v, 6, cc); - if (PyErr_Occurred()){ + if (PyErr_Occurred()) { Py_DECREF(v); goto err; } + PyList_SetItem(v, 6, cc); return v; err: Py_DECREF(cc); From webhook-mailer at python.org Mon Oct 29 03:24:04 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 29 Oct 2018 07:24:04 -0000 Subject: [Python-checkins] [2.7] bpo-35068: Fix possible crashes in pyexpat.c. (GH-10099) Message-ID: https://github.com/python/cpython/commit/d61f586df79a754776f448e5b23015abb71f4fd1 commit: d61f586df79a754776f448e5b23015abb71f4fd1 branch: 2.7 author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-29T09:23:59+02:00 summary: [2.7] bpo-35068: Fix possible crashes in pyexpat.c. (GH-10099) files: M Modules/pyexpat.c diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index bbda6ffd0242..a1a870d418e8 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1084,21 +1084,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args) return NULL; new_parser->buffer_size = self->buffer_size; new_parser->buffer_used = 0; - if (self->buffer != NULL) { - new_parser->buffer = malloc(new_parser->buffer_size); - if (new_parser->buffer == NULL) { -#ifndef Py_TPFLAGS_HAVE_GC - /* Code for versions 2.0 and 2.1 */ - PyObject_Del(new_parser); -#else - /* Code for versions 2.2 and later. */ - PyObject_GC_Del(new_parser); -#endif - return PyErr_NoMemory(); - } - } - else - new_parser->buffer = NULL; + new_parser->buffer = NULL; new_parser->returns_unicode = self->returns_unicode; new_parser->ordered_attributes = self->ordered_attributes; new_parser->specified_attributes = self->specified_attributes; @@ -1120,6 +1106,14 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args) return PyErr_NoMemory(); } + if (self->buffer != NULL) { + new_parser->buffer = malloc(new_parser->buffer_size); + if (new_parser->buffer == NULL) { + Py_DECREF(new_parser); + return PyErr_NoMemory(); + } + } + XML_SetUserData(new_parser->itself, (void *)new_parser); /* allocate and clear handlers first */ @@ -1310,6 +1304,8 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern) self->in_callback = 0; self->ns_prefixes = 0; self->handlers = NULL; + self->intern = intern; + Py_XINCREF(self->intern); if (namespace_separator != NULL) { self->itself = XML_ParserCreateNS(encoding, *namespace_separator); } @@ -1327,8 +1323,6 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern) XML_SetHashSalt(self->itself, (unsigned long)_Py_HashSecret.prefix); #endif - self->intern = intern; - Py_XINCREF(self->intern); #ifdef Py_TPFLAGS_HAVE_GC PyObject_GC_Track(self); #else From solipsis at pitrou.net Mon Oct 29 05:11:58 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 29 Oct 2018 09:11:58 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=12 Message-ID: <20181029091158.1.1B55924290264645@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 7] memory blocks, sum=7 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, 0, -1] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogrIOfqy', '--timeout', '7200'] From webhook-mailer at python.org Mon Oct 29 07:49:57 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 29 Oct 2018 11:49:57 -0000 Subject: [Python-checkins] bpo-27741: Better wording for datetime.strptime() (GH-9994) Message-ID: https://github.com/python/cpython/commit/c0799ec973530ad2492bb1d6c7287ffc428f0348 commit: c0799ec973530ad2492bb1d6c7287ffc428f0348 branch: master author: Gus Goulart committer: Victor Stinner date: 2018-10-29T12:49:52+01:00 summary: bpo-27741: Better wording for datetime.strptime() (GH-9994) files: M Doc/library/datetime.rst diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index a1a60b09cc19..0363111ef55f 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -2016,7 +2016,9 @@ although not all objects support a :meth:`timetuple` method. Conversely, the :meth:`datetime.strptime` class method creates a :class:`.datetime` object from a string representing a date and time and a corresponding format string. ``datetime.strptime(date_string, format)`` is -equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``. +equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``, except +when the format includes sub-second components or timezone offset information, +which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``. For :class:`.time` objects, the format codes for year, month, and day should not be used, as time objects have no such values. If they're used anyway, ``1900`` From webhook-mailer at python.org Mon Oct 29 07:54:57 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 11:54:57 -0000 Subject: [Python-checkins] bpo-27741: Better wording for datetime.strptime() (GH-9994) Message-ID: https://github.com/python/cpython/commit/0a53a067dc4eb86ecf94c50582b3e22359c601a9 commit: 0a53a067dc4eb86ecf94c50582b3e22359c601a9 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-29T04:54:54-07:00 summary: bpo-27741: Better wording for datetime.strptime() (GH-9994) (cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348) Co-authored-by: Gus Goulart files: M Doc/library/datetime.rst diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 26cb90b6207c..f2bdf8d68fb7 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1944,7 +1944,9 @@ although not all objects support a :meth:`timetuple` method. Conversely, the :meth:`datetime.strptime` class method creates a :class:`.datetime` object from a string representing a date and time and a corresponding format string. ``datetime.strptime(date_string, format)`` is -equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``. +equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``, except +when the format includes sub-second components or timezone offset information, +which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``. For :class:`.time` objects, the format codes for year, month, and day should not be used, as time objects have no such values. If they're used anyway, ``1900`` From webhook-mailer at python.org Mon Oct 29 07:55:11 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 11:55:11 -0000 Subject: [Python-checkins] bpo-27741: Better wording for datetime.strptime() (GH-9994) Message-ID: https://github.com/python/cpython/commit/a02bc719ebc496bc527e9e46de2f2e83f68bfd77 commit: a02bc719ebc496bc527e9e46de2f2e83f68bfd77 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-29T04:55:08-07:00 summary: bpo-27741: Better wording for datetime.strptime() (GH-9994) (cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348) Co-authored-by: Gus Goulart files: M Doc/library/datetime.rst diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index a1a60b09cc19..0363111ef55f 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -2016,7 +2016,9 @@ although not all objects support a :meth:`timetuple` method. Conversely, the :meth:`datetime.strptime` class method creates a :class:`.datetime` object from a string representing a date and time and a corresponding format string. ``datetime.strptime(date_string, format)`` is -equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``. +equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``, except +when the format includes sub-second components or timezone offset information, +which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``. For :class:`.time` objects, the format codes for year, month, and day should not be used, as time objects have no such values. If they're used anyway, ``1900`` From webhook-mailer at python.org Mon Oct 29 07:55:18 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 11:55:18 -0000 Subject: [Python-checkins] bpo-27741: Better wording for datetime.strptime() (GH-9994) Message-ID: https://github.com/python/cpython/commit/4ec427b005036dab0a380de20f31774394ca4dd6 commit: 4ec427b005036dab0a380de20f31774394ca4dd6 branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-29T04:55:15-07:00 summary: bpo-27741: Better wording for datetime.strptime() (GH-9994) (cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348) Co-authored-by: Gus Goulart files: M Doc/library/datetime.rst diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index d2c1c563863f..1e575d5d572e 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1594,7 +1594,9 @@ although not all objects support a :meth:`timetuple` method. Conversely, the :meth:`datetime.strptime` class method creates a :class:`.datetime` object from a string representing a date and time and a corresponding format string. ``datetime.strptime(date_string, format)`` is -equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``. +equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``, except +when the format includes sub-second components or timezone offset information, +which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``. For :class:`.time` objects, the format codes for year, month, and day should not be used, as time objects have no such values. If they're used anyway, ``1900`` From webhook-mailer at python.org Mon Oct 29 08:43:21 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 29 Oct 2018 12:43:21 -0000 Subject: [Python-checkins] bpo-35059: Convert Py_INCREF() to static inline function (GH-10079) Message-ID: https://github.com/python/cpython/commit/2aaf0c12041bcaadd7f2cc5a54450eefd7a6ff12 commit: 2aaf0c12041bcaadd7f2cc5a54450eefd7a6ff12 branch: master author: Victor Stinner committer: GitHub date: 2018-10-29T13:43:07+01:00 summary: bpo-35059: Convert Py_INCREF() to static inline function (GH-10079) * Convert Py_INCREF() and Py_DECREF() macros into static inline functions. * Remove _Py_CHECK_REFCNT() macro: code moved into Py_DECREF(). files: M Include/object.h diff --git a/Include/object.h b/Include/object.h index 7b07d7d26cfb..f9c07f7d1398 100644 --- a/Include/object.h +++ b/Include/object.h @@ -735,11 +735,7 @@ PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void); #define _Py_INC_REFTOTAL _Py_RefTotal++ #define _Py_DEC_REFTOTAL _Py_RefTotal-- #define _Py_REF_DEBUG_COMMA , -#define _Py_CHECK_REFCNT(OP) \ -{ if (((PyObject*)OP)->ob_refcnt < 0) \ - _Py_NegativeRefcount(__FILE__, __LINE__, \ - (PyObject *)(OP)); \ -} + /* Py_REF_DEBUG also controls the display of refcounts and memory block * allocations at the interactive prompt and at interpreter shutdown */ @@ -748,7 +744,6 @@ PyAPI_FUNC(void) _PyDebug_PrintTotalRefs(void); #define _Py_INC_REFTOTAL #define _Py_DEC_REFTOTAL #define _Py_REF_DEBUG_COMMA -#define _Py_CHECK_REFCNT(OP) /* a semicolon */; #endif /* Py_REF_DEBUG */ #ifdef COUNT_ALLOCS @@ -780,17 +775,21 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); #else /* Without Py_TRACE_REFS, there's little enough to do that we expand code - * inline. - */ -#define _Py_NewReference(op) ( \ - (_Py_tracemalloc_config.tracing \ - ? _PyTraceMalloc_NewReference(op) \ - : 0), \ - _Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \ - _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ - Py_REFCNT(op) = 1) + inline. */ +static inline void _Py_NewReference(PyObject *op) +{ + if (_Py_tracemalloc_config.tracing) { + _PyTraceMalloc_NewReference(op); + } + _Py_INC_TPALLOCS(op); + _Py_INC_REFTOTAL; + Py_REFCNT(op) = 1; +} -#define _Py_ForgetReference(op) _Py_INC_TPFREES(op) +static inline void _Py_ForgetReference(PyObject *op) +{ + _Py_INC_TPFREES(op); +} #ifdef Py_LIMITED_API PyAPI_FUNC(void) _Py_Dealloc(PyObject *); @@ -801,19 +800,33 @@ PyAPI_FUNC(void) _Py_Dealloc(PyObject *); #endif #endif /* !Py_TRACE_REFS */ -#define Py_INCREF(op) ( \ - _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ - ((PyObject *)(op))->ob_refcnt++) - -#define Py_DECREF(op) \ - do { \ - PyObject *_py_decref_tmp = (PyObject *)(op); \ - if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ - --(_py_decref_tmp)->ob_refcnt != 0) \ - _Py_CHECK_REFCNT(_py_decref_tmp) \ - else \ - _Py_Dealloc(_py_decref_tmp); \ - } while (0) + +static inline void _Py_INCREF(PyObject *op) +{ + _Py_INC_REFTOTAL; + op->ob_refcnt++; +} + +#define Py_INCREF(op) _Py_INCREF((PyObject *)(op)) + +static inline void _Py_DECREF(const char *filename, int lineno, + PyObject *op) +{ + _Py_DEC_REFTOTAL; + if (--op->ob_refcnt != 0) { +#ifdef Py_REF_DEBUG + if (op->ob_refcnt < 0) { + _Py_NegativeRefcount(filename, lineno, op); + } +#endif + } + else { + _Py_Dealloc(op); + } +} + +#define Py_DECREF(op) _Py_DECREF(__FILE__, __LINE__, (PyObject *)(op)) + /* Safely decref `op` and set `op` to NULL, especially useful in tp_clear * and tp_dealloc implementations. From webhook-mailer at python.org Mon Oct 29 09:49:32 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 29 Oct 2018 13:49:32 -0000 Subject: [Python-checkins] bpo-35059: Remove Py_STATIC_INLINE() macro (GH-10216) Message-ID: https://github.com/python/cpython/commit/542497aa9f71c664768c3d5b7398c03679d3a7e1 commit: 542497aa9f71c664768c3d5b7398c03679d3a7e1 branch: master author: Victor Stinner committer: GitHub date: 2018-10-29T14:49:24+01:00 summary: bpo-35059: Remove Py_STATIC_INLINE() macro (GH-10216) "static inline" should be used directly. Forcing the compiler to inline is not recommended. files: M Include/objimpl.h M Include/pydtrace.h M Include/pyport.h diff --git a/Include/objimpl.h b/Include/objimpl.h index 6ce64550401a..b3d3a81a6c94 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -144,7 +144,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); See also pymem.h. These inline functions expect non-NULL object pointers. */ -Py_STATIC_INLINE(PyObject*) +static inline PyObject* PyObject_INIT(PyObject *op, PyTypeObject *typeobj) { assert(op != NULL); @@ -153,7 +153,7 @@ PyObject_INIT(PyObject *op, PyTypeObject *typeobj) return op; } -Py_STATIC_INLINE(PyVarObject*) +static inline PyVarObject* PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) { assert(op != NULL); diff --git a/Include/pydtrace.h b/Include/pydtrace.h index cfe192fc5d29..037961d429c6 100644 --- a/Include/pydtrace.h +++ b/Include/pydtrace.h @@ -25,29 +25,29 @@ extern "C" { /* Without DTrace, compile to nothing. */ -Py_STATIC_INLINE(void) PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {} -Py_STATIC_INLINE(void) PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {} -Py_STATIC_INLINE(void) PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {} -Py_STATIC_INLINE(void) PyDTrace_GC_START(int arg0) {} -Py_STATIC_INLINE(void) PyDTrace_GC_DONE(int arg0) {} -Py_STATIC_INLINE(void) PyDTrace_INSTANCE_NEW_START(int arg0) {} -Py_STATIC_INLINE(void) PyDTrace_INSTANCE_NEW_DONE(int arg0) {} -Py_STATIC_INLINE(void) PyDTrace_INSTANCE_DELETE_START(int arg0) {} -Py_STATIC_INLINE(void) PyDTrace_INSTANCE_DELETE_DONE(int arg0) {} -Py_STATIC_INLINE(void) PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {} -Py_STATIC_INLINE(void) PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {} - -Py_STATIC_INLINE(int) PyDTrace_LINE_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_GC_START_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_GC_DONE_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; } -Py_STATIC_INLINE(int) PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; } +static inline void PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {} +static inline void PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {} +static inline void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {} +static inline void PyDTrace_GC_START(int arg0) {} +static inline void PyDTrace_GC_DONE(int arg0) {} +static inline void PyDTrace_INSTANCE_NEW_START(int arg0) {} +static inline void PyDTrace_INSTANCE_NEW_DONE(int arg0) {} +static inline void PyDTrace_INSTANCE_DELETE_START(int arg0) {} +static inline void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {} +static inline void PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {} +static inline void PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {} + +static inline int PyDTrace_LINE_ENABLED(void) { return 0; } +static inline int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; } +static inline int PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; } +static inline int PyDTrace_GC_START_ENABLED(void) { return 0; } +static inline int PyDTrace_GC_DONE_ENABLED(void) { return 0; } +static inline int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; } +static inline int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; } +static inline int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; } +static inline int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; } +static inline int PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; } +static inline int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; } #endif /* !WITH_DTRACE */ diff --git a/Include/pyport.h b/Include/pyport.h index 2f87f53700af..7f88c4f629a0 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -178,23 +178,6 @@ typedef int Py_ssize_clean_t; # define Py_LOCAL_INLINE(type) static inline type #endif -/* Declare a "static inline" function. Typical usage: - - Py_STATIC_INLINE(int) add(int a, int b) { return a + b; } - - If the compiler supports it, try to always inline the function even if no - optimization level was specified. */ -#if defined(__GNUC__) || defined(__clang__) -# define Py_STATIC_INLINE(TYPE) \ - __attribute__((always_inline)) static inline TYPE -#elif defined(_MSC_VER) -# define Py_STATIC_INLINE(TYPE) \ - static __forceinline TYPE -#else -# define Py_STATIC_INLINE(TYPE) static inline TYPE -#endif - - /* Py_MEMCPY is kept for backwards compatibility, * see https://bugs.python.org/issue28126 */ #define Py_MEMCPY memcpy From webhook-mailer at python.org Mon Oct 29 12:03:31 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 29 Oct 2018 16:03:31 -0000 Subject: [Python-checkins] [2.7] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (GH-10218) Message-ID: https://github.com/python/cpython/commit/64ffee7ad2655c7de9b3b6548aad0c317877ec49 commit: 64ffee7ad2655c7de9b3b6548aad0c317877ec49 branch: 2.7 author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-29T18:03:26+02:00 summary: [2.7] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) (GH-10218) (cherry picked from commit 53835e92d315340444e3dd083b3f69a590b00e07) files: M Modules/termios.c diff --git a/Modules/termios.c b/Modules/termios.c index e26e714e0ec1..4349df64817a 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -120,11 +120,11 @@ termios_tcgetattr(PyObject *self, PyObject *args) PyList_SetItem(v, 3, PyInt_FromLong((long)mode.c_lflag)); PyList_SetItem(v, 4, PyInt_FromLong((long)ispeed)); PyList_SetItem(v, 5, PyInt_FromLong((long)ospeed)); - PyList_SetItem(v, 6, cc); - if (PyErr_Occurred()){ + if (PyErr_Occurred()) { Py_DECREF(v); goto err; } + PyList_SetItem(v, 6, cc); return v; err: Py_DECREF(cc); From webhook-mailer at python.org Mon Oct 29 13:30:29 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 29 Oct 2018 17:30:29 -0000 Subject: [Python-checkins] bpo-33331: Clean modules in the reversed order in PyImport_Cleanup(). (GH-6565) Message-ID: https://github.com/python/cpython/commit/c93c58b5d560cfe44d9884ff02c9b18e06333360 commit: c93c58b5d560cfe44d9884ff02c9b18e06333360 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-29T19:30:16+02:00 summary: bpo-33331: Clean modules in the reversed order in PyImport_Cleanup(). (GH-6565) Modules imported last are now cleared first at interpreter shutdown. A newly imported module is moved to the end of sys.modules, behind modules on which it depends. files: A Misc/NEWS.d/next/Core and Builtins/2018-04-22-13-41-59.bpo-33331.s_DxdL.rst M Lib/importlib/_bootstrap.py M Python/import.c M Python/importlib.h diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index ba5a053d6bfe..857583afde26 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -302,33 +302,6 @@ def _module_repr(module): return ''.format(name, filename) -class _installed_safely: - - def __init__(self, module): - self._module = module - self._spec = module.__spec__ - - def __enter__(self): - # This must be done before putting the module in sys.modules - # (otherwise an optimization shortcut in import.c becomes - # wrong) - self._spec._initializing = True - sys.modules[self._spec.name] = self._module - - def __exit__(self, *args): - try: - spec = self._spec - if any(arg is not None for arg in args): - try: - del sys.modules[spec.name] - except KeyError: - pass - else: - _verbose_message('import {!r} # {!r}', spec.name, spec.loader) - finally: - self._spec._initializing = False - - class ModuleSpec: """The specification for a module, used for loading. @@ -614,30 +587,44 @@ def _exec(spec, module): if sys.modules.get(name) is not module: msg = 'module {!r} not in sys.modules'.format(name) raise ImportError(msg, name=name) - if spec.loader is None: - if spec.submodule_search_locations is None: - raise ImportError('missing loader', name=spec.name) - # namespace package - _init_module_attrs(spec, module, override=True) - return module - _init_module_attrs(spec, module, override=True) - if not hasattr(spec.loader, 'exec_module'): - # (issue19713) Once BuiltinImporter and ExtensionFileLoader - # have exec_module() implemented, we can add a deprecation - # warning here. - spec.loader.load_module(name) - else: - spec.loader.exec_module(module) - return sys.modules[name] + try: + if spec.loader is None: + if spec.submodule_search_locations is None: + raise ImportError('missing loader', name=spec.name) + # Namespace package. + _init_module_attrs(spec, module, override=True) + else: + _init_module_attrs(spec, module, override=True) + if not hasattr(spec.loader, 'exec_module'): + # (issue19713) Once BuiltinImporter and ExtensionFileLoader + # have exec_module() implemented, we can add a deprecation + # warning here. + spec.loader.load_module(name) + else: + spec.loader.exec_module(module) + finally: + # Update the order of insertion into sys.modules for module + # clean-up at shutdown. + module = sys.modules.pop(spec.name) + sys.modules[spec.name] = module + return module def _load_backward_compatible(spec): # (issue19713) Once BuiltinImporter and ExtensionFileLoader # have exec_module() implemented, we can add a deprecation # warning here. - spec.loader.load_module(spec.name) + try: + spec.loader.load_module(spec.name) + except: + if spec.name in sys.modules: + module = sys.modules.pop(spec.name) + sys.modules[spec.name] = module + raise # The module must be in sys.modules at this point! - module = sys.modules[spec.name] + # Move it to the end of sys.modules. + module = sys.modules.pop(spec.name) + sys.modules[spec.name] = module if getattr(module, '__loader__', None) is None: try: module.__loader__ = spec.loader @@ -663,23 +650,42 @@ def _load_backward_compatible(spec): def _load_unlocked(spec): # A helper for direct use by the import system. if spec.loader is not None: - # not a namespace package + # Not a namespace package. if not hasattr(spec.loader, 'exec_module'): return _load_backward_compatible(spec) module = module_from_spec(spec) - with _installed_safely(module): - if spec.loader is None: - if spec.submodule_search_locations is None: - raise ImportError('missing loader', name=spec.name) - # A namespace package so do nothing. - else: - spec.loader.exec_module(module) - # We don't ensure that the import-related module attributes get - # set in the sys.modules replacement case. Such modules are on - # their own. - return sys.modules[spec.name] + # This must be done before putting the module in sys.modules + # (otherwise an optimization shortcut in import.c becomes + # wrong). + spec._initializing = True + try: + sys.modules[spec.name] = module + try: + if spec.loader is None: + if spec.submodule_search_locations is None: + raise ImportError('missing loader', name=spec.name) + # A namespace package so do nothing. + else: + spec.loader.exec_module(module) + except: + try: + del sys.modules[spec.name] + except KeyError: + pass + raise + # Move the module to the end of sys.modules. + # We don't ensure that the import-related module attributes get + # set in the sys.modules replacement case. Such modules are on + # their own. + module = sys.modules.pop(spec.name) + sys.modules[spec.name] = module + _verbose_message('import {!r} # {!r}', spec.name, spec.loader) + finally: + spec._initializing = False + + return module # A method used during testing of _load_unlocked() and by # _load_module_shim(). diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-04-22-13-41-59.bpo-33331.s_DxdL.rst b/Misc/NEWS.d/next/Core and Builtins/2018-04-22-13-41-59.bpo-33331.s_DxdL.rst new file mode 100644 index 000000000000..95311a61e058 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-04-22-13-41-59.bpo-33331.s_DxdL.rst @@ -0,0 +1 @@ +Modules imported last are now cleared first at interpreter shutdown. diff --git a/Python/import.c b/Python/import.c index 2a9a5766583f..1e8c07b0b245 100644 --- a/Python/import.c +++ b/Python/import.c @@ -543,9 +543,10 @@ PyImport_Cleanup(void) module last. Likewise, we don't delete sys until the very end because it is implicitly referenced (e.g. by print). */ if (weaklist != NULL) { - Py_ssize_t i, n; - n = PyList_GET_SIZE(weaklist); - for (i = 0; i < n; i++) { + Py_ssize_t i; + /* Since dict is ordered in CPython 3.6+, modules are saved in + importing order. First clear modules imported later. */ + for (i = PyList_GET_SIZE(weaklist) - 1; i >= 0; i--) { PyObject *tup = PyList_GET_ITEM(weaklist, i); PyObject *name = PyTuple_GET_ITEM(tup, 0); PyObject *mod = PyWeakref_GET_OBJECT(PyTuple_GET_ITEM(tup, 1)); diff --git a/Python/importlib.h b/Python/importlib.h index 82e340676b66..c50c1f436f23 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -1,7 +1,7 @@ /* Auto-generated by Programs/_freeze_importlib.c */ const unsigned char _Py_M__importlib_bootstrap[] = { 99,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, - 0,64,0,0,0,115,208,1,0,0,100,0,90,0,100,1, + 0,64,0,0,0,115,194,1,0,0,100,0,90,0,100,1, 97,1,100,2,100,3,132,0,90,2,100,4,100,5,132,0, 90,3,105,0,90,4,105,0,90,5,71,0,100,6,100,7, 132,0,100,7,101,6,131,3,90,7,71,0,100,8,100,9, @@ -12,1068 +12,1171 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 156,1,100,22,100,23,132,2,90,14,100,24,100,25,132,0, 90,15,100,26,100,27,132,0,90,16,100,28,100,29,132,0, 90,17,100,30,100,31,132,0,90,18,71,0,100,32,100,33, - 132,0,100,33,131,2,90,19,71,0,100,34,100,35,132,0, - 100,35,131,2,90,20,100,1,100,1,100,36,156,2,100,37, - 100,38,132,2,90,21,100,96,100,39,100,40,132,1,90,22, - 100,41,100,42,156,1,100,43,100,44,132,2,90,23,100,45, - 100,46,132,0,90,24,100,47,100,48,132,0,90,25,100,49, - 100,50,132,0,90,26,100,51,100,52,132,0,90,27,100,53, - 100,54,132,0,90,28,100,55,100,56,132,0,90,29,71,0, + 132,0,100,33,131,2,90,19,100,1,100,1,100,34,156,2, + 100,35,100,36,132,2,90,20,100,94,100,37,100,38,132,1, + 90,21,100,39,100,40,156,1,100,41,100,42,132,2,90,22, + 100,43,100,44,132,0,90,23,100,45,100,46,132,0,90,24, + 100,47,100,48,132,0,90,25,100,49,100,50,132,0,90,26, + 100,51,100,52,132,0,90,27,100,53,100,54,132,0,90,28, + 71,0,100,55,100,56,132,0,100,56,131,2,90,29,71,0, 100,57,100,58,132,0,100,58,131,2,90,30,71,0,100,59, - 100,60,132,0,100,60,131,2,90,31,71,0,100,61,100,62, - 132,0,100,62,131,2,90,32,100,63,100,64,132,0,90,33, - 100,65,100,66,132,0,90,34,100,97,100,67,100,68,132,1, - 90,35,100,69,100,70,132,0,90,36,100,71,90,37,101,37, - 100,72,23,0,90,38,100,73,100,74,132,0,90,39,101,40, - 131,0,90,41,100,75,100,76,132,0,90,42,100,98,100,78, - 100,79,132,1,90,43,100,41,100,80,156,1,100,81,100,82, - 132,2,90,44,100,83,100,84,132,0,90,45,100,99,100,86, - 100,87,132,1,90,46,100,88,100,89,132,0,90,47,100,90, - 100,91,132,0,90,48,100,92,100,93,132,0,90,49,100,94, - 100,95,132,0,90,50,100,1,83,0,41,100,97,83,1,0, - 0,67,111,114,101,32,105,109,112,108,101,109,101,110,116,97, - 116,105,111,110,32,111,102,32,105,109,112,111,114,116,46,10, - 10,84,104,105,115,32,109,111,100,117,108,101,32,105,115,32, - 78,79,84,32,109,101,97,110,116,32,116,111,32,98,101,32, - 100,105,114,101,99,116,108,121,32,105,109,112,111,114,116,101, - 100,33,32,73,116,32,104,97,115,32,98,101,101,110,32,100, - 101,115,105,103,110,101,100,32,115,117,99,104,10,116,104,97, - 116,32,105,116,32,99,97,110,32,98,101,32,98,111,111,116, - 115,116,114,97,112,112,101,100,32,105,110,116,111,32,80,121, - 116,104,111,110,32,97,115,32,116,104,101,32,105,109,112,108, - 101,109,101,110,116,97,116,105,111,110,32,111,102,32,105,109, - 112,111,114,116,46,32,65,115,10,115,117,99,104,32,105,116, - 32,114,101,113,117,105,114,101,115,32,116,104,101,32,105,110, - 106,101,99,116,105,111,110,32,111,102,32,115,112,101,99,105, - 102,105,99,32,109,111,100,117,108,101,115,32,97,110,100,32, - 97,116,116,114,105,98,117,116,101,115,32,105,110,32,111,114, - 100,101,114,32,116,111,10,119,111,114,107,46,32,79,110,101, - 32,115,104,111,117,108,100,32,117,115,101,32,105,109,112,111, - 114,116,108,105,98,32,97,115,32,116,104,101,32,112,117,98, - 108,105,99,45,102,97,99,105,110,103,32,118,101,114,115,105, - 111,110,32,111,102,32,116,104,105,115,32,109,111,100,117,108, - 101,46,10,10,78,99,2,0,0,0,0,0,0,0,3,0, - 0,0,7,0,0,0,67,0,0,0,115,56,0,0,0,100, - 1,68,0,93,32,125,2,116,0,124,1,124,2,131,2,114, - 4,116,1,124,0,124,2,116,2,124,1,124,2,131,2,131, - 3,1,0,113,4,124,0,106,3,160,4,124,1,106,3,161, - 1,1,0,100,2,83,0,41,3,122,47,83,105,109,112,108, - 101,32,115,117,98,115,116,105,116,117,116,101,32,102,111,114, - 32,102,117,110,99,116,111,111,108,115,46,117,112,100,97,116, - 101,95,119,114,97,112,112,101,114,46,41,4,218,10,95,95, - 109,111,100,117,108,101,95,95,218,8,95,95,110,97,109,101, - 95,95,218,12,95,95,113,117,97,108,110,97,109,101,95,95, - 218,7,95,95,100,111,99,95,95,78,41,5,218,7,104,97, - 115,97,116,116,114,218,7,115,101,116,97,116,116,114,218,7, - 103,101,116,97,116,116,114,218,8,95,95,100,105,99,116,95, - 95,218,6,117,112,100,97,116,101,41,3,90,3,110,101,119, - 90,3,111,108,100,218,7,114,101,112,108,97,99,101,169,0, - 114,10,0,0,0,250,29,60,102,114,111,122,101,110,32,105, - 109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116, - 114,97,112,62,218,5,95,119,114,97,112,27,0,0,0,115, - 8,0,0,0,0,2,8,1,10,1,20,1,114,12,0,0, - 0,99,1,0,0,0,0,0,0,0,1,0,0,0,2,0, - 0,0,67,0,0,0,115,12,0,0,0,116,0,116,1,131, - 1,124,0,131,1,83,0,41,1,78,41,2,218,4,116,121, - 112,101,218,3,115,121,115,41,1,218,4,110,97,109,101,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,11, - 95,110,101,119,95,109,111,100,117,108,101,35,0,0,0,115, - 2,0,0,0,0,1,114,16,0,0,0,99,0,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,64,0,0,0, - 115,12,0,0,0,101,0,90,1,100,0,90,2,100,1,83, - 0,41,2,218,14,95,68,101,97,100,108,111,99,107,69,114, - 114,111,114,78,41,3,114,1,0,0,0,114,0,0,0,0, - 114,2,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,17,0,0,0,48,0, - 0,0,115,2,0,0,0,8,1,114,17,0,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,64, - 0,0,0,115,56,0,0,0,101,0,90,1,100,0,90,2, - 100,1,90,3,100,2,100,3,132,0,90,4,100,4,100,5, - 132,0,90,5,100,6,100,7,132,0,90,6,100,8,100,9, - 132,0,90,7,100,10,100,11,132,0,90,8,100,12,83,0, - 41,13,218,11,95,77,111,100,117,108,101,76,111,99,107,122, - 169,65,32,114,101,99,117,114,115,105,118,101,32,108,111,99, - 107,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110, - 32,119,104,105,99,104,32,105,115,32,97,98,108,101,32,116, - 111,32,100,101,116,101,99,116,32,100,101,97,100,108,111,99, - 107,115,10,32,32,32,32,40,101,46,103,46,32,116,104,114, - 101,97,100,32,49,32,116,114,121,105,110,103,32,116,111,32, - 116,97,107,101,32,108,111,99,107,115,32,65,32,116,104,101, - 110,32,66,44,32,97,110,100,32,116,104,114,101,97,100,32, - 50,32,116,114,121,105,110,103,32,116,111,10,32,32,32,32, - 116,97,107,101,32,108,111,99,107,115,32,66,32,116,104,101, - 110,32,65,41,46,10,32,32,32,32,99,2,0,0,0,0, - 0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,115, - 48,0,0,0,116,0,160,1,161,0,124,0,95,2,116,0, - 160,1,161,0,124,0,95,3,124,1,124,0,95,4,100,0, - 124,0,95,5,100,1,124,0,95,6,100,1,124,0,95,7, - 100,0,83,0,41,2,78,233,0,0,0,0,41,8,218,7, - 95,116,104,114,101,97,100,90,13,97,108,108,111,99,97,116, - 101,95,108,111,99,107,218,4,108,111,99,107,218,6,119,97, - 107,101,117,112,114,15,0,0,0,218,5,111,119,110,101,114, - 218,5,99,111,117,110,116,218,7,119,97,105,116,101,114,115, - 41,2,218,4,115,101,108,102,114,15,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,8,95,95, - 105,110,105,116,95,95,58,0,0,0,115,12,0,0,0,0, - 1,10,1,10,1,6,1,6,1,6,1,122,20,95,77,111, - 100,117,108,101,76,111,99,107,46,95,95,105,110,105,116,95, - 95,99,1,0,0,0,0,0,0,0,4,0,0,0,3,0, - 0,0,67,0,0,0,115,60,0,0,0,116,0,160,1,161, - 0,125,1,124,0,106,2,125,2,116,3,160,4,124,2,161, - 1,125,3,124,3,100,0,107,8,114,36,100,1,83,0,124, - 3,106,2,125,2,124,2,124,1,107,2,114,14,100,2,83, - 0,113,14,100,0,83,0,41,3,78,70,84,41,5,114,20, - 0,0,0,218,9,103,101,116,95,105,100,101,110,116,114,23, - 0,0,0,218,12,95,98,108,111,99,107,105,110,103,95,111, - 110,218,3,103,101,116,41,4,114,26,0,0,0,90,2,109, - 101,218,3,116,105,100,114,21,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,12,104,97,115,95, - 100,101,97,100,108,111,99,107,66,0,0,0,115,16,0,0, - 0,0,2,8,1,6,2,10,1,8,1,4,1,6,1,8, - 1,122,24,95,77,111,100,117,108,101,76,111,99,107,46,104, - 97,115,95,100,101,97,100,108,111,99,107,99,1,0,0,0, - 0,0,0,0,2,0,0,0,9,0,0,0,67,0,0,0, - 115,178,0,0,0,116,0,160,1,161,0,125,1,124,0,116, - 2,124,1,60,0,122,148,124,0,106,3,143,110,1,0,124, - 0,106,4,100,1,107,2,115,46,124,0,106,5,124,1,107, - 2,114,84,124,1,124,0,95,5,124,0,4,0,106,4,100, - 2,55,0,2,0,95,4,87,0,53,0,81,0,82,0,163, - 0,87,0,162,86,100,3,83,0,124,0,160,6,161,0,114, - 104,116,7,100,4,124,0,22,0,131,1,130,1,124,0,106, - 8,160,9,100,5,161,1,114,130,124,0,4,0,106,10,100, - 2,55,0,2,0,95,10,87,0,53,0,81,0,82,0,88, - 0,124,0,106,8,160,9,161,0,1,0,124,0,106,8,160, - 11,161,0,1,0,113,18,87,0,53,0,116,2,124,1,61, - 0,88,0,100,6,83,0,41,7,122,185,10,32,32,32,32, - 32,32,32,32,65,99,113,117,105,114,101,32,116,104,101,32, - 109,111,100,117,108,101,32,108,111,99,107,46,32,32,73,102, - 32,97,32,112,111,116,101,110,116,105,97,108,32,100,101,97, - 100,108,111,99,107,32,105,115,32,100,101,116,101,99,116,101, - 100,44,10,32,32,32,32,32,32,32,32,97,32,95,68,101, - 97,100,108,111,99,107,69,114,114,111,114,32,105,115,32,114, - 97,105,115,101,100,46,10,32,32,32,32,32,32,32,32,79, - 116,104,101,114,119,105,115,101,44,32,116,104,101,32,108,111, - 99,107,32,105,115,32,97,108,119,97,121,115,32,97,99,113, - 117,105,114,101,100,32,97,110,100,32,84,114,117,101,32,105, - 115,32,114,101,116,117,114,110,101,100,46,10,32,32,32,32, - 32,32,32,32,114,19,0,0,0,233,1,0,0,0,84,122, - 23,100,101,97,100,108,111,99,107,32,100,101,116,101,99,116, - 101,100,32,98,121,32,37,114,70,78,41,12,114,20,0,0, - 0,114,28,0,0,0,114,29,0,0,0,114,21,0,0,0, - 114,24,0,0,0,114,23,0,0,0,114,32,0,0,0,114, - 17,0,0,0,114,22,0,0,0,218,7,97,99,113,117,105, - 114,101,114,25,0,0,0,218,7,114,101,108,101,97,115,101, - 41,2,114,26,0,0,0,114,31,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,34,0,0,0, - 78,0,0,0,115,30,0,0,0,0,6,8,1,8,1,2, - 2,8,1,20,1,6,1,14,1,18,1,8,1,12,1,12, - 1,24,2,10,1,16,2,122,19,95,77,111,100,117,108,101, - 76,111,99,107,46,97,99,113,117,105,114,101,99,1,0,0, - 0,0,0,0,0,2,0,0,0,9,0,0,0,67,0,0, - 0,115,122,0,0,0,116,0,160,1,161,0,125,1,124,0, - 106,2,143,98,1,0,124,0,106,3,124,1,107,3,114,34, - 116,4,100,1,131,1,130,1,124,0,106,5,100,2,107,4, - 115,48,116,6,130,1,124,0,4,0,106,5,100,3,56,0, - 2,0,95,5,124,0,106,5,100,2,107,2,114,108,100,0, - 124,0,95,3,124,0,106,7,114,108,124,0,4,0,106,7, - 100,3,56,0,2,0,95,7,124,0,106,8,160,9,161,0, - 1,0,87,0,53,0,81,0,82,0,88,0,100,0,83,0, - 41,4,78,122,31,99,97,110,110,111,116,32,114,101,108,101, - 97,115,101,32,117,110,45,97,99,113,117,105,114,101,100,32, - 108,111,99,107,114,19,0,0,0,114,33,0,0,0,41,10, - 114,20,0,0,0,114,28,0,0,0,114,21,0,0,0,114, - 23,0,0,0,218,12,82,117,110,116,105,109,101,69,114,114, - 111,114,114,24,0,0,0,218,14,65,115,115,101,114,116,105, - 111,110,69,114,114,111,114,114,25,0,0,0,114,22,0,0, - 0,114,35,0,0,0,41,2,114,26,0,0,0,114,31,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,35,0,0,0,103,0,0,0,115,22,0,0,0,0, - 1,8,1,8,1,10,1,8,1,14,1,14,1,10,1,6, - 1,6,1,14,1,122,19,95,77,111,100,117,108,101,76,111, - 99,107,46,114,101,108,101,97,115,101,99,1,0,0,0,0, - 0,0,0,1,0,0,0,5,0,0,0,67,0,0,0,115, - 18,0,0,0,100,1,160,0,124,0,106,1,116,2,124,0, - 131,1,161,2,83,0,41,2,78,122,23,95,77,111,100,117, - 108,101,76,111,99,107,40,123,33,114,125,41,32,97,116,32, - 123,125,41,3,218,6,102,111,114,109,97,116,114,15,0,0, - 0,218,2,105,100,41,1,114,26,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,8,95,95,114, - 101,112,114,95,95,116,0,0,0,115,2,0,0,0,0,1, - 122,20,95,77,111,100,117,108,101,76,111,99,107,46,95,95, - 114,101,112,114,95,95,78,41,9,114,1,0,0,0,114,0, - 0,0,0,114,2,0,0,0,114,3,0,0,0,114,27,0, - 0,0,114,32,0,0,0,114,34,0,0,0,114,35,0,0, - 0,114,40,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,18,0,0,0,52, - 0,0,0,115,12,0,0,0,8,4,4,2,8,8,8,12, - 8,25,8,13,114,18,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,48, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, - 6,100,7,132,0,90,6,100,8,100,9,132,0,90,7,100, - 10,83,0,41,11,218,16,95,68,117,109,109,121,77,111,100, - 117,108,101,76,111,99,107,122,86,65,32,115,105,109,112,108, - 101,32,95,77,111,100,117,108,101,76,111,99,107,32,101,113, - 117,105,118,97,108,101,110,116,32,102,111,114,32,80,121,116, - 104,111,110,32,98,117,105,108,100,115,32,119,105,116,104,111, - 117,116,10,32,32,32,32,109,117,108,116,105,45,116,104,114, - 101,97,100,105,110,103,32,115,117,112,112,111,114,116,46,99, - 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, - 67,0,0,0,115,16,0,0,0,124,1,124,0,95,0,100, - 1,124,0,95,1,100,0,83,0,41,2,78,114,19,0,0, - 0,41,2,114,15,0,0,0,114,24,0,0,0,41,2,114, - 26,0,0,0,114,15,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,27,0,0,0,124,0,0, - 0,115,4,0,0,0,0,1,6,1,122,25,95,68,117,109, - 109,121,77,111,100,117,108,101,76,111,99,107,46,95,95,105, - 110,105,116,95,95,99,1,0,0,0,0,0,0,0,1,0, - 0,0,3,0,0,0,67,0,0,0,115,18,0,0,0,124, - 0,4,0,106,0,100,1,55,0,2,0,95,0,100,2,83, - 0,41,3,78,114,33,0,0,0,84,41,1,114,24,0,0, - 0,41,1,114,26,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,34,0,0,0,128,0,0,0, - 115,4,0,0,0,0,1,14,1,122,24,95,68,117,109,109, - 121,77,111,100,117,108,101,76,111,99,107,46,97,99,113,117, - 105,114,101,99,1,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,67,0,0,0,115,36,0,0,0,124,0,106, - 0,100,1,107,2,114,18,116,1,100,2,131,1,130,1,124, - 0,4,0,106,0,100,3,56,0,2,0,95,0,100,0,83, - 0,41,4,78,114,19,0,0,0,122,31,99,97,110,110,111, - 116,32,114,101,108,101,97,115,101,32,117,110,45,97,99,113, - 117,105,114,101,100,32,108,111,99,107,114,33,0,0,0,41, - 2,114,24,0,0,0,114,36,0,0,0,41,1,114,26,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,35,0,0,0,132,0,0,0,115,6,0,0,0,0, - 1,10,1,8,1,122,24,95,68,117,109,109,121,77,111,100, - 117,108,101,76,111,99,107,46,114,101,108,101,97,115,101,99, - 1,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0, - 67,0,0,0,115,18,0,0,0,100,1,160,0,124,0,106, - 1,116,2,124,0,131,1,161,2,83,0,41,2,78,122,28, - 95,68,117,109,109,121,77,111,100,117,108,101,76,111,99,107, - 40,123,33,114,125,41,32,97,116,32,123,125,41,3,114,38, - 0,0,0,114,15,0,0,0,114,39,0,0,0,41,1,114, + 100,60,132,0,100,60,131,2,90,31,100,61,100,62,132,0, + 90,32,100,63,100,64,132,0,90,33,100,95,100,65,100,66, + 132,1,90,34,100,67,100,68,132,0,90,35,100,69,90,36, + 101,36,100,70,23,0,90,37,100,71,100,72,132,0,90,38, + 101,39,131,0,90,40,100,73,100,74,132,0,90,41,100,96, + 100,76,100,77,132,1,90,42,100,39,100,78,156,1,100,79, + 100,80,132,2,90,43,100,81,100,82,132,0,90,44,100,97, + 100,84,100,85,132,1,90,45,100,86,100,87,132,0,90,46, + 100,88,100,89,132,0,90,47,100,90,100,91,132,0,90,48, + 100,92,100,93,132,0,90,49,100,1,83,0,41,98,97,83, + 1,0,0,67,111,114,101,32,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,32,111,102,32,105,109,112,111,114,116, + 46,10,10,84,104,105,115,32,109,111,100,117,108,101,32,105, + 115,32,78,79,84,32,109,101,97,110,116,32,116,111,32,98, + 101,32,100,105,114,101,99,116,108,121,32,105,109,112,111,114, + 116,101,100,33,32,73,116,32,104,97,115,32,98,101,101,110, + 32,100,101,115,105,103,110,101,100,32,115,117,99,104,10,116, + 104,97,116,32,105,116,32,99,97,110,32,98,101,32,98,111, + 111,116,115,116,114,97,112,112,101,100,32,105,110,116,111,32, + 80,121,116,104,111,110,32,97,115,32,116,104,101,32,105,109, + 112,108,101,109,101,110,116,97,116,105,111,110,32,111,102,32, + 105,109,112,111,114,116,46,32,65,115,10,115,117,99,104,32, + 105,116,32,114,101,113,117,105,114,101,115,32,116,104,101,32, + 105,110,106,101,99,116,105,111,110,32,111,102,32,115,112,101, + 99,105,102,105,99,32,109,111,100,117,108,101,115,32,97,110, + 100,32,97,116,116,114,105,98,117,116,101,115,32,105,110,32, + 111,114,100,101,114,32,116,111,10,119,111,114,107,46,32,79, + 110,101,32,115,104,111,117,108,100,32,117,115,101,32,105,109, + 112,111,114,116,108,105,98,32,97,115,32,116,104,101,32,112, + 117,98,108,105,99,45,102,97,99,105,110,103,32,118,101,114, + 115,105,111,110,32,111,102,32,116,104,105,115,32,109,111,100, + 117,108,101,46,10,10,78,99,2,0,0,0,0,0,0,0, + 3,0,0,0,7,0,0,0,67,0,0,0,115,56,0,0, + 0,100,1,68,0,93,32,125,2,116,0,124,1,124,2,131, + 2,114,4,116,1,124,0,124,2,116,2,124,1,124,2,131, + 2,131,3,1,0,113,4,124,0,106,3,160,4,124,1,106, + 3,161,1,1,0,100,2,83,0,41,3,122,47,83,105,109, + 112,108,101,32,115,117,98,115,116,105,116,117,116,101,32,102, + 111,114,32,102,117,110,99,116,111,111,108,115,46,117,112,100, + 97,116,101,95,119,114,97,112,112,101,114,46,41,4,218,10, + 95,95,109,111,100,117,108,101,95,95,218,8,95,95,110,97, + 109,101,95,95,218,12,95,95,113,117,97,108,110,97,109,101, + 95,95,218,7,95,95,100,111,99,95,95,78,41,5,218,7, + 104,97,115,97,116,116,114,218,7,115,101,116,97,116,116,114, + 218,7,103,101,116,97,116,116,114,218,8,95,95,100,105,99, + 116,95,95,218,6,117,112,100,97,116,101,41,3,90,3,110, + 101,119,90,3,111,108,100,218,7,114,101,112,108,97,99,101, + 169,0,114,10,0,0,0,250,29,60,102,114,111,122,101,110, + 32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116, + 115,116,114,97,112,62,218,5,95,119,114,97,112,27,0,0, + 0,115,8,0,0,0,0,2,8,1,10,1,20,1,114,12, + 0,0,0,99,1,0,0,0,0,0,0,0,1,0,0,0, + 2,0,0,0,67,0,0,0,115,12,0,0,0,116,0,116, + 1,131,1,124,0,131,1,83,0,41,1,78,41,2,218,4, + 116,121,112,101,218,3,115,121,115,41,1,218,4,110,97,109, + 101,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,11,95,110,101,119,95,109,111,100,117,108,101,35,0,0, + 0,115,2,0,0,0,0,1,114,16,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0, + 0,0,115,12,0,0,0,101,0,90,1,100,0,90,2,100, + 1,83,0,41,2,218,14,95,68,101,97,100,108,111,99,107, + 69,114,114,111,114,78,41,3,114,1,0,0,0,114,0,0, + 0,0,114,2,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,17,0,0,0, + 48,0,0,0,115,2,0,0,0,8,1,114,17,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,64,0,0,0,115,56,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, + 100,5,132,0,90,5,100,6,100,7,132,0,90,6,100,8, + 100,9,132,0,90,7,100,10,100,11,132,0,90,8,100,12, + 83,0,41,13,218,11,95,77,111,100,117,108,101,76,111,99, + 107,122,169,65,32,114,101,99,117,114,115,105,118,101,32,108, + 111,99,107,32,105,109,112,108,101,109,101,110,116,97,116,105, + 111,110,32,119,104,105,99,104,32,105,115,32,97,98,108,101, + 32,116,111,32,100,101,116,101,99,116,32,100,101,97,100,108, + 111,99,107,115,10,32,32,32,32,40,101,46,103,46,32,116, + 104,114,101,97,100,32,49,32,116,114,121,105,110,103,32,116, + 111,32,116,97,107,101,32,108,111,99,107,115,32,65,32,116, + 104,101,110,32,66,44,32,97,110,100,32,116,104,114,101,97, + 100,32,50,32,116,114,121,105,110,103,32,116,111,10,32,32, + 32,32,116,97,107,101,32,108,111,99,107,115,32,66,32,116, + 104,101,110,32,65,41,46,10,32,32,32,32,99,2,0,0, + 0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0, + 0,115,48,0,0,0,116,0,160,1,161,0,124,0,95,2, + 116,0,160,1,161,0,124,0,95,3,124,1,124,0,95,4, + 100,0,124,0,95,5,100,1,124,0,95,6,100,1,124,0, + 95,7,100,0,83,0,41,2,78,233,0,0,0,0,41,8, + 218,7,95,116,104,114,101,97,100,90,13,97,108,108,111,99, + 97,116,101,95,108,111,99,107,218,4,108,111,99,107,218,6, + 119,97,107,101,117,112,114,15,0,0,0,218,5,111,119,110, + 101,114,218,5,99,111,117,110,116,218,7,119,97,105,116,101, + 114,115,41,2,218,4,115,101,108,102,114,15,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8, + 95,95,105,110,105,116,95,95,58,0,0,0,115,12,0,0, + 0,0,1,10,1,10,1,6,1,6,1,6,1,122,20,95, + 77,111,100,117,108,101,76,111,99,107,46,95,95,105,110,105, + 116,95,95,99,1,0,0,0,0,0,0,0,4,0,0,0, + 3,0,0,0,67,0,0,0,115,60,0,0,0,116,0,160, + 1,161,0,125,1,124,0,106,2,125,2,116,3,160,4,124, + 2,161,1,125,3,124,3,100,0,107,8,114,36,100,1,83, + 0,124,3,106,2,125,2,124,2,124,1,107,2,114,14,100, + 2,83,0,113,14,100,0,83,0,41,3,78,70,84,41,5, + 114,20,0,0,0,218,9,103,101,116,95,105,100,101,110,116, + 114,23,0,0,0,218,12,95,98,108,111,99,107,105,110,103, + 95,111,110,218,3,103,101,116,41,4,114,26,0,0,0,90, + 2,109,101,218,3,116,105,100,114,21,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,12,104,97, + 115,95,100,101,97,100,108,111,99,107,66,0,0,0,115,16, + 0,0,0,0,2,8,1,6,2,10,1,8,1,4,1,6, + 1,8,1,122,24,95,77,111,100,117,108,101,76,111,99,107, + 46,104,97,115,95,100,101,97,100,108,111,99,107,99,1,0, + 0,0,0,0,0,0,2,0,0,0,9,0,0,0,67,0, + 0,0,115,178,0,0,0,116,0,160,1,161,0,125,1,124, + 0,116,2,124,1,60,0,122,148,124,0,106,3,143,110,1, + 0,124,0,106,4,100,1,107,2,115,46,124,0,106,5,124, + 1,107,2,114,84,124,1,124,0,95,5,124,0,4,0,106, + 4,100,2,55,0,2,0,95,4,87,0,53,0,81,0,82, + 0,163,0,87,0,162,86,100,3,83,0,124,0,160,6,161, + 0,114,104,116,7,100,4,124,0,22,0,131,1,130,1,124, + 0,106,8,160,9,100,5,161,1,114,130,124,0,4,0,106, + 10,100,2,55,0,2,0,95,10,87,0,53,0,81,0,82, + 0,88,0,124,0,106,8,160,9,161,0,1,0,124,0,106, + 8,160,11,161,0,1,0,113,18,87,0,53,0,116,2,124, + 1,61,0,88,0,100,6,83,0,41,7,122,185,10,32,32, + 32,32,32,32,32,32,65,99,113,117,105,114,101,32,116,104, + 101,32,109,111,100,117,108,101,32,108,111,99,107,46,32,32, + 73,102,32,97,32,112,111,116,101,110,116,105,97,108,32,100, + 101,97,100,108,111,99,107,32,105,115,32,100,101,116,101,99, + 116,101,100,44,10,32,32,32,32,32,32,32,32,97,32,95, + 68,101,97,100,108,111,99,107,69,114,114,111,114,32,105,115, + 32,114,97,105,115,101,100,46,10,32,32,32,32,32,32,32, + 32,79,116,104,101,114,119,105,115,101,44,32,116,104,101,32, + 108,111,99,107,32,105,115,32,97,108,119,97,121,115,32,97, + 99,113,117,105,114,101,100,32,97,110,100,32,84,114,117,101, + 32,105,115,32,114,101,116,117,114,110,101,100,46,10,32,32, + 32,32,32,32,32,32,114,19,0,0,0,233,1,0,0,0, + 84,122,23,100,101,97,100,108,111,99,107,32,100,101,116,101, + 99,116,101,100,32,98,121,32,37,114,70,78,41,12,114,20, + 0,0,0,114,28,0,0,0,114,29,0,0,0,114,21,0, + 0,0,114,24,0,0,0,114,23,0,0,0,114,32,0,0, + 0,114,17,0,0,0,114,22,0,0,0,218,7,97,99,113, + 117,105,114,101,114,25,0,0,0,218,7,114,101,108,101,97, + 115,101,41,2,114,26,0,0,0,114,31,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,34,0, + 0,0,78,0,0,0,115,30,0,0,0,0,6,8,1,8, + 1,2,2,8,1,20,1,6,1,14,1,18,1,8,1,12, + 1,12,1,24,2,10,1,16,2,122,19,95,77,111,100,117, + 108,101,76,111,99,107,46,97,99,113,117,105,114,101,99,1, + 0,0,0,0,0,0,0,2,0,0,0,9,0,0,0,67, + 0,0,0,115,122,0,0,0,116,0,160,1,161,0,125,1, + 124,0,106,2,143,98,1,0,124,0,106,3,124,1,107,3, + 114,34,116,4,100,1,131,1,130,1,124,0,106,5,100,2, + 107,4,115,48,116,6,130,1,124,0,4,0,106,5,100,3, + 56,0,2,0,95,5,124,0,106,5,100,2,107,2,114,108, + 100,0,124,0,95,3,124,0,106,7,114,108,124,0,4,0, + 106,7,100,3,56,0,2,0,95,7,124,0,106,8,160,9, + 161,0,1,0,87,0,53,0,81,0,82,0,88,0,100,0, + 83,0,41,4,78,122,31,99,97,110,110,111,116,32,114,101, + 108,101,97,115,101,32,117,110,45,97,99,113,117,105,114,101, + 100,32,108,111,99,107,114,19,0,0,0,114,33,0,0,0, + 41,10,114,20,0,0,0,114,28,0,0,0,114,21,0,0, + 0,114,23,0,0,0,218,12,82,117,110,116,105,109,101,69, + 114,114,111,114,114,24,0,0,0,218,14,65,115,115,101,114, + 116,105,111,110,69,114,114,111,114,114,25,0,0,0,114,22, + 0,0,0,114,35,0,0,0,41,2,114,26,0,0,0,114, + 31,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,35,0,0,0,103,0,0,0,115,22,0,0, + 0,0,1,8,1,8,1,10,1,8,1,14,1,14,1,10, + 1,6,1,6,1,14,1,122,19,95,77,111,100,117,108,101, + 76,111,99,107,46,114,101,108,101,97,115,101,99,1,0,0, + 0,0,0,0,0,1,0,0,0,5,0,0,0,67,0,0, + 0,115,18,0,0,0,100,1,160,0,124,0,106,1,116,2, + 124,0,131,1,161,2,83,0,41,2,78,122,23,95,77,111, + 100,117,108,101,76,111,99,107,40,123,33,114,125,41,32,97, + 116,32,123,125,41,3,218,6,102,111,114,109,97,116,114,15, + 0,0,0,218,2,105,100,41,1,114,26,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,95, + 95,114,101,112,114,95,95,116,0,0,0,115,2,0,0,0, + 0,1,122,20,95,77,111,100,117,108,101,76,111,99,107,46, + 95,95,114,101,112,114,95,95,78,41,9,114,1,0,0,0, + 114,0,0,0,0,114,2,0,0,0,114,3,0,0,0,114, + 27,0,0,0,114,32,0,0,0,114,34,0,0,0,114,35, + 0,0,0,114,40,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,18,0,0, + 0,52,0,0,0,115,12,0,0,0,8,4,4,2,8,8, + 8,12,8,25,8,13,114,18,0,0,0,99,0,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,64,0,0,0, + 115,48,0,0,0,101,0,90,1,100,0,90,2,100,1,90, + 3,100,2,100,3,132,0,90,4,100,4,100,5,132,0,90, + 5,100,6,100,7,132,0,90,6,100,8,100,9,132,0,90, + 7,100,10,83,0,41,11,218,16,95,68,117,109,109,121,77, + 111,100,117,108,101,76,111,99,107,122,86,65,32,115,105,109, + 112,108,101,32,95,77,111,100,117,108,101,76,111,99,107,32, + 101,113,117,105,118,97,108,101,110,116,32,102,111,114,32,80, + 121,116,104,111,110,32,98,117,105,108,100,115,32,119,105,116, + 104,111,117,116,10,32,32,32,32,109,117,108,116,105,45,116, + 104,114,101,97,100,105,110,103,32,115,117,112,112,111,114,116, + 46,99,2,0,0,0,0,0,0,0,2,0,0,0,2,0, + 0,0,67,0,0,0,115,16,0,0,0,124,1,124,0,95, + 0,100,1,124,0,95,1,100,0,83,0,41,2,78,114,19, + 0,0,0,41,2,114,15,0,0,0,114,24,0,0,0,41, + 2,114,26,0,0,0,114,15,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,27,0,0,0,124, + 0,0,0,115,4,0,0,0,0,1,6,1,122,25,95,68, + 117,109,109,121,77,111,100,117,108,101,76,111,99,107,46,95, + 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, + 1,0,0,0,3,0,0,0,67,0,0,0,115,18,0,0, + 0,124,0,4,0,106,0,100,1,55,0,2,0,95,0,100, + 2,83,0,41,3,78,114,33,0,0,0,84,41,1,114,24, + 0,0,0,41,1,114,26,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,34,0,0,0,128,0, + 0,0,115,4,0,0,0,0,1,14,1,122,24,95,68,117, + 109,109,121,77,111,100,117,108,101,76,111,99,107,46,97,99, + 113,117,105,114,101,99,1,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,36,0,0,0,124, + 0,106,0,100,1,107,2,114,18,116,1,100,2,131,1,130, + 1,124,0,4,0,106,0,100,3,56,0,2,0,95,0,100, + 0,83,0,41,4,78,114,19,0,0,0,122,31,99,97,110, + 110,111,116,32,114,101,108,101,97,115,101,32,117,110,45,97, + 99,113,117,105,114,101,100,32,108,111,99,107,114,33,0,0, + 0,41,2,114,24,0,0,0,114,36,0,0,0,41,1,114, 26,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,40,0,0,0,137,0,0,0,115,2,0,0, - 0,0,1,122,25,95,68,117,109,109,121,77,111,100,117,108, - 101,76,111,99,107,46,95,95,114,101,112,114,95,95,78,41, - 8,114,1,0,0,0,114,0,0,0,0,114,2,0,0,0, - 114,3,0,0,0,114,27,0,0,0,114,34,0,0,0,114, - 35,0,0,0,114,40,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,41,0, - 0,0,120,0,0,0,115,10,0,0,0,8,2,4,2,8, - 4,8,4,8,5,114,41,0,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115, - 36,0,0,0,101,0,90,1,100,0,90,2,100,1,100,2, - 132,0,90,3,100,3,100,4,132,0,90,4,100,5,100,6, - 132,0,90,5,100,7,83,0,41,8,218,18,95,77,111,100, - 117,108,101,76,111,99,107,77,97,110,97,103,101,114,99,2, - 0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,67, - 0,0,0,115,16,0,0,0,124,1,124,0,95,0,100,0, - 124,0,95,1,100,0,83,0,41,1,78,41,2,218,5,95, - 110,97,109,101,218,5,95,108,111,99,107,41,2,114,26,0, - 0,0,114,15,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,27,0,0,0,143,0,0,0,115, - 4,0,0,0,0,1,6,1,122,27,95,77,111,100,117,108, - 101,76,111,99,107,77,97,110,97,103,101,114,46,95,95,105, - 110,105,116,95,95,99,1,0,0,0,0,0,0,0,1,0, - 0,0,2,0,0,0,67,0,0,0,115,26,0,0,0,116, - 0,124,0,106,1,131,1,124,0,95,2,124,0,106,2,160, - 3,161,0,1,0,100,0,83,0,41,1,78,41,4,218,16, - 95,103,101,116,95,109,111,100,117,108,101,95,108,111,99,107, - 114,43,0,0,0,114,44,0,0,0,114,34,0,0,0,41, + 0,0,0,114,35,0,0,0,132,0,0,0,115,6,0,0, + 0,0,1,10,1,8,1,122,24,95,68,117,109,109,121,77, + 111,100,117,108,101,76,111,99,107,46,114,101,108,101,97,115, + 101,99,1,0,0,0,0,0,0,0,1,0,0,0,5,0, + 0,0,67,0,0,0,115,18,0,0,0,100,1,160,0,124, + 0,106,1,116,2,124,0,131,1,161,2,83,0,41,2,78, + 122,28,95,68,117,109,109,121,77,111,100,117,108,101,76,111, + 99,107,40,123,33,114,125,41,32,97,116,32,123,125,41,3, + 114,38,0,0,0,114,15,0,0,0,114,39,0,0,0,41, 1,114,26,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,9,95,95,101,110,116,101,114,95,95, - 147,0,0,0,115,4,0,0,0,0,1,12,1,122,28,95, + 114,11,0,0,0,114,40,0,0,0,137,0,0,0,115,2, + 0,0,0,0,1,122,25,95,68,117,109,109,121,77,111,100, + 117,108,101,76,111,99,107,46,95,95,114,101,112,114,95,95, + 78,41,8,114,1,0,0,0,114,0,0,0,0,114,2,0, + 0,0,114,3,0,0,0,114,27,0,0,0,114,34,0,0, + 0,114,35,0,0,0,114,40,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 41,0,0,0,120,0,0,0,115,10,0,0,0,8,2,4, + 2,8,4,8,4,8,5,114,41,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, + 0,115,36,0,0,0,101,0,90,1,100,0,90,2,100,1, + 100,2,132,0,90,3,100,3,100,4,132,0,90,4,100,5, + 100,6,132,0,90,5,100,7,83,0,41,8,218,18,95,77, + 111,100,117,108,101,76,111,99,107,77,97,110,97,103,101,114, + 99,2,0,0,0,0,0,0,0,2,0,0,0,2,0,0, + 0,67,0,0,0,115,16,0,0,0,124,1,124,0,95,0, + 100,0,124,0,95,1,100,0,83,0,41,1,78,41,2,218, + 5,95,110,97,109,101,218,5,95,108,111,99,107,41,2,114, + 26,0,0,0,114,15,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,27,0,0,0,143,0,0, + 0,115,4,0,0,0,0,1,6,1,122,27,95,77,111,100, + 117,108,101,76,111,99,107,77,97,110,97,103,101,114,46,95, + 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, + 1,0,0,0,2,0,0,0,67,0,0,0,115,26,0,0, + 0,116,0,124,0,106,1,131,1,124,0,95,2,124,0,106, + 2,160,3,161,0,1,0,100,0,83,0,41,1,78,41,4, + 218,16,95,103,101,116,95,109,111,100,117,108,101,95,108,111, + 99,107,114,43,0,0,0,114,44,0,0,0,114,34,0,0, + 0,41,1,114,26,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,9,95,95,101,110,116,101,114, + 95,95,147,0,0,0,115,4,0,0,0,0,1,12,1,122, + 28,95,77,111,100,117,108,101,76,111,99,107,77,97,110,97, + 103,101,114,46,95,95,101,110,116,101,114,95,95,99,1,0, + 0,0,0,0,0,0,3,0,0,0,2,0,0,0,79,0, + 0,0,115,14,0,0,0,124,0,106,0,160,1,161,0,1, + 0,100,0,83,0,41,1,78,41,2,114,44,0,0,0,114, + 35,0,0,0,41,3,114,26,0,0,0,218,4,97,114,103, + 115,90,6,107,119,97,114,103,115,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,8,95,95,101,120,105,116, + 95,95,151,0,0,0,115,2,0,0,0,0,1,122,27,95, 77,111,100,117,108,101,76,111,99,107,77,97,110,97,103,101, - 114,46,95,95,101,110,116,101,114,95,95,99,1,0,0,0, - 0,0,0,0,3,0,0,0,2,0,0,0,79,0,0,0, - 115,14,0,0,0,124,0,106,0,160,1,161,0,1,0,100, - 0,83,0,41,1,78,41,2,114,44,0,0,0,114,35,0, - 0,0,41,3,114,26,0,0,0,218,4,97,114,103,115,90, - 6,107,119,97,114,103,115,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,8,95,95,101,120,105,116,95,95, - 151,0,0,0,115,2,0,0,0,0,1,122,27,95,77,111, - 100,117,108,101,76,111,99,107,77,97,110,97,103,101,114,46, - 95,95,101,120,105,116,95,95,78,41,6,114,1,0,0,0, - 114,0,0,0,0,114,2,0,0,0,114,27,0,0,0,114, - 46,0,0,0,114,48,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,42,0, - 0,0,141,0,0,0,115,6,0,0,0,8,2,8,4,8, - 4,114,42,0,0,0,99,1,0,0,0,0,0,0,0,3, - 0,0,0,8,0,0,0,67,0,0,0,115,130,0,0,0, - 116,0,160,1,161,0,1,0,122,106,122,14,116,2,124,0, - 25,0,131,0,125,1,87,0,110,24,4,0,116,3,107,10, - 114,48,1,0,1,0,1,0,100,1,125,1,89,0,110,2, - 88,0,124,1,100,1,107,8,114,112,116,4,100,1,107,8, - 114,76,116,5,124,0,131,1,125,1,110,8,116,6,124,0, - 131,1,125,1,124,0,102,1,100,2,100,3,132,1,125,2, - 116,7,160,8,124,1,124,2,161,2,116,2,124,0,60,0, - 87,0,53,0,116,0,160,9,161,0,1,0,88,0,124,1, - 83,0,41,4,122,139,71,101,116,32,111,114,32,99,114,101, - 97,116,101,32,116,104,101,32,109,111,100,117,108,101,32,108, - 111,99,107,32,102,111,114,32,97,32,103,105,118,101,110,32, - 109,111,100,117,108,101,32,110,97,109,101,46,10,10,32,32, - 32,32,65,99,113,117,105,114,101,47,114,101,108,101,97,115, - 101,32,105,110,116,101,114,110,97,108,108,121,32,116,104,101, - 32,103,108,111,98,97,108,32,105,109,112,111,114,116,32,108, - 111,99,107,32,116,111,32,112,114,111,116,101,99,116,10,32, - 32,32,32,95,109,111,100,117,108,101,95,108,111,99,107,115, - 46,78,99,2,0,0,0,0,0,0,0,2,0,0,0,8, - 0,0,0,83,0,0,0,115,48,0,0,0,116,0,160,1, - 161,0,1,0,122,24,116,2,160,3,124,1,161,1,124,0, - 107,8,114,30,116,2,124,1,61,0,87,0,53,0,116,0, - 160,4,161,0,1,0,88,0,100,0,83,0,41,1,78,41, - 5,218,4,95,105,109,112,218,12,97,99,113,117,105,114,101, - 95,108,111,99,107,218,13,95,109,111,100,117,108,101,95,108, - 111,99,107,115,114,30,0,0,0,218,12,114,101,108,101,97, - 115,101,95,108,111,99,107,41,2,218,3,114,101,102,114,15, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,2,99,98,176,0,0,0,115,10,0,0,0,0, - 1,8,1,2,4,14,1,10,2,122,28,95,103,101,116,95, - 109,111,100,117,108,101,95,108,111,99,107,46,60,108,111,99, - 97,108,115,62,46,99,98,41,10,114,49,0,0,0,114,50, - 0,0,0,114,51,0,0,0,218,8,75,101,121,69,114,114, - 111,114,114,20,0,0,0,114,41,0,0,0,114,18,0,0, - 0,218,8,95,119,101,97,107,114,101,102,114,53,0,0,0, - 114,52,0,0,0,41,3,114,15,0,0,0,114,21,0,0, - 0,114,54,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,45,0,0,0,157,0,0,0,115,28, - 0,0,0,0,6,8,1,2,1,2,1,14,1,14,1,10, - 2,8,1,8,1,10,2,8,2,12,11,20,2,10,2,114, - 45,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, - 0,8,0,0,0,67,0,0,0,115,54,0,0,0,116,0, - 124,0,131,1,125,1,122,12,124,1,160,1,161,0,1,0, - 87,0,110,20,4,0,116,2,107,10,114,40,1,0,1,0, - 1,0,89,0,110,10,88,0,124,1,160,3,161,0,1,0, - 100,1,83,0,41,2,122,189,65,99,113,117,105,114,101,115, - 32,116,104,101,110,32,114,101,108,101,97,115,101,115,32,116, - 104,101,32,109,111,100,117,108,101,32,108,111,99,107,32,102, - 111,114,32,97,32,103,105,118,101,110,32,109,111,100,117,108, - 101,32,110,97,109,101,46,10,10,32,32,32,32,84,104,105, - 115,32,105,115,32,117,115,101,100,32,116,111,32,101,110,115, - 117,114,101,32,97,32,109,111,100,117,108,101,32,105,115,32, - 99,111,109,112,108,101,116,101,108,121,32,105,110,105,116,105, - 97,108,105,122,101,100,44,32,105,110,32,116,104,101,10,32, - 32,32,32,101,118,101,110,116,32,105,116,32,105,115,32,98, - 101,105,110,103,32,105,109,112,111,114,116,101,100,32,98,121, - 32,97,110,111,116,104,101,114,32,116,104,114,101,97,100,46, - 10,32,32,32,32,78,41,4,114,45,0,0,0,114,34,0, - 0,0,114,17,0,0,0,114,35,0,0,0,41,2,114,15, - 0,0,0,114,21,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,19,95,108,111,99,107,95,117, - 110,108,111,99,107,95,109,111,100,117,108,101,194,0,0,0, - 115,12,0,0,0,0,6,8,1,2,1,12,1,14,3,6, - 2,114,57,0,0,0,99,1,0,0,0,0,0,0,0,3, - 0,0,0,3,0,0,0,79,0,0,0,115,10,0,0,0, - 124,0,124,1,124,2,142,1,83,0,41,1,97,46,1,0, - 0,114,101,109,111,118,101,95,105,109,112,111,114,116,108,105, - 98,95,102,114,97,109,101,115,32,105,110,32,105,109,112,111, - 114,116,46,99,32,119,105,108,108,32,97,108,119,97,121,115, - 32,114,101,109,111,118,101,32,115,101,113,117,101,110,99,101, - 115,10,32,32,32,32,111,102,32,105,109,112,111,114,116,108, - 105,98,32,102,114,97,109,101,115,32,116,104,97,116,32,101, - 110,100,32,119,105,116,104,32,97,32,99,97,108,108,32,116, - 111,32,116,104,105,115,32,102,117,110,99,116,105,111,110,10, - 10,32,32,32,32,85,115,101,32,105,116,32,105,110,115,116, - 101,97,100,32,111,102,32,97,32,110,111,114,109,97,108,32, - 99,97,108,108,32,105,110,32,112,108,97,99,101,115,32,119, - 104,101,114,101,32,105,110,99,108,117,100,105,110,103,32,116, - 104,101,32,105,109,112,111,114,116,108,105,98,10,32,32,32, - 32,102,114,97,109,101,115,32,105,110,116,114,111,100,117,99, - 101,115,32,117,110,119,97,110,116,101,100,32,110,111,105,115, - 101,32,105,110,116,111,32,116,104,101,32,116,114,97,99,101, - 98,97,99,107,32,40,101,46,103,46,32,119,104,101,110,32, - 101,120,101,99,117,116,105,110,103,10,32,32,32,32,109,111, - 100,117,108,101,32,99,111,100,101,41,10,32,32,32,32,114, - 10,0,0,0,41,3,218,1,102,114,47,0,0,0,90,4, - 107,119,100,115,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,25,95,99,97,108,108,95,119,105,116,104,95, - 102,114,97,109,101,115,95,114,101,109,111,118,101,100,211,0, - 0,0,115,2,0,0,0,0,8,114,59,0,0,0,114,33, - 0,0,0,41,1,218,9,118,101,114,98,111,115,105,116,121, - 99,1,0,0,0,1,0,0,0,3,0,0,0,4,0,0, - 0,71,0,0,0,115,54,0,0,0,116,0,106,1,106,2, - 124,1,107,5,114,50,124,0,160,3,100,1,161,1,115,30, - 100,2,124,0,23,0,125,0,116,4,124,0,106,5,124,2, - 142,0,116,0,106,6,100,3,141,2,1,0,100,4,83,0, - 41,5,122,61,80,114,105,110,116,32,116,104,101,32,109,101, - 115,115,97,103,101,32,116,111,32,115,116,100,101,114,114,32, - 105,102,32,45,118,47,80,89,84,72,79,78,86,69,82,66, - 79,83,69,32,105,115,32,116,117,114,110,101,100,32,111,110, - 46,41,2,250,1,35,122,7,105,109,112,111,114,116,32,122, - 2,35,32,41,1,90,4,102,105,108,101,78,41,7,114,14, - 0,0,0,218,5,102,108,97,103,115,218,7,118,101,114,98, - 111,115,101,218,10,115,116,97,114,116,115,119,105,116,104,218, - 5,112,114,105,110,116,114,38,0,0,0,218,6,115,116,100, - 101,114,114,41,3,218,7,109,101,115,115,97,103,101,114,60, - 0,0,0,114,47,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,16,95,118,101,114,98,111,115, - 101,95,109,101,115,115,97,103,101,222,0,0,0,115,8,0, - 0,0,0,2,12,1,10,1,8,1,114,68,0,0,0,99, - 1,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 3,0,0,0,115,26,0,0,0,135,0,102,1,100,1,100, - 2,132,8,125,1,116,0,124,1,136,0,131,2,1,0,124, - 1,83,0,41,3,122,49,68,101,99,111,114,97,116,111,114, - 32,116,111,32,118,101,114,105,102,121,32,116,104,101,32,110, - 97,109,101,100,32,109,111,100,117,108,101,32,105,115,32,98, - 117,105,108,116,45,105,110,46,99,2,0,0,0,0,0,0, - 0,2,0,0,0,4,0,0,0,19,0,0,0,115,38,0, - 0,0,124,1,116,0,106,1,107,7,114,28,116,2,100,1, - 160,3,124,1,161,1,124,1,100,2,141,2,130,1,136,0, - 124,0,124,1,131,2,83,0,41,3,78,122,29,123,33,114, - 125,32,105,115,32,110,111,116,32,97,32,98,117,105,108,116, - 45,105,110,32,109,111,100,117,108,101,41,1,114,15,0,0, - 0,41,4,114,14,0,0,0,218,20,98,117,105,108,116,105, - 110,95,109,111,100,117,108,101,95,110,97,109,101,115,218,11, - 73,109,112,111,114,116,69,114,114,111,114,114,38,0,0,0, - 41,2,114,26,0,0,0,218,8,102,117,108,108,110,97,109, - 101,41,1,218,3,102,120,110,114,10,0,0,0,114,11,0, - 0,0,218,25,95,114,101,113,117,105,114,101,115,95,98,117, - 105,108,116,105,110,95,119,114,97,112,112,101,114,232,0,0, - 0,115,10,0,0,0,0,1,10,1,10,1,2,255,6,2, - 122,52,95,114,101,113,117,105,114,101,115,95,98,117,105,108, - 116,105,110,46,60,108,111,99,97,108,115,62,46,95,114,101, - 113,117,105,114,101,115,95,98,117,105,108,116,105,110,95,119, - 114,97,112,112,101,114,41,1,114,12,0,0,0,41,2,114, - 72,0,0,0,114,73,0,0,0,114,10,0,0,0,41,1, - 114,72,0,0,0,114,11,0,0,0,218,17,95,114,101,113, - 117,105,114,101,115,95,98,117,105,108,116,105,110,230,0,0, - 0,115,6,0,0,0,0,2,12,5,10,1,114,74,0,0, + 114,46,95,95,101,120,105,116,95,95,78,41,6,114,1,0, + 0,0,114,0,0,0,0,114,2,0,0,0,114,27,0,0, + 0,114,46,0,0,0,114,48,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 42,0,0,0,141,0,0,0,115,6,0,0,0,8,2,8, + 4,8,4,114,42,0,0,0,99,1,0,0,0,0,0,0, + 0,3,0,0,0,8,0,0,0,67,0,0,0,115,130,0, + 0,0,116,0,160,1,161,0,1,0,122,106,122,14,116,2, + 124,0,25,0,131,0,125,1,87,0,110,24,4,0,116,3, + 107,10,114,48,1,0,1,0,1,0,100,1,125,1,89,0, + 110,2,88,0,124,1,100,1,107,8,114,112,116,4,100,1, + 107,8,114,76,116,5,124,0,131,1,125,1,110,8,116,6, + 124,0,131,1,125,1,124,0,102,1,100,2,100,3,132,1, + 125,2,116,7,160,8,124,1,124,2,161,2,116,2,124,0, + 60,0,87,0,53,0,116,0,160,9,161,0,1,0,88,0, + 124,1,83,0,41,4,122,139,71,101,116,32,111,114,32,99, + 114,101,97,116,101,32,116,104,101,32,109,111,100,117,108,101, + 32,108,111,99,107,32,102,111,114,32,97,32,103,105,118,101, + 110,32,109,111,100,117,108,101,32,110,97,109,101,46,10,10, + 32,32,32,32,65,99,113,117,105,114,101,47,114,101,108,101, + 97,115,101,32,105,110,116,101,114,110,97,108,108,121,32,116, + 104,101,32,103,108,111,98,97,108,32,105,109,112,111,114,116, + 32,108,111,99,107,32,116,111,32,112,114,111,116,101,99,116, + 10,32,32,32,32,95,109,111,100,117,108,101,95,108,111,99, + 107,115,46,78,99,2,0,0,0,0,0,0,0,2,0,0, + 0,8,0,0,0,83,0,0,0,115,48,0,0,0,116,0, + 160,1,161,0,1,0,122,24,116,2,160,3,124,1,161,1, + 124,0,107,8,114,30,116,2,124,1,61,0,87,0,53,0, + 116,0,160,4,161,0,1,0,88,0,100,0,83,0,41,1, + 78,41,5,218,4,95,105,109,112,218,12,97,99,113,117,105, + 114,101,95,108,111,99,107,218,13,95,109,111,100,117,108,101, + 95,108,111,99,107,115,114,30,0,0,0,218,12,114,101,108, + 101,97,115,101,95,108,111,99,107,41,2,218,3,114,101,102, + 114,15,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,2,99,98,176,0,0,0,115,10,0,0, + 0,0,1,8,1,2,4,14,1,10,2,122,28,95,103,101, + 116,95,109,111,100,117,108,101,95,108,111,99,107,46,60,108, + 111,99,97,108,115,62,46,99,98,41,10,114,49,0,0,0, + 114,50,0,0,0,114,51,0,0,0,218,8,75,101,121,69, + 114,114,111,114,114,20,0,0,0,114,41,0,0,0,114,18, + 0,0,0,218,8,95,119,101,97,107,114,101,102,114,53,0, + 0,0,114,52,0,0,0,41,3,114,15,0,0,0,114,21, + 0,0,0,114,54,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,45,0,0,0,157,0,0,0, + 115,28,0,0,0,0,6,8,1,2,1,2,1,14,1,14, + 1,10,2,8,1,8,1,10,2,8,2,12,11,20,2,10, + 2,114,45,0,0,0,99,1,0,0,0,0,0,0,0,2, + 0,0,0,8,0,0,0,67,0,0,0,115,54,0,0,0, + 116,0,124,0,131,1,125,1,122,12,124,1,160,1,161,0, + 1,0,87,0,110,20,4,0,116,2,107,10,114,40,1,0, + 1,0,1,0,89,0,110,10,88,0,124,1,160,3,161,0, + 1,0,100,1,83,0,41,2,122,189,65,99,113,117,105,114, + 101,115,32,116,104,101,110,32,114,101,108,101,97,115,101,115, + 32,116,104,101,32,109,111,100,117,108,101,32,108,111,99,107, + 32,102,111,114,32,97,32,103,105,118,101,110,32,109,111,100, + 117,108,101,32,110,97,109,101,46,10,10,32,32,32,32,84, + 104,105,115,32,105,115,32,117,115,101,100,32,116,111,32,101, + 110,115,117,114,101,32,97,32,109,111,100,117,108,101,32,105, + 115,32,99,111,109,112,108,101,116,101,108,121,32,105,110,105, + 116,105,97,108,105,122,101,100,44,32,105,110,32,116,104,101, + 10,32,32,32,32,101,118,101,110,116,32,105,116,32,105,115, + 32,98,101,105,110,103,32,105,109,112,111,114,116,101,100,32, + 98,121,32,97,110,111,116,104,101,114,32,116,104,114,101,97, + 100,46,10,32,32,32,32,78,41,4,114,45,0,0,0,114, + 34,0,0,0,114,17,0,0,0,114,35,0,0,0,41,2, + 114,15,0,0,0,114,21,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,19,95,108,111,99,107, + 95,117,110,108,111,99,107,95,109,111,100,117,108,101,194,0, + 0,0,115,12,0,0,0,0,6,8,1,2,1,12,1,14, + 3,6,2,114,57,0,0,0,99,1,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,79,0,0,0,115,10,0, + 0,0,124,0,124,1,124,2,142,1,83,0,41,1,97,46, + 1,0,0,114,101,109,111,118,101,95,105,109,112,111,114,116, + 108,105,98,95,102,114,97,109,101,115,32,105,110,32,105,109, + 112,111,114,116,46,99,32,119,105,108,108,32,97,108,119,97, + 121,115,32,114,101,109,111,118,101,32,115,101,113,117,101,110, + 99,101,115,10,32,32,32,32,111,102,32,105,109,112,111,114, + 116,108,105,98,32,102,114,97,109,101,115,32,116,104,97,116, + 32,101,110,100,32,119,105,116,104,32,97,32,99,97,108,108, + 32,116,111,32,116,104,105,115,32,102,117,110,99,116,105,111, + 110,10,10,32,32,32,32,85,115,101,32,105,116,32,105,110, + 115,116,101,97,100,32,111,102,32,97,32,110,111,114,109,97, + 108,32,99,97,108,108,32,105,110,32,112,108,97,99,101,115, + 32,119,104,101,114,101,32,105,110,99,108,117,100,105,110,103, + 32,116,104,101,32,105,109,112,111,114,116,108,105,98,10,32, + 32,32,32,102,114,97,109,101,115,32,105,110,116,114,111,100, + 117,99,101,115,32,117,110,119,97,110,116,101,100,32,110,111, + 105,115,101,32,105,110,116,111,32,116,104,101,32,116,114,97, + 99,101,98,97,99,107,32,40,101,46,103,46,32,119,104,101, + 110,32,101,120,101,99,117,116,105,110,103,10,32,32,32,32, + 109,111,100,117,108,101,32,99,111,100,101,41,10,32,32,32, + 32,114,10,0,0,0,41,3,218,1,102,114,47,0,0,0, + 90,4,107,119,100,115,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,25,95,99,97,108,108,95,119,105,116, + 104,95,102,114,97,109,101,115,95,114,101,109,111,118,101,100, + 211,0,0,0,115,2,0,0,0,0,8,114,59,0,0,0, + 114,33,0,0,0,41,1,218,9,118,101,114,98,111,115,105, + 116,121,99,1,0,0,0,1,0,0,0,3,0,0,0,4, + 0,0,0,71,0,0,0,115,54,0,0,0,116,0,106,1, + 106,2,124,1,107,5,114,50,124,0,160,3,100,1,161,1, + 115,30,100,2,124,0,23,0,125,0,116,4,124,0,106,5, + 124,2,142,0,116,0,106,6,100,3,141,2,1,0,100,4, + 83,0,41,5,122,61,80,114,105,110,116,32,116,104,101,32, + 109,101,115,115,97,103,101,32,116,111,32,115,116,100,101,114, + 114,32,105,102,32,45,118,47,80,89,84,72,79,78,86,69, + 82,66,79,83,69,32,105,115,32,116,117,114,110,101,100,32, + 111,110,46,41,2,250,1,35,122,7,105,109,112,111,114,116, + 32,122,2,35,32,41,1,90,4,102,105,108,101,78,41,7, + 114,14,0,0,0,218,5,102,108,97,103,115,218,7,118,101, + 114,98,111,115,101,218,10,115,116,97,114,116,115,119,105,116, + 104,218,5,112,114,105,110,116,114,38,0,0,0,218,6,115, + 116,100,101,114,114,41,3,218,7,109,101,115,115,97,103,101, + 114,60,0,0,0,114,47,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,16,95,118,101,114,98, + 111,115,101,95,109,101,115,115,97,103,101,222,0,0,0,115, + 8,0,0,0,0,2,12,1,10,1,8,1,114,68,0,0, 0,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0, 0,0,3,0,0,0,115,26,0,0,0,135,0,102,1,100, 1,100,2,132,8,125,1,116,0,124,1,136,0,131,2,1, - 0,124,1,83,0,41,3,122,47,68,101,99,111,114,97,116, + 0,124,1,83,0,41,3,122,49,68,101,99,111,114,97,116, 111,114,32,116,111,32,118,101,114,105,102,121,32,116,104,101, 32,110,97,109,101,100,32,109,111,100,117,108,101,32,105,115, - 32,102,114,111,122,101,110,46,99,2,0,0,0,0,0,0, - 0,2,0,0,0,4,0,0,0,19,0,0,0,115,38,0, - 0,0,116,0,160,1,124,1,161,1,115,28,116,2,100,1, - 160,3,124,1,161,1,124,1,100,2,141,2,130,1,136,0, - 124,0,124,1,131,2,83,0,41,3,78,122,27,123,33,114, - 125,32,105,115,32,110,111,116,32,97,32,102,114,111,122,101, - 110,32,109,111,100,117,108,101,41,1,114,15,0,0,0,41, - 4,114,49,0,0,0,218,9,105,115,95,102,114,111,122,101, - 110,114,70,0,0,0,114,38,0,0,0,41,2,114,26,0, - 0,0,114,71,0,0,0,41,1,114,72,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,24,95,114,101,113,117,105, - 114,101,115,95,102,114,111,122,101,110,95,119,114,97,112,112, - 101,114,243,0,0,0,115,10,0,0,0,0,1,10,1,10, - 1,2,255,6,2,122,50,95,114,101,113,117,105,114,101,115, - 95,102,114,111,122,101,110,46,60,108,111,99,97,108,115,62, - 46,95,114,101,113,117,105,114,101,115,95,102,114,111,122,101, - 110,95,119,114,97,112,112,101,114,41,1,114,12,0,0,0, - 41,2,114,72,0,0,0,114,76,0,0,0,114,10,0,0, - 0,41,1,114,72,0,0,0,114,11,0,0,0,218,16,95, - 114,101,113,117,105,114,101,115,95,102,114,111,122,101,110,241, - 0,0,0,115,6,0,0,0,0,2,12,5,10,1,114,77, - 0,0,0,99,2,0,0,0,0,0,0,0,4,0,0,0, - 3,0,0,0,67,0,0,0,115,62,0,0,0,116,0,124, - 1,124,0,131,2,125,2,124,1,116,1,106,2,107,6,114, - 50,116,1,106,2,124,1,25,0,125,3,116,3,124,2,124, - 3,131,2,1,0,116,1,106,2,124,1,25,0,83,0,116, - 4,124,2,131,1,83,0,100,1,83,0,41,2,122,128,76, - 111,97,100,32,116,104,101,32,115,112,101,99,105,102,105,101, - 100,32,109,111,100,117,108,101,32,105,110,116,111,32,115,121, - 115,46,109,111,100,117,108,101,115,32,97,110,100,32,114,101, - 116,117,114,110,32,105,116,46,10,10,32,32,32,32,84,104, - 105,115,32,109,101,116,104,111,100,32,105,115,32,100,101,112, - 114,101,99,97,116,101,100,46,32,32,85,115,101,32,108,111, - 97,100,101,114,46,101,120,101,99,95,109,111,100,117,108,101, - 32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,78, - 41,5,218,16,115,112,101,99,95,102,114,111,109,95,108,111, - 97,100,101,114,114,14,0,0,0,218,7,109,111,100,117,108, - 101,115,218,5,95,101,120,101,99,218,5,95,108,111,97,100, - 41,4,114,26,0,0,0,114,71,0,0,0,218,4,115,112, - 101,99,218,6,109,111,100,117,108,101,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,17,95,108,111,97,100, - 95,109,111,100,117,108,101,95,115,104,105,109,253,0,0,0, - 115,12,0,0,0,0,6,10,1,10,1,10,1,10,1,10, - 2,114,84,0,0,0,99,1,0,0,0,0,0,0,0,5, - 0,0,0,8,0,0,0,67,0,0,0,115,226,0,0,0, - 116,0,124,0,100,1,100,0,131,3,125,1,116,1,124,1, - 100,2,131,2,114,56,122,12,124,1,160,2,124,0,161,1, - 87,0,83,0,4,0,116,3,107,10,114,54,1,0,1,0, - 1,0,89,0,110,2,88,0,122,10,124,0,106,4,125,2, - 87,0,110,20,4,0,116,5,107,10,114,86,1,0,1,0, - 1,0,89,0,110,18,88,0,124,2,100,0,107,9,114,104, - 116,6,124,2,131,1,83,0,122,10,124,0,106,7,125,3, - 87,0,110,24,4,0,116,5,107,10,114,138,1,0,1,0, - 1,0,100,3,125,3,89,0,110,2,88,0,122,10,124,0, - 106,8,125,4,87,0,110,58,4,0,116,5,107,10,114,208, - 1,0,1,0,1,0,124,1,100,0,107,8,114,188,100,4, - 160,9,124,3,161,1,6,0,89,0,83,0,100,5,160,9, - 124,3,124,1,161,2,6,0,89,0,83,0,89,0,110,14, - 88,0,100,6,160,9,124,3,124,4,161,2,83,0,100,0, - 83,0,41,7,78,218,10,95,95,108,111,97,100,101,114,95, - 95,218,11,109,111,100,117,108,101,95,114,101,112,114,250,1, - 63,122,13,60,109,111,100,117,108,101,32,123,33,114,125,62, - 122,20,60,109,111,100,117,108,101,32,123,33,114,125,32,40, - 123,33,114,125,41,62,122,23,60,109,111,100,117,108,101,32, - 123,33,114,125,32,102,114,111,109,32,123,33,114,125,62,41, - 10,114,6,0,0,0,114,4,0,0,0,114,86,0,0,0, - 218,9,69,120,99,101,112,116,105,111,110,218,8,95,95,115, - 112,101,99,95,95,218,14,65,116,116,114,105,98,117,116,101, - 69,114,114,111,114,218,22,95,109,111,100,117,108,101,95,114, - 101,112,114,95,102,114,111,109,95,115,112,101,99,114,1,0, - 0,0,218,8,95,95,102,105,108,101,95,95,114,38,0,0, - 0,41,5,114,83,0,0,0,218,6,108,111,97,100,101,114, - 114,82,0,0,0,114,15,0,0,0,218,8,102,105,108,101, - 110,97,109,101,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,12,95,109,111,100,117,108,101,95,114,101,112, - 114,13,1,0,0,115,46,0,0,0,0,2,12,1,10,4, - 2,1,12,1,14,1,6,1,2,1,10,1,14,1,6,2, - 8,1,8,4,2,1,10,1,14,1,10,1,2,1,10,1, - 14,1,8,1,14,2,22,2,114,95,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, - 0,0,115,36,0,0,0,101,0,90,1,100,0,90,2,100, - 1,100,2,132,0,90,3,100,3,100,4,132,0,90,4,100, - 5,100,6,132,0,90,5,100,7,83,0,41,8,218,17,95, - 105,110,115,116,97,108,108,101,100,95,115,97,102,101,108,121, - 99,2,0,0,0,0,0,0,0,2,0,0,0,2,0,0, - 0,67,0,0,0,115,18,0,0,0,124,1,124,0,95,0, - 124,1,106,1,124,0,95,2,100,0,83,0,41,1,78,41, - 3,218,7,95,109,111,100,117,108,101,114,89,0,0,0,218, - 5,95,115,112,101,99,41,2,114,26,0,0,0,114,83,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,27,0,0,0,51,1,0,0,115,4,0,0,0,0, - 1,6,1,122,26,95,105,110,115,116,97,108,108,101,100,95, - 115,97,102,101,108,121,46,95,95,105,110,105,116,95,95,99, - 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, - 67,0,0,0,115,28,0,0,0,100,1,124,0,106,0,95, - 1,124,0,106,2,116,3,106,4,124,0,106,0,106,5,60, - 0,100,0,83,0,41,2,78,84,41,6,114,98,0,0,0, - 218,13,95,105,110,105,116,105,97,108,105,122,105,110,103,114, - 97,0,0,0,114,14,0,0,0,114,79,0,0,0,114,15, - 0,0,0,41,1,114,26,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,46,0,0,0,55,1, - 0,0,115,4,0,0,0,0,4,8,1,122,27,95,105,110, - 115,116,97,108,108,101,100,95,115,97,102,101,108,121,46,95, - 95,101,110,116,101,114,95,95,99,1,0,0,0,0,0,0, - 0,3,0,0,0,8,0,0,0,71,0,0,0,115,98,0, - 0,0,122,82,124,0,106,0,125,2,116,1,100,1,100,2, - 132,0,124,1,68,0,131,1,131,1,114,64,122,14,116,2, - 106,3,124,2,106,4,61,0,87,0,113,80,4,0,116,5, - 107,10,114,60,1,0,1,0,1,0,89,0,113,80,88,0, - 110,16,116,6,100,3,124,2,106,4,124,2,106,7,131,3, - 1,0,87,0,53,0,100,4,124,0,106,0,95,8,88,0, - 100,0,83,0,41,5,78,99,1,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,115,0,0,0,115,22,0,0, - 0,124,0,93,14,125,1,124,1,100,0,107,9,86,0,1, - 0,113,2,100,0,83,0,41,1,78,114,10,0,0,0,41, - 2,90,2,46,48,90,3,97,114,103,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,9,60,103,101,110,101, - 120,112,114,62,65,1,0,0,115,4,0,0,0,4,0,2, - 0,122,45,95,105,110,115,116,97,108,108,101,100,95,115,97, - 102,101,108,121,46,95,95,101,120,105,116,95,95,46,60,108, - 111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,62, - 122,18,105,109,112,111,114,116,32,123,33,114,125,32,35,32, - 123,33,114,125,70,41,9,114,98,0,0,0,218,3,97,110, - 121,114,14,0,0,0,114,79,0,0,0,114,15,0,0,0, - 114,55,0,0,0,114,68,0,0,0,114,93,0,0,0,114, - 99,0,0,0,41,3,114,26,0,0,0,114,47,0,0,0, - 114,82,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,114,48,0,0,0,62,1,0,0,115,18,0, - 0,0,0,1,2,1,6,1,18,1,2,1,14,1,14,1, - 8,2,20,2,122,26,95,105,110,115,116,97,108,108,101,100, - 95,115,97,102,101,108,121,46,95,95,101,120,105,116,95,95, - 78,41,6,114,1,0,0,0,114,0,0,0,0,114,2,0, - 0,0,114,27,0,0,0,114,46,0,0,0,114,48,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,96,0,0,0,49,1,0,0,115,6, - 0,0,0,8,2,8,4,8,7,114,96,0,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, - 0,0,0,115,114,0,0,0,101,0,90,1,100,0,90,2, - 100,1,90,3,100,2,100,2,100,2,100,3,156,3,100,4, - 100,5,132,2,90,4,100,6,100,7,132,0,90,5,100,8, - 100,9,132,0,90,6,101,7,100,10,100,11,132,0,131,1, - 90,8,101,8,106,9,100,12,100,11,132,0,131,1,90,8, - 101,7,100,13,100,14,132,0,131,1,90,10,101,7,100,15, - 100,16,132,0,131,1,90,11,101,11,106,9,100,17,100,16, - 132,0,131,1,90,11,100,2,83,0,41,18,218,10,77,111, - 100,117,108,101,83,112,101,99,97,208,5,0,0,84,104,101, - 32,115,112,101,99,105,102,105,99,97,116,105,111,110,32,102, - 111,114,32,97,32,109,111,100,117,108,101,44,32,117,115,101, - 100,32,102,111,114,32,108,111,97,100,105,110,103,46,10,10, - 32,32,32,32,65,32,109,111,100,117,108,101,39,115,32,115, - 112,101,99,32,105,115,32,116,104,101,32,115,111,117,114,99, - 101,32,102,111,114,32,105,110,102,111,114,109,97,116,105,111, - 110,32,97,98,111,117,116,32,116,104,101,32,109,111,100,117, - 108,101,46,32,32,70,111,114,10,32,32,32,32,100,97,116, - 97,32,97,115,115,111,99,105,97,116,101,100,32,119,105,116, - 104,32,116,104,101,32,109,111,100,117,108,101,44,32,105,110, - 99,108,117,100,105,110,103,32,115,111,117,114,99,101,44,32, - 117,115,101,32,116,104,101,32,115,112,101,99,39,115,10,32, - 32,32,32,108,111,97,100,101,114,46,10,10,32,32,32,32, - 96,110,97,109,101,96,32,105,115,32,116,104,101,32,97,98, - 115,111,108,117,116,101,32,110,97,109,101,32,111,102,32,116, - 104,101,32,109,111,100,117,108,101,46,32,32,96,108,111,97, - 100,101,114,96,32,105,115,32,116,104,101,32,108,111,97,100, - 101,114,10,32,32,32,32,116,111,32,117,115,101,32,119,104, - 101,110,32,108,111,97,100,105,110,103,32,116,104,101,32,109, - 111,100,117,108,101,46,32,32,96,112,97,114,101,110,116,96, - 32,105,115,32,116,104,101,32,110,97,109,101,32,111,102,32, - 116,104,101,10,32,32,32,32,112,97,99,107,97,103,101,32, - 116,104,101,32,109,111,100,117,108,101,32,105,115,32,105,110, - 46,32,32,84,104,101,32,112,97,114,101,110,116,32,105,115, - 32,100,101,114,105,118,101,100,32,102,114,111,109,32,116,104, - 101,32,110,97,109,101,46,10,10,32,32,32,32,96,105,115, - 95,112,97,99,107,97,103,101,96,32,100,101,116,101,114,109, - 105,110,101,115,32,105,102,32,116,104,101,32,109,111,100,117, - 108,101,32,105,115,32,99,111,110,115,105,100,101,114,101,100, - 32,97,32,112,97,99,107,97,103,101,32,111,114,10,32,32, - 32,32,110,111,116,46,32,32,79,110,32,109,111,100,117,108, - 101,115,32,116,104,105,115,32,105,115,32,114,101,102,108,101, - 99,116,101,100,32,98,121,32,116,104,101,32,96,95,95,112, - 97,116,104,95,95,96,32,97,116,116,114,105,98,117,116,101, - 46,10,10,32,32,32,32,96,111,114,105,103,105,110,96,32, - 105,115,32,116,104,101,32,115,112,101,99,105,102,105,99,32, - 108,111,99,97,116,105,111,110,32,117,115,101,100,32,98,121, - 32,116,104,101,32,108,111,97,100,101,114,32,102,114,111,109, - 32,119,104,105,99,104,32,116,111,10,32,32,32,32,108,111, - 97,100,32,116,104,101,32,109,111,100,117,108,101,44,32,105, - 102,32,116,104,97,116,32,105,110,102,111,114,109,97,116,105, - 111,110,32,105,115,32,97,118,97,105,108,97,98,108,101,46, - 32,32,87,104,101,110,32,102,105,108,101,110,97,109,101,32, - 105,115,10,32,32,32,32,115,101,116,44,32,111,114,105,103, - 105,110,32,119,105,108,108,32,109,97,116,99,104,46,10,10, - 32,32,32,32,96,104,97,115,95,108,111,99,97,116,105,111, - 110,96,32,105,110,100,105,99,97,116,101,115,32,116,104,97, - 116,32,97,32,115,112,101,99,39,115,32,34,111,114,105,103, - 105,110,34,32,114,101,102,108,101,99,116,115,32,97,32,108, - 111,99,97,116,105,111,110,46,10,32,32,32,32,87,104,101, - 110,32,116,104,105,115,32,105,115,32,84,114,117,101,44,32, - 96,95,95,102,105,108,101,95,95,96,32,97,116,116,114,105, - 98,117,116,101,32,111,102,32,116,104,101,32,109,111,100,117, - 108,101,32,105,115,32,115,101,116,46,10,10,32,32,32,32, - 96,99,97,99,104,101,100,96,32,105,115,32,116,104,101,32, - 108,111,99,97,116,105,111,110,32,111,102,32,116,104,101,32, - 99,97,99,104,101,100,32,98,121,116,101,99,111,100,101,32, - 102,105,108,101,44,32,105,102,32,97,110,121,46,32,32,73, - 116,10,32,32,32,32,99,111,114,114,101,115,112,111,110,100, - 115,32,116,111,32,116,104,101,32,96,95,95,99,97,99,104, - 101,100,95,95,96,32,97,116,116,114,105,98,117,116,101,46, - 10,10,32,32,32,32,96,115,117,98,109,111,100,117,108,101, - 95,115,101,97,114,99,104,95,108,111,99,97,116,105,111,110, - 115,96,32,105,115,32,116,104,101,32,115,101,113,117,101,110, - 99,101,32,111,102,32,112,97,116,104,32,101,110,116,114,105, - 101,115,32,116,111,10,32,32,32,32,115,101,97,114,99,104, - 32,119,104,101,110,32,105,109,112,111,114,116,105,110,103,32, - 115,117,98,109,111,100,117,108,101,115,46,32,32,73,102,32, - 115,101,116,44,32,105,115,95,112,97,99,107,97,103,101,32, - 115,104,111,117,108,100,32,98,101,10,32,32,32,32,84,114, - 117,101,45,45,97,110,100,32,70,97,108,115,101,32,111,116, - 104,101,114,119,105,115,101,46,10,10,32,32,32,32,80,97, - 99,107,97,103,101,115,32,97,114,101,32,115,105,109,112,108, - 121,32,109,111,100,117,108,101,115,32,116,104,97,116,32,40, - 109,97,121,41,32,104,97,118,101,32,115,117,98,109,111,100, - 117,108,101,115,46,32,32,73,102,32,97,32,115,112,101,99, - 10,32,32,32,32,104,97,115,32,97,32,110,111,110,45,78, - 111,110,101,32,118,97,108,117,101,32,105,110,32,96,115,117, - 98,109,111,100,117,108,101,95,115,101,97,114,99,104,95,108, - 111,99,97,116,105,111,110,115,96,44,32,116,104,101,32,105, - 109,112,111,114,116,10,32,32,32,32,115,121,115,116,101,109, - 32,119,105,108,108,32,99,111,110,115,105,100,101,114,32,109, - 111,100,117,108,101,115,32,108,111,97,100,101,100,32,102,114, - 111,109,32,116,104,101,32,115,112,101,99,32,97,115,32,112, - 97,99,107,97,103,101,115,46,10,10,32,32,32,32,79,110, - 108,121,32,102,105,110,100,101,114,115,32,40,115,101,101,32, - 105,109,112,111,114,116,108,105,98,46,97,98,99,46,77,101, - 116,97,80,97,116,104,70,105,110,100,101,114,32,97,110,100, - 10,32,32,32,32,105,109,112,111,114,116,108,105,98,46,97, - 98,99,46,80,97,116,104,69,110,116,114,121,70,105,110,100, - 101,114,41,32,115,104,111,117,108,100,32,109,111,100,105,102, - 121,32,77,111,100,117,108,101,83,112,101,99,32,105,110,115, - 116,97,110,99,101,115,46,10,10,32,32,32,32,78,41,3, - 218,6,111,114,105,103,105,110,218,12,108,111,97,100,101,114, - 95,115,116,97,116,101,218,10,105,115,95,112,97,99,107,97, - 103,101,99,3,0,0,0,3,0,0,0,6,0,0,0,2, - 0,0,0,67,0,0,0,115,54,0,0,0,124,1,124,0, - 95,0,124,2,124,0,95,1,124,3,124,0,95,2,124,4, - 124,0,95,3,124,5,114,32,103,0,110,2,100,0,124,0, - 95,4,100,1,124,0,95,5,100,0,124,0,95,6,100,0, - 83,0,41,2,78,70,41,7,114,15,0,0,0,114,93,0, - 0,0,114,103,0,0,0,114,104,0,0,0,218,26,115,117, - 98,109,111,100,117,108,101,95,115,101,97,114,99,104,95,108, - 111,99,97,116,105,111,110,115,218,13,95,115,101,116,95,102, - 105,108,101,97,116,116,114,218,7,95,99,97,99,104,101,100, - 41,6,114,26,0,0,0,114,15,0,0,0,114,93,0,0, - 0,114,103,0,0,0,114,104,0,0,0,114,105,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 27,0,0,0,113,1,0,0,115,14,0,0,0,0,2,6, - 1,6,1,6,1,6,1,14,3,6,1,122,19,77,111,100, - 117,108,101,83,112,101,99,46,95,95,105,110,105,116,95,95, - 99,1,0,0,0,0,0,0,0,2,0,0,0,6,0,0, - 0,67,0,0,0,115,102,0,0,0,100,1,160,0,124,0, - 106,1,161,1,100,2,160,0,124,0,106,2,161,1,103,2, - 125,1,124,0,106,3,100,0,107,9,114,52,124,1,160,4, - 100,3,160,0,124,0,106,3,161,1,161,1,1,0,124,0, - 106,5,100,0,107,9,114,80,124,1,160,4,100,4,160,0, - 124,0,106,5,161,1,161,1,1,0,100,5,160,0,124,0, - 106,6,106,7,100,6,160,8,124,1,161,1,161,2,83,0, - 41,7,78,122,9,110,97,109,101,61,123,33,114,125,122,11, - 108,111,97,100,101,114,61,123,33,114,125,122,11,111,114,105, - 103,105,110,61,123,33,114,125,122,29,115,117,98,109,111,100, - 117,108,101,95,115,101,97,114,99,104,95,108,111,99,97,116, - 105,111,110,115,61,123,125,122,6,123,125,40,123,125,41,122, - 2,44,32,41,9,114,38,0,0,0,114,15,0,0,0,114, - 93,0,0,0,114,103,0,0,0,218,6,97,112,112,101,110, - 100,114,106,0,0,0,218,9,95,95,99,108,97,115,115,95, - 95,114,1,0,0,0,218,4,106,111,105,110,41,2,114,26, - 0,0,0,114,47,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,40,0,0,0,125,1,0,0, - 115,20,0,0,0,0,1,10,1,10,255,4,2,10,1,18, - 1,10,1,8,1,4,255,6,2,122,19,77,111,100,117,108, - 101,83,112,101,99,46,95,95,114,101,112,114,95,95,99,2, - 0,0,0,0,0,0,0,3,0,0,0,8,0,0,0,67, - 0,0,0,115,114,0,0,0,124,0,106,0,125,2,122,76, - 124,0,106,1,124,1,106,1,107,2,111,76,124,0,106,2, - 124,1,106,2,107,2,111,76,124,0,106,3,124,1,106,3, - 107,2,111,76,124,2,124,1,106,0,107,2,111,76,124,0, - 106,4,124,1,106,4,107,2,111,76,124,0,106,5,124,1, - 106,5,107,2,87,0,83,0,87,0,110,26,4,0,116,6, - 107,10,114,108,1,0,1,0,1,0,89,0,100,1,83,0, - 89,0,110,2,88,0,100,0,83,0,41,2,78,70,41,7, - 114,106,0,0,0,114,15,0,0,0,114,93,0,0,0,114, - 103,0,0,0,218,6,99,97,99,104,101,100,218,12,104,97, - 115,95,108,111,99,97,116,105,111,110,114,90,0,0,0,41, - 3,114,26,0,0,0,90,5,111,116,104,101,114,90,4,115, - 109,115,108,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,6,95,95,101,113,95,95,135,1,0,0,115,30, - 0,0,0,0,1,6,1,2,1,12,1,10,255,2,2,10, - 254,2,3,8,253,2,4,10,252,2,5,10,251,8,6,14, - 1,122,17,77,111,100,117,108,101,83,112,101,99,46,95,95, - 101,113,95,95,99,1,0,0,0,0,0,0,0,1,0,0, - 0,3,0,0,0,67,0,0,0,115,58,0,0,0,124,0, - 106,0,100,0,107,8,114,52,124,0,106,1,100,0,107,9, - 114,52,124,0,106,2,114,52,116,3,100,0,107,8,114,38, - 116,4,130,1,116,3,160,5,124,0,106,1,161,1,124,0, - 95,0,124,0,106,0,83,0,41,1,78,41,6,114,108,0, - 0,0,114,103,0,0,0,114,107,0,0,0,218,19,95,98, - 111,111,116,115,116,114,97,112,95,101,120,116,101,114,110,97, - 108,218,19,78,111,116,73,109,112,108,101,109,101,110,116,101, - 100,69,114,114,111,114,90,11,95,103,101,116,95,99,97,99, - 104,101,100,41,1,114,26,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,112,0,0,0,147,1, - 0,0,115,12,0,0,0,0,2,10,1,16,1,8,1,4, - 1,14,1,122,17,77,111,100,117,108,101,83,112,101,99,46, - 99,97,99,104,101,100,99,2,0,0,0,0,0,0,0,2, - 0,0,0,2,0,0,0,67,0,0,0,115,10,0,0,0, - 124,1,124,0,95,0,100,0,83,0,41,1,78,41,1,114, - 108,0,0,0,41,2,114,26,0,0,0,114,112,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 112,0,0,0,156,1,0,0,115,2,0,0,0,0,2,99, - 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, - 67,0,0,0,115,36,0,0,0,124,0,106,0,100,1,107, - 8,114,26,124,0,106,1,160,2,100,2,161,1,100,3,25, - 0,83,0,124,0,106,1,83,0,100,1,83,0,41,4,122, - 32,84,104,101,32,110,97,109,101,32,111,102,32,116,104,101, - 32,109,111,100,117,108,101,39,115,32,112,97,114,101,110,116, - 46,78,218,1,46,114,19,0,0,0,41,3,114,106,0,0, - 0,114,15,0,0,0,218,10,114,112,97,114,116,105,116,105, - 111,110,41,1,114,26,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,6,112,97,114,101,110,116, - 160,1,0,0,115,6,0,0,0,0,3,10,1,16,2,122, - 17,77,111,100,117,108,101,83,112,101,99,46,112,97,114,101, - 110,116,99,1,0,0,0,0,0,0,0,1,0,0,0,1, - 0,0,0,67,0,0,0,115,6,0,0,0,124,0,106,0, - 83,0,41,1,78,41,1,114,107,0,0,0,41,1,114,26, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,113,0,0,0,168,1,0,0,115,2,0,0,0, - 0,2,122,23,77,111,100,117,108,101,83,112,101,99,46,104, - 97,115,95,108,111,99,97,116,105,111,110,99,2,0,0,0, - 0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0, - 115,14,0,0,0,116,0,124,1,131,1,124,0,95,1,100, - 0,83,0,41,1,78,41,2,218,4,98,111,111,108,114,107, - 0,0,0,41,2,114,26,0,0,0,218,5,118,97,108,117, - 101,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,113,0,0,0,172,1,0,0,115,2,0,0,0,0,2, - 41,12,114,1,0,0,0,114,0,0,0,0,114,2,0,0, - 0,114,3,0,0,0,114,27,0,0,0,114,40,0,0,0, - 114,114,0,0,0,218,8,112,114,111,112,101,114,116,121,114, - 112,0,0,0,218,6,115,101,116,116,101,114,114,119,0,0, - 0,114,113,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,102,0,0,0,76, - 1,0,0,115,22,0,0,0,8,35,4,2,4,1,2,255, - 12,12,8,10,8,12,12,9,14,4,12,8,12,4,114,102, - 0,0,0,41,2,114,103,0,0,0,114,105,0,0,0,99, - 2,0,0,0,2,0,0,0,6,0,0,0,8,0,0,0, - 67,0,0,0,115,154,0,0,0,116,0,124,1,100,1,131, - 2,114,74,116,1,100,2,107,8,114,22,116,2,130,1,116, - 1,106,3,125,4,124,3,100,2,107,8,114,48,124,4,124, - 0,124,1,100,3,141,2,83,0,124,3,114,56,103,0,110, - 2,100,2,125,5,124,4,124,0,124,1,124,5,100,4,141, - 3,83,0,124,3,100,2,107,8,114,138,116,0,124,1,100, - 5,131,2,114,134,122,14,124,1,160,4,124,0,161,1,125, - 3,87,0,110,24,4,0,116,5,107,10,114,130,1,0,1, - 0,1,0,100,2,125,3,89,0,110,2,88,0,110,4,100, - 6,125,3,116,6,124,0,124,1,124,2,124,3,100,7,141, - 4,83,0,41,8,122,53,82,101,116,117,114,110,32,97,32, - 109,111,100,117,108,101,32,115,112,101,99,32,98,97,115,101, - 100,32,111,110,32,118,97,114,105,111,117,115,32,108,111,97, - 100,101,114,32,109,101,116,104,111,100,115,46,90,12,103,101, - 116,95,102,105,108,101,110,97,109,101,78,41,1,114,93,0, - 0,0,41,2,114,93,0,0,0,114,106,0,0,0,114,105, - 0,0,0,70,41,2,114,103,0,0,0,114,105,0,0,0, - 41,7,114,4,0,0,0,114,115,0,0,0,114,116,0,0, - 0,218,23,115,112,101,99,95,102,114,111,109,95,102,105,108, - 101,95,108,111,99,97,116,105,111,110,114,105,0,0,0,114, - 70,0,0,0,114,102,0,0,0,41,6,114,15,0,0,0, - 114,93,0,0,0,114,103,0,0,0,114,105,0,0,0,114, - 124,0,0,0,90,6,115,101,97,114,99,104,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,78,0,0,0, - 177,1,0,0,115,36,0,0,0,0,2,10,1,8,1,4, - 1,6,2,8,1,12,1,12,1,6,1,2,255,6,3,8, - 1,10,1,2,1,14,1,14,1,12,3,4,2,114,78,0, - 0,0,99,3,0,0,0,0,0,0,0,8,0,0,0,8, - 0,0,0,67,0,0,0,115,56,1,0,0,122,10,124,0, - 106,0,125,3,87,0,110,20,4,0,116,1,107,10,114,30, - 1,0,1,0,1,0,89,0,110,14,88,0,124,3,100,0, - 107,9,114,44,124,3,83,0,124,0,106,2,125,4,124,1, - 100,0,107,8,114,90,122,10,124,0,106,3,125,1,87,0, - 110,20,4,0,116,1,107,10,114,88,1,0,1,0,1,0, - 89,0,110,2,88,0,122,10,124,0,106,4,125,5,87,0, - 110,24,4,0,116,1,107,10,114,124,1,0,1,0,1,0, - 100,0,125,5,89,0,110,2,88,0,124,2,100,0,107,8, - 114,184,124,5,100,0,107,8,114,180,122,10,124,1,106,5, - 125,2,87,0,113,184,4,0,116,1,107,10,114,176,1,0, - 1,0,1,0,100,0,125,2,89,0,113,184,88,0,110,4, - 124,5,125,2,122,10,124,0,106,6,125,6,87,0,110,24, - 4,0,116,1,107,10,114,218,1,0,1,0,1,0,100,0, - 125,6,89,0,110,2,88,0,122,14,116,7,124,0,106,8, - 131,1,125,7,87,0,110,26,4,0,116,1,107,10,144,1, - 114,4,1,0,1,0,1,0,100,0,125,7,89,0,110,2, - 88,0,116,9,124,4,124,1,124,2,100,1,141,3,125,3, - 124,5,100,0,107,8,144,1,114,34,100,2,110,2,100,3, - 124,3,95,10,124,6,124,3,95,11,124,7,124,3,95,12, - 124,3,83,0,41,4,78,41,1,114,103,0,0,0,70,84, - 41,13,114,89,0,0,0,114,90,0,0,0,114,1,0,0, - 0,114,85,0,0,0,114,92,0,0,0,90,7,95,79,82, - 73,71,73,78,218,10,95,95,99,97,99,104,101,100,95,95, - 218,4,108,105,115,116,218,8,95,95,112,97,116,104,95,95, - 114,102,0,0,0,114,107,0,0,0,114,112,0,0,0,114, - 106,0,0,0,41,8,114,83,0,0,0,114,93,0,0,0, - 114,103,0,0,0,114,82,0,0,0,114,15,0,0,0,90, - 8,108,111,99,97,116,105,111,110,114,112,0,0,0,114,106, + 32,98,117,105,108,116,45,105,110,46,99,2,0,0,0,0, + 0,0,0,2,0,0,0,4,0,0,0,19,0,0,0,115, + 38,0,0,0,124,1,116,0,106,1,107,7,114,28,116,2, + 100,1,160,3,124,1,161,1,124,1,100,2,141,2,130,1, + 136,0,124,0,124,1,131,2,83,0,41,3,78,122,29,123, + 33,114,125,32,105,115,32,110,111,116,32,97,32,98,117,105, + 108,116,45,105,110,32,109,111,100,117,108,101,41,1,114,15, + 0,0,0,41,4,114,14,0,0,0,218,20,98,117,105,108, + 116,105,110,95,109,111,100,117,108,101,95,110,97,109,101,115, + 218,11,73,109,112,111,114,116,69,114,114,111,114,114,38,0, + 0,0,41,2,114,26,0,0,0,218,8,102,117,108,108,110, + 97,109,101,41,1,218,3,102,120,110,114,10,0,0,0,114, + 11,0,0,0,218,25,95,114,101,113,117,105,114,101,115,95, + 98,117,105,108,116,105,110,95,119,114,97,112,112,101,114,232, + 0,0,0,115,10,0,0,0,0,1,10,1,10,1,2,255, + 6,2,122,52,95,114,101,113,117,105,114,101,115,95,98,117, + 105,108,116,105,110,46,60,108,111,99,97,108,115,62,46,95, + 114,101,113,117,105,114,101,115,95,98,117,105,108,116,105,110, + 95,119,114,97,112,112,101,114,41,1,114,12,0,0,0,41, + 2,114,72,0,0,0,114,73,0,0,0,114,10,0,0,0, + 41,1,114,72,0,0,0,114,11,0,0,0,218,17,95,114, + 101,113,117,105,114,101,115,95,98,117,105,108,116,105,110,230, + 0,0,0,115,6,0,0,0,0,2,12,5,10,1,114,74, + 0,0,0,99,1,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,3,0,0,0,115,26,0,0,0,135,0,102, + 1,100,1,100,2,132,8,125,1,116,0,124,1,136,0,131, + 2,1,0,124,1,83,0,41,3,122,47,68,101,99,111,114, + 97,116,111,114,32,116,111,32,118,101,114,105,102,121,32,116, + 104,101,32,110,97,109,101,100,32,109,111,100,117,108,101,32, + 105,115,32,102,114,111,122,101,110,46,99,2,0,0,0,0, + 0,0,0,2,0,0,0,4,0,0,0,19,0,0,0,115, + 38,0,0,0,116,0,160,1,124,1,161,1,115,28,116,2, + 100,1,160,3,124,1,161,1,124,1,100,2,141,2,130,1, + 136,0,124,0,124,1,131,2,83,0,41,3,78,122,27,123, + 33,114,125,32,105,115,32,110,111,116,32,97,32,102,114,111, + 122,101,110,32,109,111,100,117,108,101,41,1,114,15,0,0, + 0,41,4,114,49,0,0,0,218,9,105,115,95,102,114,111, + 122,101,110,114,70,0,0,0,114,38,0,0,0,41,2,114, + 26,0,0,0,114,71,0,0,0,41,1,114,72,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,24,95,114,101,113, + 117,105,114,101,115,95,102,114,111,122,101,110,95,119,114,97, + 112,112,101,114,243,0,0,0,115,10,0,0,0,0,1,10, + 1,10,1,2,255,6,2,122,50,95,114,101,113,117,105,114, + 101,115,95,102,114,111,122,101,110,46,60,108,111,99,97,108, + 115,62,46,95,114,101,113,117,105,114,101,115,95,102,114,111, + 122,101,110,95,119,114,97,112,112,101,114,41,1,114,12,0, + 0,0,41,2,114,72,0,0,0,114,76,0,0,0,114,10, + 0,0,0,41,1,114,72,0,0,0,114,11,0,0,0,218, + 16,95,114,101,113,117,105,114,101,115,95,102,114,111,122,101, + 110,241,0,0,0,115,6,0,0,0,0,2,12,5,10,1, + 114,77,0,0,0,99,2,0,0,0,0,0,0,0,4,0, + 0,0,3,0,0,0,67,0,0,0,115,62,0,0,0,116, + 0,124,1,124,0,131,2,125,2,124,1,116,1,106,2,107, + 6,114,50,116,1,106,2,124,1,25,0,125,3,116,3,124, + 2,124,3,131,2,1,0,116,1,106,2,124,1,25,0,83, + 0,116,4,124,2,131,1,83,0,100,1,83,0,41,2,122, + 128,76,111,97,100,32,116,104,101,32,115,112,101,99,105,102, + 105,101,100,32,109,111,100,117,108,101,32,105,110,116,111,32, + 115,121,115,46,109,111,100,117,108,101,115,32,97,110,100,32, + 114,101,116,117,114,110,32,105,116,46,10,10,32,32,32,32, + 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, + 108,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117, + 108,101,32,105,110,115,116,101,97,100,46,10,10,32,32,32, + 32,78,41,5,218,16,115,112,101,99,95,102,114,111,109,95, + 108,111,97,100,101,114,114,14,0,0,0,218,7,109,111,100, + 117,108,101,115,218,5,95,101,120,101,99,218,5,95,108,111, + 97,100,41,4,114,26,0,0,0,114,71,0,0,0,218,4, + 115,112,101,99,218,6,109,111,100,117,108,101,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,17,95,108,111, + 97,100,95,109,111,100,117,108,101,95,115,104,105,109,253,0, + 0,0,115,12,0,0,0,0,6,10,1,10,1,10,1,10, + 1,10,2,114,84,0,0,0,99,1,0,0,0,0,0,0, + 0,5,0,0,0,8,0,0,0,67,0,0,0,115,226,0, + 0,0,116,0,124,0,100,1,100,0,131,3,125,1,116,1, + 124,1,100,2,131,2,114,56,122,12,124,1,160,2,124,0, + 161,1,87,0,83,0,4,0,116,3,107,10,114,54,1,0, + 1,0,1,0,89,0,110,2,88,0,122,10,124,0,106,4, + 125,2,87,0,110,20,4,0,116,5,107,10,114,86,1,0, + 1,0,1,0,89,0,110,18,88,0,124,2,100,0,107,9, + 114,104,116,6,124,2,131,1,83,0,122,10,124,0,106,7, + 125,3,87,0,110,24,4,0,116,5,107,10,114,138,1,0, + 1,0,1,0,100,3,125,3,89,0,110,2,88,0,122,10, + 124,0,106,8,125,4,87,0,110,58,4,0,116,5,107,10, + 114,208,1,0,1,0,1,0,124,1,100,0,107,8,114,188, + 100,4,160,9,124,3,161,1,6,0,89,0,83,0,100,5, + 160,9,124,3,124,1,161,2,6,0,89,0,83,0,89,0, + 110,14,88,0,100,6,160,9,124,3,124,4,161,2,83,0, + 100,0,83,0,41,7,78,218,10,95,95,108,111,97,100,101, + 114,95,95,218,11,109,111,100,117,108,101,95,114,101,112,114, + 250,1,63,122,13,60,109,111,100,117,108,101,32,123,33,114, + 125,62,122,20,60,109,111,100,117,108,101,32,123,33,114,125, + 32,40,123,33,114,125,41,62,122,23,60,109,111,100,117,108, + 101,32,123,33,114,125,32,102,114,111,109,32,123,33,114,125, + 62,41,10,114,6,0,0,0,114,4,0,0,0,114,86,0, + 0,0,218,9,69,120,99,101,112,116,105,111,110,218,8,95, + 95,115,112,101,99,95,95,218,14,65,116,116,114,105,98,117, + 116,101,69,114,114,111,114,218,22,95,109,111,100,117,108,101, + 95,114,101,112,114,95,102,114,111,109,95,115,112,101,99,114, + 1,0,0,0,218,8,95,95,102,105,108,101,95,95,114,38, + 0,0,0,41,5,114,83,0,0,0,218,6,108,111,97,100, + 101,114,114,82,0,0,0,114,15,0,0,0,218,8,102,105, + 108,101,110,97,109,101,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,12,95,109,111,100,117,108,101,95,114, + 101,112,114,13,1,0,0,115,46,0,0,0,0,2,12,1, + 10,4,2,1,12,1,14,1,6,1,2,1,10,1,14,1, + 6,2,8,1,8,4,2,1,10,1,14,1,10,1,2,1, + 10,1,14,1,8,1,14,2,22,2,114,95,0,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 64,0,0,0,115,114,0,0,0,101,0,90,1,100,0,90, + 2,100,1,90,3,100,2,100,2,100,2,100,3,156,3,100, + 4,100,5,132,2,90,4,100,6,100,7,132,0,90,5,100, + 8,100,9,132,0,90,6,101,7,100,10,100,11,132,0,131, + 1,90,8,101,8,106,9,100,12,100,11,132,0,131,1,90, + 8,101,7,100,13,100,14,132,0,131,1,90,10,101,7,100, + 15,100,16,132,0,131,1,90,11,101,11,106,9,100,17,100, + 16,132,0,131,1,90,11,100,2,83,0,41,18,218,10,77, + 111,100,117,108,101,83,112,101,99,97,208,5,0,0,84,104, + 101,32,115,112,101,99,105,102,105,99,97,116,105,111,110,32, + 102,111,114,32,97,32,109,111,100,117,108,101,44,32,117,115, + 101,100,32,102,111,114,32,108,111,97,100,105,110,103,46,10, + 10,32,32,32,32,65,32,109,111,100,117,108,101,39,115,32, + 115,112,101,99,32,105,115,32,116,104,101,32,115,111,117,114, + 99,101,32,102,111,114,32,105,110,102,111,114,109,97,116,105, + 111,110,32,97,98,111,117,116,32,116,104,101,32,109,111,100, + 117,108,101,46,32,32,70,111,114,10,32,32,32,32,100,97, + 116,97,32,97,115,115,111,99,105,97,116,101,100,32,119,105, + 116,104,32,116,104,101,32,109,111,100,117,108,101,44,32,105, + 110,99,108,117,100,105,110,103,32,115,111,117,114,99,101,44, + 32,117,115,101,32,116,104,101,32,115,112,101,99,39,115,10, + 32,32,32,32,108,111,97,100,101,114,46,10,10,32,32,32, + 32,96,110,97,109,101,96,32,105,115,32,116,104,101,32,97, + 98,115,111,108,117,116,101,32,110,97,109,101,32,111,102,32, + 116,104,101,32,109,111,100,117,108,101,46,32,32,96,108,111, + 97,100,101,114,96,32,105,115,32,116,104,101,32,108,111,97, + 100,101,114,10,32,32,32,32,116,111,32,117,115,101,32,119, + 104,101,110,32,108,111,97,100,105,110,103,32,116,104,101,32, + 109,111,100,117,108,101,46,32,32,96,112,97,114,101,110,116, + 96,32,105,115,32,116,104,101,32,110,97,109,101,32,111,102, + 32,116,104,101,10,32,32,32,32,112,97,99,107,97,103,101, + 32,116,104,101,32,109,111,100,117,108,101,32,105,115,32,105, + 110,46,32,32,84,104,101,32,112,97,114,101,110,116,32,105, + 115,32,100,101,114,105,118,101,100,32,102,114,111,109,32,116, + 104,101,32,110,97,109,101,46,10,10,32,32,32,32,96,105, + 115,95,112,97,99,107,97,103,101,96,32,100,101,116,101,114, + 109,105,110,101,115,32,105,102,32,116,104,101,32,109,111,100, + 117,108,101,32,105,115,32,99,111,110,115,105,100,101,114,101, + 100,32,97,32,112,97,99,107,97,103,101,32,111,114,10,32, + 32,32,32,110,111,116,46,32,32,79,110,32,109,111,100,117, + 108,101,115,32,116,104,105,115,32,105,115,32,114,101,102,108, + 101,99,116,101,100,32,98,121,32,116,104,101,32,96,95,95, + 112,97,116,104,95,95,96,32,97,116,116,114,105,98,117,116, + 101,46,10,10,32,32,32,32,96,111,114,105,103,105,110,96, + 32,105,115,32,116,104,101,32,115,112,101,99,105,102,105,99, + 32,108,111,99,97,116,105,111,110,32,117,115,101,100,32,98, + 121,32,116,104,101,32,108,111,97,100,101,114,32,102,114,111, + 109,32,119,104,105,99,104,32,116,111,10,32,32,32,32,108, + 111,97,100,32,116,104,101,32,109,111,100,117,108,101,44,32, + 105,102,32,116,104,97,116,32,105,110,102,111,114,109,97,116, + 105,111,110,32,105,115,32,97,118,97,105,108,97,98,108,101, + 46,32,32,87,104,101,110,32,102,105,108,101,110,97,109,101, + 32,105,115,10,32,32,32,32,115,101,116,44,32,111,114,105, + 103,105,110,32,119,105,108,108,32,109,97,116,99,104,46,10, + 10,32,32,32,32,96,104,97,115,95,108,111,99,97,116,105, + 111,110,96,32,105,110,100,105,99,97,116,101,115,32,116,104, + 97,116,32,97,32,115,112,101,99,39,115,32,34,111,114,105, + 103,105,110,34,32,114,101,102,108,101,99,116,115,32,97,32, + 108,111,99,97,116,105,111,110,46,10,32,32,32,32,87,104, + 101,110,32,116,104,105,115,32,105,115,32,84,114,117,101,44, + 32,96,95,95,102,105,108,101,95,95,96,32,97,116,116,114, + 105,98,117,116,101,32,111,102,32,116,104,101,32,109,111,100, + 117,108,101,32,105,115,32,115,101,116,46,10,10,32,32,32, + 32,96,99,97,99,104,101,100,96,32,105,115,32,116,104,101, + 32,108,111,99,97,116,105,111,110,32,111,102,32,116,104,101, + 32,99,97,99,104,101,100,32,98,121,116,101,99,111,100,101, + 32,102,105,108,101,44,32,105,102,32,97,110,121,46,32,32, + 73,116,10,32,32,32,32,99,111,114,114,101,115,112,111,110, + 100,115,32,116,111,32,116,104,101,32,96,95,95,99,97,99, + 104,101,100,95,95,96,32,97,116,116,114,105,98,117,116,101, + 46,10,10,32,32,32,32,96,115,117,98,109,111,100,117,108, + 101,95,115,101,97,114,99,104,95,108,111,99,97,116,105,111, + 110,115,96,32,105,115,32,116,104,101,32,115,101,113,117,101, + 110,99,101,32,111,102,32,112,97,116,104,32,101,110,116,114, + 105,101,115,32,116,111,10,32,32,32,32,115,101,97,114,99, + 104,32,119,104,101,110,32,105,109,112,111,114,116,105,110,103, + 32,115,117,98,109,111,100,117,108,101,115,46,32,32,73,102, + 32,115,101,116,44,32,105,115,95,112,97,99,107,97,103,101, + 32,115,104,111,117,108,100,32,98,101,10,32,32,32,32,84, + 114,117,101,45,45,97,110,100,32,70,97,108,115,101,32,111, + 116,104,101,114,119,105,115,101,46,10,10,32,32,32,32,80, + 97,99,107,97,103,101,115,32,97,114,101,32,115,105,109,112, + 108,121,32,109,111,100,117,108,101,115,32,116,104,97,116,32, + 40,109,97,121,41,32,104,97,118,101,32,115,117,98,109,111, + 100,117,108,101,115,46,32,32,73,102,32,97,32,115,112,101, + 99,10,32,32,32,32,104,97,115,32,97,32,110,111,110,45, + 78,111,110,101,32,118,97,108,117,101,32,105,110,32,96,115, + 117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,95, + 108,111,99,97,116,105,111,110,115,96,44,32,116,104,101,32, + 105,109,112,111,114,116,10,32,32,32,32,115,121,115,116,101, + 109,32,119,105,108,108,32,99,111,110,115,105,100,101,114,32, + 109,111,100,117,108,101,115,32,108,111,97,100,101,100,32,102, + 114,111,109,32,116,104,101,32,115,112,101,99,32,97,115,32, + 112,97,99,107,97,103,101,115,46,10,10,32,32,32,32,79, + 110,108,121,32,102,105,110,100,101,114,115,32,40,115,101,101, + 32,105,109,112,111,114,116,108,105,98,46,97,98,99,46,77, + 101,116,97,80,97,116,104,70,105,110,100,101,114,32,97,110, + 100,10,32,32,32,32,105,109,112,111,114,116,108,105,98,46, + 97,98,99,46,80,97,116,104,69,110,116,114,121,70,105,110, + 100,101,114,41,32,115,104,111,117,108,100,32,109,111,100,105, + 102,121,32,77,111,100,117,108,101,83,112,101,99,32,105,110, + 115,116,97,110,99,101,115,46,10,10,32,32,32,32,78,41, + 3,218,6,111,114,105,103,105,110,218,12,108,111,97,100,101, + 114,95,115,116,97,116,101,218,10,105,115,95,112,97,99,107, + 97,103,101,99,3,0,0,0,3,0,0,0,6,0,0,0, + 2,0,0,0,67,0,0,0,115,54,0,0,0,124,1,124, + 0,95,0,124,2,124,0,95,1,124,3,124,0,95,2,124, + 4,124,0,95,3,124,5,114,32,103,0,110,2,100,0,124, + 0,95,4,100,1,124,0,95,5,100,0,124,0,95,6,100, + 0,83,0,41,2,78,70,41,7,114,15,0,0,0,114,93, + 0,0,0,114,97,0,0,0,114,98,0,0,0,218,26,115, + 117,98,109,111,100,117,108,101,95,115,101,97,114,99,104,95, + 108,111,99,97,116,105,111,110,115,218,13,95,115,101,116,95, + 102,105,108,101,97,116,116,114,218,7,95,99,97,99,104,101, + 100,41,6,114,26,0,0,0,114,15,0,0,0,114,93,0, + 0,0,114,97,0,0,0,114,98,0,0,0,114,99,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,27,0,0,0,86,1,0,0,115,14,0,0,0,0,2, + 6,1,6,1,6,1,6,1,14,3,6,1,122,19,77,111, + 100,117,108,101,83,112,101,99,46,95,95,105,110,105,116,95, + 95,99,1,0,0,0,0,0,0,0,2,0,0,0,6,0, + 0,0,67,0,0,0,115,102,0,0,0,100,1,160,0,124, + 0,106,1,161,1,100,2,160,0,124,0,106,2,161,1,103, + 2,125,1,124,0,106,3,100,0,107,9,114,52,124,1,160, + 4,100,3,160,0,124,0,106,3,161,1,161,1,1,0,124, + 0,106,5,100,0,107,9,114,80,124,1,160,4,100,4,160, + 0,124,0,106,5,161,1,161,1,1,0,100,5,160,0,124, + 0,106,6,106,7,100,6,160,8,124,1,161,1,161,2,83, + 0,41,7,78,122,9,110,97,109,101,61,123,33,114,125,122, + 11,108,111,97,100,101,114,61,123,33,114,125,122,11,111,114, + 105,103,105,110,61,123,33,114,125,122,29,115,117,98,109,111, + 100,117,108,101,95,115,101,97,114,99,104,95,108,111,99,97, + 116,105,111,110,115,61,123,125,122,6,123,125,40,123,125,41, + 122,2,44,32,41,9,114,38,0,0,0,114,15,0,0,0, + 114,93,0,0,0,114,97,0,0,0,218,6,97,112,112,101, + 110,100,114,100,0,0,0,218,9,95,95,99,108,97,115,115, + 95,95,114,1,0,0,0,218,4,106,111,105,110,41,2,114, + 26,0,0,0,114,47,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,40,0,0,0,98,1,0, + 0,115,20,0,0,0,0,1,10,1,10,255,4,2,10,1, + 18,1,10,1,8,1,4,255,6,2,122,19,77,111,100,117, + 108,101,83,112,101,99,46,95,95,114,101,112,114,95,95,99, + 2,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0, + 67,0,0,0,115,114,0,0,0,124,0,106,0,125,2,122, + 76,124,0,106,1,124,1,106,1,107,2,111,76,124,0,106, + 2,124,1,106,2,107,2,111,76,124,0,106,3,124,1,106, + 3,107,2,111,76,124,2,124,1,106,0,107,2,111,76,124, + 0,106,4,124,1,106,4,107,2,111,76,124,0,106,5,124, + 1,106,5,107,2,87,0,83,0,87,0,110,26,4,0,116, + 6,107,10,114,108,1,0,1,0,1,0,89,0,100,1,83, + 0,89,0,110,2,88,0,100,0,83,0,41,2,78,70,41, + 7,114,100,0,0,0,114,15,0,0,0,114,93,0,0,0, + 114,97,0,0,0,218,6,99,97,99,104,101,100,218,12,104, + 97,115,95,108,111,99,97,116,105,111,110,114,90,0,0,0, + 41,3,114,26,0,0,0,90,5,111,116,104,101,114,90,4, + 115,109,115,108,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,6,95,95,101,113,95,95,108,1,0,0,115, + 30,0,0,0,0,1,6,1,2,1,12,1,10,255,2,2, + 10,254,2,3,8,253,2,4,10,252,2,5,10,251,8,6, + 14,1,122,17,77,111,100,117,108,101,83,112,101,99,46,95, + 95,101,113,95,95,99,1,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,58,0,0,0,124, + 0,106,0,100,0,107,8,114,52,124,0,106,1,100,0,107, + 9,114,52,124,0,106,2,114,52,116,3,100,0,107,8,114, + 38,116,4,130,1,116,3,160,5,124,0,106,1,161,1,124, + 0,95,0,124,0,106,0,83,0,41,1,78,41,6,114,102, + 0,0,0,114,97,0,0,0,114,101,0,0,0,218,19,95, + 98,111,111,116,115,116,114,97,112,95,101,120,116,101,114,110, + 97,108,218,19,78,111,116,73,109,112,108,101,109,101,110,116, + 101,100,69,114,114,111,114,90,11,95,103,101,116,95,99,97, + 99,104,101,100,41,1,114,26,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,106,0,0,0,120, + 1,0,0,115,12,0,0,0,0,2,10,1,16,1,8,1, + 4,1,14,1,122,17,77,111,100,117,108,101,83,112,101,99, + 46,99,97,99,104,101,100,99,2,0,0,0,0,0,0,0, + 2,0,0,0,2,0,0,0,67,0,0,0,115,10,0,0, + 0,124,1,124,0,95,0,100,0,83,0,41,1,78,41,1, + 114,102,0,0,0,41,2,114,26,0,0,0,114,106,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,106,0,0,0,129,1,0,0,115,2,0,0,0,0,2, + 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, + 0,67,0,0,0,115,36,0,0,0,124,0,106,0,100,1, + 107,8,114,26,124,0,106,1,160,2,100,2,161,1,100,3, + 25,0,83,0,124,0,106,1,83,0,100,1,83,0,41,4, + 122,32,84,104,101,32,110,97,109,101,32,111,102,32,116,104, + 101,32,109,111,100,117,108,101,39,115,32,112,97,114,101,110, + 116,46,78,218,1,46,114,19,0,0,0,41,3,114,100,0, + 0,0,114,15,0,0,0,218,10,114,112,97,114,116,105,116, + 105,111,110,41,1,114,26,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,6,112,97,114,101,110, + 116,133,1,0,0,115,6,0,0,0,0,3,10,1,16,2, + 122,17,77,111,100,117,108,101,83,112,101,99,46,112,97,114, + 101,110,116,99,1,0,0,0,0,0,0,0,1,0,0,0, + 1,0,0,0,67,0,0,0,115,6,0,0,0,124,0,106, + 0,83,0,41,1,78,41,1,114,101,0,0,0,41,1,114, + 26,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,107,0,0,0,141,1,0,0,115,2,0,0, + 0,0,2,122,23,77,111,100,117,108,101,83,112,101,99,46, + 104,97,115,95,108,111,99,97,116,105,111,110,99,2,0,0, + 0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0, + 0,115,14,0,0,0,116,0,124,1,131,1,124,0,95,1, + 100,0,83,0,41,1,78,41,2,218,4,98,111,111,108,114, + 101,0,0,0,41,2,114,26,0,0,0,218,5,118,97,108, + 117,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,107,0,0,0,145,1,0,0,115,2,0,0,0,0, + 2,41,12,114,1,0,0,0,114,0,0,0,0,114,2,0, + 0,0,114,3,0,0,0,114,27,0,0,0,114,40,0,0, + 0,114,108,0,0,0,218,8,112,114,111,112,101,114,116,121, + 114,106,0,0,0,218,6,115,101,116,116,101,114,114,113,0, + 0,0,114,107,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,96,0,0,0, + 49,1,0,0,115,22,0,0,0,8,35,4,2,4,1,2, + 255,12,12,8,10,8,12,12,9,14,4,12,8,12,4,114, + 96,0,0,0,41,2,114,97,0,0,0,114,99,0,0,0, + 99,2,0,0,0,2,0,0,0,6,0,0,0,8,0,0, + 0,67,0,0,0,115,154,0,0,0,116,0,124,1,100,1, + 131,2,114,74,116,1,100,2,107,8,114,22,116,2,130,1, + 116,1,106,3,125,4,124,3,100,2,107,8,114,48,124,4, + 124,0,124,1,100,3,141,2,83,0,124,3,114,56,103,0, + 110,2,100,2,125,5,124,4,124,0,124,1,124,5,100,4, + 141,3,83,0,124,3,100,2,107,8,114,138,116,0,124,1, + 100,5,131,2,114,134,122,14,124,1,160,4,124,0,161,1, + 125,3,87,0,110,24,4,0,116,5,107,10,114,130,1,0, + 1,0,1,0,100,2,125,3,89,0,110,2,88,0,110,4, + 100,6,125,3,116,6,124,0,124,1,124,2,124,3,100,7, + 141,4,83,0,41,8,122,53,82,101,116,117,114,110,32,97, + 32,109,111,100,117,108,101,32,115,112,101,99,32,98,97,115, + 101,100,32,111,110,32,118,97,114,105,111,117,115,32,108,111, + 97,100,101,114,32,109,101,116,104,111,100,115,46,90,12,103, + 101,116,95,102,105,108,101,110,97,109,101,78,41,1,114,93, + 0,0,0,41,2,114,93,0,0,0,114,100,0,0,0,114, + 99,0,0,0,70,41,2,114,97,0,0,0,114,99,0,0, + 0,41,7,114,4,0,0,0,114,109,0,0,0,114,110,0, + 0,0,218,23,115,112,101,99,95,102,114,111,109,95,102,105, + 108,101,95,108,111,99,97,116,105,111,110,114,99,0,0,0, + 114,70,0,0,0,114,96,0,0,0,41,6,114,15,0,0, + 0,114,93,0,0,0,114,97,0,0,0,114,99,0,0,0, + 114,118,0,0,0,90,6,115,101,97,114,99,104,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,78,0,0, + 0,150,1,0,0,115,36,0,0,0,0,2,10,1,8,1, + 4,1,6,2,8,1,12,1,12,1,6,1,2,255,6,3, + 8,1,10,1,2,1,14,1,14,1,12,3,4,2,114,78, + 0,0,0,99,3,0,0,0,0,0,0,0,8,0,0,0, + 8,0,0,0,67,0,0,0,115,56,1,0,0,122,10,124, + 0,106,0,125,3,87,0,110,20,4,0,116,1,107,10,114, + 30,1,0,1,0,1,0,89,0,110,14,88,0,124,3,100, + 0,107,9,114,44,124,3,83,0,124,0,106,2,125,4,124, + 1,100,0,107,8,114,90,122,10,124,0,106,3,125,1,87, + 0,110,20,4,0,116,1,107,10,114,88,1,0,1,0,1, + 0,89,0,110,2,88,0,122,10,124,0,106,4,125,5,87, + 0,110,24,4,0,116,1,107,10,114,124,1,0,1,0,1, + 0,100,0,125,5,89,0,110,2,88,0,124,2,100,0,107, + 8,114,184,124,5,100,0,107,8,114,180,122,10,124,1,106, + 5,125,2,87,0,113,184,4,0,116,1,107,10,114,176,1, + 0,1,0,1,0,100,0,125,2,89,0,113,184,88,0,110, + 4,124,5,125,2,122,10,124,0,106,6,125,6,87,0,110, + 24,4,0,116,1,107,10,114,218,1,0,1,0,1,0,100, + 0,125,6,89,0,110,2,88,0,122,14,116,7,124,0,106, + 8,131,1,125,7,87,0,110,26,4,0,116,1,107,10,144, + 1,114,4,1,0,1,0,1,0,100,0,125,7,89,0,110, + 2,88,0,116,9,124,4,124,1,124,2,100,1,141,3,125, + 3,124,5,100,0,107,8,144,1,114,34,100,2,110,2,100, + 3,124,3,95,10,124,6,124,3,95,11,124,7,124,3,95, + 12,124,3,83,0,41,4,78,41,1,114,97,0,0,0,70, + 84,41,13,114,89,0,0,0,114,90,0,0,0,114,1,0, + 0,0,114,85,0,0,0,114,92,0,0,0,90,7,95,79, + 82,73,71,73,78,218,10,95,95,99,97,99,104,101,100,95, + 95,218,4,108,105,115,116,218,8,95,95,112,97,116,104,95, + 95,114,96,0,0,0,114,101,0,0,0,114,106,0,0,0, + 114,100,0,0,0,41,8,114,83,0,0,0,114,93,0,0, + 0,114,97,0,0,0,114,82,0,0,0,114,15,0,0,0, + 90,8,108,111,99,97,116,105,111,110,114,106,0,0,0,114, + 100,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,17,95,115,112,101,99,95,102,114,111,109,95, + 109,111,100,117,108,101,176,1,0,0,115,72,0,0,0,0, + 2,2,1,10,1,14,1,6,2,8,1,4,2,6,1,8, + 1,2,1,10,1,14,2,6,1,2,1,10,1,14,1,10, + 1,8,1,8,1,2,1,10,1,14,1,12,2,4,1,2, + 1,10,1,14,1,10,1,2,1,14,1,16,1,10,2,14, + 1,20,1,6,1,6,1,114,122,0,0,0,70,41,1,218, + 8,111,118,101,114,114,105,100,101,99,2,0,0,0,1,0, + 0,0,5,0,0,0,8,0,0,0,67,0,0,0,115,226, + 1,0,0,124,2,115,20,116,0,124,1,100,1,100,0,131, + 3,100,0,107,8,114,54,122,12,124,0,106,1,124,1,95, + 2,87,0,110,20,4,0,116,3,107,10,114,52,1,0,1, + 0,1,0,89,0,110,2,88,0,124,2,115,74,116,0,124, + 1,100,2,100,0,131,3,100,0,107,8,114,178,124,0,106, + 4,125,3,124,3,100,0,107,8,114,146,124,0,106,5,100, + 0,107,9,114,146,116,6,100,0,107,8,114,110,116,7,130, + 1,116,6,106,8,125,4,124,4,160,9,124,4,161,1,125, + 3,124,0,106,5,124,3,95,10,124,3,124,0,95,4,100, + 0,124,1,95,11,122,10,124,3,124,1,95,12,87,0,110, + 20,4,0,116,3,107,10,114,176,1,0,1,0,1,0,89, + 0,110,2,88,0,124,2,115,198,116,0,124,1,100,3,100, + 0,131,3,100,0,107,8,114,232,122,12,124,0,106,13,124, + 1,95,14,87,0,110,20,4,0,116,3,107,10,114,230,1, + 0,1,0,1,0,89,0,110,2,88,0,122,10,124,0,124, + 1,95,15,87,0,110,22,4,0,116,3,107,10,144,1,114, + 8,1,0,1,0,1,0,89,0,110,2,88,0,124,2,144, + 1,115,34,116,0,124,1,100,4,100,0,131,3,100,0,107, + 8,144,1,114,82,124,0,106,5,100,0,107,9,144,1,114, + 82,122,12,124,0,106,5,124,1,95,16,87,0,110,22,4, + 0,116,3,107,10,144,1,114,80,1,0,1,0,1,0,89, + 0,110,2,88,0,124,0,106,17,144,1,114,222,124,2,144, + 1,115,114,116,0,124,1,100,5,100,0,131,3,100,0,107, + 8,144,1,114,150,122,12,124,0,106,18,124,1,95,11,87, + 0,110,22,4,0,116,3,107,10,144,1,114,148,1,0,1, + 0,1,0,89,0,110,2,88,0,124,2,144,1,115,174,116, + 0,124,1,100,6,100,0,131,3,100,0,107,8,144,1,114, + 222,124,0,106,19,100,0,107,9,144,1,114,222,122,12,124, + 0,106,19,124,1,95,20,87,0,110,22,4,0,116,3,107, + 10,144,1,114,220,1,0,1,0,1,0,89,0,110,2,88, + 0,124,1,83,0,41,7,78,114,1,0,0,0,114,85,0, + 0,0,218,11,95,95,112,97,99,107,97,103,101,95,95,114, + 121,0,0,0,114,92,0,0,0,114,119,0,0,0,41,21, + 114,6,0,0,0,114,15,0,0,0,114,1,0,0,0,114, + 90,0,0,0,114,93,0,0,0,114,100,0,0,0,114,109, + 0,0,0,114,110,0,0,0,218,16,95,78,97,109,101,115, + 112,97,99,101,76,111,97,100,101,114,218,7,95,95,110,101, + 119,95,95,90,5,95,112,97,116,104,114,92,0,0,0,114, + 85,0,0,0,114,113,0,0,0,114,124,0,0,0,114,89, + 0,0,0,114,121,0,0,0,114,107,0,0,0,114,97,0, + 0,0,114,106,0,0,0,114,119,0,0,0,41,5,114,82, + 0,0,0,114,83,0,0,0,114,123,0,0,0,114,93,0, + 0,0,114,125,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,18,95,105,110,105,116,95,109,111, + 100,117,108,101,95,97,116,116,114,115,221,1,0,0,115,96, + 0,0,0,0,4,20,1,2,1,12,1,14,1,6,2,20, + 1,6,1,8,2,10,1,8,1,4,1,6,2,10,1,8, + 1,6,11,6,1,2,1,10,1,14,1,6,2,20,1,2, + 1,12,1,14,1,6,2,2,1,10,1,16,1,6,2,24, + 1,12,1,2,1,12,1,16,1,6,2,8,1,24,1,2, + 1,12,1,16,1,6,2,24,1,12,1,2,1,12,1,16, + 1,6,1,114,127,0,0,0,99,1,0,0,0,0,0,0, + 0,2,0,0,0,3,0,0,0,67,0,0,0,115,82,0, + 0,0,100,1,125,1,116,0,124,0,106,1,100,2,131,2, + 114,30,124,0,106,1,160,2,124,0,161,1,125,1,110,20, + 116,0,124,0,106,1,100,3,131,2,114,50,116,3,100,4, + 131,1,130,1,124,1,100,1,107,8,114,68,116,4,124,0, + 106,5,131,1,125,1,116,6,124,0,124,1,131,2,1,0, + 124,1,83,0,41,5,122,43,67,114,101,97,116,101,32,97, + 32,109,111,100,117,108,101,32,98,97,115,101,100,32,111,110, + 32,116,104,101,32,112,114,111,118,105,100,101,100,32,115,112, + 101,99,46,78,218,13,99,114,101,97,116,101,95,109,111,100, + 117,108,101,218,11,101,120,101,99,95,109,111,100,117,108,101, + 122,66,108,111,97,100,101,114,115,32,116,104,97,116,32,100, + 101,102,105,110,101,32,101,120,101,99,95,109,111,100,117,108, + 101,40,41,32,109,117,115,116,32,97,108,115,111,32,100,101, + 102,105,110,101,32,99,114,101,97,116,101,95,109,111,100,117, + 108,101,40,41,41,7,114,4,0,0,0,114,93,0,0,0, + 114,128,0,0,0,114,70,0,0,0,114,16,0,0,0,114, + 15,0,0,0,114,127,0,0,0,41,2,114,82,0,0,0, + 114,83,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,16,109,111,100,117,108,101,95,102,114,111, + 109,95,115,112,101,99,37,2,0,0,115,18,0,0,0,0, + 3,4,1,12,3,14,1,12,1,8,2,8,1,10,1,10, + 1,114,130,0,0,0,99,1,0,0,0,0,0,0,0,2, + 0,0,0,4,0,0,0,67,0,0,0,115,106,0,0,0, + 124,0,106,0,100,1,107,8,114,14,100,2,110,4,124,0, + 106,0,125,1,124,0,106,1,100,1,107,8,114,66,124,0, + 106,2,100,1,107,8,114,50,100,3,160,3,124,1,161,1, + 83,0,100,4,160,3,124,1,124,0,106,2,161,2,83,0, + 110,36,124,0,106,4,114,86,100,5,160,3,124,1,124,0, + 106,1,161,2,83,0,100,6,160,3,124,0,106,0,124,0, + 106,1,161,2,83,0,100,1,83,0,41,7,122,38,82,101, + 116,117,114,110,32,116,104,101,32,114,101,112,114,32,116,111, + 32,117,115,101,32,102,111,114,32,116,104,101,32,109,111,100, + 117,108,101,46,78,114,87,0,0,0,122,13,60,109,111,100, + 117,108,101,32,123,33,114,125,62,122,20,60,109,111,100,117, + 108,101,32,123,33,114,125,32,40,123,33,114,125,41,62,122, + 23,60,109,111,100,117,108,101,32,123,33,114,125,32,102,114, + 111,109,32,123,33,114,125,62,122,18,60,109,111,100,117,108, + 101,32,123,33,114,125,32,40,123,125,41,62,41,5,114,15, + 0,0,0,114,97,0,0,0,114,93,0,0,0,114,38,0, + 0,0,114,107,0,0,0,41,2,114,82,0,0,0,114,15, 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,17,95,115,112,101,99,95,102,114,111,109,95,109, - 111,100,117,108,101,203,1,0,0,115,72,0,0,0,0,2, - 2,1,10,1,14,1,6,2,8,1,4,2,6,1,8,1, - 2,1,10,1,14,2,6,1,2,1,10,1,14,1,10,1, - 8,1,8,1,2,1,10,1,14,1,12,2,4,1,2,1, - 10,1,14,1,10,1,2,1,14,1,16,1,10,2,14,1, - 20,1,6,1,6,1,114,128,0,0,0,70,41,1,218,8, - 111,118,101,114,114,105,100,101,99,2,0,0,0,1,0,0, - 0,5,0,0,0,8,0,0,0,67,0,0,0,115,226,1, - 0,0,124,2,115,20,116,0,124,1,100,1,100,0,131,3, - 100,0,107,8,114,54,122,12,124,0,106,1,124,1,95,2, - 87,0,110,20,4,0,116,3,107,10,114,52,1,0,1,0, - 1,0,89,0,110,2,88,0,124,2,115,74,116,0,124,1, - 100,2,100,0,131,3,100,0,107,8,114,178,124,0,106,4, - 125,3,124,3,100,0,107,8,114,146,124,0,106,5,100,0, - 107,9,114,146,116,6,100,0,107,8,114,110,116,7,130,1, - 116,6,106,8,125,4,124,4,160,9,124,4,161,1,125,3, - 124,0,106,5,124,3,95,10,124,3,124,0,95,4,100,0, - 124,1,95,11,122,10,124,3,124,1,95,12,87,0,110,20, - 4,0,116,3,107,10,114,176,1,0,1,0,1,0,89,0, - 110,2,88,0,124,2,115,198,116,0,124,1,100,3,100,0, - 131,3,100,0,107,8,114,232,122,12,124,0,106,13,124,1, - 95,14,87,0,110,20,4,0,116,3,107,10,114,230,1,0, - 1,0,1,0,89,0,110,2,88,0,122,10,124,0,124,1, - 95,15,87,0,110,22,4,0,116,3,107,10,144,1,114,8, - 1,0,1,0,1,0,89,0,110,2,88,0,124,2,144,1, - 115,34,116,0,124,1,100,4,100,0,131,3,100,0,107,8, - 144,1,114,82,124,0,106,5,100,0,107,9,144,1,114,82, - 122,12,124,0,106,5,124,1,95,16,87,0,110,22,4,0, - 116,3,107,10,144,1,114,80,1,0,1,0,1,0,89,0, - 110,2,88,0,124,0,106,17,144,1,114,222,124,2,144,1, - 115,114,116,0,124,1,100,5,100,0,131,3,100,0,107,8, - 144,1,114,150,122,12,124,0,106,18,124,1,95,11,87,0, - 110,22,4,0,116,3,107,10,144,1,114,148,1,0,1,0, - 1,0,89,0,110,2,88,0,124,2,144,1,115,174,116,0, - 124,1,100,6,100,0,131,3,100,0,107,8,144,1,114,222, - 124,0,106,19,100,0,107,9,144,1,114,222,122,12,124,0, - 106,19,124,1,95,20,87,0,110,22,4,0,116,3,107,10, - 144,1,114,220,1,0,1,0,1,0,89,0,110,2,88,0, - 124,1,83,0,41,7,78,114,1,0,0,0,114,85,0,0, - 0,218,11,95,95,112,97,99,107,97,103,101,95,95,114,127, - 0,0,0,114,92,0,0,0,114,125,0,0,0,41,21,114, - 6,0,0,0,114,15,0,0,0,114,1,0,0,0,114,90, - 0,0,0,114,93,0,0,0,114,106,0,0,0,114,115,0, - 0,0,114,116,0,0,0,218,16,95,78,97,109,101,115,112, - 97,99,101,76,111,97,100,101,114,218,7,95,95,110,101,119, - 95,95,90,5,95,112,97,116,104,114,92,0,0,0,114,85, - 0,0,0,114,119,0,0,0,114,130,0,0,0,114,89,0, - 0,0,114,127,0,0,0,114,113,0,0,0,114,103,0,0, - 0,114,112,0,0,0,114,125,0,0,0,41,5,114,82,0, - 0,0,114,83,0,0,0,114,129,0,0,0,114,93,0,0, - 0,114,131,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,18,95,105,110,105,116,95,109,111,100, - 117,108,101,95,97,116,116,114,115,248,1,0,0,115,96,0, - 0,0,0,4,20,1,2,1,12,1,14,1,6,2,20,1, - 6,1,8,2,10,1,8,1,4,1,6,2,10,1,8,1, - 6,11,6,1,2,1,10,1,14,1,6,2,20,1,2,1, - 12,1,14,1,6,2,2,1,10,1,16,1,6,2,24,1, - 12,1,2,1,12,1,16,1,6,2,8,1,24,1,2,1, - 12,1,16,1,6,2,24,1,12,1,2,1,12,1,16,1, - 6,1,114,133,0,0,0,99,1,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,67,0,0,0,115,82,0,0, - 0,100,1,125,1,116,0,124,0,106,1,100,2,131,2,114, - 30,124,0,106,1,160,2,124,0,161,1,125,1,110,20,116, - 0,124,0,106,1,100,3,131,2,114,50,116,3,100,4,131, - 1,130,1,124,1,100,1,107,8,114,68,116,4,124,0,106, - 5,131,1,125,1,116,6,124,0,124,1,131,2,1,0,124, - 1,83,0,41,5,122,43,67,114,101,97,116,101,32,97,32, - 109,111,100,117,108,101,32,98,97,115,101,100,32,111,110,32, - 116,104,101,32,112,114,111,118,105,100,101,100,32,115,112,101, - 99,46,78,218,13,99,114,101,97,116,101,95,109,111,100,117, - 108,101,218,11,101,120,101,99,95,109,111,100,117,108,101,122, - 66,108,111,97,100,101,114,115,32,116,104,97,116,32,100,101, - 102,105,110,101,32,101,120,101,99,95,109,111,100,117,108,101, - 40,41,32,109,117,115,116,32,97,108,115,111,32,100,101,102, - 105,110,101,32,99,114,101,97,116,101,95,109,111,100,117,108, - 101,40,41,41,7,114,4,0,0,0,114,93,0,0,0,114, - 134,0,0,0,114,70,0,0,0,114,16,0,0,0,114,15, - 0,0,0,114,133,0,0,0,41,2,114,82,0,0,0,114, + 0,0,114,91,0,0,0,54,2,0,0,115,16,0,0,0, + 0,3,20,1,10,1,10,1,10,2,16,2,6,1,14,2, + 114,91,0,0,0,99,2,0,0,0,0,0,0,0,4,0, + 0,0,10,0,0,0,67,0,0,0,115,204,0,0,0,124, + 0,106,0,125,2,116,1,124,2,131,1,143,180,1,0,116, + 2,106,3,160,4,124,2,161,1,124,1,107,9,114,54,100, + 1,160,5,124,2,161,1,125,3,116,6,124,3,124,2,100, + 2,141,2,130,1,122,106,124,0,106,7,100,3,107,8,114, + 106,124,0,106,8,100,3,107,8,114,90,116,6,100,4,124, + 0,106,0,100,2,141,2,130,1,116,9,124,0,124,1,100, + 5,100,6,141,3,1,0,110,52,116,9,124,0,124,1,100, + 5,100,6,141,3,1,0,116,10,124,0,106,7,100,7,131, + 2,115,146,124,0,106,7,160,11,124,2,161,1,1,0,110, + 12,124,0,106,7,160,12,124,1,161,1,1,0,87,0,53, + 0,116,2,106,3,160,13,124,0,106,0,161,1,125,1,124, + 1,116,2,106,3,124,0,106,0,60,0,88,0,87,0,53, + 0,81,0,82,0,88,0,124,1,83,0,41,8,122,70,69, + 120,101,99,117,116,101,32,116,104,101,32,115,112,101,99,39, + 115,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, + 108,101,32,105,110,32,97,110,32,101,120,105,115,116,105,110, + 103,32,109,111,100,117,108,101,39,115,32,110,97,109,101,115, + 112,97,99,101,46,122,30,109,111,100,117,108,101,32,123,33, + 114,125,32,110,111,116,32,105,110,32,115,121,115,46,109,111, + 100,117,108,101,115,41,1,114,15,0,0,0,78,122,14,109, + 105,115,115,105,110,103,32,108,111,97,100,101,114,84,41,1, + 114,123,0,0,0,114,129,0,0,0,41,14,114,15,0,0, + 0,114,42,0,0,0,114,14,0,0,0,114,79,0,0,0, + 114,30,0,0,0,114,38,0,0,0,114,70,0,0,0,114, + 93,0,0,0,114,100,0,0,0,114,127,0,0,0,114,4, + 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, + 114,129,0,0,0,218,3,112,111,112,41,4,114,82,0,0, + 0,114,83,0,0,0,114,15,0,0,0,218,3,109,115,103, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 80,0,0,0,71,2,0,0,115,34,0,0,0,0,2,6, + 1,10,1,16,1,10,1,12,1,2,1,10,1,10,1,14, + 2,16,2,14,1,12,4,14,2,16,4,14,1,24,1,114, + 80,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, + 0,8,0,0,0,67,0,0,0,115,26,1,0,0,122,18, + 124,0,106,0,160,1,124,0,106,2,161,1,1,0,87,0, + 110,52,1,0,1,0,1,0,124,0,106,2,116,3,106,4, + 107,6,114,64,116,3,106,4,160,5,124,0,106,2,161,1, + 125,1,124,1,116,3,106,4,124,0,106,2,60,0,130,0, + 89,0,110,2,88,0,116,3,106,4,160,5,124,0,106,2, + 161,1,125,1,124,1,116,3,106,4,124,0,106,2,60,0, + 116,6,124,1,100,1,100,0,131,3,100,0,107,8,114,148, + 122,12,124,0,106,0,124,1,95,7,87,0,110,20,4,0, + 116,8,107,10,114,146,1,0,1,0,1,0,89,0,110,2, + 88,0,116,6,124,1,100,2,100,0,131,3,100,0,107,8, + 114,226,122,40,124,1,106,9,124,1,95,10,116,11,124,1, + 100,3,131,2,115,202,124,0,106,2,160,12,100,4,161,1, + 100,5,25,0,124,1,95,10,87,0,110,20,4,0,116,8, + 107,10,114,224,1,0,1,0,1,0,89,0,110,2,88,0, + 116,6,124,1,100,6,100,0,131,3,100,0,107,8,144,1, + 114,22,122,10,124,0,124,1,95,13,87,0,110,22,4,0, + 116,8,107,10,144,1,114,20,1,0,1,0,1,0,89,0, + 110,2,88,0,124,1,83,0,41,7,78,114,85,0,0,0, + 114,124,0,0,0,114,121,0,0,0,114,111,0,0,0,114, + 19,0,0,0,114,89,0,0,0,41,14,114,93,0,0,0, + 114,131,0,0,0,114,15,0,0,0,114,14,0,0,0,114, + 79,0,0,0,114,132,0,0,0,114,6,0,0,0,114,85, + 0,0,0,114,90,0,0,0,114,1,0,0,0,114,124,0, + 0,0,114,4,0,0,0,114,112,0,0,0,114,89,0,0, + 0,41,2,114,82,0,0,0,114,83,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,25,95,108, + 111,97,100,95,98,97,99,107,119,97,114,100,95,99,111,109, + 112,97,116,105,98,108,101,101,2,0,0,115,54,0,0,0, + 0,4,2,1,18,1,6,1,12,1,14,1,12,1,8,3, + 14,1,12,1,16,1,2,1,12,1,14,1,6,1,16,1, + 2,4,8,1,10,1,22,1,14,1,6,1,18,1,2,1, + 10,1,16,1,6,1,114,134,0,0,0,99,1,0,0,0, + 0,0,0,0,2,0,0,0,11,0,0,0,67,0,0,0, + 115,220,0,0,0,124,0,106,0,100,0,107,9,114,30,116, + 1,124,0,106,0,100,1,131,2,115,30,116,2,124,0,131, + 1,83,0,116,3,124,0,131,1,125,1,100,2,124,0,95, + 4,122,162,124,1,116,5,106,6,124,0,106,7,60,0,122, + 52,124,0,106,0,100,0,107,8,114,96,124,0,106,8,100, + 0,107,8,114,108,116,9,100,3,124,0,106,7,100,4,141, + 2,130,1,110,12,124,0,106,0,160,10,124,1,161,1,1, + 0,87,0,110,50,1,0,1,0,1,0,122,14,116,5,106, + 6,124,0,106,7,61,0,87,0,110,20,4,0,116,11,107, + 10,114,152,1,0,1,0,1,0,89,0,110,2,88,0,130, + 0,89,0,110,2,88,0,116,5,106,6,160,12,124,0,106, + 7,161,1,125,1,124,1,116,5,106,6,124,0,106,7,60, + 0,116,13,100,5,124,0,106,7,124,0,106,0,131,3,1, + 0,87,0,53,0,100,6,124,0,95,4,88,0,124,1,83, + 0,41,7,78,114,129,0,0,0,84,122,14,109,105,115,115, + 105,110,103,32,108,111,97,100,101,114,41,1,114,15,0,0, + 0,122,18,105,109,112,111,114,116,32,123,33,114,125,32,35, + 32,123,33,114,125,70,41,14,114,93,0,0,0,114,4,0, + 0,0,114,134,0,0,0,114,130,0,0,0,90,13,95,105, + 110,105,116,105,97,108,105,122,105,110,103,114,14,0,0,0, + 114,79,0,0,0,114,15,0,0,0,114,100,0,0,0,114, + 70,0,0,0,114,129,0,0,0,114,55,0,0,0,114,132, + 0,0,0,114,68,0,0,0,41,2,114,82,0,0,0,114, 83,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,16,109,111,100,117,108,101,95,102,114,111,109, - 95,115,112,101,99,64,2,0,0,115,18,0,0,0,0,3, - 4,1,12,3,14,1,12,1,8,2,8,1,10,1,10,1, - 114,136,0,0,0,99,1,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,67,0,0,0,115,106,0,0,0,124, - 0,106,0,100,1,107,8,114,14,100,2,110,4,124,0,106, - 0,125,1,124,0,106,1,100,1,107,8,114,66,124,0,106, - 2,100,1,107,8,114,50,100,3,160,3,124,1,161,1,83, - 0,100,4,160,3,124,1,124,0,106,2,161,2,83,0,110, - 36,124,0,106,4,114,86,100,5,160,3,124,1,124,0,106, - 1,161,2,83,0,100,6,160,3,124,0,106,0,124,0,106, - 1,161,2,83,0,100,1,83,0,41,7,122,38,82,101,116, - 117,114,110,32,116,104,101,32,114,101,112,114,32,116,111,32, - 117,115,101,32,102,111,114,32,116,104,101,32,109,111,100,117, - 108,101,46,78,114,87,0,0,0,122,13,60,109,111,100,117, - 108,101,32,123,33,114,125,62,122,20,60,109,111,100,117,108, - 101,32,123,33,114,125,32,40,123,33,114,125,41,62,122,23, - 60,109,111,100,117,108,101,32,123,33,114,125,32,102,114,111, - 109,32,123,33,114,125,62,122,18,60,109,111,100,117,108,101, - 32,123,33,114,125,32,40,123,125,41,62,41,5,114,15,0, - 0,0,114,103,0,0,0,114,93,0,0,0,114,38,0,0, - 0,114,113,0,0,0,41,2,114,82,0,0,0,114,15,0, + 0,0,0,218,14,95,108,111,97,100,95,117,110,108,111,99, + 107,101,100,138,2,0,0,115,46,0,0,0,0,2,10,2, + 12,1,8,2,8,5,6,1,2,1,12,1,2,1,10,1, + 10,1,16,3,16,1,6,1,2,1,14,1,14,1,6,1, + 8,5,14,1,12,1,20,2,8,2,114,135,0,0,0,99, + 1,0,0,0,0,0,0,0,1,0,0,0,10,0,0,0, + 67,0,0,0,115,42,0,0,0,116,0,124,0,106,1,131, + 1,143,22,1,0,116,2,124,0,131,1,87,0,2,0,53, + 0,81,0,82,0,163,0,83,0,81,0,82,0,88,0,100, + 1,83,0,41,2,122,191,82,101,116,117,114,110,32,97,32, + 110,101,119,32,109,111,100,117,108,101,32,111,98,106,101,99, + 116,44,32,108,111,97,100,101,100,32,98,121,32,116,104,101, + 32,115,112,101,99,39,115,32,108,111,97,100,101,114,46,10, + 10,32,32,32,32,84,104,101,32,109,111,100,117,108,101,32, + 105,115,32,110,111,116,32,97,100,100,101,100,32,116,111,32, + 105,116,115,32,112,97,114,101,110,116,46,10,10,32,32,32, + 32,73,102,32,97,32,109,111,100,117,108,101,32,105,115,32, + 97,108,114,101,97,100,121,32,105,110,32,115,121,115,46,109, + 111,100,117,108,101,115,44,32,116,104,97,116,32,101,120,105, + 115,116,105,110,103,32,109,111,100,117,108,101,32,103,101,116, + 115,10,32,32,32,32,99,108,111,98,98,101,114,101,100,46, + 10,10,32,32,32,32,78,41,3,114,42,0,0,0,114,15, + 0,0,0,114,135,0,0,0,41,1,114,82,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,81, + 0,0,0,180,2,0,0,115,4,0,0,0,0,9,12,1, + 114,81,0,0,0,99,0,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,64,0,0,0,115,142,0,0,0,101, + 0,90,1,100,0,90,2,100,1,90,3,101,4,100,2,100, + 3,132,0,131,1,90,5,101,6,100,4,100,4,102,2,100, + 5,100,6,132,1,131,1,90,7,101,6,100,4,102,1,100, + 7,100,8,132,1,131,1,90,8,101,6,100,9,100,10,132, + 0,131,1,90,9,101,6,100,11,100,12,132,0,131,1,90, + 10,101,6,101,11,100,13,100,14,132,0,131,1,131,1,90, + 12,101,6,101,11,100,15,100,16,132,0,131,1,131,1,90, + 13,101,6,101,11,100,17,100,18,132,0,131,1,131,1,90, + 14,101,6,101,15,131,1,90,16,100,4,83,0,41,19,218, + 15,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, + 122,144,77,101,116,97,32,112,97,116,104,32,105,109,112,111, + 114,116,32,102,111,114,32,98,117,105,108,116,45,105,110,32, + 109,111,100,117,108,101,115,46,10,10,32,32,32,32,65,108, + 108,32,109,101,116,104,111,100,115,32,97,114,101,32,101,105, + 116,104,101,114,32,99,108,97,115,115,32,111,114,32,115,116, + 97,116,105,99,32,109,101,116,104,111,100,115,32,116,111,32, + 97,118,111,105,100,32,116,104,101,32,110,101,101,100,32,116, + 111,10,32,32,32,32,105,110,115,116,97,110,116,105,97,116, + 101,32,116,104,101,32,99,108,97,115,115,46,10,10,32,32, + 32,32,99,1,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,12,0,0,0,100,1,160,0, + 124,0,106,1,161,1,83,0,41,2,122,115,82,101,116,117, + 114,110,32,114,101,112,114,32,102,111,114,32,116,104,101,32, + 109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,32, + 32,84,104,101,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,32,84,104,101,32, + 105,109,112,111,114,116,32,109,97,99,104,105,110,101,114,121, + 32,100,111,101,115,32,116,104,101,32,106,111,98,32,105,116, + 115,101,108,102,46,10,10,32,32,32,32,32,32,32,32,122, + 24,60,109,111,100,117,108,101,32,123,33,114,125,32,40,98, + 117,105,108,116,45,105,110,41,62,41,2,114,38,0,0,0, + 114,1,0,0,0,41,1,114,83,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,86,0,0,0, + 204,2,0,0,115,2,0,0,0,0,7,122,27,66,117,105, + 108,116,105,110,73,109,112,111,114,116,101,114,46,109,111,100, + 117,108,101,95,114,101,112,114,78,99,4,0,0,0,0,0, + 0,0,4,0,0,0,5,0,0,0,67,0,0,0,115,44, + 0,0,0,124,2,100,0,107,9,114,12,100,0,83,0,116, + 0,160,1,124,1,161,1,114,36,116,2,124,1,124,0,100, + 1,100,2,141,3,83,0,100,0,83,0,100,0,83,0,41, + 3,78,122,8,98,117,105,108,116,45,105,110,41,1,114,97, + 0,0,0,41,3,114,49,0,0,0,90,10,105,115,95,98, + 117,105,108,116,105,110,114,78,0,0,0,41,4,218,3,99, + 108,115,114,71,0,0,0,218,4,112,97,116,104,218,6,116, + 97,114,103,101,116,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,9,102,105,110,100,95,115,112,101,99,213, + 2,0,0,115,10,0,0,0,0,2,8,1,4,1,10,1, + 14,2,122,25,66,117,105,108,116,105,110,73,109,112,111,114, + 116,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, + 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0, + 0,0,115,30,0,0,0,124,0,160,0,124,1,124,2,161, + 2,125,3,124,3,100,1,107,9,114,26,124,3,106,1,83, + 0,100,1,83,0,41,2,122,175,70,105,110,100,32,116,104, + 101,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108, + 101,46,10,10,32,32,32,32,32,32,32,32,73,102,32,39, + 112,97,116,104,39,32,105,115,32,101,118,101,114,32,115,112, + 101,99,105,102,105,101,100,32,116,104,101,110,32,116,104,101, + 32,115,101,97,114,99,104,32,105,115,32,99,111,110,115,105, + 100,101,114,101,100,32,97,32,102,97,105,108,117,114,101,46, + 10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109, + 101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97, + 116,101,100,46,32,32,85,115,101,32,102,105,110,100,95,115, + 112,101,99,40,41,32,105,110,115,116,101,97,100,46,10,10, + 32,32,32,32,32,32,32,32,78,41,2,114,140,0,0,0, + 114,93,0,0,0,41,4,114,137,0,0,0,114,71,0,0, + 0,114,138,0,0,0,114,82,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,11,102,105,110,100, + 95,109,111,100,117,108,101,222,2,0,0,115,4,0,0,0, + 0,9,12,1,122,27,66,117,105,108,116,105,110,73,109,112, + 111,114,116,101,114,46,102,105,110,100,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,4,0, + 0,0,67,0,0,0,115,46,0,0,0,124,1,106,0,116, + 1,106,2,107,7,114,34,116,3,100,1,160,4,124,1,106, + 0,161,1,124,1,106,0,100,2,141,2,130,1,116,5,116, + 6,106,7,124,1,131,2,83,0,41,3,122,24,67,114,101, + 97,116,101,32,97,32,98,117,105,108,116,45,105,110,32,109, + 111,100,117,108,101,122,29,123,33,114,125,32,105,115,32,110, + 111,116,32,97,32,98,117,105,108,116,45,105,110,32,109,111, + 100,117,108,101,41,1,114,15,0,0,0,41,8,114,15,0, + 0,0,114,14,0,0,0,114,69,0,0,0,114,70,0,0, + 0,114,38,0,0,0,114,59,0,0,0,114,49,0,0,0, + 90,14,99,114,101,97,116,101,95,98,117,105,108,116,105,110, + 41,2,114,26,0,0,0,114,82,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,128,0,0,0, + 234,2,0,0,115,10,0,0,0,0,3,12,1,12,1,4, + 255,6,2,122,29,66,117,105,108,116,105,110,73,109,112,111, + 114,116,101,114,46,99,114,101,97,116,101,95,109,111,100,117, + 108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,3, + 0,0,0,67,0,0,0,115,16,0,0,0,116,0,116,1, + 106,2,124,1,131,2,1,0,100,1,83,0,41,2,122,22, + 69,120,101,99,32,97,32,98,117,105,108,116,45,105,110,32, + 109,111,100,117,108,101,78,41,3,114,59,0,0,0,114,49, + 0,0,0,90,12,101,120,101,99,95,98,117,105,108,116,105, + 110,41,2,114,26,0,0,0,114,83,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,129,0,0, + 0,242,2,0,0,115,2,0,0,0,0,3,122,27,66,117, + 105,108,116,105,110,73,109,112,111,114,116,101,114,46,101,120, + 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, + 0,0,0,100,1,83,0,41,2,122,57,82,101,116,117,114, + 110,32,78,111,110,101,32,97,115,32,98,117,105,108,116,45, + 105,110,32,109,111,100,117,108,101,115,32,100,111,32,110,111, + 116,32,104,97,118,101,32,99,111,100,101,32,111,98,106,101, + 99,116,115,46,78,114,10,0,0,0,41,2,114,137,0,0, + 0,114,71,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,8,103,101,116,95,99,111,100,101,247, + 2,0,0,115,2,0,0,0,0,4,122,24,66,117,105,108, + 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, + 99,111,100,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, + 83,0,41,2,122,56,82,101,116,117,114,110,32,78,111,110, + 101,32,97,115,32,98,117,105,108,116,45,105,110,32,109,111, + 100,117,108,101,115,32,100,111,32,110,111,116,32,104,97,118, + 101,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, + 10,0,0,0,41,2,114,137,0,0,0,114,71,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 10,103,101,116,95,115,111,117,114,99,101,253,2,0,0,115, + 2,0,0,0,0,4,122,26,66,117,105,108,116,105,110,73, + 109,112,111,114,116,101,114,46,103,101,116,95,115,111,117,114, + 99,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, + 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, + 41,2,122,52,82,101,116,117,114,110,32,70,97,108,115,101, + 32,97,115,32,98,117,105,108,116,45,105,110,32,109,111,100, + 117,108,101,115,32,97,114,101,32,110,101,118,101,114,32,112, + 97,99,107,97,103,101,115,46,70,114,10,0,0,0,41,2, + 114,137,0,0,0,114,71,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,99,0,0,0,3,3, + 0,0,115,2,0,0,0,0,4,122,26,66,117,105,108,116, + 105,110,73,109,112,111,114,116,101,114,46,105,115,95,112,97, + 99,107,97,103,101,41,17,114,1,0,0,0,114,0,0,0, + 0,114,2,0,0,0,114,3,0,0,0,218,12,115,116,97, + 116,105,99,109,101,116,104,111,100,114,86,0,0,0,218,11, + 99,108,97,115,115,109,101,116,104,111,100,114,140,0,0,0, + 114,141,0,0,0,114,128,0,0,0,114,129,0,0,0,114, + 74,0,0,0,114,142,0,0,0,114,143,0,0,0,114,99, + 0,0,0,114,84,0,0,0,114,131,0,0,0,114,10,0, 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,91,0,0,0,81,2,0,0,115,16,0,0,0,0, - 3,20,1,10,1,10,1,10,2,16,2,6,1,14,2,114, - 91,0,0,0,99,2,0,0,0,0,0,0,0,4,0,0, - 0,10,0,0,0,67,0,0,0,115,190,0,0,0,124,0, - 106,0,125,2,116,1,124,2,131,1,143,160,1,0,116,2, - 106,3,160,4,124,2,161,1,124,1,107,9,114,54,100,1, - 160,5,124,2,161,1,125,3,116,6,124,3,124,2,100,2, - 141,2,130,1,124,0,106,7,100,3,107,8,114,118,124,0, - 106,8,100,3,107,8,114,88,116,6,100,4,124,0,106,0, - 100,2,141,2,130,1,116,9,124,0,124,1,100,5,100,6, - 141,3,1,0,124,1,87,0,2,0,53,0,81,0,82,0, - 163,0,83,0,116,9,124,0,124,1,100,5,100,6,141,3, - 1,0,116,10,124,0,106,7,100,7,131,2,115,158,124,0, - 106,7,160,11,124,2,161,1,1,0,110,12,124,0,106,7, - 160,12,124,1,161,1,1,0,87,0,53,0,81,0,82,0, - 88,0,116,2,106,3,124,2,25,0,83,0,41,8,122,70, - 69,120,101,99,117,116,101,32,116,104,101,32,115,112,101,99, - 39,115,32,115,112,101,99,105,102,105,101,100,32,109,111,100, - 117,108,101,32,105,110,32,97,110,32,101,120,105,115,116,105, - 110,103,32,109,111,100,117,108,101,39,115,32,110,97,109,101, - 115,112,97,99,101,46,122,30,109,111,100,117,108,101,32,123, - 33,114,125,32,110,111,116,32,105,110,32,115,121,115,46,109, - 111,100,117,108,101,115,41,1,114,15,0,0,0,78,122,14, - 109,105,115,115,105,110,103,32,108,111,97,100,101,114,84,41, - 1,114,129,0,0,0,114,135,0,0,0,41,13,114,15,0, - 0,0,114,42,0,0,0,114,14,0,0,0,114,79,0,0, - 0,114,30,0,0,0,114,38,0,0,0,114,70,0,0,0, - 114,93,0,0,0,114,106,0,0,0,114,133,0,0,0,114, - 4,0,0,0,218,11,108,111,97,100,95,109,111,100,117,108, - 101,114,135,0,0,0,41,4,114,82,0,0,0,114,83,0, - 0,0,114,15,0,0,0,218,3,109,115,103,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,80,0,0,0, - 98,2,0,0,115,30,0,0,0,0,2,6,1,10,1,16, - 1,10,1,12,1,10,1,10,1,14,2,14,1,16,1,14, - 1,12,4,14,2,22,1,114,80,0,0,0,99,1,0,0, - 0,0,0,0,0,2,0,0,0,8,0,0,0,67,0,0, - 0,115,206,0,0,0,124,0,106,0,160,1,124,0,106,2, - 161,1,1,0,116,3,106,4,124,0,106,2,25,0,125,1, - 116,5,124,1,100,1,100,0,131,3,100,0,107,8,114,76, - 122,12,124,0,106,0,124,1,95,6,87,0,110,20,4,0, - 116,7,107,10,114,74,1,0,1,0,1,0,89,0,110,2, - 88,0,116,5,124,1,100,2,100,0,131,3,100,0,107,8, - 114,154,122,40,124,1,106,8,124,1,95,9,116,10,124,1, - 100,3,131,2,115,130,124,0,106,2,160,11,100,4,161,1, - 100,5,25,0,124,1,95,9,87,0,110,20,4,0,116,7, - 107,10,114,152,1,0,1,0,1,0,89,0,110,2,88,0, - 116,5,124,1,100,6,100,0,131,3,100,0,107,8,114,202, - 122,10,124,0,124,1,95,12,87,0,110,20,4,0,116,7, - 107,10,114,200,1,0,1,0,1,0,89,0,110,2,88,0, - 124,1,83,0,41,7,78,114,85,0,0,0,114,130,0,0, - 0,114,127,0,0,0,114,117,0,0,0,114,19,0,0,0, - 114,89,0,0,0,41,13,114,93,0,0,0,114,137,0,0, - 0,114,15,0,0,0,114,14,0,0,0,114,79,0,0,0, - 114,6,0,0,0,114,85,0,0,0,114,90,0,0,0,114, - 1,0,0,0,114,130,0,0,0,114,4,0,0,0,114,118, - 0,0,0,114,89,0,0,0,41,2,114,82,0,0,0,114, - 83,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,25,95,108,111,97,100,95,98,97,99,107,119, - 97,114,100,95,99,111,109,112,97,116,105,98,108,101,122,2, - 0,0,115,40,0,0,0,0,4,14,2,12,1,16,1,2, - 1,12,1,14,1,6,1,16,1,2,4,8,1,10,1,22, - 1,14,1,6,1,16,1,2,1,10,1,14,1,6,1,114, - 139,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, - 0,9,0,0,0,67,0,0,0,115,118,0,0,0,124,0, - 106,0,100,0,107,9,114,30,116,1,124,0,106,0,100,1, - 131,2,115,30,116,2,124,0,131,1,83,0,116,3,124,0, - 131,1,125,1,116,4,124,1,131,1,143,54,1,0,124,0, - 106,0,100,0,107,8,114,84,124,0,106,5,100,0,107,8, - 114,96,116,6,100,2,124,0,106,7,100,3,141,2,130,1, - 110,12,124,0,106,0,160,8,124,1,161,1,1,0,87,0, - 53,0,81,0,82,0,88,0,116,9,106,10,124,0,106,7, - 25,0,83,0,41,4,78,114,135,0,0,0,122,14,109,105, - 115,115,105,110,103,32,108,111,97,100,101,114,41,1,114,15, - 0,0,0,41,11,114,93,0,0,0,114,4,0,0,0,114, - 139,0,0,0,114,136,0,0,0,114,96,0,0,0,114,106, - 0,0,0,114,70,0,0,0,114,15,0,0,0,114,135,0, - 0,0,114,14,0,0,0,114,79,0,0,0,41,2,114,82, - 0,0,0,114,83,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,14,95,108,111,97,100,95,117, - 110,108,111,99,107,101,100,151,2,0,0,115,20,0,0,0, - 0,2,10,2,12,1,8,2,8,1,10,1,10,1,10,1, - 16,3,22,5,114,140,0,0,0,99,1,0,0,0,0,0, - 0,0,1,0,0,0,10,0,0,0,67,0,0,0,115,42, - 0,0,0,116,0,124,0,106,1,131,1,143,22,1,0,116, - 2,124,0,131,1,87,0,2,0,53,0,81,0,82,0,163, - 0,83,0,81,0,82,0,88,0,100,1,83,0,41,2,122, - 191,82,101,116,117,114,110,32,97,32,110,101,119,32,109,111, - 100,117,108,101,32,111,98,106,101,99,116,44,32,108,111,97, - 100,101,100,32,98,121,32,116,104,101,32,115,112,101,99,39, - 115,32,108,111,97,100,101,114,46,10,10,32,32,32,32,84, - 104,101,32,109,111,100,117,108,101,32,105,115,32,110,111,116, - 32,97,100,100,101,100,32,116,111,32,105,116,115,32,112,97, - 114,101,110,116,46,10,10,32,32,32,32,73,102,32,97,32, - 109,111,100,117,108,101,32,105,115,32,97,108,114,101,97,100, - 121,32,105,110,32,115,121,115,46,109,111,100,117,108,101,115, - 44,32,116,104,97,116,32,101,120,105,115,116,105,110,103,32, - 109,111,100,117,108,101,32,103,101,116,115,10,32,32,32,32, - 99,108,111,98,98,101,114,101,100,46,10,10,32,32,32,32, - 78,41,3,114,42,0,0,0,114,15,0,0,0,114,140,0, - 0,0,41,1,114,82,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,81,0,0,0,174,2,0, - 0,115,4,0,0,0,0,9,12,1,114,81,0,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 64,0,0,0,115,142,0,0,0,101,0,90,1,100,0,90, - 2,100,1,90,3,101,4,100,2,100,3,132,0,131,1,90, - 5,101,6,100,4,100,4,102,2,100,5,100,6,132,1,131, - 1,90,7,101,6,100,4,102,1,100,7,100,8,132,1,131, - 1,90,8,101,6,100,9,100,10,132,0,131,1,90,9,101, - 6,100,11,100,12,132,0,131,1,90,10,101,6,101,11,100, - 13,100,14,132,0,131,1,131,1,90,12,101,6,101,11,100, - 15,100,16,132,0,131,1,131,1,90,13,101,6,101,11,100, - 17,100,18,132,0,131,1,131,1,90,14,101,6,101,15,131, - 1,90,16,100,4,83,0,41,19,218,15,66,117,105,108,116, - 105,110,73,109,112,111,114,116,101,114,122,144,77,101,116,97, - 32,112,97,116,104,32,105,109,112,111,114,116,32,102,111,114, - 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, + 0,114,136,0,0,0,195,2,0,0,115,42,0,0,0,8, + 7,4,2,12,9,2,1,2,0,2,255,12,9,2,1,2, + 255,12,12,12,8,12,5,2,1,2,255,12,6,2,1,2, + 255,12,6,2,1,2,255,12,6,114,136,0,0,0,99,0, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, + 0,0,0,115,146,0,0,0,101,0,90,1,100,0,90,2, + 100,1,90,3,101,4,100,2,100,3,132,0,131,1,90,5, + 101,6,100,4,100,4,102,2,100,5,100,6,132,1,131,1, + 90,7,101,6,100,4,102,1,100,7,100,8,132,1,131,1, + 90,8,101,6,100,9,100,10,132,0,131,1,90,9,101,4, + 100,11,100,12,132,0,131,1,90,10,101,6,100,13,100,14, + 132,0,131,1,90,11,101,6,101,12,100,15,100,16,132,0, + 131,1,131,1,90,13,101,6,101,12,100,17,100,18,132,0, + 131,1,131,1,90,14,101,6,101,12,100,19,100,20,132,0, + 131,1,131,1,90,15,100,4,83,0,41,21,218,14,70,114, + 111,122,101,110,73,109,112,111,114,116,101,114,122,142,77,101, + 116,97,32,112,97,116,104,32,105,109,112,111,114,116,32,102, + 111,114,32,102,114,111,122,101,110,32,109,111,100,117,108,101, 115,46,10,10,32,32,32,32,65,108,108,32,109,101,116,104, 111,100,115,32,97,114,101,32,101,105,116,104,101,114,32,99, 108,97,115,115,32,111,114,32,115,116,97,116,105,99,32,109, @@ -1090,745 +1193,602 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 116,101,100,46,32,32,84,104,101,32,105,109,112,111,114,116, 32,109,97,99,104,105,110,101,114,121,32,100,111,101,115,32, 116,104,101,32,106,111,98,32,105,116,115,101,108,102,46,10, - 10,32,32,32,32,32,32,32,32,122,24,60,109,111,100,117, - 108,101,32,123,33,114,125,32,40,98,117,105,108,116,45,105, - 110,41,62,41,2,114,38,0,0,0,114,1,0,0,0,41, - 1,114,83,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,86,0,0,0,198,2,0,0,115,2, - 0,0,0,0,7,122,27,66,117,105,108,116,105,110,73,109, - 112,111,114,116,101,114,46,109,111,100,117,108,101,95,114,101, - 112,114,78,99,4,0,0,0,0,0,0,0,4,0,0,0, - 5,0,0,0,67,0,0,0,115,44,0,0,0,124,2,100, - 0,107,9,114,12,100,0,83,0,116,0,160,1,124,1,161, - 1,114,36,116,2,124,1,124,0,100,1,100,2,141,3,83, - 0,100,0,83,0,100,0,83,0,41,3,78,122,8,98,117, - 105,108,116,45,105,110,41,1,114,103,0,0,0,41,3,114, - 49,0,0,0,90,10,105,115,95,98,117,105,108,116,105,110, - 114,78,0,0,0,41,4,218,3,99,108,115,114,71,0,0, - 0,218,4,112,97,116,104,218,6,116,97,114,103,101,116,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,9, - 102,105,110,100,95,115,112,101,99,207,2,0,0,115,10,0, - 0,0,0,2,8,1,4,1,10,1,14,2,122,25,66,117, - 105,108,116,105,110,73,109,112,111,114,116,101,114,46,102,105, - 110,100,95,115,112,101,99,99,3,0,0,0,0,0,0,0, - 4,0,0,0,4,0,0,0,67,0,0,0,115,30,0,0, - 0,124,0,160,0,124,1,124,2,161,2,125,3,124,3,100, - 1,107,9,114,26,124,3,106,1,83,0,100,1,83,0,41, - 2,122,175,70,105,110,100,32,116,104,101,32,98,117,105,108, - 116,45,105,110,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,32,32,32,32,73,102,32,39,112,97,116,104,39,32, - 105,115,32,101,118,101,114,32,115,112,101,99,105,102,105,101, - 100,32,116,104,101,110,32,116,104,101,32,115,101,97,114,99, - 104,32,105,115,32,99,111,110,115,105,100,101,114,101,100,32, - 97,32,102,97,105,108,117,114,101,46,10,10,32,32,32,32, - 32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,32, - 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, - 85,115,101,32,102,105,110,100,95,115,112,101,99,40,41,32, - 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32, - 32,32,78,41,2,114,145,0,0,0,114,93,0,0,0,41, - 4,114,142,0,0,0,114,71,0,0,0,114,143,0,0,0, - 114,82,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,11,102,105,110,100,95,109,111,100,117,108, - 101,216,2,0,0,115,4,0,0,0,0,9,12,1,122,27, - 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,46, - 102,105,110,100,95,109,111,100,117,108,101,99,2,0,0,0, - 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, - 115,46,0,0,0,124,1,106,0,116,1,106,2,107,7,114, - 34,116,3,100,1,160,4,124,1,106,0,161,1,124,1,106, - 0,100,2,141,2,130,1,116,5,116,6,106,7,124,1,131, - 2,83,0,41,3,122,24,67,114,101,97,116,101,32,97,32, - 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,122, - 29,123,33,114,125,32,105,115,32,110,111,116,32,97,32,98, - 117,105,108,116,45,105,110,32,109,111,100,117,108,101,41,1, - 114,15,0,0,0,41,8,114,15,0,0,0,114,14,0,0, - 0,114,69,0,0,0,114,70,0,0,0,114,38,0,0,0, - 114,59,0,0,0,114,49,0,0,0,90,14,99,114,101,97, - 116,101,95,98,117,105,108,116,105,110,41,2,114,26,0,0, - 0,114,82,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,134,0,0,0,228,2,0,0,115,10, - 0,0,0,0,3,12,1,12,1,4,255,6,2,122,29,66, - 117,105,108,116,105,110,73,109,112,111,114,116,101,114,46,99, - 114,101,97,116,101,95,109,111,100,117,108,101,99,2,0,0, - 0,0,0,0,0,2,0,0,0,3,0,0,0,67,0,0, - 0,115,16,0,0,0,116,0,116,1,106,2,124,1,131,2, - 1,0,100,1,83,0,41,2,122,22,69,120,101,99,32,97, - 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, - 78,41,3,114,59,0,0,0,114,49,0,0,0,90,12,101, - 120,101,99,95,98,117,105,108,116,105,110,41,2,114,26,0, - 0,0,114,83,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,135,0,0,0,236,2,0,0,115, - 2,0,0,0,0,3,122,27,66,117,105,108,116,105,110,73, - 109,112,111,114,116,101,114,46,101,120,101,99,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, - 0,41,2,122,57,82,101,116,117,114,110,32,78,111,110,101, - 32,97,115,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,115,32,100,111,32,110,111,116,32,104,97,118,101, - 32,99,111,100,101,32,111,98,106,101,99,116,115,46,78,114, - 10,0,0,0,41,2,114,142,0,0,0,114,71,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 8,103,101,116,95,99,111,100,101,241,2,0,0,115,2,0, - 0,0,0,4,122,24,66,117,105,108,116,105,110,73,109,112, - 111,114,116,101,114,46,103,101,116,95,99,111,100,101,99,2, - 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,4,0,0,0,100,1,83,0,41,2,122,56, - 82,101,116,117,114,110,32,78,111,110,101,32,97,115,32,98, - 117,105,108,116,45,105,110,32,109,111,100,117,108,101,115,32, - 100,111,32,110,111,116,32,104,97,118,101,32,115,111,117,114, - 99,101,32,99,111,100,101,46,78,114,10,0,0,0,41,2, - 114,142,0,0,0,114,71,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,10,103,101,116,95,115, - 111,117,114,99,101,247,2,0,0,115,2,0,0,0,0,4, - 122,26,66,117,105,108,116,105,110,73,109,112,111,114,116,101, - 114,46,103,101,116,95,115,111,117,114,99,101,99,2,0,0, - 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, - 0,115,4,0,0,0,100,1,83,0,41,2,122,52,82,101, - 116,117,114,110,32,70,97,108,115,101,32,97,115,32,98,117, - 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97, - 114,101,32,110,101,118,101,114,32,112,97,99,107,97,103,101, - 115,46,70,114,10,0,0,0,41,2,114,142,0,0,0,114, - 71,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,105,0,0,0,253,2,0,0,115,2,0,0, - 0,0,4,122,26,66,117,105,108,116,105,110,73,109,112,111, - 114,116,101,114,46,105,115,95,112,97,99,107,97,103,101,41, - 17,114,1,0,0,0,114,0,0,0,0,114,2,0,0,0, - 114,3,0,0,0,218,12,115,116,97,116,105,99,109,101,116, - 104,111,100,114,86,0,0,0,218,11,99,108,97,115,115,109, - 101,116,104,111,100,114,145,0,0,0,114,146,0,0,0,114, - 134,0,0,0,114,135,0,0,0,114,74,0,0,0,114,147, - 0,0,0,114,148,0,0,0,114,105,0,0,0,114,84,0, - 0,0,114,137,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,141,0,0,0, - 189,2,0,0,115,42,0,0,0,8,7,4,2,12,9,2, - 1,2,0,2,255,12,9,2,1,2,255,12,12,12,8,12, - 5,2,1,2,255,12,6,2,1,2,255,12,6,2,1,2, - 255,12,6,114,141,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,4,0,0,0,64,0,0,0,115,146,0, - 0,0,101,0,90,1,100,0,90,2,100,1,90,3,101,4, - 100,2,100,3,132,0,131,1,90,5,101,6,100,4,100,4, - 102,2,100,5,100,6,132,1,131,1,90,7,101,6,100,4, - 102,1,100,7,100,8,132,1,131,1,90,8,101,6,100,9, - 100,10,132,0,131,1,90,9,101,4,100,11,100,12,132,0, - 131,1,90,10,101,6,100,13,100,14,132,0,131,1,90,11, - 101,6,101,12,100,15,100,16,132,0,131,1,131,1,90,13, - 101,6,101,12,100,17,100,18,132,0,131,1,131,1,90,14, - 101,6,101,12,100,19,100,20,132,0,131,1,131,1,90,15, - 100,4,83,0,41,21,218,14,70,114,111,122,101,110,73,109, - 112,111,114,116,101,114,122,142,77,101,116,97,32,112,97,116, - 104,32,105,109,112,111,114,116,32,102,111,114,32,102,114,111, - 122,101,110,32,109,111,100,117,108,101,115,46,10,10,32,32, - 32,32,65,108,108,32,109,101,116,104,111,100,115,32,97,114, - 101,32,101,105,116,104,101,114,32,99,108,97,115,115,32,111, - 114,32,115,116,97,116,105,99,32,109,101,116,104,111,100,115, - 32,116,111,32,97,118,111,105,100,32,116,104,101,32,110,101, - 101,100,32,116,111,10,32,32,32,32,105,110,115,116,97,110, - 116,105,97,116,101,32,116,104,101,32,99,108,97,115,115,46, - 10,10,32,32,32,32,99,1,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, - 100,1,160,0,124,0,106,1,161,1,83,0,41,2,122,115, - 82,101,116,117,114,110,32,114,101,112,114,32,102,111,114,32, - 116,104,101,32,109,111,100,117,108,101,46,10,10,32,32,32, - 32,32,32,32,32,84,104,101,32,109,101,116,104,111,100,32, - 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, - 84,104,101,32,105,109,112,111,114,116,32,109,97,99,104,105, - 110,101,114,121,32,100,111,101,115,32,116,104,101,32,106,111, - 98,32,105,116,115,101,108,102,46,10,10,32,32,32,32,32, - 32,32,32,122,22,60,109,111,100,117,108,101,32,123,33,114, - 125,32,40,102,114,111,122,101,110,41,62,41,2,114,38,0, - 0,0,114,1,0,0,0,41,1,218,1,109,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,86,0,0,0, - 15,3,0,0,115,2,0,0,0,0,7,122,26,70,114,111, - 122,101,110,73,109,112,111,114,116,101,114,46,109,111,100,117, - 108,101,95,114,101,112,114,78,99,4,0,0,0,0,0,0, - 0,4,0,0,0,5,0,0,0,67,0,0,0,115,32,0, - 0,0,116,0,160,1,124,1,161,1,114,24,116,2,124,1, - 124,0,100,1,100,2,141,3,83,0,100,0,83,0,100,0, - 83,0,41,3,78,90,6,102,114,111,122,101,110,41,1,114, - 103,0,0,0,41,3,114,49,0,0,0,114,75,0,0,0, - 114,78,0,0,0,41,4,114,142,0,0,0,114,71,0,0, - 0,114,143,0,0,0,114,144,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,145,0,0,0,24, - 3,0,0,115,6,0,0,0,0,2,10,1,14,2,122,24, - 70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,102, - 105,110,100,95,115,112,101,99,99,3,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,67,0,0,0,115,18,0, - 0,0,116,0,160,1,124,1,161,1,114,14,124,0,83,0, - 100,1,83,0,41,2,122,93,70,105,110,100,32,97,32,102, - 114,111,122,101,110,32,109,111,100,117,108,101,46,10,10,32, - 32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,104, - 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, - 46,32,32,85,115,101,32,102,105,110,100,95,115,112,101,99, - 40,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32, - 32,32,32,32,32,78,41,2,114,49,0,0,0,114,75,0, - 0,0,41,3,114,142,0,0,0,114,71,0,0,0,114,143, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,146,0,0,0,31,3,0,0,115,2,0,0,0, - 0,7,122,26,70,114,111,122,101,110,73,109,112,111,114,116, - 101,114,46,102,105,110,100,95,109,111,100,117,108,101,99,2, - 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,4,0,0,0,100,1,83,0,41,2,122,42, - 85,115,101,32,100,101,102,97,117,108,116,32,115,101,109,97, - 110,116,105,99,115,32,102,111,114,32,109,111,100,117,108,101, - 32,99,114,101,97,116,105,111,110,46,78,114,10,0,0,0, - 41,2,114,142,0,0,0,114,82,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,134,0,0,0, - 40,3,0,0,115,2,0,0,0,0,2,122,28,70,114,111, - 122,101,110,73,109,112,111,114,116,101,114,46,99,114,101,97, - 116,101,95,109,111,100,117,108,101,99,1,0,0,0,0,0, - 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,64, - 0,0,0,124,0,106,0,106,1,125,1,116,2,160,3,124, - 1,161,1,115,36,116,4,100,1,160,5,124,1,161,1,124, - 1,100,2,141,2,130,1,116,6,116,2,106,7,124,1,131, - 2,125,2,116,8,124,2,124,0,106,9,131,2,1,0,100, - 0,83,0,41,3,78,122,27,123,33,114,125,32,105,115,32, - 110,111,116,32,97,32,102,114,111,122,101,110,32,109,111,100, - 117,108,101,41,1,114,15,0,0,0,41,10,114,89,0,0, - 0,114,15,0,0,0,114,49,0,0,0,114,75,0,0,0, - 114,70,0,0,0,114,38,0,0,0,114,59,0,0,0,218, - 17,103,101,116,95,102,114,111,122,101,110,95,111,98,106,101, - 99,116,218,4,101,120,101,99,114,7,0,0,0,41,3,114, - 83,0,0,0,114,15,0,0,0,218,4,99,111,100,101,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,135, - 0,0,0,44,3,0,0,115,14,0,0,0,0,2,8,1, - 10,1,10,1,2,255,6,2,12,1,122,26,70,114,111,122, - 101,110,73,109,112,111,114,116,101,114,46,101,120,101,99,95, - 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,67,0,0,0,115,10,0,0,0, - 116,0,124,0,124,1,131,2,83,0,41,1,122,95,76,111, - 97,100,32,97,32,102,114,111,122,101,110,32,109,111,100,117, + 10,32,32,32,32,32,32,32,32,122,22,60,109,111,100,117, + 108,101,32,123,33,114,125,32,40,102,114,111,122,101,110,41, + 62,41,2,114,38,0,0,0,114,1,0,0,0,41,1,218, + 1,109,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,86,0,0,0,21,3,0,0,115,2,0,0,0,0, + 7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, + 114,46,109,111,100,117,108,101,95,114,101,112,114,78,99,4, + 0,0,0,0,0,0,0,4,0,0,0,5,0,0,0,67, + 0,0,0,115,32,0,0,0,116,0,160,1,124,1,161,1, + 114,24,116,2,124,1,124,0,100,1,100,2,141,3,83,0, + 100,0,83,0,100,0,83,0,41,3,78,90,6,102,114,111, + 122,101,110,41,1,114,97,0,0,0,41,3,114,49,0,0, + 0,114,75,0,0,0,114,78,0,0,0,41,4,114,137,0, + 0,0,114,71,0,0,0,114,138,0,0,0,114,139,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 114,140,0,0,0,30,3,0,0,115,6,0,0,0,0,2, + 10,1,14,2,122,24,70,114,111,122,101,110,73,109,112,111, + 114,116,101,114,46,102,105,110,100,95,115,112,101,99,99,3, + 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, + 0,0,0,115,18,0,0,0,116,0,160,1,124,1,161,1, + 114,14,124,0,83,0,100,1,83,0,41,2,122,93,70,105, + 110,100,32,97,32,102,114,111,122,101,110,32,109,111,100,117, 108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,105, 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, - 101,99,97,116,101,100,46,32,32,85,115,101,32,101,120,101, - 99,95,109,111,100,117,108,101,40,41,32,105,110,115,116,101, - 97,100,46,10,10,32,32,32,32,32,32,32,32,41,1,114, - 84,0,0,0,41,2,114,142,0,0,0,114,71,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 137,0,0,0,53,3,0,0,115,2,0,0,0,0,7,122, - 26,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46, - 108,111,97,100,95,109,111,100,117,108,101,99,2,0,0,0, - 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, - 115,10,0,0,0,116,0,160,1,124,1,161,1,83,0,41, - 1,122,45,82,101,116,117,114,110,32,116,104,101,32,99,111, - 100,101,32,111,98,106,101,99,116,32,102,111,114,32,116,104, - 101,32,102,114,111,122,101,110,32,109,111,100,117,108,101,46, - 41,2,114,49,0,0,0,114,153,0,0,0,41,2,114,142, - 0,0,0,114,71,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,114,147,0,0,0,62,3,0,0, - 115,2,0,0,0,0,4,122,23,70,114,111,122,101,110,73, - 109,112,111,114,116,101,114,46,103,101,116,95,99,111,100,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, - 122,54,82,101,116,117,114,110,32,78,111,110,101,32,97,115, - 32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,32, - 100,111,32,110,111,116,32,104,97,118,101,32,115,111,117,114, - 99,101,32,99,111,100,101,46,78,114,10,0,0,0,41,2, - 114,142,0,0,0,114,71,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,148,0,0,0,68,3, - 0,0,115,2,0,0,0,0,4,122,25,70,114,111,122,101, - 110,73,109,112,111,114,116,101,114,46,103,101,116,95,115,111, - 117,114,99,101,99,2,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,67,0,0,0,115,10,0,0,0,116,0, - 160,1,124,1,161,1,83,0,41,1,122,46,82,101,116,117, - 114,110,32,84,114,117,101,32,105,102,32,116,104,101,32,102, - 114,111,122,101,110,32,109,111,100,117,108,101,32,105,115,32, - 97,32,112,97,99,107,97,103,101,46,41,2,114,49,0,0, - 0,90,17,105,115,95,102,114,111,122,101,110,95,112,97,99, - 107,97,103,101,41,2,114,142,0,0,0,114,71,0,0,0, + 101,99,97,116,101,100,46,32,32,85,115,101,32,102,105,110, + 100,95,115,112,101,99,40,41,32,105,110,115,116,101,97,100, + 46,10,10,32,32,32,32,32,32,32,32,78,41,2,114,49, + 0,0,0,114,75,0,0,0,41,3,114,137,0,0,0,114, + 71,0,0,0,114,138,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,141,0,0,0,37,3,0, + 0,115,2,0,0,0,0,7,122,26,70,114,111,122,101,110, + 73,109,112,111,114,116,101,114,46,102,105,110,100,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, + 83,0,41,2,122,42,85,115,101,32,100,101,102,97,117,108, + 116,32,115,101,109,97,110,116,105,99,115,32,102,111,114,32, + 109,111,100,117,108,101,32,99,114,101,97,116,105,111,110,46, + 78,114,10,0,0,0,41,2,114,137,0,0,0,114,82,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,128,0,0,0,46,3,0,0,115,2,0,0,0,0, + 2,122,28,70,114,111,122,101,110,73,109,112,111,114,116,101, + 114,46,99,114,101,97,116,101,95,109,111,100,117,108,101,99, + 1,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0, + 67,0,0,0,115,64,0,0,0,124,0,106,0,106,1,125, + 1,116,2,160,3,124,1,161,1,115,36,116,4,100,1,160, + 5,124,1,161,1,124,1,100,2,141,2,130,1,116,6,116, + 2,106,7,124,1,131,2,125,2,116,8,124,2,124,0,106, + 9,131,2,1,0,100,0,83,0,41,3,78,122,27,123,33, + 114,125,32,105,115,32,110,111,116,32,97,32,102,114,111,122, + 101,110,32,109,111,100,117,108,101,41,1,114,15,0,0,0, + 41,10,114,89,0,0,0,114,15,0,0,0,114,49,0,0, + 0,114,75,0,0,0,114,70,0,0,0,114,38,0,0,0, + 114,59,0,0,0,218,17,103,101,116,95,102,114,111,122,101, + 110,95,111,98,106,101,99,116,218,4,101,120,101,99,114,7, + 0,0,0,41,3,114,83,0,0,0,114,15,0,0,0,218, + 4,99,111,100,101,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,129,0,0,0,50,3,0,0,115,14,0, + 0,0,0,2,8,1,10,1,10,1,2,255,6,2,12,1, + 122,26,70,114,111,122,101,110,73,109,112,111,114,116,101,114, + 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, + 0,0,0,0,0,2,0,0,0,3,0,0,0,67,0,0, + 0,115,10,0,0,0,116,0,124,0,124,1,131,2,83,0, + 41,1,122,95,76,111,97,100,32,97,32,102,114,111,122,101, + 110,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, + 32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,105, + 115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85, + 115,101,32,101,120,101,99,95,109,111,100,117,108,101,40,41, + 32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,32, + 32,32,32,41,1,114,84,0,0,0,41,2,114,137,0,0, + 0,114,71,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,131,0,0,0,59,3,0,0,115,2, + 0,0,0,0,7,122,26,70,114,111,122,101,110,73,109,112, + 111,114,116,101,114,46,108,111,97,100,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,10,0,0,0,116,0,160,1,124, + 1,161,1,83,0,41,1,122,45,82,101,116,117,114,110,32, + 116,104,101,32,99,111,100,101,32,111,98,106,101,99,116,32, + 102,111,114,32,116,104,101,32,102,114,111,122,101,110,32,109, + 111,100,117,108,101,46,41,2,114,49,0,0,0,114,148,0, + 0,0,41,2,114,137,0,0,0,114,71,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,142,0, + 0,0,68,3,0,0,115,2,0,0,0,0,4,122,23,70, + 114,111,122,101,110,73,109,112,111,114,116,101,114,46,103,101, + 116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, + 100,1,83,0,41,2,122,54,82,101,116,117,114,110,32,78, + 111,110,101,32,97,115,32,102,114,111,122,101,110,32,109,111, + 100,117,108,101,115,32,100,111,32,110,111,116,32,104,97,118, + 101,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, + 10,0,0,0,41,2,114,137,0,0,0,114,71,0,0,0, 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 105,0,0,0,74,3,0,0,115,2,0,0,0,0,4,122, + 143,0,0,0,74,3,0,0,115,2,0,0,0,0,4,122, 25,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46, - 105,115,95,112,97,99,107,97,103,101,41,16,114,1,0,0, - 0,114,0,0,0,0,114,2,0,0,0,114,3,0,0,0, - 114,149,0,0,0,114,86,0,0,0,114,150,0,0,0,114, - 145,0,0,0,114,146,0,0,0,114,134,0,0,0,114,135, - 0,0,0,114,137,0,0,0,114,77,0,0,0,114,147,0, - 0,0,114,148,0,0,0,114,105,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,151,0,0,0,6,3,0,0,115,42,0,0,0,8,7, - 4,2,12,9,2,1,2,0,2,255,12,7,2,1,2,255, - 12,9,12,4,12,9,12,9,2,1,2,255,12,6,2,1, - 2,255,12,6,2,1,2,255,114,151,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, - 0,0,115,32,0,0,0,101,0,90,1,100,0,90,2,100, - 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, - 0,90,5,100,6,83,0,41,7,218,18,95,73,109,112,111, - 114,116,76,111,99,107,67,111,110,116,101,120,116,122,36,67, - 111,110,116,101,120,116,32,109,97,110,97,103,101,114,32,102, - 111,114,32,116,104,101,32,105,109,112,111,114,116,32,108,111, - 99,107,46,99,1,0,0,0,0,0,0,0,1,0,0,0, - 2,0,0,0,67,0,0,0,115,12,0,0,0,116,0,160, - 1,161,0,1,0,100,1,83,0,41,2,122,24,65,99,113, - 117,105,114,101,32,116,104,101,32,105,109,112,111,114,116,32, - 108,111,99,107,46,78,41,2,114,49,0,0,0,114,50,0, - 0,0,41,1,114,26,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,46,0,0,0,87,3,0, - 0,115,2,0,0,0,0,2,122,28,95,73,109,112,111,114, - 116,76,111,99,107,67,111,110,116,101,120,116,46,95,95,101, - 110,116,101,114,95,95,99,4,0,0,0,0,0,0,0,4, - 0,0,0,2,0,0,0,67,0,0,0,115,12,0,0,0, - 116,0,160,1,161,0,1,0,100,1,83,0,41,2,122,60, - 82,101,108,101,97,115,101,32,116,104,101,32,105,109,112,111, - 114,116,32,108,111,99,107,32,114,101,103,97,114,100,108,101, - 115,115,32,111,102,32,97,110,121,32,114,97,105,115,101,100, - 32,101,120,99,101,112,116,105,111,110,115,46,78,41,2,114, - 49,0,0,0,114,52,0,0,0,41,4,114,26,0,0,0, - 90,8,101,120,99,95,116,121,112,101,90,9,101,120,99,95, - 118,97,108,117,101,90,13,101,120,99,95,116,114,97,99,101, - 98,97,99,107,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,48,0,0,0,91,3,0,0,115,2,0,0, - 0,0,2,122,27,95,73,109,112,111,114,116,76,111,99,107, - 67,111,110,116,101,120,116,46,95,95,101,120,105,116,95,95, - 78,41,6,114,1,0,0,0,114,0,0,0,0,114,2,0, - 0,0,114,3,0,0,0,114,46,0,0,0,114,48,0,0, - 0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,156,0,0,0,83,3,0,0,115,6, - 0,0,0,8,2,4,2,8,4,114,156,0,0,0,99,3, - 0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,67, - 0,0,0,115,64,0,0,0,124,1,160,0,100,1,124,2, - 100,2,24,0,161,2,125,3,116,1,124,3,131,1,124,2, - 107,0,114,36,116,2,100,3,131,1,130,1,124,3,100,4, - 25,0,125,4,124,0,114,60,100,5,160,3,124,4,124,0, - 161,2,83,0,124,4,83,0,41,6,122,50,82,101,115,111, - 108,118,101,32,97,32,114,101,108,97,116,105,118,101,32,109, - 111,100,117,108,101,32,110,97,109,101,32,116,111,32,97,110, - 32,97,98,115,111,108,117,116,101,32,111,110,101,46,114,117, - 0,0,0,114,33,0,0,0,122,50,97,116,116,101,109,112, - 116,101,100,32,114,101,108,97,116,105,118,101,32,105,109,112, - 111,114,116,32,98,101,121,111,110,100,32,116,111,112,45,108, - 101,118,101,108,32,112,97,99,107,97,103,101,114,19,0,0, - 0,122,5,123,125,46,123,125,41,4,218,6,114,115,112,108, - 105,116,218,3,108,101,110,218,10,86,97,108,117,101,69,114, - 114,111,114,114,38,0,0,0,41,5,114,15,0,0,0,218, - 7,112,97,99,107,97,103,101,218,5,108,101,118,101,108,90, - 4,98,105,116,115,90,4,98,97,115,101,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,13,95,114,101,115, - 111,108,118,101,95,110,97,109,101,96,3,0,0,115,10,0, - 0,0,0,2,16,1,12,1,8,1,8,1,114,162,0,0, - 0,99,3,0,0,0,0,0,0,0,4,0,0,0,4,0, - 0,0,67,0,0,0,115,34,0,0,0,124,0,160,0,124, - 1,124,2,161,2,125,3,124,3,100,0,107,8,114,24,100, - 0,83,0,116,1,124,1,124,3,131,2,83,0,41,1,78, - 41,2,114,146,0,0,0,114,78,0,0,0,41,4,218,6, - 102,105,110,100,101,114,114,15,0,0,0,114,143,0,0,0, - 114,93,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,17,95,102,105,110,100,95,115,112,101,99, - 95,108,101,103,97,99,121,105,3,0,0,115,8,0,0,0, - 0,3,12,1,8,1,4,1,114,164,0,0,0,99,3,0, - 0,0,0,0,0,0,10,0,0,0,10,0,0,0,67,0, - 0,0,115,12,1,0,0,116,0,106,1,125,3,124,3,100, - 1,107,8,114,22,116,2,100,2,131,1,130,1,124,3,115, - 38,116,3,160,4,100,3,116,5,161,2,1,0,124,0,116, - 0,106,6,107,6,125,4,124,3,68,0,93,210,125,5,116, - 7,131,0,143,84,1,0,122,10,124,5,106,8,125,6,87, - 0,110,54,4,0,116,9,107,10,114,128,1,0,1,0,1, - 0,116,10,124,5,124,0,124,1,131,3,125,7,124,7,100, - 1,107,8,114,124,89,0,87,0,53,0,81,0,82,0,163, - 0,113,52,89,0,110,14,88,0,124,6,124,0,124,1,124, - 2,131,3,125,7,87,0,53,0,81,0,82,0,88,0,124, - 7,100,1,107,9,114,52,124,4,144,0,115,254,124,0,116, - 0,106,6,107,6,144,0,114,254,116,0,106,6,124,0,25, - 0,125,8,122,10,124,8,106,11,125,9,87,0,110,28,4, - 0,116,9,107,10,114,226,1,0,1,0,1,0,124,7,6, - 0,89,0,2,0,1,0,83,0,88,0,124,9,100,1,107, - 8,114,244,124,7,2,0,1,0,83,0,124,9,2,0,1, - 0,83,0,113,52,124,7,2,0,1,0,83,0,113,52,100, - 1,83,0,41,4,122,21,70,105,110,100,32,97,32,109,111, - 100,117,108,101,39,115,32,115,112,101,99,46,78,122,53,115, - 121,115,46,109,101,116,97,95,112,97,116,104,32,105,115,32, - 78,111,110,101,44,32,80,121,116,104,111,110,32,105,115,32, - 108,105,107,101,108,121,32,115,104,117,116,116,105,110,103,32, - 100,111,119,110,122,22,115,121,115,46,109,101,116,97,95,112, - 97,116,104,32,105,115,32,101,109,112,116,121,41,12,114,14, - 0,0,0,218,9,109,101,116,97,95,112,97,116,104,114,70, - 0,0,0,218,9,95,119,97,114,110,105,110,103,115,218,4, - 119,97,114,110,218,13,73,109,112,111,114,116,87,97,114,110, - 105,110,103,114,79,0,0,0,114,156,0,0,0,114,145,0, - 0,0,114,90,0,0,0,114,164,0,0,0,114,89,0,0, - 0,41,10,114,15,0,0,0,114,143,0,0,0,114,144,0, - 0,0,114,165,0,0,0,90,9,105,115,95,114,101,108,111, - 97,100,114,163,0,0,0,114,145,0,0,0,114,82,0,0, - 0,114,83,0,0,0,114,89,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,10,95,102,105,110, - 100,95,115,112,101,99,114,3,0,0,115,54,0,0,0,0, - 2,6,1,8,2,8,3,4,1,12,5,10,1,8,1,8, - 1,2,1,10,1,14,1,12,1,8,1,20,2,22,1,8, - 2,18,1,10,1,2,1,10,1,14,4,14,2,8,1,8, - 2,10,2,10,2,114,169,0,0,0,99,3,0,0,0,0, - 0,0,0,3,0,0,0,5,0,0,0,67,0,0,0,115, - 108,0,0,0,116,0,124,0,116,1,131,2,115,28,116,2, - 100,1,160,3,116,4,124,0,131,1,161,1,131,1,130,1, - 124,2,100,2,107,0,114,44,116,5,100,3,131,1,130,1, - 124,2,100,2,107,4,114,84,116,0,124,1,116,1,131,2, - 115,72,116,2,100,4,131,1,130,1,110,12,124,1,115,84, - 116,6,100,5,131,1,130,1,124,0,115,104,124,2,100,2, - 107,2,114,104,116,5,100,6,131,1,130,1,100,7,83,0, - 41,8,122,28,86,101,114,105,102,121,32,97,114,103,117,109, - 101,110,116,115,32,97,114,101,32,34,115,97,110,101,34,46, - 122,31,109,111,100,117,108,101,32,110,97,109,101,32,109,117, - 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,123, - 125,114,19,0,0,0,122,18,108,101,118,101,108,32,109,117, - 115,116,32,98,101,32,62,61,32,48,122,31,95,95,112,97, - 99,107,97,103,101,95,95,32,110,111,116,32,115,101,116,32, - 116,111,32,97,32,115,116,114,105,110,103,122,54,97,116,116, - 101,109,112,116,101,100,32,114,101,108,97,116,105,118,101,32, - 105,109,112,111,114,116,32,119,105,116,104,32,110,111,32,107, - 110,111,119,110,32,112,97,114,101,110,116,32,112,97,99,107, - 97,103,101,122,17,69,109,112,116,121,32,109,111,100,117,108, - 101,32,110,97,109,101,78,41,7,218,10,105,115,105,110,115, - 116,97,110,99,101,218,3,115,116,114,218,9,84,121,112,101, - 69,114,114,111,114,114,38,0,0,0,114,13,0,0,0,114, - 159,0,0,0,114,70,0,0,0,41,3,114,15,0,0,0, - 114,160,0,0,0,114,161,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,13,95,115,97,110,105, - 116,121,95,99,104,101,99,107,161,3,0,0,115,22,0,0, - 0,0,2,10,1,18,1,8,1,8,1,8,1,10,1,10, - 1,4,1,8,2,12,1,114,173,0,0,0,122,16,78,111, - 32,109,111,100,117,108,101,32,110,97,109,101,100,32,122,4, - 123,33,114,125,99,2,0,0,0,0,0,0,0,8,0,0, - 0,8,0,0,0,67,0,0,0,115,220,0,0,0,100,0, - 125,2,124,0,160,0,100,1,161,1,100,2,25,0,125,3, - 124,3,114,134,124,3,116,1,106,2,107,7,114,42,116,3, - 124,1,124,3,131,2,1,0,124,0,116,1,106,2,107,6, - 114,62,116,1,106,2,124,0,25,0,83,0,116,1,106,2, - 124,3,25,0,125,4,122,10,124,4,106,4,125,2,87,0, - 110,50,4,0,116,5,107,10,114,132,1,0,1,0,1,0, - 116,6,100,3,23,0,160,7,124,0,124,3,161,2,125,5, - 116,8,124,5,124,0,100,4,141,2,100,0,130,2,89,0, - 110,2,88,0,116,9,124,0,124,2,131,2,125,6,124,6, - 100,0,107,8,114,172,116,8,116,6,160,7,124,0,161,1, - 124,0,100,4,141,2,130,1,110,8,116,10,124,6,131,1, - 125,7,124,3,114,216,116,1,106,2,124,3,25,0,125,4, - 116,11,124,4,124,0,160,0,100,1,161,1,100,5,25,0, - 124,7,131,3,1,0,124,7,83,0,41,6,78,114,117,0, - 0,0,114,19,0,0,0,122,23,59,32,123,33,114,125,32, - 105,115,32,110,111,116,32,97,32,112,97,99,107,97,103,101, - 41,1,114,15,0,0,0,233,2,0,0,0,41,12,114,118, - 0,0,0,114,14,0,0,0,114,79,0,0,0,114,59,0, - 0,0,114,127,0,0,0,114,90,0,0,0,218,8,95,69, - 82,82,95,77,83,71,114,38,0,0,0,218,19,77,111,100, - 117,108,101,78,111,116,70,111,117,110,100,69,114,114,111,114, - 114,169,0,0,0,114,140,0,0,0,114,5,0,0,0,41, - 8,114,15,0,0,0,218,7,105,109,112,111,114,116,95,114, - 143,0,0,0,114,119,0,0,0,90,13,112,97,114,101,110, - 116,95,109,111,100,117,108,101,114,138,0,0,0,114,82,0, - 0,0,114,83,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,23,95,102,105,110,100,95,97,110, - 100,95,108,111,97,100,95,117,110,108,111,99,107,101,100,180, - 3,0,0,115,42,0,0,0,0,1,4,1,14,1,4,1, - 10,1,10,2,10,1,10,1,10,1,2,1,10,1,14,1, - 16,1,20,1,10,1,8,1,20,2,8,1,4,2,10,1, - 22,1,114,178,0,0,0,99,2,0,0,0,0,0,0,0, - 4,0,0,0,10,0,0,0,67,0,0,0,115,106,0,0, - 0,116,0,124,0,131,1,143,50,1,0,116,1,106,2,160, - 3,124,0,116,4,161,2,125,2,124,2,116,4,107,8,114, - 54,116,5,124,0,124,1,131,2,87,0,2,0,53,0,81, - 0,82,0,163,0,83,0,87,0,53,0,81,0,82,0,88, - 0,124,2,100,1,107,8,114,94,100,2,160,6,124,0,161, - 1,125,3,116,7,124,3,124,0,100,3,141,2,130,1,116, - 8,124,0,131,1,1,0,124,2,83,0,41,4,122,25,70, - 105,110,100,32,97,110,100,32,108,111,97,100,32,116,104,101, - 32,109,111,100,117,108,101,46,78,122,40,105,109,112,111,114, - 116,32,111,102,32,123,125,32,104,97,108,116,101,100,59,32, - 78,111,110,101,32,105,110,32,115,121,115,46,109,111,100,117, - 108,101,115,41,1,114,15,0,0,0,41,9,114,42,0,0, - 0,114,14,0,0,0,114,79,0,0,0,114,30,0,0,0, - 218,14,95,78,69,69,68,83,95,76,79,65,68,73,78,71, - 114,178,0,0,0,114,38,0,0,0,114,176,0,0,0,114, - 57,0,0,0,41,4,114,15,0,0,0,114,177,0,0,0, - 114,83,0,0,0,114,67,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,218,14,95,102,105,110,100, - 95,97,110,100,95,108,111,97,100,210,3,0,0,115,22,0, - 0,0,0,2,10,1,14,1,8,1,32,2,8,1,4,1, - 2,255,4,2,12,2,8,1,114,180,0,0,0,114,19,0, - 0,0,99,3,0,0,0,0,0,0,0,3,0,0,0,4, - 0,0,0,67,0,0,0,115,42,0,0,0,116,0,124,0, - 124,1,124,2,131,3,1,0,124,2,100,1,107,4,114,32, - 116,1,124,0,124,1,124,2,131,3,125,0,116,2,124,0, - 116,3,131,2,83,0,41,2,97,50,1,0,0,73,109,112, - 111,114,116,32,97,110,100,32,114,101,116,117,114,110,32,116, - 104,101,32,109,111,100,117,108,101,32,98,97,115,101,100,32, - 111,110,32,105,116,115,32,110,97,109,101,44,32,116,104,101, - 32,112,97,99,107,97,103,101,32,116,104,101,32,99,97,108, - 108,32,105,115,10,32,32,32,32,98,101,105,110,103,32,109, - 97,100,101,32,102,114,111,109,44,32,97,110,100,32,116,104, - 101,32,108,101,118,101,108,32,97,100,106,117,115,116,109,101, - 110,116,46,10,10,32,32,32,32,84,104,105,115,32,102,117, - 110,99,116,105,111,110,32,114,101,112,114,101,115,101,110,116, - 115,32,116,104,101,32,103,114,101,97,116,101,115,116,32,99, - 111,109,109,111,110,32,100,101,110,111,109,105,110,97,116,111, - 114,32,111,102,32,102,117,110,99,116,105,111,110,97,108,105, - 116,121,10,32,32,32,32,98,101,116,119,101,101,110,32,105, - 109,112,111,114,116,95,109,111,100,117,108,101,32,97,110,100, - 32,95,95,105,109,112,111,114,116,95,95,46,32,84,104,105, - 115,32,105,110,99,108,117,100,101,115,32,115,101,116,116,105, - 110,103,32,95,95,112,97,99,107,97,103,101,95,95,32,105, - 102,10,32,32,32,32,116,104,101,32,108,111,97,100,101,114, - 32,100,105,100,32,110,111,116,46,10,10,32,32,32,32,114, - 19,0,0,0,41,4,114,173,0,0,0,114,162,0,0,0, - 114,180,0,0,0,218,11,95,103,99,100,95,105,109,112,111, - 114,116,41,3,114,15,0,0,0,114,160,0,0,0,114,161, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,181,0,0,0,226,3,0,0,115,8,0,0,0, - 0,9,12,1,8,1,12,1,114,181,0,0,0,41,1,218, - 9,114,101,99,117,114,115,105,118,101,99,3,0,0,0,1, - 0,0,0,8,0,0,0,11,0,0,0,67,0,0,0,115, - 226,0,0,0,124,1,68,0,93,216,125,4,116,0,124,4, - 116,1,131,2,115,66,124,3,114,34,124,0,106,2,100,1, - 23,0,125,5,110,4,100,2,125,5,116,3,100,3,124,5, - 155,0,100,4,116,4,124,4,131,1,106,2,155,0,157,4, - 131,1,130,1,110,154,124,4,100,5,107,2,114,108,124,3, - 115,106,116,5,124,0,100,6,131,2,114,106,116,6,124,0, - 124,0,106,7,124,2,100,7,100,8,141,4,1,0,110,112, - 116,5,124,0,124,4,131,2,115,220,100,9,160,8,124,0, - 106,2,124,4,161,2,125,6,122,14,116,9,124,2,124,6, - 131,2,1,0,87,0,110,72,4,0,116,10,107,10,114,218, - 1,0,125,7,1,0,122,42,124,7,106,11,124,6,107,2, - 114,200,116,12,106,13,160,14,124,6,116,15,161,2,100,10, - 107,9,114,200,87,0,89,0,162,8,113,4,130,0,87,0, - 53,0,100,10,125,7,126,7,88,0,89,0,110,2,88,0, - 113,4,124,0,83,0,41,11,122,238,70,105,103,117,114,101, - 32,111,117,116,32,119,104,97,116,32,95,95,105,109,112,111, - 114,116,95,95,32,115,104,111,117,108,100,32,114,101,116,117, - 114,110,46,10,10,32,32,32,32,84,104,101,32,105,109,112, - 111,114,116,95,32,112,97,114,97,109,101,116,101,114,32,105, - 115,32,97,32,99,97,108,108,97,98,108,101,32,119,104,105, - 99,104,32,116,97,107,101,115,32,116,104,101,32,110,97,109, - 101,32,111,102,32,109,111,100,117,108,101,32,116,111,10,32, - 32,32,32,105,109,112,111,114,116,46,32,73,116,32,105,115, - 32,114,101,113,117,105,114,101,100,32,116,111,32,100,101,99, - 111,117,112,108,101,32,116,104,101,32,102,117,110,99,116,105, - 111,110,32,102,114,111,109,32,97,115,115,117,109,105,110,103, - 32,105,109,112,111,114,116,108,105,98,39,115,10,32,32,32, - 32,105,109,112,111,114,116,32,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,32,105,115,32,100,101,115,105,114,101, - 100,46,10,10,32,32,32,32,122,8,46,95,95,97,108,108, - 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39, - 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117, - 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250, - 1,42,218,7,95,95,97,108,108,95,95,84,41,1,114,182, - 0,0,0,122,5,123,125,46,123,125,78,41,16,114,170,0, - 0,0,114,171,0,0,0,114,1,0,0,0,114,172,0,0, - 0,114,13,0,0,0,114,4,0,0,0,218,16,95,104,97, - 110,100,108,101,95,102,114,111,109,108,105,115,116,114,184,0, - 0,0,114,38,0,0,0,114,59,0,0,0,114,176,0,0, - 0,114,15,0,0,0,114,14,0,0,0,114,79,0,0,0, - 114,30,0,0,0,114,179,0,0,0,41,8,114,83,0,0, - 0,218,8,102,114,111,109,108,105,115,116,114,177,0,0,0, - 114,182,0,0,0,218,1,120,90,5,119,104,101,114,101,90, - 9,102,114,111,109,95,110,97,109,101,90,3,101,120,99,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,185, - 0,0,0,241,3,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,16,4,10,1, - 16,255,2,2,8,1,22,1,114,185,0,0,0,99,1,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,107, - 9,114,82,124,2,100,3,107,9,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,107,9,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,107,7,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,130,0,0,0,114,89,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,127,0, - 0,0,114,117,0,0,0,114,19,0,0,0,41,6,114,30, - 0,0,0,114,119,0,0,0,114,166,0,0,0,114,167,0, - 0,0,114,168,0,0,0,114,118,0,0,0,41,3,218,7, - 103,108,111,98,97,108,115,114,160,0,0,0,114,82,0,0, + 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, + 10,0,0,0,116,0,160,1,124,1,161,1,83,0,41,1, + 122,46,82,101,116,117,114,110,32,84,114,117,101,32,105,102, + 32,116,104,101,32,102,114,111,122,101,110,32,109,111,100,117, + 108,101,32,105,115,32,97,32,112,97,99,107,97,103,101,46, + 41,2,114,49,0,0,0,90,17,105,115,95,102,114,111,122, + 101,110,95,112,97,99,107,97,103,101,41,2,114,137,0,0, + 0,114,71,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,99,0,0,0,80,3,0,0,115,2, + 0,0,0,0,4,122,25,70,114,111,122,101,110,73,109,112, + 111,114,116,101,114,46,105,115,95,112,97,99,107,97,103,101, + 41,16,114,1,0,0,0,114,0,0,0,0,114,2,0,0, + 0,114,3,0,0,0,114,144,0,0,0,114,86,0,0,0, + 114,145,0,0,0,114,140,0,0,0,114,141,0,0,0,114, + 128,0,0,0,114,129,0,0,0,114,131,0,0,0,114,77, + 0,0,0,114,142,0,0,0,114,143,0,0,0,114,99,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,146,0,0,0,12,3,0,0,115, + 42,0,0,0,8,7,4,2,12,9,2,1,2,0,2,255, + 12,7,2,1,2,255,12,9,12,4,12,9,12,9,2,1, + 2,255,12,6,2,1,2,255,12,6,2,1,2,255,114,146, + 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,64,0,0,0,115,32,0,0,0,101,0,90, + 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, + 4,100,4,100,5,132,0,90,5,100,6,83,0,41,7,218, + 18,95,73,109,112,111,114,116,76,111,99,107,67,111,110,116, + 101,120,116,122,36,67,111,110,116,101,120,116,32,109,97,110, + 97,103,101,114,32,102,111,114,32,116,104,101,32,105,109,112, + 111,114,116,32,108,111,99,107,46,99,1,0,0,0,0,0, + 0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,12, + 0,0,0,116,0,160,1,161,0,1,0,100,1,83,0,41, + 2,122,24,65,99,113,117,105,114,101,32,116,104,101,32,105, + 109,112,111,114,116,32,108,111,99,107,46,78,41,2,114,49, + 0,0,0,114,50,0,0,0,41,1,114,26,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,46, + 0,0,0,93,3,0,0,115,2,0,0,0,0,2,122,28, + 95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,101, + 120,116,46,95,95,101,110,116,101,114,95,95,99,4,0,0, + 0,0,0,0,0,4,0,0,0,2,0,0,0,67,0,0, + 0,115,12,0,0,0,116,0,160,1,161,0,1,0,100,1, + 83,0,41,2,122,60,82,101,108,101,97,115,101,32,116,104, + 101,32,105,109,112,111,114,116,32,108,111,99,107,32,114,101, + 103,97,114,100,108,101,115,115,32,111,102,32,97,110,121,32, + 114,97,105,115,101,100,32,101,120,99,101,112,116,105,111,110, + 115,46,78,41,2,114,49,0,0,0,114,52,0,0,0,41, + 4,114,26,0,0,0,90,8,101,120,99,95,116,121,112,101, + 90,9,101,120,99,95,118,97,108,117,101,90,13,101,120,99, + 95,116,114,97,99,101,98,97,99,107,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,48,0,0,0,97,3, + 0,0,115,2,0,0,0,0,2,122,27,95,73,109,112,111, + 114,116,76,111,99,107,67,111,110,116,101,120,116,46,95,95, + 101,120,105,116,95,95,78,41,6,114,1,0,0,0,114,0, + 0,0,0,114,2,0,0,0,114,3,0,0,0,114,46,0, + 0,0,114,48,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,114,151,0,0,0, + 89,3,0,0,115,6,0,0,0,8,2,4,2,8,4,114, + 151,0,0,0,99,3,0,0,0,0,0,0,0,5,0,0, + 0,5,0,0,0,67,0,0,0,115,64,0,0,0,124,1, + 160,0,100,1,124,2,100,2,24,0,161,2,125,3,116,1, + 124,3,131,1,124,2,107,0,114,36,116,2,100,3,131,1, + 130,1,124,3,100,4,25,0,125,4,124,0,114,60,100,5, + 160,3,124,4,124,0,161,2,83,0,124,4,83,0,41,6, + 122,50,82,101,115,111,108,118,101,32,97,32,114,101,108,97, + 116,105,118,101,32,109,111,100,117,108,101,32,110,97,109,101, + 32,116,111,32,97,110,32,97,98,115,111,108,117,116,101,32, + 111,110,101,46,114,111,0,0,0,114,33,0,0,0,122,50, + 97,116,116,101,109,112,116,101,100,32,114,101,108,97,116,105, + 118,101,32,105,109,112,111,114,116,32,98,101,121,111,110,100, + 32,116,111,112,45,108,101,118,101,108,32,112,97,99,107,97, + 103,101,114,19,0,0,0,122,5,123,125,46,123,125,41,4, + 218,6,114,115,112,108,105,116,218,3,108,101,110,218,10,86, + 97,108,117,101,69,114,114,111,114,114,38,0,0,0,41,5, + 114,15,0,0,0,218,7,112,97,99,107,97,103,101,218,5, + 108,101,118,101,108,90,4,98,105,116,115,90,4,98,97,115, + 101,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,13,95,114,101,115,111,108,118,101,95,110,97,109,101,102, + 3,0,0,115,10,0,0,0,0,2,16,1,12,1,8,1, + 8,1,114,157,0,0,0,99,3,0,0,0,0,0,0,0, + 4,0,0,0,4,0,0,0,67,0,0,0,115,34,0,0, + 0,124,0,160,0,124,1,124,2,161,2,125,3,124,3,100, + 0,107,8,114,24,100,0,83,0,116,1,124,1,124,3,131, + 2,83,0,41,1,78,41,2,114,141,0,0,0,114,78,0, + 0,0,41,4,218,6,102,105,110,100,101,114,114,15,0,0, + 0,114,138,0,0,0,114,93,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,17,95,102,105,110, + 100,95,115,112,101,99,95,108,101,103,97,99,121,111,3,0, + 0,115,8,0,0,0,0,3,12,1,8,1,4,1,114,159, + 0,0,0,99,3,0,0,0,0,0,0,0,10,0,0,0, + 10,0,0,0,67,0,0,0,115,12,1,0,0,116,0,106, + 1,125,3,124,3,100,1,107,8,114,22,116,2,100,2,131, + 1,130,1,124,3,115,38,116,3,160,4,100,3,116,5,161, + 2,1,0,124,0,116,0,106,6,107,6,125,4,124,3,68, + 0,93,210,125,5,116,7,131,0,143,84,1,0,122,10,124, + 5,106,8,125,6,87,0,110,54,4,0,116,9,107,10,114, + 128,1,0,1,0,1,0,116,10,124,5,124,0,124,1,131, + 3,125,7,124,7,100,1,107,8,114,124,89,0,87,0,53, + 0,81,0,82,0,163,0,113,52,89,0,110,14,88,0,124, + 6,124,0,124,1,124,2,131,3,125,7,87,0,53,0,81, + 0,82,0,88,0,124,7,100,1,107,9,114,52,124,4,144, + 0,115,254,124,0,116,0,106,6,107,6,144,0,114,254,116, + 0,106,6,124,0,25,0,125,8,122,10,124,8,106,11,125, + 9,87,0,110,28,4,0,116,9,107,10,114,226,1,0,1, + 0,1,0,124,7,6,0,89,0,2,0,1,0,83,0,88, + 0,124,9,100,1,107,8,114,244,124,7,2,0,1,0,83, + 0,124,9,2,0,1,0,83,0,113,52,124,7,2,0,1, + 0,83,0,113,52,100,1,83,0,41,4,122,21,70,105,110, + 100,32,97,32,109,111,100,117,108,101,39,115,32,115,112,101, + 99,46,78,122,53,115,121,115,46,109,101,116,97,95,112,97, + 116,104,32,105,115,32,78,111,110,101,44,32,80,121,116,104, + 111,110,32,105,115,32,108,105,107,101,108,121,32,115,104,117, + 116,116,105,110,103,32,100,111,119,110,122,22,115,121,115,46, + 109,101,116,97,95,112,97,116,104,32,105,115,32,101,109,112, + 116,121,41,12,114,14,0,0,0,218,9,109,101,116,97,95, + 112,97,116,104,114,70,0,0,0,218,9,95,119,97,114,110, + 105,110,103,115,218,4,119,97,114,110,218,13,73,109,112,111, + 114,116,87,97,114,110,105,110,103,114,79,0,0,0,114,151, + 0,0,0,114,140,0,0,0,114,90,0,0,0,114,159,0, + 0,0,114,89,0,0,0,41,10,114,15,0,0,0,114,138, + 0,0,0,114,139,0,0,0,114,160,0,0,0,90,9,105, + 115,95,114,101,108,111,97,100,114,158,0,0,0,114,140,0, + 0,0,114,82,0,0,0,114,83,0,0,0,114,89,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,22,4,0,0,115,38,0,0,0,0,7,10,1, - 10,1,8,1,18,1,22,2,2,0,2,254,6,3,4,1, - 8,1,6,2,6,2,2,0,2,254,6,3,8,1,8,1, - 14,1,114,191,0,0,0,114,10,0,0,0,99,5,0,0, - 0,0,0,0,0,9,0,0,0,5,0,0,0,67,0,0, - 0,115,180,0,0,0,124,4,100,1,107,2,114,18,116,0, - 124,0,131,1,125,5,110,36,124,1,100,2,107,9,114,30, - 124,1,110,2,105,0,125,6,116,1,124,6,131,1,125,7, - 116,0,124,0,124,7,124,4,131,3,125,5,124,3,115,150, - 124,4,100,1,107,2,114,84,116,0,124,0,160,2,100,3, - 161,1,100,1,25,0,131,1,83,0,124,0,115,92,124,5, - 83,0,116,3,124,0,131,1,116,3,124,0,160,2,100,3, - 161,1,100,1,25,0,131,1,24,0,125,8,116,4,106,5, - 124,5,106,6,100,2,116,3,124,5,106,6,131,1,124,8, - 24,0,133,2,25,0,25,0,83,0,110,26,116,7,124,5, - 100,4,131,2,114,172,116,8,124,5,124,3,116,0,131,3, - 83,0,124,5,83,0,100,2,83,0,41,5,97,215,1,0, - 0,73,109,112,111,114,116,32,97,32,109,111,100,117,108,101, - 46,10,10,32,32,32,32,84,104,101,32,39,103,108,111,98, - 97,108,115,39,32,97,114,103,117,109,101,110,116,32,105,115, - 32,117,115,101,100,32,116,111,32,105,110,102,101,114,32,119, - 104,101,114,101,32,116,104,101,32,105,109,112,111,114,116,32, - 105,115,32,111,99,99,117,114,114,105,110,103,32,102,114,111, - 109,10,32,32,32,32,116,111,32,104,97,110,100,108,101,32, - 114,101,108,97,116,105,118,101,32,105,109,112,111,114,116,115, - 46,32,84,104,101,32,39,108,111,99,97,108,115,39,32,97, - 114,103,117,109,101,110,116,32,105,115,32,105,103,110,111,114, - 101,100,46,32,84,104,101,10,32,32,32,32,39,102,114,111, - 109,108,105,115,116,39,32,97,114,103,117,109,101,110,116,32, - 115,112,101,99,105,102,105,101,115,32,119,104,97,116,32,115, - 104,111,117,108,100,32,101,120,105,115,116,32,97,115,32,97, - 116,116,114,105,98,117,116,101,115,32,111,110,32,116,104,101, - 32,109,111,100,117,108,101,10,32,32,32,32,98,101,105,110, - 103,32,105,109,112,111,114,116,101,100,32,40,101,46,103,46, - 32,96,96,102,114,111,109,32,109,111,100,117,108,101,32,105, - 109,112,111,114,116,32,60,102,114,111,109,108,105,115,116,62, - 96,96,41,46,32,32,84,104,101,32,39,108,101,118,101,108, - 39,10,32,32,32,32,97,114,103,117,109,101,110,116,32,114, - 101,112,114,101,115,101,110,116,115,32,116,104,101,32,112,97, - 99,107,97,103,101,32,108,111,99,97,116,105,111,110,32,116, - 111,32,105,109,112,111,114,116,32,102,114,111,109,32,105,110, - 32,97,32,114,101,108,97,116,105,118,101,10,32,32,32,32, - 105,109,112,111,114,116,32,40,101,46,103,46,32,96,96,102, - 114,111,109,32,46,46,112,107,103,32,105,109,112,111,114,116, - 32,109,111,100,96,96,32,119,111,117,108,100,32,104,97,118, - 101,32,97,32,39,108,101,118,101,108,39,32,111,102,32,50, - 41,46,10,10,32,32,32,32,114,19,0,0,0,78,114,117, - 0,0,0,114,127,0,0,0,41,9,114,181,0,0,0,114, - 191,0,0,0,218,9,112,97,114,116,105,116,105,111,110,114, - 158,0,0,0,114,14,0,0,0,114,79,0,0,0,114,1, - 0,0,0,114,4,0,0,0,114,185,0,0,0,41,9,114, - 15,0,0,0,114,190,0,0,0,218,6,108,111,99,97,108, - 115,114,186,0,0,0,114,161,0,0,0,114,83,0,0,0, - 90,8,103,108,111,98,97,108,115,95,114,160,0,0,0,90, - 7,99,117,116,95,111,102,102,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,10,95,95,105,109,112,111,114, - 116,95,95,49,4,0,0,115,30,0,0,0,0,11,8,1, - 10,2,16,1,8,1,12,1,4,3,8,1,18,1,4,1, - 4,4,26,3,32,1,10,1,12,2,114,194,0,0,0,99, - 1,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,160,1,124,0,161, - 1,125,1,124,1,100,0,107,8,114,30,116,2,100,1,124, - 0,23,0,131,1,130,1,116,3,124,1,131,1,83,0,41, - 2,78,122,25,110,111,32,98,117,105,108,116,45,105,110,32, - 109,111,100,117,108,101,32,110,97,109,101,100,32,41,4,114, - 141,0,0,0,114,145,0,0,0,114,70,0,0,0,114,140, - 0,0,0,41,2,114,15,0,0,0,114,82,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,18, - 95,98,117,105,108,116,105,110,95,102,114,111,109,95,110,97, - 109,101,86,4,0,0,115,8,0,0,0,0,1,10,1,8, - 1,12,1,114,195,0,0,0,99,2,0,0,0,0,0,0, - 0,10,0,0,0,5,0,0,0,67,0,0,0,115,166,0, - 0,0,124,1,97,0,124,0,97,1,116,2,116,1,131,1, - 125,2,116,1,106,3,160,4,161,0,68,0,93,72,92,2, - 125,3,125,4,116,5,124,4,124,2,131,2,114,26,124,3, - 116,1,106,6,107,6,114,60,116,7,125,5,110,18,116,0, - 160,8,124,3,161,1,114,26,116,9,125,5,110,2,113,26, - 116,10,124,4,124,5,131,2,125,6,116,11,124,6,124,4, - 131,2,1,0,113,26,116,1,106,3,116,12,25,0,125,7, - 100,1,68,0,93,46,125,8,124,8,116,1,106,3,107,7, - 114,138,116,13,124,8,131,1,125,9,110,10,116,1,106,3, - 124,8,25,0,125,9,116,14,124,7,124,8,124,9,131,3, - 1,0,113,114,100,2,83,0,41,3,122,250,83,101,116,117, - 112,32,105,109,112,111,114,116,108,105,98,32,98,121,32,105, - 109,112,111,114,116,105,110,103,32,110,101,101,100,101,100,32, - 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,115, - 32,97,110,100,32,105,110,106,101,99,116,105,110,103,32,116, - 104,101,109,10,32,32,32,32,105,110,116,111,32,116,104,101, - 32,103,108,111,98,97,108,32,110,97,109,101,115,112,97,99, - 101,46,10,10,32,32,32,32,65,115,32,115,121,115,32,105, - 115,32,110,101,101,100,101,100,32,102,111,114,32,115,121,115, - 46,109,111,100,117,108,101,115,32,97,99,99,101,115,115,32, - 97,110,100,32,95,105,109,112,32,105,115,32,110,101,101,100, - 101,100,32,116,111,32,108,111,97,100,32,98,117,105,108,116, - 45,105,110,10,32,32,32,32,109,111,100,117,108,101,115,44, - 32,116,104,111,115,101,32,116,119,111,32,109,111,100,117,108, - 101,115,32,109,117,115,116,32,98,101,32,101,120,112,108,105, - 99,105,116,108,121,32,112,97,115,115,101,100,32,105,110,46, - 10,10,32,32,32,32,41,3,114,20,0,0,0,114,166,0, - 0,0,114,56,0,0,0,78,41,15,114,49,0,0,0,114, - 14,0,0,0,114,13,0,0,0,114,79,0,0,0,218,5, - 105,116,101,109,115,114,170,0,0,0,114,69,0,0,0,114, - 141,0,0,0,114,75,0,0,0,114,151,0,0,0,114,128, - 0,0,0,114,133,0,0,0,114,1,0,0,0,114,195,0, - 0,0,114,5,0,0,0,41,10,218,10,115,121,115,95,109, - 111,100,117,108,101,218,11,95,105,109,112,95,109,111,100,117, - 108,101,90,11,109,111,100,117,108,101,95,116,121,112,101,114, - 15,0,0,0,114,83,0,0,0,114,93,0,0,0,114,82, - 0,0,0,90,11,115,101,108,102,95,109,111,100,117,108,101, - 90,12,98,117,105,108,116,105,110,95,110,97,109,101,90,14, - 98,117,105,108,116,105,110,95,109,111,100,117,108,101,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,6,95, - 115,101,116,117,112,93,4,0,0,115,36,0,0,0,0,9, - 4,1,4,3,8,1,18,1,10,1,10,1,6,1,10,1, - 6,2,2,1,10,1,12,3,10,1,8,1,10,1,10,2, - 10,1,114,199,0,0,0,99,2,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0, - 0,116,0,124,0,124,1,131,2,1,0,116,1,106,2,160, - 3,116,4,161,1,1,0,116,1,106,2,160,3,116,5,161, - 1,1,0,100,1,83,0,41,2,122,48,73,110,115,116,97, - 108,108,32,105,109,112,111,114,116,101,114,115,32,102,111,114, - 32,98,117,105,108,116,105,110,32,97,110,100,32,102,114,111, - 122,101,110,32,109,111,100,117,108,101,115,78,41,6,114,199, - 0,0,0,114,14,0,0,0,114,165,0,0,0,114,109,0, - 0,0,114,141,0,0,0,114,151,0,0,0,41,2,114,197, - 0,0,0,114,198,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,8,95,105,110,115,116,97,108, - 108,128,4,0,0,115,6,0,0,0,0,2,10,2,12,1, - 114,200,0,0,0,99,0,0,0,0,0,0,0,0,1,0, - 0,0,4,0,0,0,67,0,0,0,115,32,0,0,0,100, - 1,100,2,108,0,125,0,124,0,97,1,124,0,160,2,116, - 3,106,4,116,5,25,0,161,1,1,0,100,2,83,0,41, - 3,122,57,73,110,115,116,97,108,108,32,105,109,112,111,114, - 116,101,114,115,32,116,104,97,116,32,114,101,113,117,105,114, - 101,32,101,120,116,101,114,110,97,108,32,102,105,108,101,115, - 121,115,116,101,109,32,97,99,99,101,115,115,114,19,0,0, - 0,78,41,6,218,26,95,102,114,111,122,101,110,95,105,109, - 112,111,114,116,108,105,98,95,101,120,116,101,114,110,97,108, - 114,115,0,0,0,114,200,0,0,0,114,14,0,0,0,114, - 79,0,0,0,114,1,0,0,0,41,1,114,201,0,0,0, + 218,10,95,102,105,110,100,95,115,112,101,99,120,3,0,0, + 115,54,0,0,0,0,2,6,1,8,2,8,3,4,1,12, + 5,10,1,8,1,8,1,2,1,10,1,14,1,12,1,8, + 1,20,2,22,1,8,2,18,1,10,1,2,1,10,1,14, + 4,14,2,8,1,8,2,10,2,10,2,114,164,0,0,0, + 99,3,0,0,0,0,0,0,0,3,0,0,0,5,0,0, + 0,67,0,0,0,115,108,0,0,0,116,0,124,0,116,1, + 131,2,115,28,116,2,100,1,160,3,116,4,124,0,131,1, + 161,1,131,1,130,1,124,2,100,2,107,0,114,44,116,5, + 100,3,131,1,130,1,124,2,100,2,107,4,114,84,116,0, + 124,1,116,1,131,2,115,72,116,2,100,4,131,1,130,1, + 110,12,124,1,115,84,116,6,100,5,131,1,130,1,124,0, + 115,104,124,2,100,2,107,2,114,104,116,5,100,6,131,1, + 130,1,100,7,83,0,41,8,122,28,86,101,114,105,102,121, + 32,97,114,103,117,109,101,110,116,115,32,97,114,101,32,34, + 115,97,110,101,34,46,122,31,109,111,100,117,108,101,32,110, + 97,109,101,32,109,117,115,116,32,98,101,32,115,116,114,44, + 32,110,111,116,32,123,125,114,19,0,0,0,122,18,108,101, + 118,101,108,32,109,117,115,116,32,98,101,32,62,61,32,48, + 122,31,95,95,112,97,99,107,97,103,101,95,95,32,110,111, + 116,32,115,101,116,32,116,111,32,97,32,115,116,114,105,110, + 103,122,54,97,116,116,101,109,112,116,101,100,32,114,101,108, + 97,116,105,118,101,32,105,109,112,111,114,116,32,119,105,116, + 104,32,110,111,32,107,110,111,119,110,32,112,97,114,101,110, + 116,32,112,97,99,107,97,103,101,122,17,69,109,112,116,121, + 32,109,111,100,117,108,101,32,110,97,109,101,78,41,7,218, + 10,105,115,105,110,115,116,97,110,99,101,218,3,115,116,114, + 218,9,84,121,112,101,69,114,114,111,114,114,38,0,0,0, + 114,13,0,0,0,114,154,0,0,0,114,70,0,0,0,41, + 3,114,15,0,0,0,114,155,0,0,0,114,156,0,0,0, 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 27,95,105,110,115,116,97,108,108,95,101,120,116,101,114,110, - 97,108,95,105,109,112,111,114,116,101,114,115,136,4,0,0, - 115,6,0,0,0,0,3,8,1,4,1,114,202,0,0,0, - 41,2,78,78,41,1,78,41,2,78,114,19,0,0,0,41, - 4,78,78,114,10,0,0,0,114,19,0,0,0,41,51,114, - 3,0,0,0,114,115,0,0,0,114,12,0,0,0,114,16, - 0,0,0,114,51,0,0,0,114,29,0,0,0,114,36,0, - 0,0,114,17,0,0,0,114,18,0,0,0,114,41,0,0, - 0,114,42,0,0,0,114,45,0,0,0,114,57,0,0,0, - 114,59,0,0,0,114,68,0,0,0,114,74,0,0,0,114, - 77,0,0,0,114,84,0,0,0,114,95,0,0,0,114,96, - 0,0,0,114,102,0,0,0,114,78,0,0,0,114,128,0, - 0,0,114,133,0,0,0,114,136,0,0,0,114,91,0,0, - 0,114,80,0,0,0,114,139,0,0,0,114,140,0,0,0, - 114,81,0,0,0,114,141,0,0,0,114,151,0,0,0,114, - 156,0,0,0,114,162,0,0,0,114,164,0,0,0,114,169, - 0,0,0,114,173,0,0,0,90,15,95,69,82,82,95,77, - 83,71,95,80,82,69,70,73,88,114,175,0,0,0,114,178, - 0,0,0,218,6,111,98,106,101,99,116,114,179,0,0,0, - 114,180,0,0,0,114,181,0,0,0,114,185,0,0,0,114, - 191,0,0,0,114,194,0,0,0,114,195,0,0,0,114,199, - 0,0,0,114,200,0,0,0,114,202,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,8,60,109,111,100,117,108,101,62,8,0,0,0,115, - 96,0,0,0,4,17,4,2,8,8,8,8,4,2,4,3, - 16,4,14,68,14,21,14,16,8,37,8,17,8,11,14,8, - 8,11,8,12,8,16,8,36,14,27,14,101,16,26,10,45, - 14,72,8,17,8,17,8,24,8,29,8,23,8,15,14,73, - 14,77,14,13,8,9,8,9,10,47,8,16,4,1,8,2, - 8,27,6,3,8,16,10,15,14,37,8,27,10,37,8,7, - 8,35,8,8, + 13,95,115,97,110,105,116,121,95,99,104,101,99,107,167,3, + 0,0,115,22,0,0,0,0,2,10,1,18,1,8,1,8, + 1,8,1,10,1,10,1,4,1,8,2,12,1,114,168,0, + 0,0,122,16,78,111,32,109,111,100,117,108,101,32,110,97, + 109,101,100,32,122,4,123,33,114,125,99,2,0,0,0,0, + 0,0,0,8,0,0,0,8,0,0,0,67,0,0,0,115, + 220,0,0,0,100,0,125,2,124,0,160,0,100,1,161,1, + 100,2,25,0,125,3,124,3,114,134,124,3,116,1,106,2, + 107,7,114,42,116,3,124,1,124,3,131,2,1,0,124,0, + 116,1,106,2,107,6,114,62,116,1,106,2,124,0,25,0, + 83,0,116,1,106,2,124,3,25,0,125,4,122,10,124,4, + 106,4,125,2,87,0,110,50,4,0,116,5,107,10,114,132, + 1,0,1,0,1,0,116,6,100,3,23,0,160,7,124,0, + 124,3,161,2,125,5,116,8,124,5,124,0,100,4,141,2, + 100,0,130,2,89,0,110,2,88,0,116,9,124,0,124,2, + 131,2,125,6,124,6,100,0,107,8,114,172,116,8,116,6, + 160,7,124,0,161,1,124,0,100,4,141,2,130,1,110,8, + 116,10,124,6,131,1,125,7,124,3,114,216,116,1,106,2, + 124,3,25,0,125,4,116,11,124,4,124,0,160,0,100,1, + 161,1,100,5,25,0,124,7,131,3,1,0,124,7,83,0, + 41,6,78,114,111,0,0,0,114,19,0,0,0,122,23,59, + 32,123,33,114,125,32,105,115,32,110,111,116,32,97,32,112, + 97,99,107,97,103,101,41,1,114,15,0,0,0,233,2,0, + 0,0,41,12,114,112,0,0,0,114,14,0,0,0,114,79, + 0,0,0,114,59,0,0,0,114,121,0,0,0,114,90,0, + 0,0,218,8,95,69,82,82,95,77,83,71,114,38,0,0, + 0,218,19,77,111,100,117,108,101,78,111,116,70,111,117,110, + 100,69,114,114,111,114,114,164,0,0,0,114,135,0,0,0, + 114,5,0,0,0,41,8,114,15,0,0,0,218,7,105,109, + 112,111,114,116,95,114,138,0,0,0,114,113,0,0,0,90, + 13,112,97,114,101,110,116,95,109,111,100,117,108,101,114,133, + 0,0,0,114,82,0,0,0,114,83,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,218,23,95,102, + 105,110,100,95,97,110,100,95,108,111,97,100,95,117,110,108, + 111,99,107,101,100,186,3,0,0,115,42,0,0,0,0,1, + 4,1,14,1,4,1,10,1,10,2,10,1,10,1,10,1, + 2,1,10,1,14,1,16,1,20,1,10,1,8,1,20,2, + 8,1,4,2,10,1,22,1,114,173,0,0,0,99,2,0, + 0,0,0,0,0,0,4,0,0,0,10,0,0,0,67,0, + 0,0,115,106,0,0,0,116,0,124,0,131,1,143,50,1, + 0,116,1,106,2,160,3,124,0,116,4,161,2,125,2,124, + 2,116,4,107,8,114,54,116,5,124,0,124,1,131,2,87, + 0,2,0,53,0,81,0,82,0,163,0,83,0,87,0,53, + 0,81,0,82,0,88,0,124,2,100,1,107,8,114,94,100, + 2,160,6,124,0,161,1,125,3,116,7,124,3,124,0,100, + 3,141,2,130,1,116,8,124,0,131,1,1,0,124,2,83, + 0,41,4,122,25,70,105,110,100,32,97,110,100,32,108,111, + 97,100,32,116,104,101,32,109,111,100,117,108,101,46,78,122, + 40,105,109,112,111,114,116,32,111,102,32,123,125,32,104,97, + 108,116,101,100,59,32,78,111,110,101,32,105,110,32,115,121, + 115,46,109,111,100,117,108,101,115,41,1,114,15,0,0,0, + 41,9,114,42,0,0,0,114,14,0,0,0,114,79,0,0, + 0,114,30,0,0,0,218,14,95,78,69,69,68,83,95,76, + 79,65,68,73,78,71,114,173,0,0,0,114,38,0,0,0, + 114,171,0,0,0,114,57,0,0,0,41,4,114,15,0,0, + 0,114,172,0,0,0,114,83,0,0,0,114,67,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, + 14,95,102,105,110,100,95,97,110,100,95,108,111,97,100,216, + 3,0,0,115,22,0,0,0,0,2,10,1,14,1,8,1, + 32,2,8,1,4,1,2,255,4,2,12,2,8,1,114,175, + 0,0,0,114,19,0,0,0,99,3,0,0,0,0,0,0, + 0,3,0,0,0,4,0,0,0,67,0,0,0,115,42,0, + 0,0,116,0,124,0,124,1,124,2,131,3,1,0,124,2, + 100,1,107,4,114,32,116,1,124,0,124,1,124,2,131,3, + 125,0,116,2,124,0,116,3,131,2,83,0,41,2,97,50, + 1,0,0,73,109,112,111,114,116,32,97,110,100,32,114,101, + 116,117,114,110,32,116,104,101,32,109,111,100,117,108,101,32, + 98,97,115,101,100,32,111,110,32,105,116,115,32,110,97,109, + 101,44,32,116,104,101,32,112,97,99,107,97,103,101,32,116, + 104,101,32,99,97,108,108,32,105,115,10,32,32,32,32,98, + 101,105,110,103,32,109,97,100,101,32,102,114,111,109,44,32, + 97,110,100,32,116,104,101,32,108,101,118,101,108,32,97,100, + 106,117,115,116,109,101,110,116,46,10,10,32,32,32,32,84, + 104,105,115,32,102,117,110,99,116,105,111,110,32,114,101,112, + 114,101,115,101,110,116,115,32,116,104,101,32,103,114,101,97, + 116,101,115,116,32,99,111,109,109,111,110,32,100,101,110,111, + 109,105,110,97,116,111,114,32,111,102,32,102,117,110,99,116, + 105,111,110,97,108,105,116,121,10,32,32,32,32,98,101,116, + 119,101,101,110,32,105,109,112,111,114,116,95,109,111,100,117, + 108,101,32,97,110,100,32,95,95,105,109,112,111,114,116,95, + 95,46,32,84,104,105,115,32,105,110,99,108,117,100,101,115, + 32,115,101,116,116,105,110,103,32,95,95,112,97,99,107,97, + 103,101,95,95,32,105,102,10,32,32,32,32,116,104,101,32, + 108,111,97,100,101,114,32,100,105,100,32,110,111,116,46,10, + 10,32,32,32,32,114,19,0,0,0,41,4,114,168,0,0, + 0,114,157,0,0,0,114,175,0,0,0,218,11,95,103,99, + 100,95,105,109,112,111,114,116,41,3,114,15,0,0,0,114, + 155,0,0,0,114,156,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,176,0,0,0,232,3,0, + 0,115,8,0,0,0,0,9,12,1,8,1,12,1,114,176, + 0,0,0,41,1,218,9,114,101,99,117,114,115,105,118,101, + 99,3,0,0,0,1,0,0,0,8,0,0,0,11,0,0, + 0,67,0,0,0,115,226,0,0,0,124,1,68,0,93,216, + 125,4,116,0,124,4,116,1,131,2,115,66,124,3,114,34, + 124,0,106,2,100,1,23,0,125,5,110,4,100,2,125,5, + 116,3,100,3,124,5,155,0,100,4,116,4,124,4,131,1, + 106,2,155,0,157,4,131,1,130,1,110,154,124,4,100,5, + 107,2,114,108,124,3,115,106,116,5,124,0,100,6,131,2, + 114,106,116,6,124,0,124,0,106,7,124,2,100,7,100,8, + 141,4,1,0,110,112,116,5,124,0,124,4,131,2,115,220, + 100,9,160,8,124,0,106,2,124,4,161,2,125,6,122,14, + 116,9,124,2,124,6,131,2,1,0,87,0,110,72,4,0, + 116,10,107,10,114,218,1,0,125,7,1,0,122,42,124,7, + 106,11,124,6,107,2,114,200,116,12,106,13,160,14,124,6, + 116,15,161,2,100,10,107,9,114,200,87,0,89,0,162,8, + 113,4,130,0,87,0,53,0,100,10,125,7,126,7,88,0, + 89,0,110,2,88,0,113,4,124,0,83,0,41,11,122,238, + 70,105,103,117,114,101,32,111,117,116,32,119,104,97,116,32, + 95,95,105,109,112,111,114,116,95,95,32,115,104,111,117,108, + 100,32,114,101,116,117,114,110,46,10,10,32,32,32,32,84, + 104,101,32,105,109,112,111,114,116,95,32,112,97,114,97,109, + 101,116,101,114,32,105,115,32,97,32,99,97,108,108,97,98, + 108,101,32,119,104,105,99,104,32,116,97,107,101,115,32,116, + 104,101,32,110,97,109,101,32,111,102,32,109,111,100,117,108, + 101,32,116,111,10,32,32,32,32,105,109,112,111,114,116,46, + 32,73,116,32,105,115,32,114,101,113,117,105,114,101,100,32, + 116,111,32,100,101,99,111,117,112,108,101,32,116,104,101,32, + 102,117,110,99,116,105,111,110,32,102,114,111,109,32,97,115, + 115,117,109,105,110,103,32,105,109,112,111,114,116,108,105,98, + 39,115,10,32,32,32,32,105,109,112,111,114,116,32,105,109, + 112,108,101,109,101,110,116,97,116,105,111,110,32,105,115,32, + 100,101,115,105,114,101,100,46,10,10,32,32,32,32,122,8, + 46,95,95,97,108,108,95,95,122,13,96,96,102,114,111,109, + 32,108,105,115,116,39,39,122,8,73,116,101,109,32,105,110, + 32,122,18,32,109,117,115,116,32,98,101,32,115,116,114,44, + 32,110,111,116,32,250,1,42,218,7,95,95,97,108,108,95, + 95,84,41,1,114,177,0,0,0,122,5,123,125,46,123,125, + 78,41,16,114,165,0,0,0,114,166,0,0,0,114,1,0, + 0,0,114,167,0,0,0,114,13,0,0,0,114,4,0,0, + 0,218,16,95,104,97,110,100,108,101,95,102,114,111,109,108, + 105,115,116,114,179,0,0,0,114,38,0,0,0,114,59,0, + 0,0,114,171,0,0,0,114,15,0,0,0,114,14,0,0, + 0,114,79,0,0,0,114,30,0,0,0,114,174,0,0,0, + 41,8,114,83,0,0,0,218,8,102,114,111,109,108,105,115, + 116,114,172,0,0,0,114,177,0,0,0,218,1,120,90,5, + 119,104,101,114,101,90,9,102,114,111,109,95,110,97,109,101, + 90,3,101,120,99,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,180,0,0,0,247,3,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,16,4,10,1,16,255,2,2,8,1,22,1,114,180, + 0,0,0,99,1,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,107,9,114,82,124,2,100,3,107,9,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,107,9,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,107,7,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,124,0,0,0,114, + 89,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,121,0,0,0,114,111,0,0,0,114,19,0, + 0,0,41,6,114,30,0,0,0,114,113,0,0,0,114,161, + 0,0,0,114,162,0,0,0,114,163,0,0,0,114,112,0, + 0,0,41,3,218,7,103,108,111,98,97,108,115,114,155,0, + 0,0,114,82,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,28,4,0,0,115,38,0, + 0,0,0,7,10,1,10,1,8,1,18,1,22,2,2,0, + 2,254,6,3,4,1,8,1,6,2,6,2,2,0,2,254, + 6,3,8,1,8,1,14,1,114,186,0,0,0,114,10,0, + 0,0,99,5,0,0,0,0,0,0,0,9,0,0,0,5, + 0,0,0,67,0,0,0,115,180,0,0,0,124,4,100,1, + 107,2,114,18,116,0,124,0,131,1,125,5,110,36,124,1, + 100,2,107,9,114,30,124,1,110,2,105,0,125,6,116,1, + 124,6,131,1,125,7,116,0,124,0,124,7,124,4,131,3, + 125,5,124,3,115,150,124,4,100,1,107,2,114,84,116,0, + 124,0,160,2,100,3,161,1,100,1,25,0,131,1,83,0, + 124,0,115,92,124,5,83,0,116,3,124,0,131,1,116,3, + 124,0,160,2,100,3,161,1,100,1,25,0,131,1,24,0, + 125,8,116,4,106,5,124,5,106,6,100,2,116,3,124,5, + 106,6,131,1,124,8,24,0,133,2,25,0,25,0,83,0, + 110,26,116,7,124,5,100,4,131,2,114,172,116,8,124,5, + 124,3,116,0,131,3,83,0,124,5,83,0,100,2,83,0, + 41,5,97,215,1,0,0,73,109,112,111,114,116,32,97,32, + 109,111,100,117,108,101,46,10,10,32,32,32,32,84,104,101, + 32,39,103,108,111,98,97,108,115,39,32,97,114,103,117,109, + 101,110,116,32,105,115,32,117,115,101,100,32,116,111,32,105, + 110,102,101,114,32,119,104,101,114,101,32,116,104,101,32,105, + 109,112,111,114,116,32,105,115,32,111,99,99,117,114,114,105, + 110,103,32,102,114,111,109,10,32,32,32,32,116,111,32,104, + 97,110,100,108,101,32,114,101,108,97,116,105,118,101,32,105, + 109,112,111,114,116,115,46,32,84,104,101,32,39,108,111,99, + 97,108,115,39,32,97,114,103,117,109,101,110,116,32,105,115, + 32,105,103,110,111,114,101,100,46,32,84,104,101,10,32,32, + 32,32,39,102,114,111,109,108,105,115,116,39,32,97,114,103, + 117,109,101,110,116,32,115,112,101,99,105,102,105,101,115,32, + 119,104,97,116,32,115,104,111,117,108,100,32,101,120,105,115, + 116,32,97,115,32,97,116,116,114,105,98,117,116,101,115,32, + 111,110,32,116,104,101,32,109,111,100,117,108,101,10,32,32, + 32,32,98,101,105,110,103,32,105,109,112,111,114,116,101,100, + 32,40,101,46,103,46,32,96,96,102,114,111,109,32,109,111, + 100,117,108,101,32,105,109,112,111,114,116,32,60,102,114,111, + 109,108,105,115,116,62,96,96,41,46,32,32,84,104,101,32, + 39,108,101,118,101,108,39,10,32,32,32,32,97,114,103,117, + 109,101,110,116,32,114,101,112,114,101,115,101,110,116,115,32, + 116,104,101,32,112,97,99,107,97,103,101,32,108,111,99,97, + 116,105,111,110,32,116,111,32,105,109,112,111,114,116,32,102, + 114,111,109,32,105,110,32,97,32,114,101,108,97,116,105,118, + 101,10,32,32,32,32,105,109,112,111,114,116,32,40,101,46, + 103,46,32,96,96,102,114,111,109,32,46,46,112,107,103,32, + 105,109,112,111,114,116,32,109,111,100,96,96,32,119,111,117, + 108,100,32,104,97,118,101,32,97,32,39,108,101,118,101,108, + 39,32,111,102,32,50,41,46,10,10,32,32,32,32,114,19, + 0,0,0,78,114,111,0,0,0,114,121,0,0,0,41,9, + 114,176,0,0,0,114,186,0,0,0,218,9,112,97,114,116, + 105,116,105,111,110,114,153,0,0,0,114,14,0,0,0,114, + 79,0,0,0,114,1,0,0,0,114,4,0,0,0,114,180, + 0,0,0,41,9,114,15,0,0,0,114,185,0,0,0,218, + 6,108,111,99,97,108,115,114,181,0,0,0,114,156,0,0, + 0,114,83,0,0,0,90,8,103,108,111,98,97,108,115,95, + 114,155,0,0,0,90,7,99,117,116,95,111,102,102,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,10,95, + 95,105,109,112,111,114,116,95,95,55,4,0,0,115,30,0, + 0,0,0,11,8,1,10,2,16,1,8,1,12,1,4,3, + 8,1,18,1,4,1,4,4,26,3,32,1,10,1,12,2, + 114,189,0,0,0,99,1,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,38,0,0,0,116, + 0,160,1,124,0,161,1,125,1,124,1,100,0,107,8,114, + 30,116,2,100,1,124,0,23,0,131,1,130,1,116,3,124, + 1,131,1,83,0,41,2,78,122,25,110,111,32,98,117,105, + 108,116,45,105,110,32,109,111,100,117,108,101,32,110,97,109, + 101,100,32,41,4,114,136,0,0,0,114,140,0,0,0,114, + 70,0,0,0,114,135,0,0,0,41,2,114,15,0,0,0, + 114,82,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,18,95,98,117,105,108,116,105,110,95,102, + 114,111,109,95,110,97,109,101,92,4,0,0,115,8,0,0, + 0,0,1,10,1,8,1,12,1,114,190,0,0,0,99,2, + 0,0,0,0,0,0,0,10,0,0,0,5,0,0,0,67, + 0,0,0,115,166,0,0,0,124,1,97,0,124,0,97,1, + 116,2,116,1,131,1,125,2,116,1,106,3,160,4,161,0, + 68,0,93,72,92,2,125,3,125,4,116,5,124,4,124,2, + 131,2,114,26,124,3,116,1,106,6,107,6,114,60,116,7, + 125,5,110,18,116,0,160,8,124,3,161,1,114,26,116,9, + 125,5,110,2,113,26,116,10,124,4,124,5,131,2,125,6, + 116,11,124,6,124,4,131,2,1,0,113,26,116,1,106,3, + 116,12,25,0,125,7,100,1,68,0,93,46,125,8,124,8, + 116,1,106,3,107,7,114,138,116,13,124,8,131,1,125,9, + 110,10,116,1,106,3,124,8,25,0,125,9,116,14,124,7, + 124,8,124,9,131,3,1,0,113,114,100,2,83,0,41,3, + 122,250,83,101,116,117,112,32,105,109,112,111,114,116,108,105, + 98,32,98,121,32,105,109,112,111,114,116,105,110,103,32,110, + 101,101,100,101,100,32,98,117,105,108,116,45,105,110,32,109, + 111,100,117,108,101,115,32,97,110,100,32,105,110,106,101,99, + 116,105,110,103,32,116,104,101,109,10,32,32,32,32,105,110, + 116,111,32,116,104,101,32,103,108,111,98,97,108,32,110,97, + 109,101,115,112,97,99,101,46,10,10,32,32,32,32,65,115, + 32,115,121,115,32,105,115,32,110,101,101,100,101,100,32,102, + 111,114,32,115,121,115,46,109,111,100,117,108,101,115,32,97, + 99,99,101,115,115,32,97,110,100,32,95,105,109,112,32,105, + 115,32,110,101,101,100,101,100,32,116,111,32,108,111,97,100, + 32,98,117,105,108,116,45,105,110,10,32,32,32,32,109,111, + 100,117,108,101,115,44,32,116,104,111,115,101,32,116,119,111, + 32,109,111,100,117,108,101,115,32,109,117,115,116,32,98,101, + 32,101,120,112,108,105,99,105,116,108,121,32,112,97,115,115, + 101,100,32,105,110,46,10,10,32,32,32,32,41,3,114,20, + 0,0,0,114,161,0,0,0,114,56,0,0,0,78,41,15, + 114,49,0,0,0,114,14,0,0,0,114,13,0,0,0,114, + 79,0,0,0,218,5,105,116,101,109,115,114,165,0,0,0, + 114,69,0,0,0,114,136,0,0,0,114,75,0,0,0,114, + 146,0,0,0,114,122,0,0,0,114,127,0,0,0,114,1, + 0,0,0,114,190,0,0,0,114,5,0,0,0,41,10,218, + 10,115,121,115,95,109,111,100,117,108,101,218,11,95,105,109, + 112,95,109,111,100,117,108,101,90,11,109,111,100,117,108,101, + 95,116,121,112,101,114,15,0,0,0,114,83,0,0,0,114, + 93,0,0,0,114,82,0,0,0,90,11,115,101,108,102,95, + 109,111,100,117,108,101,90,12,98,117,105,108,116,105,110,95, + 110,97,109,101,90,14,98,117,105,108,116,105,110,95,109,111, + 100,117,108,101,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,6,95,115,101,116,117,112,99,4,0,0,115, + 36,0,0,0,0,9,4,1,4,3,8,1,18,1,10,1, + 10,1,6,1,10,1,6,2,2,1,10,1,12,3,10,1, + 8,1,10,1,10,2,10,1,114,194,0,0,0,99,2,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,38,0,0,0,116,0,124,0,124,1,131,2,1, + 0,116,1,106,2,160,3,116,4,161,1,1,0,116,1,106, + 2,160,3,116,5,161,1,1,0,100,1,83,0,41,2,122, + 48,73,110,115,116,97,108,108,32,105,109,112,111,114,116,101, + 114,115,32,102,111,114,32,98,117,105,108,116,105,110,32,97, + 110,100,32,102,114,111,122,101,110,32,109,111,100,117,108,101, + 115,78,41,6,114,194,0,0,0,114,14,0,0,0,114,160, + 0,0,0,114,103,0,0,0,114,136,0,0,0,114,146,0, + 0,0,41,2,114,192,0,0,0,114,193,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,95, + 105,110,115,116,97,108,108,134,4,0,0,115,6,0,0,0, + 0,2,10,2,12,1,114,195,0,0,0,99,0,0,0,0, + 0,0,0,0,1,0,0,0,4,0,0,0,67,0,0,0, + 115,32,0,0,0,100,1,100,2,108,0,125,0,124,0,97, + 1,124,0,160,2,116,3,106,4,116,5,25,0,161,1,1, + 0,100,2,83,0,41,3,122,57,73,110,115,116,97,108,108, + 32,105,109,112,111,114,116,101,114,115,32,116,104,97,116,32, + 114,101,113,117,105,114,101,32,101,120,116,101,114,110,97,108, + 32,102,105,108,101,115,121,115,116,101,109,32,97,99,99,101, + 115,115,114,19,0,0,0,78,41,6,218,26,95,102,114,111, + 122,101,110,95,105,109,112,111,114,116,108,105,98,95,101,120, + 116,101,114,110,97,108,114,109,0,0,0,114,195,0,0,0, + 114,14,0,0,0,114,79,0,0,0,114,1,0,0,0,41, + 1,114,196,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,27,95,105,110,115,116,97,108,108,95, + 101,120,116,101,114,110,97,108,95,105,109,112,111,114,116,101, + 114,115,142,4,0,0,115,6,0,0,0,0,3,8,1,4, + 1,114,197,0,0,0,41,2,78,78,41,1,78,41,2,78, + 114,19,0,0,0,41,4,78,78,114,10,0,0,0,114,19, + 0,0,0,41,50,114,3,0,0,0,114,109,0,0,0,114, + 12,0,0,0,114,16,0,0,0,114,51,0,0,0,114,29, + 0,0,0,114,36,0,0,0,114,17,0,0,0,114,18,0, + 0,0,114,41,0,0,0,114,42,0,0,0,114,45,0,0, + 0,114,57,0,0,0,114,59,0,0,0,114,68,0,0,0, + 114,74,0,0,0,114,77,0,0,0,114,84,0,0,0,114, + 95,0,0,0,114,96,0,0,0,114,78,0,0,0,114,122, + 0,0,0,114,127,0,0,0,114,130,0,0,0,114,91,0, + 0,0,114,80,0,0,0,114,134,0,0,0,114,135,0,0, + 0,114,81,0,0,0,114,136,0,0,0,114,146,0,0,0, + 114,151,0,0,0,114,157,0,0,0,114,159,0,0,0,114, + 164,0,0,0,114,168,0,0,0,90,15,95,69,82,82,95, + 77,83,71,95,80,82,69,70,73,88,114,170,0,0,0,114, + 173,0,0,0,218,6,111,98,106,101,99,116,114,174,0,0, + 0,114,175,0,0,0,114,176,0,0,0,114,180,0,0,0, + 114,186,0,0,0,114,189,0,0,0,114,190,0,0,0,114, + 194,0,0,0,114,195,0,0,0,114,197,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,8,60,109,111,100,117,108,101,62,8,0,0,0, + 115,94,0,0,0,4,17,4,2,8,8,8,8,4,2,4, + 3,16,4,14,68,14,21,14,16,8,37,8,17,8,11,14, + 8,8,11,8,12,8,16,8,36,14,101,16,26,10,45,14, + 72,8,17,8,17,8,30,8,37,8,42,8,15,14,73,14, + 77,14,13,8,9,8,9,10,47,8,16,4,1,8,2,8, + 27,6,3,8,16,10,15,14,37,8,27,10,37,8,7,8, + 35,8,8, }; From webhook-mailer at python.org Mon Oct 29 13:31:10 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 29 Oct 2018 17:31:10 -0000 Subject: [Python-checkins] bpo-34160: Preserve user specified order of Element attributes in html. (GH-10190) Message-ID: https://github.com/python/cpython/commit/3b05ad7be09af1d4510eb698b0a70d36387f296e commit: 3b05ad7be09af1d4510eb698b0a70d36387f296e branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-29T19:31:04+02:00 summary: bpo-34160: Preserve user specified order of Element attributes in html. (GH-10190) files: M Lib/test/test_xml_etree.py M Lib/xml/etree/ElementTree.py diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 9988dad86384..8a7ec0076ff0 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -5,7 +5,6 @@ # For this purpose, the module-level "ET" symbol is temporarily # monkey-patched when running the "test_xml_etree_c" test suite. -import contextlib import copy import functools import html @@ -1056,13 +1055,10 @@ def test_dump_attribute_order(self): def test_tree_write_attribute_order(self): # See BPO 34160 root = ET.Element('cirriculum', status='public', company='example') - tree = ET.ElementTree(root) - f = io.BytesIO() - with contextlib.redirect_stdout(f): - tree.write(f, encoding='utf-8', xml_declaration=True) - self.assertEqual(f.getvalue(), - b"\n" - b'') + self.assertEqual(serialize(root), + '') + self.assertEqual(serialize(root, method='html'), + '') class XMLPullParserTest(unittest.TestCase): diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index d4df83fb51cc..c1cf483cf56b 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -979,7 +979,7 @@ def _serialize_html(write, elem, qnames, namespaces, **kwargs): k, _escape_attrib(v) )) - for k, v in sorted(items): # lexical order + for k, v in items: if isinstance(k, QName): k = k.text if isinstance(v, QName): From webhook-mailer at python.org Mon Oct 29 14:30:18 2018 From: webhook-mailer at python.org (Brian Curtin) Date: Mon, 29 Oct 2018 18:30:18 -0000 Subject: [Python-checkins] Include memo in the documented signature of copy.deepcopy() Message-ID: https://github.com/python/cpython/commit/0200928e8df012d408530b06a98119024bc82511 commit: 0200928e8df012d408530b06a98119024bc82511 branch: master author: Stephan Hoyer committer: Brian Curtin date: 2018-10-29T12:30:12-06:00 summary: Include memo in the documented signature of copy.deepcopy() * Include memo in the documented signature of copy.deepcopy() The memo argument is mentioned lower on the doc page under writing a `__deepcopy__` method, but is not included in the documented function signature. This makes it easy to miss, and can lead to incorrect/buggy implementations of `__deepcopy__` -- which is exatly what just happpend to me! files: M Doc/library/copy.rst diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index 2041d9175ea5..c7bd89f96372 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -22,7 +22,7 @@ Interface summary: Return a shallow copy of *x*. -.. function:: deepcopy(x) +.. function:: deepcopy(x[, memo]) Return a deep copy of *x*. @@ -52,7 +52,7 @@ copy operations: The :func:`deepcopy` function avoids these problems by: -* keeping a "memo" dictionary of objects already copied during the current +* keeping a ``memo`` dictionary of objects already copied during the current copying pass; and * letting user-defined classes override the copying operation or the set of @@ -82,7 +82,7 @@ In order for a class to define its own copy implementation, it can define special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is called to implement the shallow copy operation; no additional arguments are passed. The latter is called to implement the deep copy operation; it is passed one -argument, the memo dictionary. If the :meth:`__deepcopy__` implementation needs +argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs to make a deep copy of a component, it should call the :func:`deepcopy` function with the component as first argument and the memo dictionary as second argument. From webhook-mailer at python.org Mon Oct 29 15:52:46 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 29 Oct 2018 19:52:46 -0000 Subject: [Python-checkins] bpo-35059: Convert Py_XINCREF() to static inline function (GH-10224) Message-ID: https://github.com/python/cpython/commit/541497e6197268517b0d492856027774c43e0949 commit: 541497e6197268517b0d492856027774c43e0949 branch: master author: Victor Stinner committer: GitHub date: 2018-10-29T20:52:41+01:00 summary: bpo-35059: Convert Py_XINCREF() to static inline function (GH-10224) Convert Py_XINCREF() and Py_XDECREF() macros into static inline functions. files: M Include/object.h diff --git a/Include/object.h b/Include/object.h index f9c07f7d1398..799c40b2caf0 100644 --- a/Include/object.h +++ b/Include/object.h @@ -871,20 +871,24 @@ static inline void _Py_DECREF(const char *filename, int lineno, } \ } while (0) -/* Macros to use in case the object pointer may be NULL: */ -#define Py_XINCREF(op) \ - do { \ - PyObject *_py_xincref_tmp = (PyObject *)(op); \ - if (_py_xincref_tmp != NULL) \ - Py_INCREF(_py_xincref_tmp); \ - } while (0) +/* Function to use in case the object pointer can be NULL: */ +static inline void _Py_XINCREF(PyObject *op) +{ + if (op != NULL) { + Py_INCREF(op); + } +} -#define Py_XDECREF(op) \ - do { \ - PyObject *_py_xdecref_tmp = (PyObject *)(op); \ - if (_py_xdecref_tmp != NULL) \ - Py_DECREF(_py_xdecref_tmp); \ - } while (0) +#define Py_XINCREF(op) _Py_XINCREF((PyObject *)(op)) + +static inline void _Py_XDECREF(PyObject *op) +{ + if (op != NULL) { + Py_DECREF(op); + } +} + +#define Py_XDECREF(op) _Py_XDECREF((PyObject *)(op)) #ifndef Py_LIMITED_API /* Safely decref `op` and set `op` to `op2`. From webhook-mailer at python.org Mon Oct 29 16:09:44 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 29 Oct 2018 20:09:44 -0000 Subject: [Python-checkins] bpo-34945: Buffer output in test suite only when creating junit file (GH-10204) Message-ID: https://github.com/python/cpython/commit/02277482ea765335e497ecd9661d4bde9b5ddc67 commit: 02277482ea765335e497ecd9661d4bde9b5ddc67 branch: master author: Pablo Galindo committer: GitHub date: 2018-10-29T16:09:41-04:00 summary: bpo-34945: Buffer output in test suite only when creating junit file (GH-10204) After commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed, the output of the test suite is always buffered as the test output needs to be included in the JUnit file in same cases (as when a test fails). This has the consequence that printing or using debuggers (like pdb) in the test suite does not result in a good user experience anymore. This commit modifies the test suite runner so it only captures the test output when the JUnit file is requested to fix the regression so prints and debuggers are usable again. files: M Lib/test/support/__init__.py M Lib/test/support/testresult.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 01e8935cc8d7..f7a60d4bf2a3 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1921,10 +1921,9 @@ def _filter_suite(suite, pred): def _run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" - runner = get_test_runner(sys.stdout, verbosity=verbose) - - # TODO: Remove this before merging (here for easy comparison with old impl) - #runner = unittest.TextTestRunner(sys.stdout, verbosity=2, failfast=failfast) + runner = get_test_runner(sys.stdout, + verbosity=verbose, + capture_output=(junit_xml_list is not None)) result = runner.run(suite) diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index 8988d3d15278..67e126dcf752 100644 --- a/Lib/test/support/testresult.py +++ b/Lib/test/support/testresult.py @@ -60,10 +60,12 @@ def _add_result(self, test, capture=False, **args): e.set('time', f'{time.perf_counter() - self.__start_time:0.6f}') if capture: - stdout = self._stdout_buffer.getvalue().rstrip() - ET.SubElement(e, 'system-out').text = stdout - stderr = self._stderr_buffer.getvalue().rstrip() - ET.SubElement(e, 'system-err').text = stderr + if self._stdout_buffer is not None: + stdout = self._stdout_buffer.getvalue().rstrip() + ET.SubElement(e, 'system-out').text = stdout + if self._stderr_buffer is not None: + stderr = self._stderr_buffer.getvalue().rstrip() + ET.SubElement(e, 'system-err').text = stderr for k, v in args.items(): if not k or not v: @@ -152,23 +154,24 @@ def get_xml_element(self): return e class QuietRegressionTestRunner: - def __init__(self, stream): + def __init__(self, stream, buffer=False): self.result = RegressionTestResult(stream, None, 0) + self.result.buffer = buffer def run(self, test): test(self.result) return self.result -def get_test_runner_class(verbosity): +def get_test_runner_class(verbosity, buffer=False): if verbosity: return functools.partial(unittest.TextTestRunner, resultclass=RegressionTestResult, - buffer=True, + buffer=buffer, verbosity=verbosity) - return QuietRegressionTestRunner + return functools.partial(QuietRegressionTestRunner, buffer=buffer) -def get_test_runner(stream, verbosity): - return get_test_runner_class(verbosity)(stream) +def get_test_runner(stream, verbosity, capture_output=False): + return get_test_runner_class(verbosity, capture_output)(stream) if __name__ == '__main__': class TestTests(unittest.TestCase): From webhook-mailer at python.org Mon Oct 29 16:32:27 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 29 Oct 2018 20:32:27 -0000 Subject: [Python-checkins] bpo-28655: Fix test bdb for isolate mode (GH-10220) Message-ID: https://github.com/python/cpython/commit/4687bc993a275eaeb27a8b2068b128ce1f464818 commit: 4687bc993a275eaeb27a8b2068b128ce1f464818 branch: 3.6 author: Maite Gim?nez committer: Victor Stinner date: 2018-10-29T21:32:22+01:00 summary: bpo-28655: Fix test bdb for isolate mode (GH-10220) Fix test_bdb when running Python is isolated mode. (cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348) files: M Lib/test/test_bdb.py diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index a36667869718..616c3a864984 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -526,13 +526,13 @@ def gen(a, b): test.id = lambda : None test.expect_set = list(gen(repeat(()), iter(sl))) with create_modules(modules): - sys.path.append(os.getcwd()) with TracerRun(test, skip=skip) as tracer: tracer.runcall(tfunc_import) @contextmanager def create_modules(modules): with test.support.temp_cwd(): + sys.path.append(os.getcwd()) try: for m in modules: fname = m + '.py' @@ -544,6 +544,7 @@ def create_modules(modules): finally: for m in modules: test.support.forget(m) + sys.path.pop() def break_in_func(funcname, fname=__file__, temporary=False, cond=None): return 'break', (fname, None, temporary, cond, funcname) From webhook-mailer at python.org Mon Oct 29 16:43:13 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 29 Oct 2018 20:43:13 -0000 Subject: [Python-checkins] bpo-34765: install-sh is executable (GH-10225) Message-ID: https://github.com/python/cpython/commit/ed271b2350486b1fa031fa70e1e99d0d9b2b2133 commit: ed271b2350486b1fa031fa70e1e99d0d9b2b2133 branch: master author: Victor Stinner committer: GitHub date: 2018-10-29T21:43:02+01:00 summary: bpo-34765: install-sh is executable (GH-10225) Fix 'install-sh' file permission: add execution bit ("chmod +x"), "-rw-rw-r--." becomes "-rwxrwxr-x.". files: M install-sh diff --git a/install-sh b/install-sh old mode 100644 new mode 100755 From webhook-mailer at python.org Mon Oct 29 16:47:47 2018 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 29 Oct 2018 20:47:47 -0000 Subject: [Python-checkins] bpo-35031: Fix test_start_tls_server_1 on FreeBSD buildbots (GH-10011) Message-ID: https://github.com/python/cpython/commit/f6a47f3e316cede2a07a1f74a509f6d80ab8fef0 commit: f6a47f3e316cede2a07a1f74a509f6d80ab8fef0 branch: master author: Pablo Galindo committer: GitHub date: 2018-10-29T16:47:44-04:00 summary: bpo-35031: Fix test_start_tls_server_1 on FreeBSD buildbots (GH-10011) Some FreeBSD buildbots fail to run this test as the eof was not being received by the server if the size is not big enough. This behaviour only appears if the client is using TLS1.3. files: M Lib/test/test_asyncio/test_sslproto.py diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 39b19dd8594b..19b7a4366b2e 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -2,6 +2,7 @@ import logging import socket +import sys import unittest from unittest import mock try: @@ -429,6 +430,12 @@ def test_start_tls_server_1(self): server_context = test_utils.simple_server_sslcontext() client_context = test_utils.simple_client_sslcontext() + if sys.platform.startswith('freebsd'): + # bpo-35031: Some FreeBSD buildbots fail to run this test + # as the eof was not being received by the server if the payload + # size is not big enough. This behaviour only appears if the + # client is using TLS1.3. + client_context.options |= ssl.OP_NO_TLSv1_3 def client(sock, addr): sock.settimeout(self.TIMEOUT) From webhook-mailer at python.org Mon Oct 29 17:05:40 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 21:05:40 -0000 Subject: [Python-checkins] bpo-34945: Buffer output in test suite only when creating junit file (GH-10204) Message-ID: https://github.com/python/cpython/commit/58f7bf3a892031616a6b06ef4b8d36e2ebec172b commit: 58f7bf3a892031616a6b06ef4b8d36e2ebec172b branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-29T14:05:31-07:00 summary: bpo-34945: Buffer output in test suite only when creating junit file (GH-10204) After commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed, the output of the test suite is always buffered as the test output needs to be included in the JUnit file in same cases (as when a test fails). This has the consequence that printing or using debuggers (like pdb) in the test suite does not result in a good user experience anymore. This commit modifies the test suite runner so it only captures the test output when the JUnit file is requested to fix the regression so prints and debuggers are usable again. (cherry picked from commit 02277482ea765335e497ecd9661d4bde9b5ddc67) Co-authored-by: Pablo Galindo files: M Lib/test/support/__init__.py M Lib/test/support/testresult.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 4127b50d1fbb..ce455e0dc461 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1881,10 +1881,9 @@ def _filter_suite(suite, pred): def _run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" - runner = get_test_runner(sys.stdout, verbosity=verbose) - - # TODO: Remove this before merging (here for easy comparison with old impl) - #runner = unittest.TextTestRunner(sys.stdout, verbosity=2, failfast=failfast) + runner = get_test_runner(sys.stdout, + verbosity=verbose, + capture_output=(junit_xml_list is not None)) result = runner.run(suite) diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index 8988d3d15278..67e126dcf752 100644 --- a/Lib/test/support/testresult.py +++ b/Lib/test/support/testresult.py @@ -60,10 +60,12 @@ def _add_result(self, test, capture=False, **args): e.set('time', f'{time.perf_counter() - self.__start_time:0.6f}') if capture: - stdout = self._stdout_buffer.getvalue().rstrip() - ET.SubElement(e, 'system-out').text = stdout - stderr = self._stderr_buffer.getvalue().rstrip() - ET.SubElement(e, 'system-err').text = stderr + if self._stdout_buffer is not None: + stdout = self._stdout_buffer.getvalue().rstrip() + ET.SubElement(e, 'system-out').text = stdout + if self._stderr_buffer is not None: + stderr = self._stderr_buffer.getvalue().rstrip() + ET.SubElement(e, 'system-err').text = stderr for k, v in args.items(): if not k or not v: @@ -152,23 +154,24 @@ def get_xml_element(self): return e class QuietRegressionTestRunner: - def __init__(self, stream): + def __init__(self, stream, buffer=False): self.result = RegressionTestResult(stream, None, 0) + self.result.buffer = buffer def run(self, test): test(self.result) return self.result -def get_test_runner_class(verbosity): +def get_test_runner_class(verbosity, buffer=False): if verbosity: return functools.partial(unittest.TextTestRunner, resultclass=RegressionTestResult, - buffer=True, + buffer=buffer, verbosity=verbosity) - return QuietRegressionTestRunner + return functools.partial(QuietRegressionTestRunner, buffer=buffer) -def get_test_runner(stream, verbosity): - return get_test_runner_class(verbosity)(stream) +def get_test_runner(stream, verbosity, capture_output=False): + return get_test_runner_class(verbosity, capture_output)(stream) if __name__ == '__main__': class TestTests(unittest.TestCase): From webhook-mailer at python.org Mon Oct 29 17:07:54 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 21:07:54 -0000 Subject: [Python-checkins] bpo-34945: Buffer output in test suite only when creating junit file (GH-10204) Message-ID: https://github.com/python/cpython/commit/7b689c68ab3236455f7d58954435d029e2bb2c8a commit: 7b689c68ab3236455f7d58954435d029e2bb2c8a branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-29T14:07:50-07:00 summary: bpo-34945: Buffer output in test suite only when creating junit file (GH-10204) After commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed, the output of the test suite is always buffered as the test output needs to be included in the JUnit file in same cases (as when a test fails). This has the consequence that printing or using debuggers (like pdb) in the test suite does not result in a good user experience anymore. This commit modifies the test suite runner so it only captures the test output when the JUnit file is requested to fix the regression so prints and debuggers are usable again. (cherry picked from commit 02277482ea765335e497ecd9661d4bde9b5ddc67) Co-authored-by: Pablo Galindo files: M Lib/test/support/__init__.py M Lib/test/support/testresult.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 3f1962fe1cd2..7c16c985db28 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1907,10 +1907,9 @@ def _filter_suite(suite, pred): def _run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" - runner = get_test_runner(sys.stdout, verbosity=verbose) - - # TODO: Remove this before merging (here for easy comparison with old impl) - #runner = unittest.TextTestRunner(sys.stdout, verbosity=2, failfast=failfast) + runner = get_test_runner(sys.stdout, + verbosity=verbose, + capture_output=(junit_xml_list is not None)) result = runner.run(suite) diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index 8988d3d15278..67e126dcf752 100644 --- a/Lib/test/support/testresult.py +++ b/Lib/test/support/testresult.py @@ -60,10 +60,12 @@ def _add_result(self, test, capture=False, **args): e.set('time', f'{time.perf_counter() - self.__start_time:0.6f}') if capture: - stdout = self._stdout_buffer.getvalue().rstrip() - ET.SubElement(e, 'system-out').text = stdout - stderr = self._stderr_buffer.getvalue().rstrip() - ET.SubElement(e, 'system-err').text = stderr + if self._stdout_buffer is not None: + stdout = self._stdout_buffer.getvalue().rstrip() + ET.SubElement(e, 'system-out').text = stdout + if self._stderr_buffer is not None: + stderr = self._stderr_buffer.getvalue().rstrip() + ET.SubElement(e, 'system-err').text = stderr for k, v in args.items(): if not k or not v: @@ -152,23 +154,24 @@ def get_xml_element(self): return e class QuietRegressionTestRunner: - def __init__(self, stream): + def __init__(self, stream, buffer=False): self.result = RegressionTestResult(stream, None, 0) + self.result.buffer = buffer def run(self, test): test(self.result) return self.result -def get_test_runner_class(verbosity): +def get_test_runner_class(verbosity, buffer=False): if verbosity: return functools.partial(unittest.TextTestRunner, resultclass=RegressionTestResult, - buffer=True, + buffer=buffer, verbosity=verbosity) - return QuietRegressionTestRunner + return functools.partial(QuietRegressionTestRunner, buffer=buffer) -def get_test_runner(stream, verbosity): - return get_test_runner_class(verbosity)(stream) +def get_test_runner(stream, verbosity, capture_output=False): + return get_test_runner_class(verbosity, capture_output)(stream) if __name__ == '__main__': class TestTests(unittest.TestCase): From webhook-mailer at python.org Mon Oct 29 17:39:28 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 29 Oct 2018 21:39:28 -0000 Subject: [Python-checkins] Doc: fix asyncio loop.close() description (GH-10229) Message-ID: https://github.com/python/cpython/commit/b83d917fafd87e4130f9c7d5209ad2debc7219cd commit: b83d917fafd87e4130f9c7d5209ad2debc7219cd branch: master author: Andriy Maletsky committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018-10-29T14:39:21-07:00 summary: Doc: fix asyncio loop.close() description (GH-10229) Needs backport to 3.7. In 3.6 the description is correct. files: M Doc/library/asyncio-eventloop.rst diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 96f5e0b38a9f..d24413a4a7fb 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -137,7 +137,7 @@ Running and stopping the loop Close the event loop. - The loop must be running when this function is called. + The loop must not be running when this function is called. Any pending callbacks will be discarded. This method clears all queues and shuts down the executor, but does From webhook-mailer at python.org Tue Oct 30 04:29:27 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 30 Oct 2018 08:29:27 -0000 Subject: [Python-checkins] Restore EmbeddingTests, removed in 278d975ce158608f6be491c561247d4701c842be (GH-10078) Message-ID: https://github.com/python/cpython/commit/47a2824850e7f9d6d69abe9ef12caa053411221c commit: 47a2824850e7f9d6d69abe9ef12caa053411221c branch: 3.6 author: Daniel Pope committer: Serhiy Storchaka date: 2018-10-30T10:29:17+02:00 summary: Restore EmbeddingTests, removed in 278d975ce158608f6be491c561247d4701c842be (GH-10078) files: M Lib/test/test_capi.py diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index ae3bcb92057b..ae9e08a09b1e 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -372,6 +372,110 @@ def test_subinterps(self): self.assertNotEqual(pickle.load(f), id(builtins)) +class EmbeddingTests(unittest.TestCase): + def setUp(self): + here = os.path.abspath(__file__) + basepath = os.path.dirname(os.path.dirname(os.path.dirname(here))) + exename = "_testembed" + if sys.platform.startswith("win"): + ext = ("_d" if "_d" in sys.executable else "") + ".exe" + exename += ext + exepath = os.path.dirname(sys.executable) + else: + exepath = os.path.join(basepath, "Programs") + self.test_exe = exe = os.path.join(exepath, exename) + if not os.path.exists(exe): + self.skipTest("%r doesn't exist" % exe) + # This is needed otherwise we get a fatal error: + # "Py_Initialize: Unable to get the locale encoding + # LookupError: no codec search functions registered: can't find encoding" + self.oldcwd = os.getcwd() + os.chdir(basepath) + + def tearDown(self): + os.chdir(self.oldcwd) + + def run_embedded_interpreter(self, *args, env=None): + """Runs a test in the embedded interpreter""" + cmd = [self.test_exe] + cmd.extend(args) + if env is not None and sys.platform == 'win32': + # Windows requires at least the SYSTEMROOT environment variable to + # start Python. + env = env.copy() + env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] + + p = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + env=env) + (out, err) = p.communicate() + self.assertEqual(p.returncode, 0, + "bad returncode %d, stderr is %r" % + (p.returncode, err)) + return out, err + + def test_repeated_init_and_subinterpreters(self): + # This is just a "don't crash" test + out, err = self.run_embedded_interpreter('repeated_init_and_subinterpreters') + if support.verbose: + print() + print(out) + print(err) + + def test_forced_io_encoding(self): + # Checks forced configuration of embedded interpreter IO streams + env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") + out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) + if support.verbose: + print() + print(out) + print(err) + expected_stream_encoding = "utf-8" + expected_errors = "surrogateescape" + expected_output = '\n'.join([ + "--- Use defaults ---", + "Expected encoding: default", + "Expected errors: default", + "stdin: {in_encoding}:{errors}", + "stdout: {out_encoding}:{errors}", + "stderr: {out_encoding}:backslashreplace", + "--- Set errors only ---", + "Expected encoding: default", + "Expected errors: ignore", + "stdin: {in_encoding}:ignore", + "stdout: {out_encoding}:ignore", + "stderr: {out_encoding}:backslashreplace", + "--- Set encoding only ---", + "Expected encoding: latin-1", + "Expected errors: default", + "stdin: latin-1:{errors}", + "stdout: latin-1:{errors}", + "stderr: latin-1:backslashreplace", + "--- Set encoding and errors ---", + "Expected encoding: latin-1", + "Expected errors: replace", + "stdin: latin-1:replace", + "stdout: latin-1:replace", + "stderr: latin-1:backslashreplace"]) + expected_output = expected_output.format( + in_encoding=expected_stream_encoding, + out_encoding=expected_stream_encoding, + errors=expected_errors) + # This is useful if we ever trip over odd platform behaviour + self.maxDiff = None + self.assertEqual(out.strip(), expected_output) + + def test_pre_initialization_api(self): + """ + Checks the few parts of the C-API that work before the runtine + is initialized (via Py_Initialize()). + """ + env = dict(os.environ, PYTHONPATH=os.pathsep.join(sys.path)) + out, err = self.run_embedded_interpreter("pre_initialization_api", env=env) + self.assertEqual(out, '') + self.assertEqual(err, '') @unittest.skipUnless(threading, 'Threading required for this test.') From solipsis at pitrou.net Tue Oct 30 05:11:37 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 30 Oct 2018 09:11:37 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=8 Message-ID: <20181030091137.1.EB9241599A7D2941@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 1] memory blocks, sum=1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, 0, 0] memory blocks, sum=2 test_multiprocessing_spawn leaked [0, -1, 2] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogRhkA9o', '--timeout', '7200'] From webhook-mailer at python.org Tue Oct 30 07:16:08 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 30 Oct 2018 11:16:08 -0000 Subject: [Python-checkins] bpo-34876: Change the lineno of the AST for decorated function and class. (GH-9731) Message-ID: https://github.com/python/cpython/commit/95b6acf951fa7f503a3cc5ce7d969d7bcf2f95c9 commit: 95b6acf951fa7f503a3cc5ce7d969d7bcf2f95c9 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-30T13:16:02+02:00 summary: bpo-34876: Change the lineno of the AST for decorated function and class. (GH-9731) It was overridden by the lineno of the first decorator. Now it is the lineno of 'def' or 'class'. files: A Misc/NEWS.d/next/Core and Builtins/2018-10-06-14-02-51.bpo-34876.oBKBA4.rst M Lib/test/test_ast.py M Lib/test/test_trace.py M Python/ast.c M Python/compile.c M Python/importlib.h M Python/importlib_external.h diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 4bbdc3b82daa..0d51b1141925 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -124,6 +124,12 @@ def to_tuple(t): "{*{1, 2}, 3}", # Asynchronous comprehensions "async def f():\n [i async for b in c]", + # Decorated FunctionDef + "@deco1\n at deco2()\ndef f(): pass", + # Decorated AsyncFunctionDef + "@deco1\n at deco2()\nasync def f(): pass", + # Decorated ClassDef + "@deco1\n at deco2()\nclass C: pass", ] # These are compiled through "single" @@ -203,13 +209,16 @@ def _assertTrueorder(self, ast_node, parent_pos): return if isinstance(ast_node, (ast.expr, ast.stmt, ast.excepthandler)): node_pos = (ast_node.lineno, ast_node.col_offset) - self.assertTrue(node_pos >= parent_pos) + self.assertGreaterEqual(node_pos, parent_pos) parent_pos = (ast_node.lineno, ast_node.col_offset) for name in ast_node._fields: value = getattr(ast_node, name) if isinstance(value, list): + first_pos = parent_pos + if value and name == 'decorator_list': + first_pos = (value[0].lineno, value[0].col_offset) for child in value: - self._assertTrueorder(child, parent_pos) + self._assertTrueorder(child, first_pos) elif value is not None: self._assertTrueorder(value, parent_pos) @@ -1289,6 +1298,9 @@ def main(): ('Module', [('Expr', (1, 0), ('Dict', (1, 0), [None, ('Constant', (1, 10), 2)], [('Dict', (1, 3), [('Constant', (1, 4), 1)], [('Constant', (1, 6), 2)]), ('Constant', (1, 12), 3)]))]), ('Module', [('Expr', (1, 0), ('Set', (1, 0), [('Starred', (1, 1), ('Set', (1, 2), [('Constant', (1, 3), 1), ('Constant', (1, 6), 2)]), ('Load',)), ('Constant', (1, 10), 3)]))]), ('Module', [('AsyncFunctionDef', (1, 0), 'f', ('arguments', [], None, [], [], None, []), [('Expr', (2, 1), ('ListComp', (2, 2), ('Name', (2, 2), 'i', ('Load',)), [('comprehension', ('Name', (2, 14), 'b', ('Store',)), ('Name', (2, 19), 'c', ('Load',)), [], 1)]))], [], None)]), +('Module', [('FunctionDef', (3, 0), 'f', ('arguments', [], None, [], [], None, []), [('Pass', (3, 9))], [('Name', (1, 1), 'deco1', ('Load',)), ('Call', (2, 0), ('Name', (2, 1), 'deco2', ('Load',)), [], [])], None)]), +('Module', [('AsyncFunctionDef', (3, 0), 'f', ('arguments', [], None, [], [], None, []), [('Pass', (3, 15))], [('Name', (1, 1), 'deco1', ('Load',)), ('Call', (2, 0), ('Name', (2, 1), 'deco2', ('Load',)), [], [])], None)]), +('Module', [('ClassDef', (3, 0), 'C', [], [], [('Pass', (3, 9))], [('Name', (1, 1), 'deco1', ('Load',)), ('Call', (2, 0), ('Name', (2, 1), 'deco2', ('Load',)), [], [])])]), ] single_results = [ ('Interactive', [('Expr', (1, 0), ('BinOp', (1, 0), ('Constant', (1, 0), 1), ('Add',), ('Constant', (1, 2), 2)))]), diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py index 63f474179d68..5c333b7a0a5e 100644 --- a/Lib/test/test_trace.py +++ b/Lib/test/test_trace.py @@ -75,6 +75,19 @@ def traced_caller_list_comprehension(): mylist = [traced_doubler(i) for i in range(k)] return mylist +def traced_decorated_function(): + def decorator1(f): + return f + def decorator_fabric(): + def decorator2(f): + return f + return decorator2 + @decorator1 + @decorator_fabric() + def func(): + pass + func() + class TracedClass(object): def __init__(self, x): @@ -172,6 +185,24 @@ def test_trace_list_comprehension(self): } self.assertEqual(self.tracer.results().counts, expected) + def test_traced_decorated_function(self): + self.tracer.runfunc(traced_decorated_function) + + firstlineno = get_firstlineno(traced_decorated_function) + expected = { + (self.my_py_filename, firstlineno + 1): 1, + (self.my_py_filename, firstlineno + 2): 1, + (self.my_py_filename, firstlineno + 3): 1, + (self.my_py_filename, firstlineno + 4): 1, + (self.my_py_filename, firstlineno + 5): 1, + (self.my_py_filename, firstlineno + 6): 1, + (self.my_py_filename, firstlineno + 7): 1, + (self.my_py_filename, firstlineno + 8): 1, + (self.my_py_filename, firstlineno + 9): 1, + (self.my_py_filename, firstlineno + 10): 1, + (self.my_py_filename, firstlineno + 11): 1, + } + self.assertEqual(self.tracer.results().counts, expected) def test_linear_methods(self): # XXX todo: later add 'static_method_linear' and 'class_method_linear' @@ -189,6 +220,7 @@ def test_linear_methods(self): } self.assertEqual(tracer.results().counts, expected) + class TestRunExecCounts(unittest.TestCase): """A simple sanity test of line-counting, via runctx (exec)""" def setUp(self): @@ -263,6 +295,18 @@ def test_inst_method_calling(self): } self.assertEqual(self.tracer.results().calledfuncs, expected) + def test_traced_decorated_function(self): + self.tracer.runfunc(traced_decorated_function) + + expected = { + self.filemod + ('traced_decorated_function',): 1, + self.filemod + ('decorator_fabric',): 1, + self.filemod + ('decorator2',): 1, + self.filemod + ('decorator1',): 1, + self.filemod + ('func',): 1, + } + self.assertEqual(self.tracer.results().calledfuncs, expected) + class TestCallers(unittest.TestCase): """White-box testing of callers tracing""" diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-10-06-14-02-51.bpo-34876.oBKBA4.rst b/Misc/NEWS.d/next/Core and Builtins/2018-10-06-14-02-51.bpo-34876.oBKBA4.rst new file mode 100644 index 000000000000..4275c029f3f4 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-10-06-14-02-51.bpo-34876.oBKBA4.rst @@ -0,0 +1,6 @@ +The *lineno* and *col_offset* attributes of the AST for decorated function +and class refer now to the position of the corresponding ``def``, ``async +def`` and ``class`` instead of the position of the first decorator. This +leads to more correct line reporting in tracing. This is the only case when +the position of child AST nodes can preceed the position of the parent AST +node. diff --git a/Python/ast.c b/Python/ast.c index 184e33b4b506..d5c7ce6982d1 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1659,12 +1659,6 @@ ast_for_decorated(struct compiling *c, const node *n) } else if (TYPE(CHILD(n, 1)) == async_funcdef) { thing = ast_for_async_funcdef(c, CHILD(n, 1), decorator_seq); } - /* we count the decorators in when talking about the class' or - * function's line number */ - if (thing) { - thing->lineno = LINENO(n); - thing->col_offset = n->n_col_offset; - } return thing; } diff --git a/Python/compile.c b/Python/compile.c index 11958d384175..45a8c573a5ff 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1950,6 +1950,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) Py_ssize_t i, funcflags; int annotations; int scope_type; + int firstlineno; if (is_async) { assert(s->kind == AsyncFunctionDef_kind); @@ -1976,6 +1977,11 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) if (!compiler_decorators(c, decos)) return 0; + firstlineno = s->lineno; + if (asdl_seq_LEN(decos)) { + firstlineno = ((expr_ty)asdl_seq_GET(decos, 0))->lineno; + } + funcflags = compiler_default_arguments(c, args); if (funcflags == -1) { return 0; @@ -1989,7 +1995,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) funcflags |= 0x04; } - if (!compiler_enter_scope(c, name, scope_type, (void *)s, s->lineno)) { + if (!compiler_enter_scope(c, name, scope_type, (void *)s, firstlineno)) { return 0; } @@ -2032,12 +2038,17 @@ compiler_class(struct compiler *c, stmt_ty s) { PyCodeObject *co; PyObject *str; - int i; + int i, firstlineno; asdl_seq* decos = s->v.ClassDef.decorator_list; if (!compiler_decorators(c, decos)) return 0; + firstlineno = s->lineno; + if (asdl_seq_LEN(decos)) { + firstlineno = ((expr_ty)asdl_seq_GET(decos, 0))->lineno; + } + /* ultimately generate code for: = __build_class__(, , *, **) where: @@ -2052,7 +2063,7 @@ compiler_class(struct compiler *c, stmt_ty s) /* 1. compile the class body into a code object */ if (!compiler_enter_scope(c, s->v.ClassDef.name, - COMPILER_SCOPE_CLASS, (void *)s, s->lineno)) + COMPILER_SCOPE_CLASS, (void *)s, firstlineno)) return 0; /* this block represents what we do in the new scope */ { diff --git a/Python/importlib.h b/Python/importlib.h index c50c1f436f23..f38e7bb85110 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -735,1060 +735,1061 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 114,106,0,0,0,218,6,115,101,116,116,101,114,114,113,0, 0,0,114,107,0,0,0,114,10,0,0,0,114,10,0,0, 0,114,10,0,0,0,114,11,0,0,0,114,96,0,0,0, - 49,1,0,0,115,22,0,0,0,8,35,4,2,4,1,2, - 255,12,12,8,10,8,12,12,9,14,4,12,8,12,4,114, - 96,0,0,0,41,2,114,97,0,0,0,114,99,0,0,0, - 99,2,0,0,0,2,0,0,0,6,0,0,0,8,0,0, - 0,67,0,0,0,115,154,0,0,0,116,0,124,1,100,1, - 131,2,114,74,116,1,100,2,107,8,114,22,116,2,130,1, - 116,1,106,3,125,4,124,3,100,2,107,8,114,48,124,4, - 124,0,124,1,100,3,141,2,83,0,124,3,114,56,103,0, - 110,2,100,2,125,5,124,4,124,0,124,1,124,5,100,4, - 141,3,83,0,124,3,100,2,107,8,114,138,116,0,124,1, - 100,5,131,2,114,134,122,14,124,1,160,4,124,0,161,1, - 125,3,87,0,110,24,4,0,116,5,107,10,114,130,1,0, - 1,0,1,0,100,2,125,3,89,0,110,2,88,0,110,4, - 100,6,125,3,116,6,124,0,124,1,124,2,124,3,100,7, - 141,4,83,0,41,8,122,53,82,101,116,117,114,110,32,97, - 32,109,111,100,117,108,101,32,115,112,101,99,32,98,97,115, - 101,100,32,111,110,32,118,97,114,105,111,117,115,32,108,111, - 97,100,101,114,32,109,101,116,104,111,100,115,46,90,12,103, - 101,116,95,102,105,108,101,110,97,109,101,78,41,1,114,93, - 0,0,0,41,2,114,93,0,0,0,114,100,0,0,0,114, - 99,0,0,0,70,41,2,114,97,0,0,0,114,99,0,0, - 0,41,7,114,4,0,0,0,114,109,0,0,0,114,110,0, - 0,0,218,23,115,112,101,99,95,102,114,111,109,95,102,105, - 108,101,95,108,111,99,97,116,105,111,110,114,99,0,0,0, - 114,70,0,0,0,114,96,0,0,0,41,6,114,15,0,0, - 0,114,93,0,0,0,114,97,0,0,0,114,99,0,0,0, - 114,118,0,0,0,90,6,115,101,97,114,99,104,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,78,0,0, - 0,150,1,0,0,115,36,0,0,0,0,2,10,1,8,1, - 4,1,6,2,8,1,12,1,12,1,6,1,2,255,6,3, - 8,1,10,1,2,1,14,1,14,1,12,3,4,2,114,78, - 0,0,0,99,3,0,0,0,0,0,0,0,8,0,0,0, - 8,0,0,0,67,0,0,0,115,56,1,0,0,122,10,124, - 0,106,0,125,3,87,0,110,20,4,0,116,1,107,10,114, - 30,1,0,1,0,1,0,89,0,110,14,88,0,124,3,100, - 0,107,9,114,44,124,3,83,0,124,0,106,2,125,4,124, - 1,100,0,107,8,114,90,122,10,124,0,106,3,125,1,87, - 0,110,20,4,0,116,1,107,10,114,88,1,0,1,0,1, - 0,89,0,110,2,88,0,122,10,124,0,106,4,125,5,87, - 0,110,24,4,0,116,1,107,10,114,124,1,0,1,0,1, - 0,100,0,125,5,89,0,110,2,88,0,124,2,100,0,107, - 8,114,184,124,5,100,0,107,8,114,180,122,10,124,1,106, - 5,125,2,87,0,113,184,4,0,116,1,107,10,114,176,1, - 0,1,0,1,0,100,0,125,2,89,0,113,184,88,0,110, - 4,124,5,125,2,122,10,124,0,106,6,125,6,87,0,110, - 24,4,0,116,1,107,10,114,218,1,0,1,0,1,0,100, - 0,125,6,89,0,110,2,88,0,122,14,116,7,124,0,106, - 8,131,1,125,7,87,0,110,26,4,0,116,1,107,10,144, - 1,114,4,1,0,1,0,1,0,100,0,125,7,89,0,110, - 2,88,0,116,9,124,4,124,1,124,2,100,1,141,3,125, - 3,124,5,100,0,107,8,144,1,114,34,100,2,110,2,100, - 3,124,3,95,10,124,6,124,3,95,11,124,7,124,3,95, - 12,124,3,83,0,41,4,78,41,1,114,97,0,0,0,70, - 84,41,13,114,89,0,0,0,114,90,0,0,0,114,1,0, - 0,0,114,85,0,0,0,114,92,0,0,0,90,7,95,79, - 82,73,71,73,78,218,10,95,95,99,97,99,104,101,100,95, - 95,218,4,108,105,115,116,218,8,95,95,112,97,116,104,95, - 95,114,96,0,0,0,114,101,0,0,0,114,106,0,0,0, - 114,100,0,0,0,41,8,114,83,0,0,0,114,93,0,0, - 0,114,97,0,0,0,114,82,0,0,0,114,15,0,0,0, - 90,8,108,111,99,97,116,105,111,110,114,106,0,0,0,114, - 100,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,17,95,115,112,101,99,95,102,114,111,109,95, - 109,111,100,117,108,101,176,1,0,0,115,72,0,0,0,0, - 2,2,1,10,1,14,1,6,2,8,1,4,2,6,1,8, - 1,2,1,10,1,14,2,6,1,2,1,10,1,14,1,10, - 1,8,1,8,1,2,1,10,1,14,1,12,2,4,1,2, - 1,10,1,14,1,10,1,2,1,14,1,16,1,10,2,14, - 1,20,1,6,1,6,1,114,122,0,0,0,70,41,1,218, - 8,111,118,101,114,114,105,100,101,99,2,0,0,0,1,0, - 0,0,5,0,0,0,8,0,0,0,67,0,0,0,115,226, - 1,0,0,124,2,115,20,116,0,124,1,100,1,100,0,131, - 3,100,0,107,8,114,54,122,12,124,0,106,1,124,1,95, - 2,87,0,110,20,4,0,116,3,107,10,114,52,1,0,1, - 0,1,0,89,0,110,2,88,0,124,2,115,74,116,0,124, - 1,100,2,100,0,131,3,100,0,107,8,114,178,124,0,106, - 4,125,3,124,3,100,0,107,8,114,146,124,0,106,5,100, - 0,107,9,114,146,116,6,100,0,107,8,114,110,116,7,130, - 1,116,6,106,8,125,4,124,4,160,9,124,4,161,1,125, - 3,124,0,106,5,124,3,95,10,124,3,124,0,95,4,100, - 0,124,1,95,11,122,10,124,3,124,1,95,12,87,0,110, - 20,4,0,116,3,107,10,114,176,1,0,1,0,1,0,89, - 0,110,2,88,0,124,2,115,198,116,0,124,1,100,3,100, - 0,131,3,100,0,107,8,114,232,122,12,124,0,106,13,124, - 1,95,14,87,0,110,20,4,0,116,3,107,10,114,230,1, - 0,1,0,1,0,89,0,110,2,88,0,122,10,124,0,124, - 1,95,15,87,0,110,22,4,0,116,3,107,10,144,1,114, - 8,1,0,1,0,1,0,89,0,110,2,88,0,124,2,144, - 1,115,34,116,0,124,1,100,4,100,0,131,3,100,0,107, - 8,144,1,114,82,124,0,106,5,100,0,107,9,144,1,114, - 82,122,12,124,0,106,5,124,1,95,16,87,0,110,22,4, - 0,116,3,107,10,144,1,114,80,1,0,1,0,1,0,89, - 0,110,2,88,0,124,0,106,17,144,1,114,222,124,2,144, - 1,115,114,116,0,124,1,100,5,100,0,131,3,100,0,107, - 8,144,1,114,150,122,12,124,0,106,18,124,1,95,11,87, - 0,110,22,4,0,116,3,107,10,144,1,114,148,1,0,1, - 0,1,0,89,0,110,2,88,0,124,2,144,1,115,174,116, - 0,124,1,100,6,100,0,131,3,100,0,107,8,144,1,114, - 222,124,0,106,19,100,0,107,9,144,1,114,222,122,12,124, - 0,106,19,124,1,95,20,87,0,110,22,4,0,116,3,107, - 10,144,1,114,220,1,0,1,0,1,0,89,0,110,2,88, - 0,124,1,83,0,41,7,78,114,1,0,0,0,114,85,0, - 0,0,218,11,95,95,112,97,99,107,97,103,101,95,95,114, - 121,0,0,0,114,92,0,0,0,114,119,0,0,0,41,21, - 114,6,0,0,0,114,15,0,0,0,114,1,0,0,0,114, - 90,0,0,0,114,93,0,0,0,114,100,0,0,0,114,109, - 0,0,0,114,110,0,0,0,218,16,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,218,7,95,95,110,101, - 119,95,95,90,5,95,112,97,116,104,114,92,0,0,0,114, - 85,0,0,0,114,113,0,0,0,114,124,0,0,0,114,89, - 0,0,0,114,121,0,0,0,114,107,0,0,0,114,97,0, - 0,0,114,106,0,0,0,114,119,0,0,0,41,5,114,82, - 0,0,0,114,83,0,0,0,114,123,0,0,0,114,93,0, - 0,0,114,125,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,18,95,105,110,105,116,95,109,111, - 100,117,108,101,95,97,116,116,114,115,221,1,0,0,115,96, - 0,0,0,0,4,20,1,2,1,12,1,14,1,6,2,20, - 1,6,1,8,2,10,1,8,1,4,1,6,2,10,1,8, - 1,6,11,6,1,2,1,10,1,14,1,6,2,20,1,2, - 1,12,1,14,1,6,2,2,1,10,1,16,1,6,2,24, - 1,12,1,2,1,12,1,16,1,6,2,8,1,24,1,2, - 1,12,1,16,1,6,2,24,1,12,1,2,1,12,1,16, - 1,6,1,114,127,0,0,0,99,1,0,0,0,0,0,0, - 0,2,0,0,0,3,0,0,0,67,0,0,0,115,82,0, - 0,0,100,1,125,1,116,0,124,0,106,1,100,2,131,2, - 114,30,124,0,106,1,160,2,124,0,161,1,125,1,110,20, - 116,0,124,0,106,1,100,3,131,2,114,50,116,3,100,4, - 131,1,130,1,124,1,100,1,107,8,114,68,116,4,124,0, - 106,5,131,1,125,1,116,6,124,0,124,1,131,2,1,0, - 124,1,83,0,41,5,122,43,67,114,101,97,116,101,32,97, - 32,109,111,100,117,108,101,32,98,97,115,101,100,32,111,110, - 32,116,104,101,32,112,114,111,118,105,100,101,100,32,115,112, - 101,99,46,78,218,13,99,114,101,97,116,101,95,109,111,100, - 117,108,101,218,11,101,120,101,99,95,109,111,100,117,108,101, - 122,66,108,111,97,100,101,114,115,32,116,104,97,116,32,100, - 101,102,105,110,101,32,101,120,101,99,95,109,111,100,117,108, - 101,40,41,32,109,117,115,116,32,97,108,115,111,32,100,101, - 102,105,110,101,32,99,114,101,97,116,101,95,109,111,100,117, - 108,101,40,41,41,7,114,4,0,0,0,114,93,0,0,0, - 114,128,0,0,0,114,70,0,0,0,114,16,0,0,0,114, - 15,0,0,0,114,127,0,0,0,41,2,114,82,0,0,0, - 114,83,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,16,109,111,100,117,108,101,95,102,114,111, - 109,95,115,112,101,99,37,2,0,0,115,18,0,0,0,0, - 3,4,1,12,3,14,1,12,1,8,2,8,1,10,1,10, - 1,114,130,0,0,0,99,1,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,67,0,0,0,115,106,0,0,0, - 124,0,106,0,100,1,107,8,114,14,100,2,110,4,124,0, - 106,0,125,1,124,0,106,1,100,1,107,8,114,66,124,0, - 106,2,100,1,107,8,114,50,100,3,160,3,124,1,161,1, - 83,0,100,4,160,3,124,1,124,0,106,2,161,2,83,0, - 110,36,124,0,106,4,114,86,100,5,160,3,124,1,124,0, - 106,1,161,2,83,0,100,6,160,3,124,0,106,0,124,0, - 106,1,161,2,83,0,100,1,83,0,41,7,122,38,82,101, - 116,117,114,110,32,116,104,101,32,114,101,112,114,32,116,111, - 32,117,115,101,32,102,111,114,32,116,104,101,32,109,111,100, - 117,108,101,46,78,114,87,0,0,0,122,13,60,109,111,100, - 117,108,101,32,123,33,114,125,62,122,20,60,109,111,100,117, - 108,101,32,123,33,114,125,32,40,123,33,114,125,41,62,122, - 23,60,109,111,100,117,108,101,32,123,33,114,125,32,102,114, - 111,109,32,123,33,114,125,62,122,18,60,109,111,100,117,108, - 101,32,123,33,114,125,32,40,123,125,41,62,41,5,114,15, - 0,0,0,114,97,0,0,0,114,93,0,0,0,114,38,0, - 0,0,114,107,0,0,0,41,2,114,82,0,0,0,114,15, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,91,0,0,0,54,2,0,0,115,16,0,0,0, - 0,3,20,1,10,1,10,1,10,2,16,2,6,1,14,2, - 114,91,0,0,0,99,2,0,0,0,0,0,0,0,4,0, - 0,0,10,0,0,0,67,0,0,0,115,204,0,0,0,124, - 0,106,0,125,2,116,1,124,2,131,1,143,180,1,0,116, - 2,106,3,160,4,124,2,161,1,124,1,107,9,114,54,100, - 1,160,5,124,2,161,1,125,3,116,6,124,3,124,2,100, - 2,141,2,130,1,122,106,124,0,106,7,100,3,107,8,114, - 106,124,0,106,8,100,3,107,8,114,90,116,6,100,4,124, - 0,106,0,100,2,141,2,130,1,116,9,124,0,124,1,100, - 5,100,6,141,3,1,0,110,52,116,9,124,0,124,1,100, - 5,100,6,141,3,1,0,116,10,124,0,106,7,100,7,131, - 2,115,146,124,0,106,7,160,11,124,2,161,1,1,0,110, - 12,124,0,106,7,160,12,124,1,161,1,1,0,87,0,53, - 0,116,2,106,3,160,13,124,0,106,0,161,1,125,1,124, - 1,116,2,106,3,124,0,106,0,60,0,88,0,87,0,53, - 0,81,0,82,0,88,0,124,1,83,0,41,8,122,70,69, - 120,101,99,117,116,101,32,116,104,101,32,115,112,101,99,39, - 115,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, - 108,101,32,105,110,32,97,110,32,101,120,105,115,116,105,110, - 103,32,109,111,100,117,108,101,39,115,32,110,97,109,101,115, - 112,97,99,101,46,122,30,109,111,100,117,108,101,32,123,33, - 114,125,32,110,111,116,32,105,110,32,115,121,115,46,109,111, - 100,117,108,101,115,41,1,114,15,0,0,0,78,122,14,109, - 105,115,115,105,110,103,32,108,111,97,100,101,114,84,41,1, - 114,123,0,0,0,114,129,0,0,0,41,14,114,15,0,0, - 0,114,42,0,0,0,114,14,0,0,0,114,79,0,0,0, - 114,30,0,0,0,114,38,0,0,0,114,70,0,0,0,114, - 93,0,0,0,114,100,0,0,0,114,127,0,0,0,114,4, - 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, - 114,129,0,0,0,218,3,112,111,112,41,4,114,82,0,0, - 0,114,83,0,0,0,114,15,0,0,0,218,3,109,115,103, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 80,0,0,0,71,2,0,0,115,34,0,0,0,0,2,6, - 1,10,1,16,1,10,1,12,1,2,1,10,1,10,1,14, - 2,16,2,14,1,12,4,14,2,16,4,14,1,24,1,114, - 80,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, - 0,8,0,0,0,67,0,0,0,115,26,1,0,0,122,18, - 124,0,106,0,160,1,124,0,106,2,161,1,1,0,87,0, - 110,52,1,0,1,0,1,0,124,0,106,2,116,3,106,4, - 107,6,114,64,116,3,106,4,160,5,124,0,106,2,161,1, - 125,1,124,1,116,3,106,4,124,0,106,2,60,0,130,0, - 89,0,110,2,88,0,116,3,106,4,160,5,124,0,106,2, - 161,1,125,1,124,1,116,3,106,4,124,0,106,2,60,0, - 116,6,124,1,100,1,100,0,131,3,100,0,107,8,114,148, - 122,12,124,0,106,0,124,1,95,7,87,0,110,20,4,0, - 116,8,107,10,114,146,1,0,1,0,1,0,89,0,110,2, - 88,0,116,6,124,1,100,2,100,0,131,3,100,0,107,8, - 114,226,122,40,124,1,106,9,124,1,95,10,116,11,124,1, - 100,3,131,2,115,202,124,0,106,2,160,12,100,4,161,1, - 100,5,25,0,124,1,95,10,87,0,110,20,4,0,116,8, - 107,10,114,224,1,0,1,0,1,0,89,0,110,2,88,0, - 116,6,124,1,100,6,100,0,131,3,100,0,107,8,144,1, - 114,22,122,10,124,0,124,1,95,13,87,0,110,22,4,0, - 116,8,107,10,144,1,114,20,1,0,1,0,1,0,89,0, - 110,2,88,0,124,1,83,0,41,7,78,114,85,0,0,0, - 114,124,0,0,0,114,121,0,0,0,114,111,0,0,0,114, - 19,0,0,0,114,89,0,0,0,41,14,114,93,0,0,0, - 114,131,0,0,0,114,15,0,0,0,114,14,0,0,0,114, - 79,0,0,0,114,132,0,0,0,114,6,0,0,0,114,85, - 0,0,0,114,90,0,0,0,114,1,0,0,0,114,124,0, - 0,0,114,4,0,0,0,114,112,0,0,0,114,89,0,0, - 0,41,2,114,82,0,0,0,114,83,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,25,95,108, - 111,97,100,95,98,97,99,107,119,97,114,100,95,99,111,109, - 112,97,116,105,98,108,101,101,2,0,0,115,54,0,0,0, - 0,4,2,1,18,1,6,1,12,1,14,1,12,1,8,3, - 14,1,12,1,16,1,2,1,12,1,14,1,6,1,16,1, - 2,4,8,1,10,1,22,1,14,1,6,1,18,1,2,1, - 10,1,16,1,6,1,114,134,0,0,0,99,1,0,0,0, - 0,0,0,0,2,0,0,0,11,0,0,0,67,0,0,0, - 115,220,0,0,0,124,0,106,0,100,0,107,9,114,30,116, - 1,124,0,106,0,100,1,131,2,115,30,116,2,124,0,131, - 1,83,0,116,3,124,0,131,1,125,1,100,2,124,0,95, - 4,122,162,124,1,116,5,106,6,124,0,106,7,60,0,122, - 52,124,0,106,0,100,0,107,8,114,96,124,0,106,8,100, - 0,107,8,114,108,116,9,100,3,124,0,106,7,100,4,141, - 2,130,1,110,12,124,0,106,0,160,10,124,1,161,1,1, - 0,87,0,110,50,1,0,1,0,1,0,122,14,116,5,106, - 6,124,0,106,7,61,0,87,0,110,20,4,0,116,11,107, - 10,114,152,1,0,1,0,1,0,89,0,110,2,88,0,130, - 0,89,0,110,2,88,0,116,5,106,6,160,12,124,0,106, - 7,161,1,125,1,124,1,116,5,106,6,124,0,106,7,60, - 0,116,13,100,5,124,0,106,7,124,0,106,0,131,3,1, - 0,87,0,53,0,100,6,124,0,95,4,88,0,124,1,83, - 0,41,7,78,114,129,0,0,0,84,122,14,109,105,115,115, - 105,110,103,32,108,111,97,100,101,114,41,1,114,15,0,0, - 0,122,18,105,109,112,111,114,116,32,123,33,114,125,32,35, - 32,123,33,114,125,70,41,14,114,93,0,0,0,114,4,0, - 0,0,114,134,0,0,0,114,130,0,0,0,90,13,95,105, - 110,105,116,105,97,108,105,122,105,110,103,114,14,0,0,0, - 114,79,0,0,0,114,15,0,0,0,114,100,0,0,0,114, - 70,0,0,0,114,129,0,0,0,114,55,0,0,0,114,132, - 0,0,0,114,68,0,0,0,41,2,114,82,0,0,0,114, - 83,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,14,95,108,111,97,100,95,117,110,108,111,99, - 107,101,100,138,2,0,0,115,46,0,0,0,0,2,10,2, - 12,1,8,2,8,5,6,1,2,1,12,1,2,1,10,1, - 10,1,16,3,16,1,6,1,2,1,14,1,14,1,6,1, - 8,5,14,1,12,1,20,2,8,2,114,135,0,0,0,99, - 1,0,0,0,0,0,0,0,1,0,0,0,10,0,0,0, - 67,0,0,0,115,42,0,0,0,116,0,124,0,106,1,131, - 1,143,22,1,0,116,2,124,0,131,1,87,0,2,0,53, - 0,81,0,82,0,163,0,83,0,81,0,82,0,88,0,100, - 1,83,0,41,2,122,191,82,101,116,117,114,110,32,97,32, - 110,101,119,32,109,111,100,117,108,101,32,111,98,106,101,99, - 116,44,32,108,111,97,100,101,100,32,98,121,32,116,104,101, - 32,115,112,101,99,39,115,32,108,111,97,100,101,114,46,10, - 10,32,32,32,32,84,104,101,32,109,111,100,117,108,101,32, - 105,115,32,110,111,116,32,97,100,100,101,100,32,116,111,32, - 105,116,115,32,112,97,114,101,110,116,46,10,10,32,32,32, - 32,73,102,32,97,32,109,111,100,117,108,101,32,105,115,32, - 97,108,114,101,97,100,121,32,105,110,32,115,121,115,46,109, - 111,100,117,108,101,115,44,32,116,104,97,116,32,101,120,105, - 115,116,105,110,103,32,109,111,100,117,108,101,32,103,101,116, - 115,10,32,32,32,32,99,108,111,98,98,101,114,101,100,46, - 10,10,32,32,32,32,78,41,3,114,42,0,0,0,114,15, - 0,0,0,114,135,0,0,0,41,1,114,82,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,81, - 0,0,0,180,2,0,0,115,4,0,0,0,0,9,12,1, - 114,81,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,64,0,0,0,115,142,0,0,0,101, - 0,90,1,100,0,90,2,100,1,90,3,101,4,100,2,100, - 3,132,0,131,1,90,5,101,6,100,4,100,4,102,2,100, - 5,100,6,132,1,131,1,90,7,101,6,100,4,102,1,100, - 7,100,8,132,1,131,1,90,8,101,6,100,9,100,10,132, - 0,131,1,90,9,101,6,100,11,100,12,132,0,131,1,90, - 10,101,6,101,11,100,13,100,14,132,0,131,1,131,1,90, - 12,101,6,101,11,100,15,100,16,132,0,131,1,131,1,90, - 13,101,6,101,11,100,17,100,18,132,0,131,1,131,1,90, - 14,101,6,101,15,131,1,90,16,100,4,83,0,41,19,218, - 15,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, - 122,144,77,101,116,97,32,112,97,116,104,32,105,109,112,111, - 114,116,32,102,111,114,32,98,117,105,108,116,45,105,110,32, - 109,111,100,117,108,101,115,46,10,10,32,32,32,32,65,108, - 108,32,109,101,116,104,111,100,115,32,97,114,101,32,101,105, - 116,104,101,114,32,99,108,97,115,115,32,111,114,32,115,116, - 97,116,105,99,32,109,101,116,104,111,100,115,32,116,111,32, - 97,118,111,105,100,32,116,104,101,32,110,101,101,100,32,116, - 111,10,32,32,32,32,105,110,115,116,97,110,116,105,97,116, - 101,32,116,104,101,32,99,108,97,115,115,46,10,10,32,32, - 32,32,99,1,0,0,0,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,115,12,0,0,0,100,1,160,0, - 124,0,106,1,161,1,83,0,41,2,122,115,82,101,116,117, - 114,110,32,114,101,112,114,32,102,111,114,32,116,104,101,32, - 109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,32, - 32,84,104,101,32,109,101,116,104,111,100,32,105,115,32,100, - 101,112,114,101,99,97,116,101,100,46,32,32,84,104,101,32, - 105,109,112,111,114,116,32,109,97,99,104,105,110,101,114,121, - 32,100,111,101,115,32,116,104,101,32,106,111,98,32,105,116, - 115,101,108,102,46,10,10,32,32,32,32,32,32,32,32,122, - 24,60,109,111,100,117,108,101,32,123,33,114,125,32,40,98, - 117,105,108,116,45,105,110,41,62,41,2,114,38,0,0,0, - 114,1,0,0,0,41,1,114,83,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,86,0,0,0, - 204,2,0,0,115,2,0,0,0,0,7,122,27,66,117,105, - 108,116,105,110,73,109,112,111,114,116,101,114,46,109,111,100, - 117,108,101,95,114,101,112,114,78,99,4,0,0,0,0,0, - 0,0,4,0,0,0,5,0,0,0,67,0,0,0,115,44, - 0,0,0,124,2,100,0,107,9,114,12,100,0,83,0,116, - 0,160,1,124,1,161,1,114,36,116,2,124,1,124,0,100, - 1,100,2,141,3,83,0,100,0,83,0,100,0,83,0,41, - 3,78,122,8,98,117,105,108,116,45,105,110,41,1,114,97, - 0,0,0,41,3,114,49,0,0,0,90,10,105,115,95,98, - 117,105,108,116,105,110,114,78,0,0,0,41,4,218,3,99, - 108,115,114,71,0,0,0,218,4,112,97,116,104,218,6,116, - 97,114,103,101,116,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,9,102,105,110,100,95,115,112,101,99,213, - 2,0,0,115,10,0,0,0,0,2,8,1,4,1,10,1, - 14,2,122,25,66,117,105,108,116,105,110,73,109,112,111,114, - 116,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, - 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0, - 0,0,115,30,0,0,0,124,0,160,0,124,1,124,2,161, - 2,125,3,124,3,100,1,107,9,114,26,124,3,106,1,83, - 0,100,1,83,0,41,2,122,175,70,105,110,100,32,116,104, - 101,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108, - 101,46,10,10,32,32,32,32,32,32,32,32,73,102,32,39, - 112,97,116,104,39,32,105,115,32,101,118,101,114,32,115,112, - 101,99,105,102,105,101,100,32,116,104,101,110,32,116,104,101, - 32,115,101,97,114,99,104,32,105,115,32,99,111,110,115,105, - 100,101,114,101,100,32,97,32,102,97,105,108,117,114,101,46, - 10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109, - 101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97, - 116,101,100,46,32,32,85,115,101,32,102,105,110,100,95,115, - 112,101,99,40,41,32,105,110,115,116,101,97,100,46,10,10, - 32,32,32,32,32,32,32,32,78,41,2,114,140,0,0,0, - 114,93,0,0,0,41,4,114,137,0,0,0,114,71,0,0, - 0,114,138,0,0,0,114,82,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,11,102,105,110,100, - 95,109,111,100,117,108,101,222,2,0,0,115,4,0,0,0, - 0,9,12,1,122,27,66,117,105,108,116,105,110,73,109,112, - 111,114,116,101,114,46,102,105,110,100,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,4,0, - 0,0,67,0,0,0,115,46,0,0,0,124,1,106,0,116, - 1,106,2,107,7,114,34,116,3,100,1,160,4,124,1,106, - 0,161,1,124,1,106,0,100,2,141,2,130,1,116,5,116, - 6,106,7,124,1,131,2,83,0,41,3,122,24,67,114,101, - 97,116,101,32,97,32,98,117,105,108,116,45,105,110,32,109, - 111,100,117,108,101,122,29,123,33,114,125,32,105,115,32,110, - 111,116,32,97,32,98,117,105,108,116,45,105,110,32,109,111, - 100,117,108,101,41,1,114,15,0,0,0,41,8,114,15,0, - 0,0,114,14,0,0,0,114,69,0,0,0,114,70,0,0, - 0,114,38,0,0,0,114,59,0,0,0,114,49,0,0,0, - 90,14,99,114,101,97,116,101,95,98,117,105,108,116,105,110, - 41,2,114,26,0,0,0,114,82,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,128,0,0,0, - 234,2,0,0,115,10,0,0,0,0,3,12,1,12,1,4, - 255,6,2,122,29,66,117,105,108,116,105,110,73,109,112,111, - 114,116,101,114,46,99,114,101,97,116,101,95,109,111,100,117, - 108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,3, - 0,0,0,67,0,0,0,115,16,0,0,0,116,0,116,1, - 106,2,124,1,131,2,1,0,100,1,83,0,41,2,122,22, - 69,120,101,99,32,97,32,98,117,105,108,116,45,105,110,32, - 109,111,100,117,108,101,78,41,3,114,59,0,0,0,114,49, - 0,0,0,90,12,101,120,101,99,95,98,117,105,108,116,105, - 110,41,2,114,26,0,0,0,114,83,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,114,129,0,0, - 0,242,2,0,0,115,2,0,0,0,0,3,122,27,66,117, - 105,108,116,105,110,73,109,112,111,114,116,101,114,46,101,120, - 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, - 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, - 0,0,0,100,1,83,0,41,2,122,57,82,101,116,117,114, - 110,32,78,111,110,101,32,97,115,32,98,117,105,108,116,45, - 105,110,32,109,111,100,117,108,101,115,32,100,111,32,110,111, - 116,32,104,97,118,101,32,99,111,100,101,32,111,98,106,101, - 99,116,115,46,78,114,10,0,0,0,41,2,114,137,0,0, - 0,114,71,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,8,103,101,116,95,99,111,100,101,247, - 2,0,0,115,2,0,0,0,0,4,122,24,66,117,105,108, - 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, - 99,111,100,101,99,2,0,0,0,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, - 83,0,41,2,122,56,82,101,116,117,114,110,32,78,111,110, - 101,32,97,115,32,98,117,105,108,116,45,105,110,32,109,111, - 100,117,108,101,115,32,100,111,32,110,111,116,32,104,97,118, - 101,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, - 10,0,0,0,41,2,114,137,0,0,0,114,71,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 10,103,101,116,95,115,111,117,114,99,101,253,2,0,0,115, - 2,0,0,0,0,4,122,26,66,117,105,108,116,105,110,73, - 109,112,111,114,116,101,114,46,103,101,116,95,115,111,117,114, - 99,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, - 41,2,122,52,82,101,116,117,114,110,32,70,97,108,115,101, - 32,97,115,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,115,32,97,114,101,32,110,101,118,101,114,32,112, - 97,99,107,97,103,101,115,46,70,114,10,0,0,0,41,2, - 114,137,0,0,0,114,71,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,99,0,0,0,3,3, - 0,0,115,2,0,0,0,0,4,122,26,66,117,105,108,116, - 105,110,73,109,112,111,114,116,101,114,46,105,115,95,112,97, - 99,107,97,103,101,41,17,114,1,0,0,0,114,0,0,0, - 0,114,2,0,0,0,114,3,0,0,0,218,12,115,116,97, - 116,105,99,109,101,116,104,111,100,114,86,0,0,0,218,11, - 99,108,97,115,115,109,101,116,104,111,100,114,140,0,0,0, - 114,141,0,0,0,114,128,0,0,0,114,129,0,0,0,114, - 74,0,0,0,114,142,0,0,0,114,143,0,0,0,114,99, - 0,0,0,114,84,0,0,0,114,131,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,136,0,0,0,195,2,0,0,115,42,0,0,0,8, - 7,4,2,12,9,2,1,2,0,2,255,12,9,2,1,2, - 255,12,12,12,8,12,5,2,1,2,255,12,6,2,1,2, - 255,12,6,2,1,2,255,12,6,114,136,0,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, - 0,0,0,115,146,0,0,0,101,0,90,1,100,0,90,2, - 100,1,90,3,101,4,100,2,100,3,132,0,131,1,90,5, - 101,6,100,4,100,4,102,2,100,5,100,6,132,1,131,1, - 90,7,101,6,100,4,102,1,100,7,100,8,132,1,131,1, - 90,8,101,6,100,9,100,10,132,0,131,1,90,9,101,4, - 100,11,100,12,132,0,131,1,90,10,101,6,100,13,100,14, - 132,0,131,1,90,11,101,6,101,12,100,15,100,16,132,0, - 131,1,131,1,90,13,101,6,101,12,100,17,100,18,132,0, - 131,1,131,1,90,14,101,6,101,12,100,19,100,20,132,0, - 131,1,131,1,90,15,100,4,83,0,41,21,218,14,70,114, - 111,122,101,110,73,109,112,111,114,116,101,114,122,142,77,101, - 116,97,32,112,97,116,104,32,105,109,112,111,114,116,32,102, - 111,114,32,102,114,111,122,101,110,32,109,111,100,117,108,101, - 115,46,10,10,32,32,32,32,65,108,108,32,109,101,116,104, - 111,100,115,32,97,114,101,32,101,105,116,104,101,114,32,99, - 108,97,115,115,32,111,114,32,115,116,97,116,105,99,32,109, - 101,116,104,111,100,115,32,116,111,32,97,118,111,105,100,32, - 116,104,101,32,110,101,101,100,32,116,111,10,32,32,32,32, - 105,110,115,116,97,110,116,105,97,116,101,32,116,104,101,32, - 99,108,97,115,115,46,10,10,32,32,32,32,99,1,0,0, - 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, - 0,115,12,0,0,0,100,1,160,0,124,0,106,1,161,1, - 83,0,41,2,122,115,82,101,116,117,114,110,32,114,101,112, - 114,32,102,111,114,32,116,104,101,32,109,111,100,117,108,101, - 46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,109, - 101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97, - 116,101,100,46,32,32,84,104,101,32,105,109,112,111,114,116, - 32,109,97,99,104,105,110,101,114,121,32,100,111,101,115,32, - 116,104,101,32,106,111,98,32,105,116,115,101,108,102,46,10, - 10,32,32,32,32,32,32,32,32,122,22,60,109,111,100,117, - 108,101,32,123,33,114,125,32,40,102,114,111,122,101,110,41, - 62,41,2,114,38,0,0,0,114,1,0,0,0,41,1,218, - 1,109,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,86,0,0,0,21,3,0,0,115,2,0,0,0,0, - 7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, - 114,46,109,111,100,117,108,101,95,114,101,112,114,78,99,4, - 0,0,0,0,0,0,0,4,0,0,0,5,0,0,0,67, - 0,0,0,115,32,0,0,0,116,0,160,1,124,1,161,1, - 114,24,116,2,124,1,124,0,100,1,100,2,141,3,83,0, - 100,0,83,0,100,0,83,0,41,3,78,90,6,102,114,111, - 122,101,110,41,1,114,97,0,0,0,41,3,114,49,0,0, - 0,114,75,0,0,0,114,78,0,0,0,41,4,114,137,0, - 0,0,114,71,0,0,0,114,138,0,0,0,114,139,0,0, + 49,1,0,0,115,32,0,0,0,8,35,4,2,4,1,2, + 255,12,12,8,10,8,12,2,1,10,8,4,1,10,3,2, + 1,10,7,2,1,10,3,4,1,114,96,0,0,0,41,2, + 114,97,0,0,0,114,99,0,0,0,99,2,0,0,0,2, + 0,0,0,6,0,0,0,8,0,0,0,67,0,0,0,115, + 154,0,0,0,116,0,124,1,100,1,131,2,114,74,116,1, + 100,2,107,8,114,22,116,2,130,1,116,1,106,3,125,4, + 124,3,100,2,107,8,114,48,124,4,124,0,124,1,100,3, + 141,2,83,0,124,3,114,56,103,0,110,2,100,2,125,5, + 124,4,124,0,124,1,124,5,100,4,141,3,83,0,124,3, + 100,2,107,8,114,138,116,0,124,1,100,5,131,2,114,134, + 122,14,124,1,160,4,124,0,161,1,125,3,87,0,110,24, + 4,0,116,5,107,10,114,130,1,0,1,0,1,0,100,2, + 125,3,89,0,110,2,88,0,110,4,100,6,125,3,116,6, + 124,0,124,1,124,2,124,3,100,7,141,4,83,0,41,8, + 122,53,82,101,116,117,114,110,32,97,32,109,111,100,117,108, + 101,32,115,112,101,99,32,98,97,115,101,100,32,111,110,32, + 118,97,114,105,111,117,115,32,108,111,97,100,101,114,32,109, + 101,116,104,111,100,115,46,90,12,103,101,116,95,102,105,108, + 101,110,97,109,101,78,41,1,114,93,0,0,0,41,2,114, + 93,0,0,0,114,100,0,0,0,114,99,0,0,0,70,41, + 2,114,97,0,0,0,114,99,0,0,0,41,7,114,4,0, + 0,0,114,109,0,0,0,114,110,0,0,0,218,23,115,112, + 101,99,95,102,114,111,109,95,102,105,108,101,95,108,111,99, + 97,116,105,111,110,114,99,0,0,0,114,70,0,0,0,114, + 96,0,0,0,41,6,114,15,0,0,0,114,93,0,0,0, + 114,97,0,0,0,114,99,0,0,0,114,118,0,0,0,90, + 6,115,101,97,114,99,104,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,78,0,0,0,150,1,0,0,115, + 36,0,0,0,0,2,10,1,8,1,4,1,6,2,8,1, + 12,1,12,1,6,1,2,255,6,3,8,1,10,1,2,1, + 14,1,14,1,12,3,4,2,114,78,0,0,0,99,3,0, + 0,0,0,0,0,0,8,0,0,0,8,0,0,0,67,0, + 0,0,115,56,1,0,0,122,10,124,0,106,0,125,3,87, + 0,110,20,4,0,116,1,107,10,114,30,1,0,1,0,1, + 0,89,0,110,14,88,0,124,3,100,0,107,9,114,44,124, + 3,83,0,124,0,106,2,125,4,124,1,100,0,107,8,114, + 90,122,10,124,0,106,3,125,1,87,0,110,20,4,0,116, + 1,107,10,114,88,1,0,1,0,1,0,89,0,110,2,88, + 0,122,10,124,0,106,4,125,5,87,0,110,24,4,0,116, + 1,107,10,114,124,1,0,1,0,1,0,100,0,125,5,89, + 0,110,2,88,0,124,2,100,0,107,8,114,184,124,5,100, + 0,107,8,114,180,122,10,124,1,106,5,125,2,87,0,113, + 184,4,0,116,1,107,10,114,176,1,0,1,0,1,0,100, + 0,125,2,89,0,113,184,88,0,110,4,124,5,125,2,122, + 10,124,0,106,6,125,6,87,0,110,24,4,0,116,1,107, + 10,114,218,1,0,1,0,1,0,100,0,125,6,89,0,110, + 2,88,0,122,14,116,7,124,0,106,8,131,1,125,7,87, + 0,110,26,4,0,116,1,107,10,144,1,114,4,1,0,1, + 0,1,0,100,0,125,7,89,0,110,2,88,0,116,9,124, + 4,124,1,124,2,100,1,141,3,125,3,124,5,100,0,107, + 8,144,1,114,34,100,2,110,2,100,3,124,3,95,10,124, + 6,124,3,95,11,124,7,124,3,95,12,124,3,83,0,41, + 4,78,41,1,114,97,0,0,0,70,84,41,13,114,89,0, + 0,0,114,90,0,0,0,114,1,0,0,0,114,85,0,0, + 0,114,92,0,0,0,90,7,95,79,82,73,71,73,78,218, + 10,95,95,99,97,99,104,101,100,95,95,218,4,108,105,115, + 116,218,8,95,95,112,97,116,104,95,95,114,96,0,0,0, + 114,101,0,0,0,114,106,0,0,0,114,100,0,0,0,41, + 8,114,83,0,0,0,114,93,0,0,0,114,97,0,0,0, + 114,82,0,0,0,114,15,0,0,0,90,8,108,111,99,97, + 116,105,111,110,114,106,0,0,0,114,100,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,17,95, + 115,112,101,99,95,102,114,111,109,95,109,111,100,117,108,101, + 176,1,0,0,115,72,0,0,0,0,2,2,1,10,1,14, + 1,6,2,8,1,4,2,6,1,8,1,2,1,10,1,14, + 2,6,1,2,1,10,1,14,1,10,1,8,1,8,1,2, + 1,10,1,14,1,12,2,4,1,2,1,10,1,14,1,10, + 1,2,1,14,1,16,1,10,2,14,1,20,1,6,1,6, + 1,114,122,0,0,0,70,41,1,218,8,111,118,101,114,114, + 105,100,101,99,2,0,0,0,1,0,0,0,5,0,0,0, + 8,0,0,0,67,0,0,0,115,226,1,0,0,124,2,115, + 20,116,0,124,1,100,1,100,0,131,3,100,0,107,8,114, + 54,122,12,124,0,106,1,124,1,95,2,87,0,110,20,4, + 0,116,3,107,10,114,52,1,0,1,0,1,0,89,0,110, + 2,88,0,124,2,115,74,116,0,124,1,100,2,100,0,131, + 3,100,0,107,8,114,178,124,0,106,4,125,3,124,3,100, + 0,107,8,114,146,124,0,106,5,100,0,107,9,114,146,116, + 6,100,0,107,8,114,110,116,7,130,1,116,6,106,8,125, + 4,124,4,160,9,124,4,161,1,125,3,124,0,106,5,124, + 3,95,10,124,3,124,0,95,4,100,0,124,1,95,11,122, + 10,124,3,124,1,95,12,87,0,110,20,4,0,116,3,107, + 10,114,176,1,0,1,0,1,0,89,0,110,2,88,0,124, + 2,115,198,116,0,124,1,100,3,100,0,131,3,100,0,107, + 8,114,232,122,12,124,0,106,13,124,1,95,14,87,0,110, + 20,4,0,116,3,107,10,114,230,1,0,1,0,1,0,89, + 0,110,2,88,0,122,10,124,0,124,1,95,15,87,0,110, + 22,4,0,116,3,107,10,144,1,114,8,1,0,1,0,1, + 0,89,0,110,2,88,0,124,2,144,1,115,34,116,0,124, + 1,100,4,100,0,131,3,100,0,107,8,144,1,114,82,124, + 0,106,5,100,0,107,9,144,1,114,82,122,12,124,0,106, + 5,124,1,95,16,87,0,110,22,4,0,116,3,107,10,144, + 1,114,80,1,0,1,0,1,0,89,0,110,2,88,0,124, + 0,106,17,144,1,114,222,124,2,144,1,115,114,116,0,124, + 1,100,5,100,0,131,3,100,0,107,8,144,1,114,150,122, + 12,124,0,106,18,124,1,95,11,87,0,110,22,4,0,116, + 3,107,10,144,1,114,148,1,0,1,0,1,0,89,0,110, + 2,88,0,124,2,144,1,115,174,116,0,124,1,100,6,100, + 0,131,3,100,0,107,8,144,1,114,222,124,0,106,19,100, + 0,107,9,144,1,114,222,122,12,124,0,106,19,124,1,95, + 20,87,0,110,22,4,0,116,3,107,10,144,1,114,220,1, + 0,1,0,1,0,89,0,110,2,88,0,124,1,83,0,41, + 7,78,114,1,0,0,0,114,85,0,0,0,218,11,95,95, + 112,97,99,107,97,103,101,95,95,114,121,0,0,0,114,92, + 0,0,0,114,119,0,0,0,41,21,114,6,0,0,0,114, + 15,0,0,0,114,1,0,0,0,114,90,0,0,0,114,93, + 0,0,0,114,100,0,0,0,114,109,0,0,0,114,110,0, + 0,0,218,16,95,78,97,109,101,115,112,97,99,101,76,111, + 97,100,101,114,218,7,95,95,110,101,119,95,95,90,5,95, + 112,97,116,104,114,92,0,0,0,114,85,0,0,0,114,113, + 0,0,0,114,124,0,0,0,114,89,0,0,0,114,121,0, + 0,0,114,107,0,0,0,114,97,0,0,0,114,106,0,0, + 0,114,119,0,0,0,41,5,114,82,0,0,0,114,83,0, + 0,0,114,123,0,0,0,114,93,0,0,0,114,125,0,0, 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 114,140,0,0,0,30,3,0,0,115,6,0,0,0,0,2, - 10,1,14,2,122,24,70,114,111,122,101,110,73,109,112,111, - 114,116,101,114,46,102,105,110,100,95,115,112,101,99,99,3, - 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, - 0,0,0,115,18,0,0,0,116,0,160,1,124,1,161,1, - 114,14,124,0,83,0,100,1,83,0,41,2,122,93,70,105, - 110,100,32,97,32,102,114,111,122,101,110,32,109,111,100,117, - 108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,105, - 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, - 101,99,97,116,101,100,46,32,32,85,115,101,32,102,105,110, - 100,95,115,112,101,99,40,41,32,105,110,115,116,101,97,100, - 46,10,10,32,32,32,32,32,32,32,32,78,41,2,114,49, - 0,0,0,114,75,0,0,0,41,3,114,137,0,0,0,114, - 71,0,0,0,114,138,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,141,0,0,0,37,3,0, - 0,115,2,0,0,0,0,7,122,26,70,114,111,122,101,110, - 73,109,112,111,114,116,101,114,46,102,105,110,100,95,109,111, - 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, - 83,0,41,2,122,42,85,115,101,32,100,101,102,97,117,108, - 116,32,115,101,109,97,110,116,105,99,115,32,102,111,114,32, - 109,111,100,117,108,101,32,99,114,101,97,116,105,111,110,46, - 78,114,10,0,0,0,41,2,114,137,0,0,0,114,82,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,128,0,0,0,46,3,0,0,115,2,0,0,0,0, - 2,122,28,70,114,111,122,101,110,73,109,112,111,114,116,101, - 114,46,99,114,101,97,116,101,95,109,111,100,117,108,101,99, - 1,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0, - 67,0,0,0,115,64,0,0,0,124,0,106,0,106,1,125, - 1,116,2,160,3,124,1,161,1,115,36,116,4,100,1,160, - 5,124,1,161,1,124,1,100,2,141,2,130,1,116,6,116, - 2,106,7,124,1,131,2,125,2,116,8,124,2,124,0,106, - 9,131,2,1,0,100,0,83,0,41,3,78,122,27,123,33, - 114,125,32,105,115,32,110,111,116,32,97,32,102,114,111,122, - 101,110,32,109,111,100,117,108,101,41,1,114,15,0,0,0, - 41,10,114,89,0,0,0,114,15,0,0,0,114,49,0,0, - 0,114,75,0,0,0,114,70,0,0,0,114,38,0,0,0, - 114,59,0,0,0,218,17,103,101,116,95,102,114,111,122,101, - 110,95,111,98,106,101,99,116,218,4,101,120,101,99,114,7, - 0,0,0,41,3,114,83,0,0,0,114,15,0,0,0,218, - 4,99,111,100,101,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,114,129,0,0,0,50,3,0,0,115,14,0, - 0,0,0,2,8,1,10,1,10,1,2,255,6,2,12,1, - 122,26,70,114,111,122,101,110,73,109,112,111,114,116,101,114, - 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, - 0,0,0,0,0,2,0,0,0,3,0,0,0,67,0,0, - 0,115,10,0,0,0,116,0,124,0,124,1,131,2,83,0, - 41,1,122,95,76,111,97,100,32,97,32,102,114,111,122,101, - 110,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, - 32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,105, - 115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85, - 115,101,32,101,120,101,99,95,109,111,100,117,108,101,40,41, - 32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,32, - 32,32,32,41,1,114,84,0,0,0,41,2,114,137,0,0, - 0,114,71,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,131,0,0,0,59,3,0,0,115,2, - 0,0,0,0,7,122,26,70,114,111,122,101,110,73,109,112, - 111,114,116,101,114,46,108,111,97,100,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,67,0,0,0,115,10,0,0,0,116,0,160,1,124, - 1,161,1,83,0,41,1,122,45,82,101,116,117,114,110,32, - 116,104,101,32,99,111,100,101,32,111,98,106,101,99,116,32, - 102,111,114,32,116,104,101,32,102,114,111,122,101,110,32,109, - 111,100,117,108,101,46,41,2,114,49,0,0,0,114,148,0, - 0,0,41,2,114,137,0,0,0,114,71,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,142,0, - 0,0,68,3,0,0,115,2,0,0,0,0,4,122,23,70, - 114,111,122,101,110,73,109,112,111,114,116,101,114,46,103,101, - 116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, - 100,1,83,0,41,2,122,54,82,101,116,117,114,110,32,78, - 111,110,101,32,97,115,32,102,114,111,122,101,110,32,109,111, - 100,117,108,101,115,32,100,111,32,110,111,116,32,104,97,118, - 101,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, - 10,0,0,0,41,2,114,137,0,0,0,114,71,0,0,0, + 218,18,95,105,110,105,116,95,109,111,100,117,108,101,95,97, + 116,116,114,115,221,1,0,0,115,96,0,0,0,0,4,20, + 1,2,1,12,1,14,1,6,2,20,1,6,1,8,2,10, + 1,8,1,4,1,6,2,10,1,8,1,6,11,6,1,2, + 1,10,1,14,1,6,2,20,1,2,1,12,1,14,1,6, + 2,2,1,10,1,16,1,6,2,24,1,12,1,2,1,12, + 1,16,1,6,2,8,1,24,1,2,1,12,1,16,1,6, + 2,24,1,12,1,2,1,12,1,16,1,6,1,114,127,0, + 0,0,99,1,0,0,0,0,0,0,0,2,0,0,0,3, + 0,0,0,67,0,0,0,115,82,0,0,0,100,1,125,1, + 116,0,124,0,106,1,100,2,131,2,114,30,124,0,106,1, + 160,2,124,0,161,1,125,1,110,20,116,0,124,0,106,1, + 100,3,131,2,114,50,116,3,100,4,131,1,130,1,124,1, + 100,1,107,8,114,68,116,4,124,0,106,5,131,1,125,1, + 116,6,124,0,124,1,131,2,1,0,124,1,83,0,41,5, + 122,43,67,114,101,97,116,101,32,97,32,109,111,100,117,108, + 101,32,98,97,115,101,100,32,111,110,32,116,104,101,32,112, + 114,111,118,105,100,101,100,32,115,112,101,99,46,78,218,13, + 99,114,101,97,116,101,95,109,111,100,117,108,101,218,11,101, + 120,101,99,95,109,111,100,117,108,101,122,66,108,111,97,100, + 101,114,115,32,116,104,97,116,32,100,101,102,105,110,101,32, + 101,120,101,99,95,109,111,100,117,108,101,40,41,32,109,117, + 115,116,32,97,108,115,111,32,100,101,102,105,110,101,32,99, + 114,101,97,116,101,95,109,111,100,117,108,101,40,41,41,7, + 114,4,0,0,0,114,93,0,0,0,114,128,0,0,0,114, + 70,0,0,0,114,16,0,0,0,114,15,0,0,0,114,127, + 0,0,0,41,2,114,82,0,0,0,114,83,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,16, + 109,111,100,117,108,101,95,102,114,111,109,95,115,112,101,99, + 37,2,0,0,115,18,0,0,0,0,3,4,1,12,3,14, + 1,12,1,8,2,8,1,10,1,10,1,114,130,0,0,0, + 99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0, + 0,67,0,0,0,115,106,0,0,0,124,0,106,0,100,1, + 107,8,114,14,100,2,110,4,124,0,106,0,125,1,124,0, + 106,1,100,1,107,8,114,66,124,0,106,2,100,1,107,8, + 114,50,100,3,160,3,124,1,161,1,83,0,100,4,160,3, + 124,1,124,0,106,2,161,2,83,0,110,36,124,0,106,4, + 114,86,100,5,160,3,124,1,124,0,106,1,161,2,83,0, + 100,6,160,3,124,0,106,0,124,0,106,1,161,2,83,0, + 100,1,83,0,41,7,122,38,82,101,116,117,114,110,32,116, + 104,101,32,114,101,112,114,32,116,111,32,117,115,101,32,102, + 111,114,32,116,104,101,32,109,111,100,117,108,101,46,78,114, + 87,0,0,0,122,13,60,109,111,100,117,108,101,32,123,33, + 114,125,62,122,20,60,109,111,100,117,108,101,32,123,33,114, + 125,32,40,123,33,114,125,41,62,122,23,60,109,111,100,117, + 108,101,32,123,33,114,125,32,102,114,111,109,32,123,33,114, + 125,62,122,18,60,109,111,100,117,108,101,32,123,33,114,125, + 32,40,123,125,41,62,41,5,114,15,0,0,0,114,97,0, + 0,0,114,93,0,0,0,114,38,0,0,0,114,107,0,0, + 0,41,2,114,82,0,0,0,114,15,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,91,0,0, + 0,54,2,0,0,115,16,0,0,0,0,3,20,1,10,1, + 10,1,10,2,16,2,6,1,14,2,114,91,0,0,0,99, + 2,0,0,0,0,0,0,0,4,0,0,0,10,0,0,0, + 67,0,0,0,115,204,0,0,0,124,0,106,0,125,2,116, + 1,124,2,131,1,143,180,1,0,116,2,106,3,160,4,124, + 2,161,1,124,1,107,9,114,54,100,1,160,5,124,2,161, + 1,125,3,116,6,124,3,124,2,100,2,141,2,130,1,122, + 106,124,0,106,7,100,3,107,8,114,106,124,0,106,8,100, + 3,107,8,114,90,116,6,100,4,124,0,106,0,100,2,141, + 2,130,1,116,9,124,0,124,1,100,5,100,6,141,3,1, + 0,110,52,116,9,124,0,124,1,100,5,100,6,141,3,1, + 0,116,10,124,0,106,7,100,7,131,2,115,146,124,0,106, + 7,160,11,124,2,161,1,1,0,110,12,124,0,106,7,160, + 12,124,1,161,1,1,0,87,0,53,0,116,2,106,3,160, + 13,124,0,106,0,161,1,125,1,124,1,116,2,106,3,124, + 0,106,0,60,0,88,0,87,0,53,0,81,0,82,0,88, + 0,124,1,83,0,41,8,122,70,69,120,101,99,117,116,101, + 32,116,104,101,32,115,112,101,99,39,115,32,115,112,101,99, + 105,102,105,101,100,32,109,111,100,117,108,101,32,105,110,32, + 97,110,32,101,120,105,115,116,105,110,103,32,109,111,100,117, + 108,101,39,115,32,110,97,109,101,115,112,97,99,101,46,122, + 30,109,111,100,117,108,101,32,123,33,114,125,32,110,111,116, + 32,105,110,32,115,121,115,46,109,111,100,117,108,101,115,41, + 1,114,15,0,0,0,78,122,14,109,105,115,115,105,110,103, + 32,108,111,97,100,101,114,84,41,1,114,123,0,0,0,114, + 129,0,0,0,41,14,114,15,0,0,0,114,42,0,0,0, + 114,14,0,0,0,114,79,0,0,0,114,30,0,0,0,114, + 38,0,0,0,114,70,0,0,0,114,93,0,0,0,114,100, + 0,0,0,114,127,0,0,0,114,4,0,0,0,218,11,108, + 111,97,100,95,109,111,100,117,108,101,114,129,0,0,0,218, + 3,112,111,112,41,4,114,82,0,0,0,114,83,0,0,0, + 114,15,0,0,0,218,3,109,115,103,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,80,0,0,0,71,2, + 0,0,115,34,0,0,0,0,2,6,1,10,1,16,1,10, + 1,12,1,2,1,10,1,10,1,14,2,16,2,14,1,12, + 4,14,2,16,4,14,1,24,1,114,80,0,0,0,99,1, + 0,0,0,0,0,0,0,2,0,0,0,8,0,0,0,67, + 0,0,0,115,26,1,0,0,122,18,124,0,106,0,160,1, + 124,0,106,2,161,1,1,0,87,0,110,52,1,0,1,0, + 1,0,124,0,106,2,116,3,106,4,107,6,114,64,116,3, + 106,4,160,5,124,0,106,2,161,1,125,1,124,1,116,3, + 106,4,124,0,106,2,60,0,130,0,89,0,110,2,88,0, + 116,3,106,4,160,5,124,0,106,2,161,1,125,1,124,1, + 116,3,106,4,124,0,106,2,60,0,116,6,124,1,100,1, + 100,0,131,3,100,0,107,8,114,148,122,12,124,0,106,0, + 124,1,95,7,87,0,110,20,4,0,116,8,107,10,114,146, + 1,0,1,0,1,0,89,0,110,2,88,0,116,6,124,1, + 100,2,100,0,131,3,100,0,107,8,114,226,122,40,124,1, + 106,9,124,1,95,10,116,11,124,1,100,3,131,2,115,202, + 124,0,106,2,160,12,100,4,161,1,100,5,25,0,124,1, + 95,10,87,0,110,20,4,0,116,8,107,10,114,224,1,0, + 1,0,1,0,89,0,110,2,88,0,116,6,124,1,100,6, + 100,0,131,3,100,0,107,8,144,1,114,22,122,10,124,0, + 124,1,95,13,87,0,110,22,4,0,116,8,107,10,144,1, + 114,20,1,0,1,0,1,0,89,0,110,2,88,0,124,1, + 83,0,41,7,78,114,85,0,0,0,114,124,0,0,0,114, + 121,0,0,0,114,111,0,0,0,114,19,0,0,0,114,89, + 0,0,0,41,14,114,93,0,0,0,114,131,0,0,0,114, + 15,0,0,0,114,14,0,0,0,114,79,0,0,0,114,132, + 0,0,0,114,6,0,0,0,114,85,0,0,0,114,90,0, + 0,0,114,1,0,0,0,114,124,0,0,0,114,4,0,0, + 0,114,112,0,0,0,114,89,0,0,0,41,2,114,82,0, + 0,0,114,83,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,218,25,95,108,111,97,100,95,98,97, + 99,107,119,97,114,100,95,99,111,109,112,97,116,105,98,108, + 101,101,2,0,0,115,54,0,0,0,0,4,2,1,18,1, + 6,1,12,1,14,1,12,1,8,3,14,1,12,1,16,1, + 2,1,12,1,14,1,6,1,16,1,2,4,8,1,10,1, + 22,1,14,1,6,1,18,1,2,1,10,1,16,1,6,1, + 114,134,0,0,0,99,1,0,0,0,0,0,0,0,2,0, + 0,0,11,0,0,0,67,0,0,0,115,220,0,0,0,124, + 0,106,0,100,0,107,9,114,30,116,1,124,0,106,0,100, + 1,131,2,115,30,116,2,124,0,131,1,83,0,116,3,124, + 0,131,1,125,1,100,2,124,0,95,4,122,162,124,1,116, + 5,106,6,124,0,106,7,60,0,122,52,124,0,106,0,100, + 0,107,8,114,96,124,0,106,8,100,0,107,8,114,108,116, + 9,100,3,124,0,106,7,100,4,141,2,130,1,110,12,124, + 0,106,0,160,10,124,1,161,1,1,0,87,0,110,50,1, + 0,1,0,1,0,122,14,116,5,106,6,124,0,106,7,61, + 0,87,0,110,20,4,0,116,11,107,10,114,152,1,0,1, + 0,1,0,89,0,110,2,88,0,130,0,89,0,110,2,88, + 0,116,5,106,6,160,12,124,0,106,7,161,1,125,1,124, + 1,116,5,106,6,124,0,106,7,60,0,116,13,100,5,124, + 0,106,7,124,0,106,0,131,3,1,0,87,0,53,0,100, + 6,124,0,95,4,88,0,124,1,83,0,41,7,78,114,129, + 0,0,0,84,122,14,109,105,115,115,105,110,103,32,108,111, + 97,100,101,114,41,1,114,15,0,0,0,122,18,105,109,112, + 111,114,116,32,123,33,114,125,32,35,32,123,33,114,125,70, + 41,14,114,93,0,0,0,114,4,0,0,0,114,134,0,0, + 0,114,130,0,0,0,90,13,95,105,110,105,116,105,97,108, + 105,122,105,110,103,114,14,0,0,0,114,79,0,0,0,114, + 15,0,0,0,114,100,0,0,0,114,70,0,0,0,114,129, + 0,0,0,114,55,0,0,0,114,132,0,0,0,114,68,0, + 0,0,41,2,114,82,0,0,0,114,83,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,14,95, + 108,111,97,100,95,117,110,108,111,99,107,101,100,138,2,0, + 0,115,46,0,0,0,0,2,10,2,12,1,8,2,8,5, + 6,1,2,1,12,1,2,1,10,1,10,1,16,3,16,1, + 6,1,2,1,14,1,14,1,6,1,8,5,14,1,12,1, + 20,2,8,2,114,135,0,0,0,99,1,0,0,0,0,0, + 0,0,1,0,0,0,10,0,0,0,67,0,0,0,115,42, + 0,0,0,116,0,124,0,106,1,131,1,143,22,1,0,116, + 2,124,0,131,1,87,0,2,0,53,0,81,0,82,0,163, + 0,83,0,81,0,82,0,88,0,100,1,83,0,41,2,122, + 191,82,101,116,117,114,110,32,97,32,110,101,119,32,109,111, + 100,117,108,101,32,111,98,106,101,99,116,44,32,108,111,97, + 100,101,100,32,98,121,32,116,104,101,32,115,112,101,99,39, + 115,32,108,111,97,100,101,114,46,10,10,32,32,32,32,84, + 104,101,32,109,111,100,117,108,101,32,105,115,32,110,111,116, + 32,97,100,100,101,100,32,116,111,32,105,116,115,32,112,97, + 114,101,110,116,46,10,10,32,32,32,32,73,102,32,97,32, + 109,111,100,117,108,101,32,105,115,32,97,108,114,101,97,100, + 121,32,105,110,32,115,121,115,46,109,111,100,117,108,101,115, + 44,32,116,104,97,116,32,101,120,105,115,116,105,110,103,32, + 109,111,100,117,108,101,32,103,101,116,115,10,32,32,32,32, + 99,108,111,98,98,101,114,101,100,46,10,10,32,32,32,32, + 78,41,3,114,42,0,0,0,114,15,0,0,0,114,135,0, + 0,0,41,1,114,82,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,81,0,0,0,180,2,0, + 0,115,4,0,0,0,0,9,12,1,114,81,0,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 64,0,0,0,115,136,0,0,0,101,0,90,1,100,0,90, + 2,100,1,90,3,101,4,100,2,100,3,132,0,131,1,90, + 5,101,6,100,19,100,5,100,6,132,1,131,1,90,7,101, + 6,100,20,100,7,100,8,132,1,131,1,90,8,101,6,100, + 9,100,10,132,0,131,1,90,9,101,6,100,11,100,12,132, + 0,131,1,90,10,101,6,101,11,100,13,100,14,132,0,131, + 1,131,1,90,12,101,6,101,11,100,15,100,16,132,0,131, + 1,131,1,90,13,101,6,101,11,100,17,100,18,132,0,131, + 1,131,1,90,14,101,6,101,15,131,1,90,16,100,4,83, + 0,41,21,218,15,66,117,105,108,116,105,110,73,109,112,111, + 114,116,101,114,122,144,77,101,116,97,32,112,97,116,104,32, + 105,109,112,111,114,116,32,102,111,114,32,98,117,105,108,116, + 45,105,110,32,109,111,100,117,108,101,115,46,10,10,32,32, + 32,32,65,108,108,32,109,101,116,104,111,100,115,32,97,114, + 101,32,101,105,116,104,101,114,32,99,108,97,115,115,32,111, + 114,32,115,116,97,116,105,99,32,109,101,116,104,111,100,115, + 32,116,111,32,97,118,111,105,100,32,116,104,101,32,110,101, + 101,100,32,116,111,10,32,32,32,32,105,110,115,116,97,110, + 116,105,97,116,101,32,116,104,101,32,99,108,97,115,115,46, + 10,10,32,32,32,32,99,1,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, + 100,1,160,0,124,0,106,1,161,1,83,0,41,2,122,115, + 82,101,116,117,114,110,32,114,101,112,114,32,102,111,114,32, + 116,104,101,32,109,111,100,117,108,101,46,10,10,32,32,32, + 32,32,32,32,32,84,104,101,32,109,101,116,104,111,100,32, + 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, + 84,104,101,32,105,109,112,111,114,116,32,109,97,99,104,105, + 110,101,114,121,32,100,111,101,115,32,116,104,101,32,106,111, + 98,32,105,116,115,101,108,102,46,10,10,32,32,32,32,32, + 32,32,32,122,24,60,109,111,100,117,108,101,32,123,33,114, + 125,32,40,98,117,105,108,116,45,105,110,41,62,41,2,114, + 38,0,0,0,114,1,0,0,0,41,1,114,83,0,0,0, 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 143,0,0,0,74,3,0,0,115,2,0,0,0,0,4,122, - 25,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46, - 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, - 10,0,0,0,116,0,160,1,124,1,161,1,83,0,41,1, - 122,46,82,101,116,117,114,110,32,84,114,117,101,32,105,102, - 32,116,104,101,32,102,114,111,122,101,110,32,109,111,100,117, - 108,101,32,105,115,32,97,32,112,97,99,107,97,103,101,46, - 41,2,114,49,0,0,0,90,17,105,115,95,102,114,111,122, - 101,110,95,112,97,99,107,97,103,101,41,2,114,137,0,0, - 0,114,71,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,99,0,0,0,80,3,0,0,115,2, - 0,0,0,0,4,122,25,70,114,111,122,101,110,73,109,112, - 111,114,116,101,114,46,105,115,95,112,97,99,107,97,103,101, - 41,16,114,1,0,0,0,114,0,0,0,0,114,2,0,0, - 0,114,3,0,0,0,114,144,0,0,0,114,86,0,0,0, - 114,145,0,0,0,114,140,0,0,0,114,141,0,0,0,114, - 128,0,0,0,114,129,0,0,0,114,131,0,0,0,114,77, - 0,0,0,114,142,0,0,0,114,143,0,0,0,114,99,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,146,0,0,0,12,3,0,0,115, - 42,0,0,0,8,7,4,2,12,9,2,1,2,0,2,255, - 12,7,2,1,2,255,12,9,12,4,12,9,12,9,2,1, - 2,255,12,6,2,1,2,255,12,6,2,1,2,255,114,146, - 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,64,0,0,0,115,32,0,0,0,101,0,90, - 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, - 4,100,4,100,5,132,0,90,5,100,6,83,0,41,7,218, - 18,95,73,109,112,111,114,116,76,111,99,107,67,111,110,116, - 101,120,116,122,36,67,111,110,116,101,120,116,32,109,97,110, - 97,103,101,114,32,102,111,114,32,116,104,101,32,105,109,112, - 111,114,116,32,108,111,99,107,46,99,1,0,0,0,0,0, - 0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,12, - 0,0,0,116,0,160,1,161,0,1,0,100,1,83,0,41, - 2,122,24,65,99,113,117,105,114,101,32,116,104,101,32,105, - 109,112,111,114,116,32,108,111,99,107,46,78,41,2,114,49, - 0,0,0,114,50,0,0,0,41,1,114,26,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,46, - 0,0,0,93,3,0,0,115,2,0,0,0,0,2,122,28, - 95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,101, - 120,116,46,95,95,101,110,116,101,114,95,95,99,4,0,0, - 0,0,0,0,0,4,0,0,0,2,0,0,0,67,0,0, - 0,115,12,0,0,0,116,0,160,1,161,0,1,0,100,1, - 83,0,41,2,122,60,82,101,108,101,97,115,101,32,116,104, - 101,32,105,109,112,111,114,116,32,108,111,99,107,32,114,101, - 103,97,114,100,108,101,115,115,32,111,102,32,97,110,121,32, - 114,97,105,115,101,100,32,101,120,99,101,112,116,105,111,110, - 115,46,78,41,2,114,49,0,0,0,114,52,0,0,0,41, - 4,114,26,0,0,0,90,8,101,120,99,95,116,121,112,101, - 90,9,101,120,99,95,118,97,108,117,101,90,13,101,120,99, - 95,116,114,97,99,101,98,97,99,107,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,48,0,0,0,97,3, - 0,0,115,2,0,0,0,0,2,122,27,95,73,109,112,111, - 114,116,76,111,99,107,67,111,110,116,101,120,116,46,95,95, - 101,120,105,116,95,95,78,41,6,114,1,0,0,0,114,0, - 0,0,0,114,2,0,0,0,114,3,0,0,0,114,46,0, - 0,0,114,48,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,151,0,0,0, - 89,3,0,0,115,6,0,0,0,8,2,4,2,8,4,114, - 151,0,0,0,99,3,0,0,0,0,0,0,0,5,0,0, - 0,5,0,0,0,67,0,0,0,115,64,0,0,0,124,1, - 160,0,100,1,124,2,100,2,24,0,161,2,125,3,116,1, - 124,3,131,1,124,2,107,0,114,36,116,2,100,3,131,1, - 130,1,124,3,100,4,25,0,125,4,124,0,114,60,100,5, - 160,3,124,4,124,0,161,2,83,0,124,4,83,0,41,6, - 122,50,82,101,115,111,108,118,101,32,97,32,114,101,108,97, - 116,105,118,101,32,109,111,100,117,108,101,32,110,97,109,101, - 32,116,111,32,97,110,32,97,98,115,111,108,117,116,101,32, - 111,110,101,46,114,111,0,0,0,114,33,0,0,0,122,50, - 97,116,116,101,109,112,116,101,100,32,114,101,108,97,116,105, - 118,101,32,105,109,112,111,114,116,32,98,101,121,111,110,100, - 32,116,111,112,45,108,101,118,101,108,32,112,97,99,107,97, - 103,101,114,19,0,0,0,122,5,123,125,46,123,125,41,4, - 218,6,114,115,112,108,105,116,218,3,108,101,110,218,10,86, - 97,108,117,101,69,114,114,111,114,114,38,0,0,0,41,5, - 114,15,0,0,0,218,7,112,97,99,107,97,103,101,218,5, - 108,101,118,101,108,90,4,98,105,116,115,90,4,98,97,115, - 101,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,13,95,114,101,115,111,108,118,101,95,110,97,109,101,102, - 3,0,0,115,10,0,0,0,0,2,16,1,12,1,8,1, - 8,1,114,157,0,0,0,99,3,0,0,0,0,0,0,0, - 4,0,0,0,4,0,0,0,67,0,0,0,115,34,0,0, - 0,124,0,160,0,124,1,124,2,161,2,125,3,124,3,100, - 0,107,8,114,24,100,0,83,0,116,1,124,1,124,3,131, - 2,83,0,41,1,78,41,2,114,141,0,0,0,114,78,0, - 0,0,41,4,218,6,102,105,110,100,101,114,114,15,0,0, - 0,114,138,0,0,0,114,93,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,218,17,95,102,105,110, - 100,95,115,112,101,99,95,108,101,103,97,99,121,111,3,0, - 0,115,8,0,0,0,0,3,12,1,8,1,4,1,114,159, - 0,0,0,99,3,0,0,0,0,0,0,0,10,0,0,0, - 10,0,0,0,67,0,0,0,115,12,1,0,0,116,0,106, - 1,125,3,124,3,100,1,107,8,114,22,116,2,100,2,131, - 1,130,1,124,3,115,38,116,3,160,4,100,3,116,5,161, - 2,1,0,124,0,116,0,106,6,107,6,125,4,124,3,68, - 0,93,210,125,5,116,7,131,0,143,84,1,0,122,10,124, - 5,106,8,125,6,87,0,110,54,4,0,116,9,107,10,114, - 128,1,0,1,0,1,0,116,10,124,5,124,0,124,1,131, - 3,125,7,124,7,100,1,107,8,114,124,89,0,87,0,53, - 0,81,0,82,0,163,0,113,52,89,0,110,14,88,0,124, - 6,124,0,124,1,124,2,131,3,125,7,87,0,53,0,81, - 0,82,0,88,0,124,7,100,1,107,9,114,52,124,4,144, - 0,115,254,124,0,116,0,106,6,107,6,144,0,114,254,116, - 0,106,6,124,0,25,0,125,8,122,10,124,8,106,11,125, - 9,87,0,110,28,4,0,116,9,107,10,114,226,1,0,1, - 0,1,0,124,7,6,0,89,0,2,0,1,0,83,0,88, - 0,124,9,100,1,107,8,114,244,124,7,2,0,1,0,83, - 0,124,9,2,0,1,0,83,0,113,52,124,7,2,0,1, - 0,83,0,113,52,100,1,83,0,41,4,122,21,70,105,110, - 100,32,97,32,109,111,100,117,108,101,39,115,32,115,112,101, - 99,46,78,122,53,115,121,115,46,109,101,116,97,95,112,97, - 116,104,32,105,115,32,78,111,110,101,44,32,80,121,116,104, - 111,110,32,105,115,32,108,105,107,101,108,121,32,115,104,117, - 116,116,105,110,103,32,100,111,119,110,122,22,115,121,115,46, - 109,101,116,97,95,112,97,116,104,32,105,115,32,101,109,112, - 116,121,41,12,114,14,0,0,0,218,9,109,101,116,97,95, - 112,97,116,104,114,70,0,0,0,218,9,95,119,97,114,110, - 105,110,103,115,218,4,119,97,114,110,218,13,73,109,112,111, - 114,116,87,97,114,110,105,110,103,114,79,0,0,0,114,151, - 0,0,0,114,140,0,0,0,114,90,0,0,0,114,159,0, - 0,0,114,89,0,0,0,41,10,114,15,0,0,0,114,138, - 0,0,0,114,139,0,0,0,114,160,0,0,0,90,9,105, - 115,95,114,101,108,111,97,100,114,158,0,0,0,114,140,0, - 0,0,114,82,0,0,0,114,83,0,0,0,114,89,0,0, + 86,0,0,0,204,2,0,0,115,2,0,0,0,0,7,122, + 27,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, + 46,109,111,100,117,108,101,95,114,101,112,114,78,99,4,0, + 0,0,0,0,0,0,4,0,0,0,5,0,0,0,67,0, + 0,0,115,44,0,0,0,124,2,100,0,107,9,114,12,100, + 0,83,0,116,0,160,1,124,1,161,1,114,36,116,2,124, + 1,124,0,100,1,100,2,141,3,83,0,100,0,83,0,100, + 0,83,0,41,3,78,122,8,98,117,105,108,116,45,105,110, + 41,1,114,97,0,0,0,41,3,114,49,0,0,0,90,10, + 105,115,95,98,117,105,108,116,105,110,114,78,0,0,0,41, + 4,218,3,99,108,115,114,71,0,0,0,218,4,112,97,116, + 104,218,6,116,97,114,103,101,116,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,9,102,105,110,100,95,115, + 112,101,99,213,2,0,0,115,10,0,0,0,0,2,8,1, + 4,1,10,1,14,2,122,25,66,117,105,108,116,105,110,73, + 109,112,111,114,116,101,114,46,102,105,110,100,95,115,112,101, + 99,99,3,0,0,0,0,0,0,0,4,0,0,0,4,0, + 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, + 1,124,2,161,2,125,3,124,3,100,1,107,9,114,26,124, + 3,106,1,83,0,100,1,83,0,41,2,122,175,70,105,110, + 100,32,116,104,101,32,98,117,105,108,116,45,105,110,32,109, + 111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,32, + 73,102,32,39,112,97,116,104,39,32,105,115,32,101,118,101, + 114,32,115,112,101,99,105,102,105,101,100,32,116,104,101,110, + 32,116,104,101,32,115,101,97,114,99,104,32,105,115,32,99, + 111,110,115,105,100,101,114,101,100,32,97,32,102,97,105,108, + 117,114,101,46,10,10,32,32,32,32,32,32,32,32,84,104, + 105,115,32,109,101,116,104,111,100,32,105,115,32,100,101,112, + 114,101,99,97,116,101,100,46,32,32,85,115,101,32,102,105, + 110,100,95,115,112,101,99,40,41,32,105,110,115,116,101,97, + 100,46,10,10,32,32,32,32,32,32,32,32,78,41,2,114, + 140,0,0,0,114,93,0,0,0,41,4,114,137,0,0,0, + 114,71,0,0,0,114,138,0,0,0,114,82,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,11, + 102,105,110,100,95,109,111,100,117,108,101,222,2,0,0,115, + 4,0,0,0,0,9,12,1,122,27,66,117,105,108,116,105, + 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,109, + 111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0, + 0,0,4,0,0,0,67,0,0,0,115,46,0,0,0,124, + 1,106,0,116,1,106,2,107,7,114,34,116,3,100,1,160, + 4,124,1,106,0,161,1,124,1,106,0,100,2,141,2,130, + 1,116,5,116,6,106,7,124,1,131,2,83,0,41,3,122, + 24,67,114,101,97,116,101,32,97,32,98,117,105,108,116,45, + 105,110,32,109,111,100,117,108,101,122,29,123,33,114,125,32, + 105,115,32,110,111,116,32,97,32,98,117,105,108,116,45,105, + 110,32,109,111,100,117,108,101,41,1,114,15,0,0,0,41, + 8,114,15,0,0,0,114,14,0,0,0,114,69,0,0,0, + 114,70,0,0,0,114,38,0,0,0,114,59,0,0,0,114, + 49,0,0,0,90,14,99,114,101,97,116,101,95,98,117,105, + 108,116,105,110,41,2,114,26,0,0,0,114,82,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 128,0,0,0,234,2,0,0,115,10,0,0,0,0,3,12, + 1,12,1,4,255,6,2,122,29,66,117,105,108,116,105,110, + 73,109,112,111,114,116,101,114,46,99,114,101,97,116,101,95, + 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,67,0,0,0,115,16,0,0,0, + 116,0,116,1,106,2,124,1,131,2,1,0,100,1,83,0, + 41,2,122,22,69,120,101,99,32,97,32,98,117,105,108,116, + 45,105,110,32,109,111,100,117,108,101,78,41,3,114,59,0, + 0,0,114,49,0,0,0,90,12,101,120,101,99,95,98,117, + 105,108,116,105,110,41,2,114,26,0,0,0,114,83,0,0, 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,10,95,102,105,110,100,95,115,112,101,99,120,3,0,0, - 115,54,0,0,0,0,2,6,1,8,2,8,3,4,1,12, - 5,10,1,8,1,8,1,2,1,10,1,14,1,12,1,8, - 1,20,2,22,1,8,2,18,1,10,1,2,1,10,1,14, - 4,14,2,8,1,8,2,10,2,10,2,114,164,0,0,0, - 99,3,0,0,0,0,0,0,0,3,0,0,0,5,0,0, - 0,67,0,0,0,115,108,0,0,0,116,0,124,0,116,1, - 131,2,115,28,116,2,100,1,160,3,116,4,124,0,131,1, - 161,1,131,1,130,1,124,2,100,2,107,0,114,44,116,5, - 100,3,131,1,130,1,124,2,100,2,107,4,114,84,116,0, - 124,1,116,1,131,2,115,72,116,2,100,4,131,1,130,1, - 110,12,124,1,115,84,116,6,100,5,131,1,130,1,124,0, - 115,104,124,2,100,2,107,2,114,104,116,5,100,6,131,1, - 130,1,100,7,83,0,41,8,122,28,86,101,114,105,102,121, - 32,97,114,103,117,109,101,110,116,115,32,97,114,101,32,34, - 115,97,110,101,34,46,122,31,109,111,100,117,108,101,32,110, - 97,109,101,32,109,117,115,116,32,98,101,32,115,116,114,44, - 32,110,111,116,32,123,125,114,19,0,0,0,122,18,108,101, - 118,101,108,32,109,117,115,116,32,98,101,32,62,61,32,48, - 122,31,95,95,112,97,99,107,97,103,101,95,95,32,110,111, - 116,32,115,101,116,32,116,111,32,97,32,115,116,114,105,110, - 103,122,54,97,116,116,101,109,112,116,101,100,32,114,101,108, - 97,116,105,118,101,32,105,109,112,111,114,116,32,119,105,116, - 104,32,110,111,32,107,110,111,119,110,32,112,97,114,101,110, - 116,32,112,97,99,107,97,103,101,122,17,69,109,112,116,121, - 32,109,111,100,117,108,101,32,110,97,109,101,78,41,7,218, - 10,105,115,105,110,115,116,97,110,99,101,218,3,115,116,114, - 218,9,84,121,112,101,69,114,114,111,114,114,38,0,0,0, - 114,13,0,0,0,114,154,0,0,0,114,70,0,0,0,41, - 3,114,15,0,0,0,114,155,0,0,0,114,156,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 13,95,115,97,110,105,116,121,95,99,104,101,99,107,167,3, - 0,0,115,22,0,0,0,0,2,10,1,18,1,8,1,8, - 1,8,1,10,1,10,1,4,1,8,2,12,1,114,168,0, - 0,0,122,16,78,111,32,109,111,100,117,108,101,32,110,97, - 109,101,100,32,122,4,123,33,114,125,99,2,0,0,0,0, - 0,0,0,8,0,0,0,8,0,0,0,67,0,0,0,115, - 220,0,0,0,100,0,125,2,124,0,160,0,100,1,161,1, - 100,2,25,0,125,3,124,3,114,134,124,3,116,1,106,2, - 107,7,114,42,116,3,124,1,124,3,131,2,1,0,124,0, - 116,1,106,2,107,6,114,62,116,1,106,2,124,0,25,0, - 83,0,116,1,106,2,124,3,25,0,125,4,122,10,124,4, - 106,4,125,2,87,0,110,50,4,0,116,5,107,10,114,132, - 1,0,1,0,1,0,116,6,100,3,23,0,160,7,124,0, - 124,3,161,2,125,5,116,8,124,5,124,0,100,4,141,2, - 100,0,130,2,89,0,110,2,88,0,116,9,124,0,124,2, - 131,2,125,6,124,6,100,0,107,8,114,172,116,8,116,6, - 160,7,124,0,161,1,124,0,100,4,141,2,130,1,110,8, - 116,10,124,6,131,1,125,7,124,3,114,216,116,1,106,2, - 124,3,25,0,125,4,116,11,124,4,124,0,160,0,100,1, - 161,1,100,5,25,0,124,7,131,3,1,0,124,7,83,0, - 41,6,78,114,111,0,0,0,114,19,0,0,0,122,23,59, - 32,123,33,114,125,32,105,115,32,110,111,116,32,97,32,112, - 97,99,107,97,103,101,41,1,114,15,0,0,0,233,2,0, - 0,0,41,12,114,112,0,0,0,114,14,0,0,0,114,79, - 0,0,0,114,59,0,0,0,114,121,0,0,0,114,90,0, - 0,0,218,8,95,69,82,82,95,77,83,71,114,38,0,0, - 0,218,19,77,111,100,117,108,101,78,111,116,70,111,117,110, - 100,69,114,114,111,114,114,164,0,0,0,114,135,0,0,0, - 114,5,0,0,0,41,8,114,15,0,0,0,218,7,105,109, - 112,111,114,116,95,114,138,0,0,0,114,113,0,0,0,90, - 13,112,97,114,101,110,116,95,109,111,100,117,108,101,114,133, - 0,0,0,114,82,0,0,0,114,83,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,23,95,102, - 105,110,100,95,97,110,100,95,108,111,97,100,95,117,110,108, - 111,99,107,101,100,186,3,0,0,115,42,0,0,0,0,1, - 4,1,14,1,4,1,10,1,10,2,10,1,10,1,10,1, - 2,1,10,1,14,1,16,1,20,1,10,1,8,1,20,2, - 8,1,4,2,10,1,22,1,114,173,0,0,0,99,2,0, - 0,0,0,0,0,0,4,0,0,0,10,0,0,0,67,0, - 0,0,115,106,0,0,0,116,0,124,0,131,1,143,50,1, - 0,116,1,106,2,160,3,124,0,116,4,161,2,125,2,124, - 2,116,4,107,8,114,54,116,5,124,0,124,1,131,2,87, - 0,2,0,53,0,81,0,82,0,163,0,83,0,87,0,53, - 0,81,0,82,0,88,0,124,2,100,1,107,8,114,94,100, - 2,160,6,124,0,161,1,125,3,116,7,124,3,124,0,100, - 3,141,2,130,1,116,8,124,0,131,1,1,0,124,2,83, - 0,41,4,122,25,70,105,110,100,32,97,110,100,32,108,111, - 97,100,32,116,104,101,32,109,111,100,117,108,101,46,78,122, - 40,105,109,112,111,114,116,32,111,102,32,123,125,32,104,97, - 108,116,101,100,59,32,78,111,110,101,32,105,110,32,115,121, - 115,46,109,111,100,117,108,101,115,41,1,114,15,0,0,0, - 41,9,114,42,0,0,0,114,14,0,0,0,114,79,0,0, - 0,114,30,0,0,0,218,14,95,78,69,69,68,83,95,76, - 79,65,68,73,78,71,114,173,0,0,0,114,38,0,0,0, - 114,171,0,0,0,114,57,0,0,0,41,4,114,15,0,0, - 0,114,172,0,0,0,114,83,0,0,0,114,67,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 14,95,102,105,110,100,95,97,110,100,95,108,111,97,100,216, - 3,0,0,115,22,0,0,0,0,2,10,1,14,1,8,1, - 32,2,8,1,4,1,2,255,4,2,12,2,8,1,114,175, - 0,0,0,114,19,0,0,0,99,3,0,0,0,0,0,0, - 0,3,0,0,0,4,0,0,0,67,0,0,0,115,42,0, - 0,0,116,0,124,0,124,1,124,2,131,3,1,0,124,2, - 100,1,107,4,114,32,116,1,124,0,124,1,124,2,131,3, - 125,0,116,2,124,0,116,3,131,2,83,0,41,2,97,50, - 1,0,0,73,109,112,111,114,116,32,97,110,100,32,114,101, - 116,117,114,110,32,116,104,101,32,109,111,100,117,108,101,32, - 98,97,115,101,100,32,111,110,32,105,116,115,32,110,97,109, - 101,44,32,116,104,101,32,112,97,99,107,97,103,101,32,116, - 104,101,32,99,97,108,108,32,105,115,10,32,32,32,32,98, - 101,105,110,103,32,109,97,100,101,32,102,114,111,109,44,32, - 97,110,100,32,116,104,101,32,108,101,118,101,108,32,97,100, - 106,117,115,116,109,101,110,116,46,10,10,32,32,32,32,84, - 104,105,115,32,102,117,110,99,116,105,111,110,32,114,101,112, - 114,101,115,101,110,116,115,32,116,104,101,32,103,114,101,97, - 116,101,115,116,32,99,111,109,109,111,110,32,100,101,110,111, - 109,105,110,97,116,111,114,32,111,102,32,102,117,110,99,116, - 105,111,110,97,108,105,116,121,10,32,32,32,32,98,101,116, - 119,101,101,110,32,105,109,112,111,114,116,95,109,111,100,117, - 108,101,32,97,110,100,32,95,95,105,109,112,111,114,116,95, - 95,46,32,84,104,105,115,32,105,110,99,108,117,100,101,115, - 32,115,101,116,116,105,110,103,32,95,95,112,97,99,107,97, - 103,101,95,95,32,105,102,10,32,32,32,32,116,104,101,32, - 108,111,97,100,101,114,32,100,105,100,32,110,111,116,46,10, - 10,32,32,32,32,114,19,0,0,0,41,4,114,168,0,0, - 0,114,157,0,0,0,114,175,0,0,0,218,11,95,103,99, - 100,95,105,109,112,111,114,116,41,3,114,15,0,0,0,114, - 155,0,0,0,114,156,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,176,0,0,0,232,3,0, - 0,115,8,0,0,0,0,9,12,1,8,1,12,1,114,176, - 0,0,0,41,1,218,9,114,101,99,117,114,115,105,118,101, - 99,3,0,0,0,1,0,0,0,8,0,0,0,11,0,0, - 0,67,0,0,0,115,226,0,0,0,124,1,68,0,93,216, - 125,4,116,0,124,4,116,1,131,2,115,66,124,3,114,34, - 124,0,106,2,100,1,23,0,125,5,110,4,100,2,125,5, - 116,3,100,3,124,5,155,0,100,4,116,4,124,4,131,1, - 106,2,155,0,157,4,131,1,130,1,110,154,124,4,100,5, - 107,2,114,108,124,3,115,106,116,5,124,0,100,6,131,2, - 114,106,116,6,124,0,124,0,106,7,124,2,100,7,100,8, - 141,4,1,0,110,112,116,5,124,0,124,4,131,2,115,220, - 100,9,160,8,124,0,106,2,124,4,161,2,125,6,122,14, - 116,9,124,2,124,6,131,2,1,0,87,0,110,72,4,0, - 116,10,107,10,114,218,1,0,125,7,1,0,122,42,124,7, - 106,11,124,6,107,2,114,200,116,12,106,13,160,14,124,6, - 116,15,161,2,100,10,107,9,114,200,87,0,89,0,162,8, - 113,4,130,0,87,0,53,0,100,10,125,7,126,7,88,0, - 89,0,110,2,88,0,113,4,124,0,83,0,41,11,122,238, - 70,105,103,117,114,101,32,111,117,116,32,119,104,97,116,32, - 95,95,105,109,112,111,114,116,95,95,32,115,104,111,117,108, - 100,32,114,101,116,117,114,110,46,10,10,32,32,32,32,84, - 104,101,32,105,109,112,111,114,116,95,32,112,97,114,97,109, - 101,116,101,114,32,105,115,32,97,32,99,97,108,108,97,98, - 108,101,32,119,104,105,99,104,32,116,97,107,101,115,32,116, - 104,101,32,110,97,109,101,32,111,102,32,109,111,100,117,108, - 101,32,116,111,10,32,32,32,32,105,109,112,111,114,116,46, - 32,73,116,32,105,115,32,114,101,113,117,105,114,101,100,32, - 116,111,32,100,101,99,111,117,112,108,101,32,116,104,101,32, - 102,117,110,99,116,105,111,110,32,102,114,111,109,32,97,115, - 115,117,109,105,110,103,32,105,109,112,111,114,116,108,105,98, - 39,115,10,32,32,32,32,105,109,112,111,114,116,32,105,109, - 112,108,101,109,101,110,116,97,116,105,111,110,32,105,115,32, - 100,101,115,105,114,101,100,46,10,10,32,32,32,32,122,8, - 46,95,95,97,108,108,95,95,122,13,96,96,102,114,111,109, - 32,108,105,115,116,39,39,122,8,73,116,101,109,32,105,110, - 32,122,18,32,109,117,115,116,32,98,101,32,115,116,114,44, - 32,110,111,116,32,250,1,42,218,7,95,95,97,108,108,95, - 95,84,41,1,114,177,0,0,0,122,5,123,125,46,123,125, - 78,41,16,114,165,0,0,0,114,166,0,0,0,114,1,0, - 0,0,114,167,0,0,0,114,13,0,0,0,114,4,0,0, - 0,218,16,95,104,97,110,100,108,101,95,102,114,111,109,108, - 105,115,116,114,179,0,0,0,114,38,0,0,0,114,59,0, - 0,0,114,171,0,0,0,114,15,0,0,0,114,14,0,0, - 0,114,79,0,0,0,114,30,0,0,0,114,174,0,0,0, - 41,8,114,83,0,0,0,218,8,102,114,111,109,108,105,115, - 116,114,172,0,0,0,114,177,0,0,0,218,1,120,90,5, - 119,104,101,114,101,90,9,102,114,111,109,95,110,97,109,101, - 90,3,101,120,99,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,114,180,0,0,0,247,3,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,16,4,10,1,16,255,2,2,8,1,22,1,114,180, - 0,0,0,99,1,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,107,9,114,82,124,2,100,3,107,9,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,107,9,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,107,7,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,124,0,0,0,114, - 89,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,121,0,0,0,114,111,0,0,0,114,19,0, - 0,0,41,6,114,30,0,0,0,114,113,0,0,0,114,161, - 0,0,0,114,162,0,0,0,114,163,0,0,0,114,112,0, - 0,0,41,3,218,7,103,108,111,98,97,108,115,114,155,0, + 114,129,0,0,0,242,2,0,0,115,2,0,0,0,0,3, + 122,27,66,117,105,108,116,105,110,73,109,112,111,114,116,101, + 114,46,101,120,101,99,95,109,111,100,117,108,101,99,2,0, + 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,115,4,0,0,0,100,1,83,0,41,2,122,57,82, + 101,116,117,114,110,32,78,111,110,101,32,97,115,32,98,117, + 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,100, + 111,32,110,111,116,32,104,97,118,101,32,99,111,100,101,32, + 111,98,106,101,99,116,115,46,78,114,10,0,0,0,41,2, + 114,137,0,0,0,114,71,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,8,103,101,116,95,99, + 111,100,101,247,2,0,0,115,2,0,0,0,0,4,122,24, + 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,46, + 103,101,116,95,99,111,100,101,99,2,0,0,0,0,0,0, + 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, + 0,0,100,1,83,0,41,2,122,56,82,101,116,117,114,110, + 32,78,111,110,101,32,97,115,32,98,117,105,108,116,45,105, + 110,32,109,111,100,117,108,101,115,32,100,111,32,110,111,116, + 32,104,97,118,101,32,115,111,117,114,99,101,32,99,111,100, + 101,46,78,114,10,0,0,0,41,2,114,137,0,0,0,114, + 71,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,253, + 2,0,0,115,2,0,0,0,0,4,122,26,66,117,105,108, + 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, + 115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, + 100,1,83,0,41,2,122,52,82,101,116,117,114,110,32,70, + 97,108,115,101,32,97,115,32,98,117,105,108,116,45,105,110, + 32,109,111,100,117,108,101,115,32,97,114,101,32,110,101,118, + 101,114,32,112,97,99,107,97,103,101,115,46,70,114,10,0, + 0,0,41,2,114,137,0,0,0,114,71,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,99,0, + 0,0,3,3,0,0,115,2,0,0,0,0,4,122,26,66, + 117,105,108,116,105,110,73,109,112,111,114,116,101,114,46,105, + 115,95,112,97,99,107,97,103,101,41,2,78,78,41,1,78, + 41,17,114,1,0,0,0,114,0,0,0,0,114,2,0,0, + 0,114,3,0,0,0,218,12,115,116,97,116,105,99,109,101, + 116,104,111,100,114,86,0,0,0,218,11,99,108,97,115,115, + 109,101,116,104,111,100,114,140,0,0,0,114,141,0,0,0, + 114,128,0,0,0,114,129,0,0,0,114,74,0,0,0,114, + 142,0,0,0,114,143,0,0,0,114,99,0,0,0,114,84, + 0,0,0,114,131,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,136,0,0, + 0,195,2,0,0,115,42,0,0,0,8,7,4,2,2,1, + 10,8,2,1,12,8,2,1,12,11,2,1,10,7,2,1, + 10,4,2,1,2,1,12,4,2,1,2,1,12,4,2,1, + 2,1,12,4,114,136,0,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,4,0,0,0,64,0,0,0,115,140, + 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,101, + 4,100,2,100,3,132,0,131,1,90,5,101,6,100,21,100, + 5,100,6,132,1,131,1,90,7,101,6,100,22,100,7,100, + 8,132,1,131,1,90,8,101,6,100,9,100,10,132,0,131, + 1,90,9,101,4,100,11,100,12,132,0,131,1,90,10,101, + 6,100,13,100,14,132,0,131,1,90,11,101,6,101,12,100, + 15,100,16,132,0,131,1,131,1,90,13,101,6,101,12,100, + 17,100,18,132,0,131,1,131,1,90,14,101,6,101,12,100, + 19,100,20,132,0,131,1,131,1,90,15,100,4,83,0,41, + 23,218,14,70,114,111,122,101,110,73,109,112,111,114,116,101, + 114,122,142,77,101,116,97,32,112,97,116,104,32,105,109,112, + 111,114,116,32,102,111,114,32,102,114,111,122,101,110,32,109, + 111,100,117,108,101,115,46,10,10,32,32,32,32,65,108,108, + 32,109,101,116,104,111,100,115,32,97,114,101,32,101,105,116, + 104,101,114,32,99,108,97,115,115,32,111,114,32,115,116,97, + 116,105,99,32,109,101,116,104,111,100,115,32,116,111,32,97, + 118,111,105,100,32,116,104,101,32,110,101,101,100,32,116,111, + 10,32,32,32,32,105,110,115,116,97,110,116,105,97,116,101, + 32,116,104,101,32,99,108,97,115,115,46,10,10,32,32,32, + 32,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, + 0,0,67,0,0,0,115,12,0,0,0,100,1,160,0,124, + 0,106,1,161,1,83,0,41,2,122,115,82,101,116,117,114, + 110,32,114,101,112,114,32,102,111,114,32,116,104,101,32,109, + 111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,32, + 84,104,101,32,109,101,116,104,111,100,32,105,115,32,100,101, + 112,114,101,99,97,116,101,100,46,32,32,84,104,101,32,105, + 109,112,111,114,116,32,109,97,99,104,105,110,101,114,121,32, + 100,111,101,115,32,116,104,101,32,106,111,98,32,105,116,115, + 101,108,102,46,10,10,32,32,32,32,32,32,32,32,122,22, + 60,109,111,100,117,108,101,32,123,33,114,125,32,40,102,114, + 111,122,101,110,41,62,41,2,114,38,0,0,0,114,1,0, + 0,0,41,1,218,1,109,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,86,0,0,0,21,3,0,0,115, + 2,0,0,0,0,7,122,26,70,114,111,122,101,110,73,109, + 112,111,114,116,101,114,46,109,111,100,117,108,101,95,114,101, + 112,114,78,99,4,0,0,0,0,0,0,0,4,0,0,0, + 5,0,0,0,67,0,0,0,115,32,0,0,0,116,0,160, + 1,124,1,161,1,114,24,116,2,124,1,124,0,100,1,100, + 2,141,3,83,0,100,0,83,0,100,0,83,0,41,3,78, + 90,6,102,114,111,122,101,110,41,1,114,97,0,0,0,41, + 3,114,49,0,0,0,114,75,0,0,0,114,78,0,0,0, + 41,4,114,137,0,0,0,114,71,0,0,0,114,138,0,0, + 0,114,139,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,140,0,0,0,30,3,0,0,115,6, + 0,0,0,0,2,10,1,14,2,122,24,70,114,111,122,101, + 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,115, + 112,101,99,99,3,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,18,0,0,0,116,0,160, + 1,124,1,161,1,114,14,124,0,83,0,100,1,83,0,41, + 2,122,93,70,105,110,100,32,97,32,102,114,111,122,101,110, + 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32, + 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, + 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, + 101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,110, + 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, + 78,41,2,114,49,0,0,0,114,75,0,0,0,41,3,114, + 137,0,0,0,114,71,0,0,0,114,138,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,141,0, + 0,0,37,3,0,0,115,2,0,0,0,0,7,122,26,70, + 114,111,122,101,110,73,109,112,111,114,116,101,114,46,102,105, + 110,100,95,109,111,100,117,108,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, + 0,0,0,100,1,83,0,41,2,122,42,85,115,101,32,100, + 101,102,97,117,108,116,32,115,101,109,97,110,116,105,99,115, + 32,102,111,114,32,109,111,100,117,108,101,32,99,114,101,97, + 116,105,111,110,46,78,114,10,0,0,0,41,2,114,137,0, 0,0,114,82,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,28,4,0,0,115,38,0, - 0,0,0,7,10,1,10,1,8,1,18,1,22,2,2,0, - 2,254,6,3,4,1,8,1,6,2,6,2,2,0,2,254, - 6,3,8,1,8,1,14,1,114,186,0,0,0,114,10,0, - 0,0,99,5,0,0,0,0,0,0,0,9,0,0,0,5, - 0,0,0,67,0,0,0,115,180,0,0,0,124,4,100,1, - 107,2,114,18,116,0,124,0,131,1,125,5,110,36,124,1, - 100,2,107,9,114,30,124,1,110,2,105,0,125,6,116,1, - 124,6,131,1,125,7,116,0,124,0,124,7,124,4,131,3, - 125,5,124,3,115,150,124,4,100,1,107,2,114,84,116,0, - 124,0,160,2,100,3,161,1,100,1,25,0,131,1,83,0, - 124,0,115,92,124,5,83,0,116,3,124,0,131,1,116,3, - 124,0,160,2,100,3,161,1,100,1,25,0,131,1,24,0, - 125,8,116,4,106,5,124,5,106,6,100,2,116,3,124,5, - 106,6,131,1,124,8,24,0,133,2,25,0,25,0,83,0, - 110,26,116,7,124,5,100,4,131,2,114,172,116,8,124,5, - 124,3,116,0,131,3,83,0,124,5,83,0,100,2,83,0, - 41,5,97,215,1,0,0,73,109,112,111,114,116,32,97,32, - 109,111,100,117,108,101,46,10,10,32,32,32,32,84,104,101, - 32,39,103,108,111,98,97,108,115,39,32,97,114,103,117,109, - 101,110,116,32,105,115,32,117,115,101,100,32,116,111,32,105, - 110,102,101,114,32,119,104,101,114,101,32,116,104,101,32,105, - 109,112,111,114,116,32,105,115,32,111,99,99,117,114,114,105, - 110,103,32,102,114,111,109,10,32,32,32,32,116,111,32,104, - 97,110,100,108,101,32,114,101,108,97,116,105,118,101,32,105, - 109,112,111,114,116,115,46,32,84,104,101,32,39,108,111,99, - 97,108,115,39,32,97,114,103,117,109,101,110,116,32,105,115, - 32,105,103,110,111,114,101,100,46,32,84,104,101,10,32,32, - 32,32,39,102,114,111,109,108,105,115,116,39,32,97,114,103, - 117,109,101,110,116,32,115,112,101,99,105,102,105,101,115,32, - 119,104,97,116,32,115,104,111,117,108,100,32,101,120,105,115, - 116,32,97,115,32,97,116,116,114,105,98,117,116,101,115,32, - 111,110,32,116,104,101,32,109,111,100,117,108,101,10,32,32, - 32,32,98,101,105,110,103,32,105,109,112,111,114,116,101,100, - 32,40,101,46,103,46,32,96,96,102,114,111,109,32,109,111, - 100,117,108,101,32,105,109,112,111,114,116,32,60,102,114,111, - 109,108,105,115,116,62,96,96,41,46,32,32,84,104,101,32, - 39,108,101,118,101,108,39,10,32,32,32,32,97,114,103,117, - 109,101,110,116,32,114,101,112,114,101,115,101,110,116,115,32, - 116,104,101,32,112,97,99,107,97,103,101,32,108,111,99,97, - 116,105,111,110,32,116,111,32,105,109,112,111,114,116,32,102, - 114,111,109,32,105,110,32,97,32,114,101,108,97,116,105,118, - 101,10,32,32,32,32,105,109,112,111,114,116,32,40,101,46, - 103,46,32,96,96,102,114,111,109,32,46,46,112,107,103,32, - 105,109,112,111,114,116,32,109,111,100,96,96,32,119,111,117, - 108,100,32,104,97,118,101,32,97,32,39,108,101,118,101,108, - 39,32,111,102,32,50,41,46,10,10,32,32,32,32,114,19, - 0,0,0,78,114,111,0,0,0,114,121,0,0,0,41,9, - 114,176,0,0,0,114,186,0,0,0,218,9,112,97,114,116, - 105,116,105,111,110,114,153,0,0,0,114,14,0,0,0,114, - 79,0,0,0,114,1,0,0,0,114,4,0,0,0,114,180, - 0,0,0,41,9,114,15,0,0,0,114,185,0,0,0,218, - 6,108,111,99,97,108,115,114,181,0,0,0,114,156,0,0, - 0,114,83,0,0,0,90,8,103,108,111,98,97,108,115,95, - 114,155,0,0,0,90,7,99,117,116,95,111,102,102,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,10,95, - 95,105,109,112,111,114,116,95,95,55,4,0,0,115,30,0, - 0,0,0,11,8,1,10,2,16,1,8,1,12,1,4,3, - 8,1,18,1,4,1,4,4,26,3,32,1,10,1,12,2, - 114,189,0,0,0,99,1,0,0,0,0,0,0,0,2,0, - 0,0,3,0,0,0,67,0,0,0,115,38,0,0,0,116, - 0,160,1,124,0,161,1,125,1,124,1,100,0,107,8,114, - 30,116,2,100,1,124,0,23,0,131,1,130,1,116,3,124, - 1,131,1,83,0,41,2,78,122,25,110,111,32,98,117,105, - 108,116,45,105,110,32,109,111,100,117,108,101,32,110,97,109, - 101,100,32,41,4,114,136,0,0,0,114,140,0,0,0,114, - 70,0,0,0,114,135,0,0,0,41,2,114,15,0,0,0, + 0,114,11,0,0,0,114,128,0,0,0,46,3,0,0,115, + 2,0,0,0,0,2,122,28,70,114,111,122,101,110,73,109, + 112,111,114,116,101,114,46,99,114,101,97,116,101,95,109,111, + 100,117,108,101,99,1,0,0,0,0,0,0,0,3,0,0, + 0,4,0,0,0,67,0,0,0,115,64,0,0,0,124,0, + 106,0,106,1,125,1,116,2,160,3,124,1,161,1,115,36, + 116,4,100,1,160,5,124,1,161,1,124,1,100,2,141,2, + 130,1,116,6,116,2,106,7,124,1,131,2,125,2,116,8, + 124,2,124,0,106,9,131,2,1,0,100,0,83,0,41,3, + 78,122,27,123,33,114,125,32,105,115,32,110,111,116,32,97, + 32,102,114,111,122,101,110,32,109,111,100,117,108,101,41,1, + 114,15,0,0,0,41,10,114,89,0,0,0,114,15,0,0, + 0,114,49,0,0,0,114,75,0,0,0,114,70,0,0,0, + 114,38,0,0,0,114,59,0,0,0,218,17,103,101,116,95, + 102,114,111,122,101,110,95,111,98,106,101,99,116,218,4,101, + 120,101,99,114,7,0,0,0,41,3,114,83,0,0,0,114, + 15,0,0,0,218,4,99,111,100,101,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,129,0,0,0,50,3, + 0,0,115,14,0,0,0,0,2,8,1,10,1,10,1,2, + 255,6,2,12,1,122,26,70,114,111,122,101,110,73,109,112, + 111,114,116,101,114,46,101,120,101,99,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,10,0,0,0,116,0,124,0,124, + 1,131,2,83,0,41,1,122,95,76,111,97,100,32,97,32, + 102,114,111,122,101,110,32,109,111,100,117,108,101,46,10,10, + 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, + 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, + 100,46,32,32,85,115,101,32,101,120,101,99,95,109,111,100, + 117,108,101,40,41,32,105,110,115,116,101,97,100,46,10,10, + 32,32,32,32,32,32,32,32,41,1,114,84,0,0,0,41, + 2,114,137,0,0,0,114,71,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,131,0,0,0,59, + 3,0,0,115,2,0,0,0,0,7,122,26,70,114,111,122, + 101,110,73,109,112,111,114,116,101,114,46,108,111,97,100,95, + 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,67,0,0,0,115,10,0,0,0, + 116,0,160,1,124,1,161,1,83,0,41,1,122,45,82,101, + 116,117,114,110,32,116,104,101,32,99,111,100,101,32,111,98, + 106,101,99,116,32,102,111,114,32,116,104,101,32,102,114,111, + 122,101,110,32,109,111,100,117,108,101,46,41,2,114,49,0, + 0,0,114,148,0,0,0,41,2,114,137,0,0,0,114,71, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,142,0,0,0,68,3,0,0,115,2,0,0,0, + 0,4,122,23,70,114,111,122,101,110,73,109,112,111,114,116, + 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, + 0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0, + 115,4,0,0,0,100,1,83,0,41,2,122,54,82,101,116, + 117,114,110,32,78,111,110,101,32,97,115,32,102,114,111,122, + 101,110,32,109,111,100,117,108,101,115,32,100,111,32,110,111, + 116,32,104,97,118,101,32,115,111,117,114,99,101,32,99,111, + 100,101,46,78,114,10,0,0,0,41,2,114,137,0,0,0, + 114,71,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,143,0,0,0,74,3,0,0,115,2,0, + 0,0,0,4,122,25,70,114,111,122,101,110,73,109,112,111, + 114,116,101,114,46,103,101,116,95,115,111,117,114,99,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 67,0,0,0,115,10,0,0,0,116,0,160,1,124,1,161, + 1,83,0,41,1,122,46,82,101,116,117,114,110,32,84,114, + 117,101,32,105,102,32,116,104,101,32,102,114,111,122,101,110, + 32,109,111,100,117,108,101,32,105,115,32,97,32,112,97,99, + 107,97,103,101,46,41,2,114,49,0,0,0,90,17,105,115, + 95,102,114,111,122,101,110,95,112,97,99,107,97,103,101,41, + 2,114,137,0,0,0,114,71,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,114,99,0,0,0,80, + 3,0,0,115,2,0,0,0,0,4,122,25,70,114,111,122, + 101,110,73,109,112,111,114,116,101,114,46,105,115,95,112,97, + 99,107,97,103,101,41,2,78,78,41,1,78,41,16,114,1, + 0,0,0,114,0,0,0,0,114,2,0,0,0,114,3,0, + 0,0,114,144,0,0,0,114,86,0,0,0,114,145,0,0, + 0,114,140,0,0,0,114,141,0,0,0,114,128,0,0,0, + 114,129,0,0,0,114,131,0,0,0,114,77,0,0,0,114, + 142,0,0,0,114,143,0,0,0,114,99,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,146,0,0,0,12,3,0,0,115,44,0,0,0, + 8,7,4,2,2,1,10,8,2,1,12,6,2,1,12,8, + 2,1,10,3,2,1,10,8,2,1,10,8,2,1,2,1, + 12,4,2,1,2,1,12,4,2,1,2,1,114,146,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,64,0,0,0,115,32,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,100,3,132,0,90,4,100, + 4,100,5,132,0,90,5,100,6,83,0,41,7,218,18,95, + 73,109,112,111,114,116,76,111,99,107,67,111,110,116,101,120, + 116,122,36,67,111,110,116,101,120,116,32,109,97,110,97,103, + 101,114,32,102,111,114,32,116,104,101,32,105,109,112,111,114, + 116,32,108,111,99,107,46,99,1,0,0,0,0,0,0,0, + 1,0,0,0,2,0,0,0,67,0,0,0,115,12,0,0, + 0,116,0,160,1,161,0,1,0,100,1,83,0,41,2,122, + 24,65,99,113,117,105,114,101,32,116,104,101,32,105,109,112, + 111,114,116,32,108,111,99,107,46,78,41,2,114,49,0,0, + 0,114,50,0,0,0,41,1,114,26,0,0,0,114,10,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,46,0,0, + 0,93,3,0,0,115,2,0,0,0,0,2,122,28,95,73, + 109,112,111,114,116,76,111,99,107,67,111,110,116,101,120,116, + 46,95,95,101,110,116,101,114,95,95,99,4,0,0,0,0, + 0,0,0,4,0,0,0,2,0,0,0,67,0,0,0,115, + 12,0,0,0,116,0,160,1,161,0,1,0,100,1,83,0, + 41,2,122,60,82,101,108,101,97,115,101,32,116,104,101,32, + 105,109,112,111,114,116,32,108,111,99,107,32,114,101,103,97, + 114,100,108,101,115,115,32,111,102,32,97,110,121,32,114,97, + 105,115,101,100,32,101,120,99,101,112,116,105,111,110,115,46, + 78,41,2,114,49,0,0,0,114,52,0,0,0,41,4,114, + 26,0,0,0,90,8,101,120,99,95,116,121,112,101,90,9, + 101,120,99,95,118,97,108,117,101,90,13,101,120,99,95,116, + 114,97,99,101,98,97,99,107,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,48,0,0,0,97,3,0,0, + 115,2,0,0,0,0,2,122,27,95,73,109,112,111,114,116, + 76,111,99,107,67,111,110,116,101,120,116,46,95,95,101,120, + 105,116,95,95,78,41,6,114,1,0,0,0,114,0,0,0, + 0,114,2,0,0,0,114,3,0,0,0,114,46,0,0,0, + 114,48,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,114,151,0,0,0,89,3, + 0,0,115,6,0,0,0,8,2,4,2,8,4,114,151,0, + 0,0,99,3,0,0,0,0,0,0,0,5,0,0,0,5, + 0,0,0,67,0,0,0,115,64,0,0,0,124,1,160,0, + 100,1,124,2,100,2,24,0,161,2,125,3,116,1,124,3, + 131,1,124,2,107,0,114,36,116,2,100,3,131,1,130,1, + 124,3,100,4,25,0,125,4,124,0,114,60,100,5,160,3, + 124,4,124,0,161,2,83,0,124,4,83,0,41,6,122,50, + 82,101,115,111,108,118,101,32,97,32,114,101,108,97,116,105, + 118,101,32,109,111,100,117,108,101,32,110,97,109,101,32,116, + 111,32,97,110,32,97,98,115,111,108,117,116,101,32,111,110, + 101,46,114,111,0,0,0,114,33,0,0,0,122,50,97,116, + 116,101,109,112,116,101,100,32,114,101,108,97,116,105,118,101, + 32,105,109,112,111,114,116,32,98,101,121,111,110,100,32,116, + 111,112,45,108,101,118,101,108,32,112,97,99,107,97,103,101, + 114,19,0,0,0,122,5,123,125,46,123,125,41,4,218,6, + 114,115,112,108,105,116,218,3,108,101,110,218,10,86,97,108, + 117,101,69,114,114,111,114,114,38,0,0,0,41,5,114,15, + 0,0,0,218,7,112,97,99,107,97,103,101,218,5,108,101, + 118,101,108,90,4,98,105,116,115,90,4,98,97,115,101,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,13, + 95,114,101,115,111,108,118,101,95,110,97,109,101,102,3,0, + 0,115,10,0,0,0,0,2,16,1,12,1,8,1,8,1, + 114,157,0,0,0,99,3,0,0,0,0,0,0,0,4,0, + 0,0,4,0,0,0,67,0,0,0,115,34,0,0,0,124, + 0,160,0,124,1,124,2,161,2,125,3,124,3,100,0,107, + 8,114,24,100,0,83,0,116,1,124,1,124,3,131,2,83, + 0,41,1,78,41,2,114,141,0,0,0,114,78,0,0,0, + 41,4,218,6,102,105,110,100,101,114,114,15,0,0,0,114, + 138,0,0,0,114,93,0,0,0,114,10,0,0,0,114,10, + 0,0,0,114,11,0,0,0,218,17,95,102,105,110,100,95, + 115,112,101,99,95,108,101,103,97,99,121,111,3,0,0,115, + 8,0,0,0,0,3,12,1,8,1,4,1,114,159,0,0, + 0,99,3,0,0,0,0,0,0,0,10,0,0,0,10,0, + 0,0,67,0,0,0,115,12,1,0,0,116,0,106,1,125, + 3,124,3,100,1,107,8,114,22,116,2,100,2,131,1,130, + 1,124,3,115,38,116,3,160,4,100,3,116,5,161,2,1, + 0,124,0,116,0,106,6,107,6,125,4,124,3,68,0,93, + 210,125,5,116,7,131,0,143,84,1,0,122,10,124,5,106, + 8,125,6,87,0,110,54,4,0,116,9,107,10,114,128,1, + 0,1,0,1,0,116,10,124,5,124,0,124,1,131,3,125, + 7,124,7,100,1,107,8,114,124,89,0,87,0,53,0,81, + 0,82,0,163,0,113,52,89,0,110,14,88,0,124,6,124, + 0,124,1,124,2,131,3,125,7,87,0,53,0,81,0,82, + 0,88,0,124,7,100,1,107,9,114,52,124,4,144,0,115, + 254,124,0,116,0,106,6,107,6,144,0,114,254,116,0,106, + 6,124,0,25,0,125,8,122,10,124,8,106,11,125,9,87, + 0,110,28,4,0,116,9,107,10,114,226,1,0,1,0,1, + 0,124,7,6,0,89,0,2,0,1,0,83,0,88,0,124, + 9,100,1,107,8,114,244,124,7,2,0,1,0,83,0,124, + 9,2,0,1,0,83,0,113,52,124,7,2,0,1,0,83, + 0,113,52,100,1,83,0,41,4,122,21,70,105,110,100,32, + 97,32,109,111,100,117,108,101,39,115,32,115,112,101,99,46, + 78,122,53,115,121,115,46,109,101,116,97,95,112,97,116,104, + 32,105,115,32,78,111,110,101,44,32,80,121,116,104,111,110, + 32,105,115,32,108,105,107,101,108,121,32,115,104,117,116,116, + 105,110,103,32,100,111,119,110,122,22,115,121,115,46,109,101, + 116,97,95,112,97,116,104,32,105,115,32,101,109,112,116,121, + 41,12,114,14,0,0,0,218,9,109,101,116,97,95,112,97, + 116,104,114,70,0,0,0,218,9,95,119,97,114,110,105,110, + 103,115,218,4,119,97,114,110,218,13,73,109,112,111,114,116, + 87,97,114,110,105,110,103,114,79,0,0,0,114,151,0,0, + 0,114,140,0,0,0,114,90,0,0,0,114,159,0,0,0, + 114,89,0,0,0,41,10,114,15,0,0,0,114,138,0,0, + 0,114,139,0,0,0,114,160,0,0,0,90,9,105,115,95, + 114,101,108,111,97,100,114,158,0,0,0,114,140,0,0,0, + 114,82,0,0,0,114,83,0,0,0,114,89,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,10, + 95,102,105,110,100,95,115,112,101,99,120,3,0,0,115,54, + 0,0,0,0,2,6,1,8,2,8,3,4,1,12,5,10, + 1,8,1,8,1,2,1,10,1,14,1,12,1,8,1,20, + 2,22,1,8,2,18,1,10,1,2,1,10,1,14,4,14, + 2,8,1,8,2,10,2,10,2,114,164,0,0,0,99,3, + 0,0,0,0,0,0,0,3,0,0,0,5,0,0,0,67, + 0,0,0,115,108,0,0,0,116,0,124,0,116,1,131,2, + 115,28,116,2,100,1,160,3,116,4,124,0,131,1,161,1, + 131,1,130,1,124,2,100,2,107,0,114,44,116,5,100,3, + 131,1,130,1,124,2,100,2,107,4,114,84,116,0,124,1, + 116,1,131,2,115,72,116,2,100,4,131,1,130,1,110,12, + 124,1,115,84,116,6,100,5,131,1,130,1,124,0,115,104, + 124,2,100,2,107,2,114,104,116,5,100,6,131,1,130,1, + 100,7,83,0,41,8,122,28,86,101,114,105,102,121,32,97, + 114,103,117,109,101,110,116,115,32,97,114,101,32,34,115,97, + 110,101,34,46,122,31,109,111,100,117,108,101,32,110,97,109, + 101,32,109,117,115,116,32,98,101,32,115,116,114,44,32,110, + 111,116,32,123,125,114,19,0,0,0,122,18,108,101,118,101, + 108,32,109,117,115,116,32,98,101,32,62,61,32,48,122,31, + 95,95,112,97,99,107,97,103,101,95,95,32,110,111,116,32, + 115,101,116,32,116,111,32,97,32,115,116,114,105,110,103,122, + 54,97,116,116,101,109,112,116,101,100,32,114,101,108,97,116, + 105,118,101,32,105,109,112,111,114,116,32,119,105,116,104,32, + 110,111,32,107,110,111,119,110,32,112,97,114,101,110,116,32, + 112,97,99,107,97,103,101,122,17,69,109,112,116,121,32,109, + 111,100,117,108,101,32,110,97,109,101,78,41,7,218,10,105, + 115,105,110,115,116,97,110,99,101,218,3,115,116,114,218,9, + 84,121,112,101,69,114,114,111,114,114,38,0,0,0,114,13, + 0,0,0,114,154,0,0,0,114,70,0,0,0,41,3,114, + 15,0,0,0,114,155,0,0,0,114,156,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,13,95, + 115,97,110,105,116,121,95,99,104,101,99,107,167,3,0,0, + 115,22,0,0,0,0,2,10,1,18,1,8,1,8,1,8, + 1,10,1,10,1,4,1,8,2,12,1,114,168,0,0,0, + 122,16,78,111,32,109,111,100,117,108,101,32,110,97,109,101, + 100,32,122,4,123,33,114,125,99,2,0,0,0,0,0,0, + 0,8,0,0,0,8,0,0,0,67,0,0,0,115,220,0, + 0,0,100,0,125,2,124,0,160,0,100,1,161,1,100,2, + 25,0,125,3,124,3,114,134,124,3,116,1,106,2,107,7, + 114,42,116,3,124,1,124,3,131,2,1,0,124,0,116,1, + 106,2,107,6,114,62,116,1,106,2,124,0,25,0,83,0, + 116,1,106,2,124,3,25,0,125,4,122,10,124,4,106,4, + 125,2,87,0,110,50,4,0,116,5,107,10,114,132,1,0, + 1,0,1,0,116,6,100,3,23,0,160,7,124,0,124,3, + 161,2,125,5,116,8,124,5,124,0,100,4,141,2,100,0, + 130,2,89,0,110,2,88,0,116,9,124,0,124,2,131,2, + 125,6,124,6,100,0,107,8,114,172,116,8,116,6,160,7, + 124,0,161,1,124,0,100,4,141,2,130,1,110,8,116,10, + 124,6,131,1,125,7,124,3,114,216,116,1,106,2,124,3, + 25,0,125,4,116,11,124,4,124,0,160,0,100,1,161,1, + 100,5,25,0,124,7,131,3,1,0,124,7,83,0,41,6, + 78,114,111,0,0,0,114,19,0,0,0,122,23,59,32,123, + 33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,99, + 107,97,103,101,41,1,114,15,0,0,0,233,2,0,0,0, + 41,12,114,112,0,0,0,114,14,0,0,0,114,79,0,0, + 0,114,59,0,0,0,114,121,0,0,0,114,90,0,0,0, + 218,8,95,69,82,82,95,77,83,71,114,38,0,0,0,218, + 19,77,111,100,117,108,101,78,111,116,70,111,117,110,100,69, + 114,114,111,114,114,164,0,0,0,114,135,0,0,0,114,5, + 0,0,0,41,8,114,15,0,0,0,218,7,105,109,112,111, + 114,116,95,114,138,0,0,0,114,113,0,0,0,90,13,112, + 97,114,101,110,116,95,109,111,100,117,108,101,114,133,0,0, + 0,114,82,0,0,0,114,83,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,23,95,102,105,110, + 100,95,97,110,100,95,108,111,97,100,95,117,110,108,111,99, + 107,101,100,186,3,0,0,115,42,0,0,0,0,1,4,1, + 14,1,4,1,10,1,10,2,10,1,10,1,10,1,2,1, + 10,1,14,1,16,1,20,1,10,1,8,1,20,2,8,1, + 4,2,10,1,22,1,114,173,0,0,0,99,2,0,0,0, + 0,0,0,0,4,0,0,0,10,0,0,0,67,0,0,0, + 115,106,0,0,0,116,0,124,0,131,1,143,50,1,0,116, + 1,106,2,160,3,124,0,116,4,161,2,125,2,124,2,116, + 4,107,8,114,54,116,5,124,0,124,1,131,2,87,0,2, + 0,53,0,81,0,82,0,163,0,83,0,87,0,53,0,81, + 0,82,0,88,0,124,2,100,1,107,8,114,94,100,2,160, + 6,124,0,161,1,125,3,116,7,124,3,124,0,100,3,141, + 2,130,1,116,8,124,0,131,1,1,0,124,2,83,0,41, + 4,122,25,70,105,110,100,32,97,110,100,32,108,111,97,100, + 32,116,104,101,32,109,111,100,117,108,101,46,78,122,40,105, + 109,112,111,114,116,32,111,102,32,123,125,32,104,97,108,116, + 101,100,59,32,78,111,110,101,32,105,110,32,115,121,115,46, + 109,111,100,117,108,101,115,41,1,114,15,0,0,0,41,9, + 114,42,0,0,0,114,14,0,0,0,114,79,0,0,0,114, + 30,0,0,0,218,14,95,78,69,69,68,83,95,76,79,65, + 68,73,78,71,114,173,0,0,0,114,38,0,0,0,114,171, + 0,0,0,114,57,0,0,0,41,4,114,15,0,0,0,114, + 172,0,0,0,114,83,0,0,0,114,67,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,218,14,95, + 102,105,110,100,95,97,110,100,95,108,111,97,100,216,3,0, + 0,115,22,0,0,0,0,2,10,1,14,1,8,1,32,2, + 8,1,4,1,2,255,4,2,12,2,8,1,114,175,0,0, + 0,114,19,0,0,0,99,3,0,0,0,0,0,0,0,3, + 0,0,0,4,0,0,0,67,0,0,0,115,42,0,0,0, + 116,0,124,0,124,1,124,2,131,3,1,0,124,2,100,1, + 107,4,114,32,116,1,124,0,124,1,124,2,131,3,125,0, + 116,2,124,0,116,3,131,2,83,0,41,2,97,50,1,0, + 0,73,109,112,111,114,116,32,97,110,100,32,114,101,116,117, + 114,110,32,116,104,101,32,109,111,100,117,108,101,32,98,97, + 115,101,100,32,111,110,32,105,116,115,32,110,97,109,101,44, + 32,116,104,101,32,112,97,99,107,97,103,101,32,116,104,101, + 32,99,97,108,108,32,105,115,10,32,32,32,32,98,101,105, + 110,103,32,109,97,100,101,32,102,114,111,109,44,32,97,110, + 100,32,116,104,101,32,108,101,118,101,108,32,97,100,106,117, + 115,116,109,101,110,116,46,10,10,32,32,32,32,84,104,105, + 115,32,102,117,110,99,116,105,111,110,32,114,101,112,114,101, + 115,101,110,116,115,32,116,104,101,32,103,114,101,97,116,101, + 115,116,32,99,111,109,109,111,110,32,100,101,110,111,109,105, + 110,97,116,111,114,32,111,102,32,102,117,110,99,116,105,111, + 110,97,108,105,116,121,10,32,32,32,32,98,101,116,119,101, + 101,110,32,105,109,112,111,114,116,95,109,111,100,117,108,101, + 32,97,110,100,32,95,95,105,109,112,111,114,116,95,95,46, + 32,84,104,105,115,32,105,110,99,108,117,100,101,115,32,115, + 101,116,116,105,110,103,32,95,95,112,97,99,107,97,103,101, + 95,95,32,105,102,10,32,32,32,32,116,104,101,32,108,111, + 97,100,101,114,32,100,105,100,32,110,111,116,46,10,10,32, + 32,32,32,114,19,0,0,0,41,4,114,168,0,0,0,114, + 157,0,0,0,114,175,0,0,0,218,11,95,103,99,100,95, + 105,109,112,111,114,116,41,3,114,15,0,0,0,114,155,0, + 0,0,114,156,0,0,0,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,176,0,0,0,232,3,0,0,115, + 8,0,0,0,0,9,12,1,8,1,12,1,114,176,0,0, + 0,41,1,218,9,114,101,99,117,114,115,105,118,101,99,3, + 0,0,0,1,0,0,0,8,0,0,0,11,0,0,0,67, + 0,0,0,115,226,0,0,0,124,1,68,0,93,216,125,4, + 116,0,124,4,116,1,131,2,115,66,124,3,114,34,124,0, + 106,2,100,1,23,0,125,5,110,4,100,2,125,5,116,3, + 100,3,124,5,155,0,100,4,116,4,124,4,131,1,106,2, + 155,0,157,4,131,1,130,1,110,154,124,4,100,5,107,2, + 114,108,124,3,115,106,116,5,124,0,100,6,131,2,114,106, + 116,6,124,0,124,0,106,7,124,2,100,7,100,8,141,4, + 1,0,110,112,116,5,124,0,124,4,131,2,115,220,100,9, + 160,8,124,0,106,2,124,4,161,2,125,6,122,14,116,9, + 124,2,124,6,131,2,1,0,87,0,110,72,4,0,116,10, + 107,10,114,218,1,0,125,7,1,0,122,42,124,7,106,11, + 124,6,107,2,114,200,116,12,106,13,160,14,124,6,116,15, + 161,2,100,10,107,9,114,200,87,0,89,0,162,8,113,4, + 130,0,87,0,53,0,100,10,125,7,126,7,88,0,89,0, + 110,2,88,0,113,4,124,0,83,0,41,11,122,238,70,105, + 103,117,114,101,32,111,117,116,32,119,104,97,116,32,95,95, + 105,109,112,111,114,116,95,95,32,115,104,111,117,108,100,32, + 114,101,116,117,114,110,46,10,10,32,32,32,32,84,104,101, + 32,105,109,112,111,114,116,95,32,112,97,114,97,109,101,116, + 101,114,32,105,115,32,97,32,99,97,108,108,97,98,108,101, + 32,119,104,105,99,104,32,116,97,107,101,115,32,116,104,101, + 32,110,97,109,101,32,111,102,32,109,111,100,117,108,101,32, + 116,111,10,32,32,32,32,105,109,112,111,114,116,46,32,73, + 116,32,105,115,32,114,101,113,117,105,114,101,100,32,116,111, + 32,100,101,99,111,117,112,108,101,32,116,104,101,32,102,117, + 110,99,116,105,111,110,32,102,114,111,109,32,97,115,115,117, + 109,105,110,103,32,105,109,112,111,114,116,108,105,98,39,115, + 10,32,32,32,32,105,109,112,111,114,116,32,105,109,112,108, + 101,109,101,110,116,97,116,105,111,110,32,105,115,32,100,101, + 115,105,114,101,100,46,10,10,32,32,32,32,122,8,46,95, + 95,97,108,108,95,95,122,13,96,96,102,114,111,109,32,108, + 105,115,116,39,39,122,8,73,116,101,109,32,105,110,32,122, + 18,32,109,117,115,116,32,98,101,32,115,116,114,44,32,110, + 111,116,32,250,1,42,218,7,95,95,97,108,108,95,95,84, + 41,1,114,177,0,0,0,122,5,123,125,46,123,125,78,41, + 16,114,165,0,0,0,114,166,0,0,0,114,1,0,0,0, + 114,167,0,0,0,114,13,0,0,0,114,4,0,0,0,218, + 16,95,104,97,110,100,108,101,95,102,114,111,109,108,105,115, + 116,114,179,0,0,0,114,38,0,0,0,114,59,0,0,0, + 114,171,0,0,0,114,15,0,0,0,114,14,0,0,0,114, + 79,0,0,0,114,30,0,0,0,114,174,0,0,0,41,8, + 114,83,0,0,0,218,8,102,114,111,109,108,105,115,116,114, + 172,0,0,0,114,177,0,0,0,218,1,120,90,5,119,104, + 101,114,101,90,9,102,114,111,109,95,110,97,109,101,90,3, + 101,120,99,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,180,0,0,0,247,3,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, + 16,4,10,1,16,255,2,2,8,1,22,1,114,180,0,0, + 0,99,1,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,107,9,114,82,124,2,100,3,107,9,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,107,9,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,107,7,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,124,0,0,0,114,89,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,121,0,0,0,114,111,0,0,0,114,19,0,0,0, + 41,6,114,30,0,0,0,114,113,0,0,0,114,161,0,0, + 0,114,162,0,0,0,114,163,0,0,0,114,112,0,0,0, + 41,3,218,7,103,108,111,98,97,108,115,114,155,0,0,0, 114,82,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,18,95,98,117,105,108,116,105,110,95,102, - 114,111,109,95,110,97,109,101,92,4,0,0,115,8,0,0, - 0,0,1,10,1,8,1,12,1,114,190,0,0,0,99,2, - 0,0,0,0,0,0,0,10,0,0,0,5,0,0,0,67, - 0,0,0,115,166,0,0,0,124,1,97,0,124,0,97,1, - 116,2,116,1,131,1,125,2,116,1,106,3,160,4,161,0, - 68,0,93,72,92,2,125,3,125,4,116,5,124,4,124,2, - 131,2,114,26,124,3,116,1,106,6,107,6,114,60,116,7, - 125,5,110,18,116,0,160,8,124,3,161,1,114,26,116,9, - 125,5,110,2,113,26,116,10,124,4,124,5,131,2,125,6, - 116,11,124,6,124,4,131,2,1,0,113,26,116,1,106,3, - 116,12,25,0,125,7,100,1,68,0,93,46,125,8,124,8, - 116,1,106,3,107,7,114,138,116,13,124,8,131,1,125,9, - 110,10,116,1,106,3,124,8,25,0,125,9,116,14,124,7, - 124,8,124,9,131,3,1,0,113,114,100,2,83,0,41,3, - 122,250,83,101,116,117,112,32,105,109,112,111,114,116,108,105, - 98,32,98,121,32,105,109,112,111,114,116,105,110,103,32,110, - 101,101,100,101,100,32,98,117,105,108,116,45,105,110,32,109, - 111,100,117,108,101,115,32,97,110,100,32,105,110,106,101,99, - 116,105,110,103,32,116,104,101,109,10,32,32,32,32,105,110, - 116,111,32,116,104,101,32,103,108,111,98,97,108,32,110,97, - 109,101,115,112,97,99,101,46,10,10,32,32,32,32,65,115, - 32,115,121,115,32,105,115,32,110,101,101,100,101,100,32,102, - 111,114,32,115,121,115,46,109,111,100,117,108,101,115,32,97, - 99,99,101,115,115,32,97,110,100,32,95,105,109,112,32,105, - 115,32,110,101,101,100,101,100,32,116,111,32,108,111,97,100, - 32,98,117,105,108,116,45,105,110,10,32,32,32,32,109,111, - 100,117,108,101,115,44,32,116,104,111,115,101,32,116,119,111, - 32,109,111,100,117,108,101,115,32,109,117,115,116,32,98,101, - 32,101,120,112,108,105,99,105,116,108,121,32,112,97,115,115, - 101,100,32,105,110,46,10,10,32,32,32,32,41,3,114,20, - 0,0,0,114,161,0,0,0,114,56,0,0,0,78,41,15, - 114,49,0,0,0,114,14,0,0,0,114,13,0,0,0,114, - 79,0,0,0,218,5,105,116,101,109,115,114,165,0,0,0, - 114,69,0,0,0,114,136,0,0,0,114,75,0,0,0,114, - 146,0,0,0,114,122,0,0,0,114,127,0,0,0,114,1, - 0,0,0,114,190,0,0,0,114,5,0,0,0,41,10,218, - 10,115,121,115,95,109,111,100,117,108,101,218,11,95,105,109, - 112,95,109,111,100,117,108,101,90,11,109,111,100,117,108,101, - 95,116,121,112,101,114,15,0,0,0,114,83,0,0,0,114, - 93,0,0,0,114,82,0,0,0,90,11,115,101,108,102,95, - 109,111,100,117,108,101,90,12,98,117,105,108,116,105,110,95, - 110,97,109,101,90,14,98,117,105,108,116,105,110,95,109,111, - 100,117,108,101,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,6,95,115,101,116,117,112,99,4,0,0,115, - 36,0,0,0,0,9,4,1,4,3,8,1,18,1,10,1, - 10,1,6,1,10,1,6,2,2,1,10,1,12,3,10,1, - 8,1,10,1,10,2,10,1,114,194,0,0,0,99,2,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,38,0,0,0,116,0,124,0,124,1,131,2,1, - 0,116,1,106,2,160,3,116,4,161,1,1,0,116,1,106, - 2,160,3,116,5,161,1,1,0,100,1,83,0,41,2,122, - 48,73,110,115,116,97,108,108,32,105,109,112,111,114,116,101, - 114,115,32,102,111,114,32,98,117,105,108,116,105,110,32,97, - 110,100,32,102,114,111,122,101,110,32,109,111,100,117,108,101, - 115,78,41,6,114,194,0,0,0,114,14,0,0,0,114,160, - 0,0,0,114,103,0,0,0,114,136,0,0,0,114,146,0, - 0,0,41,2,114,192,0,0,0,114,193,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,95, - 105,110,115,116,97,108,108,134,4,0,0,115,6,0,0,0, - 0,2,10,2,12,1,114,195,0,0,0,99,0,0,0,0, - 0,0,0,0,1,0,0,0,4,0,0,0,67,0,0,0, - 115,32,0,0,0,100,1,100,2,108,0,125,0,124,0,97, - 1,124,0,160,2,116,3,106,4,116,5,25,0,161,1,1, - 0,100,2,83,0,41,3,122,57,73,110,115,116,97,108,108, - 32,105,109,112,111,114,116,101,114,115,32,116,104,97,116,32, - 114,101,113,117,105,114,101,32,101,120,116,101,114,110,97,108, - 32,102,105,108,101,115,121,115,116,101,109,32,97,99,99,101, - 115,115,114,19,0,0,0,78,41,6,218,26,95,102,114,111, - 122,101,110,95,105,109,112,111,114,116,108,105,98,95,101,120, - 116,101,114,110,97,108,114,109,0,0,0,114,195,0,0,0, - 114,14,0,0,0,114,79,0,0,0,114,1,0,0,0,41, - 1,114,196,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,218,27,95,105,110,115,116,97,108,108,95, - 101,120,116,101,114,110,97,108,95,105,109,112,111,114,116,101, - 114,115,142,4,0,0,115,6,0,0,0,0,3,8,1,4, - 1,114,197,0,0,0,41,2,78,78,41,1,78,41,2,78, - 114,19,0,0,0,41,4,78,78,114,10,0,0,0,114,19, - 0,0,0,41,50,114,3,0,0,0,114,109,0,0,0,114, - 12,0,0,0,114,16,0,0,0,114,51,0,0,0,114,29, - 0,0,0,114,36,0,0,0,114,17,0,0,0,114,18,0, - 0,0,114,41,0,0,0,114,42,0,0,0,114,45,0,0, - 0,114,57,0,0,0,114,59,0,0,0,114,68,0,0,0, - 114,74,0,0,0,114,77,0,0,0,114,84,0,0,0,114, - 95,0,0,0,114,96,0,0,0,114,78,0,0,0,114,122, - 0,0,0,114,127,0,0,0,114,130,0,0,0,114,91,0, - 0,0,114,80,0,0,0,114,134,0,0,0,114,135,0,0, - 0,114,81,0,0,0,114,136,0,0,0,114,146,0,0,0, - 114,151,0,0,0,114,157,0,0,0,114,159,0,0,0,114, - 164,0,0,0,114,168,0,0,0,90,15,95,69,82,82,95, - 77,83,71,95,80,82,69,70,73,88,114,170,0,0,0,114, - 173,0,0,0,218,6,111,98,106,101,99,116,114,174,0,0, - 0,114,175,0,0,0,114,176,0,0,0,114,180,0,0,0, - 114,186,0,0,0,114,189,0,0,0,114,190,0,0,0,114, - 194,0,0,0,114,195,0,0,0,114,197,0,0,0,114,10, + 11,0,0,0,218,17,95,99,97,108,99,95,95,95,112,97, + 99,107,97,103,101,95,95,28,4,0,0,115,38,0,0,0, + 0,7,10,1,10,1,8,1,18,1,22,2,2,0,2,254, + 6,3,4,1,8,1,6,2,6,2,2,0,2,254,6,3, + 8,1,8,1,14,1,114,186,0,0,0,114,10,0,0,0, + 99,5,0,0,0,0,0,0,0,9,0,0,0,5,0,0, + 0,67,0,0,0,115,180,0,0,0,124,4,100,1,107,2, + 114,18,116,0,124,0,131,1,125,5,110,36,124,1,100,2, + 107,9,114,30,124,1,110,2,105,0,125,6,116,1,124,6, + 131,1,125,7,116,0,124,0,124,7,124,4,131,3,125,5, + 124,3,115,150,124,4,100,1,107,2,114,84,116,0,124,0, + 160,2,100,3,161,1,100,1,25,0,131,1,83,0,124,0, + 115,92,124,5,83,0,116,3,124,0,131,1,116,3,124,0, + 160,2,100,3,161,1,100,1,25,0,131,1,24,0,125,8, + 116,4,106,5,124,5,106,6,100,2,116,3,124,5,106,6, + 131,1,124,8,24,0,133,2,25,0,25,0,83,0,110,26, + 116,7,124,5,100,4,131,2,114,172,116,8,124,5,124,3, + 116,0,131,3,83,0,124,5,83,0,100,2,83,0,41,5, + 97,215,1,0,0,73,109,112,111,114,116,32,97,32,109,111, + 100,117,108,101,46,10,10,32,32,32,32,84,104,101,32,39, + 103,108,111,98,97,108,115,39,32,97,114,103,117,109,101,110, + 116,32,105,115,32,117,115,101,100,32,116,111,32,105,110,102, + 101,114,32,119,104,101,114,101,32,116,104,101,32,105,109,112, + 111,114,116,32,105,115,32,111,99,99,117,114,114,105,110,103, + 32,102,114,111,109,10,32,32,32,32,116,111,32,104,97,110, + 100,108,101,32,114,101,108,97,116,105,118,101,32,105,109,112, + 111,114,116,115,46,32,84,104,101,32,39,108,111,99,97,108, + 115,39,32,97,114,103,117,109,101,110,116,32,105,115,32,105, + 103,110,111,114,101,100,46,32,84,104,101,10,32,32,32,32, + 39,102,114,111,109,108,105,115,116,39,32,97,114,103,117,109, + 101,110,116,32,115,112,101,99,105,102,105,101,115,32,119,104, + 97,116,32,115,104,111,117,108,100,32,101,120,105,115,116,32, + 97,115,32,97,116,116,114,105,98,117,116,101,115,32,111,110, + 32,116,104,101,32,109,111,100,117,108,101,10,32,32,32,32, + 98,101,105,110,103,32,105,109,112,111,114,116,101,100,32,40, + 101,46,103,46,32,96,96,102,114,111,109,32,109,111,100,117, + 108,101,32,105,109,112,111,114,116,32,60,102,114,111,109,108, + 105,115,116,62,96,96,41,46,32,32,84,104,101,32,39,108, + 101,118,101,108,39,10,32,32,32,32,97,114,103,117,109,101, + 110,116,32,114,101,112,114,101,115,101,110,116,115,32,116,104, + 101,32,112,97,99,107,97,103,101,32,108,111,99,97,116,105, + 111,110,32,116,111,32,105,109,112,111,114,116,32,102,114,111, + 109,32,105,110,32,97,32,114,101,108,97,116,105,118,101,10, + 32,32,32,32,105,109,112,111,114,116,32,40,101,46,103,46, + 32,96,96,102,114,111,109,32,46,46,112,107,103,32,105,109, + 112,111,114,116,32,109,111,100,96,96,32,119,111,117,108,100, + 32,104,97,118,101,32,97,32,39,108,101,118,101,108,39,32, + 111,102,32,50,41,46,10,10,32,32,32,32,114,19,0,0, + 0,78,114,111,0,0,0,114,121,0,0,0,41,9,114,176, + 0,0,0,114,186,0,0,0,218,9,112,97,114,116,105,116, + 105,111,110,114,153,0,0,0,114,14,0,0,0,114,79,0, + 0,0,114,1,0,0,0,114,4,0,0,0,114,180,0,0, + 0,41,9,114,15,0,0,0,114,185,0,0,0,218,6,108, + 111,99,97,108,115,114,181,0,0,0,114,156,0,0,0,114, + 83,0,0,0,90,8,103,108,111,98,97,108,115,95,114,155, + 0,0,0,90,7,99,117,116,95,111,102,102,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,10,95,95,105, + 109,112,111,114,116,95,95,55,4,0,0,115,30,0,0,0, + 0,11,8,1,10,2,16,1,8,1,12,1,4,3,8,1, + 18,1,4,1,4,4,26,3,32,1,10,1,12,2,114,189, + 0,0,0,99,1,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,67,0,0,0,115,38,0,0,0,116,0,160, + 1,124,0,161,1,125,1,124,1,100,0,107,8,114,30,116, + 2,100,1,124,0,23,0,131,1,130,1,116,3,124,1,131, + 1,83,0,41,2,78,122,25,110,111,32,98,117,105,108,116, + 45,105,110,32,109,111,100,117,108,101,32,110,97,109,101,100, + 32,41,4,114,136,0,0,0,114,140,0,0,0,114,70,0, + 0,0,114,135,0,0,0,41,2,114,15,0,0,0,114,82, 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,8,60,109,111,100,117,108,101,62,8,0,0,0, - 115,94,0,0,0,4,17,4,2,8,8,8,8,4,2,4, - 3,16,4,14,68,14,21,14,16,8,37,8,17,8,11,14, - 8,8,11,8,12,8,16,8,36,14,101,16,26,10,45,14, - 72,8,17,8,17,8,30,8,37,8,42,8,15,14,73,14, - 77,14,13,8,9,8,9,10,47,8,16,4,1,8,2,8, - 27,6,3,8,16,10,15,14,37,8,27,10,37,8,7,8, - 35,8,8, + 0,0,218,18,95,98,117,105,108,116,105,110,95,102,114,111, + 109,95,110,97,109,101,92,4,0,0,115,8,0,0,0,0, + 1,10,1,8,1,12,1,114,190,0,0,0,99,2,0,0, + 0,0,0,0,0,10,0,0,0,5,0,0,0,67,0,0, + 0,115,166,0,0,0,124,1,97,0,124,0,97,1,116,2, + 116,1,131,1,125,2,116,1,106,3,160,4,161,0,68,0, + 93,72,92,2,125,3,125,4,116,5,124,4,124,2,131,2, + 114,26,124,3,116,1,106,6,107,6,114,60,116,7,125,5, + 110,18,116,0,160,8,124,3,161,1,114,26,116,9,125,5, + 110,2,113,26,116,10,124,4,124,5,131,2,125,6,116,11, + 124,6,124,4,131,2,1,0,113,26,116,1,106,3,116,12, + 25,0,125,7,100,1,68,0,93,46,125,8,124,8,116,1, + 106,3,107,7,114,138,116,13,124,8,131,1,125,9,110,10, + 116,1,106,3,124,8,25,0,125,9,116,14,124,7,124,8, + 124,9,131,3,1,0,113,114,100,2,83,0,41,3,122,250, + 83,101,116,117,112,32,105,109,112,111,114,116,108,105,98,32, + 98,121,32,105,109,112,111,114,116,105,110,103,32,110,101,101, + 100,101,100,32,98,117,105,108,116,45,105,110,32,109,111,100, + 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, + 110,103,32,116,104,101,109,10,32,32,32,32,105,110,116,111, + 32,116,104,101,32,103,108,111,98,97,108,32,110,97,109,101, + 115,112,97,99,101,46,10,10,32,32,32,32,65,115,32,115, + 121,115,32,105,115,32,110,101,101,100,101,100,32,102,111,114, + 32,115,121,115,46,109,111,100,117,108,101,115,32,97,99,99, + 101,115,115,32,97,110,100,32,95,105,109,112,32,105,115,32, + 110,101,101,100,101,100,32,116,111,32,108,111,97,100,32,98, + 117,105,108,116,45,105,110,10,32,32,32,32,109,111,100,117, + 108,101,115,44,32,116,104,111,115,101,32,116,119,111,32,109, + 111,100,117,108,101,115,32,109,117,115,116,32,98,101,32,101, + 120,112,108,105,99,105,116,108,121,32,112,97,115,115,101,100, + 32,105,110,46,10,10,32,32,32,32,41,3,114,20,0,0, + 0,114,161,0,0,0,114,56,0,0,0,78,41,15,114,49, + 0,0,0,114,14,0,0,0,114,13,0,0,0,114,79,0, + 0,0,218,5,105,116,101,109,115,114,165,0,0,0,114,69, + 0,0,0,114,136,0,0,0,114,75,0,0,0,114,146,0, + 0,0,114,122,0,0,0,114,127,0,0,0,114,1,0,0, + 0,114,190,0,0,0,114,5,0,0,0,41,10,218,10,115, + 121,115,95,109,111,100,117,108,101,218,11,95,105,109,112,95, + 109,111,100,117,108,101,90,11,109,111,100,117,108,101,95,116, + 121,112,101,114,15,0,0,0,114,83,0,0,0,114,93,0, + 0,0,114,82,0,0,0,90,11,115,101,108,102,95,109,111, + 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, + 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, + 108,101,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,6,95,115,101,116,117,112,99,4,0,0,115,36,0, + 0,0,0,9,4,1,4,3,8,1,18,1,10,1,10,1, + 6,1,10,1,6,2,2,1,10,1,12,3,10,1,8,1, + 10,1,10,2,10,1,114,194,0,0,0,99,2,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,38,0,0,0,116,0,124,0,124,1,131,2,1,0,116, + 1,106,2,160,3,116,4,161,1,1,0,116,1,106,2,160, + 3,116,5,161,1,1,0,100,1,83,0,41,2,122,48,73, + 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115, + 32,102,111,114,32,98,117,105,108,116,105,110,32,97,110,100, + 32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,78, + 41,6,114,194,0,0,0,114,14,0,0,0,114,160,0,0, + 0,114,103,0,0,0,114,136,0,0,0,114,146,0,0,0, + 41,2,114,192,0,0,0,114,193,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,8,95,105,110, + 115,116,97,108,108,134,4,0,0,115,6,0,0,0,0,2, + 10,2,12,1,114,195,0,0,0,99,0,0,0,0,0,0, + 0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,32, + 0,0,0,100,1,100,2,108,0,125,0,124,0,97,1,124, + 0,160,2,116,3,106,4,116,5,25,0,161,1,1,0,100, + 2,83,0,41,3,122,57,73,110,115,116,97,108,108,32,105, + 109,112,111,114,116,101,114,115,32,116,104,97,116,32,114,101, + 113,117,105,114,101,32,101,120,116,101,114,110,97,108,32,102, + 105,108,101,115,121,115,116,101,109,32,97,99,99,101,115,115, + 114,19,0,0,0,78,41,6,218,26,95,102,114,111,122,101, + 110,95,105,109,112,111,114,116,108,105,98,95,101,120,116,101, + 114,110,97,108,114,109,0,0,0,114,195,0,0,0,114,14, + 0,0,0,114,79,0,0,0,114,1,0,0,0,41,1,114, + 196,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,27,95,105,110,115,116,97,108,108,95,101,120, + 116,101,114,110,97,108,95,105,109,112,111,114,116,101,114,115, + 142,4,0,0,115,6,0,0,0,0,3,8,1,4,1,114, + 197,0,0,0,41,2,78,78,41,1,78,41,2,78,114,19, + 0,0,0,41,4,78,78,114,10,0,0,0,114,19,0,0, + 0,41,50,114,3,0,0,0,114,109,0,0,0,114,12,0, + 0,0,114,16,0,0,0,114,51,0,0,0,114,29,0,0, + 0,114,36,0,0,0,114,17,0,0,0,114,18,0,0,0, + 114,41,0,0,0,114,42,0,0,0,114,45,0,0,0,114, + 57,0,0,0,114,59,0,0,0,114,68,0,0,0,114,74, + 0,0,0,114,77,0,0,0,114,84,0,0,0,114,95,0, + 0,0,114,96,0,0,0,114,78,0,0,0,114,122,0,0, + 0,114,127,0,0,0,114,130,0,0,0,114,91,0,0,0, + 114,80,0,0,0,114,134,0,0,0,114,135,0,0,0,114, + 81,0,0,0,114,136,0,0,0,114,146,0,0,0,114,151, + 0,0,0,114,157,0,0,0,114,159,0,0,0,114,164,0, + 0,0,114,168,0,0,0,90,15,95,69,82,82,95,77,83, + 71,95,80,82,69,70,73,88,114,170,0,0,0,114,173,0, + 0,0,218,6,111,98,106,101,99,116,114,174,0,0,0,114, + 175,0,0,0,114,176,0,0,0,114,180,0,0,0,114,186, + 0,0,0,114,189,0,0,0,114,190,0,0,0,114,194,0, + 0,0,114,195,0,0,0,114,197,0,0,0,114,10,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,8,60,109,111,100,117,108,101,62,8,0,0,0,115,94, + 0,0,0,4,17,4,2,8,8,8,8,4,2,4,3,16, + 4,14,68,14,21,14,16,8,37,8,17,8,11,14,8,8, + 11,8,12,8,16,8,36,14,101,16,26,10,45,14,72,8, + 17,8,17,8,30,8,37,8,42,8,15,14,73,14,77,14, + 13,8,9,8,9,10,47,8,16,4,1,8,2,8,27,6, + 3,8,16,10,15,14,37,8,27,10,37,8,7,8,35,8, + 8, }; diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 8596671343be..0443298d036d 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1061,989 +1061,989 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 178,0,0,0,114,184,0,0,0,114,187,0,0,0,114,188, 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, 0,0,114,4,0,0,0,114,175,0,0,0,179,2,0,0, - 115,30,0,0,0,8,2,4,3,2,255,2,4,2,255,2, - 3,4,2,12,7,12,15,2,1,2,0,2,255,12,16,2, - 1,2,255,114,175,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,2,0,0,0,64,0,0,0,115,48,0, - 0,0,101,0,90,1,100,0,90,2,100,1,90,3,100,2, - 100,3,132,0,90,4,100,4,100,5,132,0,90,5,100,6, - 100,7,132,0,90,6,100,8,100,9,132,0,90,7,100,10, - 83,0,41,11,218,13,95,76,111,97,100,101,114,66,97,115, - 105,99,115,122,83,66,97,115,101,32,99,108,97,115,115,32, - 111,102,32,99,111,109,109,111,110,32,99,111,100,101,32,110, - 101,101,100,101,100,32,98,121,32,98,111,116,104,32,83,111, - 117,114,99,101,76,111,97,100,101,114,32,97,110,100,10,32, - 32,32,32,83,111,117,114,99,101,108,101,115,115,70,105,108, - 101,76,111,97,100,101,114,46,99,2,0,0,0,0,0,0, - 0,5,0,0,0,4,0,0,0,67,0,0,0,115,64,0, - 0,0,116,0,124,0,160,1,124,1,161,1,131,1,100,1, - 25,0,125,2,124,2,160,2,100,2,100,1,161,2,100,3, - 25,0,125,3,124,1,160,3,100,2,161,1,100,4,25,0, - 125,4,124,3,100,5,107,2,111,62,124,4,100,5,107,3, - 83,0,41,6,122,141,67,111,110,99,114,101,116,101,32,105, - 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, - 32,73,110,115,112,101,99,116,76,111,97,100,101,114,46,105, - 115,95,112,97,99,107,97,103,101,32,98,121,32,99,104,101, - 99,107,105,110,103,32,105,102,10,32,32,32,32,32,32,32, - 32,116,104,101,32,112,97,116,104,32,114,101,116,117,114,110, - 101,100,32,98,121,32,103,101,116,95,102,105,108,101,110,97, - 109,101,32,104,97,115,32,97,32,102,105,108,101,110,97,109, - 101,32,111,102,32,39,95,95,105,110,105,116,95,95,46,112, - 121,39,46,114,34,0,0,0,114,63,0,0,0,114,64,0, - 0,0,114,23,0,0,0,218,8,95,95,105,110,105,116,95, - 95,41,4,114,42,0,0,0,114,164,0,0,0,114,38,0, - 0,0,114,36,0,0,0,41,5,114,108,0,0,0,114,127, - 0,0,0,114,88,0,0,0,90,13,102,105,108,101,110,97, - 109,101,95,98,97,115,101,90,9,116,97,105,108,95,110,97, - 109,101,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,166,0,0,0,248,2,0,0,115,8,0,0,0,0, - 3,18,1,16,1,14,1,122,24,95,76,111,97,100,101,114, - 66,97,115,105,99,115,46,105,115,95,112,97,99,107,97,103, - 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, - 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, - 2,122,42,85,115,101,32,100,101,102,97,117,108,116,32,115, - 101,109,97,110,116,105,99,115,32,102,111,114,32,109,111,100, - 117,108,101,32,99,114,101,97,116,105,111,110,46,78,114,2, - 0,0,0,41,2,114,108,0,0,0,114,171,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,13, - 99,114,101,97,116,101,95,109,111,100,117,108,101,0,3,0, - 0,115,2,0,0,0,0,1,122,27,95,76,111,97,100,101, - 114,66,97,115,105,99,115,46,99,114,101,97,116,101,95,109, - 111,100,117,108,101,99,2,0,0,0,0,0,0,0,3,0, - 0,0,5,0,0,0,67,0,0,0,115,56,0,0,0,124, - 0,160,0,124,1,106,1,161,1,125,2,124,2,100,1,107, - 8,114,36,116,2,100,2,160,3,124,1,106,1,161,1,131, - 1,130,1,116,4,160,5,116,6,124,2,124,1,106,7,161, - 3,1,0,100,1,83,0,41,3,122,19,69,120,101,99,117, - 116,101,32,116,104,101,32,109,111,100,117,108,101,46,78,122, - 52,99,97,110,110,111,116,32,108,111,97,100,32,109,111,100, - 117,108,101,32,123,33,114,125,32,119,104,101,110,32,103,101, - 116,95,99,111,100,101,40,41,32,114,101,116,117,114,110,115, - 32,78,111,110,101,41,8,218,8,103,101,116,95,99,111,100, - 101,114,113,0,0,0,114,107,0,0,0,114,54,0,0,0, - 114,122,0,0,0,218,25,95,99,97,108,108,95,119,105,116, - 104,95,102,114,97,109,101,115,95,114,101,109,111,118,101,100, - 218,4,101,120,101,99,114,119,0,0,0,41,3,114,108,0, - 0,0,218,6,109,111,100,117,108,101,114,150,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,11, - 101,120,101,99,95,109,111,100,117,108,101,3,3,0,0,115, - 12,0,0,0,0,2,12,1,8,1,6,1,4,255,6,2, - 122,25,95,76,111,97,100,101,114,66,97,115,105,99,115,46, - 101,120,101,99,95,109,111,100,117,108,101,99,2,0,0,0, - 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, - 115,12,0,0,0,116,0,160,1,124,0,124,1,161,2,83, - 0,41,1,122,26,84,104,105,115,32,109,111,100,117,108,101, - 32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,41, - 2,114,122,0,0,0,218,17,95,108,111,97,100,95,109,111, - 100,117,108,101,95,115,104,105,109,41,2,114,108,0,0,0, - 114,127,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,218,11,108,111,97,100,95,109,111,100,117,108, - 101,11,3,0,0,115,2,0,0,0,0,2,122,25,95,76, - 111,97,100,101,114,66,97,115,105,99,115,46,108,111,97,100, - 95,109,111,100,117,108,101,78,41,8,114,113,0,0,0,114, - 112,0,0,0,114,114,0,0,0,114,115,0,0,0,114,166, - 0,0,0,114,192,0,0,0,114,197,0,0,0,114,199,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,190,0,0,0,243,2,0,0,115, - 10,0,0,0,8,3,4,2,8,8,8,3,8,8,114,190, - 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,64,0,0,0,115,74,0,0,0,101,0,90, - 1,100,0,90,2,100,1,100,2,132,0,90,3,100,3,100, - 4,132,0,90,4,100,5,100,6,132,0,90,5,100,7,100, - 8,132,0,90,6,100,9,100,10,132,0,90,7,100,11,100, - 12,156,1,100,13,100,14,132,2,90,8,100,15,100,16,132, - 0,90,9,100,17,83,0,41,18,218,12,83,111,117,114,99, - 101,76,111,97,100,101,114,99,2,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, - 0,116,0,130,1,100,1,83,0,41,2,122,165,79,112,116, - 105,111,110,97,108,32,109,101,116,104,111,100,32,116,104,97, - 116,32,114,101,116,117,114,110,115,32,116,104,101,32,109,111, - 100,105,102,105,99,97,116,105,111,110,32,116,105,109,101,32, - 40,97,110,32,105,110,116,41,32,102,111,114,32,116,104,101, - 10,32,32,32,32,32,32,32,32,115,112,101,99,105,102,105, - 101,100,32,112,97,116,104,32,40,97,32,115,116,114,41,46, - 10,10,32,32,32,32,32,32,32,32,82,97,105,115,101,115, - 32,79,83,69,114,114,111,114,32,119,104,101,110,32,116,104, - 101,32,112,97,116,104,32,99,97,110,110,111,116,32,98,101, - 32,104,97,110,100,108,101,100,46,10,32,32,32,32,32,32, - 32,32,78,41,1,114,44,0,0,0,41,2,114,108,0,0, - 0,114,39,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,218,10,112,97,116,104,95,109,116,105,109, - 101,18,3,0,0,115,2,0,0,0,0,6,122,23,83,111, - 117,114,99,101,76,111,97,100,101,114,46,112,97,116,104,95, - 109,116,105,109,101,99,2,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,67,0,0,0,115,14,0,0,0,100, - 1,124,0,160,0,124,1,161,1,105,1,83,0,41,2,97, - 158,1,0,0,79,112,116,105,111,110,97,108,32,109,101,116, - 104,111,100,32,114,101,116,117,114,110,105,110,103,32,97,32, - 109,101,116,97,100,97,116,97,32,100,105,99,116,32,102,111, - 114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,10, - 32,32,32,32,32,32,32,32,112,97,116,104,32,40,97,32, - 115,116,114,41,46,10,10,32,32,32,32,32,32,32,32,80, - 111,115,115,105,98,108,101,32,107,101,121,115,58,10,32,32, - 32,32,32,32,32,32,45,32,39,109,116,105,109,101,39,32, - 40,109,97,110,100,97,116,111,114,121,41,32,105,115,32,116, - 104,101,32,110,117,109,101,114,105,99,32,116,105,109,101,115, - 116,97,109,112,32,111,102,32,108,97,115,116,32,115,111,117, - 114,99,101,10,32,32,32,32,32,32,32,32,32,32,99,111, - 100,101,32,109,111,100,105,102,105,99,97,116,105,111,110,59, - 10,32,32,32,32,32,32,32,32,45,32,39,115,105,122,101, - 39,32,40,111,112,116,105,111,110,97,108,41,32,105,115,32, - 116,104,101,32,115,105,122,101,32,105,110,32,98,121,116,101, - 115,32,111,102,32,116,104,101,32,115,111,117,114,99,101,32, - 99,111,100,101,46,10,10,32,32,32,32,32,32,32,32,73, - 109,112,108,101,109,101,110,116,105,110,103,32,116,104,105,115, - 32,109,101,116,104,111,100,32,97,108,108,111,119,115,32,116, - 104,101,32,108,111,97,100,101,114,32,116,111,32,114,101,97, - 100,32,98,121,116,101,99,111,100,101,32,102,105,108,101,115, - 46,10,32,32,32,32,32,32,32,32,82,97,105,115,101,115, - 32,79,83,69,114,114,111,114,32,119,104,101,110,32,116,104, - 101,32,112,97,116,104,32,99,97,110,110,111,116,32,98,101, - 32,104,97,110,100,108,101,100,46,10,32,32,32,32,32,32, - 32,32,114,155,0,0,0,41,1,114,201,0,0,0,41,2, - 114,108,0,0,0,114,39,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,10,112,97,116,104,95, - 115,116,97,116,115,26,3,0,0,115,2,0,0,0,0,12, - 122,23,83,111,117,114,99,101,76,111,97,100,101,114,46,112, - 97,116,104,95,115,116,97,116,115,99,4,0,0,0,0,0, - 0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,12, - 0,0,0,124,0,160,0,124,2,124,3,161,2,83,0,41, - 1,122,228,79,112,116,105,111,110,97,108,32,109,101,116,104, - 111,100,32,119,104,105,99,104,32,119,114,105,116,101,115,32, - 100,97,116,97,32,40,98,121,116,101,115,41,32,116,111,32, - 97,32,102,105,108,101,32,112,97,116,104,32,40,97,32,115, - 116,114,41,46,10,10,32,32,32,32,32,32,32,32,73,109, - 112,108,101,109,101,110,116,105,110,103,32,116,104,105,115,32, - 109,101,116,104,111,100,32,97,108,108,111,119,115,32,102,111, - 114,32,116,104,101,32,119,114,105,116,105,110,103,32,111,102, - 32,98,121,116,101,99,111,100,101,32,102,105,108,101,115,46, - 10,10,32,32,32,32,32,32,32,32,84,104,101,32,115,111, - 117,114,99,101,32,112,97,116,104,32,105,115,32,110,101,101, - 100,101,100,32,105,110,32,111,114,100,101,114,32,116,111,32, - 99,111,114,114,101,99,116,108,121,32,116,114,97,110,115,102, - 101,114,32,112,101,114,109,105,115,115,105,111,110,115,10,32, - 32,32,32,32,32,32,32,41,1,218,8,115,101,116,95,100, - 97,116,97,41,4,114,108,0,0,0,114,99,0,0,0,90, - 10,99,97,99,104,101,95,112,97,116,104,114,21,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, - 15,95,99,97,99,104,101,95,98,121,116,101,99,111,100,101, - 40,3,0,0,115,2,0,0,0,0,8,122,28,83,111,117, - 114,99,101,76,111,97,100,101,114,46,95,99,97,99,104,101, - 95,98,121,116,101,99,111,100,101,99,3,0,0,0,0,0, - 0,0,3,0,0,0,1,0,0,0,67,0,0,0,115,4, - 0,0,0,100,1,83,0,41,2,122,150,79,112,116,105,111, - 110,97,108,32,109,101,116,104,111,100,32,119,104,105,99,104, - 32,119,114,105,116,101,115,32,100,97,116,97,32,40,98,121, - 116,101,115,41,32,116,111,32,97,32,102,105,108,101,32,112, - 97,116,104,32,40,97,32,115,116,114,41,46,10,10,32,32, - 32,32,32,32,32,32,73,109,112,108,101,109,101,110,116,105, - 110,103,32,116,104,105,115,32,109,101,116,104,111,100,32,97, - 108,108,111,119,115,32,102,111,114,32,116,104,101,32,119,114, - 105,116,105,110,103,32,111,102,32,98,121,116,101,99,111,100, - 101,32,102,105,108,101,115,46,10,32,32,32,32,32,32,32, - 32,78,114,2,0,0,0,41,3,114,108,0,0,0,114,39, - 0,0,0,114,21,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,203,0,0,0,50,3,0,0, - 115,2,0,0,0,0,4,122,21,83,111,117,114,99,101,76, - 111,97,100,101,114,46,115,101,116,95,100,97,116,97,99,2, - 0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,67, - 0,0,0,115,82,0,0,0,124,0,160,0,124,1,161,1, - 125,2,122,14,124,0,160,1,124,2,161,1,125,3,87,0, - 110,48,4,0,116,2,107,10,114,72,1,0,125,4,1,0, - 122,18,116,3,100,1,124,1,100,2,141,2,124,4,130,2, - 87,0,53,0,100,3,125,4,126,4,88,0,89,0,110,2, - 88,0,116,4,124,3,131,1,83,0,41,4,122,52,67,111, - 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, - 97,116,105,111,110,32,111,102,32,73,110,115,112,101,99,116, - 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, - 101,46,122,39,115,111,117,114,99,101,32,110,111,116,32,97, - 118,97,105,108,97,98,108,101,32,116,104,114,111,117,103,104, - 32,103,101,116,95,100,97,116,97,40,41,41,1,114,106,0, - 0,0,78,41,5,114,164,0,0,0,218,8,103,101,116,95, - 100,97,116,97,114,44,0,0,0,114,107,0,0,0,114,162, - 0,0,0,41,5,114,108,0,0,0,114,127,0,0,0,114, - 39,0,0,0,114,160,0,0,0,218,3,101,120,99,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,10,103, - 101,116,95,115,111,117,114,99,101,57,3,0,0,115,20,0, - 0,0,0,2,10,1,2,1,14,1,16,1,4,1,2,255, - 4,1,2,255,20,2,122,23,83,111,117,114,99,101,76,111, - 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,114, - 96,0,0,0,41,1,218,9,95,111,112,116,105,109,105,122, - 101,99,3,0,0,0,1,0,0,0,4,0,0,0,8,0, - 0,0,67,0,0,0,115,22,0,0,0,116,0,106,1,116, - 2,124,1,124,2,100,1,100,2,124,3,100,3,141,6,83, - 0,41,4,122,130,82,101,116,117,114,110,32,116,104,101,32, - 99,111,100,101,32,111,98,106,101,99,116,32,99,111,109,112, - 105,108,101,100,32,102,114,111,109,32,115,111,117,114,99,101, - 46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,39, - 100,97,116,97,39,32,97,114,103,117,109,101,110,116,32,99, - 97,110,32,98,101,32,97,110,121,32,111,98,106,101,99,116, - 32,116,121,112,101,32,116,104,97,116,32,99,111,109,112,105, - 108,101,40,41,32,115,117,112,112,111,114,116,115,46,10,32, - 32,32,32,32,32,32,32,114,195,0,0,0,84,41,2,218, - 12,100,111,110,116,95,105,110,104,101,114,105,116,114,75,0, - 0,0,41,3,114,122,0,0,0,114,194,0,0,0,218,7, - 99,111,109,112,105,108,101,41,4,114,108,0,0,0,114,21, - 0,0,0,114,39,0,0,0,114,208,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,14,115,111, - 117,114,99,101,95,116,111,95,99,111,100,101,67,3,0,0, - 115,8,0,0,0,0,5,12,1,2,0,2,255,122,27,83, - 111,117,114,99,101,76,111,97,100,101,114,46,115,111,117,114, - 99,101,95,116,111,95,99,111,100,101,99,2,0,0,0,0, - 0,0,0,15,0,0,0,9,0,0,0,67,0,0,0,115, - 34,2,0,0,124,0,160,0,124,1,161,1,125,2,100,1, - 125,3,100,1,125,4,100,1,125,5,100,2,125,6,100,3, - 125,7,122,12,116,1,124,2,131,1,125,8,87,0,110,26, - 4,0,116,2,107,10,114,68,1,0,1,0,1,0,100,1, - 125,8,89,0,144,1,110,48,88,0,122,14,124,0,160,3, - 124,2,161,1,125,9,87,0,110,22,4,0,116,4,107,10, - 114,106,1,0,1,0,1,0,89,0,144,1,110,10,88,0, - 116,5,124,9,100,4,25,0,131,1,125,3,122,14,124,0, - 160,6,124,8,161,1,125,10,87,0,110,20,4,0,116,4, - 107,10,114,154,1,0,1,0,1,0,89,0,110,218,88,0, - 124,1,124,8,100,5,156,2,125,11,122,148,116,7,124,10, - 124,1,124,11,131,3,125,12,116,8,124,10,131,1,100,6, - 100,1,133,2,25,0,125,13,124,12,100,7,64,0,100,8, - 107,3,125,6,124,6,144,1,114,36,124,12,100,9,64,0, - 100,8,107,3,125,7,116,9,106,10,100,10,107,3,144,1, - 114,34,124,7,115,254,116,9,106,10,100,11,107,2,144,1, - 114,34,124,0,160,6,124,2,161,1,125,4,116,9,160,11, - 116,12,124,4,161,2,125,5,116,13,124,10,124,5,124,1, - 124,11,131,4,1,0,110,20,116,14,124,10,124,3,124,9, - 100,12,25,0,124,1,124,11,131,5,1,0,87,0,110,26, - 4,0,116,15,116,16,102,2,107,10,144,1,114,84,1,0, - 1,0,1,0,89,0,110,32,88,0,116,17,160,18,100,13, - 124,8,124,2,161,3,1,0,116,19,124,13,124,1,124,8, - 124,2,100,14,141,4,83,0,124,4,100,1,107,8,144,1, - 114,136,124,0,160,6,124,2,161,1,125,4,124,0,160,20, - 124,4,124,2,161,2,125,14,116,17,160,18,100,15,124,2, - 161,2,1,0,116,21,106,22,144,2,115,30,124,8,100,1, - 107,9,144,2,114,30,124,3,100,1,107,9,144,2,114,30, - 124,6,144,1,114,228,124,5,100,1,107,8,144,1,114,214, - 116,9,160,11,124,4,161,1,125,5,116,23,124,14,124,5, - 124,7,131,3,125,10,110,16,116,24,124,14,124,3,116,25, - 124,4,131,1,131,3,125,10,122,18,124,0,160,26,124,2, - 124,8,124,10,161,3,1,0,87,0,110,22,4,0,116,2, - 107,10,144,2,114,28,1,0,1,0,1,0,89,0,110,2, - 88,0,124,14,83,0,41,16,122,190,67,111,110,99,114,101, - 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, - 110,32,111,102,32,73,110,115,112,101,99,116,76,111,97,100, - 101,114,46,103,101,116,95,99,111,100,101,46,10,10,32,32, - 32,32,32,32,32,32,82,101,97,100,105,110,103,32,111,102, - 32,98,121,116,101,99,111,100,101,32,114,101,113,117,105,114, - 101,115,32,112,97,116,104,95,115,116,97,116,115,32,116,111, - 32,98,101,32,105,109,112,108,101,109,101,110,116,101,100,46, - 32,84,111,32,119,114,105,116,101,10,32,32,32,32,32,32, - 32,32,98,121,116,101,99,111,100,101,44,32,115,101,116,95, - 100,97,116,97,32,109,117,115,116,32,97,108,115,111,32,98, - 101,32,105,109,112,108,101,109,101,110,116,101,100,46,10,10, - 32,32,32,32,32,32,32,32,78,70,84,114,155,0,0,0, - 41,2,114,106,0,0,0,114,39,0,0,0,114,132,0,0, - 0,114,34,0,0,0,114,64,0,0,0,114,23,0,0,0, - 90,5,110,101,118,101,114,90,6,97,108,119,97,121,115,218, - 4,115,105,122,101,122,13,123,125,32,109,97,116,99,104,101, - 115,32,123,125,41,3,114,106,0,0,0,114,98,0,0,0, - 114,99,0,0,0,122,19,99,111,100,101,32,111,98,106,101, - 99,116,32,102,114,111,109,32,123,125,41,27,114,164,0,0, - 0,114,89,0,0,0,114,73,0,0,0,114,202,0,0,0, - 114,44,0,0,0,114,14,0,0,0,114,205,0,0,0,114, - 139,0,0,0,218,10,109,101,109,111,114,121,118,105,101,119, - 114,149,0,0,0,90,21,99,104,101,99,107,95,104,97,115, - 104,95,98,97,115,101,100,95,112,121,99,115,114,144,0,0, - 0,218,17,95,82,65,87,95,77,65,71,73,67,95,78,85, - 77,66,69,82,114,145,0,0,0,114,143,0,0,0,114,107, - 0,0,0,114,137,0,0,0,114,122,0,0,0,114,136,0, - 0,0,114,151,0,0,0,114,211,0,0,0,114,6,0,0, - 0,218,19,100,111,110,116,95,119,114,105,116,101,95,98,121, - 116,101,99,111,100,101,114,157,0,0,0,114,156,0,0,0, - 114,18,0,0,0,114,204,0,0,0,41,15,114,108,0,0, - 0,114,127,0,0,0,114,99,0,0,0,114,141,0,0,0, - 114,160,0,0,0,114,144,0,0,0,90,10,104,97,115,104, - 95,98,97,115,101,100,90,12,99,104,101,99,107,95,115,111, - 117,114,99,101,114,98,0,0,0,218,2,115,116,114,21,0, - 0,0,114,138,0,0,0,114,74,0,0,0,90,10,98,121, - 116,101,115,95,100,97,116,97,90,11,99,111,100,101,95,111, - 98,106,101,99,116,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,193,0,0,0,75,3,0,0,115,152,0, - 0,0,0,7,10,1,4,1,4,1,4,1,4,1,4,1, - 2,1,12,1,14,1,12,2,2,1,14,1,14,1,8,2, - 12,1,2,1,14,1,14,1,6,3,2,1,2,254,6,4, - 2,1,12,1,16,1,12,1,6,1,12,1,12,1,2,255, - 2,2,8,254,4,3,10,1,4,1,2,1,2,254,4,4, - 8,1,2,255,6,3,2,1,2,1,2,1,6,1,2,1, - 2,251,8,7,20,1,6,2,8,1,2,255,4,2,6,1, - 2,1,2,254,6,3,10,1,10,1,12,1,12,1,18,1, - 6,255,4,2,6,1,10,1,10,1,14,2,6,1,6,255, - 4,2,2,1,18,1,16,1,6,1,122,21,83,111,117,114, - 99,101,76,111,97,100,101,114,46,103,101,116,95,99,111,100, - 101,78,41,10,114,113,0,0,0,114,112,0,0,0,114,114, - 0,0,0,114,201,0,0,0,114,202,0,0,0,114,204,0, - 0,0,114,203,0,0,0,114,207,0,0,0,114,211,0,0, - 0,114,193,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,200,0,0,0,16, - 3,0,0,115,14,0,0,0,8,2,8,8,8,14,8,10, - 8,7,8,10,14,8,114,200,0,0,0,99,0,0,0,0, - 0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0, - 115,124,0,0,0,101,0,90,1,100,0,90,2,100,1,90, - 3,100,2,100,3,132,0,90,4,100,4,100,5,132,0,90, - 5,100,6,100,7,132,0,90,6,101,7,135,0,102,1,100, - 8,100,9,132,8,131,1,90,8,101,7,100,10,100,11,132, - 0,131,1,90,9,100,12,100,13,132,0,90,10,101,7,100, - 14,100,15,132,0,131,1,90,11,100,16,100,17,132,0,90, - 12,100,18,100,19,132,0,90,13,100,20,100,21,132,0,90, - 14,100,22,100,23,132,0,90,15,135,0,4,0,90,16,83, - 0,41,24,218,10,70,105,108,101,76,111,97,100,101,114,122, - 103,66,97,115,101,32,102,105,108,101,32,108,111,97,100,101, - 114,32,99,108,97,115,115,32,119,104,105,99,104,32,105,109, - 112,108,101,109,101,110,116,115,32,116,104,101,32,108,111,97, - 100,101,114,32,112,114,111,116,111,99,111,108,32,109,101,116, - 104,111,100,115,32,116,104,97,116,10,32,32,32,32,114,101, - 113,117,105,114,101,32,102,105,108,101,32,115,121,115,116,101, - 109,32,117,115,97,103,101,46,99,3,0,0,0,0,0,0, - 0,3,0,0,0,2,0,0,0,67,0,0,0,115,16,0, - 0,0,124,1,124,0,95,0,124,2,124,0,95,1,100,1, - 83,0,41,2,122,75,67,97,99,104,101,32,116,104,101,32, - 109,111,100,117,108,101,32,110,97,109,101,32,97,110,100,32, - 116,104,101,32,112,97,116,104,32,116,111,32,116,104,101,32, - 102,105,108,101,32,102,111,117,110,100,32,98,121,32,116,104, - 101,10,32,32,32,32,32,32,32,32,102,105,110,100,101,114, - 46,78,41,2,114,106,0,0,0,114,39,0,0,0,41,3, - 114,108,0,0,0,114,127,0,0,0,114,39,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,191, - 0,0,0,165,3,0,0,115,4,0,0,0,0,3,6,1, - 122,19,70,105,108,101,76,111,97,100,101,114,46,95,95,105, - 110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,0, - 0,0,2,0,0,0,67,0,0,0,115,24,0,0,0,124, - 0,106,0,124,1,106,0,107,2,111,22,124,0,106,1,124, - 1,106,1,107,2,83,0,41,1,78,41,2,218,9,95,95, - 99,108,97,115,115,95,95,114,119,0,0,0,41,2,114,108, - 0,0,0,218,5,111,116,104,101,114,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,6,95,95,101,113,95, - 95,171,3,0,0,115,6,0,0,0,0,1,12,1,10,255, - 122,17,70,105,108,101,76,111,97,100,101,114,46,95,95,101, - 113,95,95,99,1,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,67,0,0,0,115,20,0,0,0,116,0,124, - 0,106,1,131,1,116,0,124,0,106,2,131,1,65,0,83, - 0,41,1,78,41,3,218,4,104,97,115,104,114,106,0,0, - 0,114,39,0,0,0,41,1,114,108,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,8,95,95, - 104,97,115,104,95,95,175,3,0,0,115,2,0,0,0,0, - 1,122,19,70,105,108,101,76,111,97,100,101,114,46,95,95, - 104,97,115,104,95,95,99,2,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,3,0,0,0,115,16,0,0,0, - 116,0,116,1,124,0,131,2,160,2,124,1,161,1,83,0, - 41,1,122,100,76,111,97,100,32,97,32,109,111,100,117,108, - 101,32,102,114,111,109,32,97,32,102,105,108,101,46,10,10, - 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, - 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, - 100,46,32,32,85,115,101,32,101,120,101,99,95,109,111,100, - 117,108,101,40,41,32,105,110,115,116,101,97,100,46,10,10, - 32,32,32,32,32,32,32,32,41,3,218,5,115,117,112,101, - 114,114,217,0,0,0,114,199,0,0,0,41,2,114,108,0, - 0,0,114,127,0,0,0,41,1,114,218,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,199,0,0,0,178,3,0, - 0,115,2,0,0,0,0,10,122,22,70,105,108,101,76,111, - 97,100,101,114,46,108,111,97,100,95,109,111,100,117,108,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,6,0,0,0,124,0,106,0,83,0, - 41,1,122,58,82,101,116,117,114,110,32,116,104,101,32,112, - 97,116,104,32,116,111,32,116,104,101,32,115,111,117,114,99, - 101,32,102,105,108,101,32,97,115,32,102,111,117,110,100,32, - 98,121,32,116,104,101,32,102,105,110,100,101,114,46,41,1, - 114,39,0,0,0,41,2,114,108,0,0,0,114,127,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,164,0,0,0,190,3,0,0,115,2,0,0,0,0,3, - 122,23,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,102,105,108,101,110,97,109,101,99,2,0,0,0,0,0, - 0,0,3,0,0,0,10,0,0,0,67,0,0,0,115,44, - 0,0,0,116,0,160,1,124,1,100,1,161,2,143,22,125, - 2,124,2,160,2,161,0,87,0,2,0,53,0,81,0,82, - 0,163,0,83,0,81,0,82,0,88,0,100,2,83,0,41, - 3,122,39,82,101,116,117,114,110,32,116,104,101,32,100,97, - 116,97,32,102,114,111,109,32,112,97,116,104,32,97,115,32, - 114,97,119,32,98,121,116,101,115,46,218,1,114,78,41,3, - 114,56,0,0,0,114,57,0,0,0,90,4,114,101,97,100, - 41,3,114,108,0,0,0,114,39,0,0,0,114,60,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 114,205,0,0,0,195,3,0,0,115,4,0,0,0,0,2, - 14,1,122,19,70,105,108,101,76,111,97,100,101,114,46,103, - 101,116,95,100,97,116,97,99,2,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,67,0,0,0,115,18,0,0, - 0,124,0,160,0,124,1,161,1,114,14,124,0,83,0,100, - 0,83,0,41,1,78,41,1,114,166,0,0,0,41,2,114, - 108,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,218,19,103,101,116,95,114,101, - 115,111,117,114,99,101,95,114,101,97,100,101,114,202,3,0, - 0,115,6,0,0,0,0,2,10,1,4,1,122,30,70,105, - 108,101,76,111,97,100,101,114,46,103,101,116,95,114,101,115, - 111,117,114,99,101,95,114,101,97,100,101,114,99,2,0,0, - 0,0,0,0,0,3,0,0,0,4,0,0,0,67,0,0, - 0,115,32,0,0,0,116,0,116,1,124,0,106,2,131,1, - 100,1,25,0,124,1,131,2,125,2,116,3,160,4,124,2, - 100,2,161,2,83,0,41,3,78,114,64,0,0,0,114,224, - 0,0,0,41,5,114,33,0,0,0,114,42,0,0,0,114, - 39,0,0,0,114,56,0,0,0,114,57,0,0,0,41,3, - 114,108,0,0,0,218,8,114,101,115,111,117,114,99,101,114, - 39,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,13,111,112,101,110,95,114,101,115,111,117,114, - 99,101,208,3,0,0,115,4,0,0,0,0,1,20,1,122, - 24,70,105,108,101,76,111,97,100,101,114,46,111,112,101,110, - 95,114,101,115,111,117,114,99,101,99,2,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38, - 0,0,0,124,0,160,0,124,1,161,1,115,14,116,1,130, - 1,116,2,116,3,124,0,106,4,131,1,100,1,25,0,124, - 1,131,2,125,2,124,2,83,0,41,2,78,114,64,0,0, - 0,41,5,218,11,105,115,95,114,101,115,111,117,114,99,101, - 218,17,70,105,108,101,78,111,116,70,111,117,110,100,69,114, - 114,111,114,114,33,0,0,0,114,42,0,0,0,114,39,0, - 0,0,41,3,114,108,0,0,0,114,226,0,0,0,114,39, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,13,114,101,115,111,117,114,99,101,95,112,97,116, - 104,212,3,0,0,115,8,0,0,0,0,1,10,1,4,1, - 20,1,122,24,70,105,108,101,76,111,97,100,101,114,46,114, - 101,115,111,117,114,99,101,95,112,97,116,104,99,2,0,0, - 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, - 0,115,40,0,0,0,116,0,124,1,107,6,114,12,100,1, - 83,0,116,1,116,2,124,0,106,3,131,1,100,2,25,0, - 124,1,131,2,125,2,116,4,124,2,131,1,83,0,41,3, - 78,70,114,64,0,0,0,41,5,114,30,0,0,0,114,33, - 0,0,0,114,42,0,0,0,114,39,0,0,0,114,48,0, - 0,0,41,3,114,108,0,0,0,114,106,0,0,0,114,39, - 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,228,0,0,0,218,3,0,0,115,8,0,0,0, - 0,1,8,1,4,1,20,1,122,22,70,105,108,101,76,111, - 97,100,101,114,46,105,115,95,114,101,115,111,117,114,99,101, - 99,1,0,0,0,0,0,0,0,1,0,0,0,5,0,0, - 0,67,0,0,0,115,24,0,0,0,116,0,116,1,160,2, - 116,3,124,0,106,4,131,1,100,1,25,0,161,1,131,1, - 83,0,41,2,78,114,64,0,0,0,41,5,218,4,105,116, - 101,114,114,1,0,0,0,218,7,108,105,115,116,100,105,114, - 114,42,0,0,0,114,39,0,0,0,41,1,114,108,0,0, - 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, - 218,8,99,111,110,116,101,110,116,115,224,3,0,0,115,2, - 0,0,0,0,1,122,19,70,105,108,101,76,111,97,100,101, - 114,46,99,111,110,116,101,110,116,115,41,17,114,113,0,0, - 0,114,112,0,0,0,114,114,0,0,0,114,115,0,0,0, - 114,191,0,0,0,114,220,0,0,0,114,222,0,0,0,114, - 124,0,0,0,114,199,0,0,0,114,164,0,0,0,114,205, - 0,0,0,114,225,0,0,0,114,227,0,0,0,114,230,0, - 0,0,114,228,0,0,0,114,233,0,0,0,90,13,95,95, - 99,108,97,115,115,99,101,108,108,95,95,114,2,0,0,0, - 114,2,0,0,0,41,1,114,218,0,0,0,114,4,0,0, - 0,114,217,0,0,0,160,3,0,0,115,24,0,0,0,8, - 3,4,2,8,6,8,4,8,3,16,12,12,5,8,7,12, - 6,8,4,8,6,8,6,114,217,0,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, - 0,115,46,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, - 90,5,100,6,100,7,156,1,100,8,100,9,132,2,90,6, - 100,10,83,0,41,11,218,16,83,111,117,114,99,101,70,105, - 108,101,76,111,97,100,101,114,122,62,67,111,110,99,114,101, - 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, - 110,32,111,102,32,83,111,117,114,99,101,76,111,97,100,101, - 114,32,117,115,105,110,103,32,116,104,101,32,102,105,108,101, - 32,115,121,115,116,101,109,46,99,2,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,67,0,0,0,115,22,0, - 0,0,116,0,124,1,131,1,125,2,124,2,106,1,124,2, - 106,2,100,1,156,2,83,0,41,2,122,33,82,101,116,117, - 114,110,32,116,104,101,32,109,101,116,97,100,97,116,97,32, - 102,111,114,32,116,104,101,32,112,97,116,104,46,41,2,114, - 155,0,0,0,114,212,0,0,0,41,3,114,43,0,0,0, - 218,8,115,116,95,109,116,105,109,101,90,7,115,116,95,115, - 105,122,101,41,3,114,108,0,0,0,114,39,0,0,0,114, - 216,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,114,202,0,0,0,232,3,0,0,115,4,0,0, - 0,0,2,8,1,122,27,83,111,117,114,99,101,70,105,108, - 101,76,111,97,100,101,114,46,112,97,116,104,95,115,116,97, - 116,115,99,4,0,0,0,0,0,0,0,5,0,0,0,5, - 0,0,0,67,0,0,0,115,24,0,0,0,116,0,124,1, - 131,1,125,4,124,0,106,1,124,2,124,3,124,4,100,1, - 141,3,83,0,41,2,78,41,1,218,5,95,109,111,100,101, - 41,2,114,105,0,0,0,114,203,0,0,0,41,5,114,108, - 0,0,0,114,99,0,0,0,114,98,0,0,0,114,21,0, - 0,0,114,46,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,204,0,0,0,237,3,0,0,115, - 4,0,0,0,0,2,8,1,122,32,83,111,117,114,99,101, - 70,105,108,101,76,111,97,100,101,114,46,95,99,97,99,104, - 101,95,98,121,116,101,99,111,100,101,105,182,1,0,0,41, - 1,114,236,0,0,0,99,3,0,0,0,1,0,0,0,9, - 0,0,0,11,0,0,0,67,0,0,0,115,0,1,0,0, - 116,0,124,1,131,1,92,2,125,4,125,5,103,0,125,6, - 124,4,114,52,116,1,124,4,131,1,115,52,116,0,124,4, - 131,1,92,2,125,4,125,7,124,6,160,2,124,7,161,1, - 1,0,113,16,116,3,124,6,131,1,68,0,93,112,125,7, - 116,4,124,4,124,7,131,2,125,4,122,14,116,5,160,6, - 124,4,161,1,1,0,87,0,110,82,4,0,116,7,107,10, - 114,112,1,0,1,0,1,0,89,0,113,60,89,0,110,60, - 4,0,116,8,107,10,114,170,1,0,125,8,1,0,122,30, - 116,9,160,10,100,1,124,4,124,8,161,3,1,0,87,0, - 89,0,162,10,1,0,100,2,83,0,87,0,53,0,100,2, - 125,8,126,8,88,0,89,0,110,2,88,0,113,60,122,28, - 116,11,124,1,124,2,124,3,131,3,1,0,116,9,160,10, - 100,3,124,1,161,2,1,0,87,0,110,48,4,0,116,8, - 107,10,114,250,1,0,125,8,1,0,122,18,116,9,160,10, - 100,1,124,1,124,8,161,3,1,0,87,0,53,0,100,2, - 125,8,126,8,88,0,89,0,110,2,88,0,100,2,83,0, - 41,4,122,27,87,114,105,116,101,32,98,121,116,101,115,32, - 100,97,116,97,32,116,111,32,97,32,102,105,108,101,46,122, - 27,99,111,117,108,100,32,110,111,116,32,99,114,101,97,116, - 101,32,123,33,114,125,58,32,123,33,114,125,78,122,12,99, - 114,101,97,116,101,100,32,123,33,114,125,41,12,114,42,0, - 0,0,114,50,0,0,0,114,170,0,0,0,114,37,0,0, - 0,114,33,0,0,0,114,1,0,0,0,90,5,109,107,100, - 105,114,218,15,70,105,108,101,69,120,105,115,116,115,69,114, - 114,111,114,114,44,0,0,0,114,122,0,0,0,114,136,0, - 0,0,114,61,0,0,0,41,9,114,108,0,0,0,114,39, - 0,0,0,114,21,0,0,0,114,236,0,0,0,218,6,112, - 97,114,101,110,116,114,88,0,0,0,114,32,0,0,0,114, - 28,0,0,0,114,206,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,203,0,0,0,242,3,0, - 0,115,48,0,0,0,0,2,12,1,4,2,12,1,12,1, - 12,2,12,1,10,1,2,1,14,1,14,2,8,1,16,3, - 6,1,2,0,2,255,4,2,32,1,2,1,12,1,16,1, - 16,2,8,1,2,255,122,25,83,111,117,114,99,101,70,105, - 108,101,76,111,97,100,101,114,46,115,101,116,95,100,97,116, - 97,78,41,7,114,113,0,0,0,114,112,0,0,0,114,114, - 0,0,0,114,115,0,0,0,114,202,0,0,0,114,204,0, - 0,0,114,203,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,234,0,0,0, - 228,3,0,0,115,8,0,0,0,8,2,4,2,8,5,8, - 5,114,234,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,64,0,0,0,115,32,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, - 132,0,90,4,100,4,100,5,132,0,90,5,100,6,83,0, - 41,7,218,20,83,111,117,114,99,101,108,101,115,115,70,105, - 108,101,76,111,97,100,101,114,122,45,76,111,97,100,101,114, - 32,119,104,105,99,104,32,104,97,110,100,108,101,115,32,115, - 111,117,114,99,101,108,101,115,115,32,102,105,108,101,32,105, - 109,112,111,114,116,115,46,99,2,0,0,0,0,0,0,0, - 5,0,0,0,5,0,0,0,67,0,0,0,115,68,0,0, - 0,124,0,160,0,124,1,161,1,125,2,124,0,160,1,124, - 2,161,1,125,3,124,1,124,2,100,1,156,2,125,4,116, - 2,124,3,124,1,124,4,131,3,1,0,116,3,116,4,124, - 3,131,1,100,2,100,0,133,2,25,0,124,1,124,2,100, - 3,141,3,83,0,41,4,78,41,2,114,106,0,0,0,114, - 39,0,0,0,114,132,0,0,0,41,2,114,106,0,0,0, - 114,98,0,0,0,41,5,114,164,0,0,0,114,205,0,0, - 0,114,139,0,0,0,114,151,0,0,0,114,213,0,0,0, - 41,5,114,108,0,0,0,114,127,0,0,0,114,39,0,0, - 0,114,21,0,0,0,114,138,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,193,0,0,0,21, - 4,0,0,115,22,0,0,0,0,1,10,1,10,4,2,1, - 2,254,6,4,12,1,2,1,14,1,2,1,2,253,122,29, - 83,111,117,114,99,101,108,101,115,115,70,105,108,101,76,111, - 97,100,101,114,46,103,101,116,95,99,111,100,101,99,2,0, - 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, - 0,0,115,4,0,0,0,100,1,83,0,41,2,122,39,82, - 101,116,117,114,110,32,78,111,110,101,32,97,115,32,116,104, - 101,114,101,32,105,115,32,110,111,32,115,111,117,114,99,101, - 32,99,111,100,101,46,78,114,2,0,0,0,41,2,114,108, - 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,207,0,0,0,37,4,0,0, - 115,2,0,0,0,0,2,122,31,83,111,117,114,99,101,108, - 101,115,115,70,105,108,101,76,111,97,100,101,114,46,103,101, - 116,95,115,111,117,114,99,101,78,41,6,114,113,0,0,0, - 114,112,0,0,0,114,114,0,0,0,114,115,0,0,0,114, - 193,0,0,0,114,207,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,239,0, - 0,0,17,4,0,0,115,6,0,0,0,8,2,4,2,8, - 16,114,239,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,3,0,0,0,64,0,0,0,115,92,0,0,0, + 115,28,0,0,0,8,2,4,3,2,255,2,4,2,255,2, + 3,4,2,2,1,10,6,2,1,10,14,2,1,16,15,2, + 1,114,175,0,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,64,0,0,0,115,48,0,0,0, 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, 132,0,90,4,100,4,100,5,132,0,90,5,100,6,100,7, - 132,0,90,6,100,8,100,9,132,0,90,7,100,10,100,11, - 132,0,90,8,100,12,100,13,132,0,90,9,100,14,100,15, - 132,0,90,10,100,16,100,17,132,0,90,11,101,12,100,18, - 100,19,132,0,131,1,90,13,100,20,83,0,41,21,218,19, - 69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97, - 100,101,114,122,93,76,111,97,100,101,114,32,102,111,114,32, - 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, - 115,46,10,10,32,32,32,32,84,104,101,32,99,111,110,115, - 116,114,117,99,116,111,114,32,105,115,32,100,101,115,105,103, - 110,101,100,32,116,111,32,119,111,114,107,32,119,105,116,104, - 32,70,105,108,101,70,105,110,100,101,114,46,10,10,32,32, - 32,32,99,3,0,0,0,0,0,0,0,3,0,0,0,2, - 0,0,0,67,0,0,0,115,16,0,0,0,124,1,124,0, - 95,0,124,2,124,0,95,1,100,0,83,0,41,1,78,41, - 2,114,106,0,0,0,114,39,0,0,0,41,3,114,108,0, - 0,0,114,106,0,0,0,114,39,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,191,0,0,0, - 54,4,0,0,115,4,0,0,0,0,1,6,1,122,28,69, - 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, - 101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,0, - 0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0, - 115,24,0,0,0,124,0,106,0,124,1,106,0,107,2,111, - 22,124,0,106,1,124,1,106,1,107,2,83,0,41,1,78, - 41,2,114,218,0,0,0,114,119,0,0,0,41,2,114,108, - 0,0,0,114,219,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,220,0,0,0,58,4,0,0, - 115,6,0,0,0,0,1,12,1,10,255,122,26,69,120,116, - 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, - 46,95,95,101,113,95,95,99,1,0,0,0,0,0,0,0, - 1,0,0,0,3,0,0,0,67,0,0,0,115,20,0,0, - 0,116,0,124,0,106,1,131,1,116,0,124,0,106,2,131, - 1,65,0,83,0,41,1,78,41,3,114,221,0,0,0,114, - 106,0,0,0,114,39,0,0,0,41,1,114,108,0,0,0, + 132,0,90,6,100,8,100,9,132,0,90,7,100,10,83,0, + 41,11,218,13,95,76,111,97,100,101,114,66,97,115,105,99, + 115,122,83,66,97,115,101,32,99,108,97,115,115,32,111,102, + 32,99,111,109,109,111,110,32,99,111,100,101,32,110,101,101, + 100,101,100,32,98,121,32,98,111,116,104,32,83,111,117,114, + 99,101,76,111,97,100,101,114,32,97,110,100,10,32,32,32, + 32,83,111,117,114,99,101,108,101,115,115,70,105,108,101,76, + 111,97,100,101,114,46,99,2,0,0,0,0,0,0,0,5, + 0,0,0,4,0,0,0,67,0,0,0,115,64,0,0,0, + 116,0,124,0,160,1,124,1,161,1,131,1,100,1,25,0, + 125,2,124,2,160,2,100,2,100,1,161,2,100,3,25,0, + 125,3,124,1,160,3,100,2,161,1,100,4,25,0,125,4, + 124,3,100,5,107,2,111,62,124,4,100,5,107,3,83,0, + 41,6,122,141,67,111,110,99,114,101,116,101,32,105,109,112, + 108,101,109,101,110,116,97,116,105,111,110,32,111,102,32,73, + 110,115,112,101,99,116,76,111,97,100,101,114,46,105,115,95, + 112,97,99,107,97,103,101,32,98,121,32,99,104,101,99,107, + 105,110,103,32,105,102,10,32,32,32,32,32,32,32,32,116, + 104,101,32,112,97,116,104,32,114,101,116,117,114,110,101,100, + 32,98,121,32,103,101,116,95,102,105,108,101,110,97,109,101, + 32,104,97,115,32,97,32,102,105,108,101,110,97,109,101,32, + 111,102,32,39,95,95,105,110,105,116,95,95,46,112,121,39, + 46,114,34,0,0,0,114,63,0,0,0,114,64,0,0,0, + 114,23,0,0,0,218,8,95,95,105,110,105,116,95,95,41, + 4,114,42,0,0,0,114,164,0,0,0,114,38,0,0,0, + 114,36,0,0,0,41,5,114,108,0,0,0,114,127,0,0, + 0,114,88,0,0,0,90,13,102,105,108,101,110,97,109,101, + 95,98,97,115,101,90,9,116,97,105,108,95,110,97,109,101, 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 222,0,0,0,62,4,0,0,115,2,0,0,0,0,1,122, - 28,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, - 97,100,101,114,46,95,95,104,97,115,104,95,95,99,2,0, - 0,0,0,0,0,0,3,0,0,0,5,0,0,0,67,0, - 0,0,115,36,0,0,0,116,0,160,1,116,2,106,3,124, - 1,161,2,125,2,116,0,160,4,100,1,124,1,106,5,124, - 0,106,6,161,3,1,0,124,2,83,0,41,2,122,38,67, - 114,101,97,116,101,32,97,110,32,117,110,105,116,105,97,108, - 105,122,101,100,32,101,120,116,101,110,115,105,111,110,32,109, - 111,100,117,108,101,122,38,101,120,116,101,110,115,105,111,110, - 32,109,111,100,117,108,101,32,123,33,114,125,32,108,111,97, - 100,101,100,32,102,114,111,109,32,123,33,114,125,41,7,114, - 122,0,0,0,114,194,0,0,0,114,149,0,0,0,90,14, - 99,114,101,97,116,101,95,100,121,110,97,109,105,99,114,136, - 0,0,0,114,106,0,0,0,114,39,0,0,0,41,3,114, - 108,0,0,0,114,171,0,0,0,114,196,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,192,0, - 0,0,65,4,0,0,115,18,0,0,0,0,2,4,1,4, - 0,2,255,4,2,6,1,4,0,4,255,4,2,122,33,69, - 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, - 101,114,46,99,114,101,97,116,101,95,109,111,100,117,108,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,5,0,0, - 0,67,0,0,0,115,36,0,0,0,116,0,160,1,116,2, - 106,3,124,1,161,2,1,0,116,0,160,4,100,1,124,0, - 106,5,124,0,106,6,161,3,1,0,100,2,83,0,41,3, - 122,30,73,110,105,116,105,97,108,105,122,101,32,97,110,32, - 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, - 122,40,101,120,116,101,110,115,105,111,110,32,109,111,100,117, - 108,101,32,123,33,114,125,32,101,120,101,99,117,116,101,100, - 32,102,114,111,109,32,123,33,114,125,78,41,7,114,122,0, - 0,0,114,194,0,0,0,114,149,0,0,0,90,12,101,120, - 101,99,95,100,121,110,97,109,105,99,114,136,0,0,0,114, - 106,0,0,0,114,39,0,0,0,41,2,114,108,0,0,0, - 114,196,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,197,0,0,0,73,4,0,0,115,10,0, - 0,0,0,2,14,1,6,1,4,0,4,255,122,31,69,120, - 116,101,110,115,105,111,110,70,105,108,101,76,111,97,100,101, - 114,46,101,120,101,99,95,109,111,100,117,108,101,99,2,0, - 0,0,0,0,0,0,2,0,0,0,4,0,0,0,3,0, - 0,0,115,36,0,0,0,116,0,124,0,106,1,131,1,100, - 1,25,0,137,0,116,2,135,0,102,1,100,2,100,3,132, - 8,116,3,68,0,131,1,131,1,83,0,41,4,122,49,82, - 101,116,117,114,110,32,84,114,117,101,32,105,102,32,116,104, - 101,32,101,120,116,101,110,115,105,111,110,32,109,111,100,117, - 108,101,32,105,115,32,97,32,112,97,99,107,97,103,101,46, - 114,34,0,0,0,99,1,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,51,0,0,0,115,26,0,0,0,124, - 0,93,18,125,1,136,0,100,0,124,1,23,0,107,2,86, - 0,1,0,113,2,100,1,83,0,41,2,114,191,0,0,0, - 78,114,2,0,0,0,41,2,114,27,0,0,0,218,6,115, - 117,102,102,105,120,41,1,218,9,102,105,108,101,95,110,97, - 109,101,114,2,0,0,0,114,4,0,0,0,218,9,60,103, - 101,110,101,120,112,114,62,82,4,0,0,115,4,0,0,0, - 4,1,2,255,122,49,69,120,116,101,110,115,105,111,110,70, - 105,108,101,76,111,97,100,101,114,46,105,115,95,112,97,99, - 107,97,103,101,46,60,108,111,99,97,108,115,62,46,60,103, - 101,110,101,120,112,114,62,41,4,114,42,0,0,0,114,39, - 0,0,0,218,3,97,110,121,218,18,69,88,84,69,78,83, - 73,79,78,95,83,85,70,70,73,88,69,83,41,2,114,108, - 0,0,0,114,127,0,0,0,114,2,0,0,0,41,1,114, - 242,0,0,0,114,4,0,0,0,114,166,0,0,0,79,4, - 0,0,115,8,0,0,0,0,2,14,1,12,1,2,255,122, - 30,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, - 97,100,101,114,46,105,115,95,112,97,99,107,97,103,101,99, + 166,0,0,0,248,2,0,0,115,8,0,0,0,0,3,18, + 1,16,1,14,1,122,24,95,76,111,97,100,101,114,66,97, + 115,105,99,115,46,105,115,95,112,97,99,107,97,103,101,99, 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, - 63,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, - 97,110,32,101,120,116,101,110,115,105,111,110,32,109,111,100, - 117,108,101,32,99,97,110,110,111,116,32,99,114,101,97,116, - 101,32,97,32,99,111,100,101,32,111,98,106,101,99,116,46, - 78,114,2,0,0,0,41,2,114,108,0,0,0,114,127,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,193,0,0,0,85,4,0,0,115,2,0,0,0,0, - 2,122,28,69,120,116,101,110,115,105,111,110,70,105,108,101, - 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,99, - 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, - 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, - 53,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, - 101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,101, - 115,32,104,97,118,101,32,110,111,32,115,111,117,114,99,101, - 32,99,111,100,101,46,78,114,2,0,0,0,41,2,114,108, - 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,207,0,0,0,89,4,0,0, - 115,2,0,0,0,0,2,122,30,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,6,0,0, - 0,124,0,106,0,83,0,41,1,122,58,82,101,116,117,114, - 110,32,116,104,101,32,112,97,116,104,32,116,111,32,116,104, - 101,32,115,111,117,114,99,101,32,102,105,108,101,32,97,115, - 32,102,111,117,110,100,32,98,121,32,116,104,101,32,102,105, - 110,100,101,114,46,41,1,114,39,0,0,0,41,2,114,108, - 0,0,0,114,127,0,0,0,114,2,0,0,0,114,2,0, - 0,0,114,4,0,0,0,114,164,0,0,0,93,4,0,0, - 115,2,0,0,0,0,3,122,32,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,102,105,108,101,110,97,109,101,78,41,14,114,113,0,0, - 0,114,112,0,0,0,114,114,0,0,0,114,115,0,0,0, - 114,191,0,0,0,114,220,0,0,0,114,222,0,0,0,114, - 192,0,0,0,114,197,0,0,0,114,166,0,0,0,114,193, - 0,0,0,114,207,0,0,0,114,124,0,0,0,114,164,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,240,0,0,0,46,4,0,0,115, - 20,0,0,0,8,6,4,2,8,4,8,4,8,3,8,8, - 8,6,8,6,8,4,8,4,114,240,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, - 0,0,115,96,0,0,0,101,0,90,1,100,0,90,2,100, - 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, - 0,90,5,100,6,100,7,132,0,90,6,100,8,100,9,132, - 0,90,7,100,10,100,11,132,0,90,8,100,12,100,13,132, - 0,90,9,100,14,100,15,132,0,90,10,100,16,100,17,132, - 0,90,11,100,18,100,19,132,0,90,12,100,20,100,21,132, - 0,90,13,100,22,83,0,41,23,218,14,95,78,97,109,101, - 115,112,97,99,101,80,97,116,104,97,38,1,0,0,82,101, - 112,114,101,115,101,110,116,115,32,97,32,110,97,109,101,115, - 112,97,99,101,32,112,97,99,107,97,103,101,39,115,32,112, - 97,116,104,46,32,32,73,116,32,117,115,101,115,32,116,104, - 101,32,109,111,100,117,108,101,32,110,97,109,101,10,32,32, - 32,32,116,111,32,102,105,110,100,32,105,116,115,32,112,97, - 114,101,110,116,32,109,111,100,117,108,101,44,32,97,110,100, - 32,102,114,111,109,32,116,104,101,114,101,32,105,116,32,108, - 111,111,107,115,32,117,112,32,116,104,101,32,112,97,114,101, - 110,116,39,115,10,32,32,32,32,95,95,112,97,116,104,95, - 95,46,32,32,87,104,101,110,32,116,104,105,115,32,99,104, - 97,110,103,101,115,44,32,116,104,101,32,109,111,100,117,108, - 101,39,115,32,111,119,110,32,112,97,116,104,32,105,115,32, - 114,101,99,111,109,112,117,116,101,100,44,10,32,32,32,32, - 117,115,105,110,103,32,112,97,116,104,95,102,105,110,100,101, - 114,46,32,32,70,111,114,32,116,111,112,45,108,101,118,101, - 108,32,109,111,100,117,108,101,115,44,32,116,104,101,32,112, - 97,114,101,110,116,32,109,111,100,117,108,101,39,115,32,112, - 97,116,104,10,32,32,32,32,105,115,32,115,121,115,46,112, - 97,116,104,46,99,4,0,0,0,0,0,0,0,4,0,0, - 0,3,0,0,0,67,0,0,0,115,36,0,0,0,124,1, - 124,0,95,0,124,2,124,0,95,1,116,2,124,0,160,3, - 161,0,131,1,124,0,95,4,124,3,124,0,95,5,100,0, - 83,0,41,1,78,41,6,218,5,95,110,97,109,101,218,5, - 95,112,97,116,104,114,102,0,0,0,218,16,95,103,101,116, - 95,112,97,114,101,110,116,95,112,97,116,104,218,17,95,108, - 97,115,116,95,112,97,114,101,110,116,95,112,97,116,104,218, - 12,95,112,97,116,104,95,102,105,110,100,101,114,41,4,114, - 108,0,0,0,114,106,0,0,0,114,39,0,0,0,218,11, - 112,97,116,104,95,102,105,110,100,101,114,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,191,0,0,0,106, - 4,0,0,115,8,0,0,0,0,1,6,1,6,1,14,1, - 122,23,95,78,97,109,101,115,112,97,99,101,80,97,116,104, - 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, - 0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,38, - 0,0,0,124,0,106,0,160,1,100,1,161,1,92,3,125, - 1,125,2,125,3,124,2,100,2,107,2,114,30,100,3,83, - 0,124,1,100,4,102,2,83,0,41,5,122,62,82,101,116, - 117,114,110,115,32,97,32,116,117,112,108,101,32,111,102,32, - 40,112,97,114,101,110,116,45,109,111,100,117,108,101,45,110, - 97,109,101,44,32,112,97,114,101,110,116,45,112,97,116,104, - 45,97,116,116,114,45,110,97,109,101,41,114,63,0,0,0, - 114,35,0,0,0,41,2,114,6,0,0,0,114,39,0,0, - 0,90,8,95,95,112,97,116,104,95,95,41,2,114,247,0, - 0,0,114,36,0,0,0,41,4,114,108,0,0,0,114,238, - 0,0,0,218,3,100,111,116,90,2,109,101,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,218,23,95,102,105, - 110,100,95,112,97,114,101,110,116,95,112,97,116,104,95,110, - 97,109,101,115,112,4,0,0,115,8,0,0,0,0,2,18, - 1,8,2,4,3,122,38,95,78,97,109,101,115,112,97,99, - 101,80,97,116,104,46,95,102,105,110,100,95,112,97,114,101, - 110,116,95,112,97,116,104,95,110,97,109,101,115,99,1,0, - 0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,0, - 0,0,115,28,0,0,0,124,0,160,0,161,0,92,2,125, - 1,125,2,116,1,116,2,106,3,124,1,25,0,124,2,131, - 2,83,0,41,1,78,41,4,114,254,0,0,0,114,118,0, - 0,0,114,6,0,0,0,218,7,109,111,100,117,108,101,115, - 41,3,114,108,0,0,0,90,18,112,97,114,101,110,116,95, - 109,111,100,117,108,101,95,110,97,109,101,90,14,112,97,116, - 104,95,97,116,116,114,95,110,97,109,101,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,249,0,0,0,122, - 4,0,0,115,4,0,0,0,0,1,12,1,122,31,95,78, - 97,109,101,115,112,97,99,101,80,97,116,104,46,95,103,101, - 116,95,112,97,114,101,110,116,95,112,97,116,104,99,1,0, - 0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0, - 0,0,115,80,0,0,0,116,0,124,0,160,1,161,0,131, - 1,125,1,124,1,124,0,106,2,107,3,114,74,124,0,160, - 3,124,0,106,4,124,1,161,2,125,2,124,2,100,0,107, - 9,114,68,124,2,106,5,100,0,107,8,114,68,124,2,106, - 6,114,68,124,2,106,6,124,0,95,7,124,1,124,0,95, - 2,124,0,106,7,83,0,41,1,78,41,8,114,102,0,0, - 0,114,249,0,0,0,114,250,0,0,0,114,251,0,0,0, - 114,247,0,0,0,114,128,0,0,0,114,163,0,0,0,114, - 248,0,0,0,41,3,114,108,0,0,0,90,11,112,97,114, - 101,110,116,95,112,97,116,104,114,171,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,12,95,114, - 101,99,97,108,99,117,108,97,116,101,126,4,0,0,115,16, - 0,0,0,0,2,12,1,10,1,14,3,18,1,6,1,8, - 1,6,1,122,27,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,95,114,101,99,97,108,99,117,108,97,116,101, - 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,12,0,0,0,116,0,124,0,160,1, - 161,0,131,1,83,0,41,1,78,41,2,114,231,0,0,0, - 114,0,1,0,0,41,1,114,108,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,218,8,95,95,105, - 116,101,114,95,95,139,4,0,0,115,2,0,0,0,0,1, - 122,23,95,78,97,109,101,115,112,97,99,101,80,97,116,104, - 46,95,95,105,116,101,114,95,95,99,3,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,14, - 0,0,0,124,2,124,0,106,0,124,1,60,0,100,0,83, - 0,41,1,78,41,1,114,248,0,0,0,41,3,114,108,0, - 0,0,218,5,105,110,100,101,120,114,39,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,218,11,95, - 95,115,101,116,105,116,101,109,95,95,142,4,0,0,115,2, - 0,0,0,0,1,122,26,95,78,97,109,101,115,112,97,99, - 101,80,97,116,104,46,95,95,115,101,116,105,116,101,109,95, - 95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, - 0,0,67,0,0,0,115,12,0,0,0,116,0,124,0,160, - 1,161,0,131,1,83,0,41,1,78,41,2,114,18,0,0, - 0,114,0,1,0,0,41,1,114,108,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,218,7,95,95, - 108,101,110,95,95,145,4,0,0,115,2,0,0,0,0,1, - 122,22,95,78,97,109,101,115,112,97,99,101,80,97,116,104, - 46,95,95,108,101,110,95,95,99,1,0,0,0,0,0,0, - 0,1,0,0,0,3,0,0,0,67,0,0,0,115,12,0, - 0,0,100,1,160,0,124,0,106,1,161,1,83,0,41,2, - 78,122,20,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,40,123,33,114,125,41,41,2,114,54,0,0,0,114,248, - 0,0,0,41,1,114,108,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,8,95,95,114,101,112, - 114,95,95,148,4,0,0,115,2,0,0,0,0,1,122,23, - 95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,95, - 95,114,101,112,114,95,95,99,2,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0, - 0,124,1,124,0,160,0,161,0,107,6,83,0,41,1,78, - 41,1,114,0,1,0,0,41,2,114,108,0,0,0,218,4, - 105,116,101,109,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,12,95,95,99,111,110,116,97,105,110,115,95, - 95,151,4,0,0,115,2,0,0,0,0,1,122,27,95,78, - 97,109,101,115,112,97,99,101,80,97,116,104,46,95,95,99, - 111,110,116,97,105,110,115,95,95,99,2,0,0,0,0,0, - 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,16, - 0,0,0,124,0,106,0,160,1,124,1,161,1,1,0,100, - 0,83,0,41,1,78,41,2,114,248,0,0,0,114,170,0, - 0,0,41,2,114,108,0,0,0,114,6,1,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,170,0, - 0,0,154,4,0,0,115,2,0,0,0,0,1,122,21,95, - 78,97,109,101,115,112,97,99,101,80,97,116,104,46,97,112, - 112,101,110,100,78,41,14,114,113,0,0,0,114,112,0,0, - 0,114,114,0,0,0,114,115,0,0,0,114,191,0,0,0, - 114,254,0,0,0,114,249,0,0,0,114,0,1,0,0,114, - 1,1,0,0,114,3,1,0,0,114,4,1,0,0,114,5, - 1,0,0,114,7,1,0,0,114,170,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, - 0,114,246,0,0,0,99,4,0,0,115,22,0,0,0,8, - 5,4,2,8,6,8,10,8,4,8,13,8,3,8,3,8, - 3,8,3,8,3,114,246,0,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, - 80,0,0,0,101,0,90,1,100,0,90,2,100,1,100,2, - 132,0,90,3,101,4,100,3,100,4,132,0,131,1,90,5, - 100,5,100,6,132,0,90,6,100,7,100,8,132,0,90,7, - 100,9,100,10,132,0,90,8,100,11,100,12,132,0,90,9, - 100,13,100,14,132,0,90,10,100,15,100,16,132,0,90,11, - 100,17,83,0,41,18,218,16,95,78,97,109,101,115,112,97, - 99,101,76,111,97,100,101,114,99,4,0,0,0,0,0,0, - 0,4,0,0,0,4,0,0,0,67,0,0,0,115,18,0, - 0,0,116,0,124,1,124,2,124,3,131,3,124,0,95,1, - 100,0,83,0,41,1,78,41,2,114,246,0,0,0,114,248, - 0,0,0,41,4,114,108,0,0,0,114,106,0,0,0,114, - 39,0,0,0,114,252,0,0,0,114,2,0,0,0,114,2, - 0,0,0,114,4,0,0,0,114,191,0,0,0,160,4,0, - 0,115,2,0,0,0,0,1,122,25,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,46,95,95,105,110,105, - 116,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,67,0,0,0,115,12,0,0,0,100,1,160, - 0,124,1,106,1,161,1,83,0,41,2,122,115,82,101,116, - 117,114,110,32,114,101,112,114,32,102,111,114,32,116,104,101, - 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32, - 32,32,84,104,101,32,109,101,116,104,111,100,32,105,115,32, - 100,101,112,114,101,99,97,116,101,100,46,32,32,84,104,101, - 32,105,109,112,111,114,116,32,109,97,99,104,105,110,101,114, - 121,32,100,111,101,115,32,116,104,101,32,106,111,98,32,105, - 116,115,101,108,102,46,10,10,32,32,32,32,32,32,32,32, - 122,25,60,109,111,100,117,108,101,32,123,33,114,125,32,40, - 110,97,109,101,115,112,97,99,101,41,62,41,2,114,54,0, - 0,0,114,113,0,0,0,41,2,114,177,0,0,0,114,196, + 42,85,115,101,32,100,101,102,97,117,108,116,32,115,101,109, + 97,110,116,105,99,115,32,102,111,114,32,109,111,100,117,108, + 101,32,99,114,101,97,116,105,111,110,46,78,114,2,0,0, + 0,41,2,114,108,0,0,0,114,171,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,13,99,114, + 101,97,116,101,95,109,111,100,117,108,101,0,3,0,0,115, + 2,0,0,0,0,1,122,27,95,76,111,97,100,101,114,66, + 97,115,105,99,115,46,99,114,101,97,116,101,95,109,111,100, + 117,108,101,99,2,0,0,0,0,0,0,0,3,0,0,0, + 5,0,0,0,67,0,0,0,115,56,0,0,0,124,0,160, + 0,124,1,106,1,161,1,125,2,124,2,100,1,107,8,114, + 36,116,2,100,2,160,3,124,1,106,1,161,1,131,1,130, + 1,116,4,160,5,116,6,124,2,124,1,106,7,161,3,1, + 0,100,1,83,0,41,3,122,19,69,120,101,99,117,116,101, + 32,116,104,101,32,109,111,100,117,108,101,46,78,122,52,99, + 97,110,110,111,116,32,108,111,97,100,32,109,111,100,117,108, + 101,32,123,33,114,125,32,119,104,101,110,32,103,101,116,95, + 99,111,100,101,40,41,32,114,101,116,117,114,110,115,32,78, + 111,110,101,41,8,218,8,103,101,116,95,99,111,100,101,114, + 113,0,0,0,114,107,0,0,0,114,54,0,0,0,114,122, + 0,0,0,218,25,95,99,97,108,108,95,119,105,116,104,95, + 102,114,97,109,101,115,95,114,101,109,111,118,101,100,218,4, + 101,120,101,99,114,119,0,0,0,41,3,114,108,0,0,0, + 218,6,109,111,100,117,108,101,114,150,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,218,11,101,120, + 101,99,95,109,111,100,117,108,101,3,3,0,0,115,12,0, + 0,0,0,2,12,1,8,1,6,1,4,255,6,2,122,25, + 95,76,111,97,100,101,114,66,97,115,105,99,115,46,101,120, + 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,12, + 0,0,0,116,0,160,1,124,0,124,1,161,2,83,0,41, + 1,122,26,84,104,105,115,32,109,111,100,117,108,101,32,105, + 115,32,100,101,112,114,101,99,97,116,101,100,46,41,2,114, + 122,0,0,0,218,17,95,108,111,97,100,95,109,111,100,117, + 108,101,95,115,104,105,109,41,2,114,108,0,0,0,114,127, 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,11,109,111,100,117,108,101,95,114,101,112,114,163, - 4,0,0,115,2,0,0,0,0,7,122,28,95,78,97,109, - 101,115,112,97,99,101,76,111,97,100,101,114,46,109,111,100, - 117,108,101,95,114,101,112,114,99,2,0,0,0,0,0,0, - 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, - 0,0,100,1,83,0,41,2,78,84,114,2,0,0,0,41, - 2,114,108,0,0,0,114,127,0,0,0,114,2,0,0,0, - 114,2,0,0,0,114,4,0,0,0,114,166,0,0,0,172, - 4,0,0,115,2,0,0,0,0,1,122,27,95,78,97,109, - 101,115,112,97,99,101,76,111,97,100,101,114,46,105,115,95, - 112,97,99,107,97,103,101,99,2,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,1,83,0,41,2,78,114,35,0,0,0,114,2,0, - 0,0,41,2,114,108,0,0,0,114,127,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,207,0, - 0,0,175,4,0,0,115,2,0,0,0,0,1,122,27,95, - 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46, - 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, - 0,0,0,2,0,0,0,6,0,0,0,67,0,0,0,115, - 16,0,0,0,116,0,100,1,100,2,100,3,100,4,100,5, - 141,4,83,0,41,6,78,114,35,0,0,0,122,8,60,115, - 116,114,105,110,103,62,114,195,0,0,0,84,41,1,114,209, - 0,0,0,41,1,114,210,0,0,0,41,2,114,108,0,0, - 0,114,127,0,0,0,114,2,0,0,0,114,2,0,0,0, - 114,4,0,0,0,114,193,0,0,0,178,4,0,0,115,2, - 0,0,0,0,1,122,25,95,78,97,109,101,115,112,97,99, - 101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101, - 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,4,0,0,0,100,1,83,0,41,2, - 122,42,85,115,101,32,100,101,102,97,117,108,116,32,115,101, - 109,97,110,116,105,99,115,32,102,111,114,32,109,111,100,117, - 108,101,32,99,114,101,97,116,105,111,110,46,78,114,2,0, - 0,0,41,2,114,108,0,0,0,114,171,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,192,0, - 0,0,181,4,0,0,115,2,0,0,0,0,1,122,30,95, - 78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46, - 99,114,101,97,116,101,95,109,111,100,117,108,101,99,2,0, - 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, - 0,0,115,4,0,0,0,100,0,83,0,41,1,78,114,2, - 0,0,0,41,2,114,108,0,0,0,114,196,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,197, - 0,0,0,184,4,0,0,115,2,0,0,0,0,1,122,28, - 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, - 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, - 0,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, - 0,115,26,0,0,0,116,0,160,1,100,1,124,0,106,2, - 161,2,1,0,116,0,160,3,124,0,124,1,161,2,83,0, - 41,2,122,98,76,111,97,100,32,97,32,110,97,109,101,115, - 112,97,99,101,32,109,111,100,117,108,101,46,10,10,32,32, + 0,0,218,11,108,111,97,100,95,109,111,100,117,108,101,11, + 3,0,0,115,2,0,0,0,0,2,122,25,95,76,111,97, + 100,101,114,66,97,115,105,99,115,46,108,111,97,100,95,109, + 111,100,117,108,101,78,41,8,114,113,0,0,0,114,112,0, + 0,0,114,114,0,0,0,114,115,0,0,0,114,166,0,0, + 0,114,192,0,0,0,114,197,0,0,0,114,199,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,190,0,0,0,243,2,0,0,115,10,0, + 0,0,8,3,4,2,8,8,8,3,8,8,114,190,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,64,0,0,0,115,74,0,0,0,101,0,90,1,100, + 0,90,2,100,1,100,2,132,0,90,3,100,3,100,4,132, + 0,90,4,100,5,100,6,132,0,90,5,100,7,100,8,132, + 0,90,6,100,9,100,10,132,0,90,7,100,11,100,12,156, + 1,100,13,100,14,132,2,90,8,100,15,100,16,132,0,90, + 9,100,17,83,0,41,18,218,12,83,111,117,114,99,101,76, + 111,97,100,101,114,99,2,0,0,0,0,0,0,0,2,0, + 0,0,1,0,0,0,67,0,0,0,115,8,0,0,0,116, + 0,130,1,100,1,83,0,41,2,122,165,79,112,116,105,111, + 110,97,108,32,109,101,116,104,111,100,32,116,104,97,116,32, + 114,101,116,117,114,110,115,32,116,104,101,32,109,111,100,105, + 102,105,99,97,116,105,111,110,32,116,105,109,101,32,40,97, + 110,32,105,110,116,41,32,102,111,114,32,116,104,101,10,32, + 32,32,32,32,32,32,32,115,112,101,99,105,102,105,101,100, + 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, + 32,32,32,32,32,32,32,32,82,97,105,115,101,115,32,79, + 83,69,114,114,111,114,32,119,104,101,110,32,116,104,101,32, + 112,97,116,104,32,99,97,110,110,111,116,32,98,101,32,104, + 97,110,100,108,101,100,46,10,32,32,32,32,32,32,32,32, + 78,41,1,114,44,0,0,0,41,2,114,108,0,0,0,114, + 39,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,10,112,97,116,104,95,109,116,105,109,101,18, + 3,0,0,115,2,0,0,0,0,6,122,23,83,111,117,114, + 99,101,76,111,97,100,101,114,46,112,97,116,104,95,109,116, + 105,109,101,99,2,0,0,0,0,0,0,0,2,0,0,0, + 4,0,0,0,67,0,0,0,115,14,0,0,0,100,1,124, + 0,160,0,124,1,161,1,105,1,83,0,41,2,97,158,1, + 0,0,79,112,116,105,111,110,97,108,32,109,101,116,104,111, + 100,32,114,101,116,117,114,110,105,110,103,32,97,32,109,101, + 116,97,100,97,116,97,32,100,105,99,116,32,102,111,114,32, + 116,104,101,32,115,112,101,99,105,102,105,101,100,10,32,32, + 32,32,32,32,32,32,112,97,116,104,32,40,97,32,115,116, + 114,41,46,10,10,32,32,32,32,32,32,32,32,80,111,115, + 115,105,98,108,101,32,107,101,121,115,58,10,32,32,32,32, + 32,32,32,32,45,32,39,109,116,105,109,101,39,32,40,109, + 97,110,100,97,116,111,114,121,41,32,105,115,32,116,104,101, + 32,110,117,109,101,114,105,99,32,116,105,109,101,115,116,97, + 109,112,32,111,102,32,108,97,115,116,32,115,111,117,114,99, + 101,10,32,32,32,32,32,32,32,32,32,32,99,111,100,101, + 32,109,111,100,105,102,105,99,97,116,105,111,110,59,10,32, + 32,32,32,32,32,32,32,45,32,39,115,105,122,101,39,32, + 40,111,112,116,105,111,110,97,108,41,32,105,115,32,116,104, + 101,32,115,105,122,101,32,105,110,32,98,121,116,101,115,32, + 111,102,32,116,104,101,32,115,111,117,114,99,101,32,99,111, + 100,101,46,10,10,32,32,32,32,32,32,32,32,73,109,112, + 108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,109, + 101,116,104,111,100,32,97,108,108,111,119,115,32,116,104,101, + 32,108,111,97,100,101,114,32,116,111,32,114,101,97,100,32, + 98,121,116,101,99,111,100,101,32,102,105,108,101,115,46,10, + 32,32,32,32,32,32,32,32,82,97,105,115,101,115,32,79, + 83,69,114,114,111,114,32,119,104,101,110,32,116,104,101,32, + 112,97,116,104,32,99,97,110,110,111,116,32,98,101,32,104, + 97,110,100,108,101,100,46,10,32,32,32,32,32,32,32,32, + 114,155,0,0,0,41,1,114,201,0,0,0,41,2,114,108, + 0,0,0,114,39,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,218,10,112,97,116,104,95,115,116, + 97,116,115,26,3,0,0,115,2,0,0,0,0,12,122,23, + 83,111,117,114,99,101,76,111,97,100,101,114,46,112,97,116, + 104,95,115,116,97,116,115,99,4,0,0,0,0,0,0,0, + 4,0,0,0,4,0,0,0,67,0,0,0,115,12,0,0, + 0,124,0,160,0,124,2,124,3,161,2,83,0,41,1,122, + 228,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100, + 32,119,104,105,99,104,32,119,114,105,116,101,115,32,100,97, + 116,97,32,40,98,121,116,101,115,41,32,116,111,32,97,32, + 102,105,108,101,32,112,97,116,104,32,40,97,32,115,116,114, + 41,46,10,10,32,32,32,32,32,32,32,32,73,109,112,108, + 101,109,101,110,116,105,110,103,32,116,104,105,115,32,109,101, + 116,104,111,100,32,97,108,108,111,119,115,32,102,111,114,32, + 116,104,101,32,119,114,105,116,105,110,103,32,111,102,32,98, + 121,116,101,99,111,100,101,32,102,105,108,101,115,46,10,10, + 32,32,32,32,32,32,32,32,84,104,101,32,115,111,117,114, + 99,101,32,112,97,116,104,32,105,115,32,110,101,101,100,101, + 100,32,105,110,32,111,114,100,101,114,32,116,111,32,99,111, + 114,114,101,99,116,108,121,32,116,114,97,110,115,102,101,114, + 32,112,101,114,109,105,115,115,105,111,110,115,10,32,32,32, + 32,32,32,32,32,41,1,218,8,115,101,116,95,100,97,116, + 97,41,4,114,108,0,0,0,114,99,0,0,0,90,10,99, + 97,99,104,101,95,112,97,116,104,114,21,0,0,0,114,2, + 0,0,0,114,2,0,0,0,114,4,0,0,0,218,15,95, + 99,97,99,104,101,95,98,121,116,101,99,111,100,101,40,3, + 0,0,115,2,0,0,0,0,8,122,28,83,111,117,114,99, + 101,76,111,97,100,101,114,46,95,99,97,99,104,101,95,98, + 121,116,101,99,111,100,101,99,3,0,0,0,0,0,0,0, + 3,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, + 0,100,1,83,0,41,2,122,150,79,112,116,105,111,110,97, + 108,32,109,101,116,104,111,100,32,119,104,105,99,104,32,119, + 114,105,116,101,115,32,100,97,116,97,32,40,98,121,116,101, + 115,41,32,116,111,32,97,32,102,105,108,101,32,112,97,116, + 104,32,40,97,32,115,116,114,41,46,10,10,32,32,32,32, + 32,32,32,32,73,109,112,108,101,109,101,110,116,105,110,103, + 32,116,104,105,115,32,109,101,116,104,111,100,32,97,108,108, + 111,119,115,32,102,111,114,32,116,104,101,32,119,114,105,116, + 105,110,103,32,111,102,32,98,121,116,101,99,111,100,101,32, + 102,105,108,101,115,46,10,32,32,32,32,32,32,32,32,78, + 114,2,0,0,0,41,3,114,108,0,0,0,114,39,0,0, + 0,114,21,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,203,0,0,0,50,3,0,0,115,2, + 0,0,0,0,4,122,21,83,111,117,114,99,101,76,111,97, + 100,101,114,46,115,101,116,95,100,97,116,97,99,2,0,0, + 0,0,0,0,0,5,0,0,0,10,0,0,0,67,0,0, + 0,115,82,0,0,0,124,0,160,0,124,1,161,1,125,2, + 122,14,124,0,160,1,124,2,161,1,125,3,87,0,110,48, + 4,0,116,2,107,10,114,72,1,0,125,4,1,0,122,18, + 116,3,100,1,124,1,100,2,141,2,124,4,130,2,87,0, + 53,0,100,3,125,4,126,4,88,0,89,0,110,2,88,0, + 116,4,124,3,131,1,83,0,41,4,122,52,67,111,110,99, + 114,101,116,101,32,105,109,112,108,101,109,101,110,116,97,116, + 105,111,110,32,111,102,32,73,110,115,112,101,99,116,76,111, + 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,46, + 122,39,115,111,117,114,99,101,32,110,111,116,32,97,118,97, + 105,108,97,98,108,101,32,116,104,114,111,117,103,104,32,103, + 101,116,95,100,97,116,97,40,41,41,1,114,106,0,0,0, + 78,41,5,114,164,0,0,0,218,8,103,101,116,95,100,97, + 116,97,114,44,0,0,0,114,107,0,0,0,114,162,0,0, + 0,41,5,114,108,0,0,0,114,127,0,0,0,114,39,0, + 0,0,114,160,0,0,0,218,3,101,120,99,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,218,10,103,101,116, + 95,115,111,117,114,99,101,57,3,0,0,115,20,0,0,0, + 0,2,10,1,2,1,14,1,16,1,4,1,2,255,4,1, + 2,255,20,2,122,23,83,111,117,114,99,101,76,111,97,100, + 101,114,46,103,101,116,95,115,111,117,114,99,101,114,96,0, + 0,0,41,1,218,9,95,111,112,116,105,109,105,122,101,99, + 3,0,0,0,1,0,0,0,4,0,0,0,8,0,0,0, + 67,0,0,0,115,22,0,0,0,116,0,106,1,116,2,124, + 1,124,2,100,1,100,2,124,3,100,3,141,6,83,0,41, + 4,122,130,82,101,116,117,114,110,32,116,104,101,32,99,111, + 100,101,32,111,98,106,101,99,116,32,99,111,109,112,105,108, + 101,100,32,102,114,111,109,32,115,111,117,114,99,101,46,10, + 10,32,32,32,32,32,32,32,32,84,104,101,32,39,100,97, + 116,97,39,32,97,114,103,117,109,101,110,116,32,99,97,110, + 32,98,101,32,97,110,121,32,111,98,106,101,99,116,32,116, + 121,112,101,32,116,104,97,116,32,99,111,109,112,105,108,101, + 40,41,32,115,117,112,112,111,114,116,115,46,10,32,32,32, + 32,32,32,32,32,114,195,0,0,0,84,41,2,218,12,100, + 111,110,116,95,105,110,104,101,114,105,116,114,75,0,0,0, + 41,3,114,122,0,0,0,114,194,0,0,0,218,7,99,111, + 109,112,105,108,101,41,4,114,108,0,0,0,114,21,0,0, + 0,114,39,0,0,0,114,208,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,218,14,115,111,117,114, + 99,101,95,116,111,95,99,111,100,101,67,3,0,0,115,8, + 0,0,0,0,5,12,1,2,0,2,255,122,27,83,111,117, + 114,99,101,76,111,97,100,101,114,46,115,111,117,114,99,101, + 95,116,111,95,99,111,100,101,99,2,0,0,0,0,0,0, + 0,15,0,0,0,9,0,0,0,67,0,0,0,115,34,2, + 0,0,124,0,160,0,124,1,161,1,125,2,100,1,125,3, + 100,1,125,4,100,1,125,5,100,2,125,6,100,3,125,7, + 122,12,116,1,124,2,131,1,125,8,87,0,110,26,4,0, + 116,2,107,10,114,68,1,0,1,0,1,0,100,1,125,8, + 89,0,144,1,110,48,88,0,122,14,124,0,160,3,124,2, + 161,1,125,9,87,0,110,22,4,0,116,4,107,10,114,106, + 1,0,1,0,1,0,89,0,144,1,110,10,88,0,116,5, + 124,9,100,4,25,0,131,1,125,3,122,14,124,0,160,6, + 124,8,161,1,125,10,87,0,110,20,4,0,116,4,107,10, + 114,154,1,0,1,0,1,0,89,0,110,218,88,0,124,1, + 124,8,100,5,156,2,125,11,122,148,116,7,124,10,124,1, + 124,11,131,3,125,12,116,8,124,10,131,1,100,6,100,1, + 133,2,25,0,125,13,124,12,100,7,64,0,100,8,107,3, + 125,6,124,6,144,1,114,36,124,12,100,9,64,0,100,8, + 107,3,125,7,116,9,106,10,100,10,107,3,144,1,114,34, + 124,7,115,254,116,9,106,10,100,11,107,2,144,1,114,34, + 124,0,160,6,124,2,161,1,125,4,116,9,160,11,116,12, + 124,4,161,2,125,5,116,13,124,10,124,5,124,1,124,11, + 131,4,1,0,110,20,116,14,124,10,124,3,124,9,100,12, + 25,0,124,1,124,11,131,5,1,0,87,0,110,26,4,0, + 116,15,116,16,102,2,107,10,144,1,114,84,1,0,1,0, + 1,0,89,0,110,32,88,0,116,17,160,18,100,13,124,8, + 124,2,161,3,1,0,116,19,124,13,124,1,124,8,124,2, + 100,14,141,4,83,0,124,4,100,1,107,8,144,1,114,136, + 124,0,160,6,124,2,161,1,125,4,124,0,160,20,124,4, + 124,2,161,2,125,14,116,17,160,18,100,15,124,2,161,2, + 1,0,116,21,106,22,144,2,115,30,124,8,100,1,107,9, + 144,2,114,30,124,3,100,1,107,9,144,2,114,30,124,6, + 144,1,114,228,124,5,100,1,107,8,144,1,114,214,116,9, + 160,11,124,4,161,1,125,5,116,23,124,14,124,5,124,7, + 131,3,125,10,110,16,116,24,124,14,124,3,116,25,124,4, + 131,1,131,3,125,10,122,18,124,0,160,26,124,2,124,8, + 124,10,161,3,1,0,87,0,110,22,4,0,116,2,107,10, + 144,2,114,28,1,0,1,0,1,0,89,0,110,2,88,0, + 124,14,83,0,41,16,122,190,67,111,110,99,114,101,116,101, + 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, + 111,102,32,73,110,115,112,101,99,116,76,111,97,100,101,114, + 46,103,101,116,95,99,111,100,101,46,10,10,32,32,32,32, + 32,32,32,32,82,101,97,100,105,110,103,32,111,102,32,98, + 121,116,101,99,111,100,101,32,114,101,113,117,105,114,101,115, + 32,112,97,116,104,95,115,116,97,116,115,32,116,111,32,98, + 101,32,105,109,112,108,101,109,101,110,116,101,100,46,32,84, + 111,32,119,114,105,116,101,10,32,32,32,32,32,32,32,32, + 98,121,116,101,99,111,100,101,44,32,115,101,116,95,100,97, + 116,97,32,109,117,115,116,32,97,108,115,111,32,98,101,32, + 105,109,112,108,101,109,101,110,116,101,100,46,10,10,32,32, + 32,32,32,32,32,32,78,70,84,114,155,0,0,0,41,2, + 114,106,0,0,0,114,39,0,0,0,114,132,0,0,0,114, + 34,0,0,0,114,64,0,0,0,114,23,0,0,0,90,5, + 110,101,118,101,114,90,6,97,108,119,97,121,115,218,4,115, + 105,122,101,122,13,123,125,32,109,97,116,99,104,101,115,32, + 123,125,41,3,114,106,0,0,0,114,98,0,0,0,114,99, + 0,0,0,122,19,99,111,100,101,32,111,98,106,101,99,116, + 32,102,114,111,109,32,123,125,41,27,114,164,0,0,0,114, + 89,0,0,0,114,73,0,0,0,114,202,0,0,0,114,44, + 0,0,0,114,14,0,0,0,114,205,0,0,0,114,139,0, + 0,0,218,10,109,101,109,111,114,121,118,105,101,119,114,149, + 0,0,0,90,21,99,104,101,99,107,95,104,97,115,104,95, + 98,97,115,101,100,95,112,121,99,115,114,144,0,0,0,218, + 17,95,82,65,87,95,77,65,71,73,67,95,78,85,77,66, + 69,82,114,145,0,0,0,114,143,0,0,0,114,107,0,0, + 0,114,137,0,0,0,114,122,0,0,0,114,136,0,0,0, + 114,151,0,0,0,114,211,0,0,0,114,6,0,0,0,218, + 19,100,111,110,116,95,119,114,105,116,101,95,98,121,116,101, + 99,111,100,101,114,157,0,0,0,114,156,0,0,0,114,18, + 0,0,0,114,204,0,0,0,41,15,114,108,0,0,0,114, + 127,0,0,0,114,99,0,0,0,114,141,0,0,0,114,160, + 0,0,0,114,144,0,0,0,90,10,104,97,115,104,95,98, + 97,115,101,100,90,12,99,104,101,99,107,95,115,111,117,114, + 99,101,114,98,0,0,0,218,2,115,116,114,21,0,0,0, + 114,138,0,0,0,114,74,0,0,0,90,10,98,121,116,101, + 115,95,100,97,116,97,90,11,99,111,100,101,95,111,98,106, + 101,99,116,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,193,0,0,0,75,3,0,0,115,152,0,0,0, + 0,7,10,1,4,1,4,1,4,1,4,1,4,1,2,1, + 12,1,14,1,12,2,2,1,14,1,14,1,8,2,12,1, + 2,1,14,1,14,1,6,3,2,1,2,254,6,4,2,1, + 12,1,16,1,12,1,6,1,12,1,12,1,2,255,2,2, + 8,254,4,3,10,1,4,1,2,1,2,254,4,4,8,1, + 2,255,6,3,2,1,2,1,2,1,6,1,2,1,2,251, + 8,7,20,1,6,2,8,1,2,255,4,2,6,1,2,1, + 2,254,6,3,10,1,10,1,12,1,12,1,18,1,6,255, + 4,2,6,1,10,1,10,1,14,2,6,1,6,255,4,2, + 2,1,18,1,16,1,6,1,122,21,83,111,117,114,99,101, + 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,78, + 41,10,114,113,0,0,0,114,112,0,0,0,114,114,0,0, + 0,114,201,0,0,0,114,202,0,0,0,114,204,0,0,0, + 114,203,0,0,0,114,207,0,0,0,114,211,0,0,0,114, + 193,0,0,0,114,2,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,200,0,0,0,16,3,0, + 0,115,14,0,0,0,8,2,8,8,8,14,8,10,8,7, + 8,10,14,8,114,200,0,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,4,0,0,0,0,0,0,0,115,124, + 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, + 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,100, + 6,100,7,132,0,90,6,101,7,135,0,102,1,100,8,100, + 9,132,8,131,1,90,8,101,7,100,10,100,11,132,0,131, + 1,90,9,100,12,100,13,132,0,90,10,101,7,100,14,100, + 15,132,0,131,1,90,11,100,16,100,17,132,0,90,12,100, + 18,100,19,132,0,90,13,100,20,100,21,132,0,90,14,100, + 22,100,23,132,0,90,15,135,0,4,0,90,16,83,0,41, + 24,218,10,70,105,108,101,76,111,97,100,101,114,122,103,66, + 97,115,101,32,102,105,108,101,32,108,111,97,100,101,114,32, + 99,108,97,115,115,32,119,104,105,99,104,32,105,109,112,108, + 101,109,101,110,116,115,32,116,104,101,32,108,111,97,100,101, + 114,32,112,114,111,116,111,99,111,108,32,109,101,116,104,111, + 100,115,32,116,104,97,116,10,32,32,32,32,114,101,113,117, + 105,114,101,32,102,105,108,101,32,115,121,115,116,101,109,32, + 117,115,97,103,101,46,99,3,0,0,0,0,0,0,0,3, + 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, + 124,1,124,0,95,0,124,2,124,0,95,1,100,1,83,0, + 41,2,122,75,67,97,99,104,101,32,116,104,101,32,109,111, + 100,117,108,101,32,110,97,109,101,32,97,110,100,32,116,104, + 101,32,112,97,116,104,32,116,111,32,116,104,101,32,102,105, + 108,101,32,102,111,117,110,100,32,98,121,32,116,104,101,10, + 32,32,32,32,32,32,32,32,102,105,110,100,101,114,46,78, + 41,2,114,106,0,0,0,114,39,0,0,0,41,3,114,108, + 0,0,0,114,127,0,0,0,114,39,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,191,0,0, + 0,165,3,0,0,115,4,0,0,0,0,3,6,1,122,19, + 70,105,108,101,76,111,97,100,101,114,46,95,95,105,110,105, + 116,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, + 2,0,0,0,67,0,0,0,115,24,0,0,0,124,0,106, + 0,124,1,106,0,107,2,111,22,124,0,106,1,124,1,106, + 1,107,2,83,0,41,1,78,41,2,218,9,95,95,99,108, + 97,115,115,95,95,114,119,0,0,0,41,2,114,108,0,0, + 0,218,5,111,116,104,101,114,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,218,6,95,95,101,113,95,95,171, + 3,0,0,115,6,0,0,0,0,1,12,1,10,255,122,17, + 70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,95, + 95,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, + 0,0,67,0,0,0,115,20,0,0,0,116,0,124,0,106, + 1,131,1,116,0,124,0,106,2,131,1,65,0,83,0,41, + 1,78,41,3,218,4,104,97,115,104,114,106,0,0,0,114, + 39,0,0,0,41,1,114,108,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,218,8,95,95,104,97, + 115,104,95,95,175,3,0,0,115,2,0,0,0,0,1,122, + 19,70,105,108,101,76,111,97,100,101,114,46,95,95,104,97, + 115,104,95,95,99,2,0,0,0,0,0,0,0,2,0,0, + 0,3,0,0,0,3,0,0,0,115,16,0,0,0,116,0, + 116,1,124,0,131,2,160,2,124,1,161,1,83,0,41,1, + 122,100,76,111,97,100,32,97,32,109,111,100,117,108,101,32, + 102,114,111,109,32,97,32,102,105,108,101,46,10,10,32,32, 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, 32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,108, 101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, - 32,32,32,32,32,32,122,38,110,97,109,101,115,112,97,99, - 101,32,109,111,100,117,108,101,32,108,111,97,100,101,100,32, - 119,105,116,104,32,112,97,116,104,32,123,33,114,125,41,4, - 114,122,0,0,0,114,136,0,0,0,114,248,0,0,0,114, - 198,0,0,0,41,2,114,108,0,0,0,114,127,0,0,0, + 32,32,32,32,32,32,41,3,218,5,115,117,112,101,114,114, + 217,0,0,0,114,199,0,0,0,41,2,114,108,0,0,0, + 114,127,0,0,0,41,1,114,218,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,199,0,0,0,178,3,0,0,115, + 2,0,0,0,0,10,122,22,70,105,108,101,76,111,97,100, + 101,114,46,108,111,97,100,95,109,111,100,117,108,101,99,2, + 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,115,6,0,0,0,124,0,106,0,83,0,41,1, + 122,58,82,101,116,117,114,110,32,116,104,101,32,112,97,116, + 104,32,116,111,32,116,104,101,32,115,111,117,114,99,101,32, + 102,105,108,101,32,97,115,32,102,111,117,110,100,32,98,121, + 32,116,104,101,32,102,105,110,100,101,114,46,41,1,114,39, + 0,0,0,41,2,114,108,0,0,0,114,127,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,164, + 0,0,0,190,3,0,0,115,2,0,0,0,0,3,122,23, + 70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,102, + 105,108,101,110,97,109,101,99,2,0,0,0,0,0,0,0, + 3,0,0,0,10,0,0,0,67,0,0,0,115,44,0,0, + 0,116,0,160,1,124,1,100,1,161,2,143,22,125,2,124, + 2,160,2,161,0,87,0,2,0,53,0,81,0,82,0,163, + 0,83,0,81,0,82,0,88,0,100,2,83,0,41,3,122, + 39,82,101,116,117,114,110,32,116,104,101,32,100,97,116,97, + 32,102,114,111,109,32,112,97,116,104,32,97,115,32,114,97, + 119,32,98,121,116,101,115,46,218,1,114,78,41,3,114,56, + 0,0,0,114,57,0,0,0,90,4,114,101,97,100,41,3, + 114,108,0,0,0,114,39,0,0,0,114,60,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,205, + 0,0,0,195,3,0,0,115,4,0,0,0,0,2,14,1, + 122,19,70,105,108,101,76,111,97,100,101,114,46,103,101,116, + 95,100,97,116,97,99,2,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,18,0,0,0,124, + 0,160,0,124,1,161,1,114,14,124,0,83,0,100,0,83, + 0,41,1,78,41,1,114,166,0,0,0,41,2,114,108,0, + 0,0,114,196,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,218,19,103,101,116,95,114,101,115,111, + 117,114,99,101,95,114,101,97,100,101,114,202,3,0,0,115, + 6,0,0,0,0,2,10,1,4,1,122,30,70,105,108,101, + 76,111,97,100,101,114,46,103,101,116,95,114,101,115,111,117, + 114,99,101,95,114,101,97,100,101,114,99,2,0,0,0,0, + 0,0,0,3,0,0,0,4,0,0,0,67,0,0,0,115, + 32,0,0,0,116,0,116,1,124,0,106,2,131,1,100,1, + 25,0,124,1,131,2,125,2,116,3,160,4,124,2,100,2, + 161,2,83,0,41,3,78,114,64,0,0,0,114,224,0,0, + 0,41,5,114,33,0,0,0,114,42,0,0,0,114,39,0, + 0,0,114,56,0,0,0,114,57,0,0,0,41,3,114,108, + 0,0,0,218,8,114,101,115,111,117,114,99,101,114,39,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,218,13,111,112,101,110,95,114,101,115,111,117,114,99,101, + 208,3,0,0,115,4,0,0,0,0,1,20,1,122,24,70, + 105,108,101,76,111,97,100,101,114,46,111,112,101,110,95,114, + 101,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, + 3,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0, + 0,124,0,160,0,124,1,161,1,115,14,116,1,130,1,116, + 2,116,3,124,0,106,4,131,1,100,1,25,0,124,1,131, + 2,125,2,124,2,83,0,41,2,78,114,64,0,0,0,41, + 5,218,11,105,115,95,114,101,115,111,117,114,99,101,218,17, + 70,105,108,101,78,111,116,70,111,117,110,100,69,114,114,111, + 114,114,33,0,0,0,114,42,0,0,0,114,39,0,0,0, + 41,3,114,108,0,0,0,114,226,0,0,0,114,39,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 218,13,114,101,115,111,117,114,99,101,95,112,97,116,104,212, + 3,0,0,115,8,0,0,0,0,1,10,1,4,1,20,1, + 122,24,70,105,108,101,76,111,97,100,101,114,46,114,101,115, + 111,117,114,99,101,95,112,97,116,104,99,2,0,0,0,0, + 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, + 40,0,0,0,116,0,124,1,107,6,114,12,100,1,83,0, + 116,1,116,2,124,0,106,3,131,1,100,2,25,0,124,1, + 131,2,125,2,116,4,124,2,131,1,83,0,41,3,78,70, + 114,64,0,0,0,41,5,114,30,0,0,0,114,33,0,0, + 0,114,42,0,0,0,114,39,0,0,0,114,48,0,0,0, + 41,3,114,108,0,0,0,114,106,0,0,0,114,39,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,228,0,0,0,218,3,0,0,115,8,0,0,0,0,1, + 8,1,4,1,20,1,122,22,70,105,108,101,76,111,97,100, + 101,114,46,105,115,95,114,101,115,111,117,114,99,101,99,1, + 0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,67, + 0,0,0,115,24,0,0,0,116,0,116,1,160,2,116,3, + 124,0,106,4,131,1,100,1,25,0,161,1,131,1,83,0, + 41,2,78,114,64,0,0,0,41,5,218,4,105,116,101,114, + 114,1,0,0,0,218,7,108,105,115,116,100,105,114,114,42, + 0,0,0,114,39,0,0,0,41,1,114,108,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,8, + 99,111,110,116,101,110,116,115,224,3,0,0,115,2,0,0, + 0,0,1,122,19,70,105,108,101,76,111,97,100,101,114,46, + 99,111,110,116,101,110,116,115,41,17,114,113,0,0,0,114, + 112,0,0,0,114,114,0,0,0,114,115,0,0,0,114,191, + 0,0,0,114,220,0,0,0,114,222,0,0,0,114,124,0, + 0,0,114,199,0,0,0,114,164,0,0,0,114,205,0,0, + 0,114,225,0,0,0,114,227,0,0,0,114,230,0,0,0, + 114,228,0,0,0,114,233,0,0,0,90,13,95,95,99,108, + 97,115,115,99,101,108,108,95,95,114,2,0,0,0,114,2, + 0,0,0,41,1,114,218,0,0,0,114,4,0,0,0,114, + 217,0,0,0,160,3,0,0,115,30,0,0,0,8,3,4, + 2,8,6,8,4,8,3,2,1,14,11,2,1,10,4,8, + 7,2,1,10,5,8,4,8,6,8,6,114,217,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,64,0,0,0,115,46,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, + 100,5,132,0,90,5,100,6,100,7,156,1,100,8,100,9, + 132,2,90,6,100,10,83,0,41,11,218,16,83,111,117,114, + 99,101,70,105,108,101,76,111,97,100,101,114,122,62,67,111, + 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, + 97,116,105,111,110,32,111,102,32,83,111,117,114,99,101,76, + 111,97,100,101,114,32,117,115,105,110,103,32,116,104,101,32, + 102,105,108,101,32,115,121,115,116,101,109,46,99,2,0,0, + 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, + 0,115,22,0,0,0,116,0,124,1,131,1,125,2,124,2, + 106,1,124,2,106,2,100,1,156,2,83,0,41,2,122,33, + 82,101,116,117,114,110,32,116,104,101,32,109,101,116,97,100, + 97,116,97,32,102,111,114,32,116,104,101,32,112,97,116,104, + 46,41,2,114,155,0,0,0,114,212,0,0,0,41,3,114, + 43,0,0,0,218,8,115,116,95,109,116,105,109,101,90,7, + 115,116,95,115,105,122,101,41,3,114,108,0,0,0,114,39, + 0,0,0,114,216,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,202,0,0,0,232,3,0,0, + 115,4,0,0,0,0,2,8,1,122,27,83,111,117,114,99, + 101,70,105,108,101,76,111,97,100,101,114,46,112,97,116,104, + 95,115,116,97,116,115,99,4,0,0,0,0,0,0,0,5, + 0,0,0,5,0,0,0,67,0,0,0,115,24,0,0,0, + 116,0,124,1,131,1,125,4,124,0,106,1,124,2,124,3, + 124,4,100,1,141,3,83,0,41,2,78,41,1,218,5,95, + 109,111,100,101,41,2,114,105,0,0,0,114,203,0,0,0, + 41,5,114,108,0,0,0,114,99,0,0,0,114,98,0,0, + 0,114,21,0,0,0,114,46,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,204,0,0,0,237, + 3,0,0,115,4,0,0,0,0,2,8,1,122,32,83,111, + 117,114,99,101,70,105,108,101,76,111,97,100,101,114,46,95, + 99,97,99,104,101,95,98,121,116,101,99,111,100,101,105,182, + 1,0,0,41,1,114,236,0,0,0,99,3,0,0,0,1, + 0,0,0,9,0,0,0,11,0,0,0,67,0,0,0,115, + 0,1,0,0,116,0,124,1,131,1,92,2,125,4,125,5, + 103,0,125,6,124,4,114,52,116,1,124,4,131,1,115,52, + 116,0,124,4,131,1,92,2,125,4,125,7,124,6,160,2, + 124,7,161,1,1,0,113,16,116,3,124,6,131,1,68,0, + 93,112,125,7,116,4,124,4,124,7,131,2,125,4,122,14, + 116,5,160,6,124,4,161,1,1,0,87,0,110,82,4,0, + 116,7,107,10,114,112,1,0,1,0,1,0,89,0,113,60, + 89,0,110,60,4,0,116,8,107,10,114,170,1,0,125,8, + 1,0,122,30,116,9,160,10,100,1,124,4,124,8,161,3, + 1,0,87,0,89,0,162,10,1,0,100,2,83,0,87,0, + 53,0,100,2,125,8,126,8,88,0,89,0,110,2,88,0, + 113,60,122,28,116,11,124,1,124,2,124,3,131,3,1,0, + 116,9,160,10,100,3,124,1,161,2,1,0,87,0,110,48, + 4,0,116,8,107,10,114,250,1,0,125,8,1,0,122,18, + 116,9,160,10,100,1,124,1,124,8,161,3,1,0,87,0, + 53,0,100,2,125,8,126,8,88,0,89,0,110,2,88,0, + 100,2,83,0,41,4,122,27,87,114,105,116,101,32,98,121, + 116,101,115,32,100,97,116,97,32,116,111,32,97,32,102,105, + 108,101,46,122,27,99,111,117,108,100,32,110,111,116,32,99, + 114,101,97,116,101,32,123,33,114,125,58,32,123,33,114,125, + 78,122,12,99,114,101,97,116,101,100,32,123,33,114,125,41, + 12,114,42,0,0,0,114,50,0,0,0,114,170,0,0,0, + 114,37,0,0,0,114,33,0,0,0,114,1,0,0,0,90, + 5,109,107,100,105,114,218,15,70,105,108,101,69,120,105,115, + 116,115,69,114,114,111,114,114,44,0,0,0,114,122,0,0, + 0,114,136,0,0,0,114,61,0,0,0,41,9,114,108,0, + 0,0,114,39,0,0,0,114,21,0,0,0,114,236,0,0, + 0,218,6,112,97,114,101,110,116,114,88,0,0,0,114,32, + 0,0,0,114,28,0,0,0,114,206,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,203,0,0, + 0,242,3,0,0,115,48,0,0,0,0,2,12,1,4,2, + 12,1,12,1,12,2,12,1,10,1,2,1,14,1,14,2, + 8,1,16,3,6,1,2,0,2,255,4,2,32,1,2,1, + 12,1,16,1,16,2,8,1,2,255,122,25,83,111,117,114, + 99,101,70,105,108,101,76,111,97,100,101,114,46,115,101,116, + 95,100,97,116,97,78,41,7,114,113,0,0,0,114,112,0, + 0,0,114,114,0,0,0,114,115,0,0,0,114,202,0,0, + 0,114,204,0,0,0,114,203,0,0,0,114,2,0,0,0, 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 199,0,0,0,187,4,0,0,115,8,0,0,0,0,7,6, - 1,4,255,4,2,122,28,95,78,97,109,101,115,112,97,99, - 101,76,111,97,100,101,114,46,108,111,97,100,95,109,111,100, - 117,108,101,78,41,12,114,113,0,0,0,114,112,0,0,0, - 114,114,0,0,0,114,191,0,0,0,114,189,0,0,0,114, - 9,1,0,0,114,166,0,0,0,114,207,0,0,0,114,193, - 0,0,0,114,192,0,0,0,114,197,0,0,0,114,199,0, - 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,8,1,0,0,159,4,0,0,115, - 16,0,0,0,8,1,8,3,12,9,8,3,8,3,8,3, - 8,3,8,3,114,8,1,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,4,0,0,0,64,0,0,0,115,114, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,101, - 4,100,2,100,3,132,0,131,1,90,5,101,4,100,4,100, - 5,132,0,131,1,90,6,101,4,100,6,100,7,132,0,131, - 1,90,7,101,4,100,8,100,9,132,0,131,1,90,8,101, - 4,100,10,102,1,100,11,100,12,132,1,131,1,90,9,101, - 4,100,10,100,10,102,2,100,13,100,14,132,1,131,1,90, - 10,101,4,100,10,102,1,100,15,100,16,132,1,131,1,90, - 11,100,10,83,0,41,17,218,10,80,97,116,104,70,105,110, + 234,0,0,0,228,3,0,0,115,8,0,0,0,8,2,4, + 2,8,5,8,5,114,234,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115, + 32,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, + 100,6,83,0,41,7,218,20,83,111,117,114,99,101,108,101, + 115,115,70,105,108,101,76,111,97,100,101,114,122,45,76,111, + 97,100,101,114,32,119,104,105,99,104,32,104,97,110,100,108, + 101,115,32,115,111,117,114,99,101,108,101,115,115,32,102,105, + 108,101,32,105,109,112,111,114,116,115,46,99,2,0,0,0, + 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0, + 115,68,0,0,0,124,0,160,0,124,1,161,1,125,2,124, + 0,160,1,124,2,161,1,125,3,124,1,124,2,100,1,156, + 2,125,4,116,2,124,3,124,1,124,4,131,3,1,0,116, + 3,116,4,124,3,131,1,100,2,100,0,133,2,25,0,124, + 1,124,2,100,3,141,3,83,0,41,4,78,41,2,114,106, + 0,0,0,114,39,0,0,0,114,132,0,0,0,41,2,114, + 106,0,0,0,114,98,0,0,0,41,5,114,164,0,0,0, + 114,205,0,0,0,114,139,0,0,0,114,151,0,0,0,114, + 213,0,0,0,41,5,114,108,0,0,0,114,127,0,0,0, + 114,39,0,0,0,114,21,0,0,0,114,138,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,193, + 0,0,0,21,4,0,0,115,22,0,0,0,0,1,10,1, + 10,4,2,1,2,254,6,4,12,1,2,1,14,1,2,1, + 2,253,122,29,83,111,117,114,99,101,108,101,115,115,70,105, + 108,101,76,111,97,100,101,114,46,103,101,116,95,99,111,100, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, + 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, + 2,122,39,82,101,116,117,114,110,32,78,111,110,101,32,97, + 115,32,116,104,101,114,101,32,105,115,32,110,111,32,115,111, + 117,114,99,101,32,99,111,100,101,46,78,114,2,0,0,0, + 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,207,0,0,0, + 37,4,0,0,115,2,0,0,0,0,2,122,31,83,111,117, + 114,99,101,108,101,115,115,70,105,108,101,76,111,97,100,101, + 114,46,103,101,116,95,115,111,117,114,99,101,78,41,6,114, + 113,0,0,0,114,112,0,0,0,114,114,0,0,0,114,115, + 0,0,0,114,193,0,0,0,114,207,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,114,239,0,0,0,17,4,0,0,115,6,0,0,0,8, + 2,4,2,8,16,114,239,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, + 92,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, + 100,6,100,7,132,0,90,6,100,8,100,9,132,0,90,7, + 100,10,100,11,132,0,90,8,100,12,100,13,132,0,90,9, + 100,14,100,15,132,0,90,10,100,16,100,17,132,0,90,11, + 101,12,100,18,100,19,132,0,131,1,90,13,100,20,83,0, + 41,21,218,19,69,120,116,101,110,115,105,111,110,70,105,108, + 101,76,111,97,100,101,114,122,93,76,111,97,100,101,114,32, + 102,111,114,32,101,120,116,101,110,115,105,111,110,32,109,111, + 100,117,108,101,115,46,10,10,32,32,32,32,84,104,101,32, + 99,111,110,115,116,114,117,99,116,111,114,32,105,115,32,100, + 101,115,105,103,110,101,100,32,116,111,32,119,111,114,107,32, + 119,105,116,104,32,70,105,108,101,70,105,110,100,101,114,46, + 10,10,32,32,32,32,99,3,0,0,0,0,0,0,0,3, + 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, + 124,1,124,0,95,0,124,2,124,0,95,1,100,0,83,0, + 41,1,78,41,2,114,106,0,0,0,114,39,0,0,0,41, + 3,114,108,0,0,0,114,106,0,0,0,114,39,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, + 191,0,0,0,54,4,0,0,115,4,0,0,0,0,1,6, + 1,122,28,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,95,95,105,110,105,116,95,95,99, + 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, + 67,0,0,0,115,24,0,0,0,124,0,106,0,124,1,106, + 0,107,2,111,22,124,0,106,1,124,1,106,1,107,2,83, + 0,41,1,78,41,2,114,218,0,0,0,114,119,0,0,0, + 41,2,114,108,0,0,0,114,219,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,220,0,0,0, + 58,4,0,0,115,6,0,0,0,0,1,12,1,10,255,122, + 26,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, + 97,100,101,114,46,95,95,101,113,95,95,99,1,0,0,0, + 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, + 115,20,0,0,0,116,0,124,0,106,1,131,1,116,0,124, + 0,106,2,131,1,65,0,83,0,41,1,78,41,3,114,221, + 0,0,0,114,106,0,0,0,114,39,0,0,0,41,1,114, + 108,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,222,0,0,0,62,4,0,0,115,2,0,0, + 0,0,1,122,28,69,120,116,101,110,115,105,111,110,70,105, + 108,101,76,111,97,100,101,114,46,95,95,104,97,115,104,95, + 95,99,2,0,0,0,0,0,0,0,3,0,0,0,5,0, + 0,0,67,0,0,0,115,36,0,0,0,116,0,160,1,116, + 2,106,3,124,1,161,2,125,2,116,0,160,4,100,1,124, + 1,106,5,124,0,106,6,161,3,1,0,124,2,83,0,41, + 2,122,38,67,114,101,97,116,101,32,97,110,32,117,110,105, + 116,105,97,108,105,122,101,100,32,101,120,116,101,110,115,105, + 111,110,32,109,111,100,117,108,101,122,38,101,120,116,101,110, + 115,105,111,110,32,109,111,100,117,108,101,32,123,33,114,125, + 32,108,111,97,100,101,100,32,102,114,111,109,32,123,33,114, + 125,41,7,114,122,0,0,0,114,194,0,0,0,114,149,0, + 0,0,90,14,99,114,101,97,116,101,95,100,121,110,97,109, + 105,99,114,136,0,0,0,114,106,0,0,0,114,39,0,0, + 0,41,3,114,108,0,0,0,114,171,0,0,0,114,196,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,114,192,0,0,0,65,4,0,0,115,18,0,0,0,0, + 2,4,1,4,0,2,255,4,2,6,1,4,0,4,255,4, + 2,122,33,69,120,116,101,110,115,105,111,110,70,105,108,101, + 76,111,97,100,101,114,46,99,114,101,97,116,101,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,5,0,0,0,67,0,0,0,115,36,0,0,0,116,0, + 160,1,116,2,106,3,124,1,161,2,1,0,116,0,160,4, + 100,1,124,0,106,5,124,0,106,6,161,3,1,0,100,2, + 83,0,41,3,122,30,73,110,105,116,105,97,108,105,122,101, + 32,97,110,32,101,120,116,101,110,115,105,111,110,32,109,111, + 100,117,108,101,122,40,101,120,116,101,110,115,105,111,110,32, + 109,111,100,117,108,101,32,123,33,114,125,32,101,120,101,99, + 117,116,101,100,32,102,114,111,109,32,123,33,114,125,78,41, + 7,114,122,0,0,0,114,194,0,0,0,114,149,0,0,0, + 90,12,101,120,101,99,95,100,121,110,97,109,105,99,114,136, + 0,0,0,114,106,0,0,0,114,39,0,0,0,41,2,114, + 108,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,114,197,0,0,0,73,4,0, + 0,115,10,0,0,0,0,2,14,1,6,1,4,0,4,255, + 122,31,69,120,116,101,110,115,105,111,110,70,105,108,101,76, + 111,97,100,101,114,46,101,120,101,99,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,4,0, + 0,0,3,0,0,0,115,36,0,0,0,116,0,124,0,106, + 1,131,1,100,1,25,0,137,0,116,2,135,0,102,1,100, + 2,100,3,132,8,116,3,68,0,131,1,131,1,83,0,41, + 4,122,49,82,101,116,117,114,110,32,84,114,117,101,32,105, + 102,32,116,104,101,32,101,120,116,101,110,115,105,111,110,32, + 109,111,100,117,108,101,32,105,115,32,97,32,112,97,99,107, + 97,103,101,46,114,34,0,0,0,99,1,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,51,0,0,0,115,26, + 0,0,0,124,0,93,18,125,1,136,0,100,0,124,1,23, + 0,107,2,86,0,1,0,113,2,100,1,83,0,41,2,114, + 191,0,0,0,78,114,2,0,0,0,41,2,114,27,0,0, + 0,218,6,115,117,102,102,105,120,41,1,218,9,102,105,108, + 101,95,110,97,109,101,114,2,0,0,0,114,4,0,0,0, + 218,9,60,103,101,110,101,120,112,114,62,82,4,0,0,115, + 4,0,0,0,4,1,2,255,122,49,69,120,116,101,110,115, + 105,111,110,70,105,108,101,76,111,97,100,101,114,46,105,115, + 95,112,97,99,107,97,103,101,46,60,108,111,99,97,108,115, + 62,46,60,103,101,110,101,120,112,114,62,41,4,114,42,0, + 0,0,114,39,0,0,0,218,3,97,110,121,218,18,69,88, + 84,69,78,83,73,79,78,95,83,85,70,70,73,88,69,83, + 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, + 0,41,1,114,242,0,0,0,114,4,0,0,0,114,166,0, + 0,0,79,4,0,0,115,8,0,0,0,0,2,14,1,12, + 1,2,255,122,30,69,120,116,101,110,115,105,111,110,70,105, + 108,101,76,111,97,100,101,114,46,105,115,95,112,97,99,107, + 97,103,101,99,2,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, + 0,41,2,122,63,82,101,116,117,114,110,32,78,111,110,101, + 32,97,115,32,97,110,32,101,120,116,101,110,115,105,111,110, + 32,109,111,100,117,108,101,32,99,97,110,110,111,116,32,99, + 114,101,97,116,101,32,97,32,99,111,100,101,32,111,98,106, + 101,99,116,46,78,114,2,0,0,0,41,2,114,108,0,0, + 0,114,127,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,193,0,0,0,85,4,0,0,115,2, + 0,0,0,0,2,122,28,69,120,116,101,110,115,105,111,110, + 70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,99, + 111,100,101,99,2,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, + 0,41,2,122,53,82,101,116,117,114,110,32,78,111,110,101, + 32,97,115,32,101,120,116,101,110,115,105,111,110,32,109,111, + 100,117,108,101,115,32,104,97,118,101,32,110,111,32,115,111, + 117,114,99,101,32,99,111,100,101,46,78,114,2,0,0,0, + 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,207,0,0,0, + 89,4,0,0,115,2,0,0,0,0,2,122,30,69,120,116, + 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, + 46,103,101,116,95,115,111,117,114,99,101,99,2,0,0,0, + 0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0, + 115,6,0,0,0,124,0,106,0,83,0,41,1,122,58,82, + 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, + 111,32,116,104,101,32,115,111,117,114,99,101,32,102,105,108, + 101,32,97,115,32,102,111,117,110,100,32,98,121,32,116,104, + 101,32,102,105,110,100,101,114,46,41,1,114,39,0,0,0, + 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,164,0,0,0, + 93,4,0,0,115,2,0,0,0,0,3,122,32,69,120,116, + 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, + 46,103,101,116,95,102,105,108,101,110,97,109,101,78,41,14, + 114,113,0,0,0,114,112,0,0,0,114,114,0,0,0,114, + 115,0,0,0,114,191,0,0,0,114,220,0,0,0,114,222, + 0,0,0,114,192,0,0,0,114,197,0,0,0,114,166,0, + 0,0,114,193,0,0,0,114,207,0,0,0,114,124,0,0, + 0,114,164,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,114,240,0,0,0,46, + 4,0,0,115,22,0,0,0,8,6,4,2,8,4,8,4, + 8,3,8,8,8,6,8,6,8,4,8,4,2,1,114,240, + 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,64,0,0,0,115,96,0,0,0,101,0,90, + 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, + 4,100,4,100,5,132,0,90,5,100,6,100,7,132,0,90, + 6,100,8,100,9,132,0,90,7,100,10,100,11,132,0,90, + 8,100,12,100,13,132,0,90,9,100,14,100,15,132,0,90, + 10,100,16,100,17,132,0,90,11,100,18,100,19,132,0,90, + 12,100,20,100,21,132,0,90,13,100,22,83,0,41,23,218, + 14,95,78,97,109,101,115,112,97,99,101,80,97,116,104,97, + 38,1,0,0,82,101,112,114,101,115,101,110,116,115,32,97, + 32,110,97,109,101,115,112,97,99,101,32,112,97,99,107,97, + 103,101,39,115,32,112,97,116,104,46,32,32,73,116,32,117, + 115,101,115,32,116,104,101,32,109,111,100,117,108,101,32,110, + 97,109,101,10,32,32,32,32,116,111,32,102,105,110,100,32, + 105,116,115,32,112,97,114,101,110,116,32,109,111,100,117,108, + 101,44,32,97,110,100,32,102,114,111,109,32,116,104,101,114, + 101,32,105,116,32,108,111,111,107,115,32,117,112,32,116,104, + 101,32,112,97,114,101,110,116,39,115,10,32,32,32,32,95, + 95,112,97,116,104,95,95,46,32,32,87,104,101,110,32,116, + 104,105,115,32,99,104,97,110,103,101,115,44,32,116,104,101, + 32,109,111,100,117,108,101,39,115,32,111,119,110,32,112,97, + 116,104,32,105,115,32,114,101,99,111,109,112,117,116,101,100, + 44,10,32,32,32,32,117,115,105,110,103,32,112,97,116,104, + 95,102,105,110,100,101,114,46,32,32,70,111,114,32,116,111, + 112,45,108,101,118,101,108,32,109,111,100,117,108,101,115,44, + 32,116,104,101,32,112,97,114,101,110,116,32,109,111,100,117, + 108,101,39,115,32,112,97,116,104,10,32,32,32,32,105,115, + 32,115,121,115,46,112,97,116,104,46,99,4,0,0,0,0, + 0,0,0,4,0,0,0,3,0,0,0,67,0,0,0,115, + 36,0,0,0,124,1,124,0,95,0,124,2,124,0,95,1, + 116,2,124,0,160,3,161,0,131,1,124,0,95,4,124,3, + 124,0,95,5,100,0,83,0,41,1,78,41,6,218,5,95, + 110,97,109,101,218,5,95,112,97,116,104,114,102,0,0,0, + 218,16,95,103,101,116,95,112,97,114,101,110,116,95,112,97, + 116,104,218,17,95,108,97,115,116,95,112,97,114,101,110,116, + 95,112,97,116,104,218,12,95,112,97,116,104,95,102,105,110, + 100,101,114,41,4,114,108,0,0,0,114,106,0,0,0,114, + 39,0,0,0,218,11,112,97,116,104,95,102,105,110,100,101, + 114,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,191,0,0,0,106,4,0,0,115,8,0,0,0,0,1, + 6,1,6,1,14,1,122,23,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,46,95,95,105,110,105,116,95,95,99, + 1,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0, + 67,0,0,0,115,38,0,0,0,124,0,106,0,160,1,100, + 1,161,1,92,3,125,1,125,2,125,3,124,2,100,2,107, + 2,114,30,100,3,83,0,124,1,100,4,102,2,83,0,41, + 5,122,62,82,101,116,117,114,110,115,32,97,32,116,117,112, + 108,101,32,111,102,32,40,112,97,114,101,110,116,45,109,111, + 100,117,108,101,45,110,97,109,101,44,32,112,97,114,101,110, + 116,45,112,97,116,104,45,97,116,116,114,45,110,97,109,101, + 41,114,63,0,0,0,114,35,0,0,0,41,2,114,6,0, + 0,0,114,39,0,0,0,90,8,95,95,112,97,116,104,95, + 95,41,2,114,247,0,0,0,114,36,0,0,0,41,4,114, + 108,0,0,0,114,238,0,0,0,218,3,100,111,116,90,2, + 109,101,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,218,23,95,102,105,110,100,95,112,97,114,101,110,116,95, + 112,97,116,104,95,110,97,109,101,115,112,4,0,0,115,8, + 0,0,0,0,2,18,1,8,2,4,3,122,38,95,78,97, + 109,101,115,112,97,99,101,80,97,116,104,46,95,102,105,110, + 100,95,112,97,114,101,110,116,95,112,97,116,104,95,110,97, + 109,101,115,99,1,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,28,0,0,0,124,0,160, + 0,161,0,92,2,125,1,125,2,116,1,116,2,106,3,124, + 1,25,0,124,2,131,2,83,0,41,1,78,41,4,114,254, + 0,0,0,114,118,0,0,0,114,6,0,0,0,218,7,109, + 111,100,117,108,101,115,41,3,114,108,0,0,0,90,18,112, + 97,114,101,110,116,95,109,111,100,117,108,101,95,110,97,109, + 101,90,14,112,97,116,104,95,97,116,116,114,95,110,97,109, + 101,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,249,0,0,0,122,4,0,0,115,4,0,0,0,0,1, + 12,1,122,31,95,78,97,109,101,115,112,97,99,101,80,97, + 116,104,46,95,103,101,116,95,112,97,114,101,110,116,95,112, + 97,116,104,99,1,0,0,0,0,0,0,0,3,0,0,0, + 4,0,0,0,67,0,0,0,115,80,0,0,0,116,0,124, + 0,160,1,161,0,131,1,125,1,124,1,124,0,106,2,107, + 3,114,74,124,0,160,3,124,0,106,4,124,1,161,2,125, + 2,124,2,100,0,107,9,114,68,124,2,106,5,100,0,107, + 8,114,68,124,2,106,6,114,68,124,2,106,6,124,0,95, + 7,124,1,124,0,95,2,124,0,106,7,83,0,41,1,78, + 41,8,114,102,0,0,0,114,249,0,0,0,114,250,0,0, + 0,114,251,0,0,0,114,247,0,0,0,114,128,0,0,0, + 114,163,0,0,0,114,248,0,0,0,41,3,114,108,0,0, + 0,90,11,112,97,114,101,110,116,95,112,97,116,104,114,171, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,218,12,95,114,101,99,97,108,99,117,108,97,116,101, + 126,4,0,0,115,16,0,0,0,0,2,12,1,10,1,14, + 3,18,1,6,1,8,1,6,1,122,27,95,78,97,109,101, + 115,112,97,99,101,80,97,116,104,46,95,114,101,99,97,108, + 99,117,108,97,116,101,99,1,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,0, + 116,0,124,0,160,1,161,0,131,1,83,0,41,1,78,41, + 2,114,231,0,0,0,114,0,1,0,0,41,1,114,108,0, + 0,0,114,2,0,0,0,114,2,0,0,0,114,4,0,0, + 0,218,8,95,95,105,116,101,114,95,95,139,4,0,0,115, + 2,0,0,0,0,1,122,23,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,46,95,95,105,116,101,114,95,95,99, + 3,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, + 67,0,0,0,115,14,0,0,0,124,2,124,0,106,0,124, + 1,60,0,100,0,83,0,41,1,78,41,1,114,248,0,0, + 0,41,3,114,108,0,0,0,218,5,105,110,100,101,120,114, + 39,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,11,95,95,115,101,116,105,116,101,109,95,95, + 142,4,0,0,115,2,0,0,0,0,1,122,26,95,78,97, + 109,101,115,112,97,99,101,80,97,116,104,46,95,95,115,101, + 116,105,116,101,109,95,95,99,1,0,0,0,0,0,0,0, + 1,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0, + 0,116,0,124,0,160,1,161,0,131,1,83,0,41,1,78, + 41,2,114,18,0,0,0,114,0,1,0,0,41,1,114,108, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,218,7,95,95,108,101,110,95,95,145,4,0,0,115, + 2,0,0,0,0,1,122,22,95,78,97,109,101,115,112,97, + 99,101,80,97,116,104,46,95,95,108,101,110,95,95,99,1, + 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67, + 0,0,0,115,12,0,0,0,100,1,160,0,124,0,106,1, + 161,1,83,0,41,2,78,122,20,95,78,97,109,101,115,112, + 97,99,101,80,97,116,104,40,123,33,114,125,41,41,2,114, + 54,0,0,0,114,248,0,0,0,41,1,114,108,0,0,0, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, + 8,95,95,114,101,112,114,95,95,148,4,0,0,115,2,0, + 0,0,0,1,122,23,95,78,97,109,101,115,112,97,99,101, + 80,97,116,104,46,95,95,114,101,112,114,95,95,99,2,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,12,0,0,0,124,1,124,0,160,0,161,0,107, + 6,83,0,41,1,78,41,1,114,0,1,0,0,41,2,114, + 108,0,0,0,218,4,105,116,101,109,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,218,12,95,95,99,111,110, + 116,97,105,110,115,95,95,151,4,0,0,115,2,0,0,0, + 0,1,122,27,95,78,97,109,101,115,112,97,99,101,80,97, + 116,104,46,95,95,99,111,110,116,97,105,110,115,95,95,99, + 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 67,0,0,0,115,16,0,0,0,124,0,106,0,160,1,124, + 1,161,1,1,0,100,0,83,0,41,1,78,41,2,114,248, + 0,0,0,114,170,0,0,0,41,2,114,108,0,0,0,114, + 6,1,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,170,0,0,0,154,4,0,0,115,2,0,0, + 0,0,1,122,21,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,46,97,112,112,101,110,100,78,41,14,114,113,0, + 0,0,114,112,0,0,0,114,114,0,0,0,114,115,0,0, + 0,114,191,0,0,0,114,254,0,0,0,114,249,0,0,0, + 114,0,1,0,0,114,1,1,0,0,114,3,1,0,0,114, + 4,1,0,0,114,5,1,0,0,114,7,1,0,0,114,170, + 0,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,246,0,0,0,99,4,0,0, + 115,22,0,0,0,8,5,4,2,8,6,8,10,8,4,8, + 13,8,3,8,3,8,3,8,3,8,3,114,246,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,64,0,0,0,115,80,0,0,0,101,0,90,1,100,0, + 90,2,100,1,100,2,132,0,90,3,101,4,100,3,100,4, + 132,0,131,1,90,5,100,5,100,6,132,0,90,6,100,7, + 100,8,132,0,90,7,100,9,100,10,132,0,90,8,100,11, + 100,12,132,0,90,9,100,13,100,14,132,0,90,10,100,15, + 100,16,132,0,90,11,100,17,83,0,41,18,218,16,95,78, + 97,109,101,115,112,97,99,101,76,111,97,100,101,114,99,4, + 0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,67, + 0,0,0,115,18,0,0,0,116,0,124,1,124,2,124,3, + 131,3,124,0,95,1,100,0,83,0,41,1,78,41,2,114, + 246,0,0,0,114,248,0,0,0,41,4,114,108,0,0,0, + 114,106,0,0,0,114,39,0,0,0,114,252,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,114,191, + 0,0,0,160,4,0,0,115,2,0,0,0,0,1,122,25, + 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, + 46,95,95,105,110,105,116,95,95,99,2,0,0,0,0,0, + 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,12, + 0,0,0,100,1,160,0,124,1,106,1,161,1,83,0,41, + 2,122,115,82,101,116,117,114,110,32,114,101,112,114,32,102, + 111,114,32,116,104,101,32,109,111,100,117,108,101,46,10,10, + 32,32,32,32,32,32,32,32,84,104,101,32,109,101,116,104, + 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, + 46,32,32,84,104,101,32,105,109,112,111,114,116,32,109,97, + 99,104,105,110,101,114,121,32,100,111,101,115,32,116,104,101, + 32,106,111,98,32,105,116,115,101,108,102,46,10,10,32,32, + 32,32,32,32,32,32,122,25,60,109,111,100,117,108,101,32, + 123,33,114,125,32,40,110,97,109,101,115,112,97,99,101,41, + 62,41,2,114,54,0,0,0,114,113,0,0,0,41,2,114, + 177,0,0,0,114,196,0,0,0,114,2,0,0,0,114,2, + 0,0,0,114,4,0,0,0,218,11,109,111,100,117,108,101, + 95,114,101,112,114,163,4,0,0,115,2,0,0,0,0,7, + 122,28,95,78,97,109,101,115,112,97,99,101,76,111,97,100, + 101,114,46,109,111,100,117,108,101,95,114,101,112,114,99,2, + 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,115,4,0,0,0,100,1,83,0,41,2,78,84, + 114,2,0,0,0,41,2,114,108,0,0,0,114,127,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,166,0,0,0,172,4,0,0,115,2,0,0,0,0,1, + 122,27,95,78,97,109,101,115,112,97,99,101,76,111,97,100, + 101,114,46,105,115,95,112,97,99,107,97,103,101,99,2,0, + 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,115,4,0,0,0,100,1,83,0,41,2,78,114,35, + 0,0,0,114,2,0,0,0,41,2,114,108,0,0,0,114, + 127,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,207,0,0,0,175,4,0,0,115,2,0,0, + 0,0,1,122,27,95,78,97,109,101,115,112,97,99,101,76, + 111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,101, + 99,2,0,0,0,0,0,0,0,2,0,0,0,6,0,0, + 0,67,0,0,0,115,16,0,0,0,116,0,100,1,100,2, + 100,3,100,4,100,5,141,4,83,0,41,6,78,114,35,0, + 0,0,122,8,60,115,116,114,105,110,103,62,114,195,0,0, + 0,84,41,1,114,209,0,0,0,41,1,114,210,0,0,0, + 41,2,114,108,0,0,0,114,127,0,0,0,114,2,0,0, + 0,114,2,0,0,0,114,4,0,0,0,114,193,0,0,0, + 178,4,0,0,115,2,0,0,0,0,1,122,25,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,46,103,101, + 116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, + 100,1,83,0,41,2,122,42,85,115,101,32,100,101,102,97, + 117,108,116,32,115,101,109,97,110,116,105,99,115,32,102,111, + 114,32,109,111,100,117,108,101,32,99,114,101,97,116,105,111, + 110,46,78,114,2,0,0,0,41,2,114,108,0,0,0,114, + 171,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,192,0,0,0,181,4,0,0,115,2,0,0, + 0,0,1,122,30,95,78,97,109,101,115,112,97,99,101,76, + 111,97,100,101,114,46,99,114,101,97,116,101,95,109,111,100, + 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,4,0,0,0,100,0,83, + 0,41,1,78,114,2,0,0,0,41,2,114,108,0,0,0, + 114,196,0,0,0,114,2,0,0,0,114,2,0,0,0,114, + 4,0,0,0,114,197,0,0,0,184,4,0,0,115,2,0, + 0,0,0,1,122,28,95,78,97,109,101,115,112,97,99,101, + 76,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117, + 108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,67,0,0,0,115,26,0,0,0,116,0,160,1, + 100,1,124,0,106,2,161,2,1,0,116,0,160,3,124,0, + 124,1,161,2,83,0,41,2,122,98,76,111,97,100,32,97, + 32,110,97,109,101,115,112,97,99,101,32,109,111,100,117,108, + 101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,115, + 32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,101, + 99,97,116,101,100,46,32,32,85,115,101,32,101,120,101,99, + 95,109,111,100,117,108,101,40,41,32,105,110,115,116,101,97, + 100,46,10,10,32,32,32,32,32,32,32,32,122,38,110,97, + 109,101,115,112,97,99,101,32,109,111,100,117,108,101,32,108, + 111,97,100,101,100,32,119,105,116,104,32,112,97,116,104,32, + 123,33,114,125,41,4,114,122,0,0,0,114,136,0,0,0, + 114,248,0,0,0,114,198,0,0,0,41,2,114,108,0,0, + 0,114,127,0,0,0,114,2,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,199,0,0,0,187,4,0,0,115,8, + 0,0,0,0,7,6,1,4,255,4,2,122,28,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,46,108,111, + 97,100,95,109,111,100,117,108,101,78,41,12,114,113,0,0, + 0,114,112,0,0,0,114,114,0,0,0,114,191,0,0,0, + 114,189,0,0,0,114,9,1,0,0,114,166,0,0,0,114, + 207,0,0,0,114,193,0,0,0,114,192,0,0,0,114,197, + 0,0,0,114,199,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,8,1,0, + 0,159,4,0,0,115,18,0,0,0,8,1,8,3,2,1, + 10,8,8,3,8,3,8,3,8,3,8,3,114,8,1,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,4,0, + 0,0,64,0,0,0,115,106,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,101,4,100,2,100,3,132,0,131, + 1,90,5,101,4,100,4,100,5,132,0,131,1,90,6,101, + 4,100,6,100,7,132,0,131,1,90,7,101,4,100,8,100, + 9,132,0,131,1,90,8,101,4,100,17,100,11,100,12,132, + 1,131,1,90,9,101,4,100,18,100,13,100,14,132,1,131, + 1,90,10,101,4,100,19,100,15,100,16,132,1,131,1,90, + 11,100,10,83,0,41,20,218,10,80,97,116,104,70,105,110, 100,101,114,122,62,77,101,116,97,32,112,97,116,104,32,102, 105,110,100,101,114,32,102,111,114,32,115,121,115,46,112,97, 116,104,32,97,110,100,32,112,97,99,107,97,103,101,32,95, @@ -2219,464 +2219,465 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 2,0,0,0,114,4,0,0,0,114,188,0,0,0,65,5, 0,0,115,8,0,0,0,0,8,12,1,8,1,4,1,122, 22,80,97,116,104,70,105,110,100,101,114,46,102,105,110,100, - 95,109,111,100,117,108,101,41,12,114,113,0,0,0,114,112, - 0,0,0,114,114,0,0,0,114,115,0,0,0,114,189,0, - 0,0,114,11,1,0,0,114,17,1,0,0,114,19,1,0, - 0,114,20,1,0,0,114,23,1,0,0,114,187,0,0,0, - 114,188,0,0,0,114,2,0,0,0,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,10,1,0,0,201,4, - 0,0,115,30,0,0,0,8,2,4,2,12,10,12,13,12, - 22,12,15,2,1,2,255,12,32,2,1,2,0,2,255,12, - 24,2,1,2,255,114,10,1,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, - 90,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, - 101,6,90,7,100,6,100,7,132,0,90,8,100,8,100,9, - 132,0,90,9,100,19,100,11,100,12,132,1,90,10,100,13, - 100,14,132,0,90,11,101,12,100,15,100,16,132,0,131,1, - 90,13,100,17,100,18,132,0,90,14,100,10,83,0,41,20, - 218,10,70,105,108,101,70,105,110,100,101,114,122,172,70,105, - 108,101,45,98,97,115,101,100,32,102,105,110,100,101,114,46, - 10,10,32,32,32,32,73,110,116,101,114,97,99,116,105,111, - 110,115,32,119,105,116,104,32,116,104,101,32,102,105,108,101, - 32,115,121,115,116,101,109,32,97,114,101,32,99,97,99,104, - 101,100,32,102,111,114,32,112,101,114,102,111,114,109,97,110, - 99,101,44,32,98,101,105,110,103,10,32,32,32,32,114,101, - 102,114,101,115,104,101,100,32,119,104,101,110,32,116,104,101, - 32,100,105,114,101,99,116,111,114,121,32,116,104,101,32,102, - 105,110,100,101,114,32,105,115,32,104,97,110,100,108,105,110, - 103,32,104,97,115,32,98,101,101,110,32,109,111,100,105,102, - 105,101,100,46,10,10,32,32,32,32,99,2,0,0,0,0, - 0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,115, - 84,0,0,0,103,0,125,3,124,2,68,0,93,32,92,2, - 137,0,125,4,124,3,160,0,135,0,102,1,100,1,100,2, - 132,8,124,4,68,0,131,1,161,1,1,0,113,8,124,3, - 124,0,95,1,124,1,112,54,100,3,124,0,95,2,100,4, - 124,0,95,3,116,4,131,0,124,0,95,5,116,4,131,0, - 124,0,95,6,100,5,83,0,41,6,122,154,73,110,105,116, - 105,97,108,105,122,101,32,119,105,116,104,32,116,104,101,32, - 112,97,116,104,32,116,111,32,115,101,97,114,99,104,32,111, - 110,32,97,110,100,32,97,32,118,97,114,105,97,98,108,101, - 32,110,117,109,98,101,114,32,111,102,10,32,32,32,32,32, - 32,32,32,50,45,116,117,112,108,101,115,32,99,111,110,116, - 97,105,110,105,110,103,32,116,104,101,32,108,111,97,100,101, - 114,32,97,110,100,32,116,104,101,32,102,105,108,101,32,115, - 117,102,102,105,120,101,115,32,116,104,101,32,108,111,97,100, - 101,114,10,32,32,32,32,32,32,32,32,114,101,99,111,103, - 110,105,122,101,115,46,99,1,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,51,0,0,0,115,22,0,0,0, - 124,0,93,14,125,1,124,1,136,0,102,2,86,0,1,0, - 113,2,100,0,83,0,41,1,78,114,2,0,0,0,41,2, - 114,27,0,0,0,114,241,0,0,0,41,1,114,128,0,0, - 0,114,2,0,0,0,114,4,0,0,0,114,243,0,0,0, - 94,5,0,0,115,4,0,0,0,4,0,2,0,122,38,70, + 95,109,111,100,117,108,101,41,1,78,41,2,78,78,41,1, + 78,41,12,114,113,0,0,0,114,112,0,0,0,114,114,0, + 0,0,114,115,0,0,0,114,189,0,0,0,114,11,1,0, + 0,114,17,1,0,0,114,19,1,0,0,114,20,1,0,0, + 114,23,1,0,0,114,187,0,0,0,114,188,0,0,0,114, + 2,0,0,0,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,10,1,0,0,201,4,0,0,115,30,0,0, + 0,8,2,4,2,2,1,10,9,2,1,10,12,2,1,10, + 21,2,1,10,14,2,1,12,31,2,1,12,23,2,1,114, + 10,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,64,0,0,0,115,90,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, + 90,4,100,4,100,5,132,0,90,5,101,6,90,7,100,6, + 100,7,132,0,90,8,100,8,100,9,132,0,90,9,100,19, + 100,11,100,12,132,1,90,10,100,13,100,14,132,0,90,11, + 101,12,100,15,100,16,132,0,131,1,90,13,100,17,100,18, + 132,0,90,14,100,10,83,0,41,20,218,10,70,105,108,101, + 70,105,110,100,101,114,122,172,70,105,108,101,45,98,97,115, + 101,100,32,102,105,110,100,101,114,46,10,10,32,32,32,32, + 73,110,116,101,114,97,99,116,105,111,110,115,32,119,105,116, + 104,32,116,104,101,32,102,105,108,101,32,115,121,115,116,101, + 109,32,97,114,101,32,99,97,99,104,101,100,32,102,111,114, + 32,112,101,114,102,111,114,109,97,110,99,101,44,32,98,101, + 105,110,103,10,32,32,32,32,114,101,102,114,101,115,104,101, + 100,32,119,104,101,110,32,116,104,101,32,100,105,114,101,99, + 116,111,114,121,32,116,104,101,32,102,105,110,100,101,114,32, + 105,115,32,104,97,110,100,108,105,110,103,32,104,97,115,32, + 98,101,101,110,32,109,111,100,105,102,105,101,100,46,10,10, + 32,32,32,32,99,2,0,0,0,0,0,0,0,5,0,0, + 0,6,0,0,0,7,0,0,0,115,84,0,0,0,103,0, + 125,3,124,2,68,0,93,32,92,2,137,0,125,4,124,3, + 160,0,135,0,102,1,100,1,100,2,132,8,124,4,68,0, + 131,1,161,1,1,0,113,8,124,3,124,0,95,1,124,1, + 112,54,100,3,124,0,95,2,100,4,124,0,95,3,116,4, + 131,0,124,0,95,5,116,4,131,0,124,0,95,6,100,5, + 83,0,41,6,122,154,73,110,105,116,105,97,108,105,122,101, + 32,119,105,116,104,32,116,104,101,32,112,97,116,104,32,116, + 111,32,115,101,97,114,99,104,32,111,110,32,97,110,100,32, + 97,32,118,97,114,105,97,98,108,101,32,110,117,109,98,101, + 114,32,111,102,10,32,32,32,32,32,32,32,32,50,45,116, + 117,112,108,101,115,32,99,111,110,116,97,105,110,105,110,103, + 32,116,104,101,32,108,111,97,100,101,114,32,97,110,100,32, + 116,104,101,32,102,105,108,101,32,115,117,102,102,105,120,101, + 115,32,116,104,101,32,108,111,97,100,101,114,10,32,32,32, + 32,32,32,32,32,114,101,99,111,103,110,105,122,101,115,46, + 99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,0, + 0,51,0,0,0,115,22,0,0,0,124,0,93,14,125,1, + 124,1,136,0,102,2,86,0,1,0,113,2,100,0,83,0, + 41,1,78,114,2,0,0,0,41,2,114,27,0,0,0,114, + 241,0,0,0,41,1,114,128,0,0,0,114,2,0,0,0, + 114,4,0,0,0,114,243,0,0,0,94,5,0,0,115,4, + 0,0,0,4,0,2,0,122,38,70,105,108,101,70,105,110, + 100,101,114,46,95,95,105,110,105,116,95,95,46,60,108,111, + 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, + 63,0,0,0,114,96,0,0,0,78,41,7,114,153,0,0, + 0,218,8,95,108,111,97,100,101,114,115,114,39,0,0,0, + 218,11,95,112,97,116,104,95,109,116,105,109,101,218,3,115, + 101,116,218,11,95,112,97,116,104,95,99,97,99,104,101,218, + 19,95,114,101,108,97,120,101,100,95,112,97,116,104,95,99, + 97,99,104,101,41,5,114,108,0,0,0,114,39,0,0,0, + 218,14,108,111,97,100,101,114,95,100,101,116,97,105,108,115, + 90,7,108,111,97,100,101,114,115,114,173,0,0,0,114,2, + 0,0,0,41,1,114,128,0,0,0,114,4,0,0,0,114, + 191,0,0,0,88,5,0,0,115,16,0,0,0,0,4,4, + 1,12,1,26,1,6,2,10,1,6,1,8,1,122,19,70, 105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116, - 95,95,46,60,108,111,99,97,108,115,62,46,60,103,101,110, - 101,120,112,114,62,114,63,0,0,0,114,96,0,0,0,78, - 41,7,114,153,0,0,0,218,8,95,108,111,97,100,101,114, - 115,114,39,0,0,0,218,11,95,112,97,116,104,95,109,116, - 105,109,101,218,3,115,101,116,218,11,95,112,97,116,104,95, - 99,97,99,104,101,218,19,95,114,101,108,97,120,101,100,95, - 112,97,116,104,95,99,97,99,104,101,41,5,114,108,0,0, - 0,114,39,0,0,0,218,14,108,111,97,100,101,114,95,100, - 101,116,97,105,108,115,90,7,108,111,97,100,101,114,115,114, - 173,0,0,0,114,2,0,0,0,41,1,114,128,0,0,0, - 114,4,0,0,0,114,191,0,0,0,88,5,0,0,115,16, - 0,0,0,0,4,4,1,12,1,26,1,6,2,10,1,6, - 1,8,1,122,19,70,105,108,101,70,105,110,100,101,114,46, - 95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,0, - 0,1,0,0,0,2,0,0,0,67,0,0,0,115,10,0, - 0,0,100,1,124,0,95,0,100,2,83,0,41,3,122,31, - 73,110,118,97,108,105,100,97,116,101,32,116,104,101,32,100, - 105,114,101,99,116,111,114,121,32,109,116,105,109,101,46,114, - 96,0,0,0,78,41,1,114,26,1,0,0,41,1,114,108, + 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,2, + 0,0,0,67,0,0,0,115,10,0,0,0,100,1,124,0, + 95,0,100,2,83,0,41,3,122,31,73,110,118,97,108,105, + 100,97,116,101,32,116,104,101,32,100,105,114,101,99,116,111, + 114,121,32,109,116,105,109,101,46,114,96,0,0,0,78,41, + 1,114,26,1,0,0,41,1,114,108,0,0,0,114,2,0, + 0,0,114,2,0,0,0,114,4,0,0,0,114,11,1,0, + 0,102,5,0,0,115,2,0,0,0,0,2,122,28,70,105, + 108,101,70,105,110,100,101,114,46,105,110,118,97,108,105,100, + 97,116,101,95,99,97,99,104,101,115,99,2,0,0,0,0, + 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, + 42,0,0,0,124,0,160,0,124,1,161,1,125,2,124,2, + 100,1,107,8,114,26,100,1,103,0,102,2,83,0,124,2, + 106,1,124,2,106,2,112,38,103,0,102,2,83,0,41,2, + 122,197,84,114,121,32,116,111,32,102,105,110,100,32,97,32, + 108,111,97,100,101,114,32,102,111,114,32,116,104,101,32,115, + 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,44, + 32,111,114,32,116,104,101,32,110,97,109,101,115,112,97,99, + 101,10,32,32,32,32,32,32,32,32,112,97,99,107,97,103, + 101,32,112,111,114,116,105,111,110,115,46,32,82,101,116,117, + 114,110,115,32,40,108,111,97,100,101,114,44,32,108,105,115, + 116,45,111,102,45,112,111,114,116,105,111,110,115,41,46,10, + 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, + 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, + 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, + 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, + 32,32,32,32,32,32,32,78,41,3,114,187,0,0,0,114, + 128,0,0,0,114,163,0,0,0,41,3,114,108,0,0,0, + 114,127,0,0,0,114,171,0,0,0,114,2,0,0,0,114, + 2,0,0,0,114,4,0,0,0,114,125,0,0,0,108,5, + 0,0,115,8,0,0,0,0,7,10,1,8,1,8,1,122, + 22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100, + 95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,0, + 7,0,0,0,6,0,0,0,67,0,0,0,115,26,0,0, + 0,124,1,124,2,124,3,131,2,125,6,116,0,124,2,124, + 3,124,6,124,4,100,1,141,4,83,0,41,2,78,41,2, + 114,128,0,0,0,114,163,0,0,0,41,1,114,174,0,0, + 0,41,7,114,108,0,0,0,114,172,0,0,0,114,127,0, + 0,0,114,39,0,0,0,90,4,115,109,115,108,114,186,0, + 0,0,114,128,0,0,0,114,2,0,0,0,114,2,0,0, + 0,114,4,0,0,0,114,23,1,0,0,120,5,0,0,115, + 8,0,0,0,0,1,10,1,8,1,2,255,122,20,70,105, + 108,101,70,105,110,100,101,114,46,95,103,101,116,95,115,112, + 101,99,78,99,3,0,0,0,0,0,0,0,14,0,0,0, + 8,0,0,0,67,0,0,0,115,102,1,0,0,100,1,125, + 3,124,1,160,0,100,2,161,1,100,3,25,0,125,4,122, + 24,116,1,124,0,106,2,112,34,116,3,160,4,161,0,131, + 1,106,5,125,5,87,0,110,24,4,0,116,6,107,10,114, + 66,1,0,1,0,1,0,100,4,125,5,89,0,110,2,88, + 0,124,5,124,0,106,7,107,3,114,92,124,0,160,8,161, + 0,1,0,124,5,124,0,95,7,116,9,131,0,114,114,124, + 0,106,10,125,6,124,4,160,11,161,0,125,7,110,10,124, + 0,106,12,125,6,124,4,125,7,124,7,124,6,107,6,114, + 218,116,13,124,0,106,2,124,4,131,2,125,8,124,0,106, + 14,68,0,93,58,92,2,125,9,125,10,100,5,124,9,23, + 0,125,11,116,13,124,8,124,11,131,2,125,12,116,15,124, + 12,131,1,114,208,124,0,160,16,124,10,124,1,124,12,124, + 8,103,1,124,2,161,5,2,0,1,0,83,0,113,150,116, + 17,124,8,131,1,125,3,124,0,106,14,68,0,93,86,92, + 2,125,9,125,10,116,13,124,0,106,2,124,4,124,9,23, + 0,131,2,125,12,116,18,106,19,100,6,124,12,100,3,100, + 7,141,3,1,0,124,7,124,9,23,0,124,6,107,6,144, + 1,114,54,116,15,124,12,131,1,144,1,114,54,124,0,160, + 16,124,10,124,1,124,12,100,8,124,2,161,5,2,0,1, + 0,83,0,113,224,124,3,144,1,114,98,116,18,160,19,100, + 9,124,8,161,2,1,0,116,18,160,20,124,1,100,8,161, + 2,125,13,124,8,103,1,124,13,95,21,124,13,83,0,100, + 8,83,0,41,10,122,111,84,114,121,32,116,111,32,102,105, + 110,100,32,97,32,115,112,101,99,32,102,111,114,32,116,104, + 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, + 108,101,46,10,10,32,32,32,32,32,32,32,32,82,101,116, + 117,114,110,115,32,116,104,101,32,109,97,116,99,104,105,110, + 103,32,115,112,101,99,44,32,111,114,32,78,111,110,101,32, + 105,102,32,110,111,116,32,102,111,117,110,100,46,10,32,32, + 32,32,32,32,32,32,70,114,63,0,0,0,114,23,0,0, + 0,114,96,0,0,0,114,191,0,0,0,122,9,116,114,121, + 105,110,103,32,123,125,41,1,90,9,118,101,114,98,111,115, + 105,116,121,78,122,25,112,111,115,115,105,98,108,101,32,110, + 97,109,101,115,112,97,99,101,32,102,111,114,32,123,125,41, + 22,114,36,0,0,0,114,43,0,0,0,114,39,0,0,0, + 114,1,0,0,0,114,49,0,0,0,114,235,0,0,0,114, + 44,0,0,0,114,26,1,0,0,218,11,95,102,105,108,108, + 95,99,97,99,104,101,114,5,0,0,0,114,29,1,0,0, + 114,97,0,0,0,114,28,1,0,0,114,33,0,0,0,114, + 25,1,0,0,114,48,0,0,0,114,23,1,0,0,114,50, + 0,0,0,114,122,0,0,0,114,136,0,0,0,114,167,0, + 0,0,114,163,0,0,0,41,14,114,108,0,0,0,114,127, + 0,0,0,114,186,0,0,0,90,12,105,115,95,110,97,109, + 101,115,112,97,99,101,90,11,116,97,105,108,95,109,111,100, + 117,108,101,114,155,0,0,0,90,5,99,97,99,104,101,90, + 12,99,97,99,104,101,95,109,111,100,117,108,101,90,9,98, + 97,115,101,95,112,97,116,104,114,241,0,0,0,114,172,0, + 0,0,90,13,105,110,105,116,95,102,105,108,101,110,97,109, + 101,90,9,102,117,108,108,95,112,97,116,104,114,171,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,187,0,0,0,125,5,0,0,115,74,0,0,0,0,5, + 4,1,14,1,2,1,24,1,14,1,10,1,10,1,8,1, + 6,2,6,1,6,1,10,2,6,1,4,2,8,1,12,1, + 14,1,8,1,10,1,8,1,26,4,8,2,14,1,16,1, + 16,1,14,1,10,1,10,1,2,0,2,255,10,2,6,1, + 12,1,12,1,8,1,4,1,122,20,70,105,108,101,70,105, + 110,100,101,114,46,102,105,110,100,95,115,112,101,99,99,1, + 0,0,0,0,0,0,0,9,0,0,0,10,0,0,0,67, + 0,0,0,115,190,0,0,0,124,0,106,0,125,1,122,22, + 116,1,160,2,124,1,112,22,116,1,160,3,161,0,161,1, + 125,2,87,0,110,30,4,0,116,4,116,5,116,6,102,3, + 107,10,114,58,1,0,1,0,1,0,103,0,125,2,89,0, + 110,2,88,0,116,7,106,8,160,9,100,1,161,1,115,84, + 116,10,124,2,131,1,124,0,95,11,110,74,116,10,131,0, + 125,3,124,2,68,0,93,56,125,4,124,4,160,12,100,2, + 161,1,92,3,125,5,125,6,125,7,124,6,114,136,100,3, + 160,13,124,5,124,7,160,14,161,0,161,2,125,8,110,4, + 124,5,125,8,124,3,160,15,124,8,161,1,1,0,113,94, + 124,3,124,0,95,11,116,7,106,8,160,9,116,16,161,1, + 114,186,100,4,100,5,132,0,124,2,68,0,131,1,124,0, + 95,17,100,6,83,0,41,7,122,68,70,105,108,108,32,116, + 104,101,32,99,97,99,104,101,32,111,102,32,112,111,116,101, + 110,116,105,97,108,32,109,111,100,117,108,101,115,32,97,110, + 100,32,112,97,99,107,97,103,101,115,32,102,111,114,32,116, + 104,105,115,32,100,105,114,101,99,116,111,114,121,46,114,0, + 0,0,0,114,63,0,0,0,122,5,123,125,46,123,125,99, + 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, + 83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,125, + 1,124,1,160,0,161,0,146,2,113,4,83,0,114,2,0, + 0,0,41,1,114,97,0,0,0,41,2,114,27,0,0,0, + 90,2,102,110,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,218,9,60,115,101,116,99,111,109,112,62,202,5, + 0,0,115,4,0,0,0,6,0,2,0,122,41,70,105,108, + 101,70,105,110,100,101,114,46,95,102,105,108,108,95,99,97, + 99,104,101,46,60,108,111,99,97,108,115,62,46,60,115,101, + 116,99,111,109,112,62,78,41,18,114,39,0,0,0,114,1, + 0,0,0,114,232,0,0,0,114,49,0,0,0,114,229,0, + 0,0,218,15,80,101,114,109,105,115,115,105,111,110,69,114, + 114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,111, + 114,121,69,114,114,111,114,114,6,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,27,1,0,0,114,28,1,0,0, + 114,92,0,0,0,114,54,0,0,0,114,97,0,0,0,218, + 3,97,100,100,114,9,0,0,0,114,29,1,0,0,41,9, + 114,108,0,0,0,114,39,0,0,0,114,233,0,0,0,90, + 21,108,111,119,101,114,95,115,117,102,102,105,120,95,99,111, + 110,116,101,110,116,115,114,6,1,0,0,114,106,0,0,0, + 114,253,0,0,0,114,241,0,0,0,90,8,110,101,119,95, + 110,97,109,101,114,2,0,0,0,114,2,0,0,0,114,4, + 0,0,0,114,31,1,0,0,173,5,0,0,115,34,0,0, + 0,0,2,6,1,2,1,22,1,20,3,10,3,12,1,12, + 7,6,1,8,1,16,1,4,1,18,2,4,1,12,1,6, + 1,12,1,122,22,70,105,108,101,70,105,110,100,101,114,46, + 95,102,105,108,108,95,99,97,99,104,101,99,1,0,0,0, + 0,0,0,0,3,0,0,0,3,0,0,0,7,0,0,0, + 115,18,0,0,0,135,0,135,1,102,2,100,1,100,2,132, + 8,125,2,124,2,83,0,41,3,97,20,1,0,0,65,32, + 99,108,97,115,115,32,109,101,116,104,111,100,32,119,104,105, + 99,104,32,114,101,116,117,114,110,115,32,97,32,99,108,111, + 115,117,114,101,32,116,111,32,117,115,101,32,111,110,32,115, + 121,115,46,112,97,116,104,95,104,111,111,107,10,32,32,32, + 32,32,32,32,32,119,104,105,99,104,32,119,105,108,108,32, + 114,101,116,117,114,110,32,97,110,32,105,110,115,116,97,110, + 99,101,32,117,115,105,110,103,32,116,104,101,32,115,112,101, + 99,105,102,105,101,100,32,108,111,97,100,101,114,115,32,97, + 110,100,32,116,104,101,32,112,97,116,104,10,32,32,32,32, + 32,32,32,32,99,97,108,108,101,100,32,111,110,32,116,104, + 101,32,99,108,111,115,117,114,101,46,10,10,32,32,32,32, + 32,32,32,32,73,102,32,116,104,101,32,112,97,116,104,32, + 99,97,108,108,101,100,32,111,110,32,116,104,101,32,99,108, + 111,115,117,114,101,32,105,115,32,110,111,116,32,97,32,100, + 105,114,101,99,116,111,114,121,44,32,73,109,112,111,114,116, + 69,114,114,111,114,32,105,115,10,32,32,32,32,32,32,32, + 32,114,97,105,115,101,100,46,10,10,32,32,32,32,32,32, + 32,32,99,1,0,0,0,0,0,0,0,1,0,0,0,4, + 0,0,0,19,0,0,0,115,34,0,0,0,116,0,124,0, + 131,1,115,20,116,1,100,1,124,0,100,2,141,2,130,1, + 136,0,124,0,102,1,136,1,158,2,142,0,83,0,41,3, + 122,45,80,97,116,104,32,104,111,111,107,32,102,111,114,32, + 105,109,112,111,114,116,108,105,98,46,109,97,99,104,105,110, + 101,114,121,46,70,105,108,101,70,105,110,100,101,114,46,122, + 30,111,110,108,121,32,100,105,114,101,99,116,111,114,105,101, + 115,32,97,114,101,32,115,117,112,112,111,114,116,101,100,41, + 1,114,39,0,0,0,41,2,114,50,0,0,0,114,107,0, + 0,0,41,1,114,39,0,0,0,41,2,114,177,0,0,0, + 114,30,1,0,0,114,2,0,0,0,114,4,0,0,0,218, + 24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, + 105,108,101,70,105,110,100,101,114,214,5,0,0,115,6,0, + 0,0,0,2,8,1,12,1,122,54,70,105,108,101,70,105, + 110,100,101,114,46,112,97,116,104,95,104,111,111,107,46,60, + 108,111,99,97,108,115,62,46,112,97,116,104,95,104,111,111, + 107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,114, + 114,2,0,0,0,41,3,114,177,0,0,0,114,30,1,0, + 0,114,36,1,0,0,114,2,0,0,0,41,2,114,177,0, + 0,0,114,30,1,0,0,114,4,0,0,0,218,9,112,97, + 116,104,95,104,111,111,107,204,5,0,0,115,4,0,0,0, + 0,10,14,6,122,20,70,105,108,101,70,105,110,100,101,114, + 46,112,97,116,104,95,104,111,111,107,99,1,0,0,0,0, + 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, + 12,0,0,0,100,1,160,0,124,0,106,1,161,1,83,0, + 41,2,78,122,16,70,105,108,101,70,105,110,100,101,114,40, + 123,33,114,125,41,41,2,114,54,0,0,0,114,39,0,0, + 0,41,1,114,108,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,114,5,1,0,0,222,5,0,0, + 115,2,0,0,0,0,1,122,19,70,105,108,101,70,105,110, + 100,101,114,46,95,95,114,101,112,114,95,95,41,1,78,41, + 15,114,113,0,0,0,114,112,0,0,0,114,114,0,0,0, + 114,115,0,0,0,114,191,0,0,0,114,11,1,0,0,114, + 131,0,0,0,114,188,0,0,0,114,125,0,0,0,114,23, + 1,0,0,114,187,0,0,0,114,31,1,0,0,114,189,0, + 0,0,114,37,1,0,0,114,5,1,0,0,114,2,0,0, + 0,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,24,1,0,0,79,5,0,0,115,22,0,0,0,8,7, + 4,2,8,14,8,4,4,2,8,12,8,5,10,48,8,31, + 2,1,10,17,114,24,1,0,0,99,4,0,0,0,0,0, + 0,0,6,0,0,0,8,0,0,0,67,0,0,0,115,146, + 0,0,0,124,0,160,0,100,1,161,1,125,4,124,0,160, + 0,100,2,161,1,125,5,124,4,115,66,124,5,114,36,124, + 5,106,1,125,4,110,30,124,2,124,3,107,2,114,56,116, + 2,124,1,124,2,131,2,125,4,110,10,116,3,124,1,124, + 2,131,2,125,4,124,5,115,84,116,4,124,1,124,2,124, + 4,100,3,141,3,125,5,122,36,124,5,124,0,100,2,60, + 0,124,4,124,0,100,1,60,0,124,2,124,0,100,4,60, + 0,124,3,124,0,100,5,60,0,87,0,110,20,4,0,116, + 5,107,10,114,140,1,0,1,0,1,0,89,0,110,2,88, + 0,100,0,83,0,41,6,78,218,10,95,95,108,111,97,100, + 101,114,95,95,218,8,95,95,115,112,101,99,95,95,41,1, + 114,128,0,0,0,90,8,95,95,102,105,108,101,95,95,90, + 10,95,95,99,97,99,104,101,100,95,95,41,6,218,3,103, + 101,116,114,128,0,0,0,114,239,0,0,0,114,234,0,0, + 0,114,174,0,0,0,218,9,69,120,99,101,112,116,105,111, + 110,41,6,90,2,110,115,114,106,0,0,0,90,8,112,97, + 116,104,110,97,109,101,90,9,99,112,97,116,104,110,97,109, + 101,114,128,0,0,0,114,171,0,0,0,114,2,0,0,0, + 114,2,0,0,0,114,4,0,0,0,218,14,95,102,105,120, + 95,117,112,95,109,111,100,117,108,101,228,5,0,0,115,34, + 0,0,0,0,2,10,1,10,1,4,1,4,1,8,1,8, + 1,12,2,10,1,4,1,14,1,2,1,8,1,8,1,8, + 1,12,1,14,2,114,42,1,0,0,99,0,0,0,0,0, + 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, + 38,0,0,0,116,0,116,1,160,2,161,0,102,2,125,0, + 116,3,116,4,102,2,125,1,116,5,116,6,102,2,125,2, + 124,0,124,1,124,2,103,3,83,0,41,1,122,95,82,101, + 116,117,114,110,115,32,97,32,108,105,115,116,32,111,102,32, + 102,105,108,101,45,98,97,115,101,100,32,109,111,100,117,108, + 101,32,108,111,97,100,101,114,115,46,10,10,32,32,32,32, + 69,97,99,104,32,105,116,101,109,32,105,115,32,97,32,116, + 117,112,108,101,32,40,108,111,97,100,101,114,44,32,115,117, + 102,102,105,120,101,115,41,46,10,32,32,32,32,41,7,114, + 240,0,0,0,114,149,0,0,0,218,18,101,120,116,101,110, + 115,105,111,110,95,115,117,102,102,105,120,101,115,114,234,0, + 0,0,114,93,0,0,0,114,239,0,0,0,114,80,0,0, + 0,41,3,90,10,101,120,116,101,110,115,105,111,110,115,90, + 6,115,111,117,114,99,101,90,8,98,121,116,101,99,111,100, + 101,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0, + 114,168,0,0,0,251,5,0,0,115,8,0,0,0,0,5, + 12,1,8,1,8,1,114,168,0,0,0,99,1,0,0,0, + 0,0,0,0,12,0,0,0,9,0,0,0,67,0,0,0, + 115,178,1,0,0,124,0,97,0,116,0,106,1,97,1,116, + 0,106,2,97,2,116,1,106,3,116,4,25,0,125,1,100, + 1,68,0,93,48,125,2,124,2,116,1,106,3,107,7,114, + 56,116,0,160,5,124,2,161,1,125,3,110,10,116,1,106, + 3,124,2,25,0,125,3,116,6,124,1,124,2,124,3,131, + 3,1,0,113,30,100,2,100,3,103,1,102,2,100,4,100, + 5,100,3,103,2,102,2,102,2,125,4,124,4,68,0,93, + 110,92,2,125,5,125,6,116,7,100,6,100,7,132,0,124, + 6,68,0,131,1,131,1,115,136,116,8,130,1,124,6,100, + 8,25,0,125,7,124,5,116,1,106,3,107,6,114,170,116, + 1,106,3,124,5,25,0,125,8,1,0,113,226,113,106,122, + 20,116,0,160,5,124,5,161,1,125,8,87,0,1,0,113, + 226,87,0,113,106,4,0,116,9,107,10,114,214,1,0,1, + 0,1,0,89,0,113,106,89,0,113,106,88,0,113,106,116, + 9,100,9,131,1,130,1,116,6,124,1,100,10,124,8,131, + 3,1,0,116,6,124,1,100,11,124,7,131,3,1,0,116, + 6,124,1,100,12,100,13,160,10,124,6,161,1,131,3,1, + 0,116,6,124,1,100,14,100,15,100,16,132,0,124,6,68, + 0,131,1,131,3,1,0,116,0,160,5,100,17,161,1,125, + 9,116,6,124,1,100,17,124,9,131,3,1,0,116,0,160, + 5,100,18,161,1,125,10,116,6,124,1,100,18,124,10,131, + 3,1,0,124,5,100,4,107,2,144,1,114,110,116,0,160, + 5,100,19,161,1,125,11,116,6,124,1,100,20,124,11,131, + 3,1,0,116,6,124,1,100,21,116,11,131,0,131,3,1, + 0,116,12,160,13,116,2,160,14,161,0,161,1,1,0,124, + 5,100,4,107,2,144,1,114,174,116,15,160,16,100,22,161, + 1,1,0,100,23,116,12,107,6,144,1,114,174,100,24,116, + 17,95,18,100,25,83,0,41,26,122,205,83,101,116,117,112, + 32,116,104,101,32,112,97,116,104,45,98,97,115,101,100,32, + 105,109,112,111,114,116,101,114,115,32,102,111,114,32,105,109, + 112,111,114,116,108,105,98,32,98,121,32,105,109,112,111,114, + 116,105,110,103,32,110,101,101,100,101,100,10,32,32,32,32, + 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,115, + 32,97,110,100,32,105,110,106,101,99,116,105,110,103,32,116, + 104,101,109,32,105,110,116,111,32,116,104,101,32,103,108,111, + 98,97,108,32,110,97,109,101,115,112,97,99,101,46,10,10, + 32,32,32,32,79,116,104,101,114,32,99,111,109,112,111,110, + 101,110,116,115,32,97,114,101,32,101,120,116,114,97,99,116, + 101,100,32,102,114,111,109,32,116,104,101,32,99,111,114,101, + 32,98,111,111,116,115,116,114,97,112,32,109,111,100,117,108, + 101,46,10,10,32,32,32,32,41,4,114,56,0,0,0,114, + 66,0,0,0,218,8,98,117,105,108,116,105,110,115,114,146, + 0,0,0,90,5,112,111,115,105,120,250,1,47,90,2,110, + 116,250,1,92,99,1,0,0,0,0,0,0,0,2,0,0, + 0,3,0,0,0,115,0,0,0,115,26,0,0,0,124,0, + 93,18,125,1,116,0,124,1,131,1,100,0,107,2,86,0, + 1,0,113,2,100,1,83,0,41,2,114,34,0,0,0,78, + 41,1,114,18,0,0,0,41,2,114,27,0,0,0,114,86, 0,0,0,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,114,11,1,0,0,102,5,0,0,115,2,0,0,0, - 0,2,122,28,70,105,108,101,70,105,110,100,101,114,46,105, - 110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115, - 99,2,0,0,0,0,0,0,0,3,0,0,0,3,0,0, - 0,67,0,0,0,115,42,0,0,0,124,0,160,0,124,1, - 161,1,125,2,124,2,100,1,107,8,114,26,100,1,103,0, - 102,2,83,0,124,2,106,1,124,2,106,2,112,38,103,0, - 102,2,83,0,41,2,122,197,84,114,121,32,116,111,32,102, - 105,110,100,32,97,32,108,111,97,100,101,114,32,102,111,114, - 32,116,104,101,32,115,112,101,99,105,102,105,101,100,32,109, - 111,100,117,108,101,44,32,111,114,32,116,104,101,32,110,97, - 109,101,115,112,97,99,101,10,32,32,32,32,32,32,32,32, - 112,97,99,107,97,103,101,32,112,111,114,116,105,111,110,115, - 46,32,82,101,116,117,114,110,115,32,40,108,111,97,100,101, - 114,44,32,108,105,115,116,45,111,102,45,112,111,114,116,105, - 111,110,115,41,46,10,10,32,32,32,32,32,32,32,32,84, - 104,105,115,32,109,101,116,104,111,100,32,105,115,32,100,101, - 112,114,101,99,97,116,101,100,46,32,32,85,115,101,32,102, - 105,110,100,95,115,112,101,99,40,41,32,105,110,115,116,101, - 97,100,46,10,10,32,32,32,32,32,32,32,32,78,41,3, - 114,187,0,0,0,114,128,0,0,0,114,163,0,0,0,41, - 3,114,108,0,0,0,114,127,0,0,0,114,171,0,0,0, - 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,114, - 125,0,0,0,108,5,0,0,115,8,0,0,0,0,7,10, - 1,8,1,8,1,122,22,70,105,108,101,70,105,110,100,101, - 114,46,102,105,110,100,95,108,111,97,100,101,114,99,6,0, - 0,0,0,0,0,0,7,0,0,0,6,0,0,0,67,0, - 0,0,115,26,0,0,0,124,1,124,2,124,3,131,2,125, - 6,116,0,124,2,124,3,124,6,124,4,100,1,141,4,83, - 0,41,2,78,41,2,114,128,0,0,0,114,163,0,0,0, - 41,1,114,174,0,0,0,41,7,114,108,0,0,0,114,172, - 0,0,0,114,127,0,0,0,114,39,0,0,0,90,4,115, - 109,115,108,114,186,0,0,0,114,128,0,0,0,114,2,0, - 0,0,114,2,0,0,0,114,4,0,0,0,114,23,1,0, - 0,120,5,0,0,115,8,0,0,0,0,1,10,1,8,1, - 2,255,122,20,70,105,108,101,70,105,110,100,101,114,46,95, - 103,101,116,95,115,112,101,99,78,99,3,0,0,0,0,0, - 0,0,14,0,0,0,8,0,0,0,67,0,0,0,115,102, - 1,0,0,100,1,125,3,124,1,160,0,100,2,161,1,100, - 3,25,0,125,4,122,24,116,1,124,0,106,2,112,34,116, - 3,160,4,161,0,131,1,106,5,125,5,87,0,110,24,4, - 0,116,6,107,10,114,66,1,0,1,0,1,0,100,4,125, - 5,89,0,110,2,88,0,124,5,124,0,106,7,107,3,114, - 92,124,0,160,8,161,0,1,0,124,5,124,0,95,7,116, - 9,131,0,114,114,124,0,106,10,125,6,124,4,160,11,161, - 0,125,7,110,10,124,0,106,12,125,6,124,4,125,7,124, - 7,124,6,107,6,114,218,116,13,124,0,106,2,124,4,131, - 2,125,8,124,0,106,14,68,0,93,58,92,2,125,9,125, - 10,100,5,124,9,23,0,125,11,116,13,124,8,124,11,131, - 2,125,12,116,15,124,12,131,1,114,208,124,0,160,16,124, - 10,124,1,124,12,124,8,103,1,124,2,161,5,2,0,1, - 0,83,0,113,150,116,17,124,8,131,1,125,3,124,0,106, - 14,68,0,93,86,92,2,125,9,125,10,116,13,124,0,106, - 2,124,4,124,9,23,0,131,2,125,12,116,18,106,19,100, - 6,124,12,100,3,100,7,141,3,1,0,124,7,124,9,23, - 0,124,6,107,6,144,1,114,54,116,15,124,12,131,1,144, - 1,114,54,124,0,160,16,124,10,124,1,124,12,100,8,124, - 2,161,5,2,0,1,0,83,0,113,224,124,3,144,1,114, - 98,116,18,160,19,100,9,124,8,161,2,1,0,116,18,160, - 20,124,1,100,8,161,2,125,13,124,8,103,1,124,13,95, - 21,124,13,83,0,100,8,83,0,41,10,122,111,84,114,121, - 32,116,111,32,102,105,110,100,32,97,32,115,112,101,99,32, - 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, - 100,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, - 32,32,32,82,101,116,117,114,110,115,32,116,104,101,32,109, - 97,116,99,104,105,110,103,32,115,112,101,99,44,32,111,114, - 32,78,111,110,101,32,105,102,32,110,111,116,32,102,111,117, - 110,100,46,10,32,32,32,32,32,32,32,32,70,114,63,0, - 0,0,114,23,0,0,0,114,96,0,0,0,114,191,0,0, - 0,122,9,116,114,121,105,110,103,32,123,125,41,1,90,9, - 118,101,114,98,111,115,105,116,121,78,122,25,112,111,115,115, - 105,98,108,101,32,110,97,109,101,115,112,97,99,101,32,102, - 111,114,32,123,125,41,22,114,36,0,0,0,114,43,0,0, - 0,114,39,0,0,0,114,1,0,0,0,114,49,0,0,0, - 114,235,0,0,0,114,44,0,0,0,114,26,1,0,0,218, - 11,95,102,105,108,108,95,99,97,99,104,101,114,5,0,0, - 0,114,29,1,0,0,114,97,0,0,0,114,28,1,0,0, - 114,33,0,0,0,114,25,1,0,0,114,48,0,0,0,114, - 23,1,0,0,114,50,0,0,0,114,122,0,0,0,114,136, - 0,0,0,114,167,0,0,0,114,163,0,0,0,41,14,114, - 108,0,0,0,114,127,0,0,0,114,186,0,0,0,90,12, - 105,115,95,110,97,109,101,115,112,97,99,101,90,11,116,97, - 105,108,95,109,111,100,117,108,101,114,155,0,0,0,90,5, - 99,97,99,104,101,90,12,99,97,99,104,101,95,109,111,100, - 117,108,101,90,9,98,97,115,101,95,112,97,116,104,114,241, - 0,0,0,114,172,0,0,0,90,13,105,110,105,116,95,102, - 105,108,101,110,97,109,101,90,9,102,117,108,108,95,112,97, - 116,104,114,171,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,187,0,0,0,125,5,0,0,115, - 74,0,0,0,0,5,4,1,14,1,2,1,24,1,14,1, - 10,1,10,1,8,1,6,2,6,1,6,1,10,2,6,1, - 4,2,8,1,12,1,14,1,8,1,10,1,8,1,26,4, - 8,2,14,1,16,1,16,1,14,1,10,1,10,1,2,0, - 2,255,10,2,6,1,12,1,12,1,8,1,4,1,122,20, - 70,105,108,101,70,105,110,100,101,114,46,102,105,110,100,95, - 115,112,101,99,99,1,0,0,0,0,0,0,0,9,0,0, - 0,10,0,0,0,67,0,0,0,115,190,0,0,0,124,0, - 106,0,125,1,122,22,116,1,160,2,124,1,112,22,116,1, - 160,3,161,0,161,1,125,2,87,0,110,30,4,0,116,4, - 116,5,116,6,102,3,107,10,114,58,1,0,1,0,1,0, - 103,0,125,2,89,0,110,2,88,0,116,7,106,8,160,9, - 100,1,161,1,115,84,116,10,124,2,131,1,124,0,95,11, - 110,74,116,10,131,0,125,3,124,2,68,0,93,56,125,4, - 124,4,160,12,100,2,161,1,92,3,125,5,125,6,125,7, - 124,6,114,136,100,3,160,13,124,5,124,7,160,14,161,0, - 161,2,125,8,110,4,124,5,125,8,124,3,160,15,124,8, - 161,1,1,0,113,94,124,3,124,0,95,11,116,7,106,8, - 160,9,116,16,161,1,114,186,100,4,100,5,132,0,124,2, - 68,0,131,1,124,0,95,17,100,6,83,0,41,7,122,68, - 70,105,108,108,32,116,104,101,32,99,97,99,104,101,32,111, - 102,32,112,111,116,101,110,116,105,97,108,32,109,111,100,117, - 108,101,115,32,97,110,100,32,112,97,99,107,97,103,101,115, - 32,102,111,114,32,116,104,105,115,32,100,105,114,101,99,116, - 111,114,121,46,114,0,0,0,0,114,63,0,0,0,122,5, - 123,125,46,123,125,99,1,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,83,0,0,0,115,20,0,0,0,104, - 0,124,0,93,12,125,1,124,1,160,0,161,0,146,2,113, - 4,83,0,114,2,0,0,0,41,1,114,97,0,0,0,41, - 2,114,27,0,0,0,90,2,102,110,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,218,9,60,115,101,116,99, - 111,109,112,62,202,5,0,0,115,4,0,0,0,6,0,2, - 0,122,41,70,105,108,101,70,105,110,100,101,114,46,95,102, - 105,108,108,95,99,97,99,104,101,46,60,108,111,99,97,108, - 115,62,46,60,115,101,116,99,111,109,112,62,78,41,18,114, - 39,0,0,0,114,1,0,0,0,114,232,0,0,0,114,49, - 0,0,0,114,229,0,0,0,218,15,80,101,114,109,105,115, - 115,105,111,110,69,114,114,111,114,218,18,78,111,116,65,68, - 105,114,101,99,116,111,114,121,69,114,114,111,114,114,6,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,27,1,0, - 0,114,28,1,0,0,114,92,0,0,0,114,54,0,0,0, - 114,97,0,0,0,218,3,97,100,100,114,9,0,0,0,114, - 29,1,0,0,41,9,114,108,0,0,0,114,39,0,0,0, - 114,233,0,0,0,90,21,108,111,119,101,114,95,115,117,102, - 102,105,120,95,99,111,110,116,101,110,116,115,114,6,1,0, - 0,114,106,0,0,0,114,253,0,0,0,114,241,0,0,0, - 90,8,110,101,119,95,110,97,109,101,114,2,0,0,0,114, - 2,0,0,0,114,4,0,0,0,114,31,1,0,0,173,5, - 0,0,115,34,0,0,0,0,2,6,1,2,1,22,1,20, - 3,10,3,12,1,12,7,6,1,8,1,16,1,4,1,18, - 2,4,1,12,1,6,1,12,1,122,22,70,105,108,101,70, - 105,110,100,101,114,46,95,102,105,108,108,95,99,97,99,104, - 101,99,1,0,0,0,0,0,0,0,3,0,0,0,3,0, - 0,0,7,0,0,0,115,18,0,0,0,135,0,135,1,102, - 2,100,1,100,2,132,8,125,2,124,2,83,0,41,3,97, - 20,1,0,0,65,32,99,108,97,115,115,32,109,101,116,104, - 111,100,32,119,104,105,99,104,32,114,101,116,117,114,110,115, - 32,97,32,99,108,111,115,117,114,101,32,116,111,32,117,115, - 101,32,111,110,32,115,121,115,46,112,97,116,104,95,104,111, - 111,107,10,32,32,32,32,32,32,32,32,119,104,105,99,104, - 32,119,105,108,108,32,114,101,116,117,114,110,32,97,110,32, - 105,110,115,116,97,110,99,101,32,117,115,105,110,103,32,116, - 104,101,32,115,112,101,99,105,102,105,101,100,32,108,111,97, - 100,101,114,115,32,97,110,100,32,116,104,101,32,112,97,116, - 104,10,32,32,32,32,32,32,32,32,99,97,108,108,101,100, - 32,111,110,32,116,104,101,32,99,108,111,115,117,114,101,46, - 10,10,32,32,32,32,32,32,32,32,73,102,32,116,104,101, - 32,112,97,116,104,32,99,97,108,108,101,100,32,111,110,32, - 116,104,101,32,99,108,111,115,117,114,101,32,105,115,32,110, - 111,116,32,97,32,100,105,114,101,99,116,111,114,121,44,32, - 73,109,112,111,114,116,69,114,114,111,114,32,105,115,10,32, - 32,32,32,32,32,32,32,114,97,105,115,101,100,46,10,10, - 32,32,32,32,32,32,32,32,99,1,0,0,0,0,0,0, - 0,1,0,0,0,4,0,0,0,19,0,0,0,115,34,0, - 0,0,116,0,124,0,131,1,115,20,116,1,100,1,124,0, - 100,2,141,2,130,1,136,0,124,0,102,1,136,1,158,2, - 142,0,83,0,41,3,122,45,80,97,116,104,32,104,111,111, - 107,32,102,111,114,32,105,109,112,111,114,116,108,105,98,46, - 109,97,99,104,105,110,101,114,121,46,70,105,108,101,70,105, - 110,100,101,114,46,122,30,111,110,108,121,32,100,105,114,101, - 99,116,111,114,105,101,115,32,97,114,101,32,115,117,112,112, - 111,114,116,101,100,41,1,114,39,0,0,0,41,2,114,50, - 0,0,0,114,107,0,0,0,41,1,114,39,0,0,0,41, - 2,114,177,0,0,0,114,30,1,0,0,114,2,0,0,0, - 114,4,0,0,0,218,24,112,97,116,104,95,104,111,111,107, - 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,214, - 5,0,0,115,6,0,0,0,0,2,8,1,12,1,122,54, - 70,105,108,101,70,105,110,100,101,114,46,112,97,116,104,95, - 104,111,111,107,46,60,108,111,99,97,108,115,62,46,112,97, - 116,104,95,104,111,111,107,95,102,111,114,95,70,105,108,101, - 70,105,110,100,101,114,114,2,0,0,0,41,3,114,177,0, - 0,0,114,30,1,0,0,114,36,1,0,0,114,2,0,0, - 0,41,2,114,177,0,0,0,114,30,1,0,0,114,4,0, - 0,0,218,9,112,97,116,104,95,104,111,111,107,204,5,0, - 0,115,4,0,0,0,0,10,14,6,122,20,70,105,108,101, - 70,105,110,100,101,114,46,112,97,116,104,95,104,111,111,107, - 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,12,0,0,0,100,1,160,0,124,0, - 106,1,161,1,83,0,41,2,78,122,16,70,105,108,101,70, - 105,110,100,101,114,40,123,33,114,125,41,41,2,114,54,0, - 0,0,114,39,0,0,0,41,1,114,108,0,0,0,114,2, - 0,0,0,114,2,0,0,0,114,4,0,0,0,114,5,1, - 0,0,222,5,0,0,115,2,0,0,0,0,1,122,19,70, - 105,108,101,70,105,110,100,101,114,46,95,95,114,101,112,114, - 95,95,41,1,78,41,15,114,113,0,0,0,114,112,0,0, - 0,114,114,0,0,0,114,115,0,0,0,114,191,0,0,0, - 114,11,1,0,0,114,131,0,0,0,114,188,0,0,0,114, - 125,0,0,0,114,23,1,0,0,114,187,0,0,0,114,31, - 1,0,0,114,189,0,0,0,114,37,1,0,0,114,5,1, - 0,0,114,2,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,24,1,0,0,79,5,0,0,115, - 20,0,0,0,8,7,4,2,8,14,8,4,4,2,8,12, - 8,5,10,48,8,31,12,18,114,24,1,0,0,99,4,0, - 0,0,0,0,0,0,6,0,0,0,8,0,0,0,67,0, - 0,0,115,146,0,0,0,124,0,160,0,100,1,161,1,125, - 4,124,0,160,0,100,2,161,1,125,5,124,4,115,66,124, - 5,114,36,124,5,106,1,125,4,110,30,124,2,124,3,107, - 2,114,56,116,2,124,1,124,2,131,2,125,4,110,10,116, - 3,124,1,124,2,131,2,125,4,124,5,115,84,116,4,124, - 1,124,2,124,4,100,3,141,3,125,5,122,36,124,5,124, - 0,100,2,60,0,124,4,124,0,100,1,60,0,124,2,124, - 0,100,4,60,0,124,3,124,0,100,5,60,0,87,0,110, - 20,4,0,116,5,107,10,114,140,1,0,1,0,1,0,89, - 0,110,2,88,0,100,0,83,0,41,6,78,218,10,95,95, - 108,111,97,100,101,114,95,95,218,8,95,95,115,112,101,99, - 95,95,41,1,114,128,0,0,0,90,8,95,95,102,105,108, - 101,95,95,90,10,95,95,99,97,99,104,101,100,95,95,41, - 6,218,3,103,101,116,114,128,0,0,0,114,239,0,0,0, - 114,234,0,0,0,114,174,0,0,0,218,9,69,120,99,101, - 112,116,105,111,110,41,6,90,2,110,115,114,106,0,0,0, - 90,8,112,97,116,104,110,97,109,101,90,9,99,112,97,116, - 104,110,97,109,101,114,128,0,0,0,114,171,0,0,0,114, - 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,14, - 95,102,105,120,95,117,112,95,109,111,100,117,108,101,228,5, - 0,0,115,34,0,0,0,0,2,10,1,10,1,4,1,4, - 1,8,1,8,1,12,2,10,1,4,1,14,1,2,1,8, - 1,8,1,8,1,12,1,14,2,114,42,1,0,0,99,0, - 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, - 0,0,0,115,38,0,0,0,116,0,116,1,160,2,161,0, - 102,2,125,0,116,3,116,4,102,2,125,1,116,5,116,6, - 102,2,125,2,124,0,124,1,124,2,103,3,83,0,41,1, - 122,95,82,101,116,117,114,110,115,32,97,32,108,105,115,116, - 32,111,102,32,102,105,108,101,45,98,97,115,101,100,32,109, - 111,100,117,108,101,32,108,111,97,100,101,114,115,46,10,10, - 32,32,32,32,69,97,99,104,32,105,116,101,109,32,105,115, - 32,97,32,116,117,112,108,101,32,40,108,111,97,100,101,114, - 44,32,115,117,102,102,105,120,101,115,41,46,10,32,32,32, - 32,41,7,114,240,0,0,0,114,149,0,0,0,218,18,101, - 120,116,101,110,115,105,111,110,95,115,117,102,102,105,120,101, - 115,114,234,0,0,0,114,93,0,0,0,114,239,0,0,0, - 114,80,0,0,0,41,3,90,10,101,120,116,101,110,115,105, - 111,110,115,90,6,115,111,117,114,99,101,90,8,98,121,116, - 101,99,111,100,101,114,2,0,0,0,114,2,0,0,0,114, - 4,0,0,0,114,168,0,0,0,251,5,0,0,115,8,0, - 0,0,0,5,12,1,8,1,8,1,114,168,0,0,0,99, - 1,0,0,0,0,0,0,0,12,0,0,0,9,0,0,0, - 67,0,0,0,115,178,1,0,0,124,0,97,0,116,0,106, - 1,97,1,116,0,106,2,97,2,116,1,106,3,116,4,25, - 0,125,1,100,1,68,0,93,48,125,2,124,2,116,1,106, - 3,107,7,114,56,116,0,160,5,124,2,161,1,125,3,110, - 10,116,1,106,3,124,2,25,0,125,3,116,6,124,1,124, - 2,124,3,131,3,1,0,113,30,100,2,100,3,103,1,102, - 2,100,4,100,5,100,3,103,2,102,2,102,2,125,4,124, - 4,68,0,93,110,92,2,125,5,125,6,116,7,100,6,100, - 7,132,0,124,6,68,0,131,1,131,1,115,136,116,8,130, - 1,124,6,100,8,25,0,125,7,124,5,116,1,106,3,107, - 6,114,170,116,1,106,3,124,5,25,0,125,8,1,0,113, - 226,113,106,122,20,116,0,160,5,124,5,161,1,125,8,87, - 0,1,0,113,226,87,0,113,106,4,0,116,9,107,10,114, - 214,1,0,1,0,1,0,89,0,113,106,89,0,113,106,88, - 0,113,106,116,9,100,9,131,1,130,1,116,6,124,1,100, - 10,124,8,131,3,1,0,116,6,124,1,100,11,124,7,131, - 3,1,0,116,6,124,1,100,12,100,13,160,10,124,6,161, - 1,131,3,1,0,116,6,124,1,100,14,100,15,100,16,132, - 0,124,6,68,0,131,1,131,3,1,0,116,0,160,5,100, - 17,161,1,125,9,116,6,124,1,100,17,124,9,131,3,1, - 0,116,0,160,5,100,18,161,1,125,10,116,6,124,1,100, - 18,124,10,131,3,1,0,124,5,100,4,107,2,144,1,114, - 110,116,0,160,5,100,19,161,1,125,11,116,6,124,1,100, - 20,124,11,131,3,1,0,116,6,124,1,100,21,116,11,131, - 0,131,3,1,0,116,12,160,13,116,2,160,14,161,0,161, - 1,1,0,124,5,100,4,107,2,144,1,114,174,116,15,160, - 16,100,22,161,1,1,0,100,23,116,12,107,6,144,1,114, - 174,100,24,116,17,95,18,100,25,83,0,41,26,122,205,83, - 101,116,117,112,32,116,104,101,32,112,97,116,104,45,98,97, - 115,101,100,32,105,109,112,111,114,116,101,114,115,32,102,111, - 114,32,105,109,112,111,114,116,108,105,98,32,98,121,32,105, - 109,112,111,114,116,105,110,103,32,110,101,101,100,101,100,10, - 32,32,32,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, - 110,103,32,116,104,101,109,32,105,110,116,111,32,116,104,101, - 32,103,108,111,98,97,108,32,110,97,109,101,115,112,97,99, - 101,46,10,10,32,32,32,32,79,116,104,101,114,32,99,111, - 109,112,111,110,101,110,116,115,32,97,114,101,32,101,120,116, - 114,97,99,116,101,100,32,102,114,111,109,32,116,104,101,32, - 99,111,114,101,32,98,111,111,116,115,116,114,97,112,32,109, - 111,100,117,108,101,46,10,10,32,32,32,32,41,4,114,56, - 0,0,0,114,66,0,0,0,218,8,98,117,105,108,116,105, - 110,115,114,146,0,0,0,90,5,112,111,115,105,120,250,1, - 47,90,2,110,116,250,1,92,99,1,0,0,0,0,0,0, - 0,2,0,0,0,3,0,0,0,115,0,0,0,115,26,0, - 0,0,124,0,93,18,125,1,116,0,124,1,131,1,100,0, - 107,2,86,0,1,0,113,2,100,1,83,0,41,2,114,34, - 0,0,0,78,41,1,114,18,0,0,0,41,2,114,27,0, - 0,0,114,86,0,0,0,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,243,0,0,0,31,6,0,0,115, - 4,0,0,0,4,0,2,0,122,25,95,115,101,116,117,112, - 46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,120, - 112,114,62,114,64,0,0,0,122,30,105,109,112,111,114,116, - 108,105,98,32,114,101,113,117,105,114,101,115,32,112,111,115, - 105,120,32,111,114,32,110,116,114,1,0,0,0,114,30,0, - 0,0,114,26,0,0,0,114,35,0,0,0,114,52,0,0, - 0,99,1,0,0,0,0,0,0,0,2,0,0,0,4,0, - 0,0,83,0,0,0,115,22,0,0,0,104,0,124,0,93, - 14,125,1,100,0,124,1,155,0,157,2,146,2,113,4,83, - 0,41,1,114,65,0,0,0,114,2,0,0,0,41,2,114, - 27,0,0,0,218,1,115,114,2,0,0,0,114,2,0,0, - 0,114,4,0,0,0,114,32,1,0,0,47,6,0,0,115, - 4,0,0,0,6,0,2,0,122,25,95,115,101,116,117,112, - 46,60,108,111,99,97,108,115,62,46,60,115,101,116,99,111, - 109,112,62,90,7,95,116,104,114,101,97,100,90,8,95,119, - 101,97,107,114,101,102,90,6,119,105,110,114,101,103,114,176, - 0,0,0,114,5,0,0,0,122,4,46,112,121,119,122,6, - 95,100,46,112,121,100,84,78,41,19,114,122,0,0,0,114, - 6,0,0,0,114,149,0,0,0,114,255,0,0,0,114,113, - 0,0,0,90,18,95,98,117,105,108,116,105,110,95,102,114, - 111,109,95,110,97,109,101,114,117,0,0,0,218,3,97,108, - 108,114,19,0,0,0,114,107,0,0,0,114,31,0,0,0, - 114,11,0,0,0,114,245,0,0,0,114,153,0,0,0,114, - 43,1,0,0,114,93,0,0,0,114,170,0,0,0,114,175, - 0,0,0,114,179,0,0,0,41,12,218,17,95,98,111,111, - 116,115,116,114,97,112,95,109,111,100,117,108,101,90,11,115, - 101,108,102,95,109,111,100,117,108,101,90,12,98,117,105,108, - 116,105,110,95,110,97,109,101,90,14,98,117,105,108,116,105, - 110,95,109,111,100,117,108,101,90,10,111,115,95,100,101,116, - 97,105,108,115,90,10,98,117,105,108,116,105,110,95,111,115, - 114,26,0,0,0,114,30,0,0,0,90,9,111,115,95,109, - 111,100,117,108,101,90,13,116,104,114,101,97,100,95,109,111, - 100,117,108,101,90,14,119,101,97,107,114,101,102,95,109,111, - 100,117,108,101,90,13,119,105,110,114,101,103,95,109,111,100, - 117,108,101,114,2,0,0,0,114,2,0,0,0,114,4,0, - 0,0,218,6,95,115,101,116,117,112,6,6,0,0,115,78, - 0,0,0,0,8,4,1,6,1,6,3,10,1,8,1,10, - 1,12,2,10,1,14,3,22,1,12,2,22,1,8,1,10, - 1,10,1,6,2,2,1,10,1,10,1,14,1,12,2,8, - 1,12,1,12,1,18,1,22,3,10,1,12,3,10,1,12, - 3,10,1,10,1,12,3,14,1,14,1,10,1,10,1,10, - 1,114,50,1,0,0,99,1,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,67,0,0,0,115,50,0,0,0, - 116,0,124,0,131,1,1,0,116,1,131,0,125,1,116,2, - 106,3,160,4,116,5,106,6,124,1,142,0,103,1,161,1, - 1,0,116,2,106,7,160,8,116,9,161,1,1,0,100,1, - 83,0,41,2,122,41,73,110,115,116,97,108,108,32,116,104, - 101,32,112,97,116,104,45,98,97,115,101,100,32,105,109,112, - 111,114,116,32,99,111,109,112,111,110,101,110,116,115,46,78, - 41,10,114,50,1,0,0,114,168,0,0,0,114,6,0,0, - 0,114,16,1,0,0,114,153,0,0,0,114,24,1,0,0, - 114,37,1,0,0,218,9,109,101,116,97,95,112,97,116,104, - 114,170,0,0,0,114,10,1,0,0,41,2,114,49,1,0, - 0,90,17,115,117,112,112,111,114,116,101,100,95,108,111,97, - 100,101,114,115,114,2,0,0,0,114,2,0,0,0,114,4, - 0,0,0,218,8,95,105,110,115,116,97,108,108,71,6,0, - 0,115,8,0,0,0,0,2,8,1,6,1,20,1,114,52, - 1,0,0,41,63,114,115,0,0,0,114,10,0,0,0,90, - 37,95,67,65,83,69,95,73,78,83,69,78,83,73,84,73, - 86,69,95,80,76,65,84,70,79,82,77,83,95,66,89,84, - 69,83,95,75,69,89,114,9,0,0,0,114,11,0,0,0, - 114,17,0,0,0,114,22,0,0,0,114,24,0,0,0,114, - 33,0,0,0,114,42,0,0,0,114,43,0,0,0,114,47, - 0,0,0,114,48,0,0,0,114,50,0,0,0,114,53,0, - 0,0,114,61,0,0,0,218,4,116,121,112,101,218,8,95, - 95,99,111,100,101,95,95,114,148,0,0,0,114,15,0,0, - 0,114,135,0,0,0,114,14,0,0,0,114,20,0,0,0, - 114,214,0,0,0,114,83,0,0,0,114,79,0,0,0,114, - 93,0,0,0,114,80,0,0,0,90,23,68,69,66,85,71, - 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, - 69,83,90,27,79,80,84,73,77,73,90,69,68,95,66,89, - 84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,114, - 89,0,0,0,114,94,0,0,0,114,100,0,0,0,114,103, - 0,0,0,114,105,0,0,0,114,124,0,0,0,114,131,0, - 0,0,114,139,0,0,0,114,143,0,0,0,114,145,0,0, - 0,114,151,0,0,0,114,156,0,0,0,114,157,0,0,0, - 114,162,0,0,0,218,6,111,98,106,101,99,116,114,169,0, - 0,0,114,174,0,0,0,114,175,0,0,0,114,190,0,0, - 0,114,200,0,0,0,114,217,0,0,0,114,234,0,0,0, - 114,239,0,0,0,114,245,0,0,0,114,240,0,0,0,114, - 246,0,0,0,114,8,1,0,0,114,10,1,0,0,114,24, - 1,0,0,114,42,1,0,0,114,168,0,0,0,114,50,1, - 0,0,114,52,1,0,0,114,2,0,0,0,114,2,0,0, - 0,114,2,0,0,0,114,4,0,0,0,218,8,60,109,111, - 100,117,108,101,62,8,0,0,0,115,126,0,0,0,4,15, - 4,1,4,1,2,1,2,255,4,4,8,17,8,5,8,5, - 8,6,8,6,8,12,8,10,8,9,8,5,8,7,8,9, - 12,22,10,127,0,7,16,1,12,2,4,1,4,2,6,2, - 6,2,8,2,18,71,8,40,8,19,8,12,8,12,8,28, - 8,17,8,33,8,28,8,24,16,13,14,10,12,11,8,14, - 6,3,6,1,2,255,12,68,14,64,14,29,16,127,0,17, - 14,68,18,45,18,26,4,3,18,53,14,60,14,42,14,127, - 0,7,14,127,0,22,12,23,8,11,8,65, + 0,0,114,243,0,0,0,31,6,0,0,115,4,0,0,0, + 4,0,2,0,122,25,95,115,101,116,117,112,46,60,108,111, + 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, + 64,0,0,0,122,30,105,109,112,111,114,116,108,105,98,32, + 114,101,113,117,105,114,101,115,32,112,111,115,105,120,32,111, + 114,32,110,116,114,1,0,0,0,114,30,0,0,0,114,26, + 0,0,0,114,35,0,0,0,114,52,0,0,0,99,1,0, + 0,0,0,0,0,0,2,0,0,0,4,0,0,0,83,0, + 0,0,115,22,0,0,0,104,0,124,0,93,14,125,1,100, + 0,124,1,155,0,157,2,146,2,113,4,83,0,41,1,114, + 65,0,0,0,114,2,0,0,0,41,2,114,27,0,0,0, + 218,1,115,114,2,0,0,0,114,2,0,0,0,114,4,0, + 0,0,114,32,1,0,0,47,6,0,0,115,4,0,0,0, + 6,0,2,0,122,25,95,115,101,116,117,112,46,60,108,111, + 99,97,108,115,62,46,60,115,101,116,99,111,109,112,62,90, + 7,95,116,104,114,101,97,100,90,8,95,119,101,97,107,114, + 101,102,90,6,119,105,110,114,101,103,114,176,0,0,0,114, + 5,0,0,0,122,4,46,112,121,119,122,6,95,100,46,112, + 121,100,84,78,41,19,114,122,0,0,0,114,6,0,0,0, + 114,149,0,0,0,114,255,0,0,0,114,113,0,0,0,90, + 18,95,98,117,105,108,116,105,110,95,102,114,111,109,95,110, + 97,109,101,114,117,0,0,0,218,3,97,108,108,114,19,0, + 0,0,114,107,0,0,0,114,31,0,0,0,114,11,0,0, + 0,114,245,0,0,0,114,153,0,0,0,114,43,1,0,0, + 114,93,0,0,0,114,170,0,0,0,114,175,0,0,0,114, + 179,0,0,0,41,12,218,17,95,98,111,111,116,115,116,114, + 97,112,95,109,111,100,117,108,101,90,11,115,101,108,102,95, + 109,111,100,117,108,101,90,12,98,117,105,108,116,105,110,95, + 110,97,109,101,90,14,98,117,105,108,116,105,110,95,109,111, + 100,117,108,101,90,10,111,115,95,100,101,116,97,105,108,115, + 90,10,98,117,105,108,116,105,110,95,111,115,114,26,0,0, + 0,114,30,0,0,0,90,9,111,115,95,109,111,100,117,108, + 101,90,13,116,104,114,101,97,100,95,109,111,100,117,108,101, + 90,14,119,101,97,107,114,101,102,95,109,111,100,117,108,101, + 90,13,119,105,110,114,101,103,95,109,111,100,117,108,101,114, + 2,0,0,0,114,2,0,0,0,114,4,0,0,0,218,6, + 95,115,101,116,117,112,6,6,0,0,115,78,0,0,0,0, + 8,4,1,6,1,6,3,10,1,8,1,10,1,12,2,10, + 1,14,3,22,1,12,2,22,1,8,1,10,1,10,1,6, + 2,2,1,10,1,10,1,14,1,12,2,8,1,12,1,12, + 1,18,1,22,3,10,1,12,3,10,1,12,3,10,1,10, + 1,12,3,14,1,14,1,10,1,10,1,10,1,114,50,1, + 0,0,99,1,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,67,0,0,0,115,50,0,0,0,116,0,124,0, + 131,1,1,0,116,1,131,0,125,1,116,2,106,3,160,4, + 116,5,106,6,124,1,142,0,103,1,161,1,1,0,116,2, + 106,7,160,8,116,9,161,1,1,0,100,1,83,0,41,2, + 122,41,73,110,115,116,97,108,108,32,116,104,101,32,112,97, + 116,104,45,98,97,115,101,100,32,105,109,112,111,114,116,32, + 99,111,109,112,111,110,101,110,116,115,46,78,41,10,114,50, + 1,0,0,114,168,0,0,0,114,6,0,0,0,114,16,1, + 0,0,114,153,0,0,0,114,24,1,0,0,114,37,1,0, + 0,218,9,109,101,116,97,95,112,97,116,104,114,170,0,0, + 0,114,10,1,0,0,41,2,114,49,1,0,0,90,17,115, + 117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,115, + 114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,218, + 8,95,105,110,115,116,97,108,108,71,6,0,0,115,8,0, + 0,0,0,2,8,1,6,1,20,1,114,52,1,0,0,41, + 63,114,115,0,0,0,114,10,0,0,0,90,37,95,67,65, + 83,69,95,73,78,83,69,78,83,73,84,73,86,69,95,80, + 76,65,84,70,79,82,77,83,95,66,89,84,69,83,95,75, + 69,89,114,9,0,0,0,114,11,0,0,0,114,17,0,0, + 0,114,22,0,0,0,114,24,0,0,0,114,33,0,0,0, + 114,42,0,0,0,114,43,0,0,0,114,47,0,0,0,114, + 48,0,0,0,114,50,0,0,0,114,53,0,0,0,114,61, + 0,0,0,218,4,116,121,112,101,218,8,95,95,99,111,100, + 101,95,95,114,148,0,0,0,114,15,0,0,0,114,135,0, + 0,0,114,14,0,0,0,114,20,0,0,0,114,214,0,0, + 0,114,83,0,0,0,114,79,0,0,0,114,93,0,0,0, + 114,80,0,0,0,90,23,68,69,66,85,71,95,66,89,84, + 69,67,79,68,69,95,83,85,70,70,73,88,69,83,90,27, + 79,80,84,73,77,73,90,69,68,95,66,89,84,69,67,79, + 68,69,95,83,85,70,70,73,88,69,83,114,89,0,0,0, + 114,94,0,0,0,114,100,0,0,0,114,103,0,0,0,114, + 105,0,0,0,114,124,0,0,0,114,131,0,0,0,114,139, + 0,0,0,114,143,0,0,0,114,145,0,0,0,114,151,0, + 0,0,114,156,0,0,0,114,157,0,0,0,114,162,0,0, + 0,218,6,111,98,106,101,99,116,114,169,0,0,0,114,174, + 0,0,0,114,175,0,0,0,114,190,0,0,0,114,200,0, + 0,0,114,217,0,0,0,114,234,0,0,0,114,239,0,0, + 0,114,245,0,0,0,114,240,0,0,0,114,246,0,0,0, + 114,8,1,0,0,114,10,1,0,0,114,24,1,0,0,114, + 42,1,0,0,114,168,0,0,0,114,50,1,0,0,114,52, + 1,0,0,114,2,0,0,0,114,2,0,0,0,114,2,0, + 0,0,114,4,0,0,0,218,8,60,109,111,100,117,108,101, + 62,8,0,0,0,115,126,0,0,0,4,15,4,1,4,1, + 2,1,2,255,4,4,8,17,8,5,8,5,8,6,8,6, + 8,12,8,10,8,9,8,5,8,7,8,9,12,22,10,127, + 0,7,16,1,12,2,4,1,4,2,6,2,6,2,8,2, + 18,71,8,40,8,19,8,12,8,12,8,28,8,17,8,33, + 8,28,8,24,16,13,14,10,12,11,8,14,6,3,6,1, + 2,255,12,68,14,64,14,29,16,127,0,17,14,68,18,45, + 18,26,4,3,18,53,14,60,14,42,14,127,0,7,14,127, + 0,22,12,23,8,11,8,65, }; From webhook-mailer at python.org Tue Oct 30 07:19:54 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 30 Oct 2018 11:19:54 -0000 Subject: [Python-checkins] bpo-33237: Improve AttributeError message for partially initialized module. (GH-6398) Message-ID: https://github.com/python/cpython/commit/3e429dcc242e48fa4cbb1a91cf7c416c37b97b4e commit: 3e429dcc242e48fa4cbb1a91cf7c416c37b97b4e branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-30T13:19:51+02:00 summary: bpo-33237: Improve AttributeError message for partially initialized module. (GH-6398) files: A Lib/test/test_import/data/circular_imports/source.py A Lib/test/test_import/data/circular_imports/use.py A Misc/NEWS.d/next/Core and Builtins/2018-07-24-12-54-57.bpo-33237.O95mps.rst M Include/moduleobject.h M Lib/test/test_import/__init__.py M Objects/moduleobject.c M Python/import.c diff --git a/Include/moduleobject.h b/Include/moduleobject.h index 1d8fe46dea03..4d173808738c 100644 --- a/Include/moduleobject.h +++ b/Include/moduleobject.h @@ -30,6 +30,7 @@ PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyModule_Clear(PyObject *); PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *); +PyAPI_FUNC(int) _PyModuleSpec_IsInitializing(PyObject *); #endif PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*); PyAPI_FUNC(void*) PyModule_GetState(PyObject*); diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index fb9453ad0b39..7306e0f7f722 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -1271,6 +1271,19 @@ def test_binding(self): except ImportError: self.fail('circular import with binding a submodule to a name failed') + def test_crossreference1(self): + import test.test_import.data.circular_imports.use + import test.test_import.data.circular_imports.source + + def test_crossreference2(self): + with self.assertRaises(AttributeError) as cm: + import test.test_import.data.circular_imports.source + errmsg = str(cm.exception) + self.assertIn('test.test_import.data.circular_imports.source', errmsg) + self.assertIn('spam', errmsg) + self.assertIn('partially initialized module', errmsg) + self.assertIn('circular import', errmsg) + if __name__ == '__main__': # Test needs to be a package, so we can do relative imports. diff --git a/Lib/test/test_import/data/circular_imports/source.py b/Lib/test/test_import/data/circular_imports/source.py new file mode 100644 index 000000000000..f104099048c5 --- /dev/null +++ b/Lib/test/test_import/data/circular_imports/source.py @@ -0,0 +1,2 @@ +from . import use +spam = 1 diff --git a/Lib/test/test_import/data/circular_imports/use.py b/Lib/test/test_import/data/circular_imports/use.py new file mode 100644 index 000000000000..418f9e2688e9 --- /dev/null +++ b/Lib/test/test_import/data/circular_imports/use.py @@ -0,0 +1,2 @@ +from . import source +source.spam diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-07-24-12-54-57.bpo-33237.O95mps.rst b/Misc/NEWS.d/next/Core and Builtins/2018-07-24-12-54-57.bpo-33237.O95mps.rst new file mode 100644 index 000000000000..04bd86c3dd6a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-07-24-12-54-57.bpo-33237.O95mps.rst @@ -0,0 +1 @@ +Improved :exc:`AttributeError` message for partially initialized module. diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index ccf5f8e6d15a..5181941ee7bc 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -698,6 +698,27 @@ module_repr(PyModuleObject *m) return PyObject_CallMethod(interp->importlib, "_module_repr", "O", m); } +/* Check if the "_initializing" attribute of the module spec is set to true. + Clear the exception and return 0 if spec is NULL. + */ +int +_PyModuleSpec_IsInitializing(PyObject *spec) +{ + if (spec != NULL) { + _Py_IDENTIFIER(_initializing); + PyObject *value = _PyObject_GetAttrId(spec, &PyId__initializing); + if (value != NULL) { + int initializing = PyObject_IsTrue(value); + Py_DECREF(value); + if (initializing >= 0) { + return initializing; + } + } + } + PyErr_Clear(); + return 0; +} + static PyObject* module_getattro(PyModuleObject *m, PyObject *name) { @@ -717,8 +738,24 @@ module_getattro(PyModuleObject *m, PyObject *name) _Py_IDENTIFIER(__name__); mod_name = _PyDict_GetItemId(m->md_dict, &PyId___name__); if (mod_name && PyUnicode_Check(mod_name)) { - PyErr_Format(PyExc_AttributeError, - "module '%U' has no attribute '%U'", mod_name, name); + _Py_IDENTIFIER(__spec__); + Py_INCREF(mod_name); + PyObject *spec = _PyDict_GetItemId(m->md_dict, &PyId___spec__); + Py_XINCREF(spec); + if (_PyModuleSpec_IsInitializing(spec)) { + PyErr_Format(PyExc_AttributeError, + "partially initialized " + "module '%U' has no attribute '%U' " + "(most likely due to a circular import)", + mod_name, name); + } + else { + PyErr_Format(PyExc_AttributeError, + "module '%U' has no attribute '%U'", + mod_name, name); + } + Py_XDECREF(spec); + Py_DECREF(mod_name); return NULL; } } diff --git a/Python/import.c b/Python/import.c index 1e8c07b0b245..e761f65c66ba 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1721,11 +1721,8 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, mod = PyImport_GetModule(abs_name); if (mod != NULL && mod != Py_None) { _Py_IDENTIFIER(__spec__); - _Py_IDENTIFIER(_initializing); _Py_IDENTIFIER(_lock_unlock_module); - PyObject *value = NULL; PyObject *spec; - int initializing = 0; /* Optimization: only call _bootstrap._lock_unlock_module() if __spec__._initializing is true. @@ -1733,26 +1730,17 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, stuffing the new module in sys.modules. */ spec = _PyObject_GetAttrId(mod, &PyId___spec__); - if (spec != NULL) { - value = _PyObject_GetAttrId(spec, &PyId__initializing); - Py_DECREF(spec); - } - if (value == NULL) - PyErr_Clear(); - else { - initializing = PyObject_IsTrue(value); - Py_DECREF(value); - if (initializing == -1) - PyErr_Clear(); - if (initializing > 0) { - value = _PyObject_CallMethodIdObjArgs(interp->importlib, - &PyId__lock_unlock_module, abs_name, - NULL); - if (value == NULL) - goto error; - Py_DECREF(value); + if (_PyModuleSpec_IsInitializing(spec)) { + PyObject *value = _PyObject_CallMethodIdObjArgs(interp->importlib, + &PyId__lock_unlock_module, abs_name, + NULL); + if (value == NULL) { + Py_DECREF(spec); + goto error; } + Py_DECREF(value); } + Py_XDECREF(spec); } else { Py_XDECREF(mod); From webhook-mailer at python.org Tue Oct 30 07:22:47 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 30 Oct 2018 11:22:47 -0000 Subject: [Python-checkins] bpo-31680: Add curses.ncurses_version. (GH-4217) Message-ID: https://github.com/python/cpython/commit/b232df9197a19e78d0e2a751e56e0e62547354ec commit: b232df9197a19e78d0e2a751e56e0e62547354ec branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-30T13:22:42+02:00 summary: bpo-31680: Add curses.ncurses_version. (GH-4217) Use curses.ncurses_version for conditionally skipping a test. files: A Misc/NEWS.d/next/Library/2017-11-01-15-44-48.bpo-31680.yO6oSC.rst M Doc/library/curses.rst M Doc/whatsnew/3.8.rst M Lib/test/test_curses.py M Modules/_cursesmodule.c diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index 2a2ee2be84af..2a4d9ce8a35a 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1291,6 +1291,19 @@ The :mod:`curses` module defines the following data members: A bytes object representing the current version of the module. Also available as :const:`__version__`. + +.. data:: ncurses_version + + A named tuple containing the three components of the ncurses library + version: *major*, *minor*, and *patch*. All values are integers. The + components can also be accessed by name, so ``curses.ncurses_version[0]`` + is equivalent to ``curses.ncurses_version.major`` and so on. + + Availability: if the ncurses library is used. + + .. versionadded:: 3.8 + + Some constants are available to specify character cell attributes. The exact constants available are system dependent. diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 758d32e6e55a..02391de0dbc0 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -152,6 +152,15 @@ now return ``False`` instead of raising :exc:`ValueError` or its subclasses characters or bytes unrepresentable at the OS level. (Contributed by Serhiy Storchaka in :issue:`33721`.) + +ncurses +------- + +Added a new variable holding structured version information for the +underlying ncurses library: :data:`~curses.ncurses_version`. +(Contributed by Serhiy Storchaka in :issue:`31680`.) + + pathlib ------- diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 3b442fe6a4b7..09738c8a41c9 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -368,9 +368,8 @@ def test_issue6243(self): self.stdscr.getkey() @requires_curses_func('unget_wch') - # XXX Remove the decorator when ncurses on OpenBSD be updated - @unittest.skipIf(sys.platform.startswith("openbsd"), - "OpenBSD's curses (v.5.7) has bugs") + @unittest.skipIf(getattr(curses, 'ncurses_version', (99,)) < (5, 8), + "unget_wch is broken in ncurses 5.7 and earlier") def test_unget_wch(self): stdscr = self.stdscr encoding = stdscr.encoding @@ -456,6 +455,23 @@ def test_update_lines_cols(self): # can be called. curses.update_lines_cols() + @requires_curses_func('ncurses_version') + def test_ncurses_version(self): + v = curses.ncurses_version + self.assertIsInstance(v[:], tuple) + self.assertEqual(len(v), 3) + self.assertIsInstance(v[0], int) + self.assertIsInstance(v[1], int) + self.assertIsInstance(v[2], int) + self.assertIsInstance(v.major, int) + self.assertIsInstance(v.minor, int) + self.assertIsInstance(v.patch, int) + self.assertEqual(v[0], v.major) + self.assertEqual(v[1], v.minor) + self.assertEqual(v[2], v.patch) + self.assertGreaterEqual(v.major, 0) + self.assertGreaterEqual(v.minor, 0) + self.assertGreaterEqual(v.patch, 0) class TestAscii(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2017-11-01-15-44-48.bpo-31680.yO6oSC.rst b/Misc/NEWS.d/next/Library/2017-11-01-15-44-48.bpo-31680.yO6oSC.rst new file mode 100644 index 000000000000..3cf33ac9bd63 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-11-01-15-44-48.bpo-31680.yO6oSC.rst @@ -0,0 +1 @@ +Added :data:`curses.ncurses_version`. diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index a728a24f6cae..c8f564a31dbd 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -4289,6 +4289,59 @@ _curses_use_default_colors_impl(PyObject *module) } #endif /* STRICT_SYSV_CURSES */ + +#ifdef NCURSES_VERSION + +PyDoc_STRVAR(ncurses_version__doc__, +"curses.ncurses_version\n\ +\n\ +Ncurses version information as a named tuple."); + +static PyTypeObject NcursesVersionType; + +static PyStructSequence_Field ncurses_version_fields[] = { + {"major", "Major release number"}, + {"minor", "Minor release number"}, + {"patch", "Patch release number"}, + {0} +}; + +static PyStructSequence_Desc ncurses_version_desc = { + "curses.ncurses_version", /* name */ + ncurses_version__doc__, /* doc */ + ncurses_version_fields, /* fields */ + 3 +}; + +static PyObject * +make_ncurses_version(void) +{ + PyObject *ncurses_version; + int pos = 0; + + ncurses_version = PyStructSequence_New(&NcursesVersionType); + if (ncurses_version == NULL) { + return NULL; + } + +#define SetIntItem(flag) \ + PyStructSequence_SET_ITEM(ncurses_version, pos++, PyLong_FromLong(flag)); \ + if (PyErr_Occurred()) { \ + Py_CLEAR(ncurses_version); \ + return NULL; \ + } + + SetIntItem(NCURSES_VERSION_MAJOR) + SetIntItem(NCURSES_VERSION_MINOR) + SetIntItem(NCURSES_VERSION_PATCH) +#undef SetIntItem + + return ncurses_version; +} + +#endif /* NCURSES_VERSION */ + + /* List of functions defined in the module */ static PyMethodDef PyCurses_methods[] = { @@ -4426,6 +4479,30 @@ PyInit__curses(void) PyDict_SetItemString(d, "__version__", v); Py_DECREF(v); +#ifdef NCURSES_VERSION + /* ncurses_version */ + if (NcursesVersionType.tp_name == NULL) { + if (PyStructSequence_InitType2(&NcursesVersionType, + &ncurses_version_desc) < 0) + return NULL; + } + v = make_ncurses_version(); + if (v == NULL) { + return NULL; + } + PyDict_SetItemString(d, "ncurses_version", v); + Py_DECREF(v); + + /* prevent user from creating new instances */ + NcursesVersionType.tp_init = NULL; + NcursesVersionType.tp_new = NULL; + if (PyDict_DelItemString(NcursesVersionType.tp_dict, "__new__") < 0 && + PyErr_ExceptionMatches(PyExc_KeyError)) + { + PyErr_Clear(); + } +#endif /* NCURSES_VERSION */ + SetDictInt("ERR", ERR); SetDictInt("OK", OK); From webhook-mailer at python.org Tue Oct 30 07:58:14 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 11:58:14 -0000 Subject: [Python-checkins] bpo-34523: Fix config_init_fs_encoding() for ASCII (GH-10232) Message-ID: https://github.com/python/cpython/commit/905f1ace5f7424e314ca7bed997868a2a3044839 commit: 905f1ace5f7424e314ca7bed997868a2a3044839 branch: master author: Victor Stinner committer: GitHub date: 2018-10-30T12:58:10+01:00 summary: bpo-34523: Fix config_init_fs_encoding() for ASCII (GH-10232) * bpo-34523, bpo-34403: Fix config_init_fs_encoding(): it now uses ASCII if _Py_GetForceASCII() is true. * Fix a regression of commit b2457efc78b74a1d6d1b77d11a939e886b8a4e2c. * Fix also a memory leak: get_locale_encoding() already allocates memory, no need to duplicate the string. files: M Include/coreconfig.h M Python/coreconfig.c diff --git a/Include/coreconfig.h b/Include/coreconfig.h index ef043ab02df6..83c4e7ee4dbe 100644 --- a/Include/coreconfig.h +++ b/Include/coreconfig.h @@ -75,6 +75,8 @@ typedef struct { highest priority; * PYTHONIOENCODING environment variable; * The UTF-8 Mode uses UTF-8/surrogateescape; + * If Python forces the usage of the ASCII encoding (ex: C locale + or POSIX locale on FreeBSD or HP-UX), use ASCII/surrogateescape; * locale encoding: ANSI code page on Windows, UTF-8 on Android, LC_CTYPE locale encoding on other platforms; * On Windows, "surrogateescape" error handler; diff --git a/Python/coreconfig.c b/Python/coreconfig.c index fae32e533aa9..a82175e4fd26 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1164,13 +1164,17 @@ config_init_fs_encoding(_PyCoreConfig *config) } } - /* Windows defaults to utf-8/surrogatepass (PEP 529) */ + /* Windows defaults to utf-8/surrogatepass (PEP 529). + + Note: UTF-8 Mode takes the same code path and the Legacy Windows FS + encoding has the priortiy over UTF-8 Mode. */ if (config->filesystem_encoding == NULL) { config->filesystem_encoding = _PyMem_RawStrdup("utf-8"); if (config->filesystem_encoding == NULL) { return _Py_INIT_NO_MEMORY(); } } + if (config->filesystem_errors == NULL) { config->filesystem_errors = _PyMem_RawStrdup("surrogatepass"); if (config->filesystem_errors == NULL) { @@ -1178,30 +1182,28 @@ config_init_fs_encoding(_PyCoreConfig *config) } } #else - if (config->utf8_mode) { - /* UTF-8 Mode use: utf-8/surrogateescape */ - if (config->filesystem_encoding == NULL) { + if (config->filesystem_encoding == NULL) { + if (config->utf8_mode) { + /* UTF-8 Mode use: utf-8/surrogateescape */ config->filesystem_encoding = _PyMem_RawStrdup("utf-8"); - if (config->filesystem_encoding == NULL) { - return _Py_INIT_NO_MEMORY(); - } + /* errors defaults to surrogateescape above */ } - /* errors defaults to surrogateescape above */ - } - - if (config->filesystem_encoding == NULL) { - /* macOS and Android use UTF-8, other platforms use - the locale encoding. */ - char *locale_encoding; + else if (_Py_GetForceASCII()) { + config->filesystem_encoding = _PyMem_RawStrdup("ascii"); + } + else { + /* macOS and Android use UTF-8, + other platforms use the locale encoding. */ #if defined(__APPLE__) || defined(__ANDROID__) - locale_encoding = "UTF-8"; + config->filesystem_encoding = _PyMem_RawStrdup("utf-8"); #else - _PyInitError err = get_locale_encoding(&locale_encoding); - if (_Py_INIT_FAILED(err)) { - return err; - } + _PyInitError err = get_locale_encoding(&config->filesystem_encoding); + if (_Py_INIT_FAILED(err)) { + return err; + } #endif - config->filesystem_encoding = _PyMem_RawStrdup(locale_encoding); + } + if (config->filesystem_encoding == NULL) { return _Py_INIT_NO_MEMORY(); } From webhook-mailer at python.org Tue Oct 30 07:59:24 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 11:59:24 -0000 Subject: [Python-checkins] bpo-34403: Fix initfsencoding() for ASCII (GH-10233) Message-ID: https://github.com/python/cpython/commit/21220bbe65108f5a763ead24a6b572f80d84c9e2 commit: 21220bbe65108f5a763ead24a6b572f80d84c9e2 branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-10-30T12:59:20+01:00 summary: bpo-34403: Fix initfsencoding() for ASCII (GH-10233) * Add _Py_GetForceASCII(): check if Python forces the usage of ASCII in Py_DecodeLocale() and Py_EncodeLocale(). * initfsencoding() now uses ASCII if _Py_GetForceASCII() is true. files: M Include/fileutils.h M Python/fileutils.c M Python/pylifecycle.c diff --git a/Include/fileutils.h b/Include/fileutils.h index c05ff43f5163..d75189a95c50 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -183,6 +183,10 @@ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( #endif /* Py_LIMITED_API */ +#ifdef Py_BUILD_CORE +PyAPI_FUNC(int) _Py_GetForceASCII(void); +#endif + #ifdef __cplusplus } #endif diff --git a/Python/fileutils.c b/Python/fileutils.c index e72ce543cb68..1b7e6697c74a 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -180,6 +180,18 @@ check_force_ascii(void) return 1; } + +int +_Py_GetForceASCII(void) +{ + if (force_ascii == -1) { + force_ascii = check_force_ascii(); + } + return force_ascii; +} + + + static int encode_ascii(const wchar_t *text, char **str, size_t *error_pos, const char **reason, diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index ba4b54864fd8..c01b21ffebad 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1615,6 +1615,10 @@ initfsencoding(PyInterpreterState *interp) Py_FileSystemDefaultEncoding = "utf-8"; Py_HasFileSystemDefaultEncoding = 1; } + else if (_Py_GetForceASCII()) { + Py_FileSystemDefaultEncoding = "ascii"; + Py_HasFileSystemDefaultEncoding = 1; + } else if (Py_FileSystemDefaultEncoding == NULL) { Py_FileSystemDefaultEncoding = get_locale_encoding(); if (Py_FileSystemDefaultEncoding == NULL) { From webhook-mailer at python.org Tue Oct 30 09:31:48 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 13:31:48 -0000 Subject: [Python-checkins] bpo-32030: Make _PySys_AddXOptionWithError() private (GH-10236) Message-ID: https://github.com/python/cpython/commit/e1b29950bf751381538e3c8ea6a3e0a98d01dbfb commit: e1b29950bf751381538e3c8ea6a3e0a98d01dbfb branch: master author: Victor Stinner committer: GitHub date: 2018-10-30T14:31:42+01:00 summary: bpo-32030: Make _PySys_AddXOptionWithError() private (GH-10236) Make _PySys_AddXOptionWithError() and _PySys_AddWarnOptionWithError() functions private again. They are no longer needed to initialize Python: _PySys_EndInit() is now responsible to add these options instead. Moreover, PySys_AddWarnOptionUnicode() now clears the exception on failure if possible. files: M Include/sysmodule.h M Python/sysmodule.c diff --git a/Include/sysmodule.h b/Include/sysmodule.h index 719ecfcf61f2..c5547ff6742e 100644 --- a/Include/sysmodule.h +++ b/Include/sysmodule.h @@ -37,11 +37,6 @@ PyAPI_FUNC(PyObject *) PySys_GetXOptions(void); PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); #endif -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _PySys_AddXOptionWithError(const wchar_t *s); -PyAPI_FUNC(int) _PySys_AddWarnOptionWithError(PyObject *option); -#endif - #ifdef __cplusplus } #endif diff --git a/Python/sysmodule.c b/Python/sysmodule.c index f88b273e26b1..9579eae4ff5f 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1807,7 +1807,7 @@ PySys_ResetWarnOptions(void) PyList_SetSlice(warnoptions, 0, PyList_GET_SIZE(warnoptions), NULL); } -int +static int _PySys_AddWarnOptionWithError(PyObject *option) { PyObject *warnoptions = get_warnoptions(); @@ -1823,7 +1823,12 @@ _PySys_AddWarnOptionWithError(PyObject *option) void PySys_AddWarnOptionUnicode(PyObject *option) { - (void)_PySys_AddWarnOptionWithError(option); + if (_PySys_AddWarnOptionWithError(option) < 0) { + /* No return value, therefore clear error state if possible */ + if (_PyThreadState_UncheckedGet()) { + PyErr_Clear(); + } + } } void @@ -1877,7 +1882,7 @@ get_xoptions(void) return xoptions; } -int +static int _PySys_AddXOptionWithError(const wchar_t *s) { PyObject *name = NULL, *value = NULL; From webhook-mailer at python.org Tue Oct 30 09:32:13 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 13:32:13 -0000 Subject: [Python-checkins] bpo-34403: Always implement _Py_GetForceASCII() (GH-10235) Message-ID: https://github.com/python/cpython/commit/7d35f79012db89ce9a152a77ac6809eb9c34a35d commit: 7d35f79012db89ce9a152a77ac6809eb9c34a35d branch: 3.7 author: Victor Stinner committer: GitHub date: 2018-10-30T14:32:01+01:00 summary: bpo-34403: Always implement _Py_GetForceASCII() (GH-10235) Compilation fails on macOS because _Py_GetForceASCII() wasn't define: always implement implement (default implementation: just return 0). files: M Python/fileutils.c diff --git a/Python/fileutils.c b/Python/fileutils.c index 1b7e6697c74a..b3b7925073b2 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -246,6 +246,12 @@ encode_ascii(const wchar_t *text, char **str, *str = result; return 0; } +#else +int +_Py_GetForceASCII(void) +{ + return 0; +} #endif /* !defined(__APPLE__) && !defined(__ANDROID__) && !defined(MS_WINDOWS) */ From webhook-mailer at python.org Tue Oct 30 09:48:30 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 13:48:30 -0000 Subject: [Python-checkins] bpo-35059: Convert _Py_Dealloc() to static inline function (GH-10223) Message-ID: https://github.com/python/cpython/commit/3c09dca4b5de9fe8c8756251d02f49cf093b88c1 commit: 3c09dca4b5de9fe8c8756251d02f49cf093b88c1 branch: master author: Victor Stinner committer: GitHub date: 2018-10-30T14:48:26+01:00 summary: bpo-35059: Convert _Py_Dealloc() to static inline function (GH-10223) Convert _Py_Dealloc() macro into a static inline function. Moreover, it is now also defined as a static inline function if Py_TRACE_REFS is defined. files: M Include/object.h M Objects/object.c diff --git a/Include/object.h b/Include/object.h index 799c40b2caf0..10ec60051e5e 100644 --- a/Include/object.h +++ b/Include/object.h @@ -768,7 +768,6 @@ PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op); /* Py_TRACE_REFS is such major surgery that we call external routines. */ PyAPI_FUNC(void) _Py_NewReference(PyObject *); PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); -PyAPI_FUNC(void) _Py_Dealloc(PyObject *); PyAPI_FUNC(void) _Py_PrintReferences(FILE *); PyAPI_FUNC(void) _Py_PrintReferenceAddresses(FILE *); PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); @@ -790,15 +789,25 @@ static inline void _Py_ForgetReference(PyObject *op) { _Py_INC_TPFREES(op); } +#endif /* !Py_TRACE_REFS */ + -#ifdef Py_LIMITED_API PyAPI_FUNC(void) _Py_Dealloc(PyObject *); + +#ifndef Py_LIMITED_API +static inline void _Py_Dealloc_inline(PyObject *op) +{ + destructor dealloc = Py_TYPE(op)->tp_dealloc; +#ifdef Py_TRACE_REFS + _Py_ForgetReference(op); #else -#define _Py_Dealloc(op) ( \ - _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA \ - (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op))) + _Py_INC_TPFREES(op); #endif -#endif /* !Py_TRACE_REFS */ + (*dealloc)(op); +} + +# define _Py_Dealloc(op) _Py_Dealloc_inline(op) +#endif /* !defined(Py_LIMITED_API) */ static inline void _Py_INCREF(PyObject *op) diff --git a/Objects/object.c b/Objects/object.c index de9eb2cb4e2c..b72ad019c796 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1964,14 +1964,6 @@ _Py_ForgetReference(PyObject *op) _Py_INC_TPFREES(op); } -void -_Py_Dealloc(PyObject *op) -{ - destructor dealloc = Py_TYPE(op)->tp_dealloc; - _Py_ForgetReference(op); - (*dealloc)(op); -} - /* Print all live objects. Because PyObject_Print is called, the * interpreter must be in a healthy state. */ @@ -2265,18 +2257,20 @@ _PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr, Py_FatalError("_PyObject_AssertFailed"); } -#ifndef Py_TRACE_REFS -/* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. - Define this here, so we can undefine the macro. */ + #undef _Py_Dealloc -void _Py_Dealloc(PyObject *); + void _Py_Dealloc(PyObject *op) { - _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA - (*Py_TYPE(op)->tp_dealloc)(op); -} + destructor dealloc = Py_TYPE(op)->tp_dealloc; +#ifdef Py_TRACE_REFS + _Py_ForgetReference(op); +#else + _Py_INC_TPFREES(op); #endif + (*dealloc)(op); +} #ifdef __cplusplus } From webhook-mailer at python.org Tue Oct 30 10:13:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 14:13:25 -0000 Subject: [Python-checkins] bpo-35081: Cleanup pystate.c and pystate.h (GH-10240) Message-ID: https://github.com/python/cpython/commit/9204fb8623896cc5f68ae350784ee25e8a7b2184 commit: 9204fb8623896cc5f68ae350784ee25e8a7b2184 branch: master author: Victor Stinner committer: GitHub date: 2018-10-30T15:13:17+01:00 summary: bpo-35081: Cleanup pystate.c and pystate.h (GH-10240) * Remove _PyThreadState_Current * Replace GET_TSTATE() with PyThreadState_GET() * Replace GET_INTERP_STATE() with _PyInterpreterState_GET_UNSAFE() * Replace direct access to _PyThreadState_Current with PyThreadState_GET() * Replace _PyThreadState_Current with _PyRuntime.gilstate.tstate_current * Rename SET_TSTATE() to _PyThreadState_SET(), name more consistent with _PyThreadState_GET() * Update outdated comments files: M Include/pystate.h M Objects/dictobject.c M Python/ceval.c M Python/pystate.c diff --git a/Include/pystate.h b/Include/pystate.h index 80ee0d112daa..8860f124002c 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -208,8 +208,8 @@ typedef struct _ts { * if the thread holds the last reference to the lock, decref'ing the * lock will delete the lock, and that may trigger arbitrary Python code * if there's a weakref, with a callback, to the lock. But by this time - * _PyThreadState_Current is already NULL, so only the simplest of C code - * can be allowed to run (in particular it must not be possible to + * _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest + * of C code can be allowed to run (in particular it must not be possible to * release the GIL). * So instead of holding the lock directly, the tstate holds a weakref to * the lock: that's the value of on_delete_data below. Decref'ing a @@ -307,9 +307,8 @@ PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *); /* Assuming the current thread holds the GIL, this is the PyThreadState for the current thread. */ #ifdef Py_BUILD_CORE -# define _PyThreadState_Current _PyRuntime.gilstate.tstate_current # define PyThreadState_GET() \ - ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) + ((PyThreadState*)_Py_atomic_load_relaxed(&_PyRuntime.gilstate.tstate_current)) #else # define PyThreadState_GET() PyThreadState_Get() #endif diff --git a/Objects/dictobject.c b/Objects/dictobject.c index ee656953e072..363d902e9c59 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1314,8 +1314,8 @@ PyDict_GetItem(PyObject *op, PyObject *key) /* We can arrive here with a NULL tstate during initialization: try running "python -Wi" for an example related to string interning. Let's just hope that no exception occurs then... This must be - _PyThreadState_Current and not PyThreadState_GET() because in debug - mode, the latter complains if tstate is NULL. */ + PyThreadState_GET() and not PyThreadState_Get() because the latter + abort Python if tstate is NULL. */ tstate = PyThreadState_GET(); if (tstate != NULL && tstate->curexc_type != NULL) { /* preserve the existing exception */ diff --git a/Python/ceval.c b/Python/ceval.c index 9a96dc7b37b9..644312384843 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -188,8 +188,7 @@ PyEval_ReleaseLock(void) We therefore avoid PyThreadState_GET() which dumps a fatal error in debug mode. */ - drop_gil((PyThreadState*)_Py_atomic_load_relaxed( - &_PyThreadState_Current)); + drop_gil(PyThreadState_GET()); } void diff --git a/Python/pystate.c b/Python/pystate.c index 7b3d3d4c9032..d04981121c1c 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -4,12 +4,9 @@ #include "Python.h" #include "internal/pystate.h" -#define GET_TSTATE() \ - ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) -#define SET_TSTATE(value) \ - _Py_atomic_store_relaxed(&_PyThreadState_Current, (uintptr_t)(value)) -#define GET_INTERP_STATE() \ - (GET_TSTATE()->interp) +#define _PyThreadState_SET(value) \ + _Py_atomic_store_relaxed(&_PyRuntime.gilstate.tstate_current, \ + (uintptr_t)(value)) /* -------------------------------------------------------------------------- @@ -309,7 +306,7 @@ _PyInterpreterState_DeleteExceptMain() PyInterpreterState * _PyInterpreterState_Get(void) { - PyThreadState *tstate = GET_TSTATE(); + PyThreadState *tstate = PyThreadState_GET(); if (tstate == NULL) { Py_FatalError("_PyInterpreterState_Get(): no current thread state"); } @@ -508,7 +505,7 @@ PyObject* PyState_FindModule(struct PyModuleDef* module) { Py_ssize_t index = module->m_base.m_index; - PyInterpreterState *state = GET_INTERP_STATE(); + PyInterpreterState *state = _PyInterpreterState_GET_UNSAFE(); PyObject *res; if (module->m_slots) { return NULL; @@ -536,7 +533,7 @@ _PyState_AddModule(PyObject* module, struct PyModuleDef* def) "PyState_AddModule called on module with slots"); return -1; } - state = GET_INTERP_STATE(); + state = _PyInterpreterState_GET_UNSAFE(); if (!state->modules_by_index) { state->modules_by_index = PyList_New(0); if (!state->modules_by_index) @@ -554,7 +551,7 @@ int PyState_AddModule(PyObject* module, struct PyModuleDef* def) { Py_ssize_t index; - PyInterpreterState *state = GET_INTERP_STATE(); + PyInterpreterState *state = _PyInterpreterState_GET_UNSAFE(); if (!def) { Py_FatalError("PyState_AddModule: Module Definition is NULL"); return -1; @@ -581,7 +578,7 @@ PyState_RemoveModule(struct PyModuleDef* def) "PyState_RemoveModule called on module with slots"); return -1; } - state = GET_INTERP_STATE(); + state = _PyInterpreterState_GET_UNSAFE(); if (index == 0) { Py_FatalError("PyState_RemoveModule: Module index invalid."); return -1; @@ -601,7 +598,7 @@ PyState_RemoveModule(struct PyModuleDef* def) void _PyState_ClearModules(void) { - PyInterpreterState *state = GET_INTERP_STATE(); + PyInterpreterState *state = _PyInterpreterState_GET_UNSAFE(); if (state->modules_by_index) { Py_ssize_t i; for (i = 0; i < PyList_GET_SIZE(state->modules_by_index); i++) { @@ -691,7 +688,7 @@ tstate_delete_common(PyThreadState *tstate) void PyThreadState_Delete(PyThreadState *tstate) { - if (tstate == GET_TSTATE()) + if (tstate == PyThreadState_GET()) Py_FatalError("PyThreadState_Delete: tstate is still current"); if (_PyRuntime.gilstate.autoInterpreterState && PyThread_tss_get(&_PyRuntime.gilstate.autoTSSkey) == tstate) @@ -705,7 +702,7 @@ PyThreadState_Delete(PyThreadState *tstate) void PyThreadState_DeleteCurrent() { - PyThreadState *tstate = GET_TSTATE(); + PyThreadState *tstate = PyThreadState_GET(); if (tstate == NULL) Py_FatalError( "PyThreadState_DeleteCurrent: no current tstate"); @@ -715,7 +712,7 @@ PyThreadState_DeleteCurrent() { PyThread_tss_set(&_PyRuntime.gilstate.autoTSSkey, NULL); } - SET_TSTATE(NULL); + _PyThreadState_SET(NULL); PyEval_ReleaseLock(); } @@ -760,14 +757,14 @@ _PyThreadState_DeleteExcept(PyThreadState *tstate) PyThreadState * _PyThreadState_UncheckedGet(void) { - return GET_TSTATE(); + return PyThreadState_GET(); } PyThreadState * PyThreadState_Get(void) { - PyThreadState *tstate = GET_TSTATE(); + PyThreadState *tstate = PyThreadState_GET(); if (tstate == NULL) Py_FatalError("PyThreadState_Get: no current thread"); @@ -778,9 +775,9 @@ PyThreadState_Get(void) PyThreadState * PyThreadState_Swap(PyThreadState *newts) { - PyThreadState *oldts = GET_TSTATE(); + PyThreadState *oldts = PyThreadState_GET(); - SET_TSTATE(newts); + _PyThreadState_SET(newts); /* It should not be possible for more than one thread state to be used for a thread. Check this the best we can in debug builds. @@ -809,7 +806,7 @@ PyThreadState_Swap(PyThreadState *newts) PyObject * PyThreadState_GetDict(void) { - PyThreadState *tstate = GET_TSTATE(); + PyThreadState *tstate = PyThreadState_GET(); if (tstate == NULL) return NULL; @@ -834,7 +831,7 @@ PyThreadState_GetDict(void) int PyThreadState_SetAsyncExc(unsigned long id, PyObject *exc) { - PyInterpreterState *interp = GET_INTERP_STATE(); + PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); PyThreadState *p; /* Although the GIL is held, a few C API functions can be called @@ -960,7 +957,7 @@ PyThreadState_IsCurrent(PyThreadState *tstate) { /* Must be the tstate for this thread */ assert(PyGILState_GetThisThreadState()==tstate); - return tstate == GET_TSTATE(); + return tstate == PyThreadState_GET(); } /* Internal initialization/finalization functions called by @@ -1087,7 +1084,7 @@ PyGILState_Check(void) return 1; } - tstate = GET_TSTATE(); + tstate = PyThreadState_GET(); if (tstate == NULL) return 0; From webhook-mailer at python.org Tue Oct 30 10:14:32 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 14:14:32 -0000 Subject: [Python-checkins] bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239) Message-ID: https://github.com/python/cpython/commit/31368a4f0e531c19affe2a1becd25fc316bc7501 commit: 31368a4f0e531c19affe2a1becd25fc316bc7501 branch: master author: Victor Stinner committer: GitHub date: 2018-10-30T15:14:25+01:00 summary: bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239) Add pyatomic.h to the VS project (it wasn't referenced). files: A Include/internal/pyatomic.h D Include/pyatomic.h M Include/Python.h M Include/internal/ceval.h M Include/internal/gil.h M Include/internal/pystate.h M Makefile.pre.in M Modules/signalmodule.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/ceval_gil.h diff --git a/Include/Python.h b/Include/Python.h index 80200feb9033..cf87a5ce7a70 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -53,8 +53,6 @@ #include "pyport.h" #include "pymacro.h" -#include "pyatomic.h" - /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. * PYMALLOC_DEBUG is in error if pymalloc is not in use. */ diff --git a/Include/internal/ceval.h b/Include/internal/ceval.h index cdabb9521d10..4297b5a51ce4 100644 --- a/Include/internal/ceval.h +++ b/Include/internal/ceval.h @@ -4,7 +4,7 @@ extern "C" { #endif -#include "pyatomic.h" +#include "internal/pyatomic.h" #include "pythread.h" struct _pending_calls { diff --git a/Include/internal/gil.h b/Include/internal/gil.h index 6139bd215c38..7743b3f0aa8b 100644 --- a/Include/internal/gil.h +++ b/Include/internal/gil.h @@ -4,11 +4,11 @@ extern "C" { #endif -#include "pyatomic.h" - #include "internal/condvar.h" +#include "internal/pyatomic.h" + #ifndef Py_HAVE_CONDVAR -#error You need either a POSIX-compatible or a Windows system! +# error You need either a POSIX-compatible or a Windows system! #endif /* Enable if you want to force the switching of threads at least diff --git a/Include/pyatomic.h b/Include/internal/pyatomic.h similarity index 99% rename from Include/pyatomic.h rename to Include/internal/pyatomic.h index 9a497a683688..5f349cc3e9e9 100644 --- a/Include/pyatomic.h +++ b/Include/internal/pyatomic.h @@ -1,6 +1,12 @@ #ifndef Py_ATOMIC_H #define Py_ATOMIC_H -#ifdef Py_BUILD_CORE +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif #include "dynamic_annotations.h" @@ -531,5 +537,8 @@ typedef struct _Py_atomic_int { _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, _Py_memory_order_relaxed) #define _Py_atomic_load_relaxed(ATOMIC_VAL) \ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed) -#endif /* Py_BUILD_CORE */ + +#ifdef __cplusplus +} +#endif #endif /* Py_ATOMIC_H */ diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h index c93dda28954a..38845d32ecaf 100644 --- a/Include/internal/pystate.h +++ b/Include/internal/pystate.h @@ -5,7 +5,6 @@ extern "C" { #endif #include "pystate.h" -#include "pyatomic.h" #include "pythread.h" #include "internal/mem.h" diff --git a/Makefile.pre.in b/Makefile.pre.in index 61b469d4504e..232025f1cb61 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -988,7 +988,6 @@ PYTHON_HEADERS= \ $(srcdir)/Include/pgen.h \ $(srcdir)/Include/pgenheaders.h \ $(srcdir)/Include/pyarena.h \ - $(srcdir)/Include/pyatomic.h \ $(srcdir)/Include/pycapsule.h \ $(srcdir)/Include/pyctype.h \ $(srcdir)/Include/pydebug.h \ @@ -1029,6 +1028,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/ceval.h \ $(srcdir)/Include/internal/gil.h \ $(srcdir)/Include/internal/mem.h \ + $(srcdir)/Include/internal/pyatomic.h \ $(srcdir)/Include/internal/pygetopt.h \ $(srcdir)/Include/internal/pystate.h \ $(srcdir)/Include/internal/context.h \ diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index d12094858273..a81de6ab6462 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -4,6 +4,8 @@ /* XXX Signals should be recorded per thread, now we have thread state. */ #include "Python.h" +#include "internal/pyatomic.h" + #ifndef MS_WINDOWS #include "posixmodule.h" #endif diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index cb835390ee13..f65bb5b2197c 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -118,6 +118,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 510a9c2b2e4e..7fdadc81676d 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -153,6 +153,9 @@ Include + + Include + Include diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h index ef5189068e0c..4a054a97f710 100644 --- a/Python/ceval_gil.h +++ b/Python/ceval_gil.h @@ -5,6 +5,7 @@ #include #include +#include "internal/pyatomic.h" /* First some general settings */ From webhook-mailer at python.org Tue Oct 30 10:56:13 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Tue, 30 Oct 2018 14:56:13 -0000 Subject: [Python-checkins] bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160) Message-ID: https://github.com/python/cpython/commit/a80af770870937271865b5e2b05a2cfe40b024b6 commit: a80af770870937271865b5e2b05a2cfe40b024b6 branch: master author: Daniel Lovell committer: Serhiy Storchaka date: 2018-10-30T16:56:07+02:00 summary: bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160) The root widget was accessed as a global variable in the Application's method. files: M Doc/library/tkinter.rst diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 4af4b7356e1c..60cf892e0888 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -205,6 +205,7 @@ A Simple Hello World Program class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) + self.master = master self.pack() self.create_widgets() @@ -215,7 +216,7 @@ A Simple Hello World Program self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", - command=root.destroy) + command=self.master.destroy) self.quit.pack(side="bottom") def say_hi(self): From webhook-mailer at python.org Tue Oct 30 11:34:59 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 30 Oct 2018 15:34:59 -0000 Subject: [Python-checkins] bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160) Message-ID: https://github.com/python/cpython/commit/f51ef51db686938486bff453e791a3093a1df108 commit: f51ef51db686938486bff453e791a3093a1df108 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-30T08:34:54-07:00 summary: bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160) The root widget was accessed as a global variable in the Application's method. (cherry picked from commit a80af770870937271865b5e2b05a2cfe40b024b6) Co-authored-by: Daniel Lovell files: M Doc/library/tkinter.rst diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 4af4b7356e1c..60cf892e0888 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -205,6 +205,7 @@ A Simple Hello World Program class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) + self.master = master self.pack() self.create_widgets() @@ -215,7 +216,7 @@ A Simple Hello World Program self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", - command=root.destroy) + command=self.master.destroy) self.quit.pack(side="bottom") def say_hi(self): From webhook-mailer at python.org Tue Oct 30 11:35:06 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 30 Oct 2018 15:35:06 -0000 Subject: [Python-checkins] bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160) Message-ID: https://github.com/python/cpython/commit/c843a47007293d8361d0bfd45bfd7169afaa601c commit: c843a47007293d8361d0bfd45bfd7169afaa601c branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-30T08:35:02-07:00 summary: bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160) The root widget was accessed as a global variable in the Application's method. (cherry picked from commit a80af770870937271865b5e2b05a2cfe40b024b6) Co-authored-by: Daniel Lovell files: M Doc/library/tkinter.rst diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 4af4b7356e1c..60cf892e0888 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -205,6 +205,7 @@ A Simple Hello World Program class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) + self.master = master self.pack() self.create_widgets() @@ -215,7 +216,7 @@ A Simple Hello World Program self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", - command=root.destroy) + command=self.master.destroy) self.quit.pack(side="bottom") def say_hi(self): From webhook-mailer at python.org Tue Oct 30 16:30:25 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 20:30:25 -0000 Subject: [Python-checkins] bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10247) Message-ID: https://github.com/python/cpython/commit/68f323715e6627c550d1e8ffed7e36f1bb4aa42b commit: 68f323715e6627c550d1e8ffed7e36f1bb4aa42b branch: master author: matthewbelisle-wf committer: Victor Stinner date: 2018-10-30T21:30:19+01:00 summary: bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10247) files: M Doc/library/urllib.parse.rst diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index 2d3488bb5eef..913e933d657c 100644 --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -137,7 +137,7 @@ or on combining URL components into a URL string. returning :const:`None`. -.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') +.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a @@ -158,6 +158,10 @@ or on combining URL components into a URL string. percent-encoded sequences into Unicode characters, as accepted by the :meth:`bytes.decode` method. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` parameter set to ``True``) to convert such dictionaries into query strings. @@ -166,8 +170,11 @@ or on combining URL components into a URL string. .. versionchanged:: 3.2 Add *encoding* and *errors* parameters. + .. versionchanged:: 3.8 + Added *max_num_fields* parameter. + -.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') +.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of @@ -187,12 +194,19 @@ or on combining URL components into a URL string. percent-encoded sequences into Unicode characters, as accepted by the :meth:`bytes.decode` method. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into query strings. .. versionchanged:: 3.2 Add *encoding* and *errors* parameters. + .. versionchanged:: 3.8 + Added *max_num_fields* parameter. + .. function:: urlunparse(parts) From webhook-mailer at python.org Tue Oct 30 17:15:23 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 21:15:23 -0000 Subject: [Python-checkins] bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10248) Message-ID: https://github.com/python/cpython/commit/691196d1af6a7e9d218e3281a8f3385616b2ca86 commit: 691196d1af6a7e9d218e3281a8f3385616b2ca86 branch: 3.6 author: matthewbelisle-wf committer: Victor Stinner date: 2018-10-30T22:15:18+01:00 summary: bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10248) files: M Doc/library/urllib.parse.rst diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index 1cc69e62e633..d991254d5ca1 100644 --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -134,7 +134,7 @@ or on combining URL components into a URL string. returning :const:`None`. -.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') +.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a @@ -155,6 +155,10 @@ or on combining URL components into a URL string. percent-encoded sequences into Unicode characters, as accepted by the :meth:`bytes.decode` method. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` parameter set to ``True``) to convert such dictionaries into query strings. @@ -163,8 +167,11 @@ or on combining URL components into a URL string. .. versionchanged:: 3.2 Add *encoding* and *errors* parameters. + .. versionchanged:: 3.6.8 + Added *max_num_fields* parameter. + -.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') +.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of @@ -184,12 +191,19 @@ or on combining URL components into a URL string. percent-encoded sequences into Unicode characters, as accepted by the :meth:`bytes.decode` method. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into query strings. .. versionchanged:: 3.2 Add *encoding* and *errors* parameters. + .. versionchanged:: 3.6.8 + Added *max_num_fields* parameter. + .. function:: urlunparse(parts) From webhook-mailer at python.org Tue Oct 30 17:15:31 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 21:15:31 -0000 Subject: [Python-checkins] bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10246) Message-ID: https://github.com/python/cpython/commit/aa0a21a7c81cb4eca723b0f400e860a0e8e730b5 commit: aa0a21a7c81cb4eca723b0f400e860a0e8e730b5 branch: 3.7 author: matthewbelisle-wf committer: Victor Stinner date: 2018-10-30T22:15:24+01:00 summary: bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10246) files: M Doc/library/urllib.parse.rst diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index 2d3488bb5eef..0c8f0f607314 100644 --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -137,7 +137,7 @@ or on combining URL components into a URL string. returning :const:`None`. -.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') +.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a @@ -158,16 +158,22 @@ or on combining URL components into a URL string. percent-encoded sequences into Unicode characters, as accepted by the :meth:`bytes.decode` method. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` parameter set to ``True``) to convert such dictionaries into query strings. - .. versionchanged:: 3.2 Add *encoding* and *errors* parameters. + .. versionchanged:: 3.7.2 + Added *max_num_fields* parameter. -.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') + +.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of @@ -187,12 +193,18 @@ or on combining URL components into a URL string. percent-encoded sequences into Unicode characters, as accepted by the :meth:`bytes.decode` method. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into query strings. .. versionchanged:: 3.2 Add *encoding* and *errors* parameters. + .. versionchanged:: 3.7.2 + Added *max_num_fields* parameter. .. function:: urlunparse(parts) From webhook-mailer at python.org Tue Oct 30 17:16:33 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 30 Oct 2018 21:16:33 -0000 Subject: [Python-checkins] bpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969) Message-ID: https://github.com/python/cpython/commit/bc6f74a520112d25ef40324e3de4e8187ff2835d commit: bc6f74a520112d25ef40324e3de4e8187ff2835d branch: 2.7 author: matthewbelisle-wf committer: Victor Stinner date: 2018-10-30T22:16:26+01:00 summary: bpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969) Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by limiting the number of `MiniFieldStorage` objects created by `FieldStorage`. (cherry picked from commit 209144831b0a19715bda3bd72b14a3e6192d9cc1) files: A Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst M Doc/library/cgi.rst M Doc/library/urlparse.rst M Lib/cgi.py M Lib/test/test_cgi.py M Lib/urlparse.py diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst index 1bfdb3906784..ecd62c8c0194 100644 --- a/Doc/library/cgi.rst +++ b/Doc/library/cgi.rst @@ -292,12 +292,12 @@ algorithms implemented in this module in other circumstances. passed to :func:`urlparse.parse_qs` unchanged. -.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]]) +.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]]) This function is deprecated in this module. Use :func:`urlparse.parse_qs` instead. It is maintained here only for backward compatibility. -.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]]) +.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]]) This function is deprecated in this module. Use :func:`urlparse.parse_qsl` instead. It is maintained here only for backward compatibility. diff --git a/Doc/library/urlparse.rst b/Doc/library/urlparse.rst index b933dda3d242..22249da54fbb 100644 --- a/Doc/library/urlparse.rst +++ b/Doc/library/urlparse.rst @@ -126,7 +126,7 @@ The :mod:`urlparse` module defines the following functions: Added IPv6 URL parsing capabilities. -.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]]) +.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]]) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a @@ -143,14 +143,20 @@ The :mod:`urlparse` module defines the following functions: parsing errors. If false (the default), errors are silently ignored. If true, errors raise a :exc:`ValueError` exception. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.urlencode` function to convert such dictionaries into query strings. .. versionadded:: 2.6 Copied from the :mod:`cgi` module. + .. versionchanged:: 2.7.16 + Added *max_num_fields* parameter. -.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]]) +.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]]) Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of @@ -166,12 +172,18 @@ The :mod:`urlparse` module defines the following functions: parsing errors. If false (the default), errors are silently ignored. If true, errors raise a :exc:`ValueError` exception. + The optional argument *max_num_fields* is the maximum number of fields to + read. If set, then throws a :exc:`ValueError` if there are more than + *max_num_fields* fields read. + Use the :func:`urllib.urlencode` function to convert such lists of pairs into query strings. .. versionadded:: 2.6 Copied from the :mod:`cgi` module. + .. versionchanged:: 2.7.16 + Added *max_num_fields* parameter. .. function:: urlunparse(parts) diff --git a/Lib/cgi.py b/Lib/cgi.py index 7c51b44db1a9..5b903e034773 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -184,11 +184,12 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0): return urlparse.parse_qs(qs, keep_blank_values, strict_parsing) -def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): +def parse_qsl(qs, keep_blank_values=0, strict_parsing=0, max_num_fields=None): """Parse a query given as a string argument.""" warn("cgi.parse_qsl is deprecated, use urlparse.parse_qsl instead", PendingDeprecationWarning, 2) - return urlparse.parse_qsl(qs, keep_blank_values, strict_parsing) + return urlparse.parse_qsl(qs, keep_blank_values, strict_parsing, + max_num_fields) def parse_multipart(fp, pdict): """Parse multipart input. @@ -393,7 +394,8 @@ class FieldStorage: """ def __init__(self, fp=None, headers=None, outerboundary="", - environ=os.environ, keep_blank_values=0, strict_parsing=0): + environ=os.environ, keep_blank_values=0, strict_parsing=0, + max_num_fields=None): """Constructor. Read multipart/* until last part. Arguments, all optional: @@ -420,10 +422,14 @@ def __init__(self, fp=None, headers=None, outerboundary="", If false (the default), errors are silently ignored. If true, errors raise a ValueError exception. + max_num_fields: int. If set, then __init__ throws a ValueError + if there are more than n fields read by parse_qsl(). + """ method = 'GET' self.keep_blank_values = keep_blank_values self.strict_parsing = strict_parsing + self.max_num_fields = max_num_fields if 'REQUEST_METHOD' in environ: method = environ['REQUEST_METHOD'].upper() self.qs_on_post = None @@ -606,10 +612,9 @@ def read_urlencoded(self): qs = self.fp.read(self.length) if self.qs_on_post: qs += '&' + self.qs_on_post - self.list = list = [] - for key, value in urlparse.parse_qsl(qs, self.keep_blank_values, - self.strict_parsing): - list.append(MiniFieldStorage(key, value)) + query = urlparse.parse_qsl(qs, self.keep_blank_values, + self.strict_parsing, self.max_num_fields) + self.list = [MiniFieldStorage(key, value) for key, value in query] self.skip_lines() FieldStorageClass = None @@ -621,19 +626,38 @@ def read_multi(self, environ, keep_blank_values, strict_parsing): raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,) self.list = [] if self.qs_on_post: - for key, value in urlparse.parse_qsl(self.qs_on_post, - self.keep_blank_values, self.strict_parsing): - self.list.append(MiniFieldStorage(key, value)) + query = urlparse.parse_qsl(self.qs_on_post, + self.keep_blank_values, + self.strict_parsing, + self.max_num_fields) + self.list.extend(MiniFieldStorage(key, value) + for key, value in query) FieldStorageClass = None + # Propagate max_num_fields into the sub class appropriately + max_num_fields = self.max_num_fields + if max_num_fields is not None: + max_num_fields -= len(self.list) + klass = self.FieldStorageClass or self.__class__ part = klass(self.fp, {}, ib, - environ, keep_blank_values, strict_parsing) + environ, keep_blank_values, strict_parsing, + max_num_fields) + # Throw first part away while not part.done: headers = rfc822.Message(self.fp) part = klass(self.fp, headers, ib, - environ, keep_blank_values, strict_parsing) + environ, keep_blank_values, strict_parsing, + max_num_fields) + + if max_num_fields is not None: + max_num_fields -= 1 + if part.list: + max_num_fields -= len(part.list) + if max_num_fields < 0: + raise ValueError('Max number of fields exceeded') + self.list.append(part) self.skip_lines() diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index c9cf09525d71..743c2afbd4cd 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -1,3 +1,4 @@ +from io import BytesIO from test.test_support import run_unittest, check_warnings import cgi import os @@ -316,6 +317,60 @@ def testQSAndUrlEncode(self): v = gen_result(data, environ) self.assertEqual(self._qs_result, v) + def test_max_num_fields(self): + # For application/x-www-form-urlencoded + data = '&'.join(['a=a']*11) + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'application/x-www-form-urlencoded', + 'REQUEST_METHOD': 'POST', + } + + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=10, + ) + + # For multipart/form-data + data = """---123 +Content-Disposition: form-data; name="a" + +3 +---123 +Content-Type: application/x-www-form-urlencoded + +a=4 +---123 +Content-Type: application/x-www-form-urlencoded + +a=5 +---123-- +""" + environ = { + 'CONTENT_LENGTH': str(len(data)), + 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', + 'QUERY_STRING': 'a=1&a=2', + 'REQUEST_METHOD': 'POST', + } + + # 2 GET entities + # 1 top level POST entities + # 1 entity within the second POST entity + # 1 entity within the third POST entity + with self.assertRaises(ValueError): + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=4, + ) + cgi.FieldStorage( + fp=BytesIO(data.encode()), + environ=environ, + max_num_fields=5, + ) + def testQSAndFormData(self): data = """ ---123 diff --git a/Lib/urlparse.py b/Lib/urlparse.py index 4cd3d6743a96..f7c2b032b097 100644 --- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -361,7 +361,7 @@ def unquote(s): append(item) return ''.join(res) -def parse_qs(qs, keep_blank_values=0, strict_parsing=0): +def parse_qs(qs, keep_blank_values=0, strict_parsing=0, max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -378,16 +378,20 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0): strict_parsing: flag indicating what to do with parsing errors. If false (the default), errors are silently ignored. If true, errors raise a ValueError exception. + + max_num_fields: int. If set, then throws a ValueError if there + are more than n fields read by parse_qsl(). """ dict = {} - for name, value in parse_qsl(qs, keep_blank_values, strict_parsing): + for name, value in parse_qsl(qs, keep_blank_values, strict_parsing, + max_num_fields): if name in dict: dict[name].append(value) else: dict[name] = [value] return dict -def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): +def parse_qsl(qs, keep_blank_values=0, strict_parsing=0, max_num_fields=None): """Parse a query given as a string argument. Arguments: @@ -404,8 +408,19 @@ def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): false (the default), errors are silently ignored. If true, errors raise a ValueError exception. + max_num_fields: int. If set, then throws a ValueError if there + are more than n fields read by parse_qsl(). + Returns a list, as G-d intended. """ + # If max_num_fields is defined then check that the number of fields + # is less than max_num_fields. This prevents a memory exhaustion DOS + # attack via post bodies with many fields. + if max_num_fields is not None: + num_fields = 1 + qs.count('&') + qs.count(';') + if max_num_fields < num_fields: + raise ValueError('Max number of fields exceeded') + pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] r = [] for name_value in pairs: diff --git a/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst new file mode 100644 index 000000000000..90c146ce834e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-03-11-07-28.bpo-34866.ML6KpJ.rst @@ -0,0 +1,2 @@ +Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS attacks harder by +limiting the number of ``MiniFieldStorage`` objects created by ``FieldStorage``. From webhook-mailer at python.org Tue Oct 30 20:26:11 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 31 Oct 2018 00:26:11 -0000 Subject: [Python-checkins] bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) Message-ID: https://github.com/python/cpython/commit/3f819ca138db6945ee4271bf13e42db9f9b3b1e4 commit: 3f819ca138db6945ee4271bf13e42db9f9b3b1e4 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-31T02:26:06+02:00 summary: bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) files: M Doc/c-api/veryhigh.rst M Doc/distutils/apiref.rst M Doc/distutils/builtdist.rst M Doc/extending/extending.rst M Doc/howto/logging.rst M Doc/install/index.rst M Doc/library/codecs.rst M Doc/library/datetime.rst M Doc/library/email.compat32-message.rst M Doc/library/email.message.rst M Doc/library/logging.rst M Doc/library/optparse.rst M Doc/library/os.rst M Doc/library/ossaudiodev.rst M Doc/library/stat.rst M Doc/library/string.rst M Doc/library/termios.rst M Doc/tutorial/controlflow.rst M Doc/whatsnew/2.2.rst M Doc/whatsnew/2.3.rst M Doc/whatsnew/2.5.rst M Doc/whatsnew/3.4.rst M Doc/whatsnew/3.8.rst M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.0a3.rst M Misc/NEWS.d/3.5.0b3.rst M Misc/NEWS.d/3.5.0b4.rst M Misc/NEWS.d/3.5.1rc1.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.5.4rc1.rst M Misc/NEWS.d/next/Documentation/2018-06-07-08-33-45.bpo-17045.ZNx6KU.rst M Misc/NEWS.d/next/IDLE/2018-06-26-22-53-14.bpo-33975.Ow7alv.rst M Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index cefe9d44bf45..c891f6320f94 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -306,7 +306,7 @@ the same library that the Python runtime is using. Evaluate a precompiled code object, given a particular environment for its evaluation. This environment consists of a dictionary of global variables, a mapping object of local variables, arrays of arguments, keywords and - defaults, a dictionary of default values for :ref:`keyword-only\ + defaults, a dictionary of default values for :ref:`keyword-only ` arguments and a closure tuple of cells. diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index 9d5c2ab696ff..b10b39ae22ac 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -183,8 +183,9 @@ the full reference. | *sources* | list of source filenames, | a list of strings | | | relative to the distribution | | | | root (where the setup script | | - | | lives), in Unix form (slash- | | - | | separated) for portability. | | + | | lives), in Unix form | | + | | (slash-separated) for | | + | | portability. | | | | Source files may be C, C++, | | | | SWIG (.i), platform-specific | | | | resource files, or whatever | | @@ -1566,8 +1567,8 @@ lines, and joining lines with backslashes. +------------------+--------------------------------+---------+ | option name | description | default | +==================+================================+=========+ - | *strip_comments* | strip from ``'#'`` to end-of- | true | - | | line, as well as any | | + | *strip_comments* | strip from ``'#'`` to | true | + | | end-of-line, as well as any | | | | whitespace leading up to the | | | | ``'#'``\ ---unless it is | | | | escaped by a backslash | | diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst index 758bd141ac95..f1f347126160 100644 --- a/Doc/distutils/builtdist.rst +++ b/Doc/distutils/builtdist.rst @@ -63,9 +63,9 @@ distribution to generate: for example, :: python setup.py bdist --format=zip -would, when run on a Unix system, create :file:`Distutils-1.0.{plat}.zip`\ ----again, this archive would be unpacked from the root directory to install the -Distutils. +would, when run on a Unix system, create +:file:`Distutils-1.0.{plat}.zip`\ ---again, this archive would be unpacked +from the root directory to install the Distutils. The available formats for built distributions are: diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 82b689e064c1..b788a5575b3f 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -545,8 +545,9 @@ or more format codes between parentheses. For example:: :c:func:`PyObject_CallObject` returns a Python object pointer: this is the return value of the Python function. :c:func:`PyObject_CallObject` is "reference-count-neutral" with respect to its arguments. In the example a new -tuple was created to serve as the argument list, which is :c:func:`Py_DECREF`\ --ed immediately after the :c:func:`PyObject_CallObject` call. +tuple was created to serve as the argument list, which is +:c:func:`Py_DECREF`\ -ed immediately after the :c:func:`PyObject_CallObject` +call. The return value of :c:func:`PyObject_CallObject` is "new": either it is a brand new object, or it is an existing object whose reference count has been diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index 47b5c680c424..2a2282e9ecf0 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -971,7 +971,7 @@ provided: The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` classes are defined in the core logging package. The other handlers are -defined in a sub- module, :mod:`logging.handlers`. (There is also another +defined in a sub-module, :mod:`logging.handlers`. (There is also another sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the diff --git a/Doc/install/index.rst b/Doc/install/index.rst index 92cdf2f11443..f6a8cd6833a9 100644 --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -554,10 +554,10 @@ C headers ``--install-headers`` These override options can be relative, absolute, or explicitly defined in terms of one of the installation base directories. -(There are two installation base directories, and they are normally the same--- -they only differ when you use the Unix "prefix scheme" and supply different -``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will -override values computed or given for ``--install-purelib`` and +(There are two installation base directories, and they are normally the +same---they only differ when you use the Unix "prefix scheme" and supply +different ``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` +will override values computed or given for ``--install-purelib`` and ``--install-platlib``, and is recommended for schemes that don't make a difference between Python and extension modules.) @@ -584,10 +584,10 @@ in this case.) If you maintain Python on Windows, you might want third-party modules to live in a subdirectory of :file:`{prefix}`, rather than right in :file:`{prefix}` -itself. This is almost as easy as customizing the script installation directory ----you just have to remember that there are two types of modules to worry about, -Python and extension modules, which can conveniently be both controlled by one -option:: +itself. This is almost as easy as customizing the script installation +directory---you just have to remember that there are two types of modules +to worry about, Python and extension modules, which can conveniently be both +controlled by one option:: python setup.py install --install-lib=Site diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 65f41f69f23b..7cfec632ed96 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1121,10 +1121,10 @@ particular, the following variants typically exist: | | ks_c-5601, ks_c-5601-1987, | | | | ksx1001, ks_x-1001 | | +-----------------+--------------------------------+--------------------------------+ -| gb2312 | chinese, csiso58gb231280, euc- | Simplified Chinese | -| | cn, euccn, eucgb2312-cn, | | -| | gb2312-1980, gb2312-80, iso- | | -| | ir-58 | | +| gb2312 | chinese, csiso58gb231280, | Simplified Chinese | +| | euc-cn, euccn, eucgb2312-cn, | | +| | gb2312-1980, gb2312-80, | | +| | iso-ir-58 | | +-----------------+--------------------------------+--------------------------------+ | gbk | 936, cp936, ms936 | Unified Chinese | +-----------------+--------------------------------+--------------------------------+ diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 0363111ef55f..db3a6522c24f 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -276,9 +276,10 @@ Supported operations: | ``+t1`` | Returns a :class:`timedelta` object with the | | | same value. (2) | +--------------------------------+-----------------------------------------------+ -| ``-t1`` | equivalent to :class:`timedelta`\ | -| | (-*t1.days*, -*t1.seconds*, | -| | -*t1.microseconds*), and to *t1*\* -1. (1)(4) | +| ``-t1`` | equivalent to | +| | :class:`timedelta`\ (-*t1.days*, | +| | -*t1.seconds*, -*t1.microseconds*), | +| | and to *t1*\* -1. (1)(4) | +--------------------------------+-----------------------------------------------+ | ``abs(t)`` | equivalent to +\ *t* when ``t.days >= 0``, and| | | to -*t* when ``t.days < 0``. (2) | diff --git a/Doc/library/email.compat32-message.rst b/Doc/library/email.compat32-message.rst index 2e189dccdb1a..d88495089482 100644 --- a/Doc/library/email.compat32-message.rst +++ b/Doc/library/email.compat32-message.rst @@ -149,8 +149,8 @@ Here are the methods of the :class:`Message` class: .. method:: is_multipart() - Return ``True`` if the message's payload is a list of sub-\ - :class:`Message` objects, otherwise return ``False``. When + Return ``True`` if the message's payload is a list of + sub-\ :class:`Message` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload. (Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst index 261d0d62cfe6..ff5404553e96 100644 --- a/Doc/library/email.message.rst +++ b/Doc/library/email.message.rst @@ -130,8 +130,8 @@ message objects. .. method:: is_multipart() - Return ``True`` if the message's payload is a list of sub-\ - :class:`EmailMessage` objects, otherwise return ``False``. When + Return ``True`` if the message's payload is a list of + sub-\ :class:`EmailMessage` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload). Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 3a3428aa20e9..5adde29f5085 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -904,7 +904,7 @@ re-entrant, and so cannot be invoked from such signal handlers. Module-Level Functions ---------------------- -In addition to the classes described above, there are a number of module- level +In addition to the classes described above, there are a number of module-level functions. diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index e9b82ee2ac13..4f7bd43ce7d9 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -388,8 +388,8 @@ flag that is turned on with ``-v`` and off with ``-q``:: parser.add_option("-q", action="store_false", dest="verbose") Here we have two different options with the same destination, which is perfectly -OK. (It just means you have to be a bit careful when setting default values--- -see below.) +OK. (It just means you have to be a bit careful when setting default +values---see below.) When :mod:`optparse` encounters ``-v`` on the command line, it sets ``options.verbose`` to ``True``; when it encounters ``-q``, @@ -525,9 +525,9 @@ help message: default: ``"Usage: %prog [options]"``, which is fine if your script doesn't take any positional arguments. -* every option defines a help string, and doesn't worry about line-wrapping--- - :mod:`optparse` takes care of wrapping lines and making the help output look - good. +* every option defines a help string, and doesn't worry about + line-wrapping---\ :mod:`optparse` takes care of wrapping lines and making + the help output look good. * options that take a value indicate this fact in their automatically-generated help message, e.g. for the "mode" option:: diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 6a9fe362b8bd..401e9cb6e4b7 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3776,11 +3776,11 @@ written in Python, such as a mail server's external command delivery program. .. function:: wait3(options) Similar to :func:`waitpid`, except no process id argument is given and a - 3-element tuple containing the child's process id, exit status indication, and - resource usage information is returned. Refer to :mod:`resource`.\ - :func:`~resource.getrusage` for details on resource usage information. The - option argument is the same as that provided to :func:`waitpid` and - :func:`wait4`. + 3-element tuple containing the child's process id, exit status indication, + and resource usage information is returned. Refer to + :mod:`resource`.\ :func:`~resource.getrusage` for details on resource usage + information. The option argument is the same as that provided to + :func:`waitpid` and :func:`wait4`. .. availability:: Unix. diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst index 522bb7e09242..a7d3dac363cd 100644 --- a/Doc/library/ossaudiodev.rst +++ b/Doc/library/ossaudiodev.rst @@ -153,8 +153,7 @@ and (read-only) attributes: number of bytes written. If the audio device is in blocking mode (the default), the entire data is always written (again, this is different from usual Unix device semantics). If the device is in non-blocking mode, some - data may not be written - ---see :meth:`writeall`. + data may not be written---see :meth:`writeall`. .. versionchanged:: 3.5 Writable :term:`bytes-like object` is now accepted. diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst index b256312d91a8..c8f6904f9b1f 100644 --- a/Doc/library/stat.rst +++ b/Doc/library/stat.rst @@ -81,9 +81,9 @@ mode: .. function:: S_IMODE(mode) - Return the portion of the file's mode that can be set by :func:`os.chmod`\ - ---that is, the file's permission bits, plus the sticky bit, set-group-id, and - set-user-id bits (on systems that support them). + Return the portion of the file's mode that can be set by + :func:`os.chmod`\ ---that is, the file's permission bits, plus the sticky + bit, set-group-id, and set-user-id bits (on systems that support them). .. function:: S_IFMT(mode) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 7ed52ab47762..d0ef089a41a6 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -458,11 +458,11 @@ The available integer presentation types are: +---------+----------------------------------------------------------+ | ``'o'`` | Octal format. Outputs the number in base 8. | +---------+----------------------------------------------------------+ - | ``'x'`` | Hex format. Outputs the number in base 16, using lower- | - | | case letters for the digits above 9. | + | ``'x'`` | Hex format. Outputs the number in base 16, using | + | | lower-case letters for the digits above 9. | +---------+----------------------------------------------------------+ - | ``'X'`` | Hex format. Outputs the number in base 16, using upper- | - | | case letters for the digits above 9. | + | ``'X'`` | Hex format. Outputs the number in base 16, using | + | | upper-case letters for the digits above 9. | +---------+----------------------------------------------------------+ | ``'n'`` | Number. This is the same as ``'d'``, except that it uses | | | the current locale setting to insert the appropriate | diff --git a/Doc/library/termios.rst b/Doc/library/termios.rst index 7693ecd02789..d75a87c55a46 100644 --- a/Doc/library/termios.rst +++ b/Doc/library/termios.rst @@ -51,8 +51,8 @@ The module defines the following functions: .. function:: tcsendbreak(fd, duration) - Send a break on file descriptor *fd*. A zero *duration* sends a break for 0.25 - --0.5 seconds; a nonzero *duration* has a system dependent meaning. + Send a break on file descriptor *fd*. A zero *duration* sends a break for + 0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning. .. function:: tcdrain(fd) diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index c407ad433d85..bf6fbe21a7f7 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -572,8 +572,8 @@ or tuple:: .. index:: single: **; in function calls -In the same fashion, dictionaries can deliver keyword arguments with the ``**``\ --operator:: +In the same fashion, dictionaries can deliver keyword arguments with the +``**``\ -operator:: >>> def parrot(voltage, state='a stiff', action='voom'): ... print("-- This parrot wouldn't", action, end=' ') diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst index 0aa6003f4c46..c2ae866b73b8 100644 --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -576,9 +576,9 @@ similar to a :keyword:`return` statement. The big difference between variables are preserved. On the next call to the generator's ``next()`` method, the function will resume executing immediately after the :keyword:`yield` statement. (For complicated reasons, the :keyword:`yield` statement isn't -allowed inside the :keyword:`try` block of a :keyword:`try`...\ -:keyword:`finally` statement; read :pep:`255` for a full explanation of the -interaction between :keyword:`yield` and exceptions.) +allowed inside the :keyword:`try` block of a +:keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full +explanation of the interaction between :keyword:`yield` and exceptions.) Here's a sample usage of the :func:`generate_ints` generator:: diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst index 590015af98f1..37ba7c09c917 100644 --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -162,9 +162,9 @@ similar to a :keyword:`return` statement. The big difference between variables are preserved. On the next call to the generator's ``.next()`` method, the function will resume executing immediately after the :keyword:`yield` statement. (For complicated reasons, the :keyword:`yield` -statement isn't allowed inside the :keyword:`try` block of a :keyword:`try`...\ -:keyword:`finally` statement; read :pep:`255` for a full explanation of the -interaction between :keyword:`yield` and exceptions.) +statement isn't allowed inside the :keyword:`try` block of a +:keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full +explanation of the interaction between :keyword:`yield` and exceptions.) Here's a sample usage of the :func:`generate_ints` generator:: @@ -1247,8 +1247,8 @@ complete list of changes, or look through the CVS logs for all the details. will have to change your ``import`` statements to import it as :mod:`bsddb`. * The new :mod:`bz2` module is an interface to the bz2 data compression library. - bz2-compressed data is usually smaller than corresponding :mod:`zlib`\ - -compressed data. (Contributed by Gustavo Niemeyer.) + bz2-compressed data is usually smaller than corresponding + :mod:`zlib`\ -compressed data. (Contributed by Gustavo Niemeyer.) * A set of standard date/time types has been added in the new :mod:`datetime` module. See the following section for more details. diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst index d70b64205818..f803a29ccefd 100644 --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -448,8 +448,9 @@ when you're doing something with the returned value, as in the above example. The parentheses aren't always necessary, but it's easier to always add them instead of having to remember when they're needed. -(:pep:`342` explains the exact rules, which are that a :keyword:`yield`\ --expression must always be parenthesized except when it occurs at the top-level +(:pep:`342` explains the exact rules, which are that a +:keyword:`yield`\ -expression must always be parenthesized except when it +occurs at the top-level expression on the right-hand side of an assignment. This means you can write ``val = yield i`` but have to use parentheses when there's an operation, as in ``val = (yield i) + 12``.) diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 65971700c8b5..10996233ff6e 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1452,10 +1452,10 @@ in :issue:`18143`.) :class:`~ssl.SSLContext` has a new method, :meth:`~ssl.SSLContext.cert_store_stats`, that reports the number of loaded -``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists (``crl``\ -s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that returns a -list of the loaded ``CA`` certificates. (Contributed by Christian Heimes in -:issue:`18147`.) +``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists +(``crl``\ s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that +returns a list of the loaded ``CA`` certificates. (Contributed by Christian +Heimes in :issue:`18147`.) If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control the diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 02391de0dbc0..5397206030fe 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -434,8 +434,9 @@ CPython bytecode changes * The interpreter loop has been simplified by moving the logic of unrolling the stack of blocks into the compiler. The compiler emits now explicit - instructions for adjusting the stack of values and calling the cleaning- - up code for :keyword:`break`, :keyword:`continue` and :keyword:`return`. + instructions for adjusting the stack of values and calling the + cleaning-up code for :keyword:`break`, :keyword:`continue` and + :keyword:`return`. Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index 31ec21fdd8fd..62406e1aa008 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -2706,8 +2706,8 @@ Added support for the "xztar" format in the shutil module. .. nonce: ZLsRil .. section: Library -Don't force 3rd party C extensions to be built with -Werror=declaration- -after-statement. +Don't force 3rd party C extensions to be built with +-Werror=declaration-after-statement. .. @@ -4464,8 +4464,8 @@ Improve repr of inspect.Signature and inspect.Parameter. .. nonce: DFMEgN .. section: Library -Fix inspect.getcallargs() to raise correct TypeError for missing keyword- -only arguments. Patch by Jeremiah Lowin. +Fix inspect.getcallargs() to raise correct TypeError for missing +keyword-only arguments. Patch by Jeremiah Lowin. .. @@ -5059,8 +5059,8 @@ Anticipated fixes to support OS X versions > 10.9. .. nonce: KAl7aO .. section: Build -Prevent possible segfaults and other random failures of python --generate- -posix-vars in pybuilddir.txt build target. +Prevent possible segfaults and other random failures of python +--generate-posix-vars in pybuilddir.txt build target. .. diff --git a/Misc/NEWS.d/3.5.0a3.rst b/Misc/NEWS.d/3.5.0a3.rst index 0e5d7c599d32..a81d67aea866 100644 --- a/Misc/NEWS.d/3.5.0a3.rst +++ b/Misc/NEWS.d/3.5.0a3.rst @@ -62,8 +62,8 @@ Fix the default __sizeof__ implementation for variable-sized objects. .. nonce: b5M04V .. section: Library -The groupindex attribute of regular expression pattern object now is non- -modifiable mapping. +The groupindex attribute of regular expression pattern object now is +non-modifiable mapping. .. diff --git a/Misc/NEWS.d/3.5.0b3.rst b/Misc/NEWS.d/3.5.0b3.rst index 5e981f8badd1..742814b75cf4 100644 --- a/Misc/NEWS.d/3.5.0b3.rst +++ b/Misc/NEWS.d/3.5.0b3.rst @@ -110,8 +110,8 @@ by Martin Panter. .. nonce: aAbWbQ .. section: Library -Restore semantic round-trip correctness in tokenize/untokenize for tab- -indented blocks. +Restore semantic round-trip correctness in tokenize/untokenize for +tab-indented blocks. .. diff --git a/Misc/NEWS.d/3.5.0b4.rst b/Misc/NEWS.d/3.5.0b4.rst index 51cefe2a1f82..2b1b98a4316f 100644 --- a/Misc/NEWS.d/3.5.0b4.rst +++ b/Misc/NEWS.d/3.5.0b4.rst @@ -224,8 +224,8 @@ segment. .. nonce: hwXwCH .. section: Library -SMTP.auth() and SMTP.login() now support RFC 4954's optional initial- -response argument to the SMTP AUTH command. +SMTP.auth() and SMTP.login() now support RFC 4954's optional +initial-response argument to the SMTP AUTH command. .. diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst index efefaa14fdaa..d06817ccb950 100644 --- a/Misc/NEWS.d/3.5.1rc1.rst +++ b/Misc/NEWS.d/3.5.1rc1.rst @@ -159,8 +159,8 @@ twice. On Solaris 11.3 or newer, os.urandom() now uses the getrandom() function instead of the getentropy() function. The getentropy() function is blocking -to generate very good quality entropy, os.urandom() doesn't need such high- -quality entropy. +to generate very good quality entropy, os.urandom() doesn't need such +high-quality entropy. .. @@ -1083,11 +1083,11 @@ them a 'sheet'. Patch by Mark Roseman. .. nonce: -j_BV7 .. section: IDLE -Enhance the initial html viewer now used for Idle Help. * Properly indent -fixed-pitch text (patch by Mark Roseman). * Give code snippet a very Sphinx- -like light blueish-gray background. * Re-use initial width and height set by -users for shell and editor. * When the Table of Contents (TOC) menu is used, -put the section header at the top of the screen. +Enhance the initial html viewer now used for Idle Help. Properly indent +fixed-pitch text (patch by Mark Roseman). Give code snippet a very +Sphinx-like light blueish-gray background. Re-use initial width and height +set by users for shell and editor. When the Table of Contents (TOC) menu is +used, put the section header at the top of the screen. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 23486e31116f..b37ec096241e 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -568,9 +568,9 @@ string. Original fix by J?n Janech. .. section: Library The "urllib.request" module now percent-encodes non-ASCII bytes found in -redirect target URLs. Some servers send Location header fields with non- -ASCII bytes, but "http.client" requires the request target to be ASCII- -encodable, otherwise a UnicodeEncodeError is raised. Based on patch by +redirect target URLs. Some servers send Location header fields with +non-ASCII bytes, but "http.client" requires the request target to be +ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch by Christian Heimes. .. @@ -1952,10 +1952,10 @@ Fix linking extension modules for cross builds. Patch by Xavier de Gaye. .. nonce: HDjM4s .. section: Build -Disable the rules for running _freeze_importlib and pgen when cross- -compiling. The output of these programs is normally saved with the source -code anyway, and is still regenerated when doing a native build. Patch by -Xavier de Gaye. +Disable the rules for running _freeze_importlib and pgen when +cross-compiling. The output of these programs is normally saved with the +source code anyway, and is still regenerated when doing a native build. +Patch by Xavier de Gaye. .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index 3a51fad2472c..21ee2b524fc6 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -81,8 +81,8 @@ astral characters. Patch by Xiang Zhang. .. nonce: RYbEGH .. section: Core and Builtins -Extra slash no longer added to sys.path components in case of empty compile- -time PYTHONPATH components. +Extra slash no longer added to sys.path components in case of empty +compile-time PYTHONPATH components. .. @@ -349,8 +349,8 @@ Patch written by Xiang Zhang. .. section: Core and Builtins Standard __import__() no longer look up "__import__" in globals or builtins -for importing submodules or "from import". Fixed handling an error of non- -string package name. +for importing submodules or "from import". Fixed handling an error of +non-string package name. .. @@ -1124,10 +1124,10 @@ after a commit. .. nonce: cYraeH .. section: Library -A new version of typing.py from https://github.com/python/typing: - -Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__ -(upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove the -dict constraint in ForwardRef._eval_type (upstream #252) +A new version of typing.py from https://github.com/python/typing: +Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__ +(upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the +dict constraint in ForwardRef._eval_type (upstream #252). .. @@ -2070,9 +2070,9 @@ Update message in validate_ucrtbase.py .. section: Build Cause lack of llvm-profdata tool when using clang as required for PGO -linking to be a configure time error rather than make time when --with- -optimizations is enabled. Also improve our ability to find the llvm- -profdata tool on MacOS and some Linuxes. +linking to be a configure time error rather than make time when +--with-optimizations is enabled. Also improve our ability to find the +llvm-profdata tool on MacOS and some Linuxes. .. @@ -2131,7 +2131,7 @@ CPP invocation in configure must use CPPFLAGS. Patch by Chi Hsuan Yen. .. section: Build The configure script now inserts comments into the makefile to prevent the -pgen and _freeze_importlib executables from being cross- compiled. +pgen and _freeze_importlib executables from being cross-compiled. .. diff --git a/Misc/NEWS.d/3.5.4rc1.rst b/Misc/NEWS.d/3.5.4rc1.rst index 0eb85d1d7cfe..5af08cbe4ce0 100644 --- a/Misc/NEWS.d/3.5.4rc1.rst +++ b/Misc/NEWS.d/3.5.4rc1.rst @@ -20,8 +20,8 @@ Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple security vulnerabilities including: CVE-2017-9233 (External entity infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and CVE-2012-0876 -(Counter hash flooding with SipHash). Note: the CVE-2016-5300 (Use os- -specific entropy sources like getrandom) doesn't impact Python, since Python +(Counter hash flooding with SipHash). Note: the CVE-2016-5300 (Use +os-specific entropy sources like getrandom) doesn't impact Python, since Python already gets entropy from the OS to set the expat secret using ``XML_SetHashSalt()``. @@ -290,8 +290,8 @@ Update zlib to 1.2.11. .. nonce: N3KI-o .. section: Library -os.listdir() and os.scandir() now emit bytes names when called with bytes- -like argument. +os.listdir() and os.scandir() now emit bytes names when called with +bytes-like argument. .. @@ -559,8 +559,8 @@ is received. .. section: Library Various updates to typing module: add typing.NoReturn type, use -WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis- -Hilliard and Ivan Levkivskyi. +WrapperDescriptorType, minor bug-fixes. Original PRs by Jim +Fasarakis-Hilliard and Ivan Levkivskyi. .. @@ -1070,8 +1070,8 @@ default locale encoding is a multi-byte encoding) .. section: Build Prevent unnecessary rebuilding of Python during ``make test``, ``make -install`` and some other make targets when configured with ``--enable- -optimizations``. +install`` and some other make targets when configured with +``--enable-optimizations``. .. diff --git a/Misc/NEWS.d/next/Documentation/2018-06-07-08-33-45.bpo-17045.ZNx6KU.rst b/Misc/NEWS.d/next/Documentation/2018-06-07-08-33-45.bpo-17045.ZNx6KU.rst index 0f3836c10d38..15f7b445b82b 100644 --- a/Misc/NEWS.d/next/Documentation/2018-06-07-08-33-45.bpo-17045.ZNx6KU.rst +++ b/Misc/NEWS.d/next/Documentation/2018-06-07-08-33-45.bpo-17045.ZNx6KU.rst @@ -1,3 +1,3 @@ -Improve the C-API doc for PyTypeObject. This includes adding several quick- -reference tables and a lot of missing slot/typedef entries. The existing -entries were also cleaned up with a slightly more consistent format. +Improve the C-API doc for PyTypeObject. This includes adding several +quick-reference tables and a lot of missing slot/typedef entries. The +existing entries were also cleaned up with a slightly more consistent format. diff --git a/Misc/NEWS.d/next/IDLE/2018-06-26-22-53-14.bpo-33975.Ow7alv.rst b/Misc/NEWS.d/next/IDLE/2018-06-26-22-53-14.bpo-33975.Ow7alv.rst index fd975bbff3b3..03f6a1957650 100644 --- a/Misc/NEWS.d/next/IDLE/2018-06-26-22-53-14.bpo-33975.Ow7alv.rst +++ b/Misc/NEWS.d/next/IDLE/2018-06-26-22-53-14.bpo-33975.Ow7alv.rst @@ -1,3 +1,3 @@ -Avoid small type when running htests. Since part of the purpose of human- -viewed tests is to determine that widgets look right, it is important that -they look the same for testing as when running IDLE. +Avoid small type when running htests. Since part of the purpose of +human-viewed tests is to determine that widgets look right, it is important +that they look the same for testing as when running IDLE. diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst index 33f6dc4d8821..991bae38ec72 100644 --- a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -1,2 +1,2 @@ -Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- -overlapping' and changing '!=' to '<'. +Improve difflib.SequenceManager.get_matching_blocks doc by adding +'non-overlapping' and changing '!=' to '<'. From webhook-mailer at python.org Tue Oct 30 20:28:10 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 31 Oct 2018 00:28:10 -0000 Subject: [Python-checkins] bpo-33138: Change standard error message for non-pickleable and non-copyable types. (GH-6239) Message-ID: https://github.com/python/cpython/commit/0353b4eaaf451ad463ce7eb3074f6b62d332f401 commit: 0353b4eaaf451ad463ce7eb3074f6b62d332f401 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-31T02:28:07+02:00 summary: bpo-33138: Change standard error message for non-pickleable and non-copyable types. (GH-6239) files: A Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-25-14.bpo-33138.aSqudH.rst M Lib/_pyio.py M Lib/copyreg.py M Lib/socket.py M Modules/_bz2module.c M Modules/_io/bufferedio.c M Modules/_io/fileio.c M Modules/_io/textio.c M Modules/_io/winconsoleio.c M Modules/_lzmamodule.c M Objects/typeobject.c diff --git a/Lib/_pyio.py b/Lib/_pyio.py index b8975ff533d7..e4a879941e1d 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -814,8 +814,7 @@ def mode(self): return self.raw.mode def __getstate__(self): - raise TypeError("can not serialize a '{0}' object" - .format(self.__class__.__name__)) + raise TypeError(f"cannot pickle {self.__class__.__name__!r} object") def __repr__(self): modname = self.__class__.__module__ @@ -1554,7 +1553,7 @@ def __del__(self): self.close() def __getstate__(self): - raise TypeError("cannot serialize '%s' object", self.__class__.__name__) + raise TypeError(f"cannot pickle {self.__class__.__name__!r} object") def __repr__(self): class_name = '%s.%s' % (self.__class__.__module__, diff --git a/Lib/copyreg.py b/Lib/copyreg.py index bbe1af4e2e7e..dfc463c49a38 100644 --- a/Lib/copyreg.py +++ b/Lib/copyreg.py @@ -53,7 +53,8 @@ def _reconstructor(cls, base, state): def _reduce_ex(self, proto): assert proto < 2 - for base in self.__class__.__mro__: + cls = self.__class__ + for base in cls.__mro__: if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE: break else: @@ -61,16 +62,18 @@ def _reduce_ex(self, proto): if base is object: state = None else: - if base is self.__class__: - raise TypeError("can't pickle %s objects" % base.__name__) + if base is cls: + raise TypeError(f"cannot pickle {cls.__name__!r} object") state = base(self) - args = (self.__class__, base, state) + args = (cls, base, state) try: getstate = self.__getstate__ except AttributeError: if getattr(self, "__slots__", None): - raise TypeError("a class that defines __slots__ without " - "defining __getstate__ cannot be pickled") from None + raise TypeError(f"cannot pickle {cls.__name__!r} object: " + f"a class that defines __slots__ without " + f"defining __getstate__ cannot be pickled " + f"with protocol {proto}") from None try: dict = self.__dict__ except AttributeError: diff --git a/Lib/socket.py b/Lib/socket.py index 385844b58532..772b9e185bf1 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -189,7 +189,7 @@ def __repr__(self): return s def __getstate__(self): - raise TypeError("Cannot serialize socket object") + raise TypeError(f"cannot pickle {self.__class__.__name__!r} object") def dup(self): """dup() -> socket object diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-25-14.bpo-33138.aSqudH.rst b/Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-25-14.bpo-33138.aSqudH.rst new file mode 100644 index 000000000000..6f445261843f --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-25-14.bpo-33138.aSqudH.rst @@ -0,0 +1,2 @@ +Changed standard error message for non-pickleable and non-copyable types. It +now says "cannot pickle" instead of "can't pickle" or "cannot serialize". diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c index f0d9588fe55d..b5e5a79d50a5 100644 --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -264,14 +264,6 @@ _bz2_BZ2Compressor_flush_impl(BZ2Compressor *self) return result; } -static PyObject * -BZ2Compressor_getstate(BZ2Compressor *self, PyObject *noargs) -{ - PyErr_Format(PyExc_TypeError, "cannot serialize '%s' object", - Py_TYPE(self)->tp_name); - return NULL; -} - static void* BZ2_Malloc(void* ctx, int items, int size) { @@ -347,7 +339,6 @@ BZ2Compressor_dealloc(BZ2Compressor *self) static PyMethodDef BZ2Compressor_methods[] = { _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF - {"__getstate__", (PyCFunction)BZ2Compressor_getstate, METH_NOARGS}, {NULL} }; @@ -612,14 +603,6 @@ _bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data, return result; } -static PyObject * -BZ2Decompressor_getstate(BZ2Decompressor *self, PyObject *noargs) -{ - PyErr_Format(PyExc_TypeError, "cannot serialize '%s' object", - Py_TYPE(self)->tp_name); - return NULL; -} - /*[clinic input] _bz2.BZ2Decompressor.__init__ @@ -679,7 +662,6 @@ BZ2Decompressor_dealloc(BZ2Decompressor *self) static PyMethodDef BZ2Decompressor_methods[] = { _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF - {"__getstate__", (PyCFunction)BZ2Decompressor_getstate, METH_NOARGS}, {NULL} }; diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 9d3b4466493c..2eb5262f0f7b 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -608,16 +608,6 @@ buffered_isatty(buffered *self, PyObject *Py_UNUSED(ignored)) return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_isatty, NULL); } -/* Serialization */ - -static PyObject * -buffered_getstate(buffered *self, PyObject *Py_UNUSED(ignored)) -{ - PyErr_Format(PyExc_TypeError, - "cannot serialize '%s' object", Py_TYPE(self)->tp_name); - return NULL; -} - /* Forward decls */ static PyObject * _bufferedwriter_flush_unlocked(buffered *); @@ -2394,7 +2384,6 @@ static PyMethodDef bufferedreader_methods[] = { {"fileno", (PyCFunction)buffered_fileno, METH_NOARGS}, {"isatty", (PyCFunction)buffered_isatty, METH_NOARGS}, {"_dealloc_warn", (PyCFunction)buffered_dealloc_warn, METH_O}, - {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS}, _IO__BUFFERED_READ_METHODDEF _IO__BUFFERED_PEEK_METHODDEF @@ -2485,7 +2474,6 @@ static PyMethodDef bufferedwriter_methods[] = { {"fileno", (PyCFunction)buffered_fileno, METH_NOARGS}, {"isatty", (PyCFunction)buffered_isatty, METH_NOARGS}, {"_dealloc_warn", (PyCFunction)buffered_dealloc_warn, METH_O}, - {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS}, _IO_BUFFEREDWRITER_WRITE_METHODDEF _IO__BUFFERED_TRUNCATE_METHODDEF @@ -2579,8 +2567,6 @@ static PyMethodDef bufferedrwpair_methods[] = { {"close", (PyCFunction)bufferedrwpair_close, METH_NOARGS}, {"isatty", (PyCFunction)bufferedrwpair_isatty, METH_NOARGS}, - {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS}, - {NULL, NULL} }; @@ -2652,7 +2638,6 @@ static PyMethodDef bufferedrandom_methods[] = { {"fileno", (PyCFunction)buffered_fileno, METH_NOARGS}, {"isatty", (PyCFunction)buffered_isatty, METH_NOARGS}, {"_dealloc_warn", (PyCFunction)buffered_dealloc_warn, METH_O}, - {"__getstate__", (PyCFunction)buffered_getstate, METH_NOARGS}, {"flush", (PyCFunction)buffered_flush, METH_NOARGS}, diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 44d51c9faf5d..ffcb73012953 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -1120,14 +1120,6 @@ _io_FileIO_isatty_impl(fileio *self) return PyBool_FromLong(res); } -static PyObject * -fileio_getstate(fileio *self, PyObject *Py_UNUSED(ignored)) -{ - PyErr_Format(PyExc_TypeError, - "cannot serialize '%s' object", Py_TYPE(self)->tp_name); - return NULL; -} - #include "clinic/fileio.c.h" static PyMethodDef fileio_methods[] = { @@ -1145,7 +1137,6 @@ static PyMethodDef fileio_methods[] = { _IO_FILEIO_FILENO_METHODDEF _IO_FILEIO_ISATTY_METHODDEF {"_dealloc_warn", (PyCFunction)fileio_dealloc_warn, METH_O, NULL}, - {"__getstate__", (PyCFunction)fileio_getstate, METH_NOARGS, NULL}, {NULL, NULL} /* sentinel */ }; diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index a466d3a03a5b..3a3667b39da8 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -2891,14 +2891,6 @@ _io_TextIOWrapper_isatty_impl(textio *self) return _PyObject_CallMethodId(self->buffer, &PyId_isatty, NULL); } -static PyObject * -textiowrapper_getstate(textio *self, PyObject *args) -{ - PyErr_Format(PyExc_TypeError, - "cannot serialize '%s' object", Py_TYPE(self)->tp_name); - return NULL; -} - /*[clinic input] _io.TextIOWrapper.flush [clinic start generated code]*/ @@ -3132,7 +3124,6 @@ static PyMethodDef textiowrapper_methods[] = { _IO_TEXTIOWRAPPER_READABLE_METHODDEF _IO_TEXTIOWRAPPER_WRITABLE_METHODDEF _IO_TEXTIOWRAPPER_ISATTY_METHODDEF - {"__getstate__", (PyCFunction)textiowrapper_getstate, METH_NOARGS}, _IO_TEXTIOWRAPPER_SEEK_METHODDEF _IO_TEXTIOWRAPPER_TELL_METHODDEF diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 13342ec239d6..148255c354a4 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -1060,14 +1060,6 @@ _io__WindowsConsoleIO_isatty_impl(winconsoleio *self) Py_RETURN_TRUE; } -static PyObject * -winconsoleio_getstate(winconsoleio *self, PyObject *Py_UNUSED(ignored)) -{ - PyErr_Format(PyExc_TypeError, - "cannot serialize '%s' object", Py_TYPE(self)->tp_name); - return NULL; -} - #include "clinic/winconsoleio.c.h" static PyMethodDef winconsoleio_methods[] = { @@ -1080,7 +1072,6 @@ static PyMethodDef winconsoleio_methods[] = { _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF - {"__getstate__", (PyCFunction)winconsoleio_getstate, METH_NOARGS, NULL}, {NULL, NULL} /* sentinel */ }; diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index bb7a7ec50ce0..b5f9561df2ad 100644 --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -591,14 +591,6 @@ _lzma_LZMACompressor_flush_impl(Compressor *self) return result; } -static PyObject * -Compressor_getstate(Compressor *self, PyObject *noargs) -{ - PyErr_Format(PyExc_TypeError, "cannot serialize '%s' object", - Py_TYPE(self)->tp_name); - return NULL; -} - static int Compressor_init_xz(lzma_stream *lzs, int check, uint32_t preset, PyObject *filterspecs) @@ -794,7 +786,6 @@ Compressor_dealloc(Compressor *self) static PyMethodDef Compressor_methods[] = { _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF - {"__getstate__", (PyCFunction)Compressor_getstate, METH_NOARGS}, {NULL} }; @@ -1078,14 +1069,6 @@ _lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data, return result; } -static PyObject * -Decompressor_getstate(Decompressor *self, PyObject *noargs) -{ - PyErr_Format(PyExc_TypeError, "cannot serialize '%s' object", - Py_TYPE(self)->tp_name); - return NULL; -} - static int Decompressor_init_raw(lzma_stream *lzs, PyObject *filterspecs) { @@ -1235,7 +1218,6 @@ Decompressor_dealloc(Decompressor *self) static PyMethodDef Decompressor_methods[] = { _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF - {"__getstate__", (PyCFunction)Decompressor_getstate, METH_NOARGS}, {NULL} }; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 8e91e33d2d10..722fe5f94735 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4122,7 +4122,7 @@ _PyObject_GetState(PyObject *obj, int required) if (required && obj->ob_type->tp_itemsize) { PyErr_Format(PyExc_TypeError, - "can't pickle %.200s objects", + "cannot pickle '%.200s' object", Py_TYPE(obj)->tp_name); return NULL; } @@ -4163,7 +4163,7 @@ _PyObject_GetState(PyObject *obj, int required) Py_DECREF(slotnames); Py_DECREF(state); PyErr_Format(PyExc_TypeError, - "can't pickle %.200s objects", + "cannot pickle '%.200s' object", Py_TYPE(obj)->tp_name); return NULL; } @@ -4400,7 +4400,7 @@ reduce_newobj(PyObject *obj) if (Py_TYPE(obj)->tp_new == NULL) { PyErr_Format(PyExc_TypeError, - "can't pickle %.200s objects", + "cannot pickle '%.200s' object", Py_TYPE(obj)->tp_name); return NULL; } From webhook-mailer at python.org Wed Oct 31 05:00:30 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 31 Oct 2018 09:00:30 -0000 Subject: [Python-checkins] [3.7] bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231). (GH-10253) Message-ID: https://github.com/python/cpython/commit/b183750f999953bac7738b1fff114e0a2615d970 commit: b183750f999953bac7738b1fff114e0a2615d970 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2018-10-31T11:00:24+02:00 summary: [3.7] bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231). (GH-10253) (cherry picked from commit 3f819ca138db6945ee4271bf13e42db9f9b3b1e4) files: M Doc/c-api/veryhigh.rst M Doc/distutils/apiref.rst M Doc/distutils/builtdist.rst M Doc/distutils/configfile.rst M Doc/extending/extending.rst M Doc/howto/logging.rst M Doc/install/index.rst M Doc/library/codecs.rst M Doc/library/datetime.rst M Doc/library/email.compat32-message.rst M Doc/library/email.message.rst M Doc/library/logging.rst M Doc/library/optparse.rst M Doc/library/os.rst M Doc/library/ossaudiodev.rst M Doc/library/stat.rst M Doc/library/string.rst M Doc/library/termios.rst M Doc/tutorial/controlflow.rst M Doc/whatsnew/2.2.rst M Doc/whatsnew/2.3.rst M Doc/whatsnew/2.5.rst M Doc/whatsnew/3.4.rst M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.0a3.rst M Misc/NEWS.d/3.5.0b3.rst M Misc/NEWS.d/3.5.0b4.rst M Misc/NEWS.d/3.5.1rc1.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.5.4rc1.rst M Misc/NEWS.d/3.7.1rc1.rst M Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index cefe9d44bf45..c891f6320f94 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -306,7 +306,7 @@ the same library that the Python runtime is using. Evaluate a precompiled code object, given a particular environment for its evaluation. This environment consists of a dictionary of global variables, a mapping object of local variables, arrays of arguments, keywords and - defaults, a dictionary of default values for :ref:`keyword-only\ + defaults, a dictionary of default values for :ref:`keyword-only ` arguments and a closure tuple of cells. diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index 3c89468220a4..dccd7ce236cb 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -183,8 +183,9 @@ the full reference. | *sources* | list of source filenames, | a list of strings | | | relative to the distribution | | | | root (where the setup script | | - | | lives), in Unix form (slash- | | - | | separated) for portability. | | + | | lives), in Unix form | | + | | (slash-separated) for | | + | | portability. | | | | Source files may be C, C++, | | | | SWIG (.i), platform-specific | | | | resource files, or whatever | | @@ -1566,8 +1567,8 @@ lines, and joining lines with backslashes. +------------------+--------------------------------+---------+ | option name | description | default | +==================+================================+=========+ - | *strip_comments* | strip from ``'#'`` to end-of- | true | - | | line, as well as any | | + | *strip_comments* | strip from ``'#'`` to | true | + | | end-of-line, as well as any | | | | whitespace leading up to the | | | | ``'#'``\ ---unless it is | | | | escaped by a backslash | | diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst index 758bd141ac95..f1f347126160 100644 --- a/Doc/distutils/builtdist.rst +++ b/Doc/distutils/builtdist.rst @@ -63,9 +63,9 @@ distribution to generate: for example, :: python setup.py bdist --format=zip -would, when run on a Unix system, create :file:`Distutils-1.0.{plat}.zip`\ ----again, this archive would be unpacked from the root directory to install the -Distutils. +would, when run on a Unix system, create +:file:`Distutils-1.0.{plat}.zip`\ ---again, this archive would be unpacked +from the root directory to install the Distutils. The available formats for built distributions are: diff --git a/Doc/distutils/configfile.rst b/Doc/distutils/configfile.rst index cd10a7fdf315..0874d05fe703 100644 --- a/Doc/distutils/configfile.rst +++ b/Doc/distutils/configfile.rst @@ -13,8 +13,8 @@ edit is a cheap and easy way to solicit it. Configuration files also let you provide default values for any command option, which the installer can then override either on the command-line or by editing the config file. -The setup configuration file is a useful middle-ground between the setup script ----which, ideally, would be opaque to installers [#]_---and the command-line to +The setup configuration file is a useful middle-ground between the setup +script---which, ideally, would be opaque to installers [#]_---and the command-line to the setup script, which is outside of your control and entirely up to the installer. In fact, :file:`setup.cfg` (and any other Distutils configuration files present on the target system) are processed after the contents of the diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 82b689e064c1..b788a5575b3f 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -545,8 +545,9 @@ or more format codes between parentheses. For example:: :c:func:`PyObject_CallObject` returns a Python object pointer: this is the return value of the Python function. :c:func:`PyObject_CallObject` is "reference-count-neutral" with respect to its arguments. In the example a new -tuple was created to serve as the argument list, which is :c:func:`Py_DECREF`\ --ed immediately after the :c:func:`PyObject_CallObject` call. +tuple was created to serve as the argument list, which is +:c:func:`Py_DECREF`\ -ed immediately after the :c:func:`PyObject_CallObject` +call. The return value of :c:func:`PyObject_CallObject` is "new": either it is a brand new object, or it is an existing object whose reference count has been diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index 47b5c680c424..2a2282e9ecf0 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -971,7 +971,7 @@ provided: The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` classes are defined in the core logging package. The other handlers are -defined in a sub- module, :mod:`logging.handlers`. (There is also another +defined in a sub-module, :mod:`logging.handlers`. (There is also another sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the diff --git a/Doc/install/index.rst b/Doc/install/index.rst index 92cdf2f11443..f6a8cd6833a9 100644 --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -554,10 +554,10 @@ C headers ``--install-headers`` These override options can be relative, absolute, or explicitly defined in terms of one of the installation base directories. -(There are two installation base directories, and they are normally the same--- -they only differ when you use the Unix "prefix scheme" and supply different -``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will -override values computed or given for ``--install-purelib`` and +(There are two installation base directories, and they are normally the +same---they only differ when you use the Unix "prefix scheme" and supply +different ``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` +will override values computed or given for ``--install-purelib`` and ``--install-platlib``, and is recommended for schemes that don't make a difference between Python and extension modules.) @@ -584,10 +584,10 @@ in this case.) If you maintain Python on Windows, you might want third-party modules to live in a subdirectory of :file:`{prefix}`, rather than right in :file:`{prefix}` -itself. This is almost as easy as customizing the script installation directory ----you just have to remember that there are two types of modules to worry about, -Python and extension modules, which can conveniently be both controlled by one -option:: +itself. This is almost as easy as customizing the script installation +directory---you just have to remember that there are two types of modules +to worry about, Python and extension modules, which can conveniently be both +controlled by one option:: python setup.py install --install-lib=Site diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 51bfad1d5274..ef788bf241c8 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1121,10 +1121,10 @@ particular, the following variants typically exist: | | ks_c-5601, ks_c-5601-1987, | | | | ksx1001, ks_x-1001 | | +-----------------+--------------------------------+--------------------------------+ -| gb2312 | chinese, csiso58gb231280, euc- | Simplified Chinese | -| | cn, euccn, eucgb2312-cn, | | -| | gb2312-1980, gb2312-80, iso- | | -| | ir-58 | | +| gb2312 | chinese, csiso58gb231280, | Simplified Chinese | +| | euc-cn, euccn, eucgb2312-cn, | | +| | gb2312-1980, gb2312-80, | | +| | iso-ir-58 | | +-----------------+--------------------------------+--------------------------------+ | gbk | 936, cp936, ms936 | Unified Chinese | +-----------------+--------------------------------+--------------------------------+ diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 0363111ef55f..db3a6522c24f 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -276,9 +276,10 @@ Supported operations: | ``+t1`` | Returns a :class:`timedelta` object with the | | | same value. (2) | +--------------------------------+-----------------------------------------------+ -| ``-t1`` | equivalent to :class:`timedelta`\ | -| | (-*t1.days*, -*t1.seconds*, | -| | -*t1.microseconds*), and to *t1*\* -1. (1)(4) | +| ``-t1`` | equivalent to | +| | :class:`timedelta`\ (-*t1.days*, | +| | -*t1.seconds*, -*t1.microseconds*), | +| | and to *t1*\* -1. (1)(4) | +--------------------------------+-----------------------------------------------+ | ``abs(t)`` | equivalent to +\ *t* when ``t.days >= 0``, and| | | to -*t* when ``t.days < 0``. (2) | diff --git a/Doc/library/email.compat32-message.rst b/Doc/library/email.compat32-message.rst index 2e189dccdb1a..d88495089482 100644 --- a/Doc/library/email.compat32-message.rst +++ b/Doc/library/email.compat32-message.rst @@ -149,8 +149,8 @@ Here are the methods of the :class:`Message` class: .. method:: is_multipart() - Return ``True`` if the message's payload is a list of sub-\ - :class:`Message` objects, otherwise return ``False``. When + Return ``True`` if the message's payload is a list of + sub-\ :class:`Message` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload. (Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst index 261d0d62cfe6..ff5404553e96 100644 --- a/Doc/library/email.message.rst +++ b/Doc/library/email.message.rst @@ -130,8 +130,8 @@ message objects. .. method:: is_multipart() - Return ``True`` if the message's payload is a list of sub-\ - :class:`EmailMessage` objects, otherwise return ``False``. When + Return ``True`` if the message's payload is a list of + sub-\ :class:`EmailMessage` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload). Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 07556537860d..0e65f316735e 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -882,7 +882,7 @@ re-entrant, and so cannot be invoked from such signal handlers. Module-Level Functions ---------------------- -In addition to the classes described above, there are a number of module- level +In addition to the classes described above, there are a number of module-level functions. diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index e9b82ee2ac13..3afc77bf9f8e 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -379,8 +379,8 @@ types is covered in section :ref:`optparse-extending-optparse`. Handling boolean (flag) options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Flag options---set a variable to true or false when a particular option is seen ----are quite common. :mod:`optparse` supports them with two separate actions, +Flag options---set a variable to true or false when a particular option is +seen---are quite common. :mod:`optparse` supports them with two separate actions, ``store_true`` and ``store_false``. For example, you might have a ``verbose`` flag that is turned on with ``-v`` and off with ``-q``:: @@ -388,8 +388,8 @@ flag that is turned on with ``-v`` and off with ``-q``:: parser.add_option("-q", action="store_false", dest="verbose") Here we have two different options with the same destination, which is perfectly -OK. (It just means you have to be a bit careful when setting default values--- -see below.) +OK. (It just means you have to be a bit careful when setting default +values---see below.) When :mod:`optparse` encounters ``-v`` on the command line, it sets ``options.verbose`` to ``True``; when it encounters ``-q``, @@ -525,9 +525,9 @@ help message: default: ``"Usage: %prog [options]"``, which is fine if your script doesn't take any positional arguments. -* every option defines a help string, and doesn't worry about line-wrapping--- - :mod:`optparse` takes care of wrapping lines and making the help output look - good. +* every option defines a help string, and doesn't worry about + line-wrapping---\ :mod:`optparse` takes care of wrapping lines and making + the help output look good. * options that take a value indicate this fact in their automatically-generated help message, e.g. for the "mode" option:: diff --git a/Doc/library/os.rst b/Doc/library/os.rst index f376ef93ca76..be417f44aa8d 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3702,11 +3702,11 @@ written in Python, such as a mail server's external command delivery program. .. function:: wait3(options) Similar to :func:`waitpid`, except no process id argument is given and a - 3-element tuple containing the child's process id, exit status indication, and - resource usage information is returned. Refer to :mod:`resource`.\ - :func:`~resource.getrusage` for details on resource usage information. The - option argument is the same as that provided to :func:`waitpid` and - :func:`wait4`. + 3-element tuple containing the child's process id, exit status indication, + and resource usage information is returned. Refer to + :mod:`resource`.\ :func:`~resource.getrusage` for details on resource usage + information. The option argument is the same as that provided to + :func:`waitpid` and :func:`wait4`. .. availability:: Unix. diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst index 522bb7e09242..a7d3dac363cd 100644 --- a/Doc/library/ossaudiodev.rst +++ b/Doc/library/ossaudiodev.rst @@ -153,8 +153,7 @@ and (read-only) attributes: number of bytes written. If the audio device is in blocking mode (the default), the entire data is always written (again, this is different from usual Unix device semantics). If the device is in non-blocking mode, some - data may not be written - ---see :meth:`writeall`. + data may not be written---see :meth:`writeall`. .. versionchanged:: 3.5 Writable :term:`bytes-like object` is now accepted. diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst index b256312d91a8..c8f6904f9b1f 100644 --- a/Doc/library/stat.rst +++ b/Doc/library/stat.rst @@ -81,9 +81,9 @@ mode: .. function:: S_IMODE(mode) - Return the portion of the file's mode that can be set by :func:`os.chmod`\ - ---that is, the file's permission bits, plus the sticky bit, set-group-id, and - set-user-id bits (on systems that support them). + Return the portion of the file's mode that can be set by + :func:`os.chmod`\ ---that is, the file's permission bits, plus the sticky + bit, set-group-id, and set-user-id bits (on systems that support them). .. function:: S_IFMT(mode) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 7ed52ab47762..d0ef089a41a6 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -458,11 +458,11 @@ The available integer presentation types are: +---------+----------------------------------------------------------+ | ``'o'`` | Octal format. Outputs the number in base 8. | +---------+----------------------------------------------------------+ - | ``'x'`` | Hex format. Outputs the number in base 16, using lower- | - | | case letters for the digits above 9. | + | ``'x'`` | Hex format. Outputs the number in base 16, using | + | | lower-case letters for the digits above 9. | +---------+----------------------------------------------------------+ - | ``'X'`` | Hex format. Outputs the number in base 16, using upper- | - | | case letters for the digits above 9. | + | ``'X'`` | Hex format. Outputs the number in base 16, using | + | | upper-case letters for the digits above 9. | +---------+----------------------------------------------------------+ | ``'n'`` | Number. This is the same as ``'d'``, except that it uses | | | the current locale setting to insert the appropriate | diff --git a/Doc/library/termios.rst b/Doc/library/termios.rst index 7693ecd02789..d75a87c55a46 100644 --- a/Doc/library/termios.rst +++ b/Doc/library/termios.rst @@ -51,8 +51,8 @@ The module defines the following functions: .. function:: tcsendbreak(fd, duration) - Send a break on file descriptor *fd*. A zero *duration* sends a break for 0.25 - --0.5 seconds; a nonzero *duration* has a system dependent meaning. + Send a break on file descriptor *fd*. A zero *duration* sends a break for + 0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning. .. function:: tcdrain(fd) diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index c407ad433d85..bf6fbe21a7f7 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -572,8 +572,8 @@ or tuple:: .. index:: single: **; in function calls -In the same fashion, dictionaries can deliver keyword arguments with the ``**``\ --operator:: +In the same fashion, dictionaries can deliver keyword arguments with the +``**``\ -operator:: >>> def parrot(voltage, state='a stiff', action='voom'): ... print("-- This parrot wouldn't", action, end=' ') diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst index 0aa6003f4c46..c2ae866b73b8 100644 --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -576,9 +576,9 @@ similar to a :keyword:`return` statement. The big difference between variables are preserved. On the next call to the generator's ``next()`` method, the function will resume executing immediately after the :keyword:`yield` statement. (For complicated reasons, the :keyword:`yield` statement isn't -allowed inside the :keyword:`try` block of a :keyword:`try`...\ -:keyword:`finally` statement; read :pep:`255` for a full explanation of the -interaction between :keyword:`yield` and exceptions.) +allowed inside the :keyword:`try` block of a +:keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full +explanation of the interaction between :keyword:`yield` and exceptions.) Here's a sample usage of the :func:`generate_ints` generator:: diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst index 590015af98f1..37ba7c09c917 100644 --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -162,9 +162,9 @@ similar to a :keyword:`return` statement. The big difference between variables are preserved. On the next call to the generator's ``.next()`` method, the function will resume executing immediately after the :keyword:`yield` statement. (For complicated reasons, the :keyword:`yield` -statement isn't allowed inside the :keyword:`try` block of a :keyword:`try`...\ -:keyword:`finally` statement; read :pep:`255` for a full explanation of the -interaction between :keyword:`yield` and exceptions.) +statement isn't allowed inside the :keyword:`try` block of a +:keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full +explanation of the interaction between :keyword:`yield` and exceptions.) Here's a sample usage of the :func:`generate_ints` generator:: @@ -1247,8 +1247,8 @@ complete list of changes, or look through the CVS logs for all the details. will have to change your ``import`` statements to import it as :mod:`bsddb`. * The new :mod:`bz2` module is an interface to the bz2 data compression library. - bz2-compressed data is usually smaller than corresponding :mod:`zlib`\ - -compressed data. (Contributed by Gustavo Niemeyer.) + bz2-compressed data is usually smaller than corresponding + :mod:`zlib`\ -compressed data. (Contributed by Gustavo Niemeyer.) * A set of standard date/time types has been added in the new :mod:`datetime` module. See the following section for more details. diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst index 79c5a73dcf2b..7a3384cbaa5d 100644 --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -448,8 +448,9 @@ when you're doing something with the returned value, as in the above example. The parentheses aren't always necessary, but it's easier to always add them instead of having to remember when they're needed. -(:pep:`342` explains the exact rules, which are that a :keyword:`yield`\ --expression must always be parenthesized except when it occurs at the top-level +(:pep:`342` explains the exact rules, which are that a +:keyword:`yield`\ -expression must always be parenthesized except when it +occurs at the top-level expression on the right-hand side of an assignment. This means you can write ``val = yield i`` but have to use parentheses when there's an operation, as in ``val = (yield i) + 12``.) diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 65971700c8b5..10996233ff6e 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1452,10 +1452,10 @@ in :issue:`18143`.) :class:`~ssl.SSLContext` has a new method, :meth:`~ssl.SSLContext.cert_store_stats`, that reports the number of loaded -``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists (``crl``\ -s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that returns a -list of the loaded ``CA`` certificates. (Contributed by Christian Heimes in -:issue:`18147`.) +``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists +(``crl``\ s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that +returns a list of the loaded ``CA`` certificates. (Contributed by Christian +Heimes in :issue:`18147`.) If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control the diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index 7eb8326a012f..aceee4135e14 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -2706,8 +2706,8 @@ Added support for the "xztar" format in the shutil module. .. nonce: ZLsRil .. section: Library -Don't force 3rd party C extensions to be built with -Werror=declaration- -after-statement. +Don't force 3rd party C extensions to be built with +-Werror=declaration-after-statement. .. @@ -4464,8 +4464,8 @@ Improve repr of inspect.Signature and inspect.Parameter. .. nonce: DFMEgN .. section: Library -Fix inspect.getcallargs() to raise correct TypeError for missing keyword- -only arguments. Patch by Jeremiah Lowin. +Fix inspect.getcallargs() to raise correct TypeError for missing +keyword-only arguments. Patch by Jeremiah Lowin. .. @@ -5059,8 +5059,8 @@ Anticipated fixes to support OS X versions > 10.9. .. nonce: KAl7aO .. section: Build -Prevent possible segfaults and other random failures of python --generate- -posix-vars in pybuilddir.txt build target. +Prevent possible segfaults and other random failures of python +--generate-posix-vars in pybuilddir.txt build target. .. diff --git a/Misc/NEWS.d/3.5.0a3.rst b/Misc/NEWS.d/3.5.0a3.rst index 0e5d7c599d32..a81d67aea866 100644 --- a/Misc/NEWS.d/3.5.0a3.rst +++ b/Misc/NEWS.d/3.5.0a3.rst @@ -62,8 +62,8 @@ Fix the default __sizeof__ implementation for variable-sized objects. .. nonce: b5M04V .. section: Library -The groupindex attribute of regular expression pattern object now is non- -modifiable mapping. +The groupindex attribute of regular expression pattern object now is +non-modifiable mapping. .. diff --git a/Misc/NEWS.d/3.5.0b3.rst b/Misc/NEWS.d/3.5.0b3.rst index bb4cc33cc990..f2f1610fd8a9 100644 --- a/Misc/NEWS.d/3.5.0b3.rst +++ b/Misc/NEWS.d/3.5.0b3.rst @@ -110,8 +110,8 @@ by Martin Panter. .. nonce: aAbWbQ .. section: Library -Restore semantic round-trip correctness in tokenize/untokenize for tab- -indented blocks. +Restore semantic round-trip correctness in tokenize/untokenize for +tab-indented blocks. .. diff --git a/Misc/NEWS.d/3.5.0b4.rst b/Misc/NEWS.d/3.5.0b4.rst index bcc7345d8a7c..adb8ee88652f 100644 --- a/Misc/NEWS.d/3.5.0b4.rst +++ b/Misc/NEWS.d/3.5.0b4.rst @@ -224,8 +224,8 @@ segment. .. nonce: hwXwCH .. section: Library -SMTP.auth() and SMTP.login() now support RFC 4954's optional initial- -response argument to the SMTP AUTH command. +SMTP.auth() and SMTP.login() now support RFC 4954's optional +initial-response argument to the SMTP AUTH command. .. diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst index efefaa14fdaa..d06817ccb950 100644 --- a/Misc/NEWS.d/3.5.1rc1.rst +++ b/Misc/NEWS.d/3.5.1rc1.rst @@ -159,8 +159,8 @@ twice. On Solaris 11.3 or newer, os.urandom() now uses the getrandom() function instead of the getentropy() function. The getentropy() function is blocking -to generate very good quality entropy, os.urandom() doesn't need such high- -quality entropy. +to generate very good quality entropy, os.urandom() doesn't need such +high-quality entropy. .. @@ -1083,11 +1083,11 @@ them a 'sheet'. Patch by Mark Roseman. .. nonce: -j_BV7 .. section: IDLE -Enhance the initial html viewer now used for Idle Help. * Properly indent -fixed-pitch text (patch by Mark Roseman). * Give code snippet a very Sphinx- -like light blueish-gray background. * Re-use initial width and height set by -users for shell and editor. * When the Table of Contents (TOC) menu is used, -put the section header at the top of the screen. +Enhance the initial html viewer now used for Idle Help. Properly indent +fixed-pitch text (patch by Mark Roseman). Give code snippet a very +Sphinx-like light blueish-gray background. Re-use initial width and height +set by users for shell and editor. When the Table of Contents (TOC) menu is +used, put the section header at the top of the screen. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 3d513b3b9af8..231c3cac9c5f 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -568,9 +568,9 @@ string. Original fix by J?n Janech. .. section: Library The "urllib.request" module now percent-encodes non-ASCII bytes found in -redirect target URLs. Some servers send Location header fields with non- -ASCII bytes, but "http.client" requires the request target to be ASCII- -encodable, otherwise a UnicodeEncodeError is raised. Based on patch by +redirect target URLs. Some servers send Location header fields with +non-ASCII bytes, but "http.client" requires the request target to be +ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch by Christian Heimes. .. @@ -1952,10 +1952,10 @@ Fix linking extension modules for cross builds. Patch by Xavier de Gaye. .. nonce: HDjM4s .. section: Build -Disable the rules for running _freeze_importlib and pgen when cross- -compiling. The output of these programs is normally saved with the source -code anyway, and is still regenerated when doing a native build. Patch by -Xavier de Gaye. +Disable the rules for running _freeze_importlib and pgen when +cross-compiling. The output of these programs is normally saved with the +source code anyway, and is still regenerated when doing a native build. +Patch by Xavier de Gaye. .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index bca43c8f708f..fd59cf798b12 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -81,8 +81,8 @@ astral characters. Patch by Xiang Zhang. .. nonce: RYbEGH .. section: Core and Builtins -Extra slash no longer added to sys.path components in case of empty compile- -time PYTHONPATH components. +Extra slash no longer added to sys.path components in case of empty +compile-time PYTHONPATH components. .. @@ -349,8 +349,8 @@ Patch written by Xiang Zhang. .. section: Core and Builtins Standard __import__() no longer look up "__import__" in globals or builtins -for importing submodules or "from import". Fixed handling an error of non- -string package name. +for importing submodules or "from import". Fixed handling an error of +non-string package name. .. @@ -1124,10 +1124,10 @@ after a commit. .. nonce: cYraeH .. section: Library -A new version of typing.py from https://github.com/python/typing: - -Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__ -(upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove the -dict constraint in ForwardRef._eval_type (upstream #252) +A new version of typing.py from https://github.com/python/typing: +Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__ +(upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the +dict constraint in ForwardRef._eval_type (upstream #252). .. @@ -2070,9 +2070,9 @@ Update message in validate_ucrtbase.py .. section: Build Cause lack of llvm-profdata tool when using clang as required for PGO -linking to be a configure time error rather than make time when --with- -optimizations is enabled. Also improve our ability to find the llvm- -profdata tool on MacOS and some Linuxes. +linking to be a configure time error rather than make time when +--with-optimizations is enabled. Also improve our ability to find the +llvm-profdata tool on MacOS and some Linuxes. .. @@ -2131,7 +2131,7 @@ CPP invocation in configure must use CPPFLAGS. Patch by Chi Hsuan Yen. .. section: Build The configure script now inserts comments into the makefile to prevent the -pgen and _freeze_importlib executables from being cross- compiled. +pgen and _freeze_importlib executables from being cross-compiled. .. diff --git a/Misc/NEWS.d/3.5.4rc1.rst b/Misc/NEWS.d/3.5.4rc1.rst index 0eb85d1d7cfe..5af08cbe4ce0 100644 --- a/Misc/NEWS.d/3.5.4rc1.rst +++ b/Misc/NEWS.d/3.5.4rc1.rst @@ -20,8 +20,8 @@ Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple security vulnerabilities including: CVE-2017-9233 (External entity infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and CVE-2012-0876 -(Counter hash flooding with SipHash). Note: the CVE-2016-5300 (Use os- -specific entropy sources like getrandom) doesn't impact Python, since Python +(Counter hash flooding with SipHash). Note: the CVE-2016-5300 (Use +os-specific entropy sources like getrandom) doesn't impact Python, since Python already gets entropy from the OS to set the expat secret using ``XML_SetHashSalt()``. @@ -290,8 +290,8 @@ Update zlib to 1.2.11. .. nonce: N3KI-o .. section: Library -os.listdir() and os.scandir() now emit bytes names when called with bytes- -like argument. +os.listdir() and os.scandir() now emit bytes names when called with +bytes-like argument. .. @@ -559,8 +559,8 @@ is received. .. section: Library Various updates to typing module: add typing.NoReturn type, use -WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis- -Hilliard and Ivan Levkivskyi. +WrapperDescriptorType, minor bug-fixes. Original PRs by Jim +Fasarakis-Hilliard and Ivan Levkivskyi. .. @@ -1070,8 +1070,8 @@ default locale encoding is a multi-byte encoding) .. section: Build Prevent unnecessary rebuilding of Python during ``make test``, ``make -install`` and some other make targets when configured with ``--enable- -optimizations``. +install`` and some other make targets when configured with +``--enable-optimizations``. .. diff --git a/Misc/NEWS.d/3.7.1rc1.rst b/Misc/NEWS.d/3.7.1rc1.rst index e800c5457835..515530ae24d2 100644 --- a/Misc/NEWS.d/3.7.1rc1.rst +++ b/Misc/NEWS.d/3.7.1rc1.rst @@ -1416,9 +1416,9 @@ Fix unresponsiveness after closing certain windows and dialogs. .. nonce: Ow7alv .. section: IDLE -Avoid small type when running htests. Since part of the purpose of human- -viewed tests is to determine that widgets look right, it is important that -they look the same for testing as when running IDLE. +Avoid small type when running htests. Since part of the purpose of +human-viewed tests is to determine that widgets look right, it is important +that they look the same for testing as when running IDLE. .. diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst index 33f6dc4d8821..991bae38ec72 100644 --- a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -1,2 +1,2 @@ -Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- -overlapping' and changing '!=' to '<'. +Improve difflib.SequenceManager.get_matching_blocks doc by adding +'non-overlapping' and changing '!=' to '<'. From webhook-mailer at python.org Wed Oct 31 05:00:42 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 31 Oct 2018 09:00:42 -0000 Subject: [Python-checkins] [3.6] bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231). (GH-10254) Message-ID: https://github.com/python/cpython/commit/1e8c18509eb15efb8e80971b9935d17e7bbeabf4 commit: 1e8c18509eb15efb8e80971b9935d17e7bbeabf4 branch: 3.6 author: Serhiy Storchaka committer: GitHub date: 2018-10-31T11:00:39+02:00 summary: [3.6] bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231). (GH-10254) (cherry picked from commit 3f819ca138db6945ee4271bf13e42db9f9b3b1e4) files: M Doc/c-api/veryhigh.rst M Doc/distutils/apiref.rst M Doc/distutils/builtdist.rst M Doc/distutils/configfile.rst M Doc/extending/extending.rst M Doc/howto/logging.rst M Doc/install/index.rst M Doc/library/codecs.rst M Doc/library/datetime.rst M Doc/library/email.compat32-message.rst M Doc/library/email.message.rst M Doc/library/logging.rst M Doc/library/optparse.rst M Doc/library/os.rst M Doc/library/ossaudiodev.rst M Doc/library/stat.rst M Doc/library/string.rst M Doc/library/termios.rst M Doc/tutorial/controlflow.rst M Doc/whatsnew/2.2.rst M Doc/whatsnew/2.3.rst M Doc/whatsnew/2.5.rst M Doc/whatsnew/3.4.rst M Misc/NEWS.d/3.5.0a1.rst M Misc/NEWS.d/3.5.1rc1.rst M Misc/NEWS.d/3.5.2rc1.rst M Misc/NEWS.d/3.5.3rc1.rst M Misc/NEWS.d/3.6.7rc1.rst M Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index 3897fdd82821..5352938030bb 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -306,7 +306,7 @@ the same library that the Python runtime is using. Evaluate a precompiled code object, given a particular environment for its evaluation. This environment consists of a dictionary of global variables, a mapping object of local variables, arrays of arguments, keywords and - defaults, a dictionary of default values for :ref:`keyword-only\ + defaults, a dictionary of default values for :ref:`keyword-only ` arguments and a closure tuple of cells. diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index f147bb236a70..f6163258df2e 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -183,8 +183,9 @@ the full reference. | *sources* | list of source filenames, | a list of strings | | | relative to the distribution | | | | root (where the setup script | | - | | lives), in Unix form (slash- | | - | | separated) for portability. | | + | | lives), in Unix form | | + | | (slash-separated) for | | + | | portability. | | | | Source files may be C, C++, | | | | SWIG (.i), platform-specific | | | | resource files, or whatever | | @@ -1565,8 +1566,8 @@ lines, and joining lines with backslashes. +------------------+--------------------------------+---------+ | option name | description | default | +==================+================================+=========+ - | *strip_comments* | strip from ``'#'`` to end-of- | true | - | | line, as well as any | | + | *strip_comments* | strip from ``'#'`` to | true | + | | end-of-line, as well as any | | | | whitespace leading up to the | | | | ``'#'``\ ---unless it is | | | | escaped by a backslash | | diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst index 5e1a04979dac..92d796fb7472 100644 --- a/Doc/distutils/builtdist.rst +++ b/Doc/distutils/builtdist.rst @@ -63,9 +63,9 @@ distribution to generate: for example, :: python setup.py bdist --format=zip -would, when run on a Unix system, create :file:`Distutils-1.0.{plat}.zip`\ ----again, this archive would be unpacked from the root directory to install the -Distutils. +would, when run on a Unix system, create +:file:`Distutils-1.0.{plat}.zip`\ ---again, this archive would be unpacked +from the root directory to install the Distutils. The available formats for built distributions are: diff --git a/Doc/distutils/configfile.rst b/Doc/distutils/configfile.rst index cd10a7fdf315..0874d05fe703 100644 --- a/Doc/distutils/configfile.rst +++ b/Doc/distutils/configfile.rst @@ -13,8 +13,8 @@ edit is a cheap and easy way to solicit it. Configuration files also let you provide default values for any command option, which the installer can then override either on the command-line or by editing the config file. -The setup configuration file is a useful middle-ground between the setup script ----which, ideally, would be opaque to installers [#]_---and the command-line to +The setup configuration file is a useful middle-ground between the setup +script---which, ideally, would be opaque to installers [#]_---and the command-line to the setup script, which is outside of your control and entirely up to the installer. In fact, :file:`setup.cfg` (and any other Distutils configuration files present on the target system) are processed after the contents of the diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 130f4a732141..2a288404fd13 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -544,8 +544,9 @@ or more format codes between parentheses. For example:: :c:func:`PyObject_CallObject` returns a Python object pointer: this is the return value of the Python function. :c:func:`PyObject_CallObject` is "reference-count-neutral" with respect to its arguments. In the example a new -tuple was created to serve as the argument list, which is :c:func:`Py_DECREF`\ --ed immediately after the :c:func:`PyObject_CallObject` call. +tuple was created to serve as the argument list, which is +:c:func:`Py_DECREF`\ -ed immediately after the :c:func:`PyObject_CallObject` +call. The return value of :c:func:`PyObject_CallObject` is "new": either it is a brand new object, or it is an existing object whose reference count has been diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index 9914f8d154ab..af8c432753cc 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -971,7 +971,7 @@ provided: The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` classes are defined in the core logging package. The other handlers are -defined in a sub- module, :mod:`logging.handlers`. (There is also another +defined in a sub-module, :mod:`logging.handlers`. (There is also another sub-module, :mod:`logging.config`, for configuration functionality.) Logged messages are formatted for presentation through instances of the diff --git a/Doc/install/index.rst b/Doc/install/index.rst index 484231323896..5a59b4d80388 100644 --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -554,10 +554,10 @@ C headers ``--install-headers`` These override options can be relative, absolute, or explicitly defined in terms of one of the installation base directories. -(There are two installation base directories, and they are normally the same--- -they only differ when you use the Unix "prefix scheme" and supply different -``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will -override values computed or given for ``--install-purelib`` and +(There are two installation base directories, and they are normally the +same---they only differ when you use the Unix "prefix scheme" and supply +different ``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` +will override values computed or given for ``--install-purelib`` and ``--install-platlib``, and is recommended for schemes that don't make a difference between Python and extension modules.) @@ -584,10 +584,10 @@ in this case.) If you maintain Python on Windows, you might want third-party modules to live in a subdirectory of :file:`{prefix}`, rather than right in :file:`{prefix}` -itself. This is almost as easy as customizing the script installation directory ----you just have to remember that there are two types of modules to worry about, -Python and extension modules, which can conveniently be both controlled by one -option:: +itself. This is almost as easy as customizing the script installation +directory---you just have to remember that there are two types of modules +to worry about, Python and extension modules, which can conveniently be both +controlled by one option:: python setup.py install --install-lib=Site diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 160732aed2c8..992135154fd6 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1121,10 +1121,10 @@ particular, the following variants typically exist: | | ks_c-5601, ks_c-5601-1987, | | | | ksx1001, ks_x-1001 | | +-----------------+--------------------------------+--------------------------------+ -| gb2312 | chinese, csiso58gb231280, euc- | Simplified Chinese | -| | cn, euccn, eucgb2312-cn, | | -| | gb2312-1980, gb2312-80, iso- | | -| | ir-58 | | +| gb2312 | chinese, csiso58gb231280, | Simplified Chinese | +| | euc-cn, euccn, eucgb2312-cn, | | +| | gb2312-1980, gb2312-80, | | +| | iso-ir-58 | | +-----------------+--------------------------------+--------------------------------+ | gbk | 936, cp936, ms936 | Unified Chinese | +-----------------+--------------------------------+--------------------------------+ diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index f2bdf8d68fb7..25f2fd3f4993 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -276,9 +276,10 @@ Supported operations: | ``+t1`` | Returns a :class:`timedelta` object with the | | | same value. (2) | +--------------------------------+-----------------------------------------------+ -| ``-t1`` | equivalent to :class:`timedelta`\ | -| | (-*t1.days*, -*t1.seconds*, | -| | -*t1.microseconds*), and to *t1*\* -1. (1)(4) | +| ``-t1`` | equivalent to | +| | :class:`timedelta`\ (-*t1.days*, | +| | -*t1.seconds*, -*t1.microseconds*), | +| | and to *t1*\* -1. (1)(4) | +--------------------------------+-----------------------------------------------+ | ``abs(t)`` | equivalent to +\ *t* when ``t.days >= 0``, and| | | to -*t* when ``t.days < 0``. (2) | diff --git a/Doc/library/email.compat32-message.rst b/Doc/library/email.compat32-message.rst index 7e11782face0..9f85c5921c8f 100644 --- a/Doc/library/email.compat32-message.rst +++ b/Doc/library/email.compat32-message.rst @@ -149,8 +149,8 @@ Here are the methods of the :class:`Message` class: .. method:: is_multipart() - Return ``True`` if the message's payload is a list of sub-\ - :class:`Message` objects, otherwise return ``False``. When + Return ``True`` if the message's payload is a list of + sub-\ :class:`Message` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload. (Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst index 261d0d62cfe6..ff5404553e96 100644 --- a/Doc/library/email.message.rst +++ b/Doc/library/email.message.rst @@ -130,8 +130,8 @@ message objects. .. method:: is_multipart() - Return ``True`` if the message's payload is a list of sub-\ - :class:`EmailMessage` objects, otherwise return ``False``. When + Return ``True`` if the message's payload is a list of + sub-\ :class:`EmailMessage` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload). Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 60d7758896a7..df74688f14bc 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -882,7 +882,7 @@ re-entrant, and so cannot be invoked from such signal handlers. Module-Level Functions ---------------------- -In addition to the classes described above, there are a number of module- level +In addition to the classes described above, there are a number of module-level functions. diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index e9b82ee2ac13..3afc77bf9f8e 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -379,8 +379,8 @@ types is covered in section :ref:`optparse-extending-optparse`. Handling boolean (flag) options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Flag options---set a variable to true or false when a particular option is seen ----are quite common. :mod:`optparse` supports them with two separate actions, +Flag options---set a variable to true or false when a particular option is +seen---are quite common. :mod:`optparse` supports them with two separate actions, ``store_true`` and ``store_false``. For example, you might have a ``verbose`` flag that is turned on with ``-v`` and off with ``-q``:: @@ -388,8 +388,8 @@ flag that is turned on with ``-v`` and off with ``-q``:: parser.add_option("-q", action="store_false", dest="verbose") Here we have two different options with the same destination, which is perfectly -OK. (It just means you have to be a bit careful when setting default values--- -see below.) +OK. (It just means you have to be a bit careful when setting default +values---see below.) When :mod:`optparse` encounters ``-v`` on the command line, it sets ``options.verbose`` to ``True``; when it encounters ``-q``, @@ -525,9 +525,9 @@ help message: default: ``"Usage: %prog [options]"``, which is fine if your script doesn't take any positional arguments. -* every option defines a help string, and doesn't worry about line-wrapping--- - :mod:`optparse` takes care of wrapping lines and making the help output look - good. +* every option defines a help string, and doesn't worry about + line-wrapping---\ :mod:`optparse` takes care of wrapping lines and making + the help output look good. * options that take a value indicate this fact in their automatically-generated help message, e.g. for the "mode" option:: diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 5a4565f1ed89..b6c21071dbf4 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3557,11 +3557,11 @@ written in Python, such as a mail server's external command delivery program. .. function:: wait3(options) Similar to :func:`waitpid`, except no process id argument is given and a - 3-element tuple containing the child's process id, exit status indication, and - resource usage information is returned. Refer to :mod:`resource`.\ - :func:`~resource.getrusage` for details on resource usage information. The - option argument is the same as that provided to :func:`waitpid` and - :func:`wait4`. + 3-element tuple containing the child's process id, exit status indication, + and resource usage information is returned. Refer to + :mod:`resource`.\ :func:`~resource.getrusage` for details on resource usage + information. The option argument is the same as that provided to + :func:`waitpid` and :func:`wait4`. Availability: Unix. diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst index 522bb7e09242..a7d3dac363cd 100644 --- a/Doc/library/ossaudiodev.rst +++ b/Doc/library/ossaudiodev.rst @@ -153,8 +153,7 @@ and (read-only) attributes: number of bytes written. If the audio device is in blocking mode (the default), the entire data is always written (again, this is different from usual Unix device semantics). If the device is in non-blocking mode, some - data may not be written - ---see :meth:`writeall`. + data may not be written---see :meth:`writeall`. .. versionchanged:: 3.5 Writable :term:`bytes-like object` is now accepted. diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst index b256312d91a8..c8f6904f9b1f 100644 --- a/Doc/library/stat.rst +++ b/Doc/library/stat.rst @@ -81,9 +81,9 @@ mode: .. function:: S_IMODE(mode) - Return the portion of the file's mode that can be set by :func:`os.chmod`\ - ---that is, the file's permission bits, plus the sticky bit, set-group-id, and - set-user-id bits (on systems that support them). + Return the portion of the file's mode that can be set by + :func:`os.chmod`\ ---that is, the file's permission bits, plus the sticky + bit, set-group-id, and set-user-id bits (on systems that support them). .. function:: S_IFMT(mode) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index cd82f4711047..007ce84e78f4 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -458,11 +458,11 @@ The available integer presentation types are: +---------+----------------------------------------------------------+ | ``'o'`` | Octal format. Outputs the number in base 8. | +---------+----------------------------------------------------------+ - | ``'x'`` | Hex format. Outputs the number in base 16, using lower- | - | | case letters for the digits above 9. | + | ``'x'`` | Hex format. Outputs the number in base 16, using | + | | lower-case letters for the digits above 9. | +---------+----------------------------------------------------------+ - | ``'X'`` | Hex format. Outputs the number in base 16, using upper- | - | | case letters for the digits above 9. | + | ``'X'`` | Hex format. Outputs the number in base 16, using | + | | upper-case letters for the digits above 9. | +---------+----------------------------------------------------------+ | ``'n'`` | Number. This is the same as ``'d'``, except that it uses | | | the current locale setting to insert the appropriate | diff --git a/Doc/library/termios.rst b/Doc/library/termios.rst index 7693ecd02789..d75a87c55a46 100644 --- a/Doc/library/termios.rst +++ b/Doc/library/termios.rst @@ -51,8 +51,8 @@ The module defines the following functions: .. function:: tcsendbreak(fd, duration) - Send a break on file descriptor *fd*. A zero *duration* sends a break for 0.25 - --0.5 seconds; a nonzero *duration* has a system dependent meaning. + Send a break on file descriptor *fd*. A zero *duration* sends a break for + 0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning. .. function:: tcdrain(fd) diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index c407ad433d85..bf6fbe21a7f7 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -572,8 +572,8 @@ or tuple:: .. index:: single: **; in function calls -In the same fashion, dictionaries can deliver keyword arguments with the ``**``\ --operator:: +In the same fashion, dictionaries can deliver keyword arguments with the +``**``\ -operator:: >>> def parrot(voltage, state='a stiff', action='voom'): ... print("-- This parrot wouldn't", action, end=' ') diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst index a0bb81a97486..9671db248da3 100644 --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -576,9 +576,9 @@ similar to a :keyword:`return` statement. The big difference between variables are preserved. On the next call to the generator's ``next()`` method, the function will resume executing immediately after the :keyword:`yield` statement. (For complicated reasons, the :keyword:`yield` statement isn't -allowed inside the :keyword:`try` block of a :keyword:`try`...\ -:keyword:`finally` statement; read :pep:`255` for a full explanation of the -interaction between :keyword:`yield` and exceptions.) +allowed inside the :keyword:`try` block of a +:keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full +explanation of the interaction between :keyword:`yield` and exceptions.) Here's a sample usage of the :func:`generate_ints` generator:: diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst index 5cdd51b39b22..72906954ef78 100644 --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -162,9 +162,9 @@ similar to a :keyword:`return` statement. The big difference between variables are preserved. On the next call to the generator's ``.next()`` method, the function will resume executing immediately after the :keyword:`yield` statement. (For complicated reasons, the :keyword:`yield` -statement isn't allowed inside the :keyword:`try` block of a :keyword:`try`...\ -:keyword:`finally` statement; read :pep:`255` for a full explanation of the -interaction between :keyword:`yield` and exceptions.) +statement isn't allowed inside the :keyword:`try` block of a +:keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full +explanation of the interaction between :keyword:`yield` and exceptions.) Here's a sample usage of the :func:`generate_ints` generator:: @@ -1247,8 +1247,8 @@ complete list of changes, or look through the CVS logs for all the details. will have to change your ``import`` statements to import it as :mod:`bsddb`. * The new :mod:`bz2` module is an interface to the bz2 data compression library. - bz2-compressed data is usually smaller than corresponding :mod:`zlib`\ - -compressed data. (Contributed by Gustavo Niemeyer.) + bz2-compressed data is usually smaller than corresponding + :mod:`zlib`\ -compressed data. (Contributed by Gustavo Niemeyer.) * A set of standard date/time types has been added in the new :mod:`datetime` module. See the following section for more details. diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst index b0defbacaee8..8c262eb9f717 100644 --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -448,8 +448,9 @@ when you're doing something with the returned value, as in the above example. The parentheses aren't always necessary, but it's easier to always add them instead of having to remember when they're needed. -(:pep:`342` explains the exact rules, which are that a :keyword:`yield`\ --expression must always be parenthesized except when it occurs at the top-level +(:pep:`342` explains the exact rules, which are that a +:keyword:`yield`\ -expression must always be parenthesized except when it +occurs at the top-level expression on the right-hand side of an assignment. This means you can write ``val = yield i`` but have to use parentheses when there's an operation, as in ``val = (yield i) + 12``.) diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 65971700c8b5..10996233ff6e 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1452,10 +1452,10 @@ in :issue:`18143`.) :class:`~ssl.SSLContext` has a new method, :meth:`~ssl.SSLContext.cert_store_stats`, that reports the number of loaded -``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists (``crl``\ -s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that returns a -list of the loaded ``CA`` certificates. (Contributed by Christian Heimes in -:issue:`18147`.) +``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists +(``crl``\ s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that +returns a list of the loaded ``CA`` certificates. (Contributed by Christian +Heimes in :issue:`18147`.) If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control the diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst index 8cab0e96bb82..5ac0fab0f305 100644 --- a/Misc/NEWS.d/3.5.0a1.rst +++ b/Misc/NEWS.d/3.5.0a1.rst @@ -2707,7 +2707,11 @@ Added support for the "xztar" format in the shutil module. .. section: Library Don't force 3rd party C extensions to be built with +<<<<<<< HEAD ``-Werror=declaration-after-statement``. +======= +-Werror=declaration-after-statement. +>>>>>>> 3f819ca138... bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) .. @@ -5060,7 +5064,11 @@ Anticipated fixes to support OS X versions > 10.9. .. section: Build Prevent possible segfaults and other random failures of python +<<<<<<< HEAD ``--generate-posix-vars`` in pybuilddir.txt build target. +======= +--generate-posix-vars in pybuilddir.txt build target. +>>>>>>> 3f819ca138... bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) .. diff --git a/Misc/NEWS.d/3.5.1rc1.rst b/Misc/NEWS.d/3.5.1rc1.rst index b72940f53de4..fbb0ca2e391b 100644 --- a/Misc/NEWS.d/3.5.1rc1.rst +++ b/Misc/NEWS.d/3.5.1rc1.rst @@ -1085,9 +1085,9 @@ them a 'sheet'. Patch by Mark Roseman. Enhance the initial html viewer now used for Idle Help. Properly indent fixed-pitch text (patch by Mark Roseman). Give code snippet a very -Sphinx-like light blueish-gray background. Re-use initial width and height set by -users for shell and editor. When the Table of Contents (TOC) menu is used, -put the section header at the top of the screen. +Sphinx-like light blueish-gray background. Re-use initial width and height +set by users for shell and editor. When the Table of Contents (TOC) menu is +used, put the section header at the top of the screen. .. diff --git a/Misc/NEWS.d/3.5.2rc1.rst b/Misc/NEWS.d/3.5.2rc1.rst index 2c9d81d994b8..3df9c6cedff7 100644 --- a/Misc/NEWS.d/3.5.2rc1.rst +++ b/Misc/NEWS.d/3.5.2rc1.rst @@ -1953,9 +1953,9 @@ Fix linking extension modules for cross builds. Patch by Xavier de Gaye. .. section: Build Disable the rules for running _freeze_importlib and pgen when -cross-compiling. The output of these programs is normally saved with the source -code anyway, and is still regenerated when doing a native build. Patch by -Xavier de Gaye. +cross-compiling. The output of these programs is normally saved with the +source code anyway, and is still regenerated when doing a native build. +Patch by Xavier de Gaye. .. diff --git a/Misc/NEWS.d/3.5.3rc1.rst b/Misc/NEWS.d/3.5.3rc1.rst index 728612d8913f..ed6b64b79041 100644 --- a/Misc/NEWS.d/3.5.3rc1.rst +++ b/Misc/NEWS.d/3.5.3rc1.rst @@ -1124,10 +1124,10 @@ after a commit. .. nonce: cYraeH .. section: Library -A new version of typing.py from https://github.com/python/typing: - -Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__ -(upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove the -dict constraint in ForwardRef._eval_type (upstream #252) +A new version of typing.py from https://github.com/python/typing: +Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__ +(upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the +dict constraint in ForwardRef._eval_type (upstream #252). .. diff --git a/Misc/NEWS.d/3.6.7rc1.rst b/Misc/NEWS.d/3.6.7rc1.rst index 494186131143..5115970d5522 100644 --- a/Misc/NEWS.d/3.6.7rc1.rst +++ b/Misc/NEWS.d/3.6.7rc1.rst @@ -989,8 +989,8 @@ Fix unresponsiveness after closing certain windows and dialogs. .. nonce: Ow7alv .. section: IDLE -Avoid small type when running htests. Since part of the purpose of human- -viewed tests is to determine that widgets look right, it is important that +Avoid small type when running htests. Since part of the purpose of +human-viewed tests is to determine that widgets look right, it is important that they look the same for testing as when running IDLE. .. diff --git a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst index 33f6dc4d8821..991bae38ec72 100644 --- a/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst +++ b/Misc/NEWS.d/next/Library/2018-10-26-22-53-16.bpo-35079.Tm5jvF.rst @@ -1,2 +1,2 @@ -Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non- -overlapping' and changing '!=' to '<'. +Improve difflib.SequenceManager.get_matching_blocks doc by adding +'non-overlapping' and changing '!=' to '<'. From solipsis at pitrou.net Wed Oct 31 05:10:12 2018 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 31 Oct 2018 09:10:12 +0000 Subject: [Python-checkins] Daily reference leaks (4243df51fe43): sum=11 Message-ID: <20181031091012.1.4CD7D2DF22BAE425@psf.io> results for 4243df51fe43 on branch "default" -------------------------------------------- test_collections leaked [7, -7, 8] memory blocks, sum=8 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [-2, 2, -1] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog2m88bK', '--timeout', '7200'] From webhook-mailer at python.org Wed Oct 31 05:13:28 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 31 Oct 2018 09:13:28 -0000 Subject: [Python-checkins] Fix a possible crash in range.__reversed__(). (GH-10252) Message-ID: https://github.com/python/cpython/commit/c9a6168924ffa4f3f78175998b392fe23d3edc50 commit: c9a6168924ffa4f3f78175998b392fe23d3edc50 branch: master author: Zackery Spytz committer: Serhiy Storchaka date: 2018-10-31T11:13:16+02:00 summary: Fix a possible crash in range.__reversed__(). (GH-10252) files: M Objects/rangeobject.c diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 2b00a17425a2..e7b47bde6661 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1154,6 +1154,7 @@ range_reverse(PyObject *seq, PyObject *Py_UNUSED(ignored)) it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type); if (it == NULL) return NULL; + it->index = it->start = it->step = NULL; /* start + (len - 1) * step */ it->len = range->length; From webhook-mailer at python.org Wed Oct 31 05:14:41 2018 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 31 Oct 2018 09:14:41 -0000 Subject: [Python-checkins] bpo-35110: Fix yet few spaces before dashes. (GH-10255) Message-ID: https://github.com/python/cpython/commit/511747bec3aca4ad7930005e3adece9196c1cd39 commit: 511747bec3aca4ad7930005e3adece9196c1cd39 branch: master author: Serhiy Storchaka committer: GitHub date: 2018-10-31T11:14:38+02:00 summary: bpo-35110: Fix yet few spaces before dashes. (GH-10255) files: M Doc/distutils/configfile.rst M Doc/library/optparse.rst diff --git a/Doc/distutils/configfile.rst b/Doc/distutils/configfile.rst index cd10a7fdf315..0874d05fe703 100644 --- a/Doc/distutils/configfile.rst +++ b/Doc/distutils/configfile.rst @@ -13,8 +13,8 @@ edit is a cheap and easy way to solicit it. Configuration files also let you provide default values for any command option, which the installer can then override either on the command-line or by editing the config file. -The setup configuration file is a useful middle-ground between the setup script ----which, ideally, would be opaque to installers [#]_---and the command-line to +The setup configuration file is a useful middle-ground between the setup +script---which, ideally, would be opaque to installers [#]_---and the command-line to the setup script, which is outside of your control and entirely up to the installer. In fact, :file:`setup.cfg` (and any other Distutils configuration files present on the target system) are processed after the contents of the diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index 4f7bd43ce7d9..3afc77bf9f8e 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -379,8 +379,8 @@ types is covered in section :ref:`optparse-extending-optparse`. Handling boolean (flag) options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Flag options---set a variable to true or false when a particular option is seen ----are quite common. :mod:`optparse` supports them with two separate actions, +Flag options---set a variable to true or false when a particular option is +seen---are quite common. :mod:`optparse` supports them with two separate actions, ``store_true`` and ``store_false``. For example, you might have a ``verbose`` flag that is turned on with ``-v`` and off with ``-q``:: From webhook-mailer at python.org Wed Oct 31 05:31:42 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 31 Oct 2018 09:31:42 -0000 Subject: [Python-checkins] Fix a possible crash in range.__reversed__(). (GH-10252) Message-ID: https://github.com/python/cpython/commit/da15389fddb85cf8a97b81e75de7d77b5f505b56 commit: da15389fddb85cf8a97b81e75de7d77b5f505b56 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-31T02:31:29-07:00 summary: Fix a possible crash in range.__reversed__(). (GH-10252) (cherry picked from commit c9a6168924ffa4f3f78175998b392fe23d3edc50) Co-authored-by: Zackery Spytz files: M Objects/rangeobject.c diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index e4f778b1f8ea..037be870e36a 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1154,6 +1154,7 @@ range_reverse(PyObject *seq) it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type); if (it == NULL) return NULL; + it->index = it->start = it->step = NULL; /* start + (len - 1) * step */ it->len = range->length; From webhook-mailer at python.org Wed Oct 31 05:33:08 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 31 Oct 2018 09:33:08 -0000 Subject: [Python-checkins] Fix a possible crash in range.__reversed__(). (GH-10252) Message-ID: https://github.com/python/cpython/commit/00093f61b38c01045b71a27eef0ff64a69188e8f commit: 00093f61b38c01045b71a27eef0ff64a69188e8f branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-31T02:33:00-07:00 summary: Fix a possible crash in range.__reversed__(). (GH-10252) (cherry picked from commit c9a6168924ffa4f3f78175998b392fe23d3edc50) Co-authored-by: Zackery Spytz files: M Objects/rangeobject.c diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 2fc70cd8d7b7..4f392a4c901a 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1256,6 +1256,7 @@ range_reverse(PyObject *seq) it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type); if (it == NULL) return NULL; + it->index = it->start = it->step = NULL; /* start + (len - 1) * step */ it->len = range->length; From webhook-mailer at python.org Wed Oct 31 07:49:21 2018 From: webhook-mailer at python.org (Xiang Zhang) Date: Wed, 31 Oct 2018 11:49:21 -0000 Subject: [Python-checkins] bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) Message-ID: https://github.com/python/cpython/commit/b08746bfdf64e55ce33516f2065fa2aa4f51be95 commit: b08746bfdf64e55ce33516f2065fa2aa4f51be95 branch: master author: Xiang Zhang committer: GitHub date: 2018-10-31T19:49:16+08:00 summary: bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) _io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range value to the bitwise struct field. files: A Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst M Lib/test/test_io.py M Modules/_io/textio.c diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index abd55387bdbf..d927bb96ceb5 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3748,6 +3748,16 @@ def _check(dec): dec = self.IncrementalNewlineDecoder(None, translate=True) _check(dec) + def test_translate(self): + # issue 35062 + for translate in (-2, -1, 1, 2): + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate) + self.check_newline_decoding_utf8(decoder) + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate=0) + self.assertEqual(decoder.decode(b"\r\r\n"), "\r\r\n") + class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): pass diff --git a/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst new file mode 100644 index 000000000000..b77ed8685bfc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst @@ -0,0 +1,2 @@ +Fix incorrect parsing of :class:`_io.IncrementalNewlineDecoder`'s +*translate* argument. diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 3a3667b39da8..be427772817a 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -261,7 +261,7 @@ _io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self, } Py_INCREF(self->errors); - self->translate = translate; + self->translate = translate ? 1 : 0; self->seennl = 0; self->pendingcr = 0; From webhook-mailer at python.org Wed Oct 31 08:36:25 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 31 Oct 2018 12:36:25 -0000 Subject: [Python-checkins] bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) Message-ID: https://github.com/python/cpython/commit/71b6c1af727fbe13525fb734568057d78cea33f3 commit: 71b6c1af727fbe13525fb734568057d78cea33f3 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-31T05:36:20-07:00 summary: bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) _io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range value to the bitwise struct field. (cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95) Co-authored-by: Xiang Zhang files: A Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst M Lib/test/test_io.py M Modules/_io/textio.c diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index c68b2fea858b..b41141e28adb 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3748,6 +3748,16 @@ def _check(dec): dec = self.IncrementalNewlineDecoder(None, translate=True) _check(dec) + def test_translate(self): + # issue 35062 + for translate in (-2, -1, 1, 2): + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate) + self.check_newline_decoding_utf8(decoder) + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate=0) + self.assertEqual(decoder.decode(b"\r\r\n"), "\r\r\n") + class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): pass diff --git a/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst new file mode 100644 index 000000000000..b77ed8685bfc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst @@ -0,0 +1,2 @@ +Fix incorrect parsing of :class:`_io.IncrementalNewlineDecoder`'s +*translate* argument. diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index d6b1e9437883..73d1b2e8a23b 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -261,7 +261,7 @@ _io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self, } Py_INCREF(self->errors); - self->translate = translate; + self->translate = translate ? 1 : 0; self->seennl = 0; self->pendingcr = 0; From webhook-mailer at python.org Wed Oct 31 08:36:38 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 31 Oct 2018 12:36:38 -0000 Subject: [Python-checkins] bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) Message-ID: https://github.com/python/cpython/commit/907b07ee31a657914dafb0a6b7fa724be0f8d8ac commit: 907b07ee31a657914dafb0a6b7fa724be0f8d8ac branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-31T05:36:34-07:00 summary: bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) _io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range value to the bitwise struct field. (cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95) Co-authored-by: Xiang Zhang files: A Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst M Lib/test/test_io.py M Modules/_io/textio.c diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index f306917ca7da..f29c16cb47c5 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3547,6 +3547,16 @@ def _check(dec): dec = self.IncrementalNewlineDecoder(None, translate=True) _check(dec) + def test_translate(self): + # issue 35062 + for translate in (-2, -1, 1, 2): + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate) + self.check_newline_decoding_utf8(decoder) + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate=0) + self.assertEqual(decoder.decode(b"\r\r\n"), "\r\r\n") + class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): pass diff --git a/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst new file mode 100644 index 000000000000..b77ed8685bfc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst @@ -0,0 +1,2 @@ +Fix incorrect parsing of :class:`_io.IncrementalNewlineDecoder`'s +*translate* argument. diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index d582d3fb1340..ebc3c04d673a 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -268,7 +268,7 @@ _io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self, self->errors = errors; } - self->translate = translate; + self->translate = translate ? 1 : 0; self->seennl = 0; self->pendingcr = 0; From webhook-mailer at python.org Wed Oct 31 08:37:10 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 31 Oct 2018 12:37:10 -0000 Subject: [Python-checkins] bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) Message-ID: https://github.com/python/cpython/commit/05acd44ad6b61adb24571eb0203de7b25c7e869b commit: 05acd44ad6b61adb24571eb0203de7b25c7e869b branch: 2.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-31T05:37:06-07:00 summary: bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217) _io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range value to the bitwise struct field. (cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95) Co-authored-by: Xiang Zhang files: A Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst M Lib/test/test_io.py M Modules/_io/textio.c diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 26c5dfe9261b..8152e6174d35 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -2922,6 +2922,16 @@ def _check(dec): dec = self.IncrementalNewlineDecoder(None, translate=True) _check(dec) + def test_translate(self): + # issue 35062 + for translate in (-2, -1, 1, 2): + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate) + self.check_newline_decoding_utf8(decoder) + decoder = codecs.getincrementaldecoder("utf-8")() + decoder = self.IncrementalNewlineDecoder(decoder, translate=0) + self.assertEqual(decoder.decode(b"\r\r\n"), "\r\r\n") + class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): pass diff --git a/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst new file mode 100644 index 000000000000..b77ed8685bfc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-29-23-09-24.bpo-35062.dQS1ng.rst @@ -0,0 +1,2 @@ +Fix incorrect parsing of :class:`_io.IncrementalNewlineDecoder`'s +*translate* argument. diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 1979539cc054..825e84937c15 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -221,7 +221,7 @@ incrementalnewlinedecoder_init(nldecoder_object *self, self->errors = errors; } - self->translate = translate; + self->translate = translate ? 1 : 0; self->seennl = 0; self->pendingcr = 0; From webhook-mailer at python.org Wed Oct 31 15:19:34 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 31 Oct 2018 19:19:34 -0000 Subject: [Python-checkins] bpo-35081: Move Py_BUILD_CORE code to internal/mem.h (GH-10249) Message-ID: https://github.com/python/cpython/commit/2be00d987d37682a55db67c298e82c405d01b868 commit: 2be00d987d37682a55db67c298e82c405d01b868 branch: master author: Victor Stinner committer: GitHub date: 2018-10-31T20:19:24+01:00 summary: bpo-35081: Move Py_BUILD_CORE code to internal/mem.h (GH-10249) * Add #include "internal/mem.h" to C files using _PyMem_SetDefaultAllocator(). * Include/internal/mem.h now requires Py_BUILD_CORE to be defined. files: M Include/internal/mem.h M Include/pymem.h M Modules/main.c M Objects/obmalloc.c M Python/coreconfig.c M Python/import.c M Python/pathconfig.c M Python/pylifecycle.c M Python/pystate.c M Python/sysmodule.c diff --git a/Include/internal/mem.h b/Include/internal/mem.h index a731e30e6af7..4a41b77734ac 100644 --- a/Include/internal/mem.h +++ b/Include/internal/mem.h @@ -4,6 +4,10 @@ extern "C" { #endif +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif + #include "objimpl.h" #include "pymem.h" @@ -145,6 +149,14 @@ PyAPI_FUNC(void) _PyGC_Initialize(struct _gc_runtime_state *); #define _PyGC_generation0 _PyRuntime.gc.generation0 + +/* Set the memory allocator of the specified domain to the default. + Save the old allocator into *old_alloc if it's non-NULL. + Return on success, or return -1 if the domain is unknown. */ +PyAPI_FUNC(int) _PyMem_SetDefaultAllocator( + PyMemAllocatorDomain domain, + PyMemAllocatorEx *old_alloc); + #ifdef __cplusplus } #endif diff --git a/Include/pymem.h b/Include/pymem.h index 19f0c8a2d9bf..23457adb5a45 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -198,16 +198,6 @@ PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); #endif /* Py_LIMITED_API */ -#ifdef Py_BUILD_CORE -/* Set the memory allocator of the specified domain to the default. - Save the old allocator into *old_alloc if it's non-NULL. - Return on success, or return -1 if the domain is unknown. */ -PyAPI_FUNC(int) _PyMem_SetDefaultAllocator( - PyMemAllocatorDomain domain, - PyMemAllocatorEx *old_alloc); -#endif - - /* bpo-35053: expose _Py_tracemalloc_config for performance: _Py_NewReference() needs an efficient check to test if tracemalloc is tracing. diff --git a/Modules/main.c b/Modules/main.c index 455178af8bab..6a8aa05fc370 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -2,6 +2,7 @@ #include "Python.h" #include "osdefs.h" +#include "internal/mem.h" #include "internal/pygetopt.h" #include "internal/pystate.h" diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index fbc947806908..88ded83a29e4 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "internal/mem.h" #include diff --git a/Python/coreconfig.c b/Python/coreconfig.c index a82175e4fd26..81086f42d679 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "internal/mem.h" #include "internal/pystate.h" #include #ifdef HAVE_LANGINFO_H diff --git a/Python/import.c b/Python/import.c index e761f65c66ba..338cd302dcc0 100644 --- a/Python/import.c +++ b/Python/import.c @@ -5,6 +5,7 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with winbase.h */ #include "internal/hash.h" +#include "internal/mem.h" #include "internal/pystate.h" #include "errcode.h" #include "marshal.h" diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 4e0830f4cf9a..efccb8d6bb85 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -2,6 +2,7 @@ #include "Python.h" #include "osdefs.h" +#include "internal/mem.h" #include "internal/pystate.h" #include diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index f1579c781df7..78691a54f37f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -6,6 +6,7 @@ #undef Yield /* undefine macro conflicting with winbase.h */ #include "internal/context.h" #include "internal/hamt.h" +#include "internal/mem.h" #include "internal/pystate.h" #include "grammar.h" #include "node.h" diff --git a/Python/pystate.c b/Python/pystate.c index d04981121c1c..98e954d9d91d 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -2,6 +2,7 @@ /* Thread and interpreter state structures and their interfaces */ #include "Python.h" +#include "internal/mem.h" #include "internal/pystate.h" #define _PyThreadState_SET(value) \ diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 9579eae4ff5f..71414c959789 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -15,6 +15,7 @@ Data members: */ #include "Python.h" +#include "internal/mem.h" #include "internal/pystate.h" #include "code.h" #include "frameobject.h" From webhook-mailer at python.org Wed Oct 31 19:26:44 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 31 Oct 2018 23:26:44 -0000 Subject: [Python-checkins] bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) Message-ID: https://github.com/python/cpython/commit/3a228ab17c2a9cffd1a2f15f30d6209768de20a6 commit: 3a228ab17c2a9cffd1a2f15f30d6209768de20a6 branch: master author: Victor Stinner committer: GitHub date: 2018-11-01T00:26:41+01:00 summary: bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) Don't call _Py_FatalError_PrintExc() nor flush_std_files() if the current thread doesn't hold the GIL, or if the current thread has no Python state thread. files: M Python/pylifecycle.c diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 78691a54f37f..fab96fd52381 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1820,12 +1820,6 @@ _Py_FatalError_PrintExc(int fd) PyObject *exception, *v, *tb; int has_tb; - if (PyThreadState_GET() == NULL) { - /* The GIL is released: trying to acquire it is likely to deadlock, - just give up. */ - return 0; - } - PyErr_Fetch(&exception, &v, &tb); if (exception == NULL) { /* No current exception */ @@ -1930,9 +1924,30 @@ fatal_error(const char *prefix, const char *msg, int status) fputs("\n", stderr); fflush(stderr); /* it helps in Windows debug build */ - /* Print the exception (if an exception is set) with its traceback, - * or display the current Python stack. */ - if (!_Py_FatalError_PrintExc(fd)) { + /* Check if the current thread has a Python thread state + and holds the GIL */ + PyThreadState *tss_tstate = PyGILState_GetThisThreadState(); + if (tss_tstate != NULL) { + PyThreadState *tstate = PyThreadState_GET(); + if (tss_tstate != tstate) { + /* The Python thread does not hold the GIL */ + tss_tstate = NULL; + } + } + else { + /* Py_FatalError() has been called from a C thread + which has no Python thread state. */ + } + int has_tstate_and_gil = (tss_tstate != NULL); + + if (has_tstate_and_gil) { + /* If an exception is set, print the exception with its traceback */ + if (!_Py_FatalError_PrintExc(fd)) { + /* No exception is set, or an exception is set without traceback */ + _Py_FatalError_DumpTracebacks(fd); + } + } + else { _Py_FatalError_DumpTracebacks(fd); } @@ -1943,7 +1958,7 @@ fatal_error(const char *prefix, const char *msg, int status) _PyFaulthandler_Fini(); /* Check if the current Python thread hold the GIL */ - if (PyThreadState_GET() != NULL) { + if (has_tstate_and_gil) { /* Flush sys.stdout and sys.stderr */ flush_std_files(); } From webhook-mailer at python.org Wed Oct 31 19:45:46 2018 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 31 Oct 2018 23:45:46 -0000 Subject: [Python-checkins] bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) Message-ID: https://github.com/python/cpython/commit/192c54713b4c67a8d14b2d98056771feba40ca37 commit: 192c54713b4c67a8d14b2d98056771feba40ca37 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2018-10-31T16:45:42-07:00 summary: bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) Don't call _Py_FatalError_PrintExc() nor flush_std_files() if the current thread doesn't hold the GIL, or if the current thread has no Python state thread. (cherry picked from commit 3a228ab17c2a9cffd1a2f15f30d6209768de20a6) Co-authored-by: Victor Stinner files: M Python/pylifecycle.c diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index c01b21ffebad..86f95de8336f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2015,12 +2015,6 @@ _Py_FatalError_PrintExc(int fd) PyObject *exception, *v, *tb; int has_tb; - if (PyThreadState_GET() == NULL) { - /* The GIL is released: trying to acquire it is likely to deadlock, - just give up. */ - return 0; - } - PyErr_Fetch(&exception, &v, &tb); if (exception == NULL) { /* No current exception */ @@ -2125,9 +2119,30 @@ fatal_error(const char *prefix, const char *msg, int status) fputs("\n", stderr); fflush(stderr); /* it helps in Windows debug build */ - /* Print the exception (if an exception is set) with its traceback, - * or display the current Python stack. */ - if (!_Py_FatalError_PrintExc(fd)) { + /* Check if the current thread has a Python thread state + and holds the GIL */ + PyThreadState *tss_tstate = PyGILState_GetThisThreadState(); + if (tss_tstate != NULL) { + PyThreadState *tstate = PyThreadState_GET(); + if (tss_tstate != tstate) { + /* The Python thread does not hold the GIL */ + tss_tstate = NULL; + } + } + else { + /* Py_FatalError() has been called from a C thread + which has no Python thread state. */ + } + int has_tstate_and_gil = (tss_tstate != NULL); + + if (has_tstate_and_gil) { + /* If an exception is set, print the exception with its traceback */ + if (!_Py_FatalError_PrintExc(fd)) { + /* No exception is set, or an exception is set without traceback */ + _Py_FatalError_DumpTracebacks(fd); + } + } + else { _Py_FatalError_DumpTracebacks(fd); } @@ -2138,7 +2153,7 @@ fatal_error(const char *prefix, const char *msg, int status) _PyFaulthandler_Fini(); /* Check if the current Python thread hold the GIL */ - if (PyThreadState_GET() != NULL) { + if (has_tstate_and_gil) { /* Flush sys.stdout and sys.stderr */ flush_std_files(); } From webhook-mailer at python.org Wed Oct 31 19:52:32 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 31 Oct 2018 23:52:32 -0000 Subject: [Python-checkins] bpo-35081: Add pycore_ prefix to internal header files (GH-10263) Message-ID: https://github.com/python/cpython/commit/27e2d1f21975dfb8c0ddcb192fa0f45a51b7977e commit: 27e2d1f21975dfb8c0ddcb192fa0f45a51b7977e branch: master author: Victor Stinner committer: GitHub date: 2018-11-01T00:52:28+01:00 summary: bpo-35081: Add pycore_ prefix to internal header files (GH-10263) * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h". files: A Include/internal/pycore_atomic.h A Include/internal/pycore_ceval.h A Include/internal/pycore_condvar.h A Include/internal/pycore_context.h A Include/internal/pycore_getopt.h A Include/internal/pycore_gil.h A Include/internal/pycore_hamt.h A Include/internal/pycore_hash.h A Include/internal/pycore_mem.h A Include/internal/pycore_state.h A Include/internal/pycore_warnings.h D Include/internal/ceval.h D Include/internal/condvar.h D Include/internal/context.h D Include/internal/gil.h D Include/internal/hamt.h D Include/internal/hash.h D Include/internal/mem.h D Include/internal/pyatomic.h D Include/internal/pygetopt.h D Include/internal/pystate.h D Include/internal/warnings.h M Include/pystate.h M Makefile.pre.in M Modules/Setup M Modules/_functoolsmodule.c M Modules/_io/bufferedio.c M Modules/_threadmodule.c M Modules/_xxsubinterpretersmodule.c M Modules/gcmodule.c M Modules/getpath.c M Modules/main.c M Modules/makesetup M Modules/posixmodule.c M Modules/signalmodule.c M Objects/abstract.c M Objects/bytearrayobject.c M Objects/bytesobject.c M Objects/call.c M Objects/cellobject.c M Objects/classobject.c M Objects/codeobject.c M Objects/descrobject.c M Objects/dictobject.c M Objects/exceptions.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genobject.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/obmalloc.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 PCbuild/pyproject.props M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Parser/myreadline.c M Parser/pgenmain.c M Python/_warnings.c M Python/bltinmodule.c M Python/ceval.c M Python/ceval_gil.h M Python/codecs.c M Python/condvar.h M Python/context.c M Python/coreconfig.c M Python/dynload_shlib.c M Python/errors.c M Python/frozenmain.c M Python/getopt.c M Python/hamt.c M Python/import.c M Python/pathconfig.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/Include/internal/pyatomic.h b/Include/internal/pycore_atomic.h similarity index 100% rename from Include/internal/pyatomic.h rename to Include/internal/pycore_atomic.h diff --git a/Include/internal/ceval.h b/Include/internal/pycore_ceval.h similarity index 96% rename from Include/internal/ceval.h rename to Include/internal/pycore_ceval.h index 4297b5a51ce4..ddeeb5c4256f 100644 --- a/Include/internal/ceval.h +++ b/Include/internal/pycore_ceval.h @@ -4,7 +4,7 @@ extern "C" { #endif -#include "internal/pyatomic.h" +#include "pycore_atomic.h" #include "pythread.h" struct _pending_calls { @@ -25,7 +25,7 @@ struct _pending_calls { int last; }; -#include "internal/gil.h" +#include "pycore_gil.h" struct _ceval_runtime_state { int recursion_limit; diff --git a/Include/internal/condvar.h b/Include/internal/pycore_condvar.h similarity index 100% rename from Include/internal/condvar.h rename to Include/internal/pycore_condvar.h diff --git a/Include/internal/context.h b/Include/internal/pycore_context.h similarity index 96% rename from Include/internal/context.h rename to Include/internal/pycore_context.h index 59f88f2614e9..57a410c06f68 100644 --- a/Include/internal/context.h +++ b/Include/internal/pycore_context.h @@ -2,7 +2,7 @@ #define Py_INTERNAL_CONTEXT_H -#include "internal/hamt.h" +#include "pycore_hamt.h" struct _pycontextobject { diff --git a/Include/internal/pygetopt.h b/Include/internal/pycore_getopt.h similarity index 100% rename from Include/internal/pygetopt.h rename to Include/internal/pycore_getopt.h diff --git a/Include/internal/gil.h b/Include/internal/pycore_gil.h similarity index 95% rename from Include/internal/gil.h rename to Include/internal/pycore_gil.h index 7743b3f0aa8b..5059850d76f8 100644 --- a/Include/internal/gil.h +++ b/Include/internal/pycore_gil.h @@ -4,8 +4,8 @@ extern "C" { #endif -#include "internal/condvar.h" -#include "internal/pyatomic.h" +#include "pycore_condvar.h" +#include "pycore_atomic.h" #ifndef Py_HAVE_CONDVAR # error You need either a POSIX-compatible or a Windows system! diff --git a/Include/internal/hamt.h b/Include/internal/pycore_hamt.h similarity index 100% rename from Include/internal/hamt.h rename to Include/internal/pycore_hamt.h diff --git a/Include/internal/hash.h b/Include/internal/pycore_hash.h similarity index 100% rename from Include/internal/hash.h rename to Include/internal/pycore_hash.h diff --git a/Include/internal/mem.h b/Include/internal/pycore_mem.h similarity index 100% rename from Include/internal/mem.h rename to Include/internal/pycore_mem.h diff --git a/Include/internal/pystate.h b/Include/internal/pycore_state.h similarity index 98% rename from Include/internal/pystate.h rename to Include/internal/pycore_state.h index 38845d32ecaf..ff25d2ebf449 100644 --- a/Include/internal/pystate.h +++ b/Include/internal/pycore_state.h @@ -7,9 +7,9 @@ extern "C" { #include "pystate.h" #include "pythread.h" -#include "internal/mem.h" -#include "internal/ceval.h" -#include "internal/warnings.h" +#include "pycore_mem.h" +#include "pycore_ceval.h" +#include "pycore_warnings.h" /* GIL state */ diff --git a/Include/internal/warnings.h b/Include/internal/pycore_warnings.h similarity index 100% rename from Include/internal/warnings.h rename to Include/internal/pycore_warnings.h diff --git a/Include/pystate.h b/Include/pystate.h index 8860f124002c..7fc921e9ac73 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -250,7 +250,7 @@ PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void); #endif #ifdef Py_BUILD_CORE /* Macro which should only be used for performance critical code. - Need "#include "internal/pystate.h". See also _PyInterpreterState_Get() + Need "#include "pycore_state.h". See also _PyInterpreterState_Get() and _PyGILState_GetInterpreterStateUnsafe(). */ # define _PyInterpreterState_GET_UNSAFE() (PyThreadState_GET()->interp) #endif diff --git a/Makefile.pre.in b/Makefile.pre.in index 232025f1cb61..0336290dd841 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -91,7 +91,7 @@ CONFIGURE_LDFLAGS= @LDFLAGS@ # command line to append to these values without stomping the pre-set # values. PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) +PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to # be able to build extension modules using the directories specified in the # environment variables @@ -1025,14 +1025,14 @@ PYTHON_HEADERS= \ pyconfig.h \ $(PARSER_HEADERS) \ $(srcdir)/Include/Python-ast.h \ - $(srcdir)/Include/internal/ceval.h \ - $(srcdir)/Include/internal/gil.h \ - $(srcdir)/Include/internal/mem.h \ - $(srcdir)/Include/internal/pyatomic.h \ - $(srcdir)/Include/internal/pygetopt.h \ - $(srcdir)/Include/internal/pystate.h \ - $(srcdir)/Include/internal/context.h \ - $(srcdir)/Include/internal/warnings.h \ + $(srcdir)/Include/internal/pycore_atomic.h \ + $(srcdir)/Include/internal/pycore_ceval.h \ + $(srcdir)/Include/internal/pycore_context.h \ + $(srcdir)/Include/internal/pycore_getopt.h \ + $(srcdir)/Include/internal/pycore_gil.h \ + $(srcdir)/Include/internal/pycore_mem.h \ + $(srcdir)/Include/internal/pycore_state.h \ + $(srcdir)/Include/internal/pycore_warnings.h \ $(DTRACE_HEADERS) $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS) diff --git a/Modules/Setup b/Modules/Setup index fb16698d2fc1..c1804630b903 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -101,29 +101,29 @@ PYTHONPATH=$(COREPYTHONPATH) # This only contains the minimal set of modules required to run the # setup.py script in the root of the Python source tree. -posix -DPy_BUILD_CORE posixmodule.c # posix (UNIX) system calls +posix -DPy_BUILD_CORE -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls errno errnomodule.c # posix (UNIX) errno values pwd pwdmodule.c # this is needed to find out the user's home dir # if $HOME is not set _sre _sre.c # Fredrik Lundh's new regular expressions _codecs _codecsmodule.c # access to the builtin codecs and codec registry _weakref _weakref.c # weak references -_functools -DPy_BUILD_CORE _functoolsmodule.c # Tools for working with functions and callable objects +_functools -DPy_BUILD_CORE -I$(srcdir)/Include/internal _functoolsmodule.c # Tools for working with functions and callable objects _operator _operator.c # operator.add() and similar goodies _collections _collectionsmodule.c # Container types _abc _abc.c # Abstract base classes itertools itertoolsmodule.c # Functions creating iterators for efficient looping atexit atexitmodule.c # Register functions to be run at interpreter-shutdown -_signal -DPy_BUILD_CORE signalmodule.c +_signal -DPy_BUILD_CORE -I$(srcdir)/Include/internal signalmodule.c _stat _stat.c # stat.h interface -time -DPy_BUILD_CORE timemodule.c # -lm # time operations and variables -_thread -DPy_BUILD_CORE _threadmodule.c # low-level threading interface +time -DPy_BUILD_CORE -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables +_thread -DPy_BUILD_CORE -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface # access to ISO C locale support _locale _localemodule.c # -lintl # Standard I/O baseline -_io -DPy_BUILD_CORE -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c +_io -DPy_BUILD_CORE -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c # faulthandler module faulthandler faulthandler.c diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index ff4172d663b6..6c28b274e561 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,7 +1,7 @@ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "structmember.h" /* _functools module written and maintained diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 2eb5262f0f7b..24ae963b2b89 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -9,7 +9,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "structmember.h" #include "pythread.h" #include "_iomodule.h" diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index d33fa9924308..ad65188d7a42 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -3,7 +3,7 @@ /* Interface to Sjoerd's portable C thread library */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "structmember.h" /* offsetof */ #include "pythread.h" diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 2eb87871694d..fb0b83add5f7 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -4,7 +4,7 @@ #include "Python.h" #include "frameobject.h" -#include "internal/pystate.h" +#include "pycore_state.h" static char * diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 4773c79b5328..a54be07b27a8 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -24,9 +24,9 @@ */ #include "Python.h" -#include "internal/context.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_context.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "frameobject.h" /* for PyFrame_ClearFreeList */ #include "pydtrace.h" #include "pytime.h" /* for _PyTime_GetMonotonicClock() */ diff --git a/Modules/getpath.c b/Modules/getpath.c index 521bc6e35ed3..53e5c2b889a6 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -1,7 +1,7 @@ /* Return the initial module search path. */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "osdefs.h" #include diff --git a/Modules/main.c b/Modules/main.c index 6a8aa05fc370..1918f4f9b8ff 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -2,9 +2,9 @@ #include "Python.h" #include "osdefs.h" -#include "internal/mem.h" -#include "internal/pygetopt.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_getopt.h" +#include "pycore_state.h" #include diff --git a/Modules/makesetup b/Modules/makesetup index c7b0a60400cf..bf5ca3902b56 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -110,7 +110,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | rulesf="@rules.$$" trap 'rm -f $rulesf' 0 1 2 3 echo " -# Rules appended by makedepend +# Rules appended by makesetup " >$rulesf DEFS= BUILT= diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 9ccdc8eff1bd..0307436e3d59 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -32,7 +32,7 @@ #else #include "winreparse.h" #endif -#include "internal/pystate.h" +#include "pycore_state.h" /* On android API level 21, 'AT_EACCESS' is not declared although * HAVE_FACCESSAT is defined. */ diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index a81de6ab6462..1915fd9be456 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -4,7 +4,7 @@ /* XXX Signals should be recorded per thread, now we have thread state. */ #include "Python.h" -#include "internal/pyatomic.h" +#include "pycore_atomic.h" #ifndef MS_WINDOWS #include "posixmodule.h" diff --git a/Objects/abstract.c b/Objects/abstract.c index 305910c3584c..be4758d94513 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1,7 +1,7 @@ /* Abstract Object Interface (many thanks to Jim Fulton) */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include #include "structmember.h" /* we need the offsetof() macro from there */ #include "longintrepr.h" diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 782e27569780..7a0c340c804e 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -2,8 +2,8 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "structmember.h" #include "bytes_methods.h" #include "bytesobject.h" diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 1b36661c84de..c912fc04fd4c 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3,8 +3,8 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "bytes_methods.h" #include "pystrhex.h" diff --git a/Objects/call.c b/Objects/call.c index bda05738755a..9061d0b1ac32 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "frameobject.h" diff --git a/Objects/cellobject.c b/Objects/cellobject.c index 7b05e61ce46f..0b390c78f04e 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -1,8 +1,8 @@ /* Cell object implementation */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" PyObject * PyCell_New(PyObject *obj) diff --git a/Objects/classobject.c b/Objects/classobject.c index c4efaf282020..93d1c67f1b43 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -1,8 +1,8 @@ /* Class object implementation (dead now except for methods) */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "structmember.h" #define TP_DESCR_GET(t) ((t)->tp_descr_get) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index cedf11ee8af8..6d8e9ac154ed 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -3,7 +3,7 @@ #include "Python.h" #include "code.h" #include "structmember.h" -#include "internal/pystate.h" +#include "pycore_state.h" /* Holder for co_extra information */ typedef struct { diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 82afa8c63f86..a23b97f396f9 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1,7 +1,7 @@ /* Descriptors -- a new, flexible way to describe attributes */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "structmember.h" /* Why is this not included in Python.h? */ /*[clinic input] diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 363d902e9c59..a9ae907d9f24 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -111,7 +111,7 @@ converting the dict to the combined table. #define PyDict_MINSIZE 8 #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "dict-common.h" #include "stringlib/eq.h" /* to get unicode_eq() */ diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 6aa3d8f8e19c..da79260ab3b8 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -6,8 +6,8 @@ #define PY_SSIZE_T_CLEAN #include -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "structmember.h" #include "osdefs.h" diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 64ee386ddf96..7704022dd2e4 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1,7 +1,7 @@ /* Frame object implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "code.h" #include "frameobject.h" diff --git a/Objects/funcobject.c b/Objects/funcobject.c index c2f79c05dbb2..e5278f09af2b 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -2,8 +2,8 @@ /* Function object implementation */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "code.h" #include "structmember.h" diff --git a/Objects/genobject.c b/Objects/genobject.c index 453b1003300b..885b3f2eca72 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1,7 +1,7 @@ /* Generator object implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "frameobject.h" #include "structmember.h" #include "opcode.h" diff --git a/Objects/iterobject.c b/Objects/iterobject.c index 5f5ebfc8c0e5..23f0639db2f1 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -1,8 +1,8 @@ /* Iterator objects */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" typedef struct { PyObject_HEAD diff --git a/Objects/listobject.c b/Objects/listobject.c index e85fa5c52635..e38b21f2a30b 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1,7 +1,7 @@ /* List object implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "accu.h" #ifdef STDC_HEADERS diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index adaa67c06446..f234bb4117dc 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -1,8 +1,8 @@ /* Memoryview object implementation */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "pystrhex.h" #include diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 9176e39234f7..b0bbfa2f5f9d 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -2,8 +2,8 @@ /* Method object implementation */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "structmember.h" /* Free list for method objects to safe malloc/free overhead diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 5181941ee7bc..7fb711a1cb07 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -2,7 +2,7 @@ /* Module object implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "structmember.h" static Py_ssize_t max_module_number; diff --git a/Objects/object.c b/Objects/object.c index b72ad019c796..f7395c783ae8 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2,8 +2,8 @@ /* Generic object operations; and implementation of None */ #include "Python.h" -#include "internal/pystate.h" -#include "internal/context.h" +#include "pycore_state.h" +#include "pycore_context.h" #include "frameobject.h" #ifdef __cplusplus diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 88ded83a29e4..6a65a1572e86 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "internal/mem.h" +#include "pycore_mem.h" #include diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 67c3674ee095..81c996be5615 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -465,7 +465,7 @@ Potential Optimizations */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "structmember.h" #include "dict-common.h" #include diff --git a/Objects/setobject.c b/Objects/setobject.c index aa1f4eedbfd4..42fe80fc0503 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -32,7 +32,7 @@ */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "structmember.h" /* Object used as dummy key to fill deleted entries */ diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 2288df514954..9f1cf78cedd3 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -14,8 +14,8 @@ this type and there is exactly one in existence. */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "structmember.h" static PyObject * diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 288f1348117a..cce266f7a2d2 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -2,7 +2,7 @@ /* Tuple object implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "accu.h" /*[clinic input] diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 722fe5f94735..9a390b3e5078 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1,7 +1,7 @@ /* Type object implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "frameobject.h" #include "structmember.h" diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index f3f940ac9ef5..3692da64122f 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -40,7 +40,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "ucnhash.h" #include "bytes_methods.h" #include "stringlib/eq.h" diff --git a/PC/getpathp.c b/PC/getpathp.c index ada02899966a..3a62738d2337 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -80,7 +80,7 @@ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "osdefs.h" #include diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 95b349c077e5..cf85e1b25d58 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -27,7 +27,7 @@ - $(PySourcePath)Include;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) + $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed @@ -194,4 +194,4 @@ public override bool Execute() { - \ No newline at end of file + diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index f65bb5b2197c..ebc35a7c0049 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -112,15 +112,16 @@ - - - - - - - - - + + + + + + + + + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 7fdadc81676d..052c89cf806c 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -135,31 +135,34 @@ Include - + Include - + Include - + Include - + Include - + Include - + Include - + Include - + Include - + + Include + + Include @@ -249,9 +252,6 @@ Include - - Include - Include diff --git a/Parser/myreadline.c b/Parser/myreadline.c index edb291a6691a..d18cf1b61bac 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -10,7 +10,7 @@ */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #ifdef MS_WINDOWS #define WIN32_LEAN_AND_MEAN #include "windows.h" diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 0a4b0c5da029..9e2159b34759 100644 --- a/Parser/pgenmain.c +++ b/Parser/pgenmain.c @@ -16,8 +16,8 @@ #define PGEN #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "pgenheaders.h" #include "grammar.h" #include "node.h" diff --git a/Python/_warnings.c b/Python/_warnings.c index 8e1c01d0b295..619ec6f26b49 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "frameobject.h" #include "clinic/_warnings.c.h" diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 8001c603939a..6c8672adfc15 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2,7 +2,7 @@ #include "Python.h" #include "Python-ast.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "node.h" #include "code.h" diff --git a/Python/ceval.c b/Python/ceval.c index 644312384843..5599b6efa3e3 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -10,7 +10,7 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "code.h" #include "dictobject.h" diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h index 4a054a97f710..f2d5fdba0153 100644 --- a/Python/ceval_gil.h +++ b/Python/ceval_gil.h @@ -5,7 +5,7 @@ #include #include -#include "internal/pyatomic.h" +#include "pycore_atomic.h" /* First some general settings */ diff --git a/Python/codecs.c b/Python/codecs.c index 4062429fe354..62bbee61c0a3 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -9,7 +9,7 @@ Copyright (c) Corporation for National Research Initiatives. ------------------------------------------------------------------------ */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "ucnhash.h" #include diff --git a/Python/condvar.h b/Python/condvar.h index 951b8ad47f07..13517409aeab 100644 --- a/Python/condvar.h +++ b/Python/condvar.h @@ -41,7 +41,7 @@ #define _CONDVAR_IMPL_H_ #include "Python.h" -#include "internal/condvar.h" +#include "pycore_condvar.h" #ifdef _POSIX_THREADS /* diff --git a/Python/context.c b/Python/context.c index 7344e968ccee..b1f67b5aa75b 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1,9 +1,9 @@ #include "Python.h" #include "structmember.h" -#include "internal/pystate.h" -#include "internal/context.h" -#include "internal/hamt.h" +#include "pycore_state.h" +#include "pycore_context.h" +#include "pycore_hamt.h" #define CONTEXT_FREELIST_MAXLEN 255 diff --git a/Python/coreconfig.c b/Python/coreconfig.c index 81086f42d679..ad14a8a457da 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1,6 +1,6 @@ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include #ifdef HAVE_LANGINFO_H # include diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 73ae26d13146..98965607761a 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -2,7 +2,7 @@ /* Support for dynamic loading of extension modules */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "importdl.h" #include diff --git a/Python/errors.c b/Python/errors.c index 2926ea1918e6..14a70d9ce8e2 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -2,7 +2,7 @@ /* Error handling */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #ifndef __STDC__ #ifndef MS_WINDOWS diff --git a/Python/frozenmain.c b/Python/frozenmain.c index 86af2b6f94c5..9e9066665867 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -2,7 +2,7 @@ /* Python interpreter main program for frozen scripts */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include #ifdef MS_WINDOWS diff --git a/Python/getopt.c b/Python/getopt.c index e8d7e523c2ea..c165a94a2d84 100644 --- a/Python/getopt.c +++ b/Python/getopt.c @@ -31,7 +31,7 @@ #include #include #include -#include "internal/pygetopt.h" +#include "pycore_getopt.h" #ifdef __cplusplus extern "C" { diff --git a/Python/hamt.c b/Python/hamt.c index 562f777ea0bf..be3813b9aab1 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -1,8 +1,8 @@ #include "Python.h" #include "structmember.h" -#include "internal/pystate.h" -#include "internal/hamt.h" +#include "pycore_state.h" +#include "pycore_hamt.h" /* This file provides an implemention of an immutable mapping using the diff --git a/Python/import.c b/Python/import.c index 338cd302dcc0..18cd29df7e93 100644 --- a/Python/import.c +++ b/Python/import.c @@ -4,9 +4,9 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with winbase.h */ -#include "internal/hash.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_hash.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "errcode.h" #include "marshal.h" #include "code.h" diff --git a/Python/pathconfig.c b/Python/pathconfig.c index efccb8d6bb85..04064159f86b 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -2,8 +2,8 @@ #include "Python.h" #include "osdefs.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include #ifdef __cplusplus diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index fab96fd52381..d349aaf6deca 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -4,10 +4,10 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with winbase.h */ -#include "internal/context.h" -#include "internal/hamt.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_context.h" +#include "pycore_hamt.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "grammar.h" #include "node.h" #include "token.h" diff --git a/Python/pystate.c b/Python/pystate.c index 98e954d9d91d..c77902a7f9c7 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -2,8 +2,8 @@ /* Thread and interpreter state structures and their interfaces */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #define _PyThreadState_SET(value) \ _Py_atomic_store_relaxed(&_PyRuntime.gilstate.tstate_current, \ diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 276c5d102858..2f61aab40d90 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -12,7 +12,7 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with winbase.h */ -#include "internal/pystate.h" +#include "pycore_state.h" #include "grammar.h" #include "node.h" #include "token.h" diff --git a/Python/symtable.c b/Python/symtable.c index dc934a556daa..dae6fda0e4c7 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #ifdef Yield #undef Yield /* undefine conflicting macro from winbase.h */ #endif diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 71414c959789..cb13e21c9405 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -15,8 +15,8 @@ Data members: */ #include "Python.h" -#include "internal/mem.h" -#include "internal/pystate.h" +#include "pycore_mem.h" +#include "pycore_state.h" #include "code.h" #include "frameobject.h" #include "pythread.h" diff --git a/Python/thread.c b/Python/thread.c index a1e1fa64f120..63553816b350 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 "internal/pystate.h" +#include "pycore_state.h" #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 5b5c715a0f44..e2070f08a5a2 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -2,7 +2,7 @@ /* Traceback implementation */ #include "Python.h" -#include "internal/pystate.h" +#include "pycore_state.h" #include "code.h" #include "frameobject.h" From webhook-mailer at python.org Wed Oct 31 20:11:58 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 01 Nov 2018 00:11:58 -0000 Subject: [Python-checkins] bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) (GH-10270) Message-ID: https://github.com/python/cpython/commit/ff56597151206a03ce421712516323430b7749c8 commit: ff56597151206a03ce421712516323430b7749c8 branch: 3.6 author: Victor Stinner committer: GitHub date: 2018-11-01T01:11:54+01:00 summary: bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) (GH-10270) Don't call _Py_FatalError_PrintExc() nor flush_std_files() if the current thread doesn't hold the GIL, or if the current thread has no Python state thread. (cherry picked from commit 3a228ab17c2a9cffd1a2f15f30d6209768de20a6) files: M Python/pylifecycle.c diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index ecfdfee218dc..56f04afc7701 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1356,12 +1356,6 @@ _Py_FatalError_PrintExc(int fd) PyObject *exception, *v, *tb; int has_tb; - if (PyThreadState_GET() == NULL) { - /* The GIL is released: trying to acquire it is likely to deadlock, - just give up. */ - return 0; - } - PyErr_Fetch(&exception, &v, &tb); if (exception == NULL) { /* No current exception */ @@ -1425,10 +1419,32 @@ Py_FatalError(const char *msg) fprintf(stderr, "Fatal Python error: %s\n", msg); fflush(stderr); /* it helps in Windows debug build */ - /* Print the exception (if an exception is set) with its traceback, - * or display the current Python stack. */ - if (!_Py_FatalError_PrintExc(fd)) + /* Check if the current thread has a Python thread state + and holds the GIL */ + PyThreadState *tss_tstate = PyGILState_GetThisThreadState(); + if (tss_tstate != NULL) { + PyThreadState *tstate = PyThreadState_GET(); + if (tss_tstate != tstate) { + /* The Python thread does not hold the GIL */ + tss_tstate = NULL; + } + } + else { + /* Py_FatalError() has been called from a C thread + which has no Python thread state. */ + } + int has_tstate_and_gil = (tss_tstate != NULL); + + if (has_tstate_and_gil) { + /* If an exception is set, print the exception with its traceback */ + if (!_Py_FatalError_PrintExc(fd)) { + /* No exception is set, or an exception is set without traceback */ + _Py_FatalError_DumpTracebacks(fd); + } + } + else { _Py_FatalError_DumpTracebacks(fd); + } /* The main purpose of faulthandler is to display the traceback. We already * did our best to display it. So faulthandler can now be disabled. @@ -1436,7 +1452,7 @@ Py_FatalError(const char *msg) _PyFaulthandler_Fini(); /* Check if the current Python thread hold the GIL */ - if (PyThreadState_GET() != NULL) { + if (has_tstate_and_gil) { /* Flush sys.stdout and sys.stderr */ flush_std_files(); } From webhook-mailer at python.org Wed Oct 31 20:51:45 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 01 Nov 2018 00:51:45 -0000 Subject: [Python-checkins] bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266) Message-ID: https://github.com/python/cpython/commit/50b48572d9a90c5bb36e2bef6179548ea927a35a commit: 50b48572d9a90c5bb36e2bef6179548ea927a35a branch: master author: Victor Stinner committer: GitHub date: 2018-11-01T01:51:40+01:00 summary: bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266) If Py_BUILD_CORE is defined, the PyThreadState_GET() macro access _PyRuntime which comes from the internal pycore_state.h header. Public headers must not require internal headers. Move PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() from Include/pystate.h to Include/internal/pycore_state.h, and rename PyThreadState_GET() to _PyThreadState_GET() there. The PyThreadState_GET() macro of pystate.h is now redefined when pycore_state.h is included, to use the fast _PyThreadState_GET(). Changes: * Add _PyThreadState_GET() macro * Replace "PyThreadState_GET()->interp" with _PyInterpreterState_GET_UNSAFE() * Replace PyThreadState_GET() with _PyThreadState_GET() in internal C files (compiled with Py_BUILD_CORE defined), but keep PyThreadState_GET() in the public header files. * _testcapimodule.c: replace PyThreadState_GET() with PyThreadState_Get(); the module is not compiled with Py_BUILD_CORE defined. * pycore_state.h now requires Py_BUILD_CORE to be defined. files: M Include/internal/pycore_state.h M Include/pystate.h M Modules/_testcapimodule.c M Objects/call.c M Objects/dictobject.c M Objects/genobject.c M Objects/object.c M Objects/odictobject.c M Objects/typeobject.c M Parser/myreadline.c M Python/_warnings.c M Python/ceval.c M Python/context.c M Python/errors.c M Python/pylifecycle.c M Python/pystate.c M Python/symtable.c M Python/sysmodule.c M Python/thread_nt.h M Python/thread_pthread.h diff --git a/Include/internal/pycore_state.h b/Include/internal/pycore_state.h index ff25d2ebf449..9a084f7f4d84 100644 --- a/Include/internal/pycore_state.h +++ b/Include/internal/pycore_state.h @@ -4,6 +4,10 @@ extern "C" { #endif +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif + #include "pystate.h" #include "pythread.h" @@ -214,6 +218,36 @@ PyAPI_FUNC(_PyInitError) _PyRuntime_Initialize(void); (_PyRuntime.finalizing == tstate) +/* Variable and macro for in-line access to current thread + and interpreter state */ + +/* Get the current Python thread state. + + Efficient macro reading directly the 'gilstate.tstate_current' atomic + variable. The macro is unsafe: it does not check for error and it can + return NULL. + + The caller must hold the GIL. + + See also PyThreadState_Get() and PyThreadState_GET(). */ +#define _PyThreadState_GET() \ + ((PyThreadState*)_Py_atomic_load_relaxed(&_PyRuntime.gilstate.tstate_current)) + +/* Redefine PyThreadState_GET() as an alias to _PyThreadState_GET() */ +#undef PyThreadState_GET +#define PyThreadState_GET() _PyThreadState_GET() + +/* Get the current interpreter state. + + The macro is unsafe: it does not check for error and it can return NULL. + + The caller must hold the GIL. + + See also _PyInterpreterState_Get() + and _PyGILState_GetInterpreterStateUnsafe(). */ +#define _PyInterpreterState_GET_UNSAFE() (_PyThreadState_GET()->interp) + + /* Other */ PyAPI_FUNC(_PyInitError) _PyInterpreterState_Enable(_PyRuntimeState *); diff --git a/Include/pystate.h b/Include/pystate.h index 7fc921e9ac73..b30c3187b678 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -245,15 +245,17 @@ typedef struct _ts { PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void); PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *); PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *); + #if !defined(Py_LIMITED_API) +/* Get the current interpreter state. + + Issue a fatal error if there no current Python thread state or no current + interpreter. It cannot return NULL. + + The caller must hold the GIL.*/ PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void); #endif -#ifdef Py_BUILD_CORE - /* Macro which should only be used for performance critical code. - Need "#include "pycore_state.h". See also _PyInterpreterState_Get() - and _PyGILState_GetInterpreterStateUnsafe(). */ -# define _PyInterpreterState_GET_UNSAFE() (PyThreadState_GET()->interp) -#endif + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000 /* New in 3.7 */ PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *); @@ -286,11 +288,27 @@ PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); PyAPI_FUNC(void) _PyGILState_Reinit(void); #endif /* !Py_LIMITED_API */ -/* Return the current thread state. The global interpreter lock must be held. - * When the current thread state is NULL, this issues a fatal error (so that - * the caller needn't check for NULL). */ +/* Get the current thread state. + + When the current thread state is NULL, this issues a fatal error (so that + the caller needn't check for NULL). + + The caller must hold the GIL. + + See also PyThreadState_GET() and _PyThreadState_GET(). */ PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); +/* Get the current Python thread state. + + Macro using PyThreadState_Get() or _PyThreadState_GET() depending if + pycore_state.h is included or not (this header redefines the macro). + + If PyThreadState_Get() is used, issue a fatal error if the current thread + state is NULL. + + See also PyThreadState_Get() and _PyThreadState_GET(). */ +#define PyThreadState_GET() PyThreadState_Get() + #ifndef Py_LIMITED_API /* Similar to PyThreadState_Get(), but don't issue a fatal error * if it is NULL. */ @@ -301,18 +319,6 @@ PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *); PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void); PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *); - -/* Variable and macro for in-line access to current thread state */ - -/* Assuming the current thread holds the GIL, this is the - PyThreadState for the current thread. */ -#ifdef Py_BUILD_CORE -# define PyThreadState_GET() \ - ((PyThreadState*)_Py_atomic_load_relaxed(&_PyRuntime.gilstate.tstate_current)) -#else -# define PyThreadState_GET() PyThreadState_Get() -#endif - typedef enum {PyGILState_LOCKED, PyGILState_UNLOCKED} PyGILState_STATE; @@ -366,11 +372,11 @@ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); The function returns 1 if _PyGILState_check_enabled is non-zero. */ PyAPI_FUNC(int) PyGILState_Check(void); -/* Unsafe function to get the single PyInterpreterState used by this process' - GILState implementation. +/* Get the single PyInterpreterState used by this process' GILState + implementation. - Return NULL before _PyGILState_Init() is called and after _PyGILState_Fini() - is called. + 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(). */ PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index b2cda5142308..018af4a13707 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4160,7 +4160,7 @@ test_PyTime_AsMicroseconds(PyObject *self, PyObject *args) static PyObject* get_recursion_depth(PyObject *self, PyObject *args) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = PyThreadState_Get(); /* subtract one to ignore the frame of the get_recursion_depth() call */ return PyLong_FromLong(tstate->recursion_depth - 1); diff --git a/Objects/call.c b/Objects/call.c index 9061d0b1ac32..48e3aafe5fe5 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -258,7 +258,7 @@ function_code_fastcall(PyCodeObject *co, PyObject *const *args, Py_ssize_t nargs PyObject *globals) { PyFrameObject *f; - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject **fastlocals; Py_ssize_t i; PyObject *result; diff --git a/Objects/dictobject.c b/Objects/dictobject.c index a9ae907d9f24..ea564a2b7c9f 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1314,9 +1314,9 @@ PyDict_GetItem(PyObject *op, PyObject *key) /* We can arrive here with a NULL tstate during initialization: try running "python -Wi" for an example related to string interning. Let's just hope that no exception occurs then... This must be - PyThreadState_GET() and not PyThreadState_Get() because the latter + _PyThreadState_GET() and not PyThreadState_Get() because the latter abort Python if tstate is NULL. */ - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); if (tstate != NULL && tstate->curexc_type != NULL) { /* preserve the existing exception */ PyObject *err_type, *err_value, *err_tb; diff --git a/Objects/genobject.c b/Objects/genobject.c index 885b3f2eca72..7c2948bb52d0 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -151,7 +151,7 @@ gen_dealloc(PyGenObject *gen) static PyObject * gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyFrameObject *f = gen->gi_frame; PyObject *result; @@ -1157,7 +1157,7 @@ PyCoro_New(PyFrameObject *f, PyObject *name, PyObject *qualname) return NULL; } - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int origin_depth = tstate->coroutine_origin_tracking_depth; if (origin_depth == 0) { @@ -1267,7 +1267,7 @@ async_gen_init_hooks(PyAsyncGenObject *o) o->ag_hooks_inited = 1; - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); finalizer = tstate->async_gen_finalizer; if (finalizer) { diff --git a/Objects/object.c b/Objects/object.c index f7395c783ae8..d3a97f6c5bd4 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2136,7 +2136,7 @@ _PyTrash_deposit_object(PyObject *op) void _PyTrash_thread_deposit_object(PyObject *op) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); _PyObject_ASSERT(op, PyObject_IS_GC(op)); _PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op)); _PyObject_ASSERT(op, op->ob_refcnt == 0); @@ -2174,7 +2174,7 @@ _PyTrash_destroy_chain(void) void _PyTrash_thread_destroy_chain(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); /* We need to increase trash_delete_nesting here, otherwise, _PyTrash_thread_destroy_chain will be called recursively and then possibly crash. An example that may crash without diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 81c996be5615..52ac7e5f88b0 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1355,7 +1355,7 @@ static PyGetSetDef odict_getset[] = { static void odict_dealloc(PyODictObject *self) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject_GC_UnTrack(self); Py_TRASHCAN_SAFE_BEGIN(self) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 9a390b3e5078..dedc4f7c8764 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1115,7 +1115,7 @@ subtype_dealloc(PyObject *self) { PyTypeObject *type, *base; destructor basedealloc; - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int has_finalizer; /* Extract the type; we expect it to be a heap type */ @@ -7678,7 +7678,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) PyFrameObject *f; PyCodeObject *co; Py_ssize_t i, n; - f = PyThreadState_GET()->frame; + f = _PyThreadState_GET()->frame; if (f == NULL) { PyErr_SetString(PyExc_RuntimeError, "super(): no current frame"); diff --git a/Parser/myreadline.c b/Parser/myreadline.c index d18cf1b61bac..f511319814a5 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -301,7 +301,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) char *rv, *res; size_t len; - if (_PyOS_ReadlineTState == PyThreadState_GET()) { + if (_PyOS_ReadlineTState == _PyThreadState_GET()) { PyErr_SetString(PyExc_RuntimeError, "can't re-enter readline"); return NULL; @@ -316,7 +316,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) _PyOS_ReadlineLock = PyThread_allocate_lock(); } - _PyOS_ReadlineTState = PyThreadState_GET(); + _PyOS_ReadlineTState = _PyThreadState_GET(); Py_BEGIN_ALLOW_THREADS PyThread_acquire_lock(_PyOS_ReadlineLock, 1); diff --git a/Python/_warnings.c b/Python/_warnings.c index 619ec6f26b49..9b50289bb67b 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -671,7 +671,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, PyObject *globals; /* Setup globals, filename and lineno. */ - PyFrameObject *f = PyThreadState_GET()->frame; + PyFrameObject *f = _PyThreadState_GET()->frame; // 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)) { diff --git a/Python/ceval.c b/Python/ceval.c index 5599b6efa3e3..ac9db1533bf3 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -157,7 +157,7 @@ PyEval_InitThreads(void) if (gil_created()) return; create_gil(); - take_gil(PyThreadState_GET()); + take_gil(_PyThreadState_GET()); _PyRuntime.ceval.pending.main_thread = PyThread_get_thread_ident(); if (!_PyRuntime.ceval.pending.lock) _PyRuntime.ceval.pending.lock = PyThread_allocate_lock(); @@ -175,7 +175,7 @@ _PyEval_FiniThreads(void) void PyEval_AcquireLock(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) Py_FatalError("PyEval_AcquireLock: current thread state is NULL"); take_gil(tstate); @@ -185,10 +185,10 @@ void PyEval_ReleaseLock(void) { /* This function must succeed when the current thread state is NULL. - We therefore avoid PyThreadState_GET() which dumps a fatal error + We therefore avoid PyThreadState_Get() which dumps a fatal error in debug mode. */ - drop_gil(PyThreadState_GET()); + drop_gil(_PyThreadState_GET()); } void @@ -222,7 +222,7 @@ PyEval_ReleaseThread(PyThreadState *tstate) void PyEval_ReInitThreads(void) { - PyThreadState *current_tstate = PyThreadState_GET(); + PyThreadState *current_tstate = _PyThreadState_GET(); if (!gil_created()) return; @@ -462,7 +462,7 @@ Py_SetRecursionLimit(int new_limit) int _Py_CheckRecursiveCall(const char *where) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int recursion_limit = _PyRuntime.ceval.recursion_limit; #ifdef USE_STACKCHECK @@ -543,7 +543,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag) int oparg; /* Current opcode argument, if any */ PyObject **fastlocals, **freevars; PyObject *retval = NULL; /* Return value */ - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyCodeObject *co; /* when tracing we set things up so that @@ -3702,7 +3702,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals, } /* Create the frame */ - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); assert(tstate != NULL); f = _PyFrame_New_NoTrack(tstate, co, globals, locals); if (f == NULL) { @@ -4003,7 +4003,7 @@ do_raise(PyObject *exc, PyObject *cause) if (exc == NULL) { /* Reraise */ - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); _PyErr_StackItem *exc_info = _PyErr_GetTopmostException(tstate); PyObject *tb; type = exc_info->exc_type; @@ -4275,7 +4275,7 @@ call_trace(Py_tracefunc func, PyObject *obj, PyObject * _PyEval_CallTracing(PyObject *func, PyObject *args) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); int save_tracing = tstate->tracing; int save_use_tracing = tstate->use_tracing; PyObject *result; @@ -4329,7 +4329,7 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj, void PyEval_SetProfile(Py_tracefunc func, PyObject *arg) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *temp = tstate->c_profileobj; Py_XINCREF(arg); tstate->c_profilefunc = NULL; @@ -4346,7 +4346,7 @@ PyEval_SetProfile(Py_tracefunc func, PyObject *arg) void PyEval_SetTrace(Py_tracefunc func, PyObject *arg) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *temp = tstate->c_traceobj; _Py_TracingPossible += (func != NULL) - (tstate->c_tracefunc != NULL); Py_XINCREF(arg); @@ -4366,21 +4366,21 @@ void _PyEval_SetCoroutineOriginTrackingDepth(int new_depth) { assert(new_depth >= 0); - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); tstate->coroutine_origin_tracking_depth = new_depth; } int _PyEval_GetCoroutineOriginTrackingDepth(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return tstate->coroutine_origin_tracking_depth; } void _PyEval_SetCoroutineWrapper(PyObject *wrapper) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); Py_XINCREF(wrapper); Py_XSETREF(tstate->coroutine_wrapper, wrapper); @@ -4389,14 +4389,14 @@ _PyEval_SetCoroutineWrapper(PyObject *wrapper) PyObject * _PyEval_GetCoroutineWrapper(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return tstate->coroutine_wrapper; } void _PyEval_SetAsyncGenFirstiter(PyObject *firstiter) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); Py_XINCREF(firstiter); Py_XSETREF(tstate->async_gen_firstiter, firstiter); @@ -4405,14 +4405,14 @@ _PyEval_SetAsyncGenFirstiter(PyObject *firstiter) PyObject * _PyEval_GetAsyncGenFirstiter(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return tstate->async_gen_firstiter; } void _PyEval_SetAsyncGenFinalizer(PyObject *finalizer) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); Py_XINCREF(finalizer); Py_XSETREF(tstate->async_gen_finalizer, finalizer); @@ -4421,7 +4421,7 @@ _PyEval_SetAsyncGenFinalizer(PyObject *finalizer) PyObject * _PyEval_GetAsyncGenFinalizer(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return tstate->async_gen_finalizer; } @@ -4465,7 +4465,7 @@ PyEval_GetGlobals(void) PyFrameObject * PyEval_GetFrame(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return _PyThreadState_GetFrame(tstate); } @@ -4566,11 +4566,11 @@ call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames) presumed to be the most frequent callable object. */ if (PyCFunction_Check(func)) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); C_TRACE(x, _PyCFunction_FastCallKeywords(func, stack, nargs, kwnames)); } else if (Py_TYPE(func) == &PyMethodDescr_Type) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (nargs > 0 && tstate->use_tracing) { /* We need to create a temporary bound method as argument for profiling. @@ -4640,12 +4640,12 @@ do_call_core(PyObject *func, PyObject *callargs, PyObject *kwdict) PyObject *result; if (PyCFunction_Check(func)) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); return result; } else if (Py_TYPE(func) == &PyMethodDescr_Type) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); Py_ssize_t nargs = PyTuple_GET_SIZE(callargs); if (nargs > 0 && tstate->use_tracing) { /* We need to create a temporary bound method as argument diff --git a/Python/context.c b/Python/context.c index b1f67b5aa75b..1fb2a5de2b1b 100644 --- a/Python/context.c +++ b/Python/context.c @@ -112,7 +112,7 @@ PyContext_Enter(PyObject *octx) return -1; } - PyThreadState *ts = PyThreadState_GET(); + PyThreadState *ts = _PyThreadState_GET(); assert(ts != NULL); ctx->ctx_prev = (PyContext *)ts->context; /* borrow */ @@ -138,7 +138,7 @@ PyContext_Exit(PyObject *octx) return -1; } - PyThreadState *ts = PyThreadState_GET(); + PyThreadState *ts = _PyThreadState_GET(); assert(ts != NULL); if (ts->context != (PyObject *)ctx) { @@ -178,7 +178,7 @@ PyContextVar_Get(PyObject *ovar, PyObject *def, PyObject **val) ENSURE_ContextVar(ovar, -1) PyContextVar *var = (PyContextVar *)ovar; - PyThreadState *ts = PyThreadState_GET(); + PyThreadState *ts = _PyThreadState_GET(); assert(ts != NULL); if (ts->context == NULL) { goto not_found; @@ -382,7 +382,7 @@ context_new_from_vars(PyHamtObject *vars) static inline PyContext * context_get(void) { - PyThreadState *ts = PyThreadState_GET(); + PyThreadState *ts = _PyThreadState_GET(); assert(ts != NULL); PyContext *current_ctx = (PyContext *)ts->context; if (current_ctx == NULL) { diff --git a/Python/errors.c b/Python/errors.c index 14a70d9ce8e2..4c6c34c74fa6 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -28,7 +28,7 @@ _Py_IDENTIFIER(stderr); void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *oldtype, *oldvalue, *oldtraceback; if (traceback != NULL && !PyTraceBack_Check(traceback)) { @@ -82,7 +82,7 @@ _PyErr_CreateException(PyObject *exception, PyObject *value) void PyErr_SetObject(PyObject *exception, PyObject *value) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *exc_value; PyObject *tb = NULL; @@ -175,7 +175,7 @@ PyErr_SetString(PyObject *exception, const char *string) PyObject* _Py_HOT_FUNCTION PyErr_Occurred(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); return tstate == NULL ? NULL : tstate->curexc_type; } @@ -334,7 +334,7 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb) void PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); *p_type = tstate->curexc_type; *p_value = tstate->curexc_value; @@ -354,7 +354,7 @@ PyErr_Clear(void) void PyErr_GetExcInfo(PyObject **p_type, PyObject **p_value, PyObject **p_traceback) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); _PyErr_StackItem *exc_info = _PyErr_GetTopmostException(tstate); *p_type = exc_info->exc_type; @@ -371,7 +371,7 @@ void PyErr_SetExcInfo(PyObject *p_type, PyObject *p_value, PyObject *p_traceback) { PyObject *oldtype, *oldvalue, *oldtraceback; - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); oldtype = tstate->exc_info->exc_type; oldvalue = tstate->exc_info->exc_value; diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index d349aaf6deca..160f30ce6d6e 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -530,7 +530,7 @@ _Py_InitializeCore_impl(PyInterpreterState **interp_p, /* bpo-34008: For backward compatibility reasons, calling Py_Main() after Py_Initialize() ignores the new configuration. */ if (_PyRuntime.core_initialized) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (!tstate) { return _Py_INIT_ERR("failed to read thread state"); } @@ -1009,7 +1009,7 @@ Py_FinalizeEx(void) wait_for_thread_shutdown(); /* Get current thread state and interpreter pointer */ - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); interp = tstate->interp; /* The interpreter is still entirely intact at this point, and the @@ -1406,7 +1406,7 @@ Py_EndInterpreter(PyThreadState *tstate) { PyInterpreterState *interp = tstate->interp; - if (tstate != PyThreadState_GET()) + if (tstate != _PyThreadState_GET()) Py_FatalError("Py_EndInterpreter: thread is not current"); if (tstate->frame != NULL) Py_FatalError("Py_EndInterpreter: thread still has a frame"); @@ -1928,7 +1928,7 @@ fatal_error(const char *prefix, const char *msg, int status) and holds the GIL */ PyThreadState *tss_tstate = PyGILState_GetThisThreadState(); if (tss_tstate != NULL) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tss_tstate != tstate) { /* The Python thread does not hold the GIL */ tss_tstate = NULL; diff --git a/Python/pystate.c b/Python/pystate.c index c77902a7f9c7..c193a10c8cb2 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -307,7 +307,7 @@ _PyInterpreterState_DeleteExceptMain() PyInterpreterState * _PyInterpreterState_Get(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { Py_FatalError("_PyInterpreterState_Get(): no current thread state"); } @@ -689,7 +689,7 @@ tstate_delete_common(PyThreadState *tstate) void PyThreadState_Delete(PyThreadState *tstate) { - if (tstate == PyThreadState_GET()) + if (tstate == _PyThreadState_GET()) Py_FatalError("PyThreadState_Delete: tstate is still current"); if (_PyRuntime.gilstate.autoInterpreterState && PyThread_tss_get(&_PyRuntime.gilstate.autoTSSkey) == tstate) @@ -703,7 +703,7 @@ PyThreadState_Delete(PyThreadState *tstate) void PyThreadState_DeleteCurrent() { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) Py_FatalError( "PyThreadState_DeleteCurrent: no current tstate"); @@ -758,14 +758,14 @@ _PyThreadState_DeleteExcept(PyThreadState *tstate) PyThreadState * _PyThreadState_UncheckedGet(void) { - return PyThreadState_GET(); + return _PyThreadState_GET(); } PyThreadState * PyThreadState_Get(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) Py_FatalError("PyThreadState_Get: no current thread"); @@ -776,7 +776,7 @@ PyThreadState_Get(void) PyThreadState * PyThreadState_Swap(PyThreadState *newts) { - PyThreadState *oldts = PyThreadState_GET(); + PyThreadState *oldts = _PyThreadState_GET(); _PyThreadState_SET(newts); /* It should not be possible for more than one thread state @@ -807,7 +807,7 @@ PyThreadState_Swap(PyThreadState *newts) PyObject * PyThreadState_GetDict(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) return NULL; @@ -958,7 +958,7 @@ PyThreadState_IsCurrent(PyThreadState *tstate) { /* Must be the tstate for this thread */ assert(PyGILState_GetThisThreadState()==tstate); - return tstate == PyThreadState_GET(); + return tstate == _PyThreadState_GET(); } /* Internal initialization/finalization functions called by @@ -1085,7 +1085,7 @@ PyGILState_Check(void) return 1; } - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); if (tstate == NULL) return 0; diff --git a/Python/symtable.c b/Python/symtable.c index dae6fda0e4c7..48e1515fa3bf 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -265,7 +265,7 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) st->st_future = future; /* Setup recursion depth check counters */ - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); if (!tstate) { PySymtable_Free(st); return NULL; diff --git a/Python/sysmodule.c b/Python/sysmodule.c index cb13e21c9405..830f0a88e4fb 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -336,7 +336,7 @@ PyDoc_STRVAR(excepthook_doc, static PyObject * sys_exc_info(PyObject *self, PyObject *noargs) { - _PyErr_StackItem *err_info = _PyErr_GetTopmostException(PyThreadState_GET()); + _PyErr_StackItem *err_info = _PyErr_GetTopmostException(_PyThreadState_GET()); return Py_BuildValue( "(OOO)", err_info->exc_type != NULL ? err_info->exc_type : Py_None, @@ -565,7 +565,7 @@ function call. See the debugger chapter in the library manual." static PyObject * sys_gettrace(PyObject *self, PyObject *args) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *temp = tstate->c_traceobj; if (temp == NULL) @@ -603,7 +603,7 @@ and return. See the profiler chapter in the library manual." static PyObject * sys_getprofile(PyObject *self, PyObject *args) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); PyObject *temp = tstate->c_profileobj; if (temp == NULL) @@ -722,7 +722,7 @@ sys_setrecursionlimit(PyObject *self, PyObject *args) the new low-water mark. Otherwise it may not be possible anymore to reset the overflowed flag to 0. */ mark = _Py_RecursionLimitLowerWaterMark(new_limit); - tstate = PyThreadState_GET(); + tstate = _PyThreadState_GET(); if (tstate->recursion_depth >= mark) { PyErr_Format(PyExc_RecursionError, "cannot set the recursion limit to %i at " @@ -1362,7 +1362,7 @@ purposes only." static PyObject * sys_getframe(PyObject *self, PyObject *args) { - PyFrameObject *f = PyThreadState_GET()->frame; + PyFrameObject *f = _PyThreadState_GET()->frame; int depth = -1; if (!PyArg_ParseTuple(args, "|i:_getframe", &depth)) @@ -1745,7 +1745,7 @@ static int _PySys_ReadPreInitOptions(void) { /* Rerun the add commands with the actual sys module available */ - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { /* Still don't have a thread state, so something is wrong! */ return -1; @@ -1796,7 +1796,7 @@ get_warnoptions(void) void PySys_ResetWarnOptions(void) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { _clear_preinit_entries(&_preinit_warnoptions); return; @@ -1835,7 +1835,7 @@ PySys_AddWarnOptionUnicode(PyObject *option) void PySys_AddWarnOption(const wchar_t *s) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { _append_preinit_entry(&_preinit_warnoptions, s); return; @@ -1922,7 +1922,7 @@ _PySys_AddXOptionWithError(const wchar_t *s) void PySys_AddXOption(const wchar_t *s) { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { _append_preinit_entry(&_preinit_xoptions, s); return; diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 61fa8619bc17..21ef5556a6bc 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -189,7 +189,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) return PYTHREAD_INVALID_THREAD_ID; obj->func = func; obj->arg = arg; - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0; hThread = (HANDLE)_beginthreadex(0, Py_SAFE_DOWNCAST(stacksize, Py_ssize_t, unsigned int), @@ -334,13 +334,13 @@ _pythread_nt_set_stacksize(size_t size) { /* set to default */ if (size == 0) { - PyThreadState_GET()->interp->pythread_stacksize = 0; + _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = 0; return 0; } /* valid range? */ if (size >= THREAD_MIN_STACKSIZE && size < THREAD_MAX_STACKSIZE) { - PyThreadState_GET()->interp->pythread_stacksize = size; + _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = size; return 0; } diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 697140558fdc..6da8b3a44734 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -174,7 +174,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) return PYTHREAD_INVALID_THREAD_ID; #endif #if defined(THREAD_STACK_SIZE) - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0; tss = (stacksize != 0) ? stacksize : THREAD_STACK_SIZE; if (tss != 0) { @@ -591,7 +591,7 @@ _pythread_pthread_set_stacksize(size_t size) /* set to default */ if (size == 0) { - PyThreadState_GET()->interp->pythread_stacksize = 0; + _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = 0; return 0; } @@ -608,7 +608,7 @@ _pythread_pthread_set_stacksize(size_t size) rc = pthread_attr_setstacksize(&attrs, size); pthread_attr_destroy(&attrs); if (rc == 0) { - PyThreadState_GET()->interp->pythread_stacksize = size; + _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = size; return 0; } } From webhook-mailer at python.org Wed Oct 31 21:30:41 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 01 Nov 2018 01:30:41 -0000 Subject: [Python-checkins] bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271) Message-ID: https://github.com/python/cpython/commit/e281f7d80ce2584a7e6a36acffb5a9cd796a0fe2 commit: e281f7d80ce2584a7e6a36acffb5a9cd796a0fe2 branch: master author: Victor Stinner committer: GitHub date: 2018-11-01T02:30:36+01:00 summary: bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271) The accu.h header is no longer part of the Python C API: it has been moved to the "internal" headers which are restricted to Python itself. Replace #include "accu.h" with #include "pycore_accu.h". files: A Include/internal/pycore_accu.h D Include/accu.h M Makefile.pre.in M Modules/_io/stringio.c M Modules/_json.c M Objects/accu.c M Objects/listobject.c M Objects/tupleobject.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Include/accu.h b/Include/internal/pycore_accu.h similarity index 88% rename from Include/accu.h rename to Include/internal/pycore_accu.h index 3636ea6c98fd..ab1aad280346 100644 --- a/Include/accu.h +++ b/Include/internal/pycore_accu.h @@ -1,6 +1,9 @@ #ifndef Py_LIMITED_API -#ifndef Py_ACCU_H -#define Py_ACCU_H +#ifndef Py_INTERNAL_ACCU_H +#define Py_INTERNAL_ACCU_H +#ifdef __cplusplus +extern "C" { +#endif /*** This is a private API for use by the interpreter and the stdlib. *** Its definition may be changed or removed at any moment. @@ -12,10 +15,6 @@ * behaviour of using a naive repeated concatenation scheme. */ -#ifdef __cplusplus -extern "C" { -#endif - #undef small /* defined by some Windows headers */ typedef struct { @@ -32,6 +31,5 @@ PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc); #ifdef __cplusplus } #endif - -#endif /* Py_ACCU_H */ -#endif /* Py_LIMITED_API */ +#endif /* !Py_INTERNAL_ACCU_H */ +#endif /* !Py_LIMITED_API */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 0336290dd841..fc8b1e4e7334 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -935,7 +935,6 @@ regen-typeslots: PYTHON_HEADERS= \ $(srcdir)/Include/Python.h \ $(srcdir)/Include/abstract.h \ - $(srcdir)/Include/accu.h \ $(srcdir)/Include/asdl.h \ $(srcdir)/Include/ast.h \ $(srcdir)/Include/bltinmodule.h \ @@ -1025,6 +1024,7 @@ PYTHON_HEADERS= \ pyconfig.h \ $(PARSER_HEADERS) \ $(srcdir)/Include/Python-ast.h \ + $(srcdir)/Include/internal/pycore_accu.h \ $(srcdir)/Include/internal/pycore_atomic.h \ $(srcdir)/Include/internal/pycore_ceval.h \ $(srcdir)/Include/internal/pycore_context.h \ diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 5a03715fbde0..793fa1ee150b 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -1,7 +1,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" -#include "accu.h" +#include "pycore_accu.h" #include "_iomodule.h" /* Implementation note: the buffer is always at least one character longer diff --git a/Modules/_json.c b/Modules/_json.c index ac6e017a4eaf..53e1e88fa4bf 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -7,7 +7,7 @@ #include "Python.h" #include "structmember.h" -#include "accu.h" +#include "pycore_accu.h" #ifdef __GNUC__ #define UNUSED __attribute__((__unused__)) diff --git a/Objects/accu.c b/Objects/accu.c index 48fe02da5409..c8b5d382e388 100644 --- a/Objects/accu.c +++ b/Objects/accu.c @@ -1,7 +1,7 @@ /* Accumulator struct implementation */ #include "Python.h" -#include "accu.h" +#include "pycore_accu.h" static PyObject * join_list_unicode(PyObject *lst) diff --git a/Objects/listobject.c b/Objects/listobject.c index e38b21f2a30b..ffd91a63e323 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2,7 +2,7 @@ #include "Python.h" #include "pycore_state.h" -#include "accu.h" +#include "pycore_accu.h" #ifdef STDC_HEADERS #include diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index cce266f7a2d2..c997bc6fa2d0 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -3,7 +3,7 @@ #include "Python.h" #include "pycore_state.h" -#include "accu.h" +#include "pycore_accu.h" /*[clinic input] class tuple "PyTupleObject *" "&PyTuple_Type" diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index ebc35a7c0049..6becb8a3682c 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -79,7 +79,6 @@ - @@ -112,6 +111,7 @@ + @@ -154,7 +154,6 @@ - diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 052c89cf806c..bc118c636cde 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -36,9 +36,6 @@ Include - - Include - Include @@ -135,6 +132,9 @@ Include + + Include + Include From webhook-mailer at python.org Wed Oct 31 21:49:14 2018 From: webhook-mailer at python.org (Xiang Zhang) Date: Thu, 01 Nov 2018 01:49:14 -0000 Subject: [Python-checkins] [2.7] bpo-32804: Include the context parameter in urlretrieve documentation (GH-10203) Message-ID: https://github.com/python/cpython/commit/aa39c1ab6de6d3fb0204741efdde9b7eed25b093 commit: aa39c1ab6de6d3fb0204741efdde9b7eed25b093 branch: 2.7 author: Lysandros Nikolaou committer: Xiang Zhang date: 2018-11-01T09:49:10+08:00 summary: [2.7] bpo-32804: Include the context parameter in urlretrieve documentation (GH-10203) files: M Doc/library/urllib.rst diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst index c24f4375e9d8..084d567e5e2e 100644 --- a/Doc/library/urllib.rst +++ b/Doc/library/urllib.rst @@ -147,14 +147,15 @@ High-level interface :envvar:`no_proxy` environment variable. .. versionchanged:: 2.7.9 - The *context* parameter was added. All the neccessary certificate and hostname checks are done by default. + The *context* parameter was added. All the neccessary certificate and hostname + checks are done by default. .. deprecated:: 2.6 The :func:`urlopen` function has been removed in Python 3 in favor of :func:`urllib2.urlopen`. -.. function:: urlretrieve(url[, filename[, reporthook[, data]]]) +.. function:: urlretrieve(url[, filename[, reporthook[, data[, context]]]]) Copy a network object denoted by a URL to a local file, if necessary. If the URL points to a local file, or a valid cached copy of the object exists, the object @@ -179,6 +180,10 @@ High-level interface :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode` function below. + The *context* parameter may be set to a :class:`ssl.SSLContext` instance to + configure the SSL settings that are used if :func:`urlretrieve` makes a HTTPS + connection. + .. versionchanged:: 2.5 :func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects that the amount of data available was less than the expected amount (which is the @@ -196,6 +201,10 @@ High-level interface the size of the data it has downloaded, and just returns it. In this case you just have to assume that the download was successful. + .. versionchanged:: 2.7.9 + The *context* parameter was added. All the neccessary certificate and hostname + checks are done by default. + .. data:: _urlopener @@ -349,6 +358,10 @@ URL Opener objects :class:`URLopener` objects will raise an :exc:`IOError` exception if the server returns an error code. + .. versionchanged:: 2.7.9 + The *context* parameter was added. All the neccessary certificate and hostname + checks are done by default. + .. method:: open(fullurl[, data]) Open *fullurl* using the appropriate protocol. This method sets up cache and From webhook-mailer at python.org Wed Oct 31 22:16:02 2018 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 01 Nov 2018 02:16:02 -0000 Subject: [Python-checkins] bpo-35081: And pycore_lifecycle.h and pycore_pathconfig.h (GH-10273) Message-ID: https://github.com/python/cpython/commit/a1c249c40517917d2e0971d55aea8d14a44b2cc8 commit: a1c249c40517917d2e0971d55aea8d14a44b2cc8 branch: master author: Victor Stinner committer: GitHub date: 2018-11-01T03:15:58+01:00 summary: bpo-35081: And pycore_lifecycle.h and pycore_pathconfig.h (GH-10273) * And pycore_lifecycle.h and pycore_pathconfig.h headers to Include/internal/ * Move Py_BUILD_CORE specific code from coreconfig.h and pylifecycle.h to pycore_pathconfig.h and pycore_lifecycle.h * Move _Py_wstrlist_XXX() definitions and _PyPathConfig code from pycore_state.h to pycore_pathconfig.h * Move "Init" and "Fini" function definitions from pylifecycle.c to pycore_lifecycle.h. files: A Include/internal/pycore_lifecycle.h A Include/internal/pycore_pathconfig.h M Include/coreconfig.h M Include/internal/pycore_state.h M Include/pylifecycle.h M Makefile.pre.in M Modules/_testcapimodule.c M Modules/getpath.c M Modules/main.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Programs/python.c M Python/coreconfig.c M Python/import.c M Python/pathconfig.c M Python/pylifecycle.c M Python/sysmodule.c diff --git a/Include/coreconfig.h b/Include/coreconfig.h index 83c4e7ee4dbe..ff7b684a1fa5 100644 --- a/Include/coreconfig.h +++ b/Include/coreconfig.h @@ -361,17 +361,6 @@ PyAPI_FUNC(int) _PyCoreConfig_GetEnvDup( #endif -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _Py_SetFileSystemEncoding( - const char *encoding, - const char *errors); -PyAPI_FUNC(void) _Py_ClearFileSystemEncoding(void); -#endif - -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject*) _Py_wstrlist_as_pylist(int len, wchar_t **list); -#endif - #ifdef __cplusplus } diff --git a/Include/internal/pycore_lifecycle.h b/Include/internal/pycore_lifecycle.h new file mode 100644 index 000000000000..cf36440eabcf --- /dev/null +++ b/Include/internal/pycore_lifecycle.h @@ -0,0 +1,50 @@ +#ifndef Py_INTERNAL_LIFECYCLE_H +#define Py_INTERNAL_LIFECYCLE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif + +PyAPI_FUNC(int) _Py_UnixMain(int argc, char **argv); + +PyAPI_FUNC(int) _Py_SetFileSystemEncoding( + const char *encoding, + const char *errors); +PyAPI_FUNC(void) _Py_ClearFileSystemEncoding(void); + +PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void); + +PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc); + +extern int _PyUnicode_Init(void); +extern int _PyStructSequence_Init(void); +extern int _PyLong_Init(void); +extern _PyInitError _PyFaulthandler_Init(int enable); +extern int _PyTraceMalloc_Init(int enable); + +extern void _Py_ReadyTypes(void); + +PyAPI_FUNC(void) _PyExc_Fini(void); +PyAPI_FUNC(void) _PyImport_Fini(void); +PyAPI_FUNC(void) _PyImport_Fini2(void); +PyAPI_FUNC(void) _PyGC_Fini(void); +PyAPI_FUNC(void) _PyType_Fini(void); +PyAPI_FUNC(void) _Py_HashRandomization_Fini(void); +extern void _PyUnicode_Fini(void); +extern void PyLong_Fini(void); +extern void _PyFaulthandler_Fini(void); +extern void _PyHash_Fini(void); +extern int _PyTraceMalloc_Fini(void); + +extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *); +extern void _PyGILState_Fini(void); + +PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_LIFECYCLE_H */ diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h new file mode 100644 index 000000000000..395df498a0dc --- /dev/null +++ b/Include/internal/pycore_pathconfig.h @@ -0,0 +1,68 @@ +#ifndef Py_INTERNAL_PATHCONFIG_H +#define Py_INTERNAL_PATHCONFIG_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(void) _Py_wstrlist_clear( + int len, + wchar_t **list); +PyAPI_FUNC(wchar_t**) _Py_wstrlist_copy( + int len, + wchar_t **list); +PyAPI_FUNC(_PyInitError) _Py_wstrlist_append( + int *len, + wchar_t ***list, + const wchar_t *str); +PyAPI_FUNC(PyObject*) _Py_wstrlist_as_pylist( + int len, + wchar_t **list); + +typedef struct _PyPathConfig { + /* Full path to the Python program */ + wchar_t *program_full_path; + wchar_t *prefix; +#ifdef MS_WINDOWS + wchar_t *dll_path; +#else + wchar_t *exec_prefix; +#endif + /* Set by Py_SetPath(), or computed by _PyPathConfig_Init() */ + wchar_t *module_search_path; + /* Python program name */ + wchar_t *program_name; + /* Set by Py_SetPythonHome() or PYTHONHOME environment variable */ + wchar_t *home; + /* isolated and site_import are used to set Py_IsolatedFlag and + Py_NoSiteFlag flags on Windows in read_pth_file(). These fields + are ignored when their value are equal to -1 (unset). */ + int isolated; + int site_import; +} _PyPathConfig; + +#define _PyPathConfig_INIT \ + {.module_search_path = NULL, \ + .isolated = -1, \ + .site_import = -1} +/* Note: _PyPathConfig_INIT sets other fields to 0/NULL */ + +PyAPI_DATA(_PyPathConfig) _Py_path_config; + +PyAPI_FUNC(void) _PyPathConfig_ClearGlobal(void); +PyAPI_FUNC(_PyInitError) _PyPathConfig_SetGlobal( + const struct _PyPathConfig *config); + +PyAPI_FUNC(_PyInitError) _PyPathConfig_Calculate_impl( + _PyPathConfig *config, + const _PyCoreConfig *core_config); +PyAPI_FUNC(PyObject*) _PyPathConfig_ComputeArgv0(int argc, wchar_t **argv); +PyAPI_FUNC(int) _Py_FindEnvConfigValue( + FILE *env_file, + const wchar_t *key, + wchar_t *value, + size_t value_size); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PATHCONFIG_H */ diff --git a/Include/internal/pycore_state.h b/Include/internal/pycore_state.h index 9a084f7f4d84..6285ecf5f5dc 100644 --- a/Include/internal/pycore_state.h +++ b/Include/internal/pycore_state.h @@ -11,8 +11,9 @@ extern "C" { #include "pystate.h" #include "pythread.h" -#include "pycore_mem.h" #include "pycore_ceval.h" +#include "pycore_mem.h" +#include "pycore_pathconfig.h" #include "pycore_warnings.h" @@ -40,52 +41,6 @@ struct _gilstate_runtime_state { #define _PyGILState_check_enabled _PyRuntime.gilstate.check_enabled -typedef struct _PyPathConfig { - /* Full path to the Python program */ - wchar_t *program_full_path; - wchar_t *prefix; -#ifdef MS_WINDOWS - wchar_t *dll_path; -#else - wchar_t *exec_prefix; -#endif - /* Set by Py_SetPath(), or computed by _PyPathConfig_Init() */ - wchar_t *module_search_path; - /* Python program name */ - wchar_t *program_name; - /* Set by Py_SetPythonHome() or PYTHONHOME environment variable */ - wchar_t *home; - /* isolated and site_import are used to set Py_IsolatedFlag and - Py_NoSiteFlag flags on Windows in read_pth_file(). These fields - are ignored when their value are equal to -1 (unset). */ - int isolated; - int site_import; -} _PyPathConfig; - -#define _PyPathConfig_INIT \ - {.module_search_path = NULL, \ - .isolated = -1, \ - .site_import = -1} -/* Note: _PyPathConfig_INIT sets other fields to 0/NULL */ - -PyAPI_DATA(_PyPathConfig) _Py_path_config; - -PyAPI_FUNC(_PyInitError) _PyPathConfig_Calculate_impl( - _PyPathConfig *config, - const _PyCoreConfig *core_config); -PyAPI_FUNC(void) _PyPathConfig_ClearGlobal(void); - -PyAPI_FUNC(void) _Py_wstrlist_clear( - int len, - wchar_t **list); -PyAPI_FUNC(wchar_t**) _Py_wstrlist_copy( - int len, - wchar_t **list); -PyAPI_FUNC(_PyInitError) _Py_wstrlist_append( - int *len, - wchar_t ***list, - const wchar_t *str); - /* interpreter state */ PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpID(PY_INT64_T); diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 04e672e96e17..ca1f24f2a174 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -20,9 +20,6 @@ PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, const char *errors); #endif -#ifdef Py_BUILD_CORE -PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void); -#endif #ifndef Py_LIMITED_API @@ -82,27 +79,12 @@ PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); /* Bootstrap __main__ (defined in Modules/main.c) */ PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _Py_UnixMain(int argc, char **argv); -#endif /* In getpath.c */ PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetPath(void); -#ifdef Py_BUILD_CORE -struct _PyPathConfig; - -PyAPI_FUNC(_PyInitError) _PyPathConfig_SetGlobal( - const struct _PyPathConfig *config); -PyAPI_FUNC(PyObject*) _PyPathConfig_ComputeArgv0(int argc, wchar_t **argv); -PyAPI_FUNC(int) _Py_FindEnvConfigValue( - FILE *env_file, - const wchar_t *key, - wchar_t *value, - size_t value_size); -#endif PyAPI_FUNC(void) Py_SetPath(const wchar_t *); #ifdef MS_WINDOWS int _Py_CheckPython3(void); @@ -134,16 +116,6 @@ PyAPI_FUNC(_PyInitError) _Py_HashRandomization_Init(const _PyCoreConfig *); /* Various internal finalizers */ -#ifdef Py_BUILD_CORE -PyAPI_FUNC(void) _PyExc_Fini(void); -PyAPI_FUNC(void) _PyImport_Fini(void); -PyAPI_FUNC(void) _PyImport_Fini2(void); -PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void); -PyAPI_FUNC(void) _PyGC_Fini(void); -PyAPI_FUNC(void) _PyType_Fini(void); -PyAPI_FUNC(void) _Py_HashRandomization_Fini(void); -#endif /* Py_BUILD_CORE */ - #ifndef Py_LIMITED_API PyAPI_FUNC(void) PyMethod_Fini(void); PyAPI_FUNC(void) PyFrame_Fini(void); @@ -179,9 +151,6 @@ PyAPI_FUNC(void) _Py_CoerceLegacyLocale(int warn); PyAPI_FUNC(int) _Py_LegacyLocaleDetected(void); PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); #endif -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc); -#endif #ifdef __cplusplus } diff --git a/Makefile.pre.in b/Makefile.pre.in index fc8b1e4e7334..15f3687be5b1 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1030,7 +1030,9 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_context.h \ $(srcdir)/Include/internal/pycore_getopt.h \ $(srcdir)/Include/internal/pycore_gil.h \ + $(srcdir)/Include/internal/pycore_lifecycle.h \ $(srcdir)/Include/internal/pycore_mem.h \ + $(srcdir)/Include/internal/pycore_pathconfig.h \ $(srcdir)/Include/internal/pycore_state.h \ $(srcdir)/Include/internal/pycore_warnings.h \ $(DTRACE_HEADERS) diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 018af4a13707..e2deb2603da8 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -8,10 +8,12 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include -#include "structmember.h" #include "datetime.h" #include "marshal.h" +#include "pycore_pathconfig.h" +#include "pythread.h" +#include "structmember.h" +#include #include #ifdef MS_WINDOWS @@ -22,7 +24,6 @@ #include /* For W_STOPCODE */ #endif -#include "pythread.h" static PyObject *TestError; /* set to exception object in init */ /* Raise TestError with test_name + ": " + msg, and return NULL. */ diff --git a/Modules/getpath.c b/Modules/getpath.c index 53e5c2b889a6..0e210710ecf4 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -1,8 +1,9 @@ /* Return the initial module search path. */ #include "Python.h" -#include "pycore_state.h" #include "osdefs.h" +#include "pycore_pathconfig.h" +#include "pycore_state.h" #include #include diff --git a/Modules/main.c b/Modules/main.c index 1918f4f9b8ff..c847d1acedb7 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -2,8 +2,10 @@ #include "Python.h" #include "osdefs.h" -#include "pycore_mem.h" #include "pycore_getopt.h" +#include "pycore_lifecycle.h" +#include "pycore_mem.h" +#include "pycore_pathconfig.h" #include "pycore_state.h" #include diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 6becb8a3682c..460500cc2b1b 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -119,7 +119,9 @@ + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index bc118c636cde..64fb77b867c4 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -156,9 +156,15 @@ Include + + Include + Include + + Include + Include diff --git a/Programs/python.c b/Programs/python.c index 78e48f800c95..079bf9a2f039 100644 --- a/Programs/python.c +++ b/Programs/python.c @@ -1,6 +1,7 @@ /* Minimal main program -- everything is loaded from the library */ #include "Python.h" +#include "pycore_lifecycle.h" #ifdef MS_WINDOWS int diff --git a/Python/coreconfig.c b/Python/coreconfig.c index ad14a8a457da..b21e9344cd16 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1,5 +1,7 @@ #include "Python.h" +#include "pycore_lifecycle.h" #include "pycore_mem.h" +#include "pycore_pathconfig.h" #include "pycore_state.h" #include #ifdef HAVE_LANGINFO_H diff --git a/Python/import.c b/Python/import.c index 18cd29df7e93..67911ff0e41b 100644 --- a/Python/import.c +++ b/Python/import.c @@ -5,6 +5,7 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with winbase.h */ #include "pycore_hash.h" +#include "pycore_lifecycle.h" #include "pycore_mem.h" #include "pycore_state.h" #include "errcode.h" diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 04064159f86b..f8bcc2886a1c 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -3,6 +3,7 @@ #include "Python.h" #include "osdefs.h" #include "pycore_mem.h" +#include "pycore_pathconfig.h" #include "pycore_state.h" #include diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 160f30ce6d6e..4c5cb5342917 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -6,7 +6,9 @@ #undef Yield /* undefine macro conflicting with winbase.h */ #include "pycore_context.h" #include "pycore_hamt.h" +#include "pycore_lifecycle.h" #include "pycore_mem.h" +#include "pycore_pathconfig.h" #include "pycore_state.h" #include "grammar.h" #include "node.h" @@ -62,20 +64,6 @@ static _PyInitError initsigs(void); static void call_py_exitfuncs(PyInterpreterState *); static void wait_for_thread_shutdown(void); static void call_ll_exitfuncs(void); -extern int _PyUnicode_Init(void); -extern int _PyStructSequence_Init(void); -extern void _PyUnicode_Fini(void); -extern int _PyLong_Init(void); -extern void PyLong_Fini(void); -extern _PyInitError _PyFaulthandler_Init(int enable); -extern void _PyFaulthandler_Fini(void); -extern void _PyHash_Fini(void); -extern int _PyTraceMalloc_Init(int enable); -extern int _PyTraceMalloc_Fini(void); -extern void _Py_ReadyTypes(void); - -extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *); -extern void _PyGILState_Fini(void); _PyRuntimeState _PyRuntime = _PyRuntimeState_INIT; diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 830f0a88e4fb..21647083d683 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -15,10 +15,12 @@ Data members: */ #include "Python.h" -#include "pycore_mem.h" -#include "pycore_state.h" #include "code.h" #include "frameobject.h" +#include "pycore_lifecycle.h" +#include "pycore_mem.h" +#include "pycore_pathconfig.h" +#include "pycore_state.h" #include "pythread.h" #include "osdefs.h"