From webhook-mailer at python.org Mon Mar 1 00:27:40 2021 From: webhook-mailer at python.org (ned-deily) Date: Mon, 01 Mar 2021 05:27:40 -0000 Subject: [Python-checkins] bpo-42603: Add whatsnew and ACKS entries. (GH-24675) Message-ID: https://github.com/python/cpython/commit/a65b050516a4ec8f5fc591119b94ceaaa5f7afe3 commit: a65b050516a4ec8f5fc591119b94ceaaa5f7afe3 branch: master author: Ned Deily committer: ned-deily date: 2021-03-01T00:27:20-05:00 summary: bpo-42603: Add whatsnew and ACKS entries. (GH-24675) files: M Doc/whatsnew/3.10.rst M Misc/ACKS diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 26b7076420c87..49681cab4e523 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1123,6 +1123,12 @@ Build Changes (Contributed by Victor Stinner in :issue:`43103`.) +* The ``configure`` script now uses the ``pkg-config`` utility, if available, + to detect the location of Tcl/Tk headers and libraries. As before, those + locations can be explicitly specified with the ``--with-tcltk-includes`` + and ``--with-tcltk-libs`` configuration options. + (Contributed by Manolis Stamatogiannakis in :issue:`42603`.) + C API Changes ============= diff --git a/Misc/ACKS b/Misc/ACKS index ca222e4371f5e..d1cee7d02b786 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1660,6 +1660,7 @@ RajGopal Srinivasan Tage Stabell-Kulo Quentin Stafford-Fraser Frank Stajano +Manolis Stamatogiannakis Joel Stanley Kyle Stanley Brandon Stansbury From webhook-mailer at python.org Mon Mar 1 02:04:13 2021 From: webhook-mailer at python.org (ned-deily) Date: Mon, 01 Mar 2021 07:04:13 -0000 Subject: [Python-checkins] bpo-43103: Fix build failure with macOS framework builds. (GH-24676) Message-ID: https://github.com/python/cpython/commit/0608425944932f46b544afea04ae6d301a76f5f2 commit: 0608425944932f46b544afea04ae6d301a76f5f2 branch: master author: Ned Deily committer: ned-deily date: 2021-03-01T02:04:02-05:00 summary: bpo-43103: Fix build failure with macOS framework builds. (GH-24676) files: M configure M configure.ac diff --git a/configure b/configure index 2d5a61e71eb79..acb400f508983 100755 --- a/configure +++ b/configure @@ -17810,7 +17810,7 @@ $as_echo "yes" >&6; } fi LIBRARY_DEPS='$(PY3LIBRARY) $(EXPORTSYMS)' -if test "$PY_ENABLE_SHARED" = 1; then +if test "$PY_ENABLE_SHARED" = 1 || test "$enable_framework" ; then LIBRARY_DEPS="\$(LDLIBRARY) $LIBRARY_DEPS" if test "$STATIC_LIBPYTHON" = 1; then LIBRARY_DEPS="\$(LIBRARY) $LIBRARY_DEPS" diff --git a/configure.ac b/configure.ac index e71d74c872b70..9802c65ce179c 100644 --- a/configure.ac +++ b/configure.ac @@ -5903,7 +5903,7 @@ else fi], [AC_MSG_RESULT(yes)]) LIBRARY_DEPS='$(PY3LIBRARY) $(EXPORTSYMS)' -if test "$PY_ENABLE_SHARED" = 1; then +if test "$PY_ENABLE_SHARED" = 1 || test "$enable_framework" ; then LIBRARY_DEPS="\$(LDLIBRARY) $LIBRARY_DEPS" if test "$STATIC_LIBPYTHON" = 1; then LIBRARY_DEPS="\$(LIBRARY) $LIBRARY_DEPS" From webhook-mailer at python.org Mon Mar 1 02:39:21 2021 From: webhook-mailer at python.org (ned-deily) Date: Mon, 01 Mar 2021 07:39:21 -0000 Subject: [Python-checkins] bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677) Message-ID: https://github.com/python/cpython/commit/0242494a156970186cbc4121ccf03aefbddea716 commit: 0242494a156970186cbc4121ccf03aefbddea716 branch: master author: Ned Deily committer: ned-deily date: 2021-03-01T02:39:08-05:00 summary: bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677) files: A Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index ef64502ab780c..864661ec9e1b6 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -242,9 +242,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1i", - url="https://www.openssl.org/source/openssl-1.1.1i.tar.gz", - checksum='08987c3cf125202e2b0840035efb392c', + name="OpenSSL 1.1.1j", + url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", + checksum='cccaa064ed860a2b4d1303811bf5c682', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst new file mode 100644 index 0000000000000..5d32d87a5a97d --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst @@ -0,0 +1 @@ +Update macOS installer build to use OpenSSL 1.1.1j. From webhook-mailer at python.org Mon Mar 1 03:00:17 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 08:00:17 -0000 Subject: [Python-checkins] bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677) Message-ID: https://github.com/python/cpython/commit/e2f6ed89aeaa0b723f45f914dba92e1b42518395 commit: e2f6ed89aeaa0b723f45f914dba92e1b42518395 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T00:00:08-08:00 summary: bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677) (cherry picked from commit 0242494a156970186cbc4121ccf03aefbddea716) Co-authored-by: Ned Deily files: A Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index d25c86bf7b453..f2717b614a74a 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -209,9 +209,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1i", - url="https://www.openssl.org/source/openssl-1.1.1i.tar.gz", - checksum='08987c3cf125202e2b0840035efb392c', + name="OpenSSL 1.1.1j", + url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", + checksum='cccaa064ed860a2b4d1303811bf5c682', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst new file mode 100644 index 0000000000000..5d32d87a5a97d --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst @@ -0,0 +1 @@ +Update macOS installer build to use OpenSSL 1.1.1j. From webhook-mailer at python.org Mon Mar 1 03:01:51 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 08:01:51 -0000 Subject: [Python-checkins] bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677) Message-ID: https://github.com/python/cpython/commit/982e8ecbdf216bc1fa285a4ff45c84c6778856e5 commit: 982e8ecbdf216bc1fa285a4ff45c84c6778856e5 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T00:01:43-08:00 summary: bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677) (cherry picked from commit 0242494a156970186cbc4121ccf03aefbddea716) Co-authored-by: Ned Deily files: A Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index ef64502ab780c..864661ec9e1b6 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -242,9 +242,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1i", - url="https://www.openssl.org/source/openssl-1.1.1i.tar.gz", - checksum='08987c3cf125202e2b0840035efb392c', + name="OpenSSL 1.1.1j", + url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", + checksum='cccaa064ed860a2b4d1303811bf5c682', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst new file mode 100644 index 0000000000000..5d32d87a5a97d --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst @@ -0,0 +1 @@ +Update macOS installer build to use OpenSSL 1.1.1j. From webhook-mailer at python.org Mon Mar 1 06:18:44 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 01 Mar 2021 11:18:44 -0000 Subject: [Python-checkins] bpo-11717: fix ssize_t redefinition error when targeting 32bit Windows app (GH-24479) Message-ID: https://github.com/python/cpython/commit/c994ffe69553cbb34f1cea6a4494d6e7657f41b0 commit: c994ffe69553cbb34f1cea6a4494d6e7657f41b0 branch: master author: Jozef Grajciar committer: pablogsal date: 2021-03-01T11:18:33Z summary: bpo-11717: fix ssize_t redefinition error when targeting 32bit Windows app (GH-24479) files: M Include/pyport.h M Objects/structseq.c M PC/pyconfig.h M Parser/parser.c M Tools/peg_generator/pegen/c_generator.py diff --git a/Include/pyport.h b/Include/pyport.h index 46bbef22d7396..0993b545dc236 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -101,7 +101,9 @@ typedef intptr_t Py_intptr_t; * sizeof(size_t). C99 doesn't define such a thing directly (size_t is an * unsigned integral type). See PEP 353 for details. */ -#ifdef HAVE_SSIZE_T +#ifdef HAVE_PY_SSIZE_T + +#elif HAVE_SSIZE_T typedef ssize_t Py_ssize_t; #elif SIZEOF_VOID_P == SIZEOF_SIZE_T typedef Py_intptr_t Py_ssize_t; diff --git a/Objects/structseq.c b/Objects/structseq.c index 5d71fcff3461a..4222afa599c80 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -24,7 +24,7 @@ _Py_IDENTIFIER(n_sequence_fields); _Py_IDENTIFIER(n_fields); _Py_IDENTIFIER(n_unnamed_fields); -static ssize_t +static Py_ssize_t get_type_attr_as_size(PyTypeObject *tp, _Py_Identifier *id) { PyObject *name = _PyUnicode_FromId(id); diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 592b487adcb45..00a65b223da17 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -165,11 +165,11 @@ WIN32 is still required for the locale module. /* Define like size_t, omitting the "unsigned" */ #ifdef MS_WIN64 -typedef __int64 ssize_t; +typedef __int64 Py_ssize_t; #else -typedef _W64 int ssize_t; +typedef _W64 int Py_ssize_t; #endif -#define HAVE_SSIZE_T 1 +#define HAVE_PY_SSIZE_T 1 #if defined(MS_WIN32) && !defined(MS_WIN64) #if defined(_M_IX86) diff --git a/Parser/parser.c b/Parser/parser.c index 4ab0401a46aeb..9432746921a2e 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -18550,8 +18550,8 @@ _loop0_1_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // NEWLINE if (p->error_indicator) { D(p->level--); @@ -18616,8 +18616,8 @@ _loop0_2_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // NEWLINE if (p->error_indicator) { D(p->level--); @@ -18682,8 +18682,8 @@ _loop0_4_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' expression if (p->error_indicator) { D(p->level--); @@ -18796,8 +18796,8 @@ _loop0_6_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' expression if (p->error_indicator) { D(p->level--); @@ -18910,8 +18910,8 @@ _loop0_8_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' expression if (p->error_indicator) { D(p->level--); @@ -19024,8 +19024,8 @@ _loop0_10_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' expression if (p->error_indicator) { D(p->level--); @@ -19138,8 +19138,8 @@ _loop1_11_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // statement if (p->error_indicator) { D(p->level--); @@ -19209,8 +19209,8 @@ _loop0_13_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ';' simple_stmt if (p->error_indicator) { D(p->level--); @@ -19771,8 +19771,8 @@ _loop1_22_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (star_targets '=') if (p->error_indicator) { D(p->level--); @@ -19952,8 +19952,8 @@ _loop0_26_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' NAME if (p->error_indicator) { D(p->level--); @@ -20066,8 +20066,8 @@ _loop0_28_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' NAME if (p->error_indicator) { D(p->level--); @@ -20279,8 +20279,8 @@ _loop0_31_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('.' | '...') if (p->error_indicator) { D(p->level--); @@ -20345,8 +20345,8 @@ _loop1_32_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('.' | '...') if (p->error_indicator) { D(p->level--); @@ -20416,8 +20416,8 @@ _loop0_34_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' import_from_as_name if (p->error_indicator) { D(p->level--); @@ -20574,8 +20574,8 @@ _loop0_37_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' dotted_as_name if (p->error_indicator) { D(p->level--); @@ -20732,8 +20732,8 @@ _loop0_40_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { D(p->level--); @@ -20846,8 +20846,8 @@ _loop0_42_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { D(p->level--); @@ -20960,8 +20960,8 @@ _loop0_44_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { D(p->level--); @@ -21074,8 +21074,8 @@ _loop0_46_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { D(p->level--); @@ -21262,8 +21262,8 @@ _loop1_48_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // except_block if (p->error_indicator) { D(p->level--); @@ -21377,8 +21377,8 @@ _loop1_50_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // case_block if (p->error_indicator) { D(p->level--); @@ -21448,8 +21448,8 @@ _loop0_52_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // '|' closed_pattern if (p->error_indicator) { D(p->level--); @@ -21765,8 +21765,8 @@ _loop0_57_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' maybe_star_pattern if (p->error_indicator) { D(p->level--); @@ -21934,8 +21934,8 @@ _loop0_60_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' key_value_pattern if (p->error_indicator) { D(p->level--); @@ -22103,8 +22103,8 @@ _loop0_63_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' pattern if (p->error_indicator) { D(p->level--); @@ -22217,8 +22217,8 @@ _loop0_65_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' keyword_pattern if (p->error_indicator) { D(p->level--); @@ -22502,8 +22502,8 @@ _loop0_70_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -22568,8 +22568,8 @@ _loop0_71_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -22634,8 +22634,8 @@ _loop0_72_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -22700,8 +22700,8 @@ _loop1_73_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -22771,8 +22771,8 @@ _loop0_74_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -22837,8 +22837,8 @@ _loop1_75_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -22908,8 +22908,8 @@ _loop1_76_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -22979,8 +22979,8 @@ _loop1_77_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -23050,8 +23050,8 @@ _loop0_78_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -23116,8 +23116,8 @@ _loop1_79_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -23187,8 +23187,8 @@ _loop0_80_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -23253,8 +23253,8 @@ _loop1_81_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -23324,8 +23324,8 @@ _loop0_82_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_maybe_default if (p->error_indicator) { D(p->level--); @@ -23390,8 +23390,8 @@ _loop1_83_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_maybe_default if (p->error_indicator) { D(p->level--); @@ -23461,8 +23461,8 @@ _loop1_84_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('@' named_expression NEWLINE) if (p->error_indicator) { D(p->level--); @@ -23579,8 +23579,8 @@ _loop1_86_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (',' star_expression) if (p->error_indicator) { D(p->level--); @@ -23650,8 +23650,8 @@ _loop0_88_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' star_named_expression if (p->error_indicator) { D(p->level--); @@ -23764,8 +23764,8 @@ _loop1_89_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (',' expression) if (p->error_indicator) { D(p->level--); @@ -23835,8 +23835,8 @@ _loop0_90_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -23901,8 +23901,8 @@ _loop0_91_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -23967,8 +23967,8 @@ _loop0_92_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -24033,8 +24033,8 @@ _loop1_93_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -24104,8 +24104,8 @@ _loop0_94_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -24170,8 +24170,8 @@ _loop1_95_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -24241,8 +24241,8 @@ _loop1_96_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -24312,8 +24312,8 @@ _loop1_97_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -24383,8 +24383,8 @@ _loop0_98_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -24449,8 +24449,8 @@ _loop1_99_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -24520,8 +24520,8 @@ _loop0_100_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -24586,8 +24586,8 @@ _loop1_101_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -24657,8 +24657,8 @@ _loop0_102_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_maybe_default if (p->error_indicator) { D(p->level--); @@ -24723,8 +24723,8 @@ _loop1_103_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_maybe_default if (p->error_indicator) { D(p->level--); @@ -24794,8 +24794,8 @@ _loop1_104_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('or' conjunction) if (p->error_indicator) { D(p->level--); @@ -24865,8 +24865,8 @@ _loop1_105_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('and' inversion) if (p->error_indicator) { D(p->level--); @@ -24936,8 +24936,8 @@ _loop1_106_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // compare_op_bitwise_or_pair if (p->error_indicator) { D(p->level--); @@ -25048,8 +25048,8 @@ _loop0_109_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' slice if (p->error_indicator) { D(p->level--); @@ -25428,8 +25428,8 @@ _loop1_114_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // STRING if (p->error_indicator) { D(p->level--); @@ -25601,8 +25601,8 @@ _loop0_118_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' double_starred_kvpair if (p->error_indicator) { D(p->level--); @@ -25715,8 +25715,8 @@ _loop1_119_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // for_if_clause if (p->error_indicator) { D(p->level--); @@ -25786,8 +25786,8 @@ _loop0_120_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('if' disjunction) if (p->error_indicator) { D(p->level--); @@ -25852,8 +25852,8 @@ _loop0_121_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ('if' disjunction) if (p->error_indicator) { D(p->level--); @@ -25918,8 +25918,8 @@ _loop0_123_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' (starred_expression | named_expression !'=') if (p->error_indicator) { D(p->level--); @@ -26076,8 +26076,8 @@ _loop0_126_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' kwarg_or_starred if (p->error_indicator) { D(p->level--); @@ -26190,8 +26190,8 @@ _loop0_128_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' kwarg_or_double_starred if (p->error_indicator) { D(p->level--); @@ -26304,8 +26304,8 @@ _loop0_130_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' kwarg_or_starred if (p->error_indicator) { D(p->level--); @@ -26418,8 +26418,8 @@ _loop0_132_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' kwarg_or_double_starred if (p->error_indicator) { D(p->level--); @@ -26532,8 +26532,8 @@ _loop0_133_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (',' star_target) if (p->error_indicator) { D(p->level--); @@ -26598,8 +26598,8 @@ _loop0_135_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' star_target if (p->error_indicator) { D(p->level--); @@ -26712,8 +26712,8 @@ _loop1_136_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (',' star_target) if (p->error_indicator) { D(p->level--); @@ -26821,8 +26821,8 @@ _loop0_139_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' del_target if (p->error_indicator) { D(p->level--); @@ -26935,8 +26935,8 @@ _loop0_141_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' target if (p->error_indicator) { D(p->level--); @@ -27107,8 +27107,8 @@ _loop0_143_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // star_named_expressions if (p->error_indicator) { D(p->level--); @@ -27173,8 +27173,8 @@ _loop0_144_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (star_targets '=') if (p->error_indicator) { D(p->level--); @@ -27239,8 +27239,8 @@ _loop0_145_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // (star_targets '=') if (p->error_indicator) { D(p->level--); @@ -27489,8 +27489,8 @@ _loop0_149_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_no_default if (p->error_indicator) { D(p->level--); @@ -27555,8 +27555,8 @@ _loop1_150_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // param_with_default if (p->error_indicator) { D(p->level--); @@ -27626,8 +27626,8 @@ _loop0_151_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { D(p->level--); @@ -27692,8 +27692,8 @@ _loop1_152_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { D(p->level--); @@ -27953,8 +27953,8 @@ _loop0_157_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' (expression ['as' star_target]) if (p->error_indicator) { D(p->level--); @@ -28067,8 +28067,8 @@ _loop0_159_rule(Parser *p) D(p->level--); return NULL; } - ssize_t _children_capacity = 1; - ssize_t _n = 0; + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; { // ',' (expressions ['as' star_target]) if (p->error_indicator) { D(p->level--); diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index f5ef5d8d3340e..929ec4f547e17 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -583,8 +583,8 @@ def _handle_loop_rule_body(self, node: Rule, rhs: Rhs) -> None: self.print("int _start_mark = p->mark;") self.print("void **_children = PyMem_Malloc(sizeof(void *));") self.out_of_memory_return(f"!_children") - self.print("ssize_t _children_capacity = 1;") - self.print("ssize_t _n = 0;") + self.print("Py_ssize_t _children_capacity = 1;") + self.print("Py_ssize_t _n = 0;") if any(alt.action and "EXTRA" in alt.action for alt in rhs.alts): self._set_up_token_start_metadata_extraction() self.visit( From webhook-mailer at python.org Mon Mar 1 09:45:08 2021 From: webhook-mailer at python.org (benjaminp) Date: Mon, 01 Mar 2021 14:45:08 -0000 Subject: [Python-checkins] closes bpo-43349: Fix tuning(7) manpage hyperlink. (GH-24680) Message-ID: https://github.com/python/cpython/commit/f4d7d46cb48aa3a1bf3c2c7e2d7d71cbf49dea69 commit: f4d7d46cb48aa3a1bf3c2c7e2d7d71cbf49dea69 branch: master author: Erlend Egeberg Aasland committer: benjaminp date: 2021-03-01T08:44:46-06:00 summary: closes bpo-43349: Fix tuning(7) manpage hyperlink. (GH-24680) files: M Doc/library/resource.rst diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst index 00ff3b5dd3b6a..67e9b44fe48c4 100644 --- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -241,7 +241,9 @@ platform. The maximum size (in bytes) of the swap space that may be reserved or used by all of this user id's processes. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. - Please see :manpage:`tuning(7)` for a complete description of this sysctl. + Please see + `tuning(7) `__ + for a complete description of this sysctl. .. availability:: FreeBSD 9 or later. From webhook-mailer at python.org Mon Mar 1 09:54:40 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 14:54:40 -0000 Subject: [Python-checkins] closes bpo-43349: Fix tuning(7) manpage hyperlink. (GH-24680) Message-ID: https://github.com/python/cpython/commit/643939a07e480ed88a6eca9793157f1c695a418e commit: 643939a07e480ed88a6eca9793157f1c695a418e branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T06:54:30-08:00 summary: closes bpo-43349: Fix tuning(7) manpage hyperlink. (GH-24680) (cherry picked from commit f4d7d46cb48aa3a1bf3c2c7e2d7d71cbf49dea69) Co-authored-by: Erlend Egeberg Aasland files: M Doc/library/resource.rst diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst index e4eac43642d14..c8c1348b9ba77 100644 --- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -241,7 +241,9 @@ platform. The maximum size (in bytes) of the swap space that may be reserved or used by all of this user id's processes. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. - Please see :manpage:`tuning(7)` for a complete description of this sysctl. + Please see + `tuning(7) `__ + for a complete description of this sysctl. .. availability:: FreeBSD 9 or later. From webhook-mailer at python.org Mon Mar 1 10:07:40 2021 From: webhook-mailer at python.org (vsajip) Date: Mon, 01 Mar 2021 15:07:40 -0000 Subject: [Python-checkins] [3.8] [doc] Document VIRTUAL_ENV environment variable (GH-21970) (GH-24363) Message-ID: https://github.com/python/cpython/commit/6900a515c8410795f9a8ef2ad38740847a919b6d commit: 6900a515c8410795f9a8ef2ad38740847a919b6d branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vsajip date: 2021-03-01T15:07:31Z summary: [3.8] [doc] Document VIRTUAL_ENV environment variable (GH-21970) (GH-24363) (cherry picked from commit 3584d4b64a5373440f78237eac734831cfd83f79) files: M Doc/using/venv-create.inc diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index c81aaf15d885a..b4089e61fa7b3 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -121,6 +121,10 @@ directory containing the virtual environment): | | PowerShell | PS C:\\> \\Scripts\\Activate.ps1 | +-------------+-----------------+-----------------------------------------+ +When a virtual environment is active, the :envvar:`VIRTUAL_ENV` environment +variable is set to the path of the virtual environment. This can be used to +check if one is running inside a virtual environment. + You don't specifically *need* to activate an environment; activation just prepends the virtual environment's binary directory to your path, so that "python" invokes the virtual environment's Python interpreter and you can run From webhook-mailer at python.org Mon Mar 1 11:11:32 2021 From: webhook-mailer at python.org (willingc) Date: Mon, 01 Mar 2021 16:11:32 -0000 Subject: [Python-checkins] Fix typo in Mac/README.rst (#24682) Message-ID: https://github.com/python/cpython/commit/8c9453b5759f7ab86a01fab13b03cef5900eb328 commit: 8c9453b5759f7ab86a01fab13b03cef5900eb328 branch: master author: Ikko Ashimine committer: willingc date: 2021-03-01T08:11:23-08:00 summary: Fix typo in Mac/README.rst (#24682) targetting -> targeting files: M Mac/README.rst diff --git a/Mac/README.rst b/Mac/README.rst index f3638aa0019aa..29093e9ec193a 100644 --- a/Mac/README.rst +++ b/Mac/README.rst @@ -359,7 +359,7 @@ them symbolic links to files in ``/Library/Frameworks/Python.framework/Versions/ Weak linking support ==================== -The CPython sources support building with the latest SDK while targetting deployment +The CPython sources support building with the latest SDK while targeting deployment to macOS 10.9. This is done through weak linking of symbols introduced in macOS 10.10 or later and checking for their availability at runtime. From webhook-mailer at python.org Mon Mar 1 13:56:12 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 18:56:12 -0000 Subject: [Python-checkins] Fix grammar in enum documentation. (GH-24689) Message-ID: https://github.com/python/cpython/commit/f193874056fb185305084b79b32d2745ce9be7cf commit: f193874056fb185305084b79b32d2745ce9be7cf branch: master author: Mariatta Wijaya committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T10:56:03-08:00 summary: Fix grammar in enum documentation. (GH-24689) There is an extra `s` in the singular word `method`. Reported in docs mailing list by Steven Nguyen. Automerge-Triggered-By: GH:Mariatta files: M Doc/library/enum.rst diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 4d6f2c3633613..b7f269464e794 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -282,7 +282,7 @@ overridden:: .. note:: - The goal of the default :meth:`_generate_next_value_` methods is to provide + The goal of the default :meth:`_generate_next_value_` method is to provide the next :class:`int` in sequence with the last :class:`int` provided, but the way it does this is an implementation detail and may change. From webhook-mailer at python.org Mon Mar 1 14:21:25 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 19:21:25 -0000 Subject: [Python-checkins] Fix grammar in enum documentation. (GH-24689) Message-ID: https://github.com/python/cpython/commit/4f9eb3f3d3fab06ecf542c29e118c5086b7ec517 commit: 4f9eb3f3d3fab06ecf542c29e118c5086b7ec517 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T11:21:05-08:00 summary: Fix grammar in enum documentation. (GH-24689) There is an extra `s` in the singular word `method`. Reported in docs mailing list by Steven Nguyen. Automerge-Triggered-By: GH:Mariatta (cherry picked from commit f193874056fb185305084b79b32d2745ce9be7cf) Co-authored-by: Mariatta Wijaya files: M Doc/library/enum.rst diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 8836b24912e9e..bbe8bdc82b409 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -276,7 +276,7 @@ overridden:: .. note:: - The goal of the default :meth:`_generate_next_value_` methods is to provide + The goal of the default :meth:`_generate_next_value_` method is to provide the next :class:`int` in sequence with the last :class:`int` provided, but the way it does this is an implementation detail and may change. From webhook-mailer at python.org Mon Mar 1 14:43:34 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 01 Mar 2021 19:43:34 -0000 Subject: [Python-checkins] Python 3.10.0a6 Message-ID: https://github.com/python/cpython/commit/06c245fb67ceea81c99406d1d1396fce5f4b6f38 commit: 06c245fb67ceea81c99406d1d1396fce5f4b6f38 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-01T16:45:40Z summary: Python 3.10.0a6 files: A Misc/NEWS.d/3.10.0a6.rst D Misc/NEWS.d/next/Build/2020-01-24-12-54-22.bpo-39448.k4pv14.rst D Misc/NEWS.d/next/Build/2020-12-08-19-25-20.bpo-42603.mXs2dB.rst D Misc/NEWS.d/next/Build/2021-01-10-22-25-23.bpo-13501.g4L-6R.rst D Misc/NEWS.d/next/Build/2021-02-02-16-26-44.bpo-43103.VWeyP_.rst D Misc/NEWS.d/next/Build/2021-02-10-14-11-53.bpo-43174.F9zwXQ.rst D Misc/NEWS.d/next/C API/2021-02-11-11-37-14.bpo-43181.ydv33S.rst D Misc/NEWS.d/next/C API/2021-02-15-13-41-14.bpo-40170.r2FAtl.rst D Misc/NEWS.d/next/C API/2021-02-15-15-06-43.bpo-40170.ZYeSii.rst D Misc/NEWS.d/next/C API/2021-02-16-17-30-16.bpo-43239.FQqOGz.rst D Misc/NEWS.d/next/C API/2021-02-16-22-29-39.bpo-40170.ahHmOo.rst D Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst D Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst D Misc/NEWS.d/next/C API/2021-02-19-14-28-26.bpo-43270.UKx4XN.rst D Misc/NEWS.d/next/C API/2021-02-21-15-30-38.bpo-43278.DMPaWH.rst D Misc/NEWS.d/next/Core and Builtins/2019-09-28-12-23-23.bpo-38302.hsCNgX.rst D Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst D Misc/NEWS.d/next/Core and Builtins/2020-10-23-08-54-04.bpo-42128.SWmVEm.rst D Misc/NEWS.d/next/Core and Builtins/2020-10-23-23-17-23.bpo-41972.kbAwg4.rst D Misc/NEWS.d/next/Core and Builtins/2020-10-31-16-54-00.bpo-42217.GdcHe5.rst D Misc/NEWS.d/next/Core and Builtins/2021-01-02-05-10-58.bpo-42808.AOxgxl.rst D Misc/NEWS.d/next/Core and Builtins/2021-01-04-23-54-34.bpo-42819.4KO6wU.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-03-22-33-05.bpo-43121.jqcViq.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-07-03-27-14.bpo-43149.0umPKD.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-17-19-02-21.bpo-42990.SKXHiI.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-18-15-12-30.bpo-42990.toAqBH.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-20-16-50-22.bpo-43277.FXkRXk.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-22-19-00-00.bpo-36346.uAoni0.rst D Misc/NEWS.d/next/Core and Builtins/2021-02-26-13-17-52.bpo-43321.TCS3ph.rst D Misc/NEWS.d/next/Documentation/2020-06-15-10-45-45.bpo-36346.H0sS_i.rst D Misc/NEWS.d/next/Documentation/2021-02-20-00-09-13.bpo-27646.HRsmo-.rst D Misc/NEWS.d/next/IDLE/2021-02-21-16-30-10.bpo-43283.DLBwYn.rst D Misc/NEWS.d/next/Library/2020-05-02-01-01-30.bpo-29753.n2M-AF.rst D Misc/NEWS.d/next/Library/2020-10-26-18-01-09.bpo-42151.et5f7s.rst D Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst D Misc/NEWS.d/next/Library/2021-02-03-17-06-38.bpo-43106.SwcSuU.rst D Misc/NEWS.d/next/Library/2021-02-03-22-55-27.bpo-43102.TSlZ6J.rst D Misc/NEWS.d/next/Library/2021-02-06-21-21-35.bpo-43146.MHtb2v.rst D Misc/NEWS.d/next/Library/2021-02-08-16-27-00.bpo-43162.t-W7h3.rst D Misc/NEWS.d/next/Library/2021-02-08-21-13-51.bpo-43163.E2MgzH.rst D Misc/NEWS.d/next/Library/2021-02-10-06-00-53.bpo-43172.ZMCJni.rst D Misc/NEWS.d/next/Library/2021-02-10-23-29-50.bpo-40956.LcAbwG.rst D Misc/NEWS.d/next/Library/2021-02-18-14-24-42.bpo-43251.n6WZDw.rst D Misc/NEWS.d/next/Library/2021-02-18-23-30-52.bpo-43258.LeU-q8.rst D Misc/NEWS.d/next/Library/2021-02-20-12-15-29.bpo-43260.6znAas.rst D Misc/NEWS.d/next/Library/2021-02-23-17-20-16.bpo-43146.JAFplg.rst D Misc/NEWS.d/next/Library/2021-02-25-09-08-55.bpo-43317.qrOOpB.rst D Misc/NEWS.d/next/Library/2021-02-25-09-44-36.bpo-43316.k9Gyqn.rst D Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst D Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst D Misc/NEWS.d/next/Windows/2021-02-10-04-16-51.bpo-43155.O1tURk.rst D Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst diff --git a/Misc/NEWS.d/3.10.0a6.rst b/Misc/NEWS.d/3.10.0a6.rst new file mode 100644 index 0000000000000..46d06add9115f --- /dev/null +++ b/Misc/NEWS.d/3.10.0a6.rst @@ -0,0 +1,538 @@ +.. bpo: 42967 +.. date: 2021-02-14-15-59-16 +.. nonce: YApqDS +.. release date: 2021-03-01 +.. section: Security + +Fix web cache poisoning vulnerability by defaulting the query args separator +to ``&``, and allowing the user to choose a custom separator. + +.. + +.. bpo: 43321 +.. date: 2021-02-26-13-17-52 +.. nonce: TCS3ph +.. section: Core and Builtins + +Fix ``SystemError`` raised when ``PyArg_Parse*()`` is used with ``#`` but +without ``PY_SSIZE_T_CLEAN`` defined. + +.. + +.. bpo: 36346 +.. date: 2021-02-22-19-00-00 +.. nonce: uAoni0 +.. section: Core and Builtins + +``PyArg_Parse*()`` functions now emits ``DeprecationWarning`` when ``u`` or +``Z`` format is used. See :pep:`623` for detail. + +.. + +.. bpo: 43277 +.. date: 2021-02-20-16-50-22 +.. nonce: FXkRXk +.. section: Core and Builtins + +Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an +object is an instance of :class:`set` but not an instance of a subtype. +Patch by Pablo Galindo. + +.. + +.. bpo: 42990 +.. date: 2021-02-18-15-12-30 +.. nonce: toAqBH +.. section: Core and Builtins + +The :data:`types.FunctionType` constructor now inherits the current builtins +if the *globals* dictionary has no ``"__builtins__"`` key, rather than using +``{"None": None}`` as builtins: same behavior as :func:`eval` and +:func:`exec` functions. Defining a function with ``def function(...): ...`` +in Python is not affected, globals cannot be overriden with this syntax: it +also inherits the current builtins. Patch by Victor Stinner. + +.. + +.. bpo: 42990 +.. date: 2021-02-17-19-02-21 +.. nonce: SKXHiI +.. section: Core and Builtins + +Functions have a new ``__builtins__`` attribute which is used to look for +builtin symbols when a function is executed, instead of looking into +``__globals__['__builtins__']``. Patch by Mark Shannon and Victor Stinner. + +.. + +.. bpo: 43149 +.. date: 2021-02-07-03-27-14 +.. nonce: 0umPKD +.. section: Core and Builtins + +Improve the error message in the parser for exception groups without +parentheses. Patch by Pablo Galindo. + +.. + +.. bpo: 43121 +.. date: 2021-02-03-22-33-05 +.. nonce: jqcViq +.. section: Core and Builtins + +Fixed an incorrect :exc:`SyntaxError` message for missing comma in literals. +Patch by Pablo Galindo. + +.. + +.. bpo: 42819 +.. date: 2021-01-04-23-54-34 +.. nonce: 4KO6wU +.. section: Core and Builtins + +:mod:`readline`: Explicitly disable bracketed paste in the interactive +interpreter, even if it's set in the inputrc, is enabled by default (eg GNU +Readline 8.1), or a user calls ``readline.read_init_file()``. The Python +REPL has not implemented bracketed paste support. Also, bracketed mode +writes the ``"\x1b[?2004h"`` escape sequence into stdout which causes test +failures in applications that don't support it. It can still be explicitly +enabled by calling ``readline.parse_and_bind("set enable-bracketed-paste +on")``. Patch by Dustin Rodrigues. + +.. + +.. bpo: 42808 +.. date: 2021-01-02-05-10-58 +.. nonce: AOxgxl +.. section: Core and Builtins + +Simple calls to ``type(object)`` are now faster due to the ``vectorcall`` +calling convention. Patch by Dennis Sweeney. + +.. + +.. bpo: 42217 +.. date: 2020-10-31-16-54-00 +.. nonce: GdcHe5 +.. section: Core and Builtins + +Make the compiler merges same co_code and co_linetable objects in a module +like already did for co_consts. + +.. + +.. bpo: 41972 +.. date: 2020-10-23-23-17-23 +.. nonce: kbAwg4 +.. section: Core and Builtins + +Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` +now sometimes use the "Two-Way" string comparison algorithm to avoid +quadratic behavior on long strings. + +.. + +.. bpo: 42128 +.. date: 2020-10-23-08-54-04 +.. nonce: SWmVEm +.. section: Core and Builtins + +Implement :pep:`634` (structural pattern matching). Patch by Brandt Bucher. + +.. + +.. bpo: 40692 +.. date: 2020-05-19-22-10-05 +.. nonce: ajEhrR +.. section: Core and Builtins + +In the :class:`concurrent.futures.ProcessPoolExecutor`, validate that +:func:`multiprocess.synchronize` is available on a given platform and rely +on that check in the :mod:`concurrent.futures` test suite so we can run +tests that are unrelated to :class:`ProcessPoolExecutor` on those platforms. + +.. + +.. bpo: 38302 +.. date: 2019-09-28-12-23-23 +.. nonce: hsCNgX +.. section: Core and Builtins + +If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator +will correctly fall back to :func:`object.__pow__` and +:func:`object.__rpow__` as expected. + +.. + +.. bpo: 43316 +.. date: 2021-02-25-09-44-36 +.. nonce: k9Gyqn +.. section: Library + +The ``python -m gzip`` command line application now properly fails when +detecting an unsupported extension. It exits with a non-zero exit code and +prints an error message to stderr. + +.. + +.. bpo: 43317 +.. date: 2021-02-25-09-08-55 +.. nonce: qrOOpB +.. section: Library + +Set the chunk size for the ``gzip`` module main function to +io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes constant +that was used previously. + +.. + +.. bpo: 43146 +.. date: 2021-02-23-17-20-16 +.. nonce: JAFplg +.. section: Library + +Handle None in single-arg versions of :func:`~traceback.print_exception` and +:func:`~traceback.format_exception`. + +.. + +.. bpo: 43260 +.. date: 2021-02-20-12-15-29 +.. nonce: 6znAas +.. section: Library + +Fix TextIOWrapper can not flush internal buffer forever after very large +text is written. + +.. + +.. bpo: 43258 +.. date: 2021-02-18-23-30-52 +.. nonce: LeU-q8 +.. section: Library + +Prevent needless allocation of :mod:`sqlite3` aggregate function context +when no rows match an aggregate query. Patch by Erlend E. Aasland. + +.. + +.. bpo: 43251 +.. date: 2021-02-18-14-24-42 +.. nonce: n6WZDw +.. section: Library + +Improve :mod:`sqlite3` error handling: ``sqlite3_column_name()`` failures +now result in :exc:`MemoryError`. Patch by Erlend E. Aasland. + +.. + +.. bpo: 40956 +.. date: 2021-02-10-23-29-50 +.. nonce: LcAbwG +.. section: Library + +Fix segfault in :meth:`sqlite3.Connection.backup` if no argument was +provided. The regression was introduced by GH-23838. Patch by Erlend E. +Aasland. + +.. + +.. bpo: 43172 +.. date: 2021-02-10-06-00-53 +.. nonce: ZMCJni +.. section: Library + +The readline module now passes its tests when built directly against +libedit. Existing irreconcilable API differences remain in +:func:`readline.get_begidx` and :func:`readline.get_endidx` behavior based +on libreadline vs libedit use. + +.. + +.. bpo: 43163 +.. date: 2021-02-08-21-13-51 +.. nonce: E2MgzH +.. section: Library + +Fix a bug in :mod:`codeop` that was causing it to not ask for more input +when multi-line snippets have unclosed parentheses. Patch by Pablo Galindo + +.. + +.. bpo: 43162 +.. date: 2021-02-08-16-27-00 +.. nonce: t-W7h3 +.. section: Library + +deprecate unsupported ability to access enum members as attributes of other +enum members + +.. + +.. bpo: 43146 +.. date: 2021-02-06-21-21-35 +.. nonce: MHtb2v +.. section: Library + +Fix recent regression in None argument handling in :mod:`~traceback` module +functions. + +.. + +.. bpo: 43102 +.. date: 2021-02-03-22-55-27 +.. nonce: TSlZ6J +.. section: Library + +The namedtuple __new__ method had its __builtins__ set to None instead of an +actual dictionary. This created problems for introspection tools. + +.. + +.. bpo: 43106 +.. date: 2021-02-03-17-06-38 +.. nonce: SwcSuU +.. section: Library + +Added :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` and +:data:`~os.O_NOFOLLOW_ANY` for macOS. Patch by Dong-hee Na. + +.. + +.. bpo: 42960 +.. date: 2021-01-18-21-07-20 +.. nonce: a7Dote +.. section: Library + +Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to the +:mod:`resource` module. + +.. + +.. bpo: 42151 +.. date: 2020-10-26-18-01-09 +.. nonce: et5f7s +.. section: Library + +Make the pure Python implementation of :mod:`xml.etree.ElementTree` behave +the same as the C implementation (:mod:`_elementree`) regarding default +attribute values (by not setting ``specified_attributes=1``). + +.. + +.. bpo: 29753 +.. date: 2020-05-02-01-01-30 +.. nonce: n2M-AF +.. section: Library + +In ctypes, now packed bitfields are calculated properly and the first item +of packed bitfields is now shrank correctly. + +.. + +.. bpo: 27646 +.. date: 2021-02-20-00-09-13 +.. nonce: HRsmo- +.. section: Documentation + +Clarify that 'yield from ' works with any iterable, not just +iterators. + +.. + +.. bpo: 36346 +.. date: 2020-06-15-10-45-45 +.. nonce: H0sS_i +.. section: Documentation + +Update some deprecated unicode APIs which are documented as "will be removed +in 4.0" to "3.12". See :pep:`623` for detail. + +.. + +.. bpo: 43288 +.. date: 2021-02-21-11-11-53 +.. nonce: LfTvL- +.. section: Tests + +Fix test_importlib to correctly skip Unicode file tests if the fileystem +does not support them. + +.. + +.. bpo: 43174 +.. date: 2021-02-10-14-11-53 +.. nonce: F9zwXQ +.. section: Build + +Windows build now uses ``/utf-8`` compiler option. + +.. + +.. bpo: 43103 +.. date: 2021-02-02-16-26-44 +.. nonce: VWeyP_ +.. section: Build + +Add a new configure ``--without-static-libpython`` option to not build the +``libpythonMAJOR.MINOR.a`` static library and not install the ``python.o`` +object file. + +.. + +.. bpo: 13501 +.. date: 2021-01-10-22-25-23 +.. nonce: g4L-6R +.. section: Build + +The configure script can now use *libedit* instead of *readline* with the +command line option ``--with-readline=editline``. + +.. + +.. bpo: 42603 +.. date: 2020-12-08-19-25-20 +.. nonce: mXs2dB +.. section: Build + +Make configure script use pkg-config to detect the location of Tcl/Tk +headers and libraries, used to build tkinter. + +On macOS, a Tcl/Tk configuration provided by pkg-config will be preferred +over Tcl/Tk frameworks installed in ``/{System/,}Library/Frameworks``. If +both exist and the latter is preferred, the appropriate ``--with-tcltk-*`` +configuration options need to be explicitly set. + +.. + +.. bpo: 39448 +.. date: 2020-01-24-12-54-22 +.. nonce: k4pv14 +.. section: Build + +Add the "regen-frozen" makefile target that regenerates the code for the +frozen ``__hello__`` module. + +.. + +.. bpo: 43155 +.. date: 2021-02-10-04-16-51 +.. nonce: O1tURk +.. section: Windows + +:c:func:`PyCMethod_New` is now present in ``python3.lib``. + +.. + +.. bpo: 41837 +.. date: 2021-02-28-22-49-46 +.. nonce: 9fqyXC +.. section: macOS + +Update macOS installer build to use OpenSSL 1.1.1j. + +.. + +.. bpo: 43283 +.. date: 2021-02-21-16-30-10 +.. nonce: DLBwYn +.. section: IDLE + +Document why printing to IDLE's Shell is often slower than printing to a +system terminal and that it can be made faster by pre-formatting a single +string before printing. + +.. + +.. bpo: 43278 +.. date: 2021-02-21-15-30-38 +.. nonce: DMPaWH +.. section: C API + +Always put compiler and system information on the first line of the REPL +welcome message. + +.. + +.. bpo: 43270 +.. date: 2021-02-19-14-28-26 +.. nonce: UKx4XN +.. section: C API + +Remove the private ``_PyErr_OCCURRED()`` macro: use the public +:c:func:`PyErr_Occurred` function instead. + +.. + +.. bpo: 35134 +.. date: 2021-02-18-18-46-42 +.. nonce: dFpEDT +.. section: C API + +Move odictobject.h, parser_interface.h, picklebufobject.h, pydebug.h, and +pyfpe.h into the cpython/ directory. They must not be included directly, as +they are already included by Python.h: :ref:`Include Files `. + +.. + +.. bpo: 35134 +.. date: 2021-02-17-18-51-26 +.. nonce: YoQdk8 +.. section: C API + +Move pyarena.h, pyctype.h, and pytime.h into the cpython/ directory. They +must not be included directly, as they are already included by Python.h: +:ref:`Include Files `. + +.. + +.. bpo: 40170 +.. date: 2021-02-16-22-29-39 +.. nonce: ahHmOo +.. section: C API + +:c:func:`PyExceptionClass_Name` is now always declared as a function, in +order to hide implementation details. The macro accessed +:c:member:`PyTypeObject.tp_name` directly. Patch by Erlend E. Aasland. + +.. + +.. bpo: 43239 +.. date: 2021-02-16-17-30-16 +.. nonce: FQqOGz +.. section: C API + +The :c:func:`PyCFunction_New` function is now exported in the ABI when +compiled with ``-fvisibility=hidden``. + +.. + +.. bpo: 40170 +.. date: 2021-02-15-15-06-43 +.. nonce: ZYeSii +.. section: C API + +:c:func:`PyIter_Check` is now always declared as a function, in order to +hide implementation details. The macro accessed +:c:member:`PyTypeObject.tp_iternext` directly. Patch by Erlend E. Aasland. + +.. + +.. bpo: 40170 +.. date: 2021-02-15-13-41-14 +.. nonce: r2FAtl +.. section: C API + +Convert :c:func:`PyDescr_IsData` macro to a function to hide implementation +details: The macro accessed :c:member:`PyTypeObject.tp_descr_set` directly. +Patch by Erlend E. Aasland. + +.. + +.. bpo: 43181 +.. date: 2021-02-11-11-37-14 +.. nonce: ydv33S +.. section: C API + +Convert :c:func:`PyObject_TypeCheck` macro to a static inline function. +Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/Build/2020-01-24-12-54-22.bpo-39448.k4pv14.rst b/Misc/NEWS.d/next/Build/2020-01-24-12-54-22.bpo-39448.k4pv14.rst deleted file mode 100644 index 2a0dc0e2cd6cb..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-01-24-12-54-22.bpo-39448.k4pv14.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add the "regen-frozen" makefile target that regenerates the code for the -frozen ``__hello__`` module. diff --git a/Misc/NEWS.d/next/Build/2020-12-08-19-25-20.bpo-42603.mXs2dB.rst b/Misc/NEWS.d/next/Build/2020-12-08-19-25-20.bpo-42603.mXs2dB.rst deleted file mode 100644 index eea77e01fa7bb..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-12-08-19-25-20.bpo-42603.mXs2dB.rst +++ /dev/null @@ -1,7 +0,0 @@ -Make configure script use pkg-config to detect the location of Tcl/Tk -headers and libraries, used to build tkinter. - -On macOS, a Tcl/Tk configuration provided by pkg-config will be preferred -over Tcl/Tk frameworks installed in ``/{System/,}Library/Frameworks``. -If both exist and the latter is preferred, the appropriate -``--with-tcltk-*`` configuration options need to be explicitly set. diff --git a/Misc/NEWS.d/next/Build/2021-01-10-22-25-23.bpo-13501.g4L-6R.rst b/Misc/NEWS.d/next/Build/2021-01-10-22-25-23.bpo-13501.g4L-6R.rst deleted file mode 100644 index 8dc9442725e67..0000000000000 --- a/Misc/NEWS.d/next/Build/2021-01-10-22-25-23.bpo-13501.g4L-6R.rst +++ /dev/null @@ -1,2 +0,0 @@ -The configure script can now use *libedit* instead of *readline* with the -command line option ``--with-readline=editline``. diff --git a/Misc/NEWS.d/next/Build/2021-02-02-16-26-44.bpo-43103.VWeyP_.rst b/Misc/NEWS.d/next/Build/2021-02-02-16-26-44.bpo-43103.VWeyP_.rst deleted file mode 100644 index edf04c126897a..0000000000000 --- a/Misc/NEWS.d/next/Build/2021-02-02-16-26-44.bpo-43103.VWeyP_.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add a new configure ``--without-static-libpython`` option to not build the -``libpythonMAJOR.MINOR.a`` static library and not install the ``python.o`` -object file. diff --git a/Misc/NEWS.d/next/Build/2021-02-10-14-11-53.bpo-43174.F9zwXQ.rst b/Misc/NEWS.d/next/Build/2021-02-10-14-11-53.bpo-43174.F9zwXQ.rst deleted file mode 100644 index 64c80188d02f6..0000000000000 --- a/Misc/NEWS.d/next/Build/2021-02-10-14-11-53.bpo-43174.F9zwXQ.rst +++ /dev/null @@ -1 +0,0 @@ -Windows build now uses ``/utf-8`` compiler option. diff --git a/Misc/NEWS.d/next/C API/2021-02-11-11-37-14.bpo-43181.ydv33S.rst b/Misc/NEWS.d/next/C API/2021-02-11-11-37-14.bpo-43181.ydv33S.rst deleted file mode 100644 index 0e0a5712930d7..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-11-11-37-14.bpo-43181.ydv33S.rst +++ /dev/null @@ -1,2 +0,0 @@ -Convert :c:func:`PyObject_TypeCheck` macro to a static inline function. Patch by -Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/C API/2021-02-15-13-41-14.bpo-40170.r2FAtl.rst b/Misc/NEWS.d/next/C API/2021-02-15-13-41-14.bpo-40170.r2FAtl.rst deleted file mode 100644 index 82e844bc28409..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-15-13-41-14.bpo-40170.r2FAtl.rst +++ /dev/null @@ -1,3 +0,0 @@ -Convert :c:func:`PyDescr_IsData` macro to a function to hide implementation -details: The macro accessed :c:member:`PyTypeObject.tp_descr_set` directly. -Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/C API/2021-02-15-15-06-43.bpo-40170.ZYeSii.rst b/Misc/NEWS.d/next/C API/2021-02-15-15-06-43.bpo-40170.ZYeSii.rst deleted file mode 100644 index df6f3dcfc14b6..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-15-15-06-43.bpo-40170.ZYeSii.rst +++ /dev/null @@ -1,3 +0,0 @@ -:c:func:`PyIter_Check` is now always declared as a function, in order to hide implementation -details. The macro accessed :c:member:`PyTypeObject.tp_iternext` directly. -Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/C API/2021-02-16-17-30-16.bpo-43239.FQqOGz.rst b/Misc/NEWS.d/next/C API/2021-02-16-17-30-16.bpo-43239.FQqOGz.rst deleted file mode 100644 index cded580ae4bc2..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-16-17-30-16.bpo-43239.FQqOGz.rst +++ /dev/null @@ -1,2 +0,0 @@ -The :c:func:`PyCFunction_New` function is now exported in the ABI when -compiled with ``-fvisibility=hidden``. diff --git a/Misc/NEWS.d/next/C API/2021-02-16-22-29-39.bpo-40170.ahHmOo.rst b/Misc/NEWS.d/next/C API/2021-02-16-22-29-39.bpo-40170.ahHmOo.rst deleted file mode 100644 index 348fcce98e631..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-16-22-29-39.bpo-40170.ahHmOo.rst +++ /dev/null @@ -1,3 +0,0 @@ -:c:func:`PyExceptionClass_Name` is now always declared as a function, in -order to hide implementation details. The macro accessed -:c:member:`PyTypeObject.tp_name` directly. Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst b/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst deleted file mode 100644 index c3534fce68f83..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst +++ /dev/null @@ -1,3 +0,0 @@ -Move pyarena.h, pyctype.h, and pytime.h into the cpython/ directory. They -must not be included directly, as they are already included by Python.h: -:ref:`Include Files `. diff --git a/Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst b/Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst deleted file mode 100644 index 5384cb8288f33..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-18-18-46-42.bpo-35134.dFpEDT.rst +++ /dev/null @@ -1,3 +0,0 @@ -Move odictobject.h, parser_interface.h, picklebufobject.h, pydebug.h, and -pyfpe.h into the cpython/ directory. They must not be included directly, as -they are already included by Python.h: :ref:`Include Files `. diff --git a/Misc/NEWS.d/next/C API/2021-02-19-14-28-26.bpo-43270.UKx4XN.rst b/Misc/NEWS.d/next/C API/2021-02-19-14-28-26.bpo-43270.UKx4XN.rst deleted file mode 100644 index ab8c9772cb0f9..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-19-14-28-26.bpo-43270.UKx4XN.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove the private ``_PyErr_OCCURRED()`` macro: use the public -:c:func:`PyErr_Occurred` function instead. diff --git a/Misc/NEWS.d/next/C API/2021-02-21-15-30-38.bpo-43278.DMPaWH.rst b/Misc/NEWS.d/next/C API/2021-02-21-15-30-38.bpo-43278.DMPaWH.rst deleted file mode 100644 index 7df9295aeccf0..0000000000000 --- a/Misc/NEWS.d/next/C API/2021-02-21-15-30-38.bpo-43278.DMPaWH.rst +++ /dev/null @@ -1 +0,0 @@ -Always put compiler and system information on the first line of the REPL welcome message. diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-09-28-12-23-23.bpo-38302.hsCNgX.rst b/Misc/NEWS.d/next/Core and Builtins/2019-09-28-12-23-23.bpo-38302.hsCNgX.rst deleted file mode 100644 index e9462f1facd8f..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2019-09-28-12-23-23.bpo-38302.hsCNgX.rst +++ /dev/null @@ -1 +0,0 @@ -If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator will correctly fall back to :func:`object.__pow__` and :func:`object.__rpow__` as expected. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst deleted file mode 100644 index b92dcdd00affc..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst +++ /dev/null @@ -1 +0,0 @@ -In the :class:`concurrent.futures.ProcessPoolExecutor`, validate that :func:`multiprocess.synchronize` is available on a given platform and rely on that check in the :mod:`concurrent.futures` test suite so we can run tests that are unrelated to :class:`ProcessPoolExecutor` on those platforms. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-23-08-54-04.bpo-42128.SWmVEm.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-23-08-54-04.bpo-42128.SWmVEm.rst deleted file mode 100644 index e779eb8ceb192..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-10-23-08-54-04.bpo-42128.SWmVEm.rst +++ /dev/null @@ -1 +0,0 @@ -Implement :pep:`634` (structural pattern matching). Patch by Brandt Bucher. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-23-23-17-23.bpo-41972.kbAwg4.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-23-23-17-23.bpo-41972.kbAwg4.rst deleted file mode 100644 index 609a0ff0be253..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-10-23-23-17-23.bpo-41972.kbAwg4.rst +++ /dev/null @@ -1 +0,0 @@ -Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` now sometimes use the "Two-Way" string comparison algorithm to avoid quadratic behavior on long strings. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-31-16-54-00.bpo-42217.GdcHe5.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-31-16-54-00.bpo-42217.GdcHe5.rst deleted file mode 100644 index c50b69d18885a..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-10-31-16-54-00.bpo-42217.GdcHe5.rst +++ /dev/null @@ -1 +0,0 @@ -Make the compiler merges same co_code and co_linetable objects in a module like already did for co_consts. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-01-02-05-10-58.bpo-42808.AOxgxl.rst b/Misc/NEWS.d/next/Core and Builtins/2021-01-02-05-10-58.bpo-42808.AOxgxl.rst deleted file mode 100644 index 1c70005d0a09f..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-01-02-05-10-58.bpo-42808.AOxgxl.rst +++ /dev/null @@ -1,2 +0,0 @@ -Simple calls to ``type(object)`` are now faster due to the -``vectorcall`` calling convention. Patch by Dennis Sweeney. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-01-04-23-54-34.bpo-42819.4KO6wU.rst b/Misc/NEWS.d/next/Core and Builtins/2021-01-04-23-54-34.bpo-42819.4KO6wU.rst deleted file mode 100644 index d067f0bfa7644..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-01-04-23-54-34.bpo-42819.4KO6wU.rst +++ /dev/null @@ -1,8 +0,0 @@ -:mod:`readline`: Explicitly disable bracketed paste in the interactive -interpreter, even if it's set in the inputrc, is enabled by default (eg GNU -Readline 8.1), or a user calls ``readline.read_init_file()``. The Python REPL -has not implemented bracketed paste support. Also, bracketed mode writes the -``"\x1b[?2004h"`` escape sequence into stdout which causes test failures in -applications that don't support it. It can still be explicitly enabled by -calling ``readline.parse_and_bind("set enable-bracketed-paste on")``. Patch by -Dustin Rodrigues. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-03-22-33-05.bpo-43121.jqcViq.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-03-22-33-05.bpo-43121.jqcViq.rst deleted file mode 100644 index 5030bda133c8d..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-03-22-33-05.bpo-43121.jqcViq.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed an incorrect :exc:`SyntaxError` message for missing comma in literals. -Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-07-03-27-14.bpo-43149.0umPKD.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-07-03-27-14.bpo-43149.0umPKD.rst deleted file mode 100644 index 35ef84cc1e231..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-07-03-27-14.bpo-43149.0umPKD.rst +++ /dev/null @@ -1,2 +0,0 @@ -Improve the error message in the parser for exception groups without -parentheses. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-17-19-02-21.bpo-42990.SKXHiI.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-17-19-02-21.bpo-42990.SKXHiI.rst deleted file mode 100644 index cc17154762a91..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-17-19-02-21.bpo-42990.SKXHiI.rst +++ /dev/null @@ -1,3 +0,0 @@ -Functions have a new ``__builtins__`` attribute which is used to look for -builtin symbols when a function is executed, instead of looking into -``__globals__['__builtins__']``. Patch by Mark Shannon and Victor Stinner. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-18-15-12-30.bpo-42990.toAqBH.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-18-15-12-30.bpo-42990.toAqBH.rst deleted file mode 100644 index b9e66471e6893..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-18-15-12-30.bpo-42990.toAqBH.rst +++ /dev/null @@ -1,7 +0,0 @@ -The :data:`types.FunctionType` constructor now inherits the current builtins if -the *globals* dictionary has no ``"__builtins__"`` key, rather than using -``{"None": None}`` as builtins: same behavior as :func:`eval` and :func:`exec` -functions. Defining a function with ``def function(...): ...`` in Python is -not affected, globals cannot be overriden with this syntax: it also inherits -the current builtins. -Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-20-16-50-22.bpo-43277.FXkRXk.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-20-16-50-22.bpo-43277.FXkRXk.rst deleted file mode 100644 index 64e57911bbe7e..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-20-16-50-22.bpo-43277.FXkRXk.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an -object is an instance of :class:`set` but not an instance of a subtype. -Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-22-19-00-00.bpo-36346.uAoni0.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-22-19-00-00.bpo-36346.uAoni0.rst deleted file mode 100644 index 3b3e727b76905..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-22-19-00-00.bpo-36346.uAoni0.rst +++ /dev/null @@ -1,2 +0,0 @@ -``PyArg_Parse*()`` functions now emits ``DeprecationWarning`` when ``u`` or -``Z`` format is used. See :pep:`623` for detail. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-26-13-17-52.bpo-43321.TCS3ph.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-26-13-17-52.bpo-43321.TCS3ph.rst deleted file mode 100644 index 32c5ce14de51c..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-26-13-17-52.bpo-43321.TCS3ph.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix ``SystemError`` raised when ``PyArg_Parse*()`` is used with ``#`` but -without ``PY_SSIZE_T_CLEAN`` defined. diff --git a/Misc/NEWS.d/next/Documentation/2020-06-15-10-45-45.bpo-36346.H0sS_i.rst b/Misc/NEWS.d/next/Documentation/2020-06-15-10-45-45.bpo-36346.H0sS_i.rst deleted file mode 100644 index b737e125f8371..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-06-15-10-45-45.bpo-36346.H0sS_i.rst +++ /dev/null @@ -1,2 +0,0 @@ -Update some deprecated unicode APIs which are documented as "will be removed -in 4.0" to "3.12". See :pep:`623` for detail. diff --git a/Misc/NEWS.d/next/Documentation/2021-02-20-00-09-13.bpo-27646.HRsmo-.rst b/Misc/NEWS.d/next/Documentation/2021-02-20-00-09-13.bpo-27646.HRsmo-.rst deleted file mode 100644 index 8ba398adf6182..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2021-02-20-00-09-13.bpo-27646.HRsmo-.rst +++ /dev/null @@ -1,2 +0,0 @@ -Clarify that 'yield from ' works with any iterable, not just -iterators. diff --git a/Misc/NEWS.d/next/IDLE/2021-02-21-16-30-10.bpo-43283.DLBwYn.rst b/Misc/NEWS.d/next/IDLE/2021-02-21-16-30-10.bpo-43283.DLBwYn.rst deleted file mode 100644 index 7a627af412a8e..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2021-02-21-16-30-10.bpo-43283.DLBwYn.rst +++ /dev/null @@ -1,3 +0,0 @@ -Document why printing to IDLE's Shell is often slower than printing to a -system terminal and that it can be made faster by pre-formatting a single -string before printing. diff --git a/Misc/NEWS.d/next/Library/2020-05-02-01-01-30.bpo-29753.n2M-AF.rst b/Misc/NEWS.d/next/Library/2020-05-02-01-01-30.bpo-29753.n2M-AF.rst deleted file mode 100644 index f2a2842239b9c..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-05-02-01-01-30.bpo-29753.n2M-AF.rst +++ /dev/null @@ -1 +0,0 @@ -In ctypes, now packed bitfields are calculated properly and the first item of packed bitfields is now shrank correctly. diff --git a/Misc/NEWS.d/next/Library/2020-10-26-18-01-09.bpo-42151.et5f7s.rst b/Misc/NEWS.d/next/Library/2020-10-26-18-01-09.bpo-42151.et5f7s.rst deleted file mode 100644 index 6361f2c088d2d..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-10-26-18-01-09.bpo-42151.et5f7s.rst +++ /dev/null @@ -1,3 +0,0 @@ -Make the pure Python implementation of :mod:`xml.etree.ElementTree` behave -the same as the C implementation (:mod:`_elementree`) regarding default -attribute values (by not setting ``specified_attributes=1``). diff --git a/Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst b/Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst deleted file mode 100644 index 58c1bcc85ef70..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst +++ /dev/null @@ -1 +0,0 @@ -Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to the :mod:`resource` module. diff --git a/Misc/NEWS.d/next/Library/2021-02-03-17-06-38.bpo-43106.SwcSuU.rst b/Misc/NEWS.d/next/Library/2021-02-03-17-06-38.bpo-43106.SwcSuU.rst deleted file mode 100644 index a85d49437c4e5..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-03-17-06-38.bpo-43106.SwcSuU.rst +++ /dev/null @@ -1,2 +0,0 @@ -Added :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` -and :data:`~os.O_NOFOLLOW_ANY` for macOS. Patch by Dong-hee Na. diff --git a/Misc/NEWS.d/next/Library/2021-02-03-22-55-27.bpo-43102.TSlZ6J.rst b/Misc/NEWS.d/next/Library/2021-02-03-22-55-27.bpo-43102.TSlZ6J.rst deleted file mode 100644 index 985fd68a03a93..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-03-22-55-27.bpo-43102.TSlZ6J.rst +++ /dev/null @@ -1,2 +0,0 @@ -The namedtuple __new__ method had its __builtins__ set to None instead -of an actual dictionary. This created problems for introspection tools. diff --git a/Misc/NEWS.d/next/Library/2021-02-06-21-21-35.bpo-43146.MHtb2v.rst b/Misc/NEWS.d/next/Library/2021-02-06-21-21-35.bpo-43146.MHtb2v.rst deleted file mode 100644 index 8d213a4138ef0..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-06-21-21-35.bpo-43146.MHtb2v.rst +++ /dev/null @@ -1 +0,0 @@ -Fix recent regression in None argument handling in :mod:`~traceback` module functions. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2021-02-08-16-27-00.bpo-43162.t-W7h3.rst b/Misc/NEWS.d/next/Library/2021-02-08-16-27-00.bpo-43162.t-W7h3.rst deleted file mode 100644 index fef5915e762ee..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-08-16-27-00.bpo-43162.t-W7h3.rst +++ /dev/null @@ -1,2 +0,0 @@ -deprecate unsupported ability to access enum members as attributes of other -enum members diff --git a/Misc/NEWS.d/next/Library/2021-02-08-21-13-51.bpo-43163.E2MgzH.rst b/Misc/NEWS.d/next/Library/2021-02-08-21-13-51.bpo-43163.E2MgzH.rst deleted file mode 100644 index ddd60ea385596..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-08-21-13-51.bpo-43163.E2MgzH.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bug in :mod:`codeop` that was causing it to not ask for more input -when multi-line snippets have unclosed parentheses. Patch by Pablo Galindo diff --git a/Misc/NEWS.d/next/Library/2021-02-10-06-00-53.bpo-43172.ZMCJni.rst b/Misc/NEWS.d/next/Library/2021-02-10-06-00-53.bpo-43172.ZMCJni.rst deleted file mode 100644 index dc756606d8bb0..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-10-06-00-53.bpo-43172.ZMCJni.rst +++ /dev/null @@ -1,4 +0,0 @@ -The readline module now passes its tests when built directly against -libedit. Existing irreconcilable API differences remain in -:func:`readline.get_begidx` and :func:`readline.get_endidx` behavior based -on libreadline vs libedit use. diff --git a/Misc/NEWS.d/next/Library/2021-02-10-23-29-50.bpo-40956.LcAbwG.rst b/Misc/NEWS.d/next/Library/2021-02-10-23-29-50.bpo-40956.LcAbwG.rst deleted file mode 100644 index e81922c031567..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-10-23-29-50.bpo-40956.LcAbwG.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix segfault in :meth:`sqlite3.Connection.backup` if no argument was -provided. The regression was introduced by GH-23838. Patch by -Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/Library/2021-02-18-14-24-42.bpo-43251.n6WZDw.rst b/Misc/NEWS.d/next/Library/2021-02-18-14-24-42.bpo-43251.n6WZDw.rst deleted file mode 100644 index 52ce9d93af84c..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-18-14-24-42.bpo-43251.n6WZDw.rst +++ /dev/null @@ -1,2 +0,0 @@ -Improve :mod:`sqlite3` error handling: ``sqlite3_column_name()`` failures -now result in :exc:`MemoryError`. Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/Library/2021-02-18-23-30-52.bpo-43258.LeU-q8.rst b/Misc/NEWS.d/next/Library/2021-02-18-23-30-52.bpo-43258.LeU-q8.rst deleted file mode 100644 index 0529214718c44..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-18-23-30-52.bpo-43258.LeU-q8.rst +++ /dev/null @@ -1,2 +0,0 @@ -Prevent needless allocation of :mod:`sqlite3` aggregate function context -when no rows match an aggregate query. Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/Library/2021-02-20-12-15-29.bpo-43260.6znAas.rst b/Misc/NEWS.d/next/Library/2021-02-20-12-15-29.bpo-43260.6znAas.rst deleted file mode 100644 index f3c21d1c63f72..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-20-12-15-29.bpo-43260.6znAas.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix TextIOWrapper can not flush internal buffer forever after very large -text is written. diff --git a/Misc/NEWS.d/next/Library/2021-02-23-17-20-16.bpo-43146.JAFplg.rst b/Misc/NEWS.d/next/Library/2021-02-23-17-20-16.bpo-43146.JAFplg.rst deleted file mode 100644 index 151edbe28d246..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-23-17-20-16.bpo-43146.JAFplg.rst +++ /dev/null @@ -1 +0,0 @@ -Handle None in single-arg versions of :func:`~traceback.print_exception` and :func:`~traceback.format_exception`. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2021-02-25-09-08-55.bpo-43317.qrOOpB.rst b/Misc/NEWS.d/next/Library/2021-02-25-09-08-55.bpo-43317.qrOOpB.rst deleted file mode 100644 index 01ff48ad90d6b..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-25-09-08-55.bpo-43317.qrOOpB.rst +++ /dev/null @@ -1,3 +0,0 @@ -Set the chunk size for the ``gzip`` module main function to -io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes constant -that was used previously. diff --git a/Misc/NEWS.d/next/Library/2021-02-25-09-44-36.bpo-43316.k9Gyqn.rst b/Misc/NEWS.d/next/Library/2021-02-25-09-44-36.bpo-43316.k9Gyqn.rst deleted file mode 100644 index 1f0d3c499c16f..0000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-25-09-44-36.bpo-43316.k9Gyqn.rst +++ /dev/null @@ -1,3 +0,0 @@ -The ``python -m gzip`` command line application now properly fails when -detecting an unsupported extension. It exits with a non-zero exit code and -prints an error message to stderr. diff --git a/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst b/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst deleted file mode 100644 index f08489b41494e..0000000000000 --- a/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst +++ /dev/null @@ -1 +0,0 @@ -Fix web cache poisoning vulnerability by defaulting the query args separator to ``&``, and allowing the user to choose a custom separator. diff --git a/Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst b/Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst deleted file mode 100644 index 8463540ae8a14..0000000000000 --- a/Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix test_importlib to correctly skip Unicode file tests if the fileystem -does not support them. diff --git a/Misc/NEWS.d/next/Windows/2021-02-10-04-16-51.bpo-43155.O1tURk.rst b/Misc/NEWS.d/next/Windows/2021-02-10-04-16-51.bpo-43155.O1tURk.rst deleted file mode 100644 index 2eeef2b0ea27a..0000000000000 --- a/Misc/NEWS.d/next/Windows/2021-02-10-04-16-51.bpo-43155.O1tURk.rst +++ /dev/null @@ -1 +0,0 @@ -:c:func:`PyCMethod_New` is now present in ``python3.lib``. diff --git a/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst b/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst deleted file mode 100644 index 5d32d87a5a97d..0000000000000 --- a/Misc/NEWS.d/next/macOS/2021-02-28-22-49-46.bpo-41837.9fqyXC.rst +++ /dev/null @@ -1 +0,0 @@ -Update macOS installer build to use OpenSSL 1.1.1j. From webhook-mailer at python.org Mon Mar 1 17:00:06 2021 From: webhook-mailer at python.org (JulienPalard) Date: Mon, 01 Mar 2021 22:00:06 -0000 Subject: [Python-checkins] Fixed linenumber missing when audit hook has an error (GH-24692) Message-ID: https://github.com/python/cpython/commit/dbfabcc0c306742e34b9b0e162c63ccebe9d2b05 commit: dbfabcc0c306742e34b9b0e162c63ccebe9d2b05 branch: master author: Jules Lasne committer: JulienPalard date: 2021-03-01T22:59:58+01:00 summary: Fixed linenumber missing when audit hook has an error (GH-24692) See https://github.com/sphinx-doc/sphinx/issues/8932 Co-authored-by: tk0miya files: M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 28994399e25cf..bcd9d26b36846 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -224,6 +224,7 @@ def run(self): info['source'].append((env.docname, target)) pnode = nodes.paragraph(text, classes=["audit-hook"], ids=ids) + pnode.line = self.lineno if self.content: self.state.nested_parse(self.content, self.content_offset, pnode) else: From webhook-mailer at python.org Mon Mar 1 17:23:31 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 22:23:31 -0000 Subject: [Python-checkins] Fixed linenumber missing when audit hook has an error (GH-24692) Message-ID: https://github.com/python/cpython/commit/ff887f38f6bb438bac3a4b02aaac1d56c6077418 commit: ff887f38f6bb438bac3a4b02aaac1d56c6077418 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T14:23:21-08:00 summary: Fixed linenumber missing when audit hook has an error (GH-24692) See https://github.com/sphinx-doc/sphinx/issues/8932 Co-authored-by: tk0miya (cherry picked from commit dbfabcc0c306742e34b9b0e162c63ccebe9d2b05) Co-authored-by: Jules Lasne files: M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 2fad9ec00cd56..74de6ffa75559 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -191,6 +191,7 @@ def run(self): info['source'].append((env.docname, target)) pnode = nodes.paragraph(text, classes=["audit-hook"], ids=ids) + pnode.line = self.lineno if self.content: self.state.nested_parse(self.content, self.content_offset, pnode) else: From webhook-mailer at python.org Mon Mar 1 18:21:26 2021 From: webhook-mailer at python.org (gvanrossum) Date: Mon, 01 Mar 2021 23:21:26 -0000 Subject: [Python-checkins] bpo-42840: Document providing kwargs to type. (#24173) Message-ID: https://github.com/python/cpython/commit/72fcd14a82369ed32a5846d76f50e3026cf4eec2 commit: 72fcd14a82369ed32a5846d76f50e3026cf4eec2 branch: master author: Erik Soma committer: gvanrossum date: 2021-03-01T15:21:04-08:00 summary: bpo-42840: Document providing kwargs to type. (#24173) Co-authored-by: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com> files: M Doc/library/functions.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 370decc51087f..2a6af95cdf9ef 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1713,7 +1713,7 @@ are always available. They are listed here in alphabetical order. .. class:: type(object) - type(name, bases, dict) + type(name, bases, dict, **kwds) .. index:: object: type @@ -1742,6 +1742,13 @@ are always available. They are listed here in alphabetical order. See also :ref:`bltin-type-objects`. + Keyword arguments provided to the three argument form are passed to the + appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) + in the same way that keywords in a class + definition (besides *metaclass*) would. + + See also :ref:`class-customization`. + .. versionchanged:: 3.6 Subclasses of :class:`type` which don't override ``type.__new__`` may no longer use the one-argument form to get the type of an object. From webhook-mailer at python.org Mon Mar 1 18:30:50 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 01 Mar 2021 23:30:50 -0000 Subject: [Python-checkins] bpo-42840: Document providing kwargs to type. (GH-24173) Message-ID: https://github.com/python/cpython/commit/7101d152f9789ad243912c00349d5da657b217fd commit: 7101d152f9789ad243912c00349d5da657b217fd branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T15:30:42-08:00 summary: bpo-42840: Document providing kwargs to type. (GH-24173) Co-authored-by: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com> (cherry picked from commit 72fcd14a82369ed32a5846d76f50e3026cf4eec2) Co-authored-by: Erik Soma files: M Doc/library/functions.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 9d67d80789fc9..00d40d6519520 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1671,7 +1671,7 @@ are always available. They are listed here in alphabetical order. .. class:: type(object) - type(name, bases, dict) + type(name, bases, dict, **kwds) .. index:: object: type @@ -1700,6 +1700,13 @@ are always available. They are listed here in alphabetical order. See also :ref:`bltin-type-objects`. + Keyword arguments provided to the three argument form are passed to the + appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) + in the same way that keywords in a class + definition (besides *metaclass*) would. + + See also :ref:`class-customization`. + .. versionchanged:: 3.6 Subclasses of :class:`type` which don't override ``type.__new__`` may no longer use the one-argument form to get the type of an object. From webhook-mailer at python.org Mon Mar 1 20:52:06 2021 From: webhook-mailer at python.org (methane) Date: Tue, 02 Mar 2021 01:52:06 -0000 Subject: [Python-checkins] Doc: Improve library/json document. (GH-24390) Message-ID: https://github.com/python/cpython/commit/a347bc0b35c982e9600838d5a545e244bb76a4bf commit: a347bc0b35c982e9600838d5a545e244bb76a4bf branch: master author: Adorilson Bezerra committer: methane date: 2021-03-02T10:51:58+09:00 summary: Doc: Improve library/json document. (GH-24390) files: M Doc/library/json.rst diff --git a/Doc/library/json.rst b/Doc/library/json.rst index e1a246aad6190..c8184da80fe43 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -333,7 +333,7 @@ Encoders and Decoders *object_hook*, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to - support JSON-RPC class hinting). + support `JSON-RPC `_ class hinting). *object_pairs_hook*, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of @@ -422,10 +422,9 @@ Encoders and Decoders for ``o`` if possible, otherwise it should call the superclass implementation (to raise :exc:`TypeError`). - If *skipkeys* is false (the default), then it is a :exc:`TypeError` to - attempt encoding of keys that are not :class:`str`, :class:`int`, - :class:`float` or ``None``. If *skipkeys* is true, such items are simply - skipped. + If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when + trying to encode keys that are not :class:`str`, :class:`int`, :class:`float` + or ``None``. If *skipkeys* is true, such items are simply skipped. If *ensure_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If *ensure_ascii* is @@ -479,8 +478,8 @@ Encoders and Decoders object for *o*, or calls the base implementation (to raise a :exc:`TypeError`). - For example, to support arbitrary iterators, you could implement default - like this:: + For example, to support arbitrary iterators, you could implement + :meth:`default` like this:: def default(self, o): try: From webhook-mailer at python.org Mon Mar 1 21:15:14 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 02 Mar 2021 02:15:14 -0000 Subject: [Python-checkins] Doc: Improve library/json document. (GH-24390) Message-ID: https://github.com/python/cpython/commit/f836e5f2194857b24ec03adfcfcce05375868f88 commit: f836e5f2194857b24ec03adfcfcce05375868f88 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-01T18:15:05-08:00 summary: Doc: Improve library/json document. (GH-24390) (cherry picked from commit a347bc0b35c982e9600838d5a545e244bb76a4bf) Co-authored-by: Adorilson Bezerra files: M Doc/library/json.rst diff --git a/Doc/library/json.rst b/Doc/library/json.rst index e1a246aad6190..c8184da80fe43 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -333,7 +333,7 @@ Encoders and Decoders *object_hook*, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to - support JSON-RPC class hinting). + support `JSON-RPC `_ class hinting). *object_pairs_hook*, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of @@ -422,10 +422,9 @@ Encoders and Decoders for ``o`` if possible, otherwise it should call the superclass implementation (to raise :exc:`TypeError`). - If *skipkeys* is false (the default), then it is a :exc:`TypeError` to - attempt encoding of keys that are not :class:`str`, :class:`int`, - :class:`float` or ``None``. If *skipkeys* is true, such items are simply - skipped. + If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when + trying to encode keys that are not :class:`str`, :class:`int`, :class:`float` + or ``None``. If *skipkeys* is true, such items are simply skipped. If *ensure_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If *ensure_ascii* is @@ -479,8 +478,8 @@ Encoders and Decoders object for *o*, or calls the base implementation (to raise a :exc:`TypeError`). - For example, to support arbitrary iterators, you could implement default - like this:: + For example, to support arbitrary iterators, you could implement + :meth:`default` like this:: def default(self, o): try: From webhook-mailer at python.org Mon Mar 1 21:49:22 2021 From: webhook-mailer at python.org (methane) Date: Tue, 02 Mar 2021 02:49:22 -0000 Subject: [Python-checkins] bpo-41282: distutils: Fix stacklevel for DeprecationWarning (GH-24657) Message-ID: https://github.com/python/cpython/commit/5bfa94560519bbe70ae66ff0a29498f2ae2e1937 commit: 5bfa94560519bbe70ae66ff0a29498f2ae2e1937 branch: master author: Inada Naoki committer: methane date: 2021-03-02T11:49:10+09:00 summary: bpo-41282: distutils: Fix stacklevel for DeprecationWarning (GH-24657) DeprecationWarning is emit for `import distutils`, not for `distutils` itself. files: A Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst M Lib/distutils/__init__.py diff --git a/Lib/distutils/__init__.py b/Lib/distutils/__init__.py index 7b2b059b83dad..8eef902f7d620 100644 --- a/Lib/distutils/__init__.py +++ b/Lib/distutils/__init__.py @@ -16,4 +16,4 @@ warnings.warn("The distutils package is deprecated and slated for " "removal in Python 3.12. Use setuptools or check " "PEP 632 for potential alternatives", - DeprecationWarning) + DeprecationWarning, 2) diff --git a/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst b/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst new file mode 100644 index 0000000000000..6655ac69c44af --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst @@ -0,0 +1,2 @@ +Fixed stacklevel of ``DeprecationWarning`` emitted from ``import +distutils``. From webhook-mailer at python.org Tue Mar 2 02:40:59 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Tue, 02 Mar 2021 07:40:59 -0000 Subject: [Python-checkins] bpo-39523: Use do-while loop pysqlite_cursor_executescript() (GH-18305) Message-ID: https://github.com/python/cpython/commit/25e244c92501e84b0fd6e7539e15c0e640d42cc1 commit: 25e244c92501e84b0fd6e7539e15c0e640d42cc1 branch: master author: Alex Henrie committer: berkerpeksag date: 2021-03-02T09:40:34+02:00 summary: bpo-39523: Use do-while loop pysqlite_cursor_executescript() (GH-18305) files: M Modules/_sqlite/cursor.c diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index ddacb2745d34d..23ab7451fdaa0 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -715,14 +715,13 @@ pysqlite_cursor_executescript(pysqlite_Cursor *self, PyObject *script_obj) } /* execute statement, and ignore results of SELECT statements */ - rc = SQLITE_ROW; - while (rc == SQLITE_ROW) { + do { rc = pysqlite_step(statement, self->connection); if (PyErr_Occurred()) { (void)sqlite3_finalize(statement); goto error; } - } + } while (rc == SQLITE_ROW); if (rc != SQLITE_DONE) { (void)sqlite3_finalize(statement); From webhook-mailer at python.org Tue Mar 2 05:20:37 2021 From: webhook-mailer at python.org (markshannon) Date: Tue, 02 Mar 2021 10:20:37 -0000 Subject: [Python-checkins] bpo-43358: Fix bad free in assemble function (GH-24697) Message-ID: https://github.com/python/cpython/commit/503627fc2acb875b4c7b58a7f6e258cfcbad054b commit: 503627fc2acb875b4c7b58a7f6e258cfcbad054b branch: master author: Alex Henrie committer: markshannon date: 2021-03-02T10:20:25Z summary: bpo-43358: Fix bad free in assemble function (GH-24697) files: M Python/compile.c diff --git a/Python/compile.c b/Python/compile.c index 454005eb7b0cb..b0d3127ff6878 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -6664,12 +6664,12 @@ assemble(struct compiler *c, int addNone) for (basicblock *b = c->u->u_blocks; b != NULL; b = b->b_list) { if (normalize_basic_block(b)) { - goto error; + return NULL; } } if (ensure_exits_have_lineno(c)) { - goto error; + return NULL; } nblocks = 0; From webhook-mailer at python.org Tue Mar 2 05:37:12 2021 From: webhook-mailer at python.org (ambv) Date: Tue, 02 Mar 2021 10:37:12 -0000 Subject: [Python-checkins] bpo-42500: Fix recursion in or after except (GH-23568) (#24501) Message-ID: https://github.com/python/cpython/commit/8b795ab5541d8a4e69be4137dfdc207714270b77 commit: 8b795ab5541d8a4e69be4137dfdc207714270b77 branch: 3.9 author: Mark Shannon committer: ambv date: 2021-03-02T11:36:38+01:00 summary: bpo-42500: Fix recursion in or after except (GH-23568) (#24501) * Use counter, rather boolean state when handling soft overflows. (cherry picked from commit 4e7a69bdb63a104587759d7784124492dcdd496e) files: A Misc/NEWS.d/next/Core and Builtins/2020-11-30-14-27-29.bpo-42500.excVKU.rst M Include/cpython/pystate.h M Include/internal/pycore_ceval.h M Lib/test/test_exceptions.py M Lib/test/test_sys.py M Python/ceval.c M Python/errors.c M Python/pystate.c M Python/sysmodule.c diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index f292da1d3c6c5..29f6bf5a662dc 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -58,8 +58,7 @@ struct _ts { /* Borrowed reference to the current frame (it can be NULL) */ PyFrameObject *frame; int recursion_depth; - char overflowed; /* The stack has overflowed. Allow 50 more calls - to handle the runtime error. */ + int recursion_headroom; /* Allow 50 more calls to handle any errors. */ char recursion_critical; /* The current calls must not cause a stack overflow. */ int stackcheck_counter; diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 18c8f027af16e..e7ace9bd01c2a 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -90,24 +90,8 @@ static inline int _Py_EnterRecursiveCall_inline(const char *where) { #define Py_EnterRecursiveCall(where) _Py_EnterRecursiveCall_inline(where) -/* Compute the "lower-water mark" for a recursion limit. When - * Py_LeaveRecursiveCall() is called with a recursion depth below this mark, - * the overflowed flag is reset to 0. */ -static inline int _Py_RecursionLimitLowerWaterMark(int limit) { - if (limit > 200) { - return (limit - 50); - } - else { - return (3 * (limit >> 2)); - } -} - static inline void _Py_LeaveRecursiveCall(PyThreadState *tstate) { tstate->recursion_depth--; - int limit = tstate->interp->ceval.recursion_limit; - if (tstate->recursion_depth < _Py_RecursionLimitLowerWaterMark(limit)) { - tstate->overflowed = 0; - } } static inline void _Py_LeaveRecursiveCall_inline(void) { diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 8d125b57ad6d5..9c09bdc317dac 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1043,7 +1043,7 @@ def gen(): # tstate->recursion_depth is equal to (recursion_limit - 1) # and is equal to recursion_limit when _gen_throw() calls # PyErr_NormalizeException(). - recurse(setrecursionlimit(depth + 2) - depth - 1) + recurse(setrecursionlimit(depth + 2) - depth) finally: sys.setrecursionlimit(recursionlimit) print('Done.') @@ -1073,6 +1073,54 @@ def test_recursion_normalizing_infinite_exception(self): b'while normalizing an exception', err) self.assertIn(b'Done.', out) + + def test_recursion_in_except_handler(self): + + def set_relative_recursion_limit(n): + depth = 1 + while True: + try: + sys.setrecursionlimit(depth) + except RecursionError: + depth += 1 + else: + break + sys.setrecursionlimit(depth+n) + + def recurse_in_except(): + try: + 1/0 + except: + recurse_in_except() + + def recurse_after_except(): + try: + 1/0 + except: + pass + recurse_after_except() + + def recurse_in_body_and_except(): + try: + recurse_in_body_and_except() + except: + recurse_in_body_and_except() + + recursionlimit = sys.getrecursionlimit() + try: + set_relative_recursion_limit(10) + for func in (recurse_in_except, recurse_after_except, recurse_in_body_and_except): + with self.subTest(func=func): + try: + func() + except RecursionError: + pass + else: + self.fail("Should have raised a RecursionError") + finally: + sys.setrecursionlimit(recursionlimit) + + @cpython_only def test_recursion_normalizing_with_no_memory(self): # Issue #30697. Test that in the abort that occurs when there is no @@ -1109,7 +1157,7 @@ def raiseMemError(): except MemoryError as e: tb = e.__traceback__ else: - self.fail("Should have raises a MemoryError") + self.fail("Should have raised a MemoryError") return traceback.format_tb(tb) tb1 = raiseMemError() diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index d79151355eab1..fc6c1ef1acd7c 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -219,7 +219,7 @@ def test_recursionlimit_recovery(self): def f(): f() try: - for depth in (10, 25, 50, 75, 100, 250, 1000): + for depth in (50, 75, 100, 250, 1000): try: sys.setrecursionlimit(depth) except RecursionError: @@ -229,17 +229,17 @@ def f(): # Issue #5392: test stack overflow after hitting recursion # limit twice - self.assertRaises(RecursionError, f) - self.assertRaises(RecursionError, f) + with self.assertRaises(RecursionError): + f() + with self.assertRaises(RecursionError): + f() finally: sys.setrecursionlimit(oldlimit) @test.support.cpython_only def test_setrecursionlimit_recursion_depth(self): # Issue #25274: Setting a low recursion limit must be blocked if the - # current recursion depth is already higher than the "lower-water - # mark". Otherwise, it may not be possible anymore to - # reset the overflowed flag to 0. + # current recursion depth is already higher than limit. from _testinternalcapi import get_recursion_depth @@ -260,42 +260,10 @@ def set_recursion_limit_at_depth(depth, limit): sys.setrecursionlimit(1000) for limit in (10, 25, 50, 75, 100, 150, 200): - # formula extracted from _Py_RecursionLimitLowerWaterMark() - if limit > 200: - depth = limit - 50 - else: - depth = limit * 3 // 4 - set_recursion_limit_at_depth(depth, limit) + set_recursion_limit_at_depth(limit, limit) finally: sys.setrecursionlimit(oldlimit) - # The error message is specific to CPython - @test.support.cpython_only - def test_recursionlimit_fatalerror(self): - # A fatal error occurs if a second recursion limit is hit when recovering - # from a first one. - code = textwrap.dedent(""" - import sys - - def f(): - try: - f() - except RecursionError: - f() - - sys.setrecursionlimit(%d) - f()""") - with test.support.SuppressCrashReport(): - for i in (50, 1000): - sub = subprocess.Popen([sys.executable, '-c', code % i], - stderr=subprocess.PIPE) - err = sub.communicate()[1] - self.assertTrue(sub.returncode, sub.returncode) - self.assertIn( - b"Fatal Python error: _Py_CheckRecursiveCall: " - b"Cannot recover from stack overflow", - err) - def test_getwindowsversion(self): # Raise SkipTest if sys doesn't have getwindowsversion attribute test.support.get_attribute(sys, "getwindowsversion") diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-11-30-14-27-29.bpo-42500.excVKU.rst b/Misc/NEWS.d/next/Core and Builtins/2020-11-30-14-27-29.bpo-42500.excVKU.rst new file mode 100644 index 0000000000000..2462a8e1fabef --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-11-30-14-27-29.bpo-42500.excVKU.rst @@ -0,0 +1,2 @@ +Improve handling of exceptions near recursion limit. Converts a number of +Fatal Errors in RecursionErrors. diff --git a/Python/ceval.c b/Python/ceval.c index 91e879e804204..b7176dc0f6b8a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -793,23 +793,22 @@ _Py_CheckRecursiveCall(PyThreadState *tstate, const char *where) _Py_CheckRecursionLimit = recursion_limit; } #endif - if (tstate->recursion_critical) - /* Somebody asked that we don't check for recursion. */ - return 0; - if (tstate->overflowed) { + if (tstate->recursion_headroom) { if (tstate->recursion_depth > recursion_limit + 50) { /* Overflowing while handling an overflow. Give up. */ Py_FatalError("Cannot recover from stack overflow."); } - return 0; } - if (tstate->recursion_depth > recursion_limit) { - --tstate->recursion_depth; - tstate->overflowed = 1; - _PyErr_Format(tstate, PyExc_RecursionError, - "maximum recursion depth exceeded%s", - where); - return -1; + else { + if (tstate->recursion_depth > recursion_limit) { + tstate->recursion_headroom++; + _PyErr_Format(tstate, PyExc_RecursionError, + "maximum recursion depth exceeded%s", + where); + tstate->recursion_headroom--; + --tstate->recursion_depth; + return -1; + } } return 0; } diff --git a/Python/errors.c b/Python/errors.c index 87af39d527a51..d8c2d8b9236ed 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -290,12 +290,14 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, PyObject **val, PyObject **tb) { int recursion_depth = 0; + tstate->recursion_headroom++; PyObject *type, *value, *initial_tb; restart: type = *exc; if (type == NULL) { /* There was no exception, so nothing to do. */ + tstate->recursion_headroom--; return; } @@ -347,6 +349,7 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, } *exc = type; *val = value; + tstate->recursion_headroom--; return; error: diff --git a/Python/pystate.c b/Python/pystate.c index 9beefa8e20c44..71aac6f695d6e 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -576,7 +576,7 @@ new_threadstate(PyInterpreterState *interp, int init) tstate->frame = NULL; tstate->recursion_depth = 0; - tstate->overflowed = 0; + tstate->recursion_headroom = 0; tstate->recursion_critical = 0; tstate->stackcheck_counter = 0; tstate->tracing = 0; diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 3e4115fe8e1f9..4c7f7b67fa837 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1160,7 +1160,6 @@ static PyObject * sys_setrecursionlimit_impl(PyObject *module, int new_limit) /*[clinic end generated code: output=35e1c64754800ace input=b0f7a23393924af3]*/ { - int mark; PyThreadState *tstate = _PyThreadState_GET(); if (new_limit < 1) { @@ -1178,8 +1177,7 @@ sys_setrecursionlimit_impl(PyObject *module, int new_limit) Reject too low new limit if the current recursion depth is higher than the new low-water mark. Otherwise it may not be possible anymore to reset the overflowed flag to 0. */ - mark = _Py_RecursionLimitLowerWaterMark(new_limit); - if (tstate->recursion_depth >= mark) { + if (tstate->recursion_depth >= new_limit) { _PyErr_Format(tstate, PyExc_RecursionError, "cannot set the recursion limit to %i at " "the recursion depth %i: the limit is too low", From webhook-mailer at python.org Tue Mar 2 12:06:28 2021 From: webhook-mailer at python.org (zware) Date: Tue, 02 Mar 2021 17:06:28 -0000 Subject: [Python-checkins] bpo-43049: Use io.IncrementalNewlineDecoder for doctest newline conversion (GH-24359) Message-ID: https://github.com/python/cpython/commit/b36349a647b2bf8174f0e736a4fc347e92ae204e commit: b36349a647b2bf8174f0e736a4fc347e92ae204e branch: master author: Peter Donis committer: zware date: 2021-03-02T11:06:20-06:00 summary: bpo-43049: Use io.IncrementalNewlineDecoder for doctest newline conversion (GH-24359) Followup to bpo-1812 and GH-17385. files: M Lib/doctest.py diff --git a/Lib/doctest.py b/Lib/doctest.py index 5bb35c9715d1e..e95c333f48aad 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -102,7 +102,7 @@ def _test(): import sys import traceback import unittest -from io import StringIO +from io import StringIO, IncrementalNewlineDecoder from collections import namedtuple TestResults = namedtuple('TestResults', 'failed attempted') @@ -212,11 +212,8 @@ def _normalize_module(module, depth=2): raise TypeError("Expected a module, string, or None") def _newline_convert(data): - # We have two cases to cover and we need to make sure we do - # them in the right order - for newline in ('\r\n', '\r'): - data = data.replace(newline, '\n') - return data + # The IO module provides a handy decoder for universal newline conversion + return IncrementalNewlineDecoder(None, True).decode(data, True) def _load_testfile(filename, package, module_relative, encoding): if module_relative: From webhook-mailer at python.org Tue Mar 2 15:53:28 2021 From: webhook-mailer at python.org (orsenthil) Date: Tue, 02 Mar 2021 20:53:28 -0000 Subject: [Python-checkins] bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) Message-ID: https://github.com/python/cpython/commit/132131b404e06ee1a19b040a1f96cd1118abed0c commit: 132131b404e06ee1a19b040a1f96cd1118abed0c branch: master author: Winson Luk committer: orsenthil date: 2021-03-02T12:53:15-08:00 summary: bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) * Fail fast in shutil.move() to avoid creating destination directories on failure. Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst M Lib/shutil.py M Lib/test/test_shutil.py diff --git a/Lib/shutil.py b/Lib/shutil.py index f0e833dc979b7..89d924dec8aa4 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -813,6 +813,12 @@ def move(src, dst, copy_function=copy2): if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself" " '%s'." % (src, dst)) + if (_is_immutable(src) + or (not os.access(src, os.W_OK) and os.listdir(src) + and sys.platform == 'darwin')): + raise PermissionError("Cannot move the non-empty directory " + "'%s': Lacking write permission to '%s'." + % (src, src)) copytree(src, real_dst, copy_function=copy_function, symlinks=True) rmtree(src) @@ -830,6 +836,11 @@ def _destinsrc(src, dst): dst += os.path.sep return dst.startswith(src) +def _is_immutable(src): + st = _stat(src) + immutable_states = [stat.UF_IMMUTABLE, stat.SF_IMMUTABLE] + return hasattr(st, 'st_flags') and st.st_flags in immutable_states + def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index df8dcdcce6091..4bcad51509d9c 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -34,6 +34,8 @@ from test.support.os_helper import TESTFN, FakePath TESTFN2 = TESTFN + "2" +TESTFN_SRC = TESTFN + "_SRC" +TESTFN_DST = TESTFN + "_DST" MACOS = sys.platform.startswith("darwin") AIX = sys.platform[:3] == 'aix' try: @@ -2085,6 +2087,41 @@ def test_move_dir_caseinsensitive(self): os.rmdir(dst_dir) + @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0 + and hasattr(os, 'lchflags') + and hasattr(stat, 'SF_IMMUTABLE') + and hasattr(stat, 'UF_OPAQUE'), + 'root privileges required') + def test_move_dir_permission_denied(self): + # bpo-42782: shutil.move should not create destination directories + # if the source directory cannot be removed. + try: + os.mkdir(TESTFN_SRC) + os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE) + + # Testing on an empty immutable directory + # TESTFN_DST should not exist if shutil.move failed + self.assertRaises(PermissionError, shutil.move, TESTFN_SRC, TESTFN_DST) + self.assertFalse(TESTFN_DST in os.listdir()) + + # Create a file and keep the directory immutable + os.lchflags(TESTFN_SRC, stat.UF_OPAQUE) + os_helper.create_empty_file(os.path.join(TESTFN_SRC, 'child')) + os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE) + + # Testing on a non-empty immutable directory + # TESTFN_DST should not exist if shutil.move failed + self.assertRaises(PermissionError, shutil.move, TESTFN_SRC, TESTFN_DST) + self.assertFalse(TESTFN_DST in os.listdir()) + finally: + if os.path.exists(TESTFN_SRC): + os.lchflags(TESTFN_SRC, stat.UF_OPAQUE) + os_helper.rmtree(TESTFN_SRC) + if os.path.exists(TESTFN_DST): + os.lchflags(TESTFN_DST, stat.UF_OPAQUE) + os_helper.rmtree(TESTFN_DST) + + class TestCopyFile(unittest.TestCase): class Faux(object): diff --git a/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst new file mode 100644 index 0000000000000..065df9bf0cf42 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst @@ -0,0 +1,2 @@ +Fail fast in :func:`shutil.move()` to avoid creating destination directories on +failure. From webhook-mailer at python.org Tue Mar 2 19:20:26 2021 From: webhook-mailer at python.org (orsenthil) Date: Wed, 03 Mar 2021 00:20:26 -0000 Subject: [Python-checkins] bpo-42994: Add MIME types for opus, AAC, 3gpp and 3gpp2 (#24287) Message-ID: https://github.com/python/cpython/commit/3a87e562ea21a5083e9f168e02e8ec3e6611e167 commit: 3a87e562ea21a5083e9f168e02e8ec3e6611e167 branch: master author: Nathan Beals <850796+ndbeals at users.noreply.github.com> committer: orsenthil date: 2021-03-02T16:20:18-08:00 summary: bpo-42994: Add MIME types for opus, AAC, 3gpp and 3gpp2 (#24287) Co-authored-by: Nathan Beals files: A Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst M Lib/mimetypes.py diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index f3343c805452d..d2c8ac76dcc08 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -481,10 +481,19 @@ def _default_mime_types(): '.wsdl' : 'application/xml', '.xpdl' : 'application/xml', '.zip' : 'application/zip', + '.3gp' : 'audio/3gpp', + '.3gpp' : 'audio/3gpp', + '.3g2' : 'audio/3gpp2', + '.3gpp2' : 'audio/3gpp2', + '.aac' : 'audio/aac', + '.adts' : 'audio/aac', + '.loas' : 'audio/aac', + '.ass' : 'audio/aac', '.au' : 'audio/basic', '.snd' : 'audio/basic', '.mp3' : 'audio/mpeg', '.mp2' : 'audio/mpeg', + '.opus' : 'audio/opus', '.aif' : 'audio/x-aiff', '.aifc' : 'audio/x-aiff', '.aiff' : 'audio/x-aiff', diff --git a/Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst b/Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst new file mode 100644 index 0000000000000..40f854794215f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst @@ -0,0 +1 @@ +Add MIME types for opus, AAC, 3gpp and 3gpp2 From webhook-mailer at python.org Tue Mar 2 19:52:12 2021 From: webhook-mailer at python.org (gvanrossum) Date: Wed, 03 Mar 2021 00:52:12 -0000 Subject: [Python-checkins] Reorder contents of 3.10's What's New (#24687) Message-ID: https://github.com/python/cpython/commit/727a68b6e592eada5a65935de5c8428ef50e8741 commit: 727a68b6e592eada5a65935de5c8428ef50e8741 branch: master author: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com> committer: gvanrossum date: 2021-03-02T16:52:03-08:00 summary: Reorder contents of 3.10's What's New (#24687) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 49681cab4e523..edc99eb808e32 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -125,105 +125,48 @@ Check :pep:`617` for more details. in :issue:`12782` and :issue:`40334`.) -PEP 563: Postponed Evaluation of Annotations Becomes Default ------------------------------------------------------------- - -In Python 3.7, postponed evaluation of annotations was added, -to be enabled with a ``from __future__ import annotations`` -directive. In 3.10 this became the default behavior, even -without that future directive. With this being default, all -annotations stored in :attr:`__annotations__` will be strings. -If needed, annotations can be resolved at runtime using -:func:`typing.get_type_hints`. See :pep:`563` for a full -description. Also, the :func:`inspect.signature` will try to -resolve types from now on, and when it fails it will fall back to -showing the string annotations. (Contributed by Batuhan Taskaya -in :issue:`38605`.) - -* The :class:`int` type has a new method :meth:`int.bit_count`, returning the - number of ones in the binary expansion of a given integer, also known - as the population count. (Contributed by Niklas Fiekas in :issue:`29882`.) - -* The views returned by :meth:`dict.keys`, :meth:`dict.values` and - :meth:`dict.items` now all have a ``mapping`` attribute that gives a - :class:`types.MappingProxyType` object wrapping the original - dictionary. (Contributed by Dennis Sweeney in :issue:`40890`.) - -* :pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, used - to require that all the iterables have an equal length. - -PEP 613: TypeAlias Annotation ------------------------------ - -:pep:`484` introduced the concept of type aliases, only requiring them to be -top-level unannotated assignments. This simplicity sometimes made it difficult -for type checkers to distinguish between type aliases and ordinary assignments, -especially when forward references or invalid types were involved. Compare:: - - StrCache = 'Cache[str]' # a type alias - LOG_PREFIX = 'LOG[DEBUG]' # a module constant - -Now the :mod:`typing` module has a special annotation :data:`TypeAlias` to -declare type aliases more explicitly:: - - StrCache: TypeAlias = 'Cache[str]' # a type alias - LOG_PREFIX = 'LOG[DEBUG]' # a module constant - -See :pep:`613` for more details. - -(Contributed by Mikhail Golubev in :issue:`41923`.) - -PEP 604: New Type Union Operator --------------------------------- - -A new type union operator was introduced which enables the syntax ``X | Y``. -This provides a cleaner way of expressing 'either type X or type Y' instead of -using :data:`typing.Union`, especially in type hints (annotations). - -In previous versions of Python, to apply a type hint for functions accepting -arguments of multiple types, :data:`typing.Union` was used:: - - def square(number: Union[int, float]) -> Union[int, float]: - return number ** 2 +Better error messages in the parser +----------------------------------- +When parsing code that contains unclosed parentheses or brackets the interpreter +now includes the location of the unclosed bracket of parentheses instead of displaying +*SyntaxError: unexpected EOF while parsing* or pointing to some incorrect location. +For instance, consider the following code (notice the unclosed '{'): -Type hints can now be written in a more succinct manner:: +.. code-block:: python - def square(number: int | float) -> int | float: - return number ** 2 + expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4, + 38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6, + some_other_code = foo() +previous versions of the interpreter reported confusing places as the location of +the syntax error: -This new syntax is also accepted as the second argument to :func:`isinstance` -and :func:`issubclass`:: +.. code-block:: text - >>> isinstance(1, int | str) - True + File "example.py", line 3 + some_other_code = foo() + ^ + SyntaxError: invalid syntax -See :ref:`types-union` and :pep:`604` for more details. +but in Python3.10 a more informative error is emitted: -(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`.) +.. code-block:: text -PEP 612: Parameter Specification Variables ------------------------------------------- + File "example.py", line 1 + expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4, + ^ + SyntaxError: '{' was never closed -Two new options to improve the information provided to static type checkers for -:pep:`484`\ 's ``Callable`` have been added to the :mod:`typing` module. -The first is the parameter specification variable. They are used to forward the -parameter types of one callable to another callable -- a pattern commonly -found in higher order functions and decorators. Examples of usage can be found -in :class:`typing.ParamSpec`. Previously, there was no easy way to type annotate -dependency of parameter types in such a precise manner. +In a similar way, errors involving unclosed string literals (single and triple +quoted) now point to the start of the string instead of reporting EOF/EOL. -The second option is the new ``Concatenate`` operator. It's used in conjunction -with parameter specification variables to type annotate a higher order callable -which adds or removes parameters of another callable. Examples of usage can -be found in :class:`typing.Concatenate`. +These improvements are inspired by previous work in the PyPy interpreter. -See :class:`typing.Callable`, :class:`typing.ParamSpec`, -:class:`typing.Concatenate` and :pep:`612` for more details. +(Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in +:issue:`40176`.) -(Contributed by Ken Jin in :issue:`41559`.) PEP 634: Structural Pattern Matching ------------------------------------ @@ -500,57 +443,128 @@ Several other key features: For the full specification see :pep:`634`. Motivation and rationale are in :pep:`635`, and a longer tutorial is in :pep:`636`. -Better error messages in the parser ------------------------------------ -When parsing code that contains unclosed parentheses or brackets the interpreter -now includes the location of the unclosed bracket of parentheses instead of displaying -*SyntaxError: unexpected EOF while parsing* or pointing to some incorrect location. -For instance, consider the following code (notice the unclosed '{'): +New Features Related to Type Annotations +======================================== -.. code-block:: python +This section covers major changes affecting :pep:`484` type annotations and +the :mod:`typing` module. - expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4, - 38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6, - some_other_code = foo() -previous versions of the interpreter reported confusing places as the location of -the syntax error: +PEP 563: Postponed Evaluation of Annotations Becomes Default +------------------------------------------------------------ -.. code-block:: text +In Python 3.7, postponed evaluation of annotations was added, +to be enabled with a ``from __future__ import annotations`` +directive. In 3.10 this became the default behavior, even +without that future directive. With this being default, all +annotations stored in :attr:`__annotations__` will be strings. +If needed, annotations can be resolved at runtime using +:func:`typing.get_type_hints`. See :pep:`563` for a full +description. Also, the :func:`inspect.signature` will try to +resolve types from now on, and when it fails it will fall back to +showing the string annotations. (Contributed by Batuhan Taskaya +in :issue:`38605`.) - File "example.py", line 3 - some_other_code = foo() - ^ - SyntaxError: invalid syntax -but in Python3.10 a more informative error is emitted: +PEP 604: New Type Union Operator +-------------------------------- -.. code-block:: text +A new type union operator was introduced which enables the syntax ``X | Y``. +This provides a cleaner way of expressing 'either type X or type Y' instead of +using :data:`typing.Union`, especially in type hints (annotations). - File "example.py", line 1 - expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4, - ^ - SyntaxError: '{' was never closed +In previous versions of Python, to apply a type hint for functions accepting +arguments of multiple types, :data:`typing.Union` was used:: + def square(number: Union[int, float]) -> Union[int, float]: + return number ** 2 -In a similar way, errors involving unclosed string literals (single and triple -quoted) now point to the start of the string instead of reporting EOF/EOL. -These improvements are inspired by previous work in the PyPy interpreter. +Type hints can now be written in a more succinct manner:: + + def square(number: int | float) -> int | float: + return number ** 2 + + +This new syntax is also accepted as the second argument to :func:`isinstance` +and :func:`issubclass`:: + + >>> isinstance(1, int | str) + True + +See :ref:`types-union` and :pep:`604` for more details. + +(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`.) + + +PEP 612: Parameter Specification Variables +------------------------------------------ + +Two new options to improve the information provided to static type checkers for +:pep:`484`\ 's ``Callable`` have been added to the :mod:`typing` module. + +The first is the parameter specification variable. They are used to forward the +parameter types of one callable to another callable -- a pattern commonly +found in higher order functions and decorators. Examples of usage can be found +in :class:`typing.ParamSpec`. Previously, there was no easy way to type annotate +dependency of parameter types in such a precise manner. + +The second option is the new ``Concatenate`` operator. It's used in conjunction +with parameter specification variables to type annotate a higher order callable +which adds or removes parameters of another callable. Examples of usage can +be found in :class:`typing.Concatenate`. + +See :class:`typing.Callable`, :class:`typing.ParamSpec`, +:class:`typing.Concatenate` and :pep:`612` for more details. + +(Contributed by Ken Jin in :issue:`41559`.) + + +PEP 613: TypeAlias Annotation +----------------------------- + +:pep:`484` introduced the concept of type aliases, only requiring them to be +top-level unannotated assignments. This simplicity sometimes made it difficult +for type checkers to distinguish between type aliases and ordinary assignments, +especially when forward references or invalid types were involved. Compare:: + + StrCache = 'Cache[str]' # a type alias + LOG_PREFIX = 'LOG[DEBUG]' # a module constant + +Now the :mod:`typing` module has a special annotation :data:`TypeAlias` to +declare type aliases more explicitly:: + + StrCache: TypeAlias = 'Cache[str]' # a type alias + LOG_PREFIX = 'LOG[DEBUG]' # a module constant + +See :pep:`613` for more details. + +(Contributed by Mikhail Golubev in :issue:`41923`.) -(Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in -:issue:`40176`.) Other Language Changes ====================== +* The :class:`int` type has a new method :meth:`int.bit_count`, returning the + number of ones in the binary expansion of a given integer, also known + as the population count. (Contributed by Niklas Fiekas in :issue:`29882`.) + +* The views returned by :meth:`dict.keys`, :meth:`dict.values` and + :meth:`dict.items` now all have a ``mapping`` attribute that gives a + :class:`types.MappingProxyType` object wrapping the original + dictionary. (Contributed by Dennis Sweeney in :issue:`40890`.) + +* :pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, used + to require that all the iterables have an equal length. + * Builtin and extension functions that take integer arguments no longer accept :class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\ s and other objects that can be converted to integers only with a loss (e.g. that have the :meth:`~object.__int__` method but do not have the :meth:`~object.__index__` method). (Contributed by Serhiy Storchaka in :issue:`37999`.) + * If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator will correctly fall back to :func:`object.__pow__` and :func:`object.__rpow__` as expected. (Contributed by Alex Shkop in :issue:`38302`.) @@ -800,6 +814,8 @@ of types readily interpretable by type checkers. typing ------ +For major changes, see `New Features Related to Type Annotations`_. + The behavior of :class:`typing.Literal` was changed to conform with :pep:`586` and to match the behavior of static type checkers specified in the PEP. From webhook-mailer at python.org Wed Mar 3 02:04:16 2021 From: webhook-mailer at python.org (nascheme) Date: Wed, 03 Mar 2021 07:04:16 -0000 Subject: [Python-checkins] Pin test runner to Ubuntu 18 to un-break CI (#24715) Message-ID: https://github.com/python/cpython/commit/94894dd45e4bad6efb27eac4497b24cdc18b3e2d commit: 94894dd45e4bad6efb27eac4497b24cdc18b3e2d branch: master author: Brandt Bucher committer: nascheme date: 2021-03-02T23:03:55-08:00 summary: Pin test runner to Ubuntu 18 to un-break CI (#24715) files: M .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c674c5d606c54..ef54865ed964c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,7 +127,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: From webhook-mailer at python.org Wed Mar 3 04:56:44 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 03 Mar 2021 09:56:44 -0000 Subject: [Python-checkins] Pin test runner to Ubuntu 18 to un-break CI (GH-24715) Message-ID: https://github.com/python/cpython/commit/024325db5849c2cf1aa3b4c1013f73549712904e commit: 024325db5849c2cf1aa3b4c1013f73549712904e branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-03T01:56:36-08:00 summary: Pin test runner to Ubuntu 18 to un-break CI (GH-24715) (cherry picked from commit 94894dd45e4bad6efb27eac4497b24cdc18b3e2d) Co-authored-by: Brandt Bucher files: M .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07369ecad27cc..01370954feaae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,7 +121,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: From webhook-mailer at python.org Wed Mar 3 04:56:45 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 03 Mar 2021 09:56:45 -0000 Subject: [Python-checkins] [3.8] Pin test runner to Ubuntu 18 to un-break CI (GH-24715) (GH-24717) Message-ID: https://github.com/python/cpython/commit/9c6c5da55f4b9f4e5dde33d10adaf3d7ee824c11 commit: 9c6c5da55f4b9f4e5dde33d10adaf3d7ee824c11 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-03T01:56:41-08:00 summary: [3.8] Pin test runner to Ubuntu 18 to un-break CI (GH-24715) (GH-24717) (cherry picked from commit 94894dd45e4bad6efb27eac4497b24cdc18b3e2d) Co-authored-by: Brandt Bucher Automerge-Triggered-By: GH:tiran files: M .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 669c541dd4f49..5822428e34a86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: From webhook-mailer at python.org Wed Mar 3 05:32:47 2021 From: webhook-mailer at python.org (JulienPalard) Date: Wed, 03 Mar 2021 10:32:47 -0000 Subject: [Python-checkins] Doc: typo fix. (GH-24721) Message-ID: https://github.com/python/cpython/commit/b04f1cb9df7ad93366ef0ef7d8088effc576c5ae commit: b04f1cb9df7ad93366ef0ef7d8088effc576c5ae branch: master author: Julien Palard committer: JulienPalard date: 2021-03-03T11:32:12+01:00 summary: Doc: typo fix. (GH-24721) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index edc99eb808e32..ae76243bafb7c 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -280,8 +280,8 @@ Without the use of ``_`` in a case statement, a match may not exist. If no match exists, the behavior is a no-op. For example, if ``status`` of 500 is passed, a no-op occurs. -Pattterns with a literal and variable -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Patterns with a literal and variable +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patterns can look like unpacking assignments, and a pattern may be used to bind variables. In this example, a data point can be unpacked to its x-coordinate From webhook-mailer at python.org Wed Mar 3 09:00:08 2021 From: webhook-mailer at python.org (JulienPalard) Date: Wed, 03 Mar 2021 14:00:08 -0000 Subject: [Python-checkins] missing multiply symbol in the documentation (GH-24686) Message-ID: https://github.com/python/cpython/commit/09605ad7269c8d9828fa3c175ad7c9efe8d12762 commit: 09605ad7269c8d9828fa3c175ad7c9efe8d12762 branch: master author: Alperen Serkan Aks?z <61659936+Sekomer at users.noreply.github.com> committer: JulienPalard date: 2021-03-03T14:59:52+01:00 summary: missing multiply symbol in the documentation (GH-24686) files: M Modules/mathmodule.c diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index d0df58c63e110..d0dd12d25966a 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -1875,7 +1875,7 @@ math_isqrt(PyObject *module, PyObject *n) * (1) * * (1) * * (1 * 3 * 5) * - * (1 * 3 * 5 * 7 * 9) + * (1 * 3 * 5 * 7 * 9) * * (1 * 3 * 5 * 7 * 9 * 11 * 13 * 15 * 17 * 19) * * Here i goes from large to small: the first term corresponds to i=4 (any From webhook-mailer at python.org Wed Mar 3 09:16:31 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Wed, 03 Mar 2021 14:16:31 -0000 Subject: [Python-checkins] bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706) Message-ID: https://github.com/python/cpython/commit/3b4b2cf418707c79f96689e401e3c703c0fdd4d2 commit: 3b4b2cf418707c79f96689e401e3c703c0fdd4d2 branch: master author: Mariusz Felisiak committer: berkerpeksag date: 2021-03-03T16:16:24+02:00 summary: bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706) Regression introduced in 47feb1feb28631b6647699b7633109aa85340966. files: A Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst M Lib/sqlite3/test/regression.py M Modules/_sqlite/cursor.c diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py index c8e0b27564ad1..417a53109c87c 100644 --- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -409,6 +409,10 @@ def log(self, *args): self.con.execute("select 1") # trigger seg fault method(None) + def test_return_empty_bytestring(self): + cur = self.con.execute("select X''") + val = cur.fetchone()[0] + self.assertEqual(val, b'') def suite(): diff --git a/Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst b/Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst new file mode 100644 index 0000000000000..f9a4aa2935e3f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst @@ -0,0 +1,2 @@ +Fix a regression introduced in GH-24562, where an empty bytestring was fetched +as ``None`` instead of ``b''`` in :mod:`sqlite3`. Patch by Mariusz Felisiak. diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 23ab7451fdaa0..764eec5fbcac6 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -333,12 +333,8 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self) } else { /* coltype == SQLITE_BLOB */ const char *blob = sqlite3_column_blob(self->statement->st, i); - if (!blob) { - converted = Py_NewRef(Py_None); - } else { - nbytes = sqlite3_column_bytes(self->statement->st, i); - converted = PyBytes_FromStringAndSize(blob, nbytes); - } + nbytes = sqlite3_column_bytes(self->statement->st, i); + converted = PyBytes_FromStringAndSize(blob, nbytes); } } From webhook-mailer at python.org Wed Mar 3 10:37:30 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 03 Mar 2021 15:37:30 -0000 Subject: [Python-checkins] bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) Message-ID: https://github.com/python/cpython/commit/59e857650cf49a5e28cb82acc2641b1b53efeeeb commit: 59e857650cf49a5e28cb82acc2641b1b53efeeeb branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-03T07:37:20-08:00 summary: bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) * Fail fast in shutil.move() to avoid creating destination directories on failure. Co-authored-by: Zackery Spytz (cherry picked from commit 132131b404e06ee1a19b040a1f96cd1118abed0c) Co-authored-by: Winson Luk files: A Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst M Lib/shutil.py M Lib/test/test_shutil.py diff --git a/Lib/shutil.py b/Lib/shutil.py index 6986bce8aaee2..fdadb838000c7 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -798,6 +798,12 @@ def move(src, dst, copy_function=copy2): if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself" " '%s'." % (src, dst)) + if (_is_immutable(src) + or (not os.access(src, os.W_OK) and os.listdir(src) + and sys.platform == 'darwin')): + raise PermissionError("Cannot move the non-empty directory " + "'%s': Lacking write permission to '%s'." + % (src, src)) copytree(src, real_dst, copy_function=copy_function, symlinks=True) rmtree(src) @@ -815,6 +821,11 @@ def _destinsrc(src, dst): dst += os.path.sep return dst.startswith(src) +def _is_immutable(src): + st = _stat(src) + immutable_states = [stat.UF_IMMUTABLE, stat.SF_IMMUTABLE] + return hasattr(st, 'st_flags') and st.st_flags in immutable_states + def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 77306170d9fc1..37940c8dcf71f 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -33,6 +33,8 @@ from test.support import TESTFN, FakePath TESTFN2 = TESTFN + "2" +TESTFN_SRC = TESTFN + "_SRC" +TESTFN_DST = TESTFN + "_DST" MACOS = sys.platform.startswith("darwin") AIX = sys.platform[:3] == 'aix' try: @@ -2053,6 +2055,41 @@ def _copy(src, dst): self.assertEqual(len(moved), 3) + @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0 + and hasattr(os, 'lchflags') + and hasattr(stat, 'SF_IMMUTABLE') + and hasattr(stat, 'UF_OPAQUE'), + 'root privileges required') + def test_move_dir_permission_denied(self): + # bpo-42782: shutil.move should not create destination directories + # if the source directory cannot be removed. + try: + os.mkdir(TESTFN_SRC) + os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE) + + # Testing on an empty immutable directory + # TESTFN_DST should not exist if shutil.move failed + self.assertRaises(PermissionError, shutil.move, TESTFN_SRC, TESTFN_DST) + self.assertFalse(TESTFN_DST in os.listdir()) + + # Create a file and keep the directory immutable + os.lchflags(TESTFN_SRC, stat.UF_OPAQUE) + os_helper.create_empty_file(os.path.join(TESTFN_SRC, 'child')) + os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE) + + # Testing on a non-empty immutable directory + # TESTFN_DST should not exist if shutil.move failed + self.assertRaises(PermissionError, shutil.move, TESTFN_SRC, TESTFN_DST) + self.assertFalse(TESTFN_DST in os.listdir()) + finally: + if os.path.exists(TESTFN_SRC): + os.lchflags(TESTFN_SRC, stat.UF_OPAQUE) + os_helper.rmtree(TESTFN_SRC) + if os.path.exists(TESTFN_DST): + os.lchflags(TESTFN_DST, stat.UF_OPAQUE) + os_helper.rmtree(TESTFN_DST) + + class TestCopyFile(unittest.TestCase): _delete = False diff --git a/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst new file mode 100644 index 0000000000000..065df9bf0cf42 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst @@ -0,0 +1,2 @@ +Fail fast in :func:`shutil.move()` to avoid creating destination directories on +failure. From webhook-mailer at python.org Wed Mar 3 11:04:09 2021 From: webhook-mailer at python.org (orsenthil) Date: Wed, 03 Mar 2021 16:04:09 -0000 Subject: [Python-checkins] [3.9] bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) (#24725) Message-ID: https://github.com/python/cpython/commit/bf566847f5a97e6ce391f8fb94185ee756cb94a2 commit: bf566847f5a97e6ce391f8fb94185ee756cb94a2 branch: 3.9 author: Senthil Kumaran committer: orsenthil date: 2021-03-03T08:04:00-08:00 summary: [3.9] bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) (#24725) * Fail fast in shutil.move() to avoid creating destination directories on failure. Co-authored-by: Zackery Spytz (cherry picked from commit 132131b404e06ee1a19b040a1f96cd1118abed0c) Co-authored-by: Winson Luk Co-authored-by: Winson Luk files: A Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst M Lib/shutil.py M Lib/test/test_shutil.py diff --git a/Lib/shutil.py b/Lib/shutil.py index f0e833dc979b7..89d924dec8aa4 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -813,6 +813,12 @@ def move(src, dst, copy_function=copy2): if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself" " '%s'." % (src, dst)) + if (_is_immutable(src) + or (not os.access(src, os.W_OK) and os.listdir(src) + and sys.platform == 'darwin')): + raise PermissionError("Cannot move the non-empty directory " + "'%s': Lacking write permission to '%s'." + % (src, src)) copytree(src, real_dst, copy_function=copy_function, symlinks=True) rmtree(src) @@ -830,6 +836,11 @@ def _destinsrc(src, dst): dst += os.path.sep return dst.startswith(src) +def _is_immutable(src): + st = _stat(src) + immutable_states = [stat.UF_IMMUTABLE, stat.SF_IMMUTABLE] + return hasattr(st, 'st_flags') and st.st_flags in immutable_states + def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index e19af64be0e1a..e378033acd35a 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -33,6 +33,8 @@ from test.support import TESTFN, FakePath TESTFN2 = TESTFN + "2" +TESTFN_SRC = TESTFN + "_SRC" +TESTFN_DST = TESTFN + "_DST" MACOS = sys.platform.startswith("darwin") AIX = sys.platform[:3] == 'aix' try: @@ -2083,6 +2085,41 @@ def test_move_dir_caseinsensitive(self): os.rmdir(dst_dir) + @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0 + and hasattr(os, 'lchflags') + and hasattr(stat, 'SF_IMMUTABLE') + and hasattr(stat, 'UF_OPAQUE'), + 'root privileges required') + def test_move_dir_permission_denied(self): + # bpo-42782: shutil.move should not create destination directories + # if the source directory cannot be removed. + try: + os.mkdir(TESTFN_SRC) + os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE) + + # Testing on an empty immutable directory + # TESTFN_DST should not exist if shutil.move failed + self.assertRaises(PermissionError, shutil.move, TESTFN_SRC, TESTFN_DST) + self.assertFalse(TESTFN_DST in os.listdir()) + + # Create a file and keep the directory immutable + os.lchflags(TESTFN_SRC, stat.UF_OPAQUE) + os_helper.create_empty_file(os.path.join(TESTFN_SRC, 'child')) + os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE) + + # Testing on a non-empty immutable directory + # TESTFN_DST should not exist if shutil.move failed + self.assertRaises(PermissionError, shutil.move, TESTFN_SRC, TESTFN_DST) + self.assertFalse(TESTFN_DST in os.listdir()) + finally: + if os.path.exists(TESTFN_SRC): + os.lchflags(TESTFN_SRC, stat.UF_OPAQUE) + os_helper.rmtree(TESTFN_SRC) + if os.path.exists(TESTFN_DST): + os.lchflags(TESTFN_DST, stat.UF_OPAQUE) + os_helper.rmtree(TESTFN_DST) + + class TestCopyFile(unittest.TestCase): class Faux(object): diff --git a/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst new file mode 100644 index 0000000000000..065df9bf0cf42 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst @@ -0,0 +1,2 @@ +Fail fast in :func:`shutil.move()` to avoid creating destination directories on +failure. From webhook-mailer at python.org Wed Mar 3 11:59:07 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 03 Mar 2021 16:59:07 -0000 Subject: [Python-checkins] bpo-43295: Fix error handling of datetime.strptime format string '%z' (GH-24627) Message-ID: https://github.com/python/cpython/commit/04f6fbb6969e9860783b9ab4dc24b6fe3c6dab8d commit: 04f6fbb6969e9860783b9ab4dc24b6fe3c6dab8d branch: master author: Noor Michael committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-03T08:58:57-08:00 summary: bpo-43295: Fix error handling of datetime.strptime format string '%z' (GH-24627) Previously, `datetime.strptime` would match `'z'` with the format string `'%z'` (for UTC offsets), throwing an `IndexError` by erroneously trying to parse `'z'` as a timestamp. As a special case, `'%z'` matches the string `'Z'` which is equivalent to the offset `'+00:00'`, however this behavior is not defined for lowercase `'z'`. This change ensures a `ValueError` is thrown when encountering the original example, as follows: ``` >>> from datetime import datetime >>> datetime.strptime('z', '%z') ValueError: time data 'z' does not match format '%z' ``` Automerge-Triggered-By: GH:pganssle files: A Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst M Lib/_strptime.py M Lib/test/datetimetester.py diff --git a/Lib/_strptime.py b/Lib/_strptime.py index 5df37f5f4b89d..b97dfcce1e8e4 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -201,7 +201,7 @@ def __init__(self, locale_time=None): #XXX: Does 'Y' need to worry about having less or more than # 4 digits? 'Y': r"(?P\d\d\d\d)", - 'z': r"(?P[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)", + 'z': r"(?P[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|(?-i:Z))", 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 775d3151ae290..316cf0b8da7b4 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -2609,6 +2609,7 @@ def test_strptime(self): with self.assertRaises(ValueError): strptime("-2400", "%z") with self.assertRaises(ValueError): strptime("-000", "%z") + with self.assertRaises(ValueError): strptime("z", "%z") def test_strptime_single_digit(self): # bpo-34903: Check that single digit dates and times are allowed. diff --git a/Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst b/Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst new file mode 100644 index 0000000000000..ac9a5c96c9ced --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst @@ -0,0 +1,2 @@ +:meth:`datetime.datetime.strptime` now raises ``ValueError`` instead of +``IndexError`` when matching ``'z'`` with the ``%z`` format specifier. From webhook-mailer at python.org Wed Mar 3 12:24:13 2021 From: webhook-mailer at python.org (ned-deily) Date: Wed, 03 Mar 2021 17:24:13 -0000 Subject: [Python-checkins] Pin test runner to Ubuntu 18 to un-break CI (GH-24715) (GH-24716) Message-ID: https://github.com/python/cpython/commit/a99860e4022c386df6e51fcc7741b0aeba25d687 commit: a99860e4022c386df6e51fcc7741b0aeba25d687 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ned-deily date: 2021-03-03T12:24:05-05:00 summary: Pin test runner to Ubuntu 18 to un-break CI (GH-24715) (GH-24716) (cherry picked from commit 94894dd45e4bad6efb27eac4497b24cdc18b3e2d) Co-authored-by: Brandt Bucher Co-authored-by: Brandt Bucher files: M .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3d4b7bab9cdd..e60d315de48c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: From webhook-mailer at python.org Wed Mar 3 12:54:38 2021 From: webhook-mailer at python.org (ethanfurman) Date: Wed, 03 Mar 2021 17:54:38 -0000 Subject: [Python-checkins] bpo-43162: [Enum] update docs, renable doc tests (GH-24487) Message-ID: https://github.com/python/cpython/commit/44e580f448016b86807465a186d03d9074e2b589 commit: 44e580f448016b86807465a186d03d9074e2b589 branch: master author: Ethan Furman committer: ethanfurman date: 2021-03-03T09:54:30-08:00 summary: bpo-43162: [Enum] update docs, renable doc tests (GH-24487) * update docs, renable doc tests * make deprecation warning active for two releases files: M Doc/library/enum.rst M Lib/enum.py M Lib/test/test_enum.py diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index b7f269464e794..73b77cbc671cd 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -1222,17 +1222,18 @@ Private names are not converted to Enum members, but remain normal attributes. :class:`Enum` members are instances of their :class:`Enum` class, and are normally accessed as ``EnumClass.member``. In Python versions ``3.5`` to ``3.9`` you could access members from other members -- this practice was -discouraged, and in ``3.10`` :class:`Enum` has returned to not allowing it:: +discouraged, and in ``3.12`` :class:`Enum` will return to not allowing it, +while in ``3.10`` and ``3.11`` it will raise a :exc:`DeprecationWarning`:: >>> class FieldTypes(Enum): ... name = 0 ... value = 1 ... size = 2 ... - >>> FieldTypes.value.size - Traceback (most recent call last): - ... - AttributeError: FieldTypes: no attribute 'size' + >>> FieldTypes.value.size # doctest: +SKIP + DeprecationWarning: accessing one member from another is not supported, + and will be disabled in 3.12 + .. versionchanged:: 3.5 .. versionchanged:: 3.10 diff --git a/Lib/enum.py b/Lib/enum.py index 55299c5788244..84c7b0dc2afbe 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -148,7 +148,7 @@ def __get__(self, instance, ownerclass=None): import warnings warnings.warn( "accessing one member from another is not supported, " - " and will be disabled in 3.11", + " and will be disabled in 3.12", DeprecationWarning, stacklevel=2, ) diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 3982d1d643043..69392e01faacd 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -18,7 +18,7 @@ def load_tests(loader, tests, ignore): tests.addTests(doctest.DocTestSuite(enum)) - if os.path.exists('../../Doc/library/enum.rst'): + if os.path.exists('Doc/library/enum.rst'): tests.addTests(doctest.DocFileSuite( '../../Doc/library/enum.rst', optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE, @@ -2186,7 +2186,7 @@ class Private(Enum): self.assertEqual(Private._Private__major_, 'Hoolihan') @unittest.skipUnless( - sys.version_info[:2] == (3, 10), + sys.version_info[:2] < (3, 12), 'member-member access now raises an exception', ) def test_warning_for_member_from_member_access(self): @@ -2198,7 +2198,7 @@ class Di(Enum): self.assertIs(Di.NO, nope) @unittest.skipUnless( - sys.version_info[:2] > (3, 10), + sys.version_info[:2] >= (3, 12), 'member-member access currently issues a warning', ) def test_exception_for_member_from_member_access(self): From webhook-mailer at python.org Wed Mar 3 13:25:48 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 03 Mar 2021 18:25:48 -0000 Subject: [Python-checkins] Add an attribution to the Green Tree Snakes in the AST docs (GH-24727) Message-ID: https://github.com/python/cpython/commit/62e3b6370cf9aa990485d9c7c3ea3f6f150daa47 commit: 62e3b6370cf9aa990485d9c7c3ea3f6f150daa47 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-03T18:25:41Z summary: Add an attribution to the Green Tree Snakes in the AST docs (GH-24727) files: M Doc/library/ast.rst diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index aaedfbe1b9c01..b5e1be8269115 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -140,6 +140,11 @@ Node classes In the meantime, instantiating them will return an instance of a different class. +.. note:: + The descriptions of the specific node classes displayed here + were initially adapted from the fantastic `Green Tree + Snakes `__ project and + all its contributors. Literals ^^^^^^^^ From webhook-mailer at python.org Wed Mar 3 13:49:05 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 03 Mar 2021 18:49:05 -0000 Subject: [Python-checkins] Add an attribution to the Green Tree Snakes in the AST docs (GH-24727) Message-ID: https://github.com/python/cpython/commit/ff6a021c25ef9147b8a4c8b3458a085a67959e01 commit: ff6a021c25ef9147b8a4c8b3458a085a67959e01 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-03T10:48:56-08:00 summary: Add an attribution to the Green Tree Snakes in the AST docs (GH-24727) (cherry picked from commit 62e3b6370cf9aa990485d9c7c3ea3f6f150daa47) Co-authored-by: Pablo Galindo files: M Doc/library/ast.rst diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 95cb017d145ca..d13c7ef63850a 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -139,6 +139,11 @@ Node classes In the meantime, instantiating them will return an instance of a different class. +.. note:: + The descriptions of the specific node classes displayed here + were initially adapted from the fantastic `Green Tree + Snakes `__ project and + all its contributors. Literals ^^^^^^^^ From webhook-mailer at python.org Wed Mar 3 15:36:31 2021 From: webhook-mailer at python.org (gpshead) Date: Wed, 03 Mar 2021 20:36:31 -0000 Subject: [Python-checkins] bpo-40701: tempfile mixes str and bytes in an inconsistent manner (GH-20442) Message-ID: https://github.com/python/cpython/commit/9c7927400cd8f1d283bf7915b6b33fea81b8655d commit: 9c7927400cd8f1d283bf7915b6b33fea81b8655d branch: master author: Eric L committer: gpshead date: 2021-03-03T12:36:22-08:00 summary: bpo-40701: tempfile mixes str and bytes in an inconsistent manner (GH-20442) The case of tempfile.tempdir variable being bytes is now handled consistently. The getters return the right type and no more error of mixing str and bytes unless explicitly caused by the user. Adds a regression test. Expands the documentation to clarify the behavior. Co-authored-by: Eric L Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst M Doc/library/tempfile.rst M Lib/tempfile.py M Lib/test/test_tempfile.py diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index f9421da5fe7df..2b8a35e2651e7 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -248,6 +248,11 @@ The module defines the following user-callable items: The result of this search is cached, see the description of :data:`tempdir` below. + .. versionchanged:: 3.10 + + Always returns a str. Previously it would return any :data:`tempdir` + value regardless of type so long as it was not ``None``. + .. function:: gettempdirb() Same as :func:`gettempdir` but the return value is in bytes. @@ -269,18 +274,30 @@ The module uses a global variable to store the name of the directory used for temporary files returned by :func:`gettempdir`. It can be set directly to override the selection process, but this is discouraged. All functions in this module take a *dir* argument which can be used -to specify the directory and this is the recommended approach. +to specify the directory. This is the recommended approach that does +not surprise other unsuspecting code by changing global API behavior. .. data:: tempdir When set to a value other than ``None``, this variable defines the default value for the *dir* argument to the functions defined in this - module. + module, including its type, bytes or str. It cannot be a + :term:`path-like object`. If ``tempdir`` is ``None`` (the default) at any call to any of the above functions except :func:`gettempprefix` it is initialized following the algorithm described in :func:`gettempdir`. + .. note:: + + Beware that if you set ``tempdir`` to a bytes value, there is a + nasty side effect: The global default return type of + :func:`mkstemp` and :func:`mkdtemp` changes to bytes when no + explicit ``prefix``, ``suffix``, or ``dir`` arguments of type + str are supplied. Please do not write code expecting or + depending on this. This awkward behavior is maintained for + compatibility with the historcal implementation. + .. _tempfile-examples: Examples diff --git a/Lib/tempfile.py b/Lib/tempfile.py index c3fe61aa0af4f..dc088d9d7e448 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -99,7 +99,11 @@ def _infer_return_type(*args): "path components.") return_type = str if return_type is None: - return str # tempfile APIs return a str by default. + if tempdir is None or isinstance(tempdir, str): + return str # tempfile APIs return a str by default. + else: + # we could check for bytes but it'll fail later on anyway + return bytes return return_type @@ -265,17 +269,17 @@ def _mkstemp_inner(dir, pre, suf, flags, output_type): # User visible interfaces. def gettempprefix(): - """The default prefix for temporary directories.""" - return template + """The default prefix for temporary directories as string.""" + return _os.fsdecode(template) def gettempprefixb(): """The default prefix for temporary directories as bytes.""" - return _os.fsencode(gettempprefix()) + return _os.fsencode(template) tempdir = None -def gettempdir(): - """Accessor for tempfile.tempdir.""" +def _gettempdir(): + """Private accessor for tempfile.tempdir.""" global tempdir if tempdir is None: _once_lock.acquire() @@ -286,9 +290,13 @@ def gettempdir(): _once_lock.release() return tempdir +def gettempdir(): + """Returns tempfile.tempdir as str.""" + return _os.fsdecode(_gettempdir()) + def gettempdirb(): - """A bytes version of tempfile.gettempdir().""" - return _os.fsencode(gettempdir()) + """Returns tempfile.tempdir as bytes.""" + return _os.fsencode(_gettempdir()) def mkstemp(suffix=None, prefix=None, dir=None, text=False): """User-callable function to create and return a unique temporary diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 77d710efaf107..5822c7535e378 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -667,6 +667,37 @@ def test_choose_directory(self): finally: os.rmdir(dir) + def test_for_tempdir_is_bytes_issue40701_api_warts(self): + orig_tempdir = tempfile.tempdir + self.assertIsInstance(tempfile.tempdir, (str, type(None))) + try: + fd, path = tempfile.mkstemp() + os.close(fd) + os.unlink(path) + self.assertIsInstance(path, str) + tempfile.tempdir = tempfile.gettempdirb() + self.assertIsInstance(tempfile.tempdir, bytes) + self.assertIsInstance(tempfile.gettempdir(), str) + self.assertIsInstance(tempfile.gettempdirb(), bytes) + fd, path = tempfile.mkstemp() + os.close(fd) + os.unlink(path) + self.assertIsInstance(path, bytes) + fd, path = tempfile.mkstemp(suffix='.txt') + os.close(fd) + os.unlink(path) + self.assertIsInstance(path, str) + fd, path = tempfile.mkstemp(prefix='test-temp-') + os.close(fd) + os.unlink(path) + self.assertIsInstance(path, str) + fd, path = tempfile.mkstemp(dir=tempfile.gettempdir()) + os.close(fd) + os.unlink(path) + self.assertIsInstance(path, str) + finally: + tempfile.tempdir = orig_tempdir + class TestMkdtemp(TestBadTempdir, BaseTestCase): """Test mkdtemp().""" @@ -775,6 +806,32 @@ def test_collision_with_existing_directory(self): dir2 = tempfile.mkdtemp() self.assertTrue(dir2.endswith('bbb')) + def test_for_tempdir_is_bytes_issue40701_api_warts(self): + orig_tempdir = tempfile.tempdir + self.assertIsInstance(tempfile.tempdir, (str, type(None))) + try: + path = tempfile.mkdtemp() + os.rmdir(path) + self.assertIsInstance(path, str) + tempfile.tempdir = tempfile.gettempdirb() + self.assertIsInstance(tempfile.tempdir, bytes) + self.assertIsInstance(tempfile.gettempdir(), str) + self.assertIsInstance(tempfile.gettempdirb(), bytes) + path = tempfile.mkdtemp() + os.rmdir(path) + self.assertIsInstance(path, bytes) + path = tempfile.mkdtemp(suffix='-dir') + os.rmdir(path) + self.assertIsInstance(path, str) + path = tempfile.mkdtemp(prefix='test-mkdtemp-') + os.rmdir(path) + self.assertIsInstance(path, str) + path = tempfile.mkdtemp(dir=tempfile.gettempdir()) + os.rmdir(path) + self.assertIsInstance(path, str) + finally: + tempfile.tempdir = orig_tempdir + class TestMktemp(BaseTestCase): """Test mktemp().""" diff --git a/Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst b/Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst new file mode 100644 index 0000000000000..a7a4a1ce999af --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst @@ -0,0 +1,6 @@ +When the :data:`tempfile.tempdir` global variable is set to a value of +type bytes, it is now handled consistently. Previously exceptions +could be raised from some tempfile APIs when the directory did not +already exist in this situation. Also ensures that the +:func:`tempfile.gettempdir()` and :func:`tempfile.gettempdirb()` +functions *always* return ``str`` and ``bytes`` respectively. From webhook-mailer at python.org Wed Mar 3 19:03:51 2021 From: webhook-mailer at python.org (pablogsal) Date: Thu, 04 Mar 2021 00:03:51 -0000 Subject: [Python-checkins] bpo-42128: Add __match_args__ to structseq-based classes (GH-24732) Message-ID: https://github.com/python/cpython/commit/0632b1012d4dfa81ffef0d686a4710f6134f77a8 commit: 0632b1012d4dfa81ffef0d686a4710f6134f77a8 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-04T00:03:44Z summary: bpo-42128: Add __match_args__ to structseq-based classes (GH-24732) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst M Lib/test/test_structseq.py M Objects/structseq.c diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py index 36630a17367ff..a9fe193028ebe 100644 --- a/Lib/test/test_structseq.py +++ b/Lib/test/test_structseq.py @@ -122,5 +122,17 @@ def test_extended_getslice(self): self.assertEqual(list(t[start:stop:step]), L[start:stop:step]) + def test_match_args(self): + expected_args = ('tm_year', 'tm_mon', 'tm_mday', 'tm_hour', 'tm_min', + 'tm_sec', 'tm_wday', 'tm_yday', 'tm_isdst') + self.assertEqual(time.struct_time.__match_args__, expected_args) + + def test_match_args_with_unnamed_fields(self): + expected_args = ('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', + 'st_gid', 'st_size') + self.assertEqual(os.stat_result.n_unnamed_fields, 3) + self.assertEqual(os.stat_result.__match_args__, expected_args) + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst new file mode 100644 index 0000000000000..7c4733a9b0d70 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst @@ -0,0 +1,2 @@ +Add ``__match_args__`` to :c:type:`structsequence` based classes. Patch by +Pablo Galindo. diff --git a/Objects/structseq.c b/Objects/structseq.c index 4222afa599c80..8a92bdbec08d1 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -15,6 +15,7 @@ static const char visible_length_key[] = "n_sequence_fields"; static const char real_length_key[] = "n_fields"; static const char unnamed_fields_key[] = "n_unnamed_fields"; +static const char match_args_key[] = "__match_args__"; /* Fields with this name have only a field index, not a field name. They are only allowed for indices < n_visible_fields. */ @@ -399,7 +400,40 @@ initialize_structseq_dict(PyStructSequence_Desc *desc, PyObject* dict, SET_DICT_FROM_SIZE(visible_length_key, desc->n_in_sequence); SET_DICT_FROM_SIZE(real_length_key, n_members); SET_DICT_FROM_SIZE(unnamed_fields_key, n_unnamed_members); + + // Prepare and set __match_args__ + Py_ssize_t i, k; + PyObject* keys = PyTuple_New(desc->n_in_sequence); + if (keys == NULL) { + return -1; + } + + for (i = k = 0; i < desc->n_in_sequence; ++i) { + if (desc->fields[i].name == PyStructSequence_UnnamedField) { + continue; + } + PyObject* new_member = PyUnicode_FromString(desc->fields[i].name); + if (new_member == NULL) { + goto error; + } + PyTuple_SET_ITEM(keys, k, new_member); + k++; + } + + if (_PyTuple_Resize(&keys, k) == -1) { + goto error; + } + + if (PyDict_SetItemString(dict, match_args_key, keys) < 0) { + goto error; + } + + Py_DECREF(keys); return 0; + +error: + Py_DECREF(keys); + return -1; } static void From webhook-mailer at python.org Wed Mar 3 20:29:34 2021 From: webhook-mailer at python.org (pablogsal) Date: Thu, 04 Mar 2021 01:29:34 -0000 Subject: [Python-checkins] Improve the description of the improvements in bpo-42202 (GH-24738) Message-ID: https://github.com/python/cpython/commit/8747c1f233fc1a3dd5ee3d8e163317f28b4d7568 commit: 8747c1f233fc1a3dd5ee3d8e163317f28b4d7568 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-04T01:29:29Z summary: Improve the description of the improvements in bpo-42202 (GH-24738) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index ae76243bafb7c..db71f061f14df 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -903,8 +903,9 @@ Optimizations * Function parameters and their annotations are no longer computed at runtime, but rather at compilation time. They are stored as a tuple of strings at the - bytecode level. It is now around 100% faster to create a function with parameter - annotations. (Contributed by Yurii Karabas and Inada Naoki in :issue:`42202`) + bytecode level. It is now around 2 times faster to create a function with + parameter annotations. (Contributed by Yurii Karabas and Inada Naoki + in :issue:`42202`) * Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` now sometimes use Crochemore & Perrin's "Two-Way" string searching From webhook-mailer at python.org Wed Mar 3 22:09:56 2021 From: webhook-mailer at python.org (gvanrossum) Date: Thu, 04 Mar 2021 03:09:56 -0000 Subject: [Python-checkins] bpo-43271: Re-enable ceval.c optimizations for Windows debug builds (GH-24739) Message-ID: https://github.com/python/cpython/commit/131d5516409791b170b09a6ef8ed8463c9b09015 commit: 131d5516409791b170b09a6ef8ed8463c9b09015 branch: master author: db3l committer: gvanrossum date: 2021-03-03T19:09:48-08:00 summary: bpo-43271: Re-enable ceval.c optimizations for Windows debug builds (GH-24739) Partially reverts commit b74396c3167cc780f01309148db02709bc37b432 The optimizations are necessary to prevent the interpreter from crashing in a number of tests involving recursion. files: M Include/pyport.h M Python/ceval.c diff --git a/Include/pyport.h b/Include/pyport.h index 0993b545dc236..fe27fbc748322 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -182,8 +182,9 @@ typedef int Py_ssize_clean_t; */ #if defined(_MSC_VER) -# if defined(PY_LOCAL_AGGRESSIVE) && !defined(Py_DEBUG) +# if defined(PY_LOCAL_AGGRESSIVE) /* enable more aggressive optimization for MSVC */ + /* active in both release and debug builds - see bpo-43271 */ # pragma optimize("gt", on) #endif /* ignore warnings if the compiler decides not to inline a function */ diff --git a/Python/ceval.c b/Python/ceval.c index 8ec00bc2400fb..abdea1de09b43 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -7,6 +7,7 @@ */ /* enable more aggressive intra-module optimizations, where available */ +/* affects both release and debug builds - see bpo-43271 */ #define PY_LOCAL_AGGRESSIVE #include "Python.h" From webhook-mailer at python.org Thu Mar 4 00:54:06 2021 From: webhook-mailer at python.org (brandtbucher) Date: Thu, 04 Mar 2021 05:54:06 -0000 Subject: [Python-checkins] bpo-43394: Fix -Wstrict-prototypes warnings (GH-24737) Message-ID: https://github.com/python/cpython/commit/c61ec7e6b892313cd3ecbaf02227bacb9d5ddaa2 commit: c61ec7e6b892313cd3ecbaf02227bacb9d5ddaa2 branch: master author: Brandt Bucher committer: brandtbucher date: 2021-03-03T21:53:59-08:00 summary: bpo-43394: Fix -Wstrict-prototypes warnings (GH-24737) files: M Modules/_xxtestfuzz/fuzzer.c M Modules/_zoneinfo.c diff --git a/Modules/_xxtestfuzz/fuzzer.c b/Modules/_xxtestfuzz/fuzzer.c index 6bd2c3aedccc9..699f906a6aec1 100644 --- a/Modules/_xxtestfuzz/fuzzer.c +++ b/Modules/_xxtestfuzz/fuzzer.c @@ -83,7 +83,7 @@ static int fuzz_builtin_unicode(const char* data, size_t size) { PyObject* struct_unpack_method = NULL; PyObject* struct_error = NULL; /* Called by LLVMFuzzerTestOneInput for initialization */ -static int init_struct_unpack() { +static int init_struct_unpack(void) { /* Import struct.unpack */ PyObject* struct_module = PyImport_ImportModule("struct"); if (struct_module == NULL) { @@ -146,7 +146,7 @@ static int fuzz_struct_unpack(const char* data, size_t size) { PyObject* json_loads_method = NULL; /* Called by LLVMFuzzerTestOneInput for initialization */ -static int init_json_loads() { +static int init_json_loads(void) { /* Import json.loads */ PyObject* json_module = PyImport_ImportModule("json"); if (json_module == NULL) { @@ -192,7 +192,7 @@ PyObject* sre_compile_method = NULL; PyObject* sre_error_exception = NULL; int SRE_FLAG_DEBUG = 0; /* Called by LLVMFuzzerTestOneInput for initialization */ -static int init_sre_compile() { +static int init_sre_compile(void) { /* Import sre_compile.compile and sre.error */ PyObject* sre_compile_module = PyImport_ImportModule("sre_compile"); if (sre_compile_module == NULL) { @@ -284,7 +284,7 @@ static const char* regex_patterns[] = { const size_t NUM_PATTERNS = sizeof(regex_patterns) / sizeof(regex_patterns[0]); PyObject** compiled_patterns = NULL; /* Called by LLVMFuzzerTestOneInput for initialization */ -static int init_sre_match() { +static int init_sre_match(void) { PyObject* re_module = PyImport_ImportModule("re"); if (re_module == NULL) { return 0; @@ -339,7 +339,7 @@ static int fuzz_sre_match(const char* data, size_t size) { PyObject* csv_module = NULL; PyObject* csv_error = NULL; /* Called by LLVMFuzzerTestOneInput for initialization */ -static int init_csv_reader() { +static int init_csv_reader(void) { /* Import csv and csv.Error */ csv_module = PyImport_ImportModule("csv"); if (csv_module == NULL) { diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index 4726b82b6a42c..755442f857652 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -2608,7 +2608,7 @@ static PyTypeObject PyZoneInfo_ZoneInfoType = { // Specify the _zoneinfo module static PyMethodDef module_methods[] = {{NULL, NULL}}; static void -module_free() +module_free(void) { Py_XDECREF(_tzpath_find_tzfile); _tzpath_find_tzfile = NULL; From webhook-mailer at python.org Thu Mar 4 04:50:40 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Thu, 04 Mar 2021 09:50:40 -0000 Subject: [Python-checkins] bpo-43369: sqlite3_column_{text, blob} failures now raise MemoryError (GH-24723) Message-ID: https://github.com/python/cpython/commit/e161ec5dd7ba9355eb06757b9304019ac53cdf69 commit: e161ec5dd7ba9355eb06757b9304019ac53cdf69 branch: master author: Erlend Egeberg Aasland committer: berkerpeksag date: 2021-03-04T11:50:25+02:00 summary: bpo-43369: sqlite3_column_{text,blob} failures now raise MemoryError (GH-24723) files: A Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst M Lib/sqlite3/test/types.py M Modules/_sqlite/cursor.c diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py index 92ec6349f8bd2..2370dd1693042 100644 --- a/Lib/sqlite3/test/types.py +++ b/Lib/sqlite3/test/types.py @@ -110,7 +110,20 @@ def __conform__(self, protocol): def setUp(self): self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_DECLTYPES) self.cur = self.con.cursor() - self.cur.execute("create table test(i int, s str, f float, b bool, u unicode, foo foo, bin blob, n1 number, n2 number(5), bad bad)") + self.cur.execute(""" + create table test( + i int, + s str, + f float, + b bool, + u unicode, + foo foo, + bin blob, + n1 number, + n2 number(5), + bad bad, + cbin cblob) + """) # override float, make them always return the same number sqlite.converters["FLOAT"] = lambda x: 47.2 @@ -121,6 +134,7 @@ def setUp(self): sqlite.converters["BAD"] = DeclTypesTests.BadConform sqlite.converters["WRONG"] = lambda x: "WRONG" sqlite.converters["NUMBER"] = float + sqlite.converters["CBLOB"] = lambda x: b"blobish" def tearDown(self): del sqlite.converters["FLOAT"] @@ -129,6 +143,7 @@ def tearDown(self): del sqlite.converters["BAD"] del sqlite.converters["WRONG"] del sqlite.converters["NUMBER"] + del sqlite.converters["CBLOB"] self.cur.close() self.con.close() @@ -237,6 +252,12 @@ def test_number2(self): # if the converter is not used, it's an int instead of a float self.assertEqual(type(value), float) + def test_convert_zero_sized_blob(self): + self.con.execute("insert into test(cbin) values (?)", (b"",)) + cur = self.con.execute("select cbin from test") + self.assertEqual(cur.fetchone()[0], b"blobish") + + class ColNamesTests(unittest.TestCase): def setUp(self): self.con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES) diff --git a/Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst b/Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst new file mode 100644 index 0000000000000..f88a7070dbcee --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst @@ -0,0 +1,3 @@ +Improve :mod:`sqlite3` error handling: If ``sqlite3_column_text()`` and +``sqlite3_column_blob()`` set ``SQLITE_NOMEM``, :exc:`MemoryError` is now +raised. Patch by Erlend E. Aasland. diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 764eec5fbcac6..dfaa5577ab408 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -262,6 +262,7 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self) if (!row) return NULL; + sqlite3 *db = self->connection->db; for (i = 0; i < numcols; i++) { if (self->connection->detect_types && self->row_cast_map != NULL @@ -280,17 +281,19 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self) * See https://sqlite.org/c3ref/column_blob.html for details. */ if (converter != Py_None) { - const char *blob = (const char*)sqlite3_column_blob(self->statement->st, i); + const void *blob = sqlite3_column_blob(self->statement->st, i); + if (blob == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) { + PyErr_NoMemory(); + goto error; + } + nbytes = sqlite3_column_bytes(self->statement->st, i); - if (!blob) { - converted = Py_NewRef(Py_None); - } else { - item = PyBytes_FromStringAndSize(blob, nbytes); - if (!item) - goto error; - converted = PyObject_CallOneArg(converter, item); - Py_DECREF(item); + item = PyBytes_FromStringAndSize(blob, nbytes); + if (item == NULL) { + goto error; } + converted = PyObject_CallOneArg(converter, item); + Py_DECREF(item); } else { Py_BEGIN_ALLOW_THREADS coltype = sqlite3_column_type(self->statement->st, i); @@ -303,6 +306,11 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self) converted = PyFloat_FromDouble(sqlite3_column_double(self->statement->st, i)); } else if (coltype == SQLITE_TEXT) { const char *text = (const char*)sqlite3_column_text(self->statement->st, i); + if (text == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) { + PyErr_NoMemory(); + goto error; + } + nbytes = sqlite3_column_bytes(self->statement->st, i); if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) { converted = PyUnicode_FromStringAndSize(text, nbytes); @@ -332,7 +340,12 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self) } } else { /* coltype == SQLITE_BLOB */ - const char *blob = sqlite3_column_blob(self->statement->st, i); + const void *blob = sqlite3_column_blob(self->statement->st, i); + if (blob == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) { + PyErr_NoMemory(); + goto error; + } + nbytes = sqlite3_column_bytes(self->statement->st, i); converted = PyBytes_FromStringAndSize(blob, nbytes); } From webhook-mailer at python.org Thu Mar 4 10:46:21 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Thu, 04 Mar 2021 15:46:21 -0000 Subject: [Python-checkins] bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746) Message-ID: https://github.com/python/cpython/commit/40d1b831ecd1b5b6a4fce9a908a6e61b50b360a0 commit: 40d1b831ecd1b5b6a4fce9a908a6e61b50b360a0 branch: master author: Erlend Egeberg Aasland committer: berkerpeksag date: 2021-03-04T17:46:14+02:00 summary: bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746) files: M Doc/library/sqlite3.rst diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index c017dacff8897..172ce6c6bb03b 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -26,34 +26,34 @@ represents the database. Here the data will be stored in the :file:`example.db` file:: import sqlite3 - conn = sqlite3.connect('example.db') + con = sqlite3.connect('example.db') You can also supply the special name ``:memory:`` to create a database in RAM. Once you have a :class:`Connection`, you can create a :class:`Cursor` object and call its :meth:`~Cursor.execute` method to perform SQL commands:: - c = conn.cursor() + cur = con.cursor() # Create table - c.execute('''CREATE TABLE stocks - (date text, trans text, symbol text, qty real, price real)''') + cur.execute('''CREATE TABLE stocks + (date text, trans text, symbol text, qty real, price real)''') # Insert a row of data - c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") + cur.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") # Save (commit) the changes - conn.commit() + con.commit() # We can also close the connection if we are done with it. # Just be sure any changes have been committed or they will be lost. - conn.close() + con.close() The data you've saved is persistent and is available in subsequent sessions:: import sqlite3 - conn = sqlite3.connect('example.db') - c = conn.cursor() + con = sqlite3.connect('example.db') + cur = con.cursor() Usually your SQL operations will need to use values from Python variables. You shouldn't assemble your query using Python's string operations because doing so @@ -68,19 +68,19 @@ example:: # Never do this -- insecure! symbol = 'RHAT' - c.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol) + cur.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol) # Do this instead t = ('RHAT',) - c.execute('SELECT * FROM stocks WHERE symbol=?', t) - print(c.fetchone()) + cur.execute('SELECT * FROM stocks WHERE symbol=?', t) + print(cur.fetchone()) # Larger example that inserts many records at a time purchases = [('2006-03-28', 'BUY', 'IBM', 1000, 45.00), ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00), ('2006-04-06', 'SELL', 'IBM', 500, 53.00), ] - c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + cur.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) To retrieve data after executing a SELECT statement, you can either treat the cursor as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to @@ -89,7 +89,7 @@ matching rows. This example uses the iterator form:: - >>> for row in c.execute('SELECT * FROM stocks ORDER BY price'): + >>> for row in cur.execute('SELECT * FROM stocks ORDER BY price'): print(row) ('2006-01-05', 'BUY', 'RHAT', 100, 35.14) @@ -764,23 +764,23 @@ Row Objects Let's assume we initialize a table as in the example given above:: - conn = sqlite3.connect(":memory:") - c = conn.cursor() - c.execute('''create table stocks + con = sqlite3.connect(":memory:") + cur = con.cursor() + cur.execute('''create table stocks (date text, trans text, symbol text, qty real, price real)''') - c.execute("""insert into stocks - values ('2006-01-05','BUY','RHAT',100,35.14)""") - conn.commit() - c.close() + cur.execute("""insert into stocks + values ('2006-01-05','BUY','RHAT',100,35.14)""") + con.commit() + cur.close() Now we plug :class:`Row` in:: - >>> conn.row_factory = sqlite3.Row - >>> c = conn.cursor() - >>> c.execute('select * from stocks') + >>> con.row_factory = sqlite3.Row + >>> cur = con.cursor() + >>> cur.execute('select * from stocks') - >>> r = c.fetchone() + >>> r = cur.fetchone() >>> type(r) >>> tuple(r) From webhook-mailer at python.org Thu Mar 4 11:36:51 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 04 Mar 2021 16:36:51 -0000 Subject: [Python-checkins] [3.9] bpo-37193: Remove thread objects which finished process its request (GH-23127) (GH-24750) Message-ID: https://github.com/python/cpython/commit/0e76157b0ca70bd38157fed56680a7752a52668d commit: 0e76157b0ca70bd38157fed56680a7752a52668d branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-04T08:36:41-08:00 summary: [3.9] bpo-37193: Remove thread objects which finished process its request (GH-23127) (GH-24750) This reverts commit aca67da4fe68d5420401ac1782203d302875eb27. (cherry picked from commit b5711c940f70af89f2b4cf081a3fcd83924f3ae7) Co-authored-by: Jason R. Coombs Automerge-Triggered-By: GH:jaraco files: A Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst M Lib/socketserver.py M Lib/test/test_socketserver.py diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 57c1ae6e9e8be..0d9583d56a4d7 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -628,6 +628,39 @@ def server_close(self): self.collect_children(blocking=self.block_on_close) +class _Threads(list): + """ + Joinable list of all non-daemon threads. + """ + def append(self, thread): + self.reap() + if thread.daemon: + return + super().append(thread) + + def pop_all(self): + self[:], result = [], self[:] + return result + + def join(self): + for thread in self.pop_all(): + thread.join() + + def reap(self): + self[:] = (thread for thread in self if thread.is_alive()) + + +class _NoThreads: + """ + Degenerate version of _Threads. + """ + def append(self, thread): + pass + + def join(self): + pass + + class ThreadingMixIn: """Mix-in class to handle each request in a new thread.""" @@ -636,9 +669,9 @@ class ThreadingMixIn: daemon_threads = False # If true, server_close() waits until all non-daemonic threads terminate. block_on_close = True - # For non-daemonic threads, list of threading.Threading objects + # Threads object # used by server_close() to wait for all threads completion. - _threads = None + _threads = _NoThreads() def process_request_thread(self, request, client_address): """Same as in BaseServer but as a thread. @@ -655,23 +688,17 @@ def process_request_thread(self, request, client_address): def process_request(self, request, client_address): """Start a new thread to process the request.""" + if self.block_on_close: + vars(self).setdefault('_threads', _Threads()) t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) t.daemon = self.daemon_threads - if not t.daemon and self.block_on_close: - if self._threads is None: - self._threads = [] - self._threads.append(t) + self._threads.append(t) t.start() def server_close(self): super().server_close() - if self.block_on_close: - threads = self._threads - self._threads = None - if threads: - for thread in threads: - thread.join() + self._threads.join() if hasattr(os, "fork"): diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index c663cc95889c9..c9455adfd85e2 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -275,6 +275,13 @@ class MyHandler(socketserver.StreamRequestHandler): t.join() s.server_close() + def test_close_immediately(self): + class MyServer(socketserver.ThreadingMixIn, socketserver.TCPServer): + pass + + server = MyServer((HOST, 0), lambda: None) + server.server_close() + def test_tcpserver_bind_leak(self): # Issue #22435: the server socket wouldn't be closed if bind()/listen() # failed. @@ -489,6 +496,22 @@ def shutdown_request(self, request): self.assertEqual(server.shutdown_called, 1) server.server_close() + def test_threads_reaped(self): + """ + In #37193, users reported a memory leak + due to the saving of every request thread. Ensure that + not all threads are kept forever. + """ + class MyServer(socketserver.ThreadingMixIn, socketserver.TCPServer): + pass + + server = MyServer((HOST, 0), socketserver.StreamRequestHandler) + for n in range(10): + with socket.create_connection(server.server_address): + server.handle_request() + self.assertLess(len(server._threads), 10) + server.server_close() + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst b/Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst new file mode 100644 index 0000000000000..fbf56d3194cd2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst @@ -0,0 +1,2 @@ +Fixed memory leak in ``socketserver.ThreadingMixIn`` introduced in Python +3.7. From webhook-mailer at python.org Thu Mar 4 11:55:44 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 04 Mar 2021 16:55:44 -0000 Subject: [Python-checkins] [3.8] bpo-37193: Remove thread objects which finished process its request (GH-23127) (GH-24749) Message-ID: https://github.com/python/cpython/commit/0064d561b8e44f7a991188d7c5016c165bc89326 commit: 0064d561b8e44f7a991188d7c5016c165bc89326 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-04T08:55:24-08:00 summary: [3.8] bpo-37193: Remove thread objects which finished process its request (GH-23127) (GH-24749) This reverts commit aca67da4fe68d5420401ac1782203d302875eb27. (cherry picked from commit b5711c940f70af89f2b4cf081a3fcd83924f3ae7) Co-authored-by: Jason R. Coombs Automerge-Triggered-By: GH:jaraco files: A Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst M Lib/socketserver.py M Lib/test/test_socketserver.py diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 1ad028fa4d08c..9e94c76731e81 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -628,6 +628,39 @@ def server_close(self): self.collect_children(blocking=self.block_on_close) +class _Threads(list): + """ + Joinable list of all non-daemon threads. + """ + def append(self, thread): + self.reap() + if thread.daemon: + return + super().append(thread) + + def pop_all(self): + self[:], result = [], self[:] + return result + + def join(self): + for thread in self.pop_all(): + thread.join() + + def reap(self): + self[:] = (thread for thread in self if thread.is_alive()) + + +class _NoThreads: + """ + Degenerate version of _Threads. + """ + def append(self, thread): + pass + + def join(self): + pass + + class ThreadingMixIn: """Mix-in class to handle each request in a new thread.""" @@ -636,9 +669,9 @@ class ThreadingMixIn: daemon_threads = False # If true, server_close() waits until all non-daemonic threads terminate. block_on_close = True - # For non-daemonic threads, list of threading.Threading objects + # Threads object # used by server_close() to wait for all threads completion. - _threads = None + _threads = _NoThreads() def process_request_thread(self, request, client_address): """Same as in BaseServer but as a thread. @@ -655,23 +688,17 @@ def process_request_thread(self, request, client_address): def process_request(self, request, client_address): """Start a new thread to process the request.""" + if self.block_on_close: + vars(self).setdefault('_threads', _Threads()) t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) t.daemon = self.daemon_threads - if not t.daemon and self.block_on_close: - if self._threads is None: - self._threads = [] - self._threads.append(t) + self._threads.append(t) t.start() def server_close(self): super().server_close() - if self.block_on_close: - threads = self._threads - self._threads = None - if threads: - for thread in threads: - thread.join() + self._threads.join() if hasattr(os, "fork"): diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 8aed4b61a2374..1e5224df01bbf 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -276,6 +276,13 @@ class MyHandler(socketserver.StreamRequestHandler): t.join() s.server_close() + def test_close_immediately(self): + class MyServer(socketserver.ThreadingMixIn, socketserver.TCPServer): + pass + + server = MyServer((HOST, 0), lambda: None) + server.server_close() + def test_tcpserver_bind_leak(self): # Issue #22435: the server socket wouldn't be closed if bind()/listen() # failed. @@ -490,6 +497,22 @@ def shutdown_request(self, request): self.assertEqual(server.shutdown_called, 1) server.server_close() + def test_threads_reaped(self): + """ + In #37193, users reported a memory leak + due to the saving of every request thread. Ensure that + not all threads are kept forever. + """ + class MyServer(socketserver.ThreadingMixIn, socketserver.TCPServer): + pass + + server = MyServer((HOST, 0), socketserver.StreamRequestHandler) + for n in range(10): + with socket.create_connection(server.server_address): + server.handle_request() + self.assertLess(len(server._threads), 10) + server.server_close() + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst b/Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst new file mode 100644 index 0000000000000..fbf56d3194cd2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-12-21-23-20.bpo-37193.wJximU.rst @@ -0,0 +1,2 @@ +Fixed memory leak in ``socketserver.ThreadingMixIn`` introduced in Python +3.7. From webhook-mailer at python.org Thu Mar 4 11:59:17 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 04 Mar 2021 16:59:17 -0000 Subject: [Python-checkins] bpo-42405: fix C extensions build on Windows ARM64 (GH-23399) Message-ID: https://github.com/python/cpython/commit/cb7bc7640935f6b05e9d2acfe4b33d496e8f8666 commit: cb7bc7640935f6b05e9d2acfe4b33d496e8f8666 branch: master author: Adrian Vladu committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-04T08:59:12-08:00 summary: bpo-42405: fix C extensions build on Windows ARM64 (GH-23399) The following changes are required: * add a new platform win-arm64 * replace the emulated compiler executable paths * bump the linker base addressed as ARM64 requires more memory this change might not be needed (investigation required) On Windows 10 ARM64, VS compiler paths look like this: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\ARM64\cl.exe Note that the cl.exe for ARM64 is an x32 binary, which can run emulated on Windows 10 ARM64 (it has builtin emulation for x32). The rc.exe and mc.exe paths have to also be changed, as the initial discovery has to be fixed. Work in progress to remove the hardcoded bits and to change the path query fixes to the proper location. Automerge-Triggered-By: GH:jaraco files: A Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst M Lib/distutils/msvc9compiler.py diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py index 6934e964abd69..b2b52e56c8ea5 100644 --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -54,6 +54,7 @@ PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'amd64', + 'win-arm64' : 'arm64', } class Reg: @@ -342,7 +343,7 @@ def initialize(self, plat_name=None): if plat_name is None: plat_name = get_platform() # sanity check for platforms to prevent obscure errors later. - ok_plats = 'win32', 'win-amd64' + ok_plats = 'win32', 'win-amd64', 'win-arm64' if plat_name not in ok_plats: raise DistutilsPlatformError("--plat-name must be one of %s" % (ok_plats,)) @@ -371,6 +372,9 @@ def initialize(self, plat_name=None): vc_env = query_vcvarsall(VERSION, plat_spec) self.__paths = vc_env['path'].split(os.pathsep) + if plat_name == 'win-arm64': + self.__paths = ( + vc_env['path'].replace('HostX64', 'HostX86').split(os.pathsep)) os.environ['lib'] = vc_env['lib'] os.environ['include'] = vc_env['include'] @@ -385,6 +389,12 @@ def initialize(self, plat_name=None): self.lib = self.find_exe("lib.exe") self.rc = self.find_exe("rc.exe") # resource compiler self.mc = self.find_exe("mc.exe") # message compiler + if plat_name == 'win-arm64': + self.cc = self.cc.replace('HostX64', 'Hostx86') + self.linker = self.linker.replace('HostX64', 'Hostx86') + self.lib = self.lib.replace('HostX64', 'Hostx86') + self.rc = self.rc.replace('x64', 'arm64') + self.mc = self.mc.replace('x64', 'arm64') #self.set_path_env_var('lib') #self.set_path_env_var('include') @@ -634,6 +644,17 @@ def link(self, if extra_postargs: ld_args.extend(extra_postargs) + if get_platform() == 'win-arm64': + ld_args_arm = [] + for ld_arg in ld_args: + # VS tries to use the x86 linker + ld_arg_arm = ld_arg.replace(r'\um\x86', r'\um\arm64') + # A larger memory address is required on ARM64 + ld_arg_arm = ld_arg_arm.replace("0x1", "0x10") + ld_args_arm += [ld_arg_arm] + + ld_args = list(ld_args_arm) + self.mkpath(os.path.dirname(output_filename)) try: self.spawn([self.linker] + ld_args) diff --git a/Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst b/Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst new file mode 100644 index 0000000000000..9d71c922ab81e --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst @@ -0,0 +1 @@ +In distutils, add support for building C extensions on Windows ARM64. From webhook-mailer at python.org Thu Mar 4 12:11:50 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Thu, 04 Mar 2021 17:11:50 -0000 Subject: [Python-checkins] bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746) Message-ID: https://github.com/python/cpython/commit/374ee449331bc95d18c37f5032aaea1448462e58 commit: 374ee449331bc95d18c37f5032aaea1448462e58 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: berkerpeksag date: 2021-03-04T19:11:40+02:00 summary: bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746) (cherry picked from commit 40d1b831ecd1b5b6a4fce9a908a6e61b50b360a0) Co-authored-by: Erlend Egeberg Aasland files: M Doc/library/sqlite3.rst diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 2e2e5e9cdae37..600e85944f3a0 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -25,34 +25,34 @@ represents the database. Here the data will be stored in the :file:`example.db` file:: import sqlite3 - conn = sqlite3.connect('example.db') + con = sqlite3.connect('example.db') You can also supply the special name ``:memory:`` to create a database in RAM. Once you have a :class:`Connection`, you can create a :class:`Cursor` object and call its :meth:`~Cursor.execute` method to perform SQL commands:: - c = conn.cursor() + cur = con.cursor() # Create table - c.execute('''CREATE TABLE stocks - (date text, trans text, symbol text, qty real, price real)''') + cur.execute('''CREATE TABLE stocks + (date text, trans text, symbol text, qty real, price real)''') # Insert a row of data - c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") + cur.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") # Save (commit) the changes - conn.commit() + con.commit() # We can also close the connection if we are done with it. # Just be sure any changes have been committed or they will be lost. - conn.close() + con.close() The data you've saved is persistent and is available in subsequent sessions:: import sqlite3 - conn = sqlite3.connect('example.db') - c = conn.cursor() + con = sqlite3.connect('example.db') + cur = con.cursor() Usually your SQL operations will need to use values from Python variables. You shouldn't assemble your query using Python's string operations because doing so @@ -67,19 +67,19 @@ example:: # Never do this -- insecure! symbol = 'RHAT' - c.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol) + cur.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol) # Do this instead t = ('RHAT',) - c.execute('SELECT * FROM stocks WHERE symbol=?', t) - print(c.fetchone()) + cur.execute('SELECT * FROM stocks WHERE symbol=?', t) + print(cur.fetchone()) # Larger example that inserts many records at a time purchases = [('2006-03-28', 'BUY', 'IBM', 1000, 45.00), ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00), ('2006-04-06', 'SELL', 'IBM', 500, 53.00), ] - c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + cur.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) To retrieve data after executing a SELECT statement, you can either treat the cursor as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to @@ -88,7 +88,7 @@ matching rows. This example uses the iterator form:: - >>> for row in c.execute('SELECT * FROM stocks ORDER BY price'): + >>> for row in cur.execute('SELECT * FROM stocks ORDER BY price'): print(row) ('2006-01-05', 'BUY', 'RHAT', 100, 35.14) @@ -768,23 +768,23 @@ Row Objects Let's assume we initialize a table as in the example given above:: - conn = sqlite3.connect(":memory:") - c = conn.cursor() - c.execute('''create table stocks + con = sqlite3.connect(":memory:") + cur = con.cursor() + cur.execute('''create table stocks (date text, trans text, symbol text, qty real, price real)''') - c.execute("""insert into stocks - values ('2006-01-05','BUY','RHAT',100,35.14)""") - conn.commit() - c.close() + cur.execute("""insert into stocks + values ('2006-01-05','BUY','RHAT',100,35.14)""") + con.commit() + cur.close() Now we plug :class:`Row` in:: - >>> conn.row_factory = sqlite3.Row - >>> c = conn.cursor() - >>> c.execute('select * from stocks') + >>> con.row_factory = sqlite3.Row + >>> cur = con.cursor() + >>> cur.execute('select * from stocks') - >>> r = c.fetchone() + >>> r = cur.fetchone() >>> type(r) >>> tuple(r) From webhook-mailer at python.org Thu Mar 4 12:12:15 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Thu, 04 Mar 2021 17:12:15 -0000 Subject: [Python-checkins] bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746) Message-ID: https://github.com/python/cpython/commit/213c155a460b8dd9e43901e4d61aa088cbac4221 commit: 213c155a460b8dd9e43901e4d61aa088cbac4221 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: berkerpeksag date: 2021-03-04T19:12:06+02:00 summary: bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746) (cherry picked from commit 40d1b831ecd1b5b6a4fce9a908a6e61b50b360a0) Co-authored-by: Erlend Egeberg Aasland files: M Doc/library/sqlite3.rst diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 92d5ffaf3971c..0ceaed556bf0b 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -25,34 +25,34 @@ represents the database. Here the data will be stored in the :file:`example.db` file:: import sqlite3 - conn = sqlite3.connect('example.db') + con = sqlite3.connect('example.db') You can also supply the special name ``:memory:`` to create a database in RAM. Once you have a :class:`Connection`, you can create a :class:`Cursor` object and call its :meth:`~Cursor.execute` method to perform SQL commands:: - c = conn.cursor() + cur = con.cursor() # Create table - c.execute('''CREATE TABLE stocks - (date text, trans text, symbol text, qty real, price real)''') + cur.execute('''CREATE TABLE stocks + (date text, trans text, symbol text, qty real, price real)''') # Insert a row of data - c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") + cur.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") # Save (commit) the changes - conn.commit() + con.commit() # We can also close the connection if we are done with it. # Just be sure any changes have been committed or they will be lost. - conn.close() + con.close() The data you've saved is persistent and is available in subsequent sessions:: import sqlite3 - conn = sqlite3.connect('example.db') - c = conn.cursor() + con = sqlite3.connect('example.db') + cur = con.cursor() Usually your SQL operations will need to use values from Python variables. You shouldn't assemble your query using Python's string operations because doing so @@ -67,19 +67,19 @@ example:: # Never do this -- insecure! symbol = 'RHAT' - c.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol) + cur.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol) # Do this instead t = ('RHAT',) - c.execute('SELECT * FROM stocks WHERE symbol=?', t) - print(c.fetchone()) + cur.execute('SELECT * FROM stocks WHERE symbol=?', t) + print(cur.fetchone()) # Larger example that inserts many records at a time purchases = [('2006-03-28', 'BUY', 'IBM', 1000, 45.00), ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00), ('2006-04-06', 'SELL', 'IBM', 500, 53.00), ] - c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + cur.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) To retrieve data after executing a SELECT statement, you can either treat the cursor as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to @@ -88,7 +88,7 @@ matching rows. This example uses the iterator form:: - >>> for row in c.execute('SELECT * FROM stocks ORDER BY price'): + >>> for row in cur.execute('SELECT * FROM stocks ORDER BY price'): print(row) ('2006-01-05', 'BUY', 'RHAT', 100, 35.14) @@ -768,23 +768,23 @@ Row Objects Let's assume we initialize a table as in the example given above:: - conn = sqlite3.connect(":memory:") - c = conn.cursor() - c.execute('''create table stocks + con = sqlite3.connect(":memory:") + cur = con.cursor() + cur.execute('''create table stocks (date text, trans text, symbol text, qty real, price real)''') - c.execute("""insert into stocks - values ('2006-01-05','BUY','RHAT',100,35.14)""") - conn.commit() - c.close() + cur.execute("""insert into stocks + values ('2006-01-05','BUY','RHAT',100,35.14)""") + con.commit() + cur.close() Now we plug :class:`Row` in:: - >>> conn.row_factory = sqlite3.Row - >>> c = conn.cursor() - >>> c.execute('select * from stocks') + >>> con.row_factory = sqlite3.Row + >>> cur = con.cursor() + >>> cur.execute('select * from stocks') - >>> r = c.fetchone() + >>> r = cur.fetchone() >>> type(r) >>> tuple(r) From webhook-mailer at python.org Thu Mar 4 13:25:03 2021 From: webhook-mailer at python.org (gpshead) Date: Thu, 04 Mar 2021 18:25:03 -0000 Subject: [Python-checkins] bpo-43391: Remove the broken Python 2.4 link from the comment (GH-24736) Message-ID: https://github.com/python/cpython/commit/b225d91f0a92d657d9a1b62daa53ab239c8191e3 commit: b225d91f0a92d657d9a1b62daa53ab239c8191e3 branch: master author: Kamil Turek committer: gpshead date: 2021-03-04T10:24:42-08:00 summary: bpo-43391: Remove the broken Python 2.4 link from the comment (GH-24736) files: M Lib/subprocess.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index aa107cb60e461..e4ca5f500c21a 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -5,7 +5,6 @@ # Copyright (c) 2003-2005 by Peter Astrand # # Licensed to PSF under a Contributor Agreement. -# See http://www.python.org/2.4/license for licensing details. r"""Subprocesses with accessible I/O streams From webhook-mailer at python.org Thu Mar 4 13:41:58 2021 From: webhook-mailer at python.org (jaraco) Date: Thu, 04 Mar 2021 18:41:58 -0000 Subject: [Python-checkins] Revert "bpo-42405: fix C extensions build on Windows ARM64 (GH-23399)" (#24753) Message-ID: https://github.com/python/cpython/commit/fbf75b9997e280b1220755d0a17dbed71240d42e commit: fbf75b9997e280b1220755d0a17dbed71240d42e branch: master author: Jason R. Coombs committer: jaraco date: 2021-03-04T13:41:49-05:00 summary: Revert "bpo-42405: fix C extensions build on Windows ARM64 (GH-23399)" (#24753) This reverts commit cb7bc7640935f6b05e9d2acfe4b33d496e8f8666. files: D Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst M Lib/distutils/msvc9compiler.py diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py index b2b52e56c8ea5..6934e964abd69 100644 --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -54,7 +54,6 @@ PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'amd64', - 'win-arm64' : 'arm64', } class Reg: @@ -343,7 +342,7 @@ def initialize(self, plat_name=None): if plat_name is None: plat_name = get_platform() # sanity check for platforms to prevent obscure errors later. - ok_plats = 'win32', 'win-amd64', 'win-arm64' + ok_plats = 'win32', 'win-amd64' if plat_name not in ok_plats: raise DistutilsPlatformError("--plat-name must be one of %s" % (ok_plats,)) @@ -372,9 +371,6 @@ def initialize(self, plat_name=None): vc_env = query_vcvarsall(VERSION, plat_spec) self.__paths = vc_env['path'].split(os.pathsep) - if plat_name == 'win-arm64': - self.__paths = ( - vc_env['path'].replace('HostX64', 'HostX86').split(os.pathsep)) os.environ['lib'] = vc_env['lib'] os.environ['include'] = vc_env['include'] @@ -389,12 +385,6 @@ def initialize(self, plat_name=None): self.lib = self.find_exe("lib.exe") self.rc = self.find_exe("rc.exe") # resource compiler self.mc = self.find_exe("mc.exe") # message compiler - if plat_name == 'win-arm64': - self.cc = self.cc.replace('HostX64', 'Hostx86') - self.linker = self.linker.replace('HostX64', 'Hostx86') - self.lib = self.lib.replace('HostX64', 'Hostx86') - self.rc = self.rc.replace('x64', 'arm64') - self.mc = self.mc.replace('x64', 'arm64') #self.set_path_env_var('lib') #self.set_path_env_var('include') @@ -644,17 +634,6 @@ def link(self, if extra_postargs: ld_args.extend(extra_postargs) - if get_platform() == 'win-arm64': - ld_args_arm = [] - for ld_arg in ld_args: - # VS tries to use the x86 linker - ld_arg_arm = ld_arg.replace(r'\um\x86', r'\um\arm64') - # A larger memory address is required on ARM64 - ld_arg_arm = ld_arg_arm.replace("0x1", "0x10") - ld_args_arm += [ld_arg_arm] - - ld_args = list(ld_args_arm) - self.mkpath(os.path.dirname(output_filename)) try: self.spawn([self.linker] + ld_args) diff --git a/Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst b/Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst deleted file mode 100644 index 9d71c922ab81e..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst +++ /dev/null @@ -1 +0,0 @@ -In distutils, add support for building C extensions on Windows ARM64. From webhook-mailer at python.org Thu Mar 4 13:43:11 2021 From: webhook-mailer at python.org (jaraco) Date: Thu, 04 Mar 2021 18:43:11 -0000 Subject: [Python-checkins] bpo-42129: Add support for resources in namespaces (GH-24670) Message-ID: https://github.com/python/cpython/commit/67148254146948041a77d8a2989f41b88cdb2f99 commit: 67148254146948041a77d8a2989f41b88cdb2f99 branch: master author: Jason R. Coombs committer: jaraco date: 2021-03-04T13:43:00-05:00 summary: bpo-42129: Add support for resources in namespaces (GH-24670) * Unify behavior in ResourceReaderDefaultsTests and align with the behavior found in importlib_resources. * Equip NamespaceLoader with a NamespaceReader. * Apply changes from importlib_resources 5.0.4 files: A Lib/importlib/_adapters.py A Lib/test/test_importlib/namespacedata01/binary.file A Lib/test/test_importlib/namespacedata01/utf-16.file A Lib/test/test_importlib/namespacedata01/utf-8.file A Lib/test/test_importlib/test_reader.py A Lib/test/test_importlib/update-zips.py A Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst M Lib/importlib/_bootstrap_external.py M Lib/importlib/_common.py M Lib/importlib/abc.py M Lib/importlib/readers.py M Lib/importlib/resources.py M Lib/test/test_importlib/test_abc.py M Lib/test/test_importlib/test_files.py M Lib/test/test_importlib/test_open.py M Lib/test/test_importlib/test_path.py M Lib/test/test_importlib/test_read.py M Lib/test/test_importlib/test_resource.py M Lib/test/test_importlib/zipdata01/ziptestdata.zip M Lib/test/test_importlib/zipdata02/ziptestdata.zip M Python/importlib_external.h diff --git a/Lib/importlib/_adapters.py b/Lib/importlib/_adapters.py new file mode 100644 index 0000000000000..eedde49dd03ad --- /dev/null +++ b/Lib/importlib/_adapters.py @@ -0,0 +1,82 @@ +from contextlib import suppress + +from . import abc + + +class SpecLoaderAdapter: + """ + Adapt a package spec to adapt the underlying loader. + """ + + def __init__(self, spec, adapter=lambda spec: spec.loader): + self.spec = spec + self.loader = adapter(spec) + + def __getattr__(self, name): + return getattr(self.spec, name) + + +class TraversableResourcesLoader: + """ + Adapt a loader to provide TraversableResources. + """ + + def __init__(self, spec): + self.spec = spec + + def get_resource_reader(self, name): + return DegenerateFiles(self.spec)._native() + + +class DegenerateFiles: + """ + Adapter for an existing or non-existant resource reader + to provide a degenerate .files(). + """ + + class Path(abc.Traversable): + def iterdir(self): + return iter(()) + + def is_dir(self): + return False + + is_file = exists = is_dir # type: ignore + + def joinpath(self, other): + return DegenerateFiles.Path() + + def name(self): + return '' + + def open(self): + raise ValueError() + + def __init__(self, spec): + self.spec = spec + + @property + def _reader(self): + with suppress(AttributeError): + return self.spec.loader.get_resource_reader(self.spec.name) + + def _native(self): + """ + Return the native reader if it supports files(). + """ + reader = self._reader + return reader if hasattr(reader, 'files') else self + + def __getattr__(self, attr): + return getattr(self._reader, attr) + + def files(self): + return DegenerateFiles.Path() + + +def wrap_spec(package): + """ + Construct a package spec with traversable compatibility + on the spec/loader/reader. + """ + return SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 3396d5d2b0692..2dab45d480a11 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1259,6 +1259,10 @@ def load_module(self, fullname): # Warning implemented in _load_module_shim(). return _bootstrap._load_module_shim(self, fullname) + def get_resource_reader(self, module): + from importlib.readers import NamespaceReader + return NamespaceReader(self._path) + # Finders ##################################################################### diff --git a/Lib/importlib/_common.py b/Lib/importlib/_common.py index 71ce6af8cc985..03383048ad736 100644 --- a/Lib/importlib/_common.py +++ b/Lib/importlib/_common.py @@ -9,6 +9,8 @@ from typing import Union, Any, Optional from .abc import ResourceReader +from ._adapters import wrap_spec + Package = Union[types.ModuleType, str] @@ -43,18 +45,15 @@ def get_resource_reader(package): # zipimport.zipimporter does not support weak references, resulting in a # TypeError. That seems terrible. spec = package.__spec__ - reader = getattr(spec.loader, 'get_resource_reader', None) + reader = getattr(spec.loader, 'get_resource_reader', None) # type: ignore if reader is None: return None - return reader(spec.name) + return reader(spec.name) # type: ignore def resolve(cand): # type: (Package) -> types.ModuleType - return ( - cand if isinstance(cand, types.ModuleType) - else importlib.import_module(cand) - ) + return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand) def get_package(package): @@ -64,7 +63,7 @@ def get_package(package): Raise an exception if the resolved module is not a package. """ resolved = resolve(package) - if resolved.__spec__.submodule_search_locations is None: + if wrap_spec(resolved).submodule_search_locations is None: raise TypeError('{!r} is not a package'.format(package)) return resolved @@ -74,7 +73,7 @@ def from_package(package): Return a Traversable object for the given package. """ - spec = package.__spec__ + spec = wrap_spec(package) reader = spec.loader.get_resource_reader(spec.name) return reader.files() diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index 55e70889f22f7..4be51e2346282 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -14,6 +14,7 @@ from ._abc import Loader import abc import warnings +from typing import BinaryIO, Iterable, Text from typing import Protocol, runtime_checkable @@ -297,49 +298,45 @@ def set_data(self, path, data): class ResourceReader(metaclass=abc.ABCMeta): - - """Abstract base class to provide resource-reading support. - - Loaders that support resource reading are expected to implement - the ``get_resource_reader(fullname)`` method and have it either return None - or an object compatible with this ABC. - """ + """Abstract base class for loaders to provide resource reading support.""" @abc.abstractmethod - def open_resource(self, resource): + def open_resource(self, resource: Text) -> BinaryIO: """Return an opened, file-like object for binary reading. - The 'resource' argument is expected to represent only a file name - and thus not contain any subdirectory components. - + The 'resource' argument is expected to represent only a file name. If the resource cannot be found, FileNotFoundError is raised. """ + # This deliberately raises FileNotFoundError instead of + # NotImplementedError so that if this method is accidentally called, + # it'll still do the right thing. raise FileNotFoundError @abc.abstractmethod - def resource_path(self, resource): + def resource_path(self, resource: Text) -> Text: """Return the file system path to the specified resource. - The 'resource' argument is expected to represent only a file name - and thus not contain any subdirectory components. - + The 'resource' argument is expected to represent only a file name. If the resource does not exist on the file system, raise FileNotFoundError. """ + # This deliberately raises FileNotFoundError instead of + # NotImplementedError so that if this method is accidentally called, + # it'll still do the right thing. raise FileNotFoundError @abc.abstractmethod - def is_resource(self, name): - """Return True if the named 'name' is consider a resource.""" + def is_resource(self, path: Text) -> bool: + """Return True if the named 'path' is a resource. + + Files are resources, directories are not. + """ raise FileNotFoundError @abc.abstractmethod - def contents(self): - """Return an iterable of strings over the contents of the package.""" - return [] - - -_register(ResourceReader, machinery.SourceFileLoader) + def contents(self) -> Iterable[str]: + """Return an iterable of entries in `package`.""" + raise FileNotFoundError @runtime_checkable @@ -355,26 +352,28 @@ def iterdir(self): Yield Traversable objects in self """ - @abc.abstractmethod def read_bytes(self): """ Read contents of self as bytes """ + with self.open('rb') as strm: + return strm.read() - @abc.abstractmethod def read_text(self, encoding=None): """ - Read contents of self as bytes + Read contents of self as text """ + with self.open(encoding=encoding) as strm: + return strm.read() @abc.abstractmethod - def is_dir(self): + def is_dir(self) -> bool: """ Return True if self is a dir """ @abc.abstractmethod - def is_file(self): + def is_file(self) -> bool: """ Return True if self is a file """ @@ -385,11 +384,11 @@ def joinpath(self, child): Return Traversable child in self """ - @abc.abstractmethod def __truediv__(self, child): """ Return Traversable child in self """ + return self.joinpath(child) @abc.abstractmethod def open(self, mode='r', *args, **kwargs): @@ -402,14 +401,18 @@ def open(self, mode='r', *args, **kwargs): """ @abc.abstractproperty - def name(self): - # type: () -> str + def name(self) -> str: """ The base name of this object without any parent references. """ class TraversableResources(ResourceReader): + """ + The required interface for providing traversable + resources. + """ + @abc.abstractmethod def files(self): """Return a Traversable object for the loaded package.""" diff --git a/Lib/importlib/readers.py b/Lib/importlib/readers.py index 74a63e4a7535b..535c8283e9081 100644 --- a/Lib/importlib/readers.py +++ b/Lib/importlib/readers.py @@ -1,8 +1,13 @@ +import collections import zipfile import pathlib from . import abc +def remove_duplicates(items): + return iter(collections.OrderedDict.fromkeys(items)) + + class FileReader(abc.TraversableResources): def __init__(self, loader): self.path = pathlib.Path(loader.path).parent @@ -39,3 +44,80 @@ def is_resource(self, path): def files(self): return zipfile.Path(self.archive, self.prefix) + + +class MultiplexedPath(abc.Traversable): + """ + Given a series of Traversable objects, implement a merged + version of the interface across all objects. Useful for + namespace packages which may be multihomed at a single + name. + """ + + def __init__(self, *paths): + self._paths = list(map(pathlib.Path, remove_duplicates(paths))) + if not self._paths: + message = 'MultiplexedPath must contain at least one path' + raise FileNotFoundError(message) + if not all(path.is_dir() for path in self._paths): + raise NotADirectoryError('MultiplexedPath only supports directories') + + def iterdir(self): + visited = [] + for path in self._paths: + for file in path.iterdir(): + if file.name in visited: + continue + visited.append(file.name) + yield file + + def read_bytes(self): + raise FileNotFoundError(f'{self} is not a file') + + def read_text(self, *args, **kwargs): + raise FileNotFoundError(f'{self} is not a file') + + def is_dir(self): + return True + + def is_file(self): + return False + + def joinpath(self, child): + # first try to find child in current paths + for file in self.iterdir(): + if file.name == child: + return file + # if it does not exist, construct it with the first path + return self._paths[0] / child + + __truediv__ = joinpath + + def open(self, *args, **kwargs): + raise FileNotFoundError('{} is not a file'.format(self)) + + def name(self): + return self._paths[0].name + + def __repr__(self): + return 'MultiplexedPath({})'.format( + ', '.join("'{}'".format(path) for path in self._paths) + ) + + +class NamespaceReader(abc.TraversableResources): + def __init__(self, namespace_path): + if 'NamespacePath' not in str(namespace_path): + raise ValueError('Invalid path') + self.path = MultiplexedPath(*list(namespace_path)) + + def resource_path(self, resource): + """ + Return the file system path to prevent + `resources.path()` from creating a temporary + copy. + """ + return str(self.path.joinpath(resource)) + + def files(self): + return self.path diff --git a/Lib/importlib/resources.py b/Lib/importlib/resources.py index 4169171b189cc..db0e0c0eeff80 100644 --- a/Lib/importlib/resources.py +++ b/Lib/importlib/resources.py @@ -3,8 +3,10 @@ from . import _common from ._common import as_file, files +from .abc import ResourceReader from contextlib import suppress from importlib.abc import ResourceLoader +from importlib.machinery import ModuleSpec from io import BytesIO, TextIOWrapper from pathlib import Path from types import ModuleType @@ -18,6 +20,7 @@ __all__ = [ 'Package', 'Resource', + 'ResourceReader', 'as_file', 'contents', 'files', @@ -27,7 +30,7 @@ 'path', 'read_binary', 'read_text', - ] +] Package = Union[str, ModuleType] @@ -41,36 +44,45 @@ def open_binary(package: Package, resource: Resource) -> BinaryIO: reader = _common.get_resource_reader(package) if reader is not None: return reader.open_resource(resource) - absolute_package_path = os.path.abspath( - package.__spec__.origin or 'non-existent file') - package_path = os.path.dirname(absolute_package_path) - full_path = os.path.join(package_path, resource) - try: - return open(full_path, mode='rb') - except OSError: - # Just assume the loader is a resource loader; all the relevant - # importlib.machinery loaders are and an AttributeError for - # get_data() will make it clear what is needed from the loader. - loader = cast(ResourceLoader, package.__spec__.loader) - data = None - if hasattr(package.__spec__.loader, 'get_data'): - with suppress(OSError): - data = loader.get_data(full_path) - if data is None: - package_name = package.__spec__.name - message = '{!r} resource not found in {!r}'.format( - resource, package_name) - raise FileNotFoundError(message) - return BytesIO(data) - - -def open_text(package: Package, - resource: Resource, - encoding: str = 'utf-8', - errors: str = 'strict') -> TextIO: + spec = cast(ModuleSpec, package.__spec__) + # Using pathlib doesn't work well here due to the lack of 'strict' + # argument for pathlib.Path.resolve() prior to Python 3.6. + if spec.submodule_search_locations is not None: + paths = spec.submodule_search_locations + elif spec.origin is not None: + paths = [os.path.dirname(os.path.abspath(spec.origin))] + + for package_path in paths: + full_path = os.path.join(package_path, resource) + try: + return open(full_path, mode='rb') + except OSError: + # Just assume the loader is a resource loader; all the relevant + # importlib.machinery loaders are and an AttributeError for + # get_data() will make it clear what is needed from the loader. + loader = cast(ResourceLoader, spec.loader) + data = None + if hasattr(spec.loader, 'get_data'): + with suppress(OSError): + data = loader.get_data(full_path) + if data is not None: + return BytesIO(data) + + raise FileNotFoundError( + '{!r} resource not found in {!r}'.format(resource, spec.name) + ) + + +def open_text( + package: Package, + resource: Resource, + encoding: str = 'utf-8', + errors: str = 'strict', +) -> TextIO: """Return a file-like object opened for text reading of the resource.""" return TextIOWrapper( - open_binary(package, resource), encoding=encoding, errors=errors) + open_binary(package, resource), encoding=encoding, errors=errors + ) def read_binary(package: Package, resource: Resource) -> bytes: @@ -79,10 +91,12 @@ def read_binary(package: Package, resource: Resource) -> bytes: return fp.read() -def read_text(package: Package, - resource: Resource, - encoding: str = 'utf-8', - errors: str = 'strict') -> str: +def read_text( + package: Package, + resource: Resource, + encoding: str = 'utf-8', + errors: str = 'strict', +) -> str: """Return the decoded string of the resource. The decoding-related arguments have the same semantics as those of @@ -93,8 +107,9 @@ def read_text(package: Package, def path( - package: Package, resource: Resource, - ) -> 'ContextManager[Path]': + package: Package, + resource: Resource, +) -> 'ContextManager[Path]': """A context manager providing a file path object to the resource. If the resource does not already exist on its own on the file system, @@ -106,15 +121,17 @@ def path( reader = _common.get_resource_reader(_common.get_package(package)) return ( _path_from_reader(reader, _common.normalize_path(resource)) - if reader else - _common.as_file( - _common.files(package).joinpath(_common.normalize_path(resource))) + if reader + else _common.as_file( + _common.files(package).joinpath(_common.normalize_path(resource)) ) + ) def _path_from_reader(reader, resource): - return _path_from_resource_path(reader, resource) or \ - _path_from_open_resource(reader, resource) + return _path_from_resource_path(reader, resource) or _path_from_open_resource( + reader, resource + ) def _path_from_resource_path(reader, resource): @@ -154,15 +171,10 @@ def contents(package: Package) -> Iterable[str]: reader = _common.get_resource_reader(package) if reader is not None: return _ensure_sequence(reader.contents()) - # Is the package a namespace package? By definition, namespace packages - # cannot have resources. - namespace = ( - package.__spec__.origin is None or - package.__spec__.origin == 'namespace' - ) - if namespace or not package.__spec__.has_location: - return () - return list(item.name for item in _common.from_package(package).iterdir()) + transversable = _common.from_package(package) + if transversable.is_dir(): + return list(item.name for item in transversable.iterdir()) + return [] @singledispatch diff --git a/Lib/test/test_importlib/namespacedata01/binary.file b/Lib/test/test_importlib/namespacedata01/binary.file new file mode 100644 index 0000000000000..eaf36c1daccfd Binary files /dev/null and b/Lib/test/test_importlib/namespacedata01/binary.file differ diff --git a/Lib/test/test_importlib/namespacedata01/utf-16.file b/Lib/test/test_importlib/namespacedata01/utf-16.file new file mode 100644 index 0000000000000..2cb772295ef4b Binary files /dev/null and b/Lib/test/test_importlib/namespacedata01/utf-16.file differ diff --git a/Lib/test/test_importlib/namespacedata01/utf-8.file b/Lib/test/test_importlib/namespacedata01/utf-8.file new file mode 100644 index 0000000000000..1c0132ad90a19 --- /dev/null +++ b/Lib/test/test_importlib/namespacedata01/utf-8.file @@ -0,0 +1 @@ +Hello, UTF-8 world! diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index d8b9fc89f29aa..d1c89c183b79f 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -338,7 +338,9 @@ def test_is_resource(self): self.ins.is_resource('dummy_file') def test_contents(self): - self.assertEqual([], list(self.ins.contents())) + with self.assertRaises(FileNotFoundError): + self.ins.contents() + (Frozen_RRDefaultTests, Source_RRDefaultsTests diff --git a/Lib/test/test_importlib/test_files.py b/Lib/test/test_importlib/test_files.py index fa7af82bf0c28..1e7a1f3cbcc54 100644 --- a/Lib/test/test_importlib/test_files.py +++ b/Lib/test/test_importlib/test_files.py @@ -21,7 +21,7 @@ def test_read_text(self): @unittest.skipUnless( hasattr(typing, 'runtime_checkable'), "Only suitable when typing supports runtime_checkable", - ) + ) def test_traversable(self): assert isinstance(resources.files(self.data), Traversable) diff --git a/Lib/test/test_importlib/test_open.py b/Lib/test/test_importlib/test_open.py index fd6e84b70f65c..b75675f43b63f 100644 --- a/Lib/test/test_importlib/test_open.py +++ b/Lib/test/test_importlib/test_open.py @@ -29,34 +29,32 @@ def test_open_text_default_encoding(self): self.assertEqual(result, 'Hello, UTF-8 world!\n') def test_open_text_given_encoding(self): - with resources.open_text( - self.data, 'utf-16.file', 'utf-16', 'strict') as fp: + with resources.open_text(self.data, 'utf-16.file', 'utf-16', 'strict') as fp: result = fp.read() self.assertEqual(result, 'Hello, UTF-16 world!\n') def test_open_text_with_errors(self): # Raises UnicodeError without the 'errors' argument. - with resources.open_text( - self.data, 'utf-16.file', 'utf-8', 'strict') as fp: + with resources.open_text(self.data, 'utf-16.file', 'utf-8', 'strict') as fp: self.assertRaises(UnicodeError, fp.read) - with resources.open_text( - self.data, 'utf-16.file', 'utf-8', 'ignore') as fp: + with resources.open_text(self.data, 'utf-16.file', 'utf-8', 'ignore') as fp: result = fp.read() self.assertEqual( result, 'H\x00e\x00l\x00l\x00o\x00,\x00 ' '\x00U\x00T\x00F\x00-\x001\x006\x00 ' - '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00') + '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00', + ) def test_open_binary_FileNotFoundError(self): self.assertRaises( - FileNotFoundError, - resources.open_binary, self.data, 'does-not-exist') + FileNotFoundError, resources.open_binary, self.data, 'does-not-exist' + ) def test_open_text_FileNotFoundError(self): self.assertRaises( - FileNotFoundError, - resources.open_text, self.data, 'does-not-exist') + FileNotFoundError, resources.open_text, self.data, 'does-not-exist' + ) class OpenDiskTests(OpenTests, unittest.TestCase): @@ -64,6 +62,13 @@ def setUp(self): self.data = data01 +class OpenDiskNamespaceTests(OpenTests, unittest.TestCase): + def setUp(self): + from . import namespacedata01 + + self.data = namespacedata01 + + class OpenZipTests(OpenTests, util.ZipSetup, unittest.TestCase): pass diff --git a/Lib/test/test_importlib/test_path.py b/Lib/test/test_importlib/test_path.py index abf8086558158..2110770e2ac09 100644 --- a/Lib/test/test_importlib/test_path.py +++ b/Lib/test/test_importlib/test_path.py @@ -1,3 +1,4 @@ +import io import unittest from importlib import resources @@ -37,6 +38,17 @@ def test_natural_path(self): assert 'data' in str(path) +class PathMemoryTests(PathTests, unittest.TestCase): + def setUp(self): + file = io.BytesIO(b'Hello, UTF-8 world!\n') + self.addCleanup(file.close) + self.data = util.create_package( + file=file, path=FileNotFoundError("package exists only in memory") + ) + self.data.__spec__.origin = None + self.data.__spec__.has_location = False + + class PathZipTests(PathTests, util.ZipSetup, unittest.TestCase): def test_remove_in_context_manager(self): # It is not an error if the file that was temporarily stashed on the diff --git a/Lib/test/test_importlib/test_read.py b/Lib/test/test_importlib/test_read.py index ff78d0b2948f6..f6ec13af62d13 100644 --- a/Lib/test/test_importlib/test_read.py +++ b/Lib/test/test_importlib/test_read.py @@ -25,20 +25,19 @@ def test_read_text_default_encoding(self): self.assertEqual(result, 'Hello, UTF-8 world!\n') def test_read_text_given_encoding(self): - result = resources.read_text( - self.data, 'utf-16.file', encoding='utf-16') + result = resources.read_text(self.data, 'utf-16.file', encoding='utf-16') self.assertEqual(result, 'Hello, UTF-16 world!\n') def test_read_text_with_errors(self): # Raises UnicodeError without the 'errors' argument. - self.assertRaises( - UnicodeError, resources.read_text, self.data, 'utf-16.file') + self.assertRaises(UnicodeError, resources.read_text, self.data, 'utf-16.file') result = resources.read_text(self.data, 'utf-16.file', errors='ignore') self.assertEqual( result, 'H\x00e\x00l\x00l\x00o\x00,\x00 ' '\x00U\x00T\x00F\x00-\x001\x006\x00 ' - '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00') + '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00', + ) class ReadDiskTests(ReadTests, unittest.TestCase): @@ -48,13 +47,11 @@ class ReadDiskTests(ReadTests, unittest.TestCase): class ReadZipTests(ReadTests, util.ZipSetup, unittest.TestCase): def test_read_submodule_resource(self): submodule = import_module('ziptestdata.subdirectory') - result = resources.read_binary( - submodule, 'binary.file') + result = resources.read_binary(submodule, 'binary.file') self.assertEqual(result, b'\0\1\2\3') def test_read_submodule_resource_by_name(self): - result = resources.read_binary( - 'ziptestdata.subdirectory', 'binary.file') + result = resources.read_binary('ziptestdata.subdirectory', 'binary.file') self.assertEqual(result, b'\0\1\2\3') diff --git a/Lib/test/test_importlib/test_reader.py b/Lib/test/test_importlib/test_reader.py new file mode 100644 index 0000000000000..905d4fcdece74 --- /dev/null +++ b/Lib/test/test_importlib/test_reader.py @@ -0,0 +1,123 @@ +import os.path +import sys +import pathlib +import unittest + +from importlib import import_module +from importlib.readers import MultiplexedPath, NamespaceReader + + +class MultiplexedPathTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + path = pathlib.Path(__file__).parent / 'namespacedata01' + cls.folder = str(path) + + def test_init_no_paths(self): + with self.assertRaises(FileNotFoundError): + MultiplexedPath() + + def test_init_file(self): + with self.assertRaises(NotADirectoryError): + MultiplexedPath(os.path.join(self.folder, 'binary.file')) + + def test_iterdir(self): + contents = {path.name for path in MultiplexedPath(self.folder).iterdir()} + try: + contents.remove('__pycache__') + except (KeyError, ValueError): + pass + self.assertEqual(contents, {'binary.file', 'utf-16.file', 'utf-8.file'}) + + def test_iterdir_duplicate(self): + data01 = os.path.abspath(os.path.join(__file__, '..', 'data01')) + contents = { + path.name for path in MultiplexedPath(self.folder, data01).iterdir() + } + for remove in ('__pycache__', '__init__.pyc'): + try: + contents.remove(remove) + except (KeyError, ValueError): + pass + self.assertEqual( + contents, + {'__init__.py', 'binary.file', 'subdirectory', 'utf-16.file', 'utf-8.file'}, + ) + + def test_is_dir(self): + self.assertEqual(MultiplexedPath(self.folder).is_dir(), True) + + def test_is_file(self): + self.assertEqual(MultiplexedPath(self.folder).is_file(), False) + + def test_open_file(self): + path = MultiplexedPath(self.folder) + with self.assertRaises(FileNotFoundError): + path.read_bytes() + with self.assertRaises(FileNotFoundError): + path.read_text() + with self.assertRaises(FileNotFoundError): + path.open() + + def test_join_path(self): + print('test_join_path') + prefix = os.path.abspath(os.path.join(__file__, '..')) + data01 = os.path.join(prefix, 'data01') + path = MultiplexedPath(self.folder, data01) + self.assertEqual( + str(path.joinpath('binary.file'))[len(prefix) + 1 :], + os.path.join('namespacedata01', 'binary.file'), + ) + self.assertEqual( + str(path.joinpath('subdirectory'))[len(prefix) + 1 :], + os.path.join('data01', 'subdirectory'), + ) + self.assertEqual( + str(path.joinpath('imaginary'))[len(prefix) + 1 :], + os.path.join('namespacedata01', 'imaginary'), + ) + + def test_repr(self): + self.assertEqual( + repr(MultiplexedPath(self.folder)), + "MultiplexedPath('{}')".format(self.folder), + ) + + +class NamespaceReaderTest(unittest.TestCase): + site_dir = str(pathlib.Path(__file__).parent) + + @classmethod + def setUpClass(cls): + sys.path.append(cls.site_dir) + + @classmethod + def tearDownClass(cls): + sys.path.remove(cls.site_dir) + + def test_init_error(self): + with self.assertRaises(ValueError): + NamespaceReader(['path1', 'path2']) + + def test_resource_path(self): + namespacedata01 = import_module('namespacedata01') + reader = NamespaceReader(namespacedata01.__spec__.submodule_search_locations) + + root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01')) + self.assertEqual( + reader.resource_path('binary.file'), os.path.join(root, 'binary.file') + ) + self.assertEqual( + reader.resource_path('imaginary'), os.path.join(root, 'imaginary') + ) + + def test_files(self): + namespacedata01 = import_module('namespacedata01') + reader = NamespaceReader(namespacedata01.__spec__.submodule_search_locations) + root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01')) + self.assertIsInstance(reader.files(), MultiplexedPath) + self.assertEqual(repr(reader.files()), "MultiplexedPath('{}')".format(root)) + + +if __name__ == '__main__': + unittest.main() diff --git a/Lib/test/test_importlib/test_resource.py b/Lib/test/test_importlib/test_resource.py index 1d1bdad1b218d..f8d861e9d4c20 100644 --- a/Lib/test/test_importlib/test_resource.py +++ b/Lib/test/test_importlib/test_resource.py @@ -27,20 +27,21 @@ def test_is_resource_subresource_directory(self): def test_contents(self): contents = set(resources.contents(self.data)) # There may be cruft in the directory listing of the data directory. - # Under Python 3 we could have a __pycache__ directory, and under - # Python 2 we could have .pyc files. These are both artifacts of the - # test suite importing these modules and writing these caches. They - # aren't germane to this test, so just filter them out. + # It could have a __pycache__ directory, + # an artifact of the + # test suite importing these modules, which + # are not germane to this test, so just filter them out. contents.discard('__pycache__') - contents.discard('__init__.pyc') - contents.discard('__init__.pyo') - self.assertEqual(contents, { - '__init__.py', - 'subdirectory', - 'utf-8.file', - 'binary.file', - 'utf-16.file', - }) + self.assertEqual( + contents, + { + '__init__.py', + 'subdirectory', + 'utf-8.file', + 'binary.file', + 'utf-16.file', + }, + ) class ResourceDiskTests(ResourceTests, unittest.TestCase): @@ -55,27 +56,26 @@ class ResourceZipTests(ResourceTests, util.ZipSetup, unittest.TestCase): class ResourceLoaderTests(unittest.TestCase): def test_resource_contents(self): package = util.create_package( - file=data01, path=data01.__file__, contents=['A', 'B', 'C']) - self.assertEqual( - set(resources.contents(package)), - {'A', 'B', 'C'}) + file=data01, path=data01.__file__, contents=['A', 'B', 'C'] + ) + self.assertEqual(set(resources.contents(package)), {'A', 'B', 'C'}) def test_resource_is_resource(self): package = util.create_package( - file=data01, path=data01.__file__, - contents=['A', 'B', 'C', 'D/E', 'D/F']) + file=data01, path=data01.__file__, contents=['A', 'B', 'C', 'D/E', 'D/F'] + ) self.assertTrue(resources.is_resource(package, 'B')) def test_resource_directory_is_not_resource(self): package = util.create_package( - file=data01, path=data01.__file__, - contents=['A', 'B', 'C', 'D/E', 'D/F']) + file=data01, path=data01.__file__, contents=['A', 'B', 'C', 'D/E', 'D/F'] + ) self.assertFalse(resources.is_resource(package, 'D')) def test_resource_missing_is_not_resource(self): package = util.create_package( - file=data01, path=data01.__file__, - contents=['A', 'B', 'C', 'D/E', 'D/F']) + file=data01, path=data01.__file__, contents=['A', 'B', 'C', 'D/E', 'D/F'] + ) self.assertFalse(resources.is_resource(package, 'Z')) @@ -86,90 +86,63 @@ def test_package_has_no_reader_fallback(self): # 2. Are not on the file system # 3. Are not in a zip file module = util.create_package( - file=data01, path=data01.__file__, contents=['A', 'B', 'C']) + file=data01, path=data01.__file__, contents=['A', 'B', 'C'] + ) # Give the module a dummy loader. module.__loader__ = object() # Give the module a dummy origin. module.__file__ = '/path/which/shall/not/be/named' - if sys.version_info >= (3,): - module.__spec__.loader = module.__loader__ - module.__spec__.origin = module.__file__ + module.__spec__.loader = module.__loader__ + module.__spec__.origin = module.__file__ self.assertFalse(resources.is_resource(module, 'A')) -class ResourceFromZipsTest(util.ZipSetupBase, unittest.TestCase): - ZIP_MODULE = zipdata02 # type: ignore - - def test_unrelated_contents(self): - # https://gitlab.com/python-devs/importlib_resources/issues/44 - # - # Here we have a zip file with two unrelated subpackages. The bug - # reports that getting the contents of a resource returns unrelated - # files. - self.assertEqual( - set(resources.contents('ziptestdata.one')), - {'__init__.py', 'resource1.txt'}) - self.assertEqual( - set(resources.contents('ziptestdata.two')), - {'__init__.py', 'resource2.txt'}) - - -class SubdirectoryResourceFromZipsTest(util.ZipSetupBase, unittest.TestCase): - ZIP_MODULE = zipdata01 # type: ignore +class ResourceFromZipsTest01(util.ZipSetupBase, unittest.TestCase): + ZIP_MODULE = zipdata01 # type: ignore def test_is_submodule_resource(self): submodule = import_module('ziptestdata.subdirectory') - self.assertTrue( - resources.is_resource(submodule, 'binary.file')) + self.assertTrue(resources.is_resource(submodule, 'binary.file')) def test_read_submodule_resource_by_name(self): self.assertTrue( - resources.is_resource('ziptestdata.subdirectory', 'binary.file')) + resources.is_resource('ziptestdata.subdirectory', 'binary.file') + ) def test_submodule_contents(self): submodule = import_module('ziptestdata.subdirectory') self.assertEqual( - set(resources.contents(submodule)), - {'__init__.py', 'binary.file'}) + set(resources.contents(submodule)), {'__init__.py', 'binary.file'} + ) def test_submodule_contents_by_name(self): self.assertEqual( set(resources.contents('ziptestdata.subdirectory')), - {'__init__.py', 'binary.file'}) - - -class NamespaceTest(unittest.TestCase): - def test_namespaces_cannot_have_resources(self): - contents = resources.contents('test.test_importlib.data03.namespace') - self.assertFalse(list(contents)) - # Even though there is a file in the namespace directory, it is not - # considered a resource, since namespace packages can't have them. - self.assertFalse(resources.is_resource( - 'test.test_importlib.data03.namespace', - 'resource1.txt')) - # We should get an exception if we try to read it or open it. - self.assertRaises( - FileNotFoundError, - resources.open_text, - 'test.test_importlib.data03.namespace', 'resource1.txt') - self.assertRaises( - FileNotFoundError, - resources.open_binary, - 'test.test_importlib.data03.namespace', 'resource1.txt') - self.assertRaises( - FileNotFoundError, - resources.read_text, - 'test.test_importlib.data03.namespace', 'resource1.txt') - self.assertRaises( - FileNotFoundError, - resources.read_binary, - 'test.test_importlib.data03.namespace', 'resource1.txt') + {'__init__.py', 'binary.file'}, + ) + + +class ResourceFromZipsTest02(util.ZipSetupBase, unittest.TestCase): + ZIP_MODULE = zipdata02 # type: ignore + + def test_unrelated_contents(self): + """ + Test thata zip with two unrelated subpackages return + distinct resources. Ref python/importlib_resources#44. + """ + self.assertEqual( + set(resources.contents('ziptestdata.one')), {'__init__.py', 'resource1.txt'} + ) + self.assertEqual( + set(resources.contents('ziptestdata.two')), {'__init__.py', 'resource2.txt'} + ) class DeletingZipsTest(unittest.TestCase): """Having accessed resources in a zip file should not keep an open reference to the zip. """ + ZIP_MODULE = zipdata01 def setUp(self): @@ -241,5 +214,41 @@ def test_read_text_does_not_keep_open(self): del c +class ResourceFromNamespaceTest01(unittest.TestCase): + site_dir = str(pathlib.Path(__file__).parent) + + @classmethod + def setUpClass(cls): + sys.path.append(cls.site_dir) + + @classmethod + def tearDownClass(cls): + sys.path.remove(cls.site_dir) + + def test_is_submodule_resource(self): + self.assertTrue( + resources.is_resource(import_module('namespacedata01'), 'binary.file') + ) + + def test_read_submodule_resource_by_name(self): + self.assertTrue(resources.is_resource('namespacedata01', 'binary.file')) + + def test_submodule_contents(self): + contents = set(resources.contents(import_module('namespacedata01'))) + try: + contents.remove('__pycache__') + except KeyError: + pass + self.assertEqual(contents, {'binary.file', 'utf-8.file', 'utf-16.file'}) + + def test_submodule_contents_by_name(self): + contents = set(resources.contents('namespacedata01')) + try: + contents.remove('__pycache__') + except KeyError: + pass + self.assertEqual(contents, {'binary.file', 'utf-8.file', 'utf-16.file'}) + + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_importlib/update-zips.py b/Lib/test/test_importlib/update-zips.py new file mode 100755 index 0000000000000..9ef0224ca65ca --- /dev/null +++ b/Lib/test/test_importlib/update-zips.py @@ -0,0 +1,53 @@ +""" +Generate the zip test data files. + +Run to build the tests/zipdataNN/ziptestdata.zip files from +files in tests/dataNN. + +Replaces the file with the working copy, but does commit anything +to the source repo. +""" + +import contextlib +import os +import pathlib +import zipfile + + +def main(): + """ + >>> from unittest import mock + >>> monkeypatch = getfixture('monkeypatch') + >>> monkeypatch.setattr(zipfile, 'ZipFile', mock.MagicMock()) + >>> print(); main() # print workaround for bpo-32509 + + ...data01... -> ziptestdata/... + ... + ...data02... -> ziptestdata/... + ... + """ + suffixes = '01', '02' + tuple(map(generate, suffixes)) + + +def generate(suffix): + root = pathlib.Path(__file__).parent.relative_to(os.getcwd()) + zfpath = root / f'zipdata{suffix}/ziptestdata.zip' + with zipfile.ZipFile(zfpath, 'w') as zf: + for src, rel in walk(root / f'data{suffix}'): + dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix()) + print(src, '->', dst) + zf.write(src, dst) + + +def walk(datapath): + for dirpath, dirnames, filenames in os.walk(datapath): + with contextlib.suppress(KeyError): + dirnames.remove('__pycache__') + for filename in filenames: + res = pathlib.Path(dirpath) / filename + rel = res.relative_to(datapath) + yield res, rel + + +__name__ == '__main__' and main() diff --git a/Lib/test/test_importlib/zipdata01/ziptestdata.zip b/Lib/test/test_importlib/zipdata01/ziptestdata.zip index 12f7872cd596a..9a3bb0739f87e 100644 Binary files a/Lib/test/test_importlib/zipdata01/ziptestdata.zip and b/Lib/test/test_importlib/zipdata01/ziptestdata.zip differ diff --git a/Lib/test/test_importlib/zipdata02/ziptestdata.zip b/Lib/test/test_importlib/zipdata02/ziptestdata.zip index 9ee00586e75f1..d63ff512d2807 100644 Binary files a/Lib/test/test_importlib/zipdata02/ziptestdata.zip and b/Lib/test/test_importlib/zipdata02/ziptestdata.zip differ diff --git a/Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst b/Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst new file mode 100644 index 0000000000000..4b8f5029fefec --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst @@ -0,0 +1,3 @@ +``importlib.resources`` now honors namespace packages, merging resources +from each location in the namespace as introduced in +``importlib_resources`` 3.2 and including incidental changes through 5.0.3. diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 6b4cd39e35515..108f59e2631c4 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1529,7 +1529,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 67,0,0,0,115,20,0,0,0,100,1,100,2,108,0,109, 1,125,2,1,0,124,2,124,0,131,1,83,0,41,3,78, 114,0,0,0,0,41,1,218,10,70,105,108,101,82,101,97, - 100,101,114,41,2,90,17,105,109,112,111,114,116,108,105,98, + 100,101,114,41,2,218,17,105,109,112,111,114,116,108,105,98, 46,114,101,97,100,101,114,115,114,18,1,0,0,41,3,114, 130,0,0,0,114,231,0,0,0,114,18,1,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,218,19,103, @@ -1540,7 +1540,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 114,41,13,114,137,0,0,0,114,136,0,0,0,114,138,0, 0,0,114,139,0,0,0,114,223,0,0,0,114,3,1,0, 0,114,9,1,0,0,114,147,0,0,0,114,235,0,0,0, - 114,190,0,0,0,114,242,0,0,0,114,19,1,0,0,90, + 114,190,0,0,0,114,242,0,0,0,114,20,1,0,0,90, 13,95,95,99,108,97,115,115,99,101,108,108,95,95,114,7, 0,0,0,114,7,0,0,0,114,12,1,0,0,114,8,0, 0,0,114,254,0,0,0,218,3,0,0,115,26,0,0,0, @@ -1580,7 +1580,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,115,6,0,0,0,8,2,16,1,255,128,122,32,83,111, 117,114,99,101,70,105,108,101,76,111,97,100,101,114,46,95, 99,97,99,104,101,95,98,121,116,101,99,111,100,101,114,75, - 0,0,0,114,22,1,0,0,99,3,0,0,0,0,0,0, + 0,0,0,114,23,1,0,0,99,3,0,0,0,0,0,0, 0,1,0,0,0,9,0,0,0,11,0,0,0,67,0,0, 0,115,254,0,0,0,116,0,124,1,131,1,92,2,125,4, 125,5,103,0,125,6,124,4,114,62,116,1,124,4,131,1, @@ -1608,7 +1608,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 5,109,107,100,105,114,218,15,70,105,108,101,69,120,105,115, 116,115,69,114,114,111,114,114,64,0,0,0,114,146,0,0, 0,114,160,0,0,0,114,84,0,0,0,41,9,114,130,0, - 0,0,114,58,0,0,0,114,42,0,0,0,114,23,1,0, + 0,0,114,58,0,0,0,114,42,0,0,0,114,24,1,0, 0,218,6,112,97,114,101,110,116,114,108,0,0,0,114,53, 0,0,0,114,49,0,0,0,114,243,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,114,240,0,0, @@ -1621,9 +1621,9 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 41,7,114,137,0,0,0,114,136,0,0,0,114,138,0,0, 0,114,139,0,0,0,114,239,0,0,0,114,241,0,0,0, 114,240,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,20,1,0,0,12,4, + 7,0,0,0,114,8,0,0,0,114,21,1,0,0,12,4, 0,0,115,12,0,0,0,8,0,4,2,8,2,8,5,18, - 5,255,128,114,20,1,0,0,99,0,0,0,0,0,0,0, + 5,255,128,114,21,1,0,0,99,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, 0,115,32,0,0,0,101,0,90,1,100,0,90,2,100,1, 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, @@ -1660,9 +1660,9 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 117,114,99,101,78,41,6,114,137,0,0,0,114,136,0,0, 0,114,138,0,0,0,114,139,0,0,0,114,228,0,0,0, 114,244,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,26,1,0,0,57,4, + 7,0,0,0,114,8,0,0,0,114,27,1,0,0,57,4, 0,0,115,10,0,0,0,8,0,4,2,8,2,12,16,255, - 128,114,26,1,0,0,99,0,0,0,0,0,0,0,0,0, + 128,114,27,1,0,0,99,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, 92,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, @@ -1754,7 +1754,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 103,101,46,60,108,111,99,97,108,115,62,46,60,103,101,110, 101,120,112,114,62,78,41,4,114,61,0,0,0,114,58,0, 0,0,218,3,97,110,121,114,219,0,0,0,114,234,0,0, - 0,114,7,0,0,0,114,30,1,0,0,114,8,0,0,0, + 0,114,7,0,0,0,114,31,1,0,0,114,8,0,0,0, 114,193,0,0,0,115,4,0,0,115,10,0,0,0,14,2, 12,1,2,1,8,255,255,128,122,30,69,120,116,101,110,115, 105,111,110,70,105,108,101,76,111,97,100,101,114,46,105,115, @@ -1847,8 +1847,8 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 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,86,0,0,0,114, 10,0,0,0,41,2,114,16,0,0,0,114,58,0,0,0, - 90,8,95,95,112,97,116,104,95,95,78,41,2,114,33,1, - 0,0,114,55,0,0,0,41,4,114,130,0,0,0,114,25, + 90,8,95,95,112,97,116,104,95,95,78,41,2,114,34,1, + 0,0,114,55,0,0,0,41,4,114,130,0,0,0,114,26, 1,0,0,218,3,100,111,116,90,2,109,101,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,218,23,95,102,105, 110,100,95,112,97,114,101,110,116,95,112,97,116,104,95,110, @@ -1860,12 +1860,12 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 3,0,0,0,67,0,0,0,115,28,0,0,0,124,0,160, 0,161,0,92,2,125,1,125,2,116,1,116,2,106,3,124, 1,25,0,124,2,131,2,83,0,114,121,0,0,0,41,4, - 114,40,1,0,0,114,142,0,0,0,114,16,0,0,0,218, + 114,41,1,0,0,114,142,0,0,0,114,16,0,0,0,218, 7,109,111,100,117,108,101,115,41,3,114,130,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,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,35,1,0,0,158,4,0,0,115,6,0,0,0, + 0,0,114,36,1,0,0,158,4,0,0,115,6,0,0,0, 12,1,16,1,255,128,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, @@ -1876,9 +1876,9 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 68,124,2,106,5,100,0,117,0,114,68,124,2,106,6,114, 68,124,2,106,6,124,0,95,7,124,1,124,0,95,2,124, 0,106,7,83,0,114,121,0,0,0,41,8,114,123,0,0, - 0,114,35,1,0,0,114,36,1,0,0,114,37,1,0,0, - 114,33,1,0,0,114,151,0,0,0,114,189,0,0,0,114, - 34,1,0,0,41,3,114,130,0,0,0,90,11,112,97,114, + 0,114,36,1,0,0,114,37,1,0,0,114,38,1,0,0, + 114,34,1,0,0,114,151,0,0,0,114,189,0,0,0,114, + 35,1,0,0,41,3,114,130,0,0,0,90,11,112,97,114, 101,110,116,95,112,97,116,104,114,198,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,218,12,95,114, 101,99,97,108,99,117,108,97,116,101,162,4,0,0,115,18, @@ -1888,7 +1888,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 116,101,99,1,0,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,3,0,0,0,67,0,0,0,243,12,0,0,0, 116,0,124,0,160,1,161,0,131,1,83,0,114,121,0,0, - 0,41,2,218,4,105,116,101,114,114,42,1,0,0,114,8, + 0,41,2,218,4,105,116,101,114,114,43,1,0,0,114,8, 1,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, 0,0,218,8,95,95,105,116,101,114,95,95,175,4,0,0, 243,4,0,0,0,12,1,255,128,122,23,95,78,97,109,101, @@ -1896,764 +1896,776 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 95,95,99,2,0,0,0,0,0,0,0,0,0,0,0,2, 0,0,0,2,0,0,0,67,0,0,0,115,12,0,0,0, 124,0,160,0,161,0,124,1,25,0,83,0,114,121,0,0, - 0,169,1,114,42,1,0,0,41,2,114,130,0,0,0,218, + 0,169,1,114,43,1,0,0,41,2,114,130,0,0,0,218, 5,105,110,100,101,120,114,7,0,0,0,114,7,0,0,0, 114,8,0,0,0,218,11,95,95,103,101,116,105,116,101,109, - 95,95,178,4,0,0,114,46,1,0,0,122,26,95,78,97, + 95,95,178,4,0,0,114,47,1,0,0,122,26,95,78,97, 109,101,115,112,97,99,101,80,97,116,104,46,95,95,103,101, 116,105,116,101,109,95,95,99,3,0,0,0,0,0,0,0, 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, 115,14,0,0,0,124,2,124,0,106,0,124,1,60,0,100, - 0,83,0,114,121,0,0,0,41,1,114,34,1,0,0,41, - 3,114,130,0,0,0,114,48,1,0,0,114,58,0,0,0, + 0,83,0,114,121,0,0,0,41,1,114,35,1,0,0,41, + 3,114,130,0,0,0,114,49,1,0,0,114,58,0,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,218, 11,95,95,115,101,116,105,116,101,109,95,95,181,4,0,0, 115,4,0,0,0,14,1,255,128,122,26,95,78,97,109,101, 115,112,97,99,101,80,97,116,104,46,95,95,115,101,116,105, 116,101,109,95,95,99,1,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,3,0,0,0,67,0,0,0,114,43, + 0,0,1,0,0,0,3,0,0,0,67,0,0,0,114,44, 1,0,0,114,121,0,0,0,41,2,114,4,0,0,0,114, - 42,1,0,0,114,8,1,0,0,114,7,0,0,0,114,7, + 43,1,0,0,114,8,1,0,0,114,7,0,0,0,114,7, 0,0,0,114,8,0,0,0,218,7,95,95,108,101,110,95, - 95,184,4,0,0,114,46,1,0,0,122,22,95,78,97,109, + 95,184,4,0,0,114,47,1,0,0,122,22,95,78,97,109, 101,115,112,97,99,101,80,97,116,104,46,95,95,108,101,110, 95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,3,0,0,0,67,0,0,0,243,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,77,0,0,0,114,34,1,0, + 123,33,114,125,41,41,2,114,77,0,0,0,114,35,1,0, 0,114,8,1,0,0,114,7,0,0,0,114,7,0,0,0, 114,8,0,0,0,218,8,95,95,114,101,112,114,95,95,187, - 4,0,0,114,46,1,0,0,122,23,95,78,97,109,101,115, + 4,0,0,114,47,1,0,0,122,23,95,78,97,109,101,115, 112,97,99,101,80,97,116,104,46,95,95,114,101,112,114,95, 95,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, 0,0,3,0,0,0,67,0,0,0,115,12,0,0,0,124, 1,124,0,160,0,161,0,118,0,83,0,114,121,0,0,0, - 114,47,1,0,0,169,2,114,130,0,0,0,218,4,105,116, + 114,48,1,0,0,169,2,114,130,0,0,0,218,4,105,116, 101,109,114,7,0,0,0,114,7,0,0,0,114,8,0,0, 0,218,12,95,95,99,111,110,116,97,105,110,115,95,95,190, - 4,0,0,114,46,1,0,0,122,27,95,78,97,109,101,115, + 4,0,0,114,47,1,0,0,122,27,95,78,97,109,101,115, 112,97,99,101,80,97,116,104,46,95,95,99,111,110,116,97, 105,110,115,95,95,99,2,0,0,0,0,0,0,0,0,0, 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,16, 0,0,0,124,0,106,0,160,1,124,1,161,1,1,0,100, - 0,83,0,114,121,0,0,0,41,2,114,34,1,0,0,114, - 197,0,0,0,114,54,1,0,0,114,7,0,0,0,114,7, + 0,83,0,114,121,0,0,0,41,2,114,35,1,0,0,114, + 197,0,0,0,114,55,1,0,0,114,7,0,0,0,114,7, 0,0,0,114,8,0,0,0,114,197,0,0,0,193,4,0, 0,243,4,0,0,0,16,1,255,128,122,21,95,78,97,109, 101,115,112,97,99,101,80,97,116,104,46,97,112,112,101,110, 100,78,41,15,114,137,0,0,0,114,136,0,0,0,114,138, - 0,0,0,114,139,0,0,0,114,223,0,0,0,114,40,1, - 0,0,114,35,1,0,0,114,42,1,0,0,114,45,1,0, - 0,114,49,1,0,0,114,50,1,0,0,114,51,1,0,0, - 114,53,1,0,0,114,56,1,0,0,114,197,0,0,0,114, + 0,0,0,114,139,0,0,0,114,223,0,0,0,114,41,1, + 0,0,114,36,1,0,0,114,43,1,0,0,114,46,1,0, + 0,114,50,1,0,0,114,51,1,0,0,114,52,1,0,0, + 114,54,1,0,0,114,57,1,0,0,114,197,0,0,0,114, 7,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,32,1,0,0,135,4,0,0,115,28,0,0, + 0,0,0,114,33,1,0,0,135,4,0,0,115,28,0,0, 0,8,0,4,1,8,6,8,6,8,10,8,4,8,13,8, - 3,8,3,8,3,8,3,8,3,12,3,255,128,114,32,1, + 3,8,3,8,3,8,3,8,3,12,3,255,128,114,33,1, 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,3,0,0,0,64,0,0,0,115,80,0,0,0, + 0,0,0,3,0,0,0,64,0,0,0,115,88,0,0,0, 101,0,90,1,100,0,90,2,100,1,100,2,132,0,90,3, 101,4,100,3,100,4,132,0,131,1,90,5,100,5,100,6, 132,0,90,6,100,7,100,8,132,0,90,7,100,9,100,10, 132,0,90,8,100,11,100,12,132,0,90,9,100,13,100,14, - 132,0,90,10,100,15,100,16,132,0,90,11,100,17,83,0, - 41,18,218,16,95,78,97,109,101,115,112,97,99,101,76,111, - 97,100,101,114,99,4,0,0,0,0,0,0,0,0,0,0, - 0,4,0,0,0,4,0,0,0,67,0,0,0,115,18,0, - 0,0,116,0,124,1,124,2,124,3,131,3,124,0,95,1, - 100,0,83,0,114,121,0,0,0,41,2,114,32,1,0,0, - 114,34,1,0,0,114,38,1,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,223,0,0,0,199,4, - 0,0,115,4,0,0,0,18,1,255,128,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,1,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,114, - 52,1,0,0,41,3,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,78,41,2,114,77,0,0,0,114,137, - 0,0,0,41,1,114,231,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,218,11,109,111,100,117,108, - 101,95,114,101,112,114,202,4,0,0,115,4,0,0,0,12, - 7,255,128,122,28,95,78,97,109,101,115,112,97,99,101,76, - 111,97,100,101,114,46,109,111,100,117,108,101,95,114,101,112, - 114,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,114,24,0,0,0,41, - 2,78,84,114,7,0,0,0,114,234,0,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,193,0,0, - 0,211,4,0,0,243,4,0,0,0,4,1,255,128,122,27, - 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, - 46,105,115,95,112,97,99,107,97,103,101,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, - 67,0,0,0,114,24,0,0,0,41,2,78,114,10,0,0, - 0,114,7,0,0,0,114,234,0,0,0,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,114,244,0,0,0,214, - 4,0,0,114,60,1,0,0,122,27,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,46,103,101,116,95,115, - 111,117,114,99,101,99,2,0,0,0,0,0,0,0,0,0, - 0,0,2,0,0,0,6,0,0,0,67,0,0,0,115,16, - 0,0,0,116,0,100,1,100,2,100,3,100,4,100,5,141, - 4,83,0,41,6,78,114,10,0,0,0,122,8,60,115,116, - 114,105,110,103,62,114,230,0,0,0,84,41,1,114,246,0, - 0,0,41,1,114,247,0,0,0,114,234,0,0,0,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,228,0, - 0,0,217,4,0,0,114,57,1,0,0,122,25,95,78,97, - 109,101,115,112,97,99,101,76,111,97,100,101,114,46,103,101, - 116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,114, - 24,0,0,0,114,224,0,0,0,114,7,0,0,0,114,225, + 132,0,90,10,100,15,100,16,132,0,90,11,100,17,100,18, + 132,0,90,12,100,19,83,0,41,20,218,16,95,78,97,109, + 101,115,112,97,99,101,76,111,97,100,101,114,99,4,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0, + 0,67,0,0,0,115,18,0,0,0,116,0,124,1,124,2, + 124,3,131,3,124,0,95,1,100,0,83,0,114,121,0,0, + 0,41,2,114,33,1,0,0,114,35,1,0,0,114,39,1, + 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, + 0,114,223,0,0,0,199,4,0,0,115,4,0,0,0,18, + 1,255,128,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,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,114,53,1,0,0,41,3,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,78,41, + 2,114,77,0,0,0,114,137,0,0,0,41,1,114,231,0, + 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, + 0,218,11,109,111,100,117,108,101,95,114,101,112,114,202,4, + 0,0,115,4,0,0,0,12,7,255,128,122,28,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,46,109,111, + 100,117,108,101,95,114,101,112,114,99,2,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,114,24,0,0,0,41,2,78,84,114,7,0,0,0, + 114,234,0,0,0,114,7,0,0,0,114,7,0,0,0,114, + 8,0,0,0,114,193,0,0,0,211,4,0,0,243,4,0, + 0,0,4,1,255,128,122,27,95,78,97,109,101,115,112,97, + 99,101,76,111,97,100,101,114,46,105,115,95,112,97,99,107, + 97,103,101,99,2,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,114,24,0,0, + 0,41,2,78,114,10,0,0,0,114,7,0,0,0,114,234, 0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,226,0,0,0,220,4,0,0,114,227,0,0,0, - 122,30,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,46,99,114,101,97,116,101,95,109,111,100,117,108,101, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,0, - 83,0,114,121,0,0,0,114,7,0,0,0,114,27,1,0, + 0,0,114,244,0,0,0,214,4,0,0,114,61,1,0,0, + 122,27,95,78,97,109,101,115,112,97,99,101,76,111,97,100, + 101,114,46,103,101,116,95,115,111,117,114,99,101,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,6,0, + 0,0,67,0,0,0,115,16,0,0,0,116,0,100,1,100, + 2,100,3,100,4,100,5,141,4,83,0,41,6,78,114,10, + 0,0,0,122,8,60,115,116,114,105,110,103,62,114,230,0, + 0,0,84,41,1,114,246,0,0,0,41,1,114,247,0,0, + 0,114,234,0,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,228,0,0,0,217,4,0,0,114,58, + 1,0,0,122,25,95,78,97,109,101,115,112,97,99,101,76, + 111,97,100,101,114,46,103,101,116,95,99,111,100,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1, + 0,0,0,67,0,0,0,114,24,0,0,0,114,224,0,0, + 0,114,7,0,0,0,114,225,0,0,0,114,7,0,0,0, + 114,7,0,0,0,114,8,0,0,0,114,226,0,0,0,220, + 4,0,0,114,227,0,0,0,122,30,95,78,97,109,101,115, + 112,97,99,101,76,111,97,100,101,114,46,99,114,101,97,116, + 101,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, + 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, + 0,115,4,0,0,0,100,0,83,0,114,121,0,0,0,114, + 7,0,0,0,114,28,1,0,0,114,7,0,0,0,114,7, + 0,0,0,114,8,0,0,0,114,232,0,0,0,223,4,0, + 0,114,61,1,0,0,122,28,95,78,97,109,101,115,112,97, + 99,101,76,111,97,100,101,114,46,101,120,101,99,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,4,0,0,0,67,0,0,0,115,26,0, + 0,0,116,0,160,1,100,1,124,0,106,2,161,2,1,0, + 116,0,160,3,124,0,124,1,161,2,83,0,41,3,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,78,41,4,114,146,0, + 0,0,114,160,0,0,0,114,35,1,0,0,114,233,0,0, + 0,114,234,0,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,235,0,0,0,226,4,0,0,115,10, + 0,0,0,6,7,4,1,4,255,12,3,255,128,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,99,2,0,0,0, + 0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0, + 67,0,0,0,115,22,0,0,0,100,1,100,2,108,0,109, + 1,125,2,1,0,124,2,124,0,106,2,131,1,83,0,41, + 3,78,114,0,0,0,0,41,1,218,15,78,97,109,101,115, + 112,97,99,101,82,101,97,100,101,114,41,3,114,19,1,0, + 0,114,62,1,0,0,114,35,1,0,0,41,3,114,130,0, + 0,0,114,231,0,0,0,114,62,1,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,114,20,1,0,0, + 238,4,0,0,115,6,0,0,0,12,1,10,1,255,128,122, + 36,95,78,97,109,101,115,112,97,99,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,78,41,13,114,137,0,0,0,114,136,0, + 0,0,114,138,0,0,0,114,223,0,0,0,114,220,0,0, + 0,114,60,1,0,0,114,193,0,0,0,114,244,0,0,0, + 114,228,0,0,0,114,226,0,0,0,114,232,0,0,0,114, + 235,0,0,0,114,20,1,0,0,114,7,0,0,0,114,7, + 0,0,0,114,7,0,0,0,114,8,0,0,0,114,59,1, + 0,0,198,4,0,0,115,24,0,0,0,8,0,8,1,2, + 3,10,1,8,8,8,3,8,3,8,3,8,3,8,3,12, + 12,255,128,114,59,1,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, + 0,115,118,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,101,4,100,2,100,3,132,0,131,1,90,5,101,4, + 100,4,100,5,132,0,131,1,90,6,101,7,100,6,100,7, + 132,0,131,1,90,8,101,7,100,8,100,9,132,0,131,1, + 90,9,101,7,100,19,100,11,100,12,132,1,131,1,90,10, + 101,7,100,20,100,13,100,14,132,1,131,1,90,11,101,7, + 100,21,100,15,100,16,132,1,131,1,90,12,101,4,100,17, + 100,18,132,0,131,1,90,13,100,10,83,0,41,22,218,10, + 80,97,116,104,70,105,110,100,101,114,122,62,77,101,116,97, + 32,112,97,116,104,32,102,105,110,100,101,114,32,102,111,114, + 32,115,121,115,46,112,97,116,104,32,97,110,100,32,112,97, + 99,107,97,103,101,32,95,95,112,97,116,104,95,95,32,97, + 116,116,114,105,98,117,116,101,115,46,99,0,0,0,0,0, + 0,0,0,0,0,0,0,2,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,0,125,1,124,1, + 100,1,117,0,114,40,116,1,106,2,124,0,61,0,113,14, + 116,4,124,1,100,2,131,2,114,58,124,1,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,16,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,140,0,0,0,114,64,1,0,0, + 41,2,114,128,0,0,0,218,6,102,105,110,100,101,114,114, + 7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,64, + 1,0,0,249,4,0,0,115,16,0,0,0,22,4,8,1, + 10,1,10,1,8,1,2,128,4,252,255,128,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,1,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,9,0,0,0,67, + 0,0,0,115,76,0,0,0,116,0,106,1,100,1,117,1, + 114,28,116,0,106,1,115,28,116,2,160,3,100,2,116,4, + 161,2,1,0,116,0,106,1,68,0,93,34,125,1,122,14, + 124,1,124,0,131,1,87,0,2,0,1,0,83,0,4,0, + 116,5,121,74,1,0,1,0,1,0,89,0,113,34,100,1, + 83,0,119,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,16,0,0,0,218,10,112,97,116,104,95,104,111, + 111,107,115,114,88,0,0,0,114,89,0,0,0,114,149,0, + 0,0,114,129,0,0,0,41,2,114,58,0,0,0,90,4, + 104,111,111,107,114,7,0,0,0,114,7,0,0,0,114,8, + 0,0,0,218,11,95,112,97,116,104,95,104,111,111,107,115, + 3,5,0,0,115,20,0,0,0,16,3,12,1,10,1,2, + 1,14,1,12,1,4,1,4,2,2,253,255,128,122,22,80, + 97,116,104,70,105,110,100,101,114,46,95,112,97,116,104,95, + 104,111,111,107,115,99,2,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,8,0,0,0,67,0,0,0,115,100, + 0,0,0,124,1,100,1,107,2,114,40,122,12,116,0,160, + 1,161,0,125,1,87,0,110,18,4,0,116,2,121,98,1, + 0,1,0,1,0,89,0,100,2,83,0,122,16,116,3,106, + 4,124,1,25,0,125,2,87,0,124,2,83,0,4,0,116, + 5,121,96,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,124, + 2,83,0,119,0,119,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,10,0, + 0,0,78,41,7,114,19,0,0,0,114,70,0,0,0,218, + 17,70,105,108,101,78,111,116,70,111,117,110,100,69,114,114, + 111,114,114,16,0,0,0,114,66,1,0,0,218,8,75,101, + 121,69,114,114,111,114,114,70,1,0,0,41,3,114,209,0, + 0,0,114,58,0,0,0,114,68,1,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,218,20,95,112,97, + 116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104, + 101,16,5,0,0,115,30,0,0,0,8,8,2,1,12,1, + 12,1,6,3,2,1,12,1,4,4,12,253,10,1,12,1, + 4,1,2,253,2,250,255,128,122,31,80,97,116,104,70,105, + 110,100,101,114,46,95,112,97,116,104,95,105,109,112,111,114, + 116,101,114,95,99,97,99,104,101,99,3,0,0,0,0,0, + 0,0,0,0,0,0,6,0,0,0,4,0,0,0,67,0, + 0,0,115,82,0,0,0,116,0,124,2,100,1,131,2,114, + 26,124,2,160,1,124,1,161,1,92,2,125,3,125,4,110, + 14,124,2,160,2,124,1,161,1,125,3,103,0,125,4,124, + 3,100,0,117,1,114,60,116,3,160,4,124,1,124,3,161, + 2,83,0,116,3,160,5,124,1,100,0,161,2,125,5,124, + 4,124,5,95,6,124,5,83,0,41,2,78,114,148,0,0, + 0,41,7,114,140,0,0,0,114,148,0,0,0,114,217,0, + 0,0,114,146,0,0,0,114,212,0,0,0,114,194,0,0, + 0,114,189,0,0,0,41,6,114,209,0,0,0,114,150,0, + 0,0,114,68,1,0,0,114,151,0,0,0,114,152,0,0, + 0,114,198,0,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,218,16,95,108,101,103,97,99,121,95,103, + 101,116,95,115,112,101,99,38,5,0,0,115,20,0,0,0, + 10,4,16,1,10,2,4,1,8,1,12,1,12,1,6,1, + 4,1,255,128,122,27,80,97,116,104,70,105,110,100,101,114, + 46,95,108,101,103,97,99,121,95,103,101,116,95,115,112,101, + 99,78,99,4,0,0,0,0,0,0,0,0,0,0,0,9, + 0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,0, + 103,0,125,4,124,2,68,0,93,134,125,5,116,0,124,5, + 116,1,116,2,102,2,131,2,115,28,113,8,124,0,160,3, + 124,5,161,1,125,6,124,6,100,1,117,1,114,142,116,4, + 124,6,100,2,131,2,114,70,124,6,160,5,124,1,124,3, + 161,2,125,7,110,12,124,0,160,6,124,1,124,6,161,2, + 125,7,124,7,100,1,117,0,114,92,113,8,124,7,106,7, + 100,1,117,1,114,110,124,7,2,0,1,0,83,0,124,7, + 106,8,125,8,124,8,100,1,117,0,114,132,116,9,100,3, + 131,1,130,1,124,4,160,10,124,8,161,1,1,0,113,8, + 116,11,160,12,124,1,100,1,161,2,125,7,124,4,124,7, + 95,8,124,7,83,0,41,4,122,63,70,105,110,100,32,116, + 104,101,32,108,111,97,100,101,114,32,111,114,32,110,97,109, + 101,115,112,97,99,101,95,112,97,116,104,32,102,111,114,32, + 116,104,105,115,32,109,111,100,117,108,101,47,112,97,99,107, + 97,103,101,32,110,97,109,101,46,78,114,214,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,172,0,0,0,114,97,0,0,0, + 218,5,98,121,116,101,115,114,73,1,0,0,114,140,0,0, + 0,114,214,0,0,0,114,74,1,0,0,114,151,0,0,0, + 114,189,0,0,0,114,129,0,0,0,114,178,0,0,0,114, + 146,0,0,0,114,194,0,0,0,41,9,114,209,0,0,0, + 114,150,0,0,0,114,58,0,0,0,114,213,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,68,1,0,0,114,198,0,0,0, + 114,152,0,0,0,114,7,0,0,0,114,7,0,0,0,114, + 8,0,0,0,218,9,95,103,101,116,95,115,112,101,99,53, + 5,0,0,115,44,0,0,0,4,5,8,1,14,1,2,1, + 10,1,8,1,10,1,14,1,12,2,8,1,2,1,10,1, + 8,1,6,1,8,1,8,1,10,5,2,128,12,2,6,1, + 4,1,255,128,122,20,80,97,116,104,70,105,110,100,101,114, + 46,95,103,101,116,95,115,112,101,99,99,4,0,0,0,0, + 0,0,0,0,0,0,0,6,0,0,0,5,0,0,0,67, + 0,0,0,115,94,0,0,0,124,2,100,1,117,0,114,14, + 116,0,106,1,125,2,124,0,160,2,124,1,124,2,124,3, + 161,3,125,4,124,4,100,1,117,0,114,40,100,1,83,0, + 124,4,106,3,100,1,117,0,114,90,124,4,106,4,125,5, + 124,5,114,86,100,1,124,4,95,5,116,6,124,1,124,5, + 124,0,106,2,131,3,124,4,95,4,124,4,83,0,100,1, + 83,0,124,4,83,0,41,2,122,141,84,114,121,32,116,111, + 32,102,105,110,100,32,97,32,115,112,101,99,32,102,111,114, + 32,39,102,117,108,108,110,97,109,101,39,32,111,110,32,115, + 121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,104, + 39,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, + 115,101,97,114,99,104,32,105,115,32,98,97,115,101,100,32, + 111,110,32,115,121,115,46,112,97,116,104,95,104,111,111,107, + 115,32,97,110,100,32,115,121,115,46,112,97,116,104,95,105, + 109,112,111,114,116,101,114,95,99,97,99,104,101,46,10,32, + 32,32,32,32,32,32,32,78,41,7,114,16,0,0,0,114, + 58,0,0,0,114,77,1,0,0,114,151,0,0,0,114,189, + 0,0,0,114,192,0,0,0,114,33,1,0,0,41,6,114, + 209,0,0,0,114,150,0,0,0,114,58,0,0,0,114,213, + 0,0,0,114,198,0,0,0,114,76,1,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,214,0,0, + 0,85,5,0,0,115,28,0,0,0,8,6,6,1,14,1, + 8,1,4,1,10,1,6,1,4,1,6,3,16,1,4,1, + 4,2,4,2,255,128,122,20,80,97,116,104,70,105,110,100, + 101,114,46,102,105,110,100,95,115,112,101,99,99,3,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0, + 0,67,0,0,0,115,30,0,0,0,124,0,160,0,124,1, + 124,2,161,2,125,3,124,3,100,1,117,0,114,24,100,1, + 83,0,124,3,106,1,83,0,41,2,122,170,102,105,110,100, + 32,116,104,101,32,109,111,100,117,108,101,32,111,110,32,115, + 121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,104, + 39,32,98,97,115,101,100,32,111,110,32,115,121,115,46,112, + 97,116,104,95,104,111,111,107,115,32,97,110,100,10,32,32, + 32,32,32,32,32,32,115,121,115,46,112,97,116,104,95,105, + 109,112,111,114,116,101,114,95,99,97,99,104,101,46,10,10, + 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, + 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, + 100,46,32,32,85,115,101,32,102,105,110,100,95,115,112,101, + 99,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, + 32,32,32,32,32,32,78,114,215,0,0,0,114,216,0,0, 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 114,232,0,0,0,223,4,0,0,114,60,1,0,0,122,28, - 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, - 46,101,120,101,99,95,109,111,100,117,108,101,99,2,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0, - 0,67,0,0,0,115,26,0,0,0,116,0,160,1,100,1, - 124,0,106,2,161,2,1,0,116,0,160,3,124,0,124,1, - 161,2,83,0,41,3,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, + 114,217,0,0,0,109,5,0,0,115,10,0,0,0,12,8, + 8,1,4,1,6,1,255,128,122,22,80,97,116,104,70,105, + 110,100,101,114,46,102,105,110,100,95,109,111,100,117,108,101, + 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,4,0,0,0,79,0,0,0,115,28,0,0,0,100,1, + 100,2,108,0,109,1,125,2,1,0,124,2,106,2,124,0, + 105,0,124,1,164,1,142,1,83,0,41,4,97,32,1,0, + 0,10,32,32,32,32,32,32,32,32,70,105,110,100,32,100, + 105,115,116,114,105,98,117,116,105,111,110,115,46,10,10,32, + 32,32,32,32,32,32,32,82,101,116,117,114,110,32,97,110, + 32,105,116,101,114,97,98,108,101,32,111,102,32,97,108,108, + 32,68,105,115,116,114,105,98,117,116,105,111,110,32,105,110, + 115,116,97,110,99,101,115,32,99,97,112,97,98,108,101,32, + 111,102,10,32,32,32,32,32,32,32,32,108,111,97,100,105, + 110,103,32,116,104,101,32,109,101,116,97,100,97,116,97,32, + 102,111,114,32,112,97,99,107,97,103,101,115,32,109,97,116, + 99,104,105,110,103,32,96,96,99,111,110,116,101,120,116,46, + 110,97,109,101,96,96,10,32,32,32,32,32,32,32,32,40, + 111,114,32,97,108,108,32,110,97,109,101,115,32,105,102,32, + 96,96,78,111,110,101,96,96,32,105,110,100,105,99,97,116, + 101,100,41,32,97,108,111,110,103,32,116,104,101,32,112,97, + 116,104,115,32,105,110,32,116,104,101,32,108,105,115,116,10, + 32,32,32,32,32,32,32,32,111,102,32,100,105,114,101,99, + 116,111,114,105,101,115,32,96,96,99,111,110,116,101,120,116, + 46,112,97,116,104,96,96,46,10,32,32,32,32,32,32,32, + 32,114,0,0,0,0,41,1,218,18,77,101,116,97,100,97, + 116,97,80,97,116,104,70,105,110,100,101,114,78,41,3,90, + 18,105,109,112,111,114,116,108,105,98,46,109,101,116,97,100, + 97,116,97,114,78,1,0,0,218,18,102,105,110,100,95,100, + 105,115,116,114,105,98,117,116,105,111,110,115,41,3,114,131, + 0,0,0,114,132,0,0,0,114,78,1,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,79,1,0, + 0,122,5,0,0,115,6,0,0,0,12,10,16,1,255,128, + 122,29,80,97,116,104,70,105,110,100,101,114,46,102,105,110, + 100,95,100,105,115,116,114,105,98,117,116,105,111,110,115,41, + 1,78,41,2,78,78,41,1,78,41,14,114,137,0,0,0, + 114,136,0,0,0,114,138,0,0,0,114,139,0,0,0,114, + 220,0,0,0,114,64,1,0,0,114,70,1,0,0,114,221, + 0,0,0,114,73,1,0,0,114,74,1,0,0,114,77,1, + 0,0,114,214,0,0,0,114,217,0,0,0,114,79,1,0, + 0,114,7,0,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,63,1,0,0,245,4,0,0,115,38, + 0,0,0,8,0,4,2,2,2,10,1,2,9,10,1,2, + 12,10,1,2,21,10,1,2,14,12,1,2,31,12,1,2, + 23,12,1,2,12,14,1,255,128,114,63,1,0,0,99,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3, + 0,0,0,64,0,0,0,115,90,0,0,0,101,0,90,1, + 100,0,90,2,100,1,90,3,100,2,100,3,132,0,90,4, + 100,4,100,5,132,0,90,5,101,6,90,7,100,6,100,7, + 132,0,90,8,100,8,100,9,132,0,90,9,100,19,100,11, + 100,12,132,1,90,10,100,13,100,14,132,0,90,11,101,12, + 100,15,100,16,132,0,131,1,90,13,100,17,100,18,132,0, + 90,14,100,10,83,0,41,20,218,10,70,105,108,101,70,105, + 110,100,101,114,122,172,70,105,108,101,45,98,97,115,101,100, + 32,102,105,110,100,101,114,46,10,10,32,32,32,32,73,110, + 116,101,114,97,99,116,105,111,110,115,32,119,105,116,104,32, + 116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,32, + 97,114,101,32,99,97,99,104,101,100,32,102,111,114,32,112, + 101,114,102,111,114,109,97,110,99,101,44,32,98,101,105,110, + 103,10,32,32,32,32,114,101,102,114,101,115,104,101,100,32, + 119,104,101,110,32,116,104,101,32,100,105,114,101,99,116,111, + 114,121,32,116,104,101,32,102,105,110,100,101,114,32,105,115, + 32,104,97,110,100,108,105,110,103,32,104,97,115,32,98,101, + 101,110,32,109,111,100,105,102,105,101,100,46,10,10,32,32, + 32,32,99,2,0,0,0,0,0,0,0,0,0,0,0,5, + 0,0,0,6,0,0,0,7,0,0,0,115,84,0,0,0, + 103,0,125,3,124,2,68,0,93,32,92,2,137,0,125,4, + 124,3,160,0,135,0,102,1,100,1,100,2,132,8,124,4, + 68,0,131,1,161,1,1,0,113,8,124,3,124,0,95,1, + 124,1,112,54,100,3,124,0,95,2,100,4,124,0,95,3, + 116,4,131,0,124,0,95,5,116,4,131,0,124,0,95,6, + 100,5,83,0,41,6,122,154,73,110,105,116,105,97,108,105, + 122,101,32,119,105,116,104,32,116,104,101,32,112,97,116,104, + 32,116,111,32,115,101,97,114,99,104,32,111,110,32,97,110, + 100,32,97,32,118,97,114,105,97,98,108,101,32,110,117,109, + 98,101,114,32,111,102,10,32,32,32,32,32,32,32,32,50, + 45,116,117,112,108,101,115,32,99,111,110,116,97,105,110,105, + 110,103,32,116,104,101,32,108,111,97,100,101,114,32,97,110, + 100,32,116,104,101,32,102,105,108,101,32,115,117,102,102,105, + 120,101,115,32,116,104,101,32,108,111,97,100,101,114,10,32, + 32,32,32,32,32,32,32,114,101,99,111,103,110,105,122,101, + 115,46,99,1,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,51,0,0,0,115,22,0,0,0, + 124,0,93,14,125,1,124,1,136,0,102,2,86,0,1,0, + 113,2,100,0,83,0,114,121,0,0,0,114,7,0,0,0, + 114,29,1,0,0,169,1,114,151,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,9,0,0,0,151,5,0,0,114, + 14,0,0,0,122,38,70,105,108,101,70,105,110,100,101,114, + 46,95,95,105,110,105,116,95,95,46,60,108,111,99,97,108, + 115,62,46,60,103,101,110,101,120,112,114,62,114,86,0,0, + 0,114,116,0,0,0,78,41,7,114,178,0,0,0,218,8, + 95,108,111,97,100,101,114,115,114,58,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,130,0,0,0,114,58,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,200,0,0,0,114,7,0,0,0, + 114,81,1,0,0,114,8,0,0,0,114,223,0,0,0,145, + 5,0,0,115,18,0,0,0,4,4,12,1,26,1,6,1, + 10,2,6,1,8,1,12,1,255,128,122,19,70,105,108,101, + 70,105,110,100,101,114,46,95,95,105,110,105,116,95,95,99, + 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, + 2,0,0,0,67,0,0,0,115,10,0,0,0,100,1,124, + 0,95,0,100,2,83,0,41,3,122,31,73,110,118,97,108, + 105,100,97,116,101,32,116,104,101,32,100,105,114,101,99,116, + 111,114,121,32,109,116,105,109,101,46,114,116,0,0,0,78, + 41,1,114,83,1,0,0,114,8,1,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,114,64,1,0,0, + 159,5,0,0,114,69,0,0,0,122,28,70,105,108,101,70, + 105,110,100,101,114,46,105,110,118,97,108,105,100,97,116,101, + 95,99,97,99,104,101,115,99,2,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, + 115,42,0,0,0,124,0,160,0,124,1,161,1,125,2,124, + 2,100,1,117,0,114,26,100,1,103,0,102,2,83,0,124, + 2,106,1,124,2,106,2,112,38,103,0,102,2,83,0,41, + 2,122,197,84,114,121,32,116,111,32,102,105,110,100,32,97, + 32,108,111,97,100,101,114,32,102,111,114,32,116,104,101,32, + 115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,101, + 44,32,111,114,32,116,104,101,32,110,97,109,101,115,112,97, + 99,101,10,32,32,32,32,32,32,32,32,112,97,99,107,97, + 103,101,32,112,111,114,116,105,111,110,115,46,32,82,101,116, + 117,114,110,115,32,40,108,111,97,100,101,114,44,32,108,105, + 115,116,45,111,102,45,112,111,114,116,105,111,110,115,41,46, 10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109, 101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97, - 116,101,100,46,32,32,85,115,101,32,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,78,41,4,114,146,0,0,0,114,160,0,0,0,114, - 34,1,0,0,114,233,0,0,0,114,234,0,0,0,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,235,0, - 0,0,226,4,0,0,115,10,0,0,0,6,7,4,1,4, - 255,12,3,255,128,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,137,0,0,0,114,136,0,0,0, - 114,138,0,0,0,114,223,0,0,0,114,220,0,0,0,114, - 59,1,0,0,114,193,0,0,0,114,244,0,0,0,114,228, - 0,0,0,114,226,0,0,0,114,232,0,0,0,114,235,0, - 0,0,114,7,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,58,1,0,0,198,4,0,0,115, - 22,0,0,0,8,0,8,1,2,3,10,1,8,8,8,3, - 8,3,8,3,8,3,12,3,255,128,114,58,1,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 4,0,0,0,64,0,0,0,115,118,0,0,0,101,0,90, - 1,100,0,90,2,100,1,90,3,101,4,100,2,100,3,132, - 0,131,1,90,5,101,4,100,4,100,5,132,0,131,1,90, - 6,101,7,100,6,100,7,132,0,131,1,90,8,101,7,100, - 8,100,9,132,0,131,1,90,9,101,7,100,19,100,11,100, - 12,132,1,131,1,90,10,101,7,100,20,100,13,100,14,132, - 1,131,1,90,11,101,7,100,21,100,15,100,16,132,1,131, - 1,90,12,101,4,100,17,100,18,132,0,131,1,90,13,100, - 10,83,0,41,22,218,10,80,97,116,104,70,105,110,100,101, - 114,122,62,77,101,116,97,32,112,97,116,104,32,102,105,110, - 100,101,114,32,102,111,114,32,115,121,115,46,112,97,116,104, - 32,97,110,100,32,112,97,99,107,97,103,101,32,95,95,112, - 97,116,104,95,95,32,97,116,116,114,105,98,117,116,101,115, - 46,99,0,0,0,0,0,0,0,0,0,0,0,0,2,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,0,125,1,124,1,100,1,117,0,114,40,116,1,106, - 2,124,0,61,0,113,14,116,4,124,1,100,2,131,2,114, - 58,124,1,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,16,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,140,0, - 0,0,114,62,1,0,0,41,2,114,128,0,0,0,218,6, - 102,105,110,100,101,114,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,62,1,0,0,245,4,0,0,115,16, - 0,0,0,22,4,8,1,10,1,10,1,8,1,2,128,4, - 252,255,128,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,1,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,9,0,0,0,67,0,0,0,115,76,0,0,0,116, - 0,106,1,100,1,117,1,114,28,116,0,106,1,115,28,116, - 2,160,3,100,2,116,4,161,2,1,0,116,0,106,1,68, - 0,93,34,125,1,122,14,124,1,124,0,131,1,87,0,2, - 0,1,0,83,0,4,0,116,5,121,74,1,0,1,0,1, - 0,89,0,113,34,100,1,83,0,119,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,16,0,0,0,218,10, - 112,97,116,104,95,104,111,111,107,115,114,88,0,0,0,114, - 89,0,0,0,114,149,0,0,0,114,129,0,0,0,41,2, - 114,58,0,0,0,90,4,104,111,111,107,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,218,11,95,112,97,116, - 104,95,104,111,111,107,115,255,4,0,0,115,20,0,0,0, - 16,3,12,1,10,1,2,1,14,1,12,1,4,1,4,2, - 2,253,255,128,122,22,80,97,116,104,70,105,110,100,101,114, - 46,95,112,97,116,104,95,104,111,111,107,115,99,2,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,8,0,0, - 0,67,0,0,0,115,100,0,0,0,124,1,100,1,107,2, - 114,40,122,12,116,0,160,1,161,0,125,1,87,0,110,18, - 4,0,116,2,121,98,1,0,1,0,1,0,89,0,100,2, - 83,0,122,16,116,3,106,4,124,1,25,0,125,2,87,0, - 124,2,83,0,4,0,116,5,121,96,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,124,2,83,0,119,0,119,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,10,0,0,0,78,41,7,114,19,0,0, - 0,114,70,0,0,0,218,17,70,105,108,101,78,111,116,70, - 111,117,110,100,69,114,114,111,114,114,16,0,0,0,114,64, - 1,0,0,218,8,75,101,121,69,114,114,111,114,114,68,1, - 0,0,41,3,114,209,0,0,0,114,58,0,0,0,114,66, - 1,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,218,20,95,112,97,116,104,95,105,109,112,111,114,116, - 101,114,95,99,97,99,104,101,12,5,0,0,115,30,0,0, - 0,8,8,2,1,12,1,12,1,6,3,2,1,12,1,4, - 4,12,253,10,1,12,1,4,1,2,253,2,250,255,128,122, - 31,80,97,116,104,70,105,110,100,101,114,46,95,112,97,116, - 104,95,105,109,112,111,114,116,101,114,95,99,97,99,104,101, - 99,3,0,0,0,0,0,0,0,0,0,0,0,6,0,0, - 0,4,0,0,0,67,0,0,0,115,82,0,0,0,116,0, - 124,2,100,1,131,2,114,26,124,2,160,1,124,1,161,1, - 92,2,125,3,125,4,110,14,124,2,160,2,124,1,161,1, - 125,3,103,0,125,4,124,3,100,0,117,1,114,60,116,3, - 160,4,124,1,124,3,161,2,83,0,116,3,160,5,124,1, - 100,0,161,2,125,5,124,4,124,5,95,6,124,5,83,0, - 41,2,78,114,148,0,0,0,41,7,114,140,0,0,0,114, - 148,0,0,0,114,217,0,0,0,114,146,0,0,0,114,212, - 0,0,0,114,194,0,0,0,114,189,0,0,0,41,6,114, - 209,0,0,0,114,150,0,0,0,114,66,1,0,0,114,151, - 0,0,0,114,152,0,0,0,114,198,0,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,218,16,95,108, - 101,103,97,99,121,95,103,101,116,95,115,112,101,99,34,5, - 0,0,115,20,0,0,0,10,4,16,1,10,2,4,1,8, - 1,12,1,12,1,6,1,4,1,255,128,122,27,80,97,116, - 104,70,105,110,100,101,114,46,95,108,101,103,97,99,121,95, - 103,101,116,95,115,112,101,99,78,99,4,0,0,0,0,0, - 0,0,0,0,0,0,9,0,0,0,5,0,0,0,67,0, - 0,0,115,166,0,0,0,103,0,125,4,124,2,68,0,93, - 134,125,5,116,0,124,5,116,1,116,2,102,2,131,2,115, - 28,113,8,124,0,160,3,124,5,161,1,125,6,124,6,100, - 1,117,1,114,142,116,4,124,6,100,2,131,2,114,70,124, - 6,160,5,124,1,124,3,161,2,125,7,110,12,124,0,160, - 6,124,1,124,6,161,2,125,7,124,7,100,1,117,0,114, - 92,113,8,124,7,106,7,100,1,117,1,114,110,124,7,2, - 0,1,0,83,0,124,7,106,8,125,8,124,8,100,1,117, - 0,114,132,116,9,100,3,131,1,130,1,124,4,160,10,124, - 8,161,1,1,0,113,8,116,11,160,12,124,1,100,1,161, - 2,125,7,124,4,124,7,95,8,124,7,83,0,41,4,122, - 63,70,105,110,100,32,116,104,101,32,108,111,97,100,101,114, - 32,111,114,32,110,97,109,101,115,112,97,99,101,95,112,97, - 116,104,32,102,111,114,32,116,104,105,115,32,109,111,100,117, - 108,101,47,112,97,99,107,97,103,101,32,110,97,109,101,46, - 78,114,214,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,172,0, - 0,0,114,97,0,0,0,218,5,98,121,116,101,115,114,71, - 1,0,0,114,140,0,0,0,114,214,0,0,0,114,72,1, - 0,0,114,151,0,0,0,114,189,0,0,0,114,129,0,0, - 0,114,178,0,0,0,114,146,0,0,0,114,194,0,0,0, - 41,9,114,209,0,0,0,114,150,0,0,0,114,58,0,0, - 0,114,213,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,66,1, - 0,0,114,198,0,0,0,114,152,0,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,218,9,95,103,101, - 116,95,115,112,101,99,49,5,0,0,115,44,0,0,0,4, - 5,8,1,14,1,2,1,10,1,8,1,10,1,14,1,12, - 2,8,1,2,1,10,1,8,1,6,1,8,1,8,1,10, - 5,2,128,12,2,6,1,4,1,255,128,122,20,80,97,116, - 104,70,105,110,100,101,114,46,95,103,101,116,95,115,112,101, - 99,99,4,0,0,0,0,0,0,0,0,0,0,0,6,0, - 0,0,5,0,0,0,67,0,0,0,115,94,0,0,0,124, - 2,100,1,117,0,114,14,116,0,106,1,125,2,124,0,160, - 2,124,1,124,2,124,3,161,3,125,4,124,4,100,1,117, - 0,114,40,100,1,83,0,124,4,106,3,100,1,117,0,114, - 90,124,4,106,4,125,5,124,5,114,86,100,1,124,4,95, - 5,116,6,124,1,124,5,124,0,106,2,131,3,124,4,95, - 4,124,4,83,0,100,1,83,0,124,4,83,0,41,2,122, - 141,84,114,121,32,116,111,32,102,105,110,100,32,97,32,115, - 112,101,99,32,102,111,114,32,39,102,117,108,108,110,97,109, - 101,39,32,111,110,32,115,121,115,46,112,97,116,104,32,111, - 114,32,39,112,97,116,104,39,46,10,10,32,32,32,32,32, - 32,32,32,84,104,101,32,115,101,97,114,99,104,32,105,115, - 32,98,97,115,101,100,32,111,110,32,115,121,115,46,112,97, - 116,104,95,104,111,111,107,115,32,97,110,100,32,115,121,115, - 46,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, - 97,99,104,101,46,10,32,32,32,32,32,32,32,32,78,41, - 7,114,16,0,0,0,114,58,0,0,0,114,75,1,0,0, - 114,151,0,0,0,114,189,0,0,0,114,192,0,0,0,114, - 32,1,0,0,41,6,114,209,0,0,0,114,150,0,0,0, - 114,58,0,0,0,114,213,0,0,0,114,198,0,0,0,114, - 74,1,0,0,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,214,0,0,0,81,5,0,0,115,28,0,0, - 0,8,6,6,1,14,1,8,1,4,1,10,1,6,1,4, - 1,6,3,16,1,4,1,4,2,4,2,255,128,122,20,80, - 97,116,104,70,105,110,100,101,114,46,102,105,110,100,95,115, - 112,101,99,99,3,0,0,0,0,0,0,0,0,0,0,0, - 4,0,0,0,4,0,0,0,67,0,0,0,115,30,0,0, - 0,124,0,160,0,124,1,124,2,161,2,125,3,124,3,100, - 1,117,0,114,24,100,1,83,0,124,3,106,1,83,0,41, - 2,122,170,102,105,110,100,32,116,104,101,32,109,111,100,117, - 108,101,32,111,110,32,115,121,115,46,112,97,116,104,32,111, - 114,32,39,112,97,116,104,39,32,98,97,115,101,100,32,111, - 110,32,115,121,115,46,112,97,116,104,95,104,111,111,107,115, - 32,97,110,100,10,32,32,32,32,32,32,32,32,115,121,115, - 46,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, - 97,99,104,101,46,10,10,32,32,32,32,32,32,32,32,84, - 104,105,115,32,109,101,116,104,111,100,32,105,115,32,100,101, - 112,114,101,99,97,116,101,100,46,32,32,85,115,101,32,102, - 105,110,100,95,115,112,101,99,40,41,32,105,110,115,116,101, - 97,100,46,10,10,32,32,32,32,32,32,32,32,78,114,215, - 0,0,0,114,216,0,0,0,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,217,0,0,0,105,5,0,0, - 115,10,0,0,0,12,8,8,1,4,1,6,1,255,128,122, - 22,80,97,116,104,70,105,110,100,101,114,46,102,105,110,100, - 95,109,111,100,117,108,101,99,0,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,4,0,0,0,79,0,0,0, - 115,28,0,0,0,100,1,100,2,108,0,109,1,125,2,1, - 0,124,2,106,2,124,0,105,0,124,1,164,1,142,1,83, - 0,41,4,97,32,1,0,0,10,32,32,32,32,32,32,32, - 32,70,105,110,100,32,100,105,115,116,114,105,98,117,116,105, - 111,110,115,46,10,10,32,32,32,32,32,32,32,32,82,101, - 116,117,114,110,32,97,110,32,105,116,101,114,97,98,108,101, - 32,111,102,32,97,108,108,32,68,105,115,116,114,105,98,117, - 116,105,111,110,32,105,110,115,116,97,110,99,101,115,32,99, - 97,112,97,98,108,101,32,111,102,10,32,32,32,32,32,32, - 32,32,108,111,97,100,105,110,103,32,116,104,101,32,109,101, - 116,97,100,97,116,97,32,102,111,114,32,112,97,99,107,97, - 103,101,115,32,109,97,116,99,104,105,110,103,32,96,96,99, - 111,110,116,101,120,116,46,110,97,109,101,96,96,10,32,32, - 32,32,32,32,32,32,40,111,114,32,97,108,108,32,110,97, - 109,101,115,32,105,102,32,96,96,78,111,110,101,96,96,32, - 105,110,100,105,99,97,116,101,100,41,32,97,108,111,110,103, - 32,116,104,101,32,112,97,116,104,115,32,105,110,32,116,104, - 101,32,108,105,115,116,10,32,32,32,32,32,32,32,32,111, - 102,32,100,105,114,101,99,116,111,114,105,101,115,32,96,96, - 99,111,110,116,101,120,116,46,112,97,116,104,96,96,46,10, - 32,32,32,32,32,32,32,32,114,0,0,0,0,41,1,218, - 18,77,101,116,97,100,97,116,97,80,97,116,104,70,105,110, - 100,101,114,78,41,3,90,18,105,109,112,111,114,116,108,105, - 98,46,109,101,116,97,100,97,116,97,114,76,1,0,0,218, - 18,102,105,110,100,95,100,105,115,116,114,105,98,117,116,105, - 111,110,115,41,3,114,131,0,0,0,114,132,0,0,0,114, - 76,1,0,0,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,77,1,0,0,118,5,0,0,115,6,0,0, - 0,12,10,16,1,255,128,122,29,80,97,116,104,70,105,110, - 100,101,114,46,102,105,110,100,95,100,105,115,116,114,105,98, - 117,116,105,111,110,115,41,1,78,41,2,78,78,41,1,78, - 41,14,114,137,0,0,0,114,136,0,0,0,114,138,0,0, - 0,114,139,0,0,0,114,220,0,0,0,114,62,1,0,0, - 114,68,1,0,0,114,221,0,0,0,114,71,1,0,0,114, - 72,1,0,0,114,75,1,0,0,114,214,0,0,0,114,217, - 0,0,0,114,77,1,0,0,114,7,0,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,61,1,0, - 0,241,4,0,0,115,38,0,0,0,8,0,4,2,2,2, - 10,1,2,9,10,1,2,12,10,1,2,21,10,1,2,14, - 12,1,2,31,12,1,2,23,12,1,2,12,14,1,255,128, - 114,61,1,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,64,0,0,0,115,90, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,101, - 6,90,7,100,6,100,7,132,0,90,8,100,8,100,9,132, - 0,90,9,100,19,100,11,100,12,132,1,90,10,100,13,100, - 14,132,0,90,11,101,12,100,15,100,16,132,0,131,1,90, - 13,100,17,100,18,132,0,90,14,100,10,83,0,41,20,218, - 10,70,105,108,101,70,105,110,100,101,114,122,172,70,105,108, - 101,45,98,97,115,101,100,32,102,105,110,100,101,114,46,10, - 10,32,32,32,32,73,110,116,101,114,97,99,116,105,111,110, - 115,32,119,105,116,104,32,116,104,101,32,102,105,108,101,32, - 115,121,115,116,101,109,32,97,114,101,32,99,97,99,104,101, - 100,32,102,111,114,32,112,101,114,102,111,114,109,97,110,99, - 101,44,32,98,101,105,110,103,10,32,32,32,32,114,101,102, - 114,101,115,104,101,100,32,119,104,101,110,32,116,104,101,32, - 100,105,114,101,99,116,111,114,121,32,116,104,101,32,102,105, - 110,100,101,114,32,105,115,32,104,97,110,100,108,105,110,103, - 32,104,97,115,32,98,101,101,110,32,109,111,100,105,102,105, - 101,100,46,10,10,32,32,32,32,99,2,0,0,0,0,0, - 0,0,0,0,0,0,5,0,0,0,6,0,0,0,7,0, - 0,0,115,84,0,0,0,103,0,125,3,124,2,68,0,93, - 32,92,2,137,0,125,4,124,3,160,0,135,0,102,1,100, - 1,100,2,132,8,124,4,68,0,131,1,161,1,1,0,113, - 8,124,3,124,0,95,1,124,1,112,54,100,3,124,0,95, - 2,100,4,124,0,95,3,116,4,131,0,124,0,95,5,116, - 4,131,0,124,0,95,6,100,5,83,0,41,6,122,154,73, - 110,105,116,105,97,108,105,122,101,32,119,105,116,104,32,116, - 104,101,32,112,97,116,104,32,116,111,32,115,101,97,114,99, - 104,32,111,110,32,97,110,100,32,97,32,118,97,114,105,97, - 98,108,101,32,110,117,109,98,101,114,32,111,102,10,32,32, - 32,32,32,32,32,32,50,45,116,117,112,108,101,115,32,99, - 111,110,116,97,105,110,105,110,103,32,116,104,101,32,108,111, - 97,100,101,114,32,97,110,100,32,116,104,101,32,102,105,108, - 101,32,115,117,102,102,105,120,101,115,32,116,104,101,32,108, - 111,97,100,101,114,10,32,32,32,32,32,32,32,32,114,101, - 99,111,103,110,105,122,101,115,46,99,1,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,51,0, - 0,0,115,22,0,0,0,124,0,93,14,125,1,124,1,136, - 0,102,2,86,0,1,0,113,2,100,0,83,0,114,121,0, - 0,0,114,7,0,0,0,114,28,1,0,0,169,1,114,151, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,9,0, - 0,0,147,5,0,0,114,14,0,0,0,122,38,70,105,108, - 101,70,105,110,100,101,114,46,95,95,105,110,105,116,95,95, - 46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,120, - 112,114,62,114,86,0,0,0,114,116,0,0,0,78,41,7, - 114,178,0,0,0,218,8,95,108,111,97,100,101,114,115,114, - 58,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,130,0,0,0,114, - 58,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,200,0, - 0,0,114,7,0,0,0,114,79,1,0,0,114,8,0,0, - 0,114,223,0,0,0,141,5,0,0,115,18,0,0,0,4, - 4,12,1,26,1,6,1,10,2,6,1,8,1,12,1,255, - 128,122,19,70,105,108,101,70,105,110,100,101,114,46,95,95, - 105,110,105,116,95,95,99,1,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,2,0,0,0,67,0,0,0,115, - 10,0,0,0,100,1,124,0,95,0,100,2,83,0,41,3, - 122,31,73,110,118,97,108,105,100,97,116,101,32,116,104,101, - 32,100,105,114,101,99,116,111,114,121,32,109,116,105,109,101, - 46,114,116,0,0,0,78,41,1,114,81,1,0,0,114,8, - 1,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,62,1,0,0,155,5,0,0,114,69,0,0,0, - 122,28,70,105,108,101,70,105,110,100,101,114,46,105,110,118, - 97,108,105,100,97,116,101,95,99,97,99,104,101,115,99,2, - 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3, - 0,0,0,67,0,0,0,115,42,0,0,0,124,0,160,0, - 124,1,161,1,125,2,124,2,100,1,117,0,114,26,100,1, - 103,0,102,2,83,0,124,2,106,1,124,2,106,2,112,38, - 103,0,102,2,83,0,41,2,122,197,84,114,121,32,116,111, - 32,102,105,110,100,32,97,32,108,111,97,100,101,114,32,102, - 111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,100, - 32,109,111,100,117,108,101,44,32,111,114,32,116,104,101,32, - 110,97,109,101,115,112,97,99,101,10,32,32,32,32,32,32, - 32,32,112,97,99,107,97,103,101,32,112,111,114,116,105,111, - 110,115,46,32,82,101,116,117,114,110,115,32,40,108,111,97, - 100,101,114,44,32,108,105,115,116,45,111,102,45,112,111,114, - 116,105,111,110,115,41,46,10,10,32,32,32,32,32,32,32, - 32,84,104,105,115,32,109,101,116,104,111,100,32,105,115,32, - 100,101,112,114,101,99,97,116,101,100,46,32,32,85,115,101, - 32,102,105,110,100,95,115,112,101,99,40,41,32,105,110,115, - 116,101,97,100,46,10,10,32,32,32,32,32,32,32,32,78, - 41,3,114,214,0,0,0,114,151,0,0,0,114,189,0,0, - 0,41,3,114,130,0,0,0,114,150,0,0,0,114,198,0, - 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,148,0,0,0,161,5,0,0,115,10,0,0,0,10, - 7,8,1,8,1,16,1,255,128,122,22,70,105,108,101,70, - 105,110,100,101,114,46,102,105,110,100,95,108,111,97,100,101, - 114,99,6,0,0,0,0,0,0,0,0,0,0,0,7,0, - 0,0,6,0,0,0,67,0,0,0,115,26,0,0,0,124, - 1,124,2,124,3,131,2,125,6,116,0,124,2,124,3,124, - 6,124,4,100,1,141,4,83,0,41,2,78,114,188,0,0, - 0,41,1,114,201,0,0,0,41,7,114,130,0,0,0,114, - 199,0,0,0,114,150,0,0,0,114,58,0,0,0,90,4, - 115,109,115,108,114,213,0,0,0,114,151,0,0,0,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,75,1, - 0,0,173,5,0,0,115,10,0,0,0,10,1,8,1,2, - 1,6,255,255,128,122,20,70,105,108,101,70,105,110,100,101, - 114,46,95,103,101,116,95,115,112,101,99,78,99,3,0,0, - 0,0,0,0,0,0,0,0,0,14,0,0,0,8,0,0, - 0,67,0,0,0,115,100,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,20,4,0,116,6,144,1,121,98,1,0, - 1,0,1,0,100,4,125,5,89,0,124,5,124,0,106,7, - 107,3,114,88,124,0,160,8,161,0,1,0,124,5,124,0, - 95,7,116,9,131,0,114,110,124,0,106,10,125,6,124,4, - 160,11,161,0,125,7,110,10,124,0,106,12,125,6,124,4, - 125,7,124,7,124,6,118,0,114,214,116,13,124,0,106,2, - 124,4,131,2,125,8,124,0,106,14,68,0,93,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,204,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,146,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,118,0,144,1,114,50,116,15,124,12, - 131,1,144,1,114,50,124,0,160,16,124,10,124,1,124,12, - 100,8,124,2,161,5,2,0,1,0,83,0,113,220,124,3, - 144,1,114,94,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,119,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,86,0,0,0,114,45,0,0,0,114,116,0,0, - 0,114,223,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,55,0,0, - 0,114,63,0,0,0,114,58,0,0,0,114,19,0,0,0, - 114,70,0,0,0,114,21,1,0,0,114,64,0,0,0,114, - 81,1,0,0,218,11,95,102,105,108,108,95,99,97,99,104, - 101,114,22,0,0,0,114,84,1,0,0,114,117,0,0,0, - 114,83,1,0,0,114,54,0,0,0,114,80,1,0,0,114, - 68,0,0,0,114,75,1,0,0,114,71,0,0,0,114,146, - 0,0,0,114,160,0,0,0,114,194,0,0,0,114,189,0, - 0,0,41,14,114,130,0,0,0,114,150,0,0,0,114,213, - 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,180, - 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,29,1,0,0,114,199,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,198,0,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,114,214,0,0,0, - 178,5,0,0,115,80,0,0,0,4,5,14,1,2,1,24, - 1,14,1,6,1,10,1,8,1,6,1,6,2,6,1,10, - 1,6,2,4,1,8,2,12,1,14,1,8,1,10,1,8, - 1,24,1,2,255,8,5,14,2,16,1,16,1,14,1,10, - 1,10,1,4,1,8,255,2,128,6,2,12,1,12,1,8, - 1,4,1,4,1,2,219,255,128,122,20,70,105,108,101,70, - 105,110,100,101,114,46,102,105,110,100,95,115,112,101,99,99, - 1,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, - 10,0,0,0,67,0,0,0,115,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,24,4,0,116,4,116, - 5,116,6,102,3,121,188,1,0,1,0,1,0,103,0,125, - 2,89,0,116,7,106,8,160,9,100,1,161,1,115,78,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,130,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,88,124, - 3,124,0,95,11,116,7,106,8,160,9,116,16,161,1,114, - 184,100,4,100,5,132,0,124,2,68,0,131,1,124,0,95, - 17,100,6,83,0,100,6,83,0,119,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,15,0,0,0,114,86,0,0,0,114,76,0, - 0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,83,0,0,0,115,20,0,0,0, - 104,0,124,0,93,12,125,1,124,1,160,0,161,0,146,2, - 113,4,83,0,114,7,0,0,0,41,1,114,117,0,0,0, - 41,2,114,5,0,0,0,90,2,102,110,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,114,13,0,0,0,255, - 5,0,0,115,4,0,0,0,20,0,255,128,122,41,70,105, + 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,214,0,0,0, + 114,151,0,0,0,114,189,0,0,0,41,3,114,130,0,0, + 0,114,150,0,0,0,114,198,0,0,0,114,7,0,0,0, + 114,7,0,0,0,114,8,0,0,0,114,148,0,0,0,165, + 5,0,0,115,10,0,0,0,10,7,8,1,8,1,16,1, + 255,128,122,22,70,105,108,101,70,105,110,100,101,114,46,102, + 105,110,100,95,108,111,97,100,101,114,99,6,0,0,0,0, + 0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,67, + 0,0,0,115,26,0,0,0,124,1,124,2,124,3,131,2, + 125,6,116,0,124,2,124,3,124,6,124,4,100,1,141,4, + 83,0,41,2,78,114,188,0,0,0,41,1,114,201,0,0, + 0,41,7,114,130,0,0,0,114,199,0,0,0,114,150,0, + 0,0,114,58,0,0,0,90,4,115,109,115,108,114,213,0, + 0,0,114,151,0,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,77,1,0,0,177,5,0,0,115, + 10,0,0,0,10,1,8,1,2,1,6,255,255,128,122,20, + 70,105,108,101,70,105,110,100,101,114,46,95,103,101,116,95, + 115,112,101,99,78,99,3,0,0,0,0,0,0,0,0,0, + 0,0,14,0,0,0,8,0,0,0,67,0,0,0,115,100, + 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,20,4, + 0,116,6,144,1,121,98,1,0,1,0,1,0,100,4,125, + 5,89,0,124,5,124,0,106,7,107,3,114,88,124,0,160, + 8,161,0,1,0,124,5,124,0,95,7,116,9,131,0,114, + 110,124,0,106,10,125,6,124,4,160,11,161,0,125,7,110, + 10,124,0,106,12,125,6,124,4,125,7,124,7,124,6,118, + 0,114,214,116,13,124,0,106,2,124,4,131,2,125,8,124, + 0,106,14,68,0,93,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,204,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, + 146,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,118, + 0,144,1,114,50,116,15,124,12,131,1,144,1,114,50,124, + 0,160,16,124,10,124,1,124,12,100,8,124,2,161,5,2, + 0,1,0,83,0,113,220,124,3,144,1,114,94,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,119,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,86,0,0,0, + 114,45,0,0,0,114,116,0,0,0,114,223,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,55,0,0,0,114,63,0,0,0,114, + 58,0,0,0,114,19,0,0,0,114,70,0,0,0,114,22, + 1,0,0,114,64,0,0,0,114,83,1,0,0,218,11,95, + 102,105,108,108,95,99,97,99,104,101,114,22,0,0,0,114, + 86,1,0,0,114,117,0,0,0,114,85,1,0,0,114,54, + 0,0,0,114,82,1,0,0,114,68,0,0,0,114,77,1, + 0,0,114,71,0,0,0,114,146,0,0,0,114,160,0,0, + 0,114,194,0,0,0,114,189,0,0,0,41,14,114,130,0, + 0,0,114,150,0,0,0,114,213,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,180,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,30,1,0, + 0,114,199,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,198,0,0,0,114,7,0,0,0,114,7,0,0,0,114, + 8,0,0,0,114,214,0,0,0,182,5,0,0,115,80,0, + 0,0,4,5,14,1,2,1,24,1,14,1,6,1,10,1, + 8,1,6,1,6,2,6,1,10,1,6,2,4,1,8,2, + 12,1,14,1,8,1,10,1,8,1,24,1,2,255,8,5, + 14,2,16,1,16,1,14,1,10,1,10,1,4,1,8,255, + 2,128,6,2,12,1,12,1,8,1,4,1,4,1,2,219, + 255,128,122,20,70,105,108,101,70,105,110,100,101,114,46,102, + 105,110,100,95,115,112,101,99,99,1,0,0,0,0,0,0, + 0,0,0,0,0,9,0,0,0,10,0,0,0,67,0,0, + 0,115,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,24,4,0,116,4,116,5,116,6,102,3,121,188, + 1,0,1,0,1,0,103,0,125,2,89,0,116,7,106,8, + 160,9,100,1,161,1,115,78,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,130,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,88,124,3,124,0,95,11,116,7, + 106,8,160,9,116,16,161,1,114,184,100,4,100,5,132,0, + 124,2,68,0,131,1,124,0,95,17,100,6,83,0,100,6, + 83,0,119,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,15,0,0, + 0,114,86,0,0,0,114,76,0,0,0,99,1,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, + 83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,125, + 1,124,1,160,0,161,0,146,2,113,4,83,0,114,7,0, + 0,0,41,1,114,117,0,0,0,41,2,114,5,0,0,0, + 90,2,102,110,114,7,0,0,0,114,7,0,0,0,114,8, + 0,0,0,114,13,0,0,0,3,6,0,0,115,4,0,0, + 0,20,0,255,128,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,58,0,0,0,114,19,0,0,0,90,7,108, + 105,115,116,100,105,114,114,70,0,0,0,114,71,1,0,0, + 218,15,80,101,114,109,105,115,115,105,111,110,69,114,114,111, + 114,218,18,78,111,116,65,68,105,114,101,99,116,111,114,121, + 69,114,114,111,114,114,16,0,0,0,114,26,0,0,0,114, + 27,0,0,0,114,84,1,0,0,114,85,1,0,0,114,112, + 0,0,0,114,77,0,0,0,114,117,0,0,0,218,3,97, + 100,100,114,28,0,0,0,114,86,1,0,0,41,9,114,130, + 0,0,0,114,58,0,0,0,90,8,99,111,110,116,101,110, + 116,115,90,21,108,111,119,101,114,95,115,117,102,102,105,120, + 95,99,111,110,116,101,110,116,115,114,56,1,0,0,114,128, + 0,0,0,114,40,1,0,0,114,30,1,0,0,90,8,110, + 101,119,95,110,97,109,101,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,88,1,0,0,230,5,0,0,115, + 40,0,0,0,6,2,2,1,22,1,18,1,6,3,12,3, + 12,1,6,7,8,1,16,1,4,1,18,1,4,2,12,1, + 6,1,12,1,20,1,4,255,2,233,255,128,122,22,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,58,0,0,0,114, - 19,0,0,0,90,7,108,105,115,116,100,105,114,114,70,0, - 0,0,114,69,1,0,0,218,15,80,101,114,109,105,115,115, - 105,111,110,69,114,114,111,114,218,18,78,111,116,65,68,105, - 114,101,99,116,111,114,121,69,114,114,111,114,114,16,0,0, - 0,114,26,0,0,0,114,27,0,0,0,114,82,1,0,0, - 114,83,1,0,0,114,112,0,0,0,114,77,0,0,0,114, - 117,0,0,0,218,3,97,100,100,114,28,0,0,0,114,84, - 1,0,0,41,9,114,130,0,0,0,114,58,0,0,0,90, - 8,99,111,110,116,101,110,116,115,90,21,108,111,119,101,114, - 95,115,117,102,102,105,120,95,99,111,110,116,101,110,116,115, - 114,55,1,0,0,114,128,0,0,0,114,39,1,0,0,114, - 29,1,0,0,90,8,110,101,119,95,110,97,109,101,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,86,1, - 0,0,226,5,0,0,115,40,0,0,0,6,2,2,1,22, - 1,18,1,6,3,12,3,12,1,6,7,8,1,16,1,4, - 1,18,1,4,2,12,1,6,1,12,1,20,1,4,255,2, - 233,255,128,122,22,70,105,108,101,70,105,110,100,101,114,46, - 95,102,105,108,108,95,99,97,99,104,101,99,1,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, - 7,0,0,0,115,18,0,0,0,135,0,135,1,102,2,100, - 1,100,2,132,8,125,2,124,2,83,0,41,4,97,20,1, - 0,0,65,32,99,108,97,115,115,32,109,101,116,104,111,100, - 32,119,104,105,99,104,32,114,101,116,117,114,110,115,32,97, - 32,99,108,111,115,117,114,101,32,116,111,32,117,115,101,32, - 111,110,32,115,121,115,46,112,97,116,104,95,104,111,111,107, - 10,32,32,32,32,32,32,32,32,119,104,105,99,104,32,119, - 105,108,108,32,114,101,116,117,114,110,32,97,110,32,105,110, - 115,116,97,110,99,101,32,117,115,105,110,103,32,116,104,101, - 32,115,112,101,99,105,102,105,101,100,32,108,111,97,100,101, - 114,115,32,97,110,100,32,116,104,101,32,112,97,116,104,10, - 32,32,32,32,32,32,32,32,99,97,108,108,101,100,32,111, - 110,32,116,104,101,32,99,108,111,115,117,114,101,46,10,10, - 32,32,32,32,32,32,32,32,73,102,32,116,104,101,32,112, - 97,116,104,32,99,97,108,108,101,100,32,111,110,32,116,104, - 101,32,99,108,111,115,117,114,101,32,105,115,32,110,111,116, - 32,97,32,100,105,114,101,99,116,111,114,121,44,32,73,109, - 112,111,114,116,69,114,114,111,114,32,105,115,10,32,32,32, - 32,32,32,32,32,114,97,105,115,101,100,46,10,10,32,32, - 32,32,32,32,32,32,99,1,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,4,0,0,0,19,0,0,0,115, - 36,0,0,0,116,0,124,0,131,1,115,20,116,1,100,1, - 124,0,100,2,141,2,130,1,136,0,124,0,103,1,136,1, - 162,1,82,0,142,0,83,0,41,4,122,45,80,97,116,104, - 32,104,111,111,107,32,102,111,114,32,105,109,112,111,114,116, - 108,105,98,46,109,97,99,104,105,110,101,114,121,46,70,105, - 108,101,70,105,110,100,101,114,46,122,30,111,110,108,121,32, - 100,105,114,101,99,116,111,114,105,101,115,32,97,114,101,32, - 115,117,112,112,111,114,116,101,100,114,62,0,0,0,78,41, - 2,114,71,0,0,0,114,129,0,0,0,114,62,0,0,0, - 169,2,114,209,0,0,0,114,85,1,0,0,114,7,0,0, - 0,114,8,0,0,0,218,24,112,97,116,104,95,104,111,111, - 107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,114, - 11,6,0,0,115,8,0,0,0,8,2,12,1,16,1,255, - 128,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,78,114,7,0,0,0,41, - 3,114,209,0,0,0,114,85,1,0,0,114,91,1,0,0, - 114,7,0,0,0,114,90,1,0,0,114,8,0,0,0,218, - 9,112,97,116,104,95,104,111,111,107,1,6,0,0,115,6, - 0,0,0,14,10,4,6,255,128,122,20,70,105,108,101,70, - 105,110,100,101,114,46,112,97,116,104,95,104,111,111,107,99, + 97,99,104,101,99,1,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,7,0,0,0,115,18,0, + 0,0,135,0,135,1,102,2,100,1,100,2,132,8,125,2, + 124,2,83,0,41,4,97,20,1,0,0,65,32,99,108,97, + 115,115,32,109,101,116,104,111,100,32,119,104,105,99,104,32, + 114,101,116,117,114,110,115,32,97,32,99,108,111,115,117,114, + 101,32,116,111,32,117,115,101,32,111,110,32,115,121,115,46, + 112,97,116,104,95,104,111,111,107,10,32,32,32,32,32,32, + 32,32,119,104,105,99,104,32,119,105,108,108,32,114,101,116, + 117,114,110,32,97,110,32,105,110,115,116,97,110,99,101,32, + 117,115,105,110,103,32,116,104,101,32,115,112,101,99,105,102, + 105,101,100,32,108,111,97,100,101,114,115,32,97,110,100,32, + 116,104,101,32,112,97,116,104,10,32,32,32,32,32,32,32, + 32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,99, + 108,111,115,117,114,101,46,10,10,32,32,32,32,32,32,32, + 32,73,102,32,116,104,101,32,112,97,116,104,32,99,97,108, + 108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,117, + 114,101,32,105,115,32,110,111,116,32,97,32,100,105,114,101, + 99,116,111,114,121,44,32,73,109,112,111,114,116,69,114,114, + 111,114,32,105,115,10,32,32,32,32,32,32,32,32,114,97, + 105,115,101,100,46,10,10,32,32,32,32,32,32,32,32,99, 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,67,0,0,0,114,52,1,0,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,77,0,0,0,114,58,0,0,0,114,8, - 1,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,53,1,0,0,19,6,0,0,114,46,1,0,0, - 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,137,0,0,0,114, - 136,0,0,0,114,138,0,0,0,114,139,0,0,0,114,223, - 0,0,0,114,62,1,0,0,114,154,0,0,0,114,217,0, - 0,0,114,148,0,0,0,114,75,1,0,0,114,214,0,0, - 0,114,86,1,0,0,114,221,0,0,0,114,92,1,0,0, - 114,53,1,0,0,114,7,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,78,1,0,0,132,5, - 0,0,115,26,0,0,0,8,0,4,2,8,7,8,14,4, - 4,8,2,8,12,10,5,8,48,2,31,10,1,12,17,255, - 128,114,78,1,0,0,99,4,0,0,0,0,0,0,0,0, - 0,0,0,6,0,0,0,8,0,0,0,67,0,0,0,115, - 144,0,0,0,124,0,160,0,100,1,161,1,125,4,124,0, - 160,0,100,2,161,1,125,5,124,4,115,66,124,5,114,36, - 124,5,106,1,125,4,110,30,124,2,124,3,107,2,114,56, - 116,2,124,1,124,2,131,2,125,4,110,10,116,3,124,1, - 124,2,131,2,125,4,124,5,115,84,116,4,124,1,124,2, - 124,4,100,3,141,3,125,5,122,38,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,100,0,83,0, - 4,0,116,5,121,142,1,0,1,0,1,0,89,0,100,0, - 83,0,119,0,41,6,78,218,10,95,95,108,111,97,100,101, - 114,95,95,218,8,95,95,115,112,101,99,95,95,114,79,1, - 0,0,90,8,95,95,102,105,108,101,95,95,90,10,95,95, - 99,97,99,104,101,100,95,95,41,6,218,3,103,101,116,114, - 151,0,0,0,114,26,1,0,0,114,20,1,0,0,114,201, - 0,0,0,218,9,69,120,99,101,112,116,105,111,110,41,6, - 90,2,110,115,114,128,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,151, - 0,0,0,114,198,0,0,0,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,218,14,95,102,105,120,95,117,112, - 95,109,111,100,117,108,101,25,6,0,0,115,38,0,0,0, - 10,2,10,1,4,1,4,1,8,1,8,1,12,1,10,2, - 4,1,14,1,2,1,8,1,8,1,8,1,14,1,12,1, - 6,2,2,254,255,128,114,97,1,0,0,99,0,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,116,1,160,2,161, - 0,102,2,125,0,116,3,116,4,102,2,125,1,116,5,116, - 6,102,2,125,2,124,0,124,1,124,2,103,3,83,0,41, - 2,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,78,41,7,114,17,1,0,0,114,174,0,0,0,218, - 18,101,120,116,101,110,115,105,111,110,95,115,117,102,102,105, - 120,101,115,114,20,1,0,0,114,113,0,0,0,114,26,1, - 0,0,114,101,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,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,195,0,0,0,48,6,0,0,115, - 10,0,0,0,12,5,8,1,8,1,10,1,255,128,114,195, - 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, - 1,0,0,0,1,0,0,0,67,0,0,0,115,8,0,0, - 0,124,0,97,0,100,0,83,0,114,121,0,0,0,41,1, - 114,146,0,0,0,41,1,218,17,95,98,111,111,116,115,116, - 114,97,112,95,109,111,100,117,108,101,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,218,21,95,115,101,116,95, - 98,111,111,116,115,116,114,97,112,95,109,111,100,117,108,101, - 59,6,0,0,115,4,0,0,0,8,2,255,128,114,100,1, - 0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,4,0,0,0,67,0,0,0,115,50,0,0,0, - 116,0,124,0,131,1,1,0,116,1,131,0,125,1,116,2, - 106,3,160,4,116,5,106,6,124,1,142,0,103,1,161,1, - 1,0,116,2,106,7,160,8,116,9,161,1,1,0,100,1, - 83,0,41,2,122,41,73,110,115,116,97,108,108,32,116,104, - 101,32,112,97,116,104,45,98,97,115,101,100,32,105,109,112, - 111,114,116,32,99,111,109,112,111,110,101,110,116,115,46,78, - 41,10,114,100,1,0,0,114,195,0,0,0,114,16,0,0, - 0,114,67,1,0,0,114,178,0,0,0,114,78,1,0,0, - 114,92,1,0,0,218,9,109,101,116,97,95,112,97,116,104, - 114,197,0,0,0,114,61,1,0,0,41,2,114,99,1,0, - 0,90,17,115,117,112,112,111,114,116,101,100,95,108,111,97, - 100,101,114,115,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,218,8,95,105,110,115,116,97,108,108,64,6,0, - 0,115,10,0,0,0,8,2,6,1,20,1,16,1,255,128, - 114,102,1,0,0,41,1,114,75,0,0,0,41,1,78,41, - 3,78,78,78,41,2,114,0,0,0,0,114,0,0,0,0, - 41,1,84,41,1,78,41,1,78,41,83,114,139,0,0,0, - 114,146,0,0,0,114,174,0,0,0,114,79,0,0,0,114, - 16,0,0,0,114,88,0,0,0,114,171,0,0,0,114,26, - 0,0,0,114,218,0,0,0,90,2,110,116,114,19,0,0, - 0,114,203,0,0,0,90,5,112,111,115,105,120,114,48,0, - 0,0,218,3,97,108,108,114,51,0,0,0,114,52,0,0, - 0,114,73,0,0,0,114,29,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,28,0,0,0,114,30,0,0,0,114,22,0,0, - 0,114,37,0,0,0,114,43,0,0,0,114,46,0,0,0, - 114,54,0,0,0,114,61,0,0,0,114,63,0,0,0,114, - 67,0,0,0,114,68,0,0,0,114,71,0,0,0,114,74, - 0,0,0,114,84,0,0,0,218,4,116,121,112,101,218,8, - 95,95,99,111,100,101,95,95,114,173,0,0,0,114,35,0, - 0,0,114,159,0,0,0,114,34,0,0,0,114,40,0,0, - 0,114,251,0,0,0,114,104,0,0,0,114,100,0,0,0, - 114,113,0,0,0,114,197,0,0,0,114,98,1,0,0,114, - 219,0,0,0,114,101,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, - 109,0,0,0,114,114,0,0,0,114,120,0,0,0,114,124, - 0,0,0,114,126,0,0,0,114,147,0,0,0,114,154,0, - 0,0,114,163,0,0,0,114,167,0,0,0,114,169,0,0, - 0,114,176,0,0,0,114,181,0,0,0,114,182,0,0,0, - 114,187,0,0,0,218,6,111,98,106,101,99,116,114,196,0, - 0,0,114,201,0,0,0,114,202,0,0,0,114,222,0,0, - 0,114,236,0,0,0,114,254,0,0,0,114,20,1,0,0, - 114,26,1,0,0,114,17,1,0,0,114,32,1,0,0,114, - 58,1,0,0,114,61,1,0,0,114,78,1,0,0,114,97, - 1,0,0,114,195,0,0,0,114,100,1,0,0,114,102,1, - 0,0,114,7,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,218,8,60,109,111,100,117,108,101,62, - 1,0,0,0,115,172,0,0,0,4,0,4,22,8,3,8, - 1,8,1,8,1,8,1,10,3,4,1,8,1,10,1,8, - 2,4,3,10,1,6,2,22,2,8,1,10,1,14,1,4, - 4,4,1,2,1,2,1,4,255,8,4,6,16,8,3,8, - 5,8,5,8,6,8,6,8,12,8,10,8,9,8,5,8, - 7,10,9,10,22,0,127,16,25,12,1,4,2,4,1,6, - 2,6,1,10,1,8,2,6,2,8,2,16,2,8,71,8, - 40,8,19,8,12,8,12,8,31,8,17,8,33,8,28,10, - 24,10,13,10,10,8,11,6,14,4,3,2,1,12,255,14, - 68,14,64,16,30,0,127,14,17,18,50,18,45,18,25,14, - 53,14,63,14,43,0,127,14,20,0,127,10,22,8,23,8, - 11,12,5,255,128, + 4,0,0,0,19,0,0,0,115,36,0,0,0,116,0,124, + 0,131,1,115,20,116,1,100,1,124,0,100,2,141,2,130, + 1,136,0,124,0,103,1,136,1,162,1,82,0,142,0,83, + 0,41,4,122,45,80,97,116,104,32,104,111,111,107,32,102, + 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, + 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, + 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, + 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, + 101,100,114,62,0,0,0,78,41,2,114,71,0,0,0,114, + 129,0,0,0,114,62,0,0,0,169,2,114,209,0,0,0, + 114,87,1,0,0,114,7,0,0,0,114,8,0,0,0,218, + 24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, + 105,108,101,70,105,110,100,101,114,15,6,0,0,115,8,0, + 0,0,8,2,12,1,16,1,255,128,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,78,114,7,0,0,0,41,3,114,209,0,0,0,114, + 87,1,0,0,114,93,1,0,0,114,7,0,0,0,114,92, + 1,0,0,114,8,0,0,0,218,9,112,97,116,104,95,104, + 111,111,107,5,6,0,0,115,6,0,0,0,14,10,4,6, + 255,128,122,20,70,105,108,101,70,105,110,100,101,114,46,112, + 97,116,104,95,104,111,111,107,99,1,0,0,0,0,0,0, + 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, + 0,114,53,1,0,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,77,0, + 0,0,114,58,0,0,0,114,8,1,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,114,54,1,0,0, + 23,6,0,0,114,47,1,0,0,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,137,0,0,0,114,136,0,0,0,114,138,0, + 0,0,114,139,0,0,0,114,223,0,0,0,114,64,1,0, + 0,114,154,0,0,0,114,217,0,0,0,114,148,0,0,0, + 114,77,1,0,0,114,214,0,0,0,114,88,1,0,0,114, + 221,0,0,0,114,94,1,0,0,114,54,1,0,0,114,7, + 0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, + 0,0,114,80,1,0,0,136,5,0,0,115,26,0,0,0, + 8,0,4,2,8,7,8,14,4,4,8,2,8,12,10,5, + 8,48,2,31,10,1,12,17,255,128,114,80,1,0,0,99, + 4,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, + 8,0,0,0,67,0,0,0,115,144,0,0,0,124,0,160, + 0,100,1,161,1,125,4,124,0,160,0,100,2,161,1,125, + 5,124,4,115,66,124,5,114,36,124,5,106,1,125,4,110, + 30,124,2,124,3,107,2,114,56,116,2,124,1,124,2,131, + 2,125,4,110,10,116,3,124,1,124,2,131,2,125,4,124, + 5,115,84,116,4,124,1,124,2,124,4,100,3,141,3,125, + 5,122,38,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,100,0,83,0,4,0,116,5,121,142,1, + 0,1,0,1,0,89,0,100,0,83,0,119,0,41,6,78, + 218,10,95,95,108,111,97,100,101,114,95,95,218,8,95,95, + 115,112,101,99,95,95,114,81,1,0,0,90,8,95,95,102, + 105,108,101,95,95,90,10,95,95,99,97,99,104,101,100,95, + 95,41,6,218,3,103,101,116,114,151,0,0,0,114,27,1, + 0,0,114,21,1,0,0,114,201,0,0,0,218,9,69,120, + 99,101,112,116,105,111,110,41,6,90,2,110,115,114,128,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,151,0,0,0,114,198,0,0, + 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, + 218,14,95,102,105,120,95,117,112,95,109,111,100,117,108,101, + 29,6,0,0,115,38,0,0,0,10,2,10,1,4,1,4, + 1,8,1,8,1,12,1,10,2,4,1,14,1,2,1,8, + 1,8,1,8,1,14,1,12,1,6,2,2,254,255,128,114, + 99,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0, + 0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,3, + 116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,0, + 124,1,124,2,103,3,83,0,41,2,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,78,41,7,114,17, + 1,0,0,114,174,0,0,0,218,18,101,120,116,101,110,115, + 105,111,110,95,115,117,102,102,105,120,101,115,114,21,1,0, + 0,114,113,0,0,0,114,27,1,0,0,114,101,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,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, + 195,0,0,0,52,6,0,0,115,10,0,0,0,12,5,8, + 1,8,1,10,1,255,128,114,195,0,0,0,99,1,0,0, + 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0, + 0,67,0,0,0,115,8,0,0,0,124,0,97,0,100,0, + 83,0,114,121,0,0,0,41,1,114,146,0,0,0,41,1, + 218,17,95,98,111,111,116,115,116,114,97,112,95,109,111,100, + 117,108,101,114,7,0,0,0,114,7,0,0,0,114,8,0, + 0,0,218,21,95,115,101,116,95,98,111,111,116,115,116,114, + 97,112,95,109,111,100,117,108,101,63,6,0,0,115,4,0, + 0,0,8,2,255,128,114,102,1,0,0,99,1,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, + 67,0,0,0,115,50,0,0,0,116,0,124,0,131,1,1, + 0,116,1,131,0,125,1,116,2,106,3,160,4,116,5,106, + 6,124,1,142,0,103,1,161,1,1,0,116,2,106,7,160, + 8,116,9,161,1,1,0,100,1,83,0,41,2,122,41,73, + 110,115,116,97,108,108,32,116,104,101,32,112,97,116,104,45, + 98,97,115,101,100,32,105,109,112,111,114,116,32,99,111,109, + 112,111,110,101,110,116,115,46,78,41,10,114,102,1,0,0, + 114,195,0,0,0,114,16,0,0,0,114,69,1,0,0,114, + 178,0,0,0,114,80,1,0,0,114,94,1,0,0,218,9, + 109,101,116,97,95,112,97,116,104,114,197,0,0,0,114,63, + 1,0,0,41,2,114,101,1,0,0,90,17,115,117,112,112, + 111,114,116,101,100,95,108,111,97,100,101,114,115,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,218,8,95,105, + 110,115,116,97,108,108,68,6,0,0,115,10,0,0,0,8, + 2,6,1,20,1,16,1,255,128,114,104,1,0,0,41,1, + 114,75,0,0,0,41,1,78,41,3,78,78,78,41,2,114, + 0,0,0,0,114,0,0,0,0,41,1,84,41,1,78,41, + 1,78,41,83,114,139,0,0,0,114,146,0,0,0,114,174, + 0,0,0,114,79,0,0,0,114,16,0,0,0,114,88,0, + 0,0,114,171,0,0,0,114,26,0,0,0,114,218,0,0, + 0,90,2,110,116,114,19,0,0,0,114,203,0,0,0,90, + 5,112,111,115,105,120,114,48,0,0,0,218,3,97,108,108, + 114,51,0,0,0,114,52,0,0,0,114,73,0,0,0,114, + 29,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,28,0,0,0, + 114,30,0,0,0,114,22,0,0,0,114,37,0,0,0,114, + 43,0,0,0,114,46,0,0,0,114,54,0,0,0,114,61, + 0,0,0,114,63,0,0,0,114,67,0,0,0,114,68,0, + 0,0,114,71,0,0,0,114,74,0,0,0,114,84,0,0, + 0,218,4,116,121,112,101,218,8,95,95,99,111,100,101,95, + 95,114,173,0,0,0,114,35,0,0,0,114,159,0,0,0, + 114,34,0,0,0,114,40,0,0,0,114,251,0,0,0,114, + 104,0,0,0,114,100,0,0,0,114,113,0,0,0,114,197, + 0,0,0,114,100,1,0,0,114,219,0,0,0,114,101,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,109,0,0,0,114,114,0, + 0,0,114,120,0,0,0,114,124,0,0,0,114,126,0,0, + 0,114,147,0,0,0,114,154,0,0,0,114,163,0,0,0, + 114,167,0,0,0,114,169,0,0,0,114,176,0,0,0,114, + 181,0,0,0,114,182,0,0,0,114,187,0,0,0,218,6, + 111,98,106,101,99,116,114,196,0,0,0,114,201,0,0,0, + 114,202,0,0,0,114,222,0,0,0,114,236,0,0,0,114, + 254,0,0,0,114,21,1,0,0,114,27,1,0,0,114,17, + 1,0,0,114,33,1,0,0,114,59,1,0,0,114,63,1, + 0,0,114,80,1,0,0,114,99,1,0,0,114,195,0,0, + 0,114,102,1,0,0,114,104,1,0,0,114,7,0,0,0, + 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,218, + 8,60,109,111,100,117,108,101,62,1,0,0,0,115,172,0, + 0,0,4,0,4,22,8,3,8,1,8,1,8,1,8,1, + 10,3,4,1,8,1,10,1,8,2,4,3,10,1,6,2, + 22,2,8,1,10,1,14,1,4,4,4,1,2,1,2,1, + 4,255,8,4,6,16,8,3,8,5,8,5,8,6,8,6, + 8,12,8,10,8,9,8,5,8,7,10,9,10,22,0,127, + 16,25,12,1,4,2,4,1,6,2,6,1,10,1,8,2, + 6,2,8,2,16,2,8,71,8,40,8,19,8,12,8,12, + 8,31,8,17,8,33,8,28,10,24,10,13,10,10,8,11, + 6,14,4,3,2,1,12,255,14,68,14,64,16,30,0,127, + 14,17,18,50,18,45,18,25,14,53,14,63,14,47,0,127, + 14,20,0,127,10,22,8,23,8,11,12,5,255,128, }; From webhook-mailer at python.org Thu Mar 4 18:39:37 2021 From: webhook-mailer at python.org (rhettinger) Date: Thu, 04 Mar 2021 23:39:37 -0000 Subject: [Python-checkins] bpo-43400: Remove "easy to use" from mock docs (GH-24752) Message-ID: https://github.com/python/cpython/commit/2122e486307d5577cb5fb5e7cfd24095695bc7e9 commit: 2122e486307d5577cb5fb5e7cfd24095695bc7e9 branch: master author: Eddie Peters committer: rhettinger date: 2021-03-04T15:39:29-08:00 summary: bpo-43400: Remove "easy to use" from mock docs (GH-24752) files: M Doc/library/unittest.mock.rst diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index f795a2e8c1aeb..1604731b99e3f 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -30,7 +30,7 @@ module and class level attributes within the scope of a test, along with some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`. -Mock is very easy to use and is designed for use with :mod:`unittest`. Mock +Mock is designed for use with :mod:`unittest` and is based on the 'action -> assertion' pattern instead of 'record -> replay' used by many mocking frameworks. From webhook-mailer at python.org Thu Mar 4 19:35:54 2021 From: webhook-mailer at python.org (rhettinger) Date: Fri, 05 Mar 2021 00:35:54 -0000 Subject: [Python-checkins] bpo-43400: Remove "easy to use" from mock docs (GH-24752) (GH-24758) Message-ID: https://github.com/python/cpython/commit/0dd4cb944b497dc6bd0b3763e461d72e9a7b6490 commit: 0dd4cb944b497dc6bd0b3763e461d72e9a7b6490 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: rhettinger date: 2021-03-04T16:35:43-08:00 summary: bpo-43400: Remove "easy to use" from mock docs (GH-24752) (GH-24758) files: M Doc/library/unittest.mock.rst diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index c5360f91f518d..9e73ec3240303 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -30,7 +30,7 @@ module and class level attributes within the scope of a test, along with some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`. -Mock is very easy to use and is designed for use with :mod:`unittest`. Mock +Mock is designed for use with :mod:`unittest` and is based on the 'action -> assertion' pattern instead of 'record -> replay' used by many mocking frameworks. From webhook-mailer at python.org Fri Mar 5 00:49:38 2021 From: webhook-mailer at python.org (gpshead) Date: Fri, 05 Mar 2021 05:49:38 -0000 Subject: [Python-checkins] bpo-43390: Set SA_ONSTACK in PyOS_setsig (GH-24730) Message-ID: https://github.com/python/cpython/commit/02ac6f41e5569ec28d625bb005155903f64cc9ee commit: 02ac6f41e5569ec28d625bb005155903f64cc9ee branch: master author: Gregory P. Smith committer: gpshead date: 2021-03-04T21:49:30-08:00 summary: bpo-43390: Set SA_ONSTACK in PyOS_setsig (GH-24730) This is friendlier to other in-process code that an extension module or embedding use could pull in such as CGo where tiny stacks are the norm and sigaltstack() has been used to provide for signal handlers. Without this, signals received by a process using tiny stacks may lead to stack overflow crashes. files: A Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst M Python/pylifecycle.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst new file mode 100644 index 0000000000000..ae115db84ece7 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst @@ -0,0 +1,6 @@ +CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for the VM's +default signal handlers. This is friendlier to other in-process code that +an extension module or embedding use could pull in (such as Golang's cgo) +where tiny thread stacks are the norm and ``sigaltstack()`` has been used to +provide for signal handlers. This is a no-op change for the vast majority +of processes that don't use sigaltstack. diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index ec770841c8de3..d03c6c07f7108 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2884,7 +2884,10 @@ PyOS_setsig(int sig, PyOS_sighandler_t handler) struct sigaction context, ocontext; context.sa_handler = handler; sigemptyset(&context.sa_mask); - context.sa_flags = 0; + /* Using SA_ONSTACK is friendlier to other C/C++/Golang-VM code that + * extension module or embedding code may use where tiny thread stacks + * are used. https://bugs.python.org/issue43390 */ + context.sa_flags = SA_ONSTACK; if (sigaction(sig, &context, &ocontext) == -1) return SIG_ERR; return ocontext.sa_handler; From webhook-mailer at python.org Fri Mar 5 04:33:20 2021 From: webhook-mailer at python.org (pitrou) Date: Fri, 05 Mar 2021 09:33:20 -0000 Subject: [Python-checkins] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) Message-ID: https://github.com/python/cpython/commit/68245b7a1030287294c65c298975ab9026543fd2 commit: 68245b7a1030287294c65c298975ab9026543fd2 branch: master author: Antoine Pitrou committer: pitrou date: 2021-03-05T10:32:50+01:00 summary: bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) We can receive signals (at the C level, in `trip_signal()` in signalmodule.c) while `signal.signal` is being called to modify the corresponding handler. Later when `PyErr_CheckSignals()` is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception. files: A Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst M Lib/test/test_signal.py M Modules/signalmodule.c diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 6a43fe70372c5..c9de4a4e015a3 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -6,6 +6,7 @@ import statistics import subprocess import sys +import threading import time import unittest from test import support @@ -1251,6 +1252,55 @@ def handler(signum, frame): # Python handler self.assertEqual(len(sigs), N, "Some signals were lost") + @unittest.skipUnless(hasattr(signal, "SIGUSR1"), + "test needs SIGUSR1") + def test_stress_modifying_handlers(self): + # bpo-43406: race condition between trip_signal() and signal.signal + signum = signal.SIGUSR1 + num_sent_signals = 0 + num_received_signals = 0 + do_stop = False + + def custom_handler(signum, frame): + nonlocal num_received_signals + num_received_signals += 1 + + def set_interrupts(): + nonlocal num_sent_signals + while not do_stop: + signal.raise_signal(signum) + num_sent_signals += 1 + + def cycle_handlers(): + while num_sent_signals < 100: + for i in range(20000): + # Cycle between a Python-defined and a non-Python handler + for handler in [custom_handler, signal.SIG_IGN]: + signal.signal(signum, handler) + + old_handler = signal.signal(signum, custom_handler) + self.addCleanup(signal.signal, signum, old_handler) + t = threading.Thread(target=set_interrupts) + t.start() + try: + with support.catch_unraisable_exception() as cm: + cycle_handlers() + if cm.unraisable is not None: + # An unraisable exception may be printed out when + # a signal is ignored due to the aforementioned + # race condition, check it. + self.assertIsInstance(cm.unraisable.exc_value, OSError) + self.assertIn( + f"Signal {signum} ignored due to race condition", + str(cm.unraisable.exc_value)) + # Sanity check that some signals were received, but not all + self.assertGreater(num_received_signals, 0) + self.assertLess(num_received_signals, num_sent_signals) + finally: + do_stop = True + t.join() + + class RaiseSignalTest(unittest.TestCase): def test_sigint(self): diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst new file mode 100644 index 0000000000000..c18a55ef32306 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst @@ -0,0 +1,2 @@ +Fix a possible race condition where ``PyErr_CheckSignals`` tries to execute a +non-Python signal handler. diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 7ac797a3aa3f8..c6564be9c6aab 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1706,10 +1706,34 @@ _PyErr_CheckSignalsTstate(PyThreadState *tstate) } _Py_atomic_store_relaxed(&Handlers[i].tripped, 0); + /* Signal handlers can be modified while a signal is received, + * and therefore the fact that trip_signal() or PyErr_SetInterrupt() + * was called doesn't guarantee that there is still a Python + * signal handler for it by the time PyErr_CheckSignals() is called + * (see bpo-43406). + */ + PyObject *func = Handlers[i].func; + if (func == NULL || func == Py_None || func == IgnoreHandler || + func == DefaultHandler) { + /* No Python signal handler due to aforementioned race condition. + * We can't call raise() as it would break the assumption + * that PyErr_SetInterrupt() only *simulates* an incoming + * signal (i.e. it will never kill the process). + * We also don't want to interrupt user code with a cryptic + * asynchronous exception, so instead just write out an + * unraisable error. + */ + PyErr_Format(PyExc_OSError, + "Signal %i ignored due to race condition", + i); + PyErr_WriteUnraisable(Py_None); + continue; + } + PyObject *arglist = Py_BuildValue("(iO)", i, frame); PyObject *result; if (arglist) { - result = _PyObject_Call(tstate, Handlers[i].func, arglist, NULL); + result = _PyObject_Call(tstate, func, arglist, NULL); Py_DECREF(arglist); } else { From webhook-mailer at python.org Fri Mar 5 09:46:22 2021 From: webhook-mailer at python.org (markshannon) Date: Fri, 05 Mar 2021 14:46:22 -0000 Subject: [Python-checkins] Make tracing info (bounds, and previous instruction offset) a bit more robust. (GH-24726) Message-ID: https://github.com/python/cpython/commit/8e1b40627551909687db8914971b0faf6cf7a079 commit: 8e1b40627551909687db8914971b0faf6cf7a079 branch: master author: Mark Shannon committer: markshannon date: 2021-03-05T14:45:50Z summary: Make tracing info (bounds, and previous instruction offset) a bit more robust. (GH-24726) files: M Python/ceval.c diff --git a/Python/ceval.c b/Python/ceval.c index abdea1de09b43..7418b15176d2a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -34,6 +34,13 @@ #include +typedef struct { + PyCodeObject *code; // The code object for the bounds. May be NULL. + int instr_prev; // Only valid if code != NULL. + PyCodeAddressRange bounds; // Only valid if code != NULL. +} PyTraceInfo; + + #ifdef Py_DEBUG /* For debugging the interpreter: */ #define LLTRACE 1 /* Low-level trace feature */ @@ -48,10 +55,10 @@ _Py_IDENTIFIER(__name__); /* Forward declarations */ Py_LOCAL_INLINE(PyObject *) call_function( - PyThreadState *tstate, PyCodeAddressRange *, PyObject ***pp_stack, + PyThreadState *tstate, PyTraceInfo *, PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames); static PyObject * do_call_core( - PyThreadState *tstate, PyCodeAddressRange *, PyObject *func, + PyThreadState *tstate, PyTraceInfo *, PyObject *func, PyObject *callargs, PyObject *kwdict); #ifdef LLTRACE @@ -60,19 +67,19 @@ static int prtrace(PyThreadState *, PyObject *, const char *); #endif static int call_trace(Py_tracefunc, PyObject *, PyThreadState *, PyFrameObject *, - PyCodeAddressRange *, + PyTraceInfo *, int, PyObject *); static int call_trace_protected(Py_tracefunc, PyObject *, PyThreadState *, PyFrameObject *, - PyCodeAddressRange *, + PyTraceInfo *, int, PyObject *); static void call_exc_trace(Py_tracefunc, PyObject *, PyThreadState *, PyFrameObject *, - PyCodeAddressRange *); + PyTraceInfo *trace_info); static int maybe_call_line_trace(Py_tracefunc, PyObject *, PyThreadState *, PyFrameObject *, - PyCodeAddressRange *, int *); -static void maybe_dtrace_line(PyFrameObject *, PyCodeAddressRange *, int *); + PyTraceInfo *); +static void maybe_dtrace_line(PyFrameObject *, PyTraceInfo *); static void dtrace_function_entry(PyFrameObject *); static void dtrace_function_return(PyFrameObject *); @@ -1617,15 +1624,17 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) /* Start of code */ - /* push frame */ if (_Py_EnterRecursiveCall(tstate, "")) { return NULL; } + PyTraceInfo trace_info; + /* Mark trace_info as initialized */ + trace_info.code = NULL; + + /* push frame */ tstate->frame = f; co = f->f_code; - PyCodeAddressRange bounds; - _PyCode_InitAddressRange(co, &bounds); if (tstate->use_tracing) { if (tstate->c_tracefunc != NULL) { @@ -1644,7 +1653,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) whenever an exception is detected. */ if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, - tstate, f, &bounds, + tstate, f, &trace_info, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ goto exit_eval_frame; @@ -1655,7 +1664,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) return itself and isn't called for "line" events */ if (call_trace_protected(tstate->c_profilefunc, tstate->c_profileobj, - tstate, f, &bounds, + tstate, f, &trace_info, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ goto exit_eval_frame; @@ -1666,8 +1675,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (PyDTrace_FUNCTION_ENTRY_ENABLED()) dtrace_function_entry(f); - int instr_prev = -1; - names = co->co_names; consts = co->co_consts; fastlocals = f->f_localsplus; @@ -1792,7 +1799,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) f->f_lasti = INSTR_OFFSET(); if (PyDTrace_LINE_ENABLED()) - maybe_dtrace_line(f, &bounds, &instr_prev); + maybe_dtrace_line(f, &trace_info); /* line-by-line tracing support */ @@ -1806,7 +1813,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) err = maybe_call_line_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f, - &bounds, &instr_prev); + &trace_info); /* Reload possibly changed frame fields */ JUMPTO(f->f_lasti); stack_pointer = f->f_valuestack+f->f_stackdepth; @@ -2593,7 +2600,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (retval == NULL) { if (tstate->c_tracefunc != NULL && _PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) - call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f, &bounds); + call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f, &trace_info); if (_PyGen_FetchStopIterationValue(&retval) == 0) { gen_status = PYGEN_RETURN; } @@ -4061,7 +4068,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) goto error; } else if (tstate->c_tracefunc != NULL) { - call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f, &bounds); + call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f, &trace_info); } _PyErr_Clear(tstate); } @@ -4229,7 +4236,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) `callable` will be POPed by call_function. NULL will will be POPed manually later. */ - res = call_function(tstate, &bounds, &sp, oparg, NULL); + res = call_function(tstate, &trace_info, &sp, oparg, NULL); stack_pointer = sp; (void)POP(); /* POP the NULL. */ } @@ -4246,7 +4253,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) We'll be passing `oparg + 1` to call_function, to make it accept the `self` as a first argument. */ - res = call_function(tstate, &bounds, &sp, oparg + 1, NULL); + res = call_function(tstate, &trace_info, &sp, oparg + 1, NULL); stack_pointer = sp; } @@ -4260,7 +4267,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PREDICTED(CALL_FUNCTION); PyObject **sp, *res; sp = stack_pointer; - res = call_function(tstate, &bounds, &sp, oparg, NULL); + res = call_function(tstate, &trace_info, &sp, oparg, NULL); stack_pointer = sp; PUSH(res); if (res == NULL) { @@ -4277,7 +4284,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) assert(PyTuple_GET_SIZE(names) <= oparg); /* We assume without checking that names contains only strings */ sp = stack_pointer; - res = call_function(tstate, &bounds, &sp, oparg, names); + res = call_function(tstate, &trace_info, &sp, oparg, names); stack_pointer = sp; PUSH(res); Py_DECREF(names); @@ -4322,7 +4329,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } assert(PyTuple_CheckExact(callargs)); - result = do_call_core(tstate, &bounds, func, callargs, kwargs); + result = do_call_core(tstate, &trace_info, func, callargs, kwargs); Py_DECREF(func); Py_DECREF(callargs); Py_XDECREF(kwargs); @@ -4489,7 +4496,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) assert(f->f_state == FRAME_EXECUTING); f->f_state = FRAME_UNWINDING; call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, - tstate, f, &bounds); + tstate, f, &trace_info); } exception_unwind: f->f_state = FRAME_UNWINDING; @@ -4541,7 +4548,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PUSH(exc); JUMPTO(handler); if (_Py_TracingPossible(ceval2)) { - instr_prev = INT_MAX; + trace_info.instr_prev = INT_MAX; } /* Resume normal execution */ f->f_state = FRAME_EXECUTING; @@ -4567,13 +4574,13 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (tstate->use_tracing) { if (tstate->c_tracefunc) { if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, - tstate, f, &bounds, PyTrace_RETURN, retval)) { + tstate, f, &trace_info, PyTrace_RETURN, retval)) { Py_CLEAR(retval); } } if (tstate->c_profilefunc) { if (call_trace_protected(tstate->c_profilefunc, tstate->c_profileobj, - tstate, f, &bounds, PyTrace_RETURN, retval)) { + tstate, f, &trace_info, PyTrace_RETURN, retval)) { Py_CLEAR(retval); } } @@ -5436,7 +5443,7 @@ static void call_exc_trace(Py_tracefunc func, PyObject *self, PyThreadState *tstate, PyFrameObject *f, - PyCodeAddressRange *bounds) + PyTraceInfo *trace_info) { PyObject *type, *value, *traceback, *orig_traceback, *arg; int err; @@ -5452,7 +5459,7 @@ call_exc_trace(Py_tracefunc func, PyObject *self, _PyErr_Restore(tstate, type, value, orig_traceback); return; } - err = call_trace(func, self, tstate, f, bounds, PyTrace_EXCEPTION, arg); + err = call_trace(func, self, tstate, f, trace_info, PyTrace_EXCEPTION, arg); Py_DECREF(arg); if (err == 0) { _PyErr_Restore(tstate, type, value, orig_traceback); @@ -5467,13 +5474,13 @@ call_exc_trace(Py_tracefunc func, PyObject *self, static int call_trace_protected(Py_tracefunc func, PyObject *obj, PyThreadState *tstate, PyFrameObject *frame, - PyCodeAddressRange *bounds, + PyTraceInfo *trace_info, int what, PyObject *arg) { PyObject *type, *value, *traceback; int err; _PyErr_Fetch(tstate, &type, &value, &traceback); - err = call_trace(func, obj, tstate, frame, bounds, what, arg); + err = call_trace(func, obj, tstate, frame, trace_info, what, arg); if (err == 0) { _PyErr_Restore(tstate, type, value, traceback); @@ -5487,10 +5494,20 @@ call_trace_protected(Py_tracefunc func, PyObject *obj, } } +static void +initialize_trace_info(PyTraceInfo *trace_info, PyFrameObject *frame) +{ + if (trace_info->code != frame->f_code) { + trace_info->code = frame->f_code; + trace_info->instr_prev = -1; + _PyCode_InitAddressRange(frame->f_code, &trace_info->bounds); + } +} + static int call_trace(Py_tracefunc func, PyObject *obj, PyThreadState *tstate, PyFrameObject *frame, - PyCodeAddressRange *bounds, + PyTraceInfo *trace_info, int what, PyObject *arg) { int result; @@ -5502,7 +5519,8 @@ call_trace(Py_tracefunc func, PyObject *obj, frame->f_lineno = frame->f_code->co_firstlineno; } else { - frame->f_lineno = _PyCode_CheckLineNumber(frame->f_lasti, bounds); + initialize_trace_info(trace_info, frame); + frame->f_lineno = _PyCode_CheckLineNumber(frame->f_lasti, &trace_info->bounds); } result = func(obj, frame, what, arg); frame->f_lineno = 0; @@ -5533,7 +5551,7 @@ _PyEval_CallTracing(PyObject *func, PyObject *args) static int maybe_call_line_trace(Py_tracefunc func, PyObject *obj, PyThreadState *tstate, PyFrameObject *frame, - PyCodeAddressRange *bounds, int *instr_prev) + PyTraceInfo *trace_info) { int result = 0; @@ -5541,21 +5559,22 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj, represents a jump backwards, update the frame's line number and then call the trace function if we're tracing source lines. */ - int lastline = bounds->ar_line; - int line = _PyCode_CheckLineNumber(frame->f_lasti, bounds); + initialize_trace_info(trace_info, frame); + int lastline = trace_info->bounds.ar_line; + int line = _PyCode_CheckLineNumber(frame->f_lasti, &trace_info->bounds); if (line != -1 && frame->f_trace_lines) { /* Trace backward edges or first instruction of a new line */ - if (frame->f_lasti < *instr_prev || - (line != lastline && frame->f_lasti == bounds->ar_start)) + if (frame->f_lasti < trace_info->instr_prev || + (line != lastline && frame->f_lasti == trace_info->bounds.ar_start)) { - result = call_trace(func, obj, tstate, frame, bounds, PyTrace_LINE, Py_None); + result = call_trace(func, obj, tstate, frame, trace_info, PyTrace_LINE, Py_None); } } /* Always emit an opcode event if we're tracing all opcodes. */ if (frame->f_trace_opcodes) { - result = call_trace(func, obj, tstate, frame, bounds, PyTrace_OPCODE, Py_None); + result = call_trace(func, obj, tstate, frame, trace_info, PyTrace_OPCODE, Py_None); } - *instr_prev = frame->f_lasti; + trace_info->instr_prev = frame->f_lasti; return result; } @@ -5826,7 +5845,7 @@ PyEval_GetFuncDesc(PyObject *func) #define C_TRACE(x, call) \ if (tstate->use_tracing && tstate->c_profilefunc) { \ if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, \ - tstate, tstate->frame, bounds, \ + tstate, tstate->frame, trace_info, \ PyTrace_C_CALL, func)) { \ x = NULL; \ } \ @@ -5836,13 +5855,13 @@ if (tstate->use_tracing && tstate->c_profilefunc) { \ if (x == NULL) { \ call_trace_protected(tstate->c_profilefunc, \ tstate->c_profileobj, \ - tstate, tstate->frame, bounds, \ + tstate, tstate->frame, trace_info, \ PyTrace_C_EXCEPTION, func); \ /* XXX should pass (type, value, tb) */ \ } else { \ if (call_trace(tstate->c_profilefunc, \ tstate->c_profileobj, \ - tstate, tstate->frame, bounds, \ + tstate, tstate->frame, trace_info, \ PyTrace_C_RETURN, func)) { \ Py_DECREF(x); \ x = NULL; \ @@ -5857,7 +5876,7 @@ if (tstate->use_tracing && tstate->c_profilefunc) { \ static PyObject * trace_call_function(PyThreadState *tstate, - PyCodeAddressRange *bounds, + PyTraceInfo *trace_info, PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) @@ -5893,7 +5912,7 @@ trace_call_function(PyThreadState *tstate, to reduce the stack consumption. */ Py_LOCAL_INLINE(PyObject *) _Py_HOT_FUNCTION call_function(PyThreadState *tstate, - PyCodeAddressRange *bounds, + PyTraceInfo *trace_info, PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames) @@ -5906,7 +5925,7 @@ call_function(PyThreadState *tstate, PyObject **stack = (*pp_stack) - nargs - nkwargs; if (tstate->use_tracing) { - x = trace_call_function(tstate, bounds, func, stack, nargs, kwnames); + x = trace_call_function(tstate, trace_info, func, stack, nargs, kwnames); } else { x = PyObject_Vectorcall(func, stack, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames); @@ -5925,7 +5944,7 @@ call_function(PyThreadState *tstate, static PyObject * do_call_core(PyThreadState *tstate, - PyCodeAddressRange *bounds, + PyTraceInfo *trace_info, PyObject *func, PyObject *callargs, PyObject *kwdict) @@ -6488,18 +6507,19 @@ dtrace_function_return(PyFrameObject *f) /* DTrace equivalent of maybe_call_line_trace. */ static void maybe_dtrace_line(PyFrameObject *frame, - PyCodeAddressRange *bounds, int *instr_prev) + PyTraceInfo *trace_info) { const char *co_filename, *co_name; /* If the last instruction executed isn't in the current instruction window, reset the window. */ - int line = _PyCode_CheckLineNumber(frame->f_lasti, bounds); + initialize_trace_info(trace_info, frame); + int line = _PyCode_CheckLineNumber(frame->f_lasti, &trace_info->bounds); /* If the last instruction falls at the start of a line or if it represents a jump backwards, update the frame's line number and call the trace function. */ - if (line != frame->f_lineno || frame->f_lasti < *instr_prev) { + if (line != frame->f_lineno || frame->f_lasti < trace_info->instr_prev) { if (line != -1) { frame->f_lineno = line; co_filename = PyUnicode_AsUTF8(frame->f_code->co_filename); @@ -6511,7 +6531,7 @@ maybe_dtrace_line(PyFrameObject *frame, PyDTrace_LINE(co_filename, co_name, line); } } - *instr_prev = frame->f_lasti; + trace_info->instr_prev = frame->f_lasti; } From webhook-mailer at python.org Fri Mar 5 20:22:34 2021 From: webhook-mailer at python.org (terryjreedy) Date: Sat, 06 Mar 2021 01:22:34 -0000 Subject: [Python-checkins] bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757) Message-ID: https://github.com/python/cpython/commit/ff5f05934db241dfafc604989b2de3487b09ca82 commit: ff5f05934db241dfafc604989b2de3487b09ca82 branch: master author: Alex Willmer committer: terryjreedy date: 2021-03-05T20:22:13-05:00 summary: bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757) Previous wording implied that only the result of call N and N+1 could be meaningfully compared, whereas comparing call N and N+M is fine. files: A Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst M Doc/library/time.rst diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 143f84b565f5e..cfd67e87501cd 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -277,7 +277,7 @@ Functions Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the - difference between the results of consecutive calls is valid. + difference between the results of two calls is valid. Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:`float` type. @@ -306,7 +306,7 @@ Functions clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so that only the difference between - the results of consecutive calls is valid. + the results of two calls is valid. Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:`float` type. @@ -334,7 +334,7 @@ Functions CPU time of the current process. It does not include time elapsed during sleep. It is process-wide by definition. The reference point of the returned value is undefined, so that only the difference between the results - of consecutive calls is valid. + of two calls is valid. Use :func:`process_time_ns` to avoid the precision loss caused by the :class:`float` type. @@ -626,7 +626,7 @@ Functions CPU time of the current thread. It does not include time elapsed during sleep. It is thread-specific by definition. The reference point of the returned value is undefined, so that only the difference between the results - of consecutive calls in the same thread is valid. + of two calls in the same thread is valid. Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:`float` type. diff --git a/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst new file mode 100644 index 0000000000000..615e3d016307c --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst @@ -0,0 +1,4 @@ +Clarified that a result from :func:`time.monotonic`, +:func:`time.perf_counter`, :func:`time.process_time`, or +:func:`time.thread_time` can be compared with the result from any following +call to the same function - not just the next immediate call. From webhook-mailer at python.org Fri Mar 5 20:34:35 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 06 Mar 2021 01:34:35 -0000 Subject: [Python-checkins] bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757) Message-ID: https://github.com/python/cpython/commit/e12a9e2f62bea8ddc755e373f17adfbb2740b0b1 commit: e12a9e2f62bea8ddc755e373f17adfbb2740b0b1 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-05T17:34:27-08:00 summary: bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757) Previous wording implied that only the result of call N and N+1 could be meaningfully compared, whereas comparing call N and N+M is fine. (cherry picked from commit ff5f05934db241dfafc604989b2de3487b09ca82) Co-authored-by: Alex Willmer files: A Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst M Doc/library/time.rst diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 6842e9075e1a6..e8bb9ccb8e77c 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -271,7 +271,7 @@ Functions Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the - difference between the results of consecutive calls is valid. + difference between the results of two calls is valid. .. versionadded:: 3.3 .. versionchanged:: 3.5 @@ -293,7 +293,7 @@ Functions clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so that only the difference between - the results of consecutive calls is valid. + the results of two calls is valid. .. versionadded:: 3.3 @@ -315,7 +315,7 @@ Functions CPU time of the current process. It does not include time elapsed during sleep. It is process-wide by definition. The reference point of the returned value is undefined, so that only the difference between the results - of consecutive calls is valid. + of two calls is valid. .. versionadded:: 3.3 @@ -593,7 +593,7 @@ Functions CPU time of the current thread. It does not include time elapsed during sleep. It is thread-specific by definition. The reference point of the returned value is undefined, so that only the difference between the results - of consecutive calls in the same thread is valid. + of two calls in the same thread is valid. .. availability:: Windows, Linux, Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``. diff --git a/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst new file mode 100644 index 0000000000000..615e3d016307c --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst @@ -0,0 +1,4 @@ +Clarified that a result from :func:`time.monotonic`, +:func:`time.perf_counter`, :func:`time.process_time`, or +:func:`time.thread_time` can be compared with the result from any following +call to the same function - not just the next immediate call. From webhook-mailer at python.org Fri Mar 5 20:48:42 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 06 Mar 2021 01:48:42 -0000 Subject: [Python-checkins] bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757) Message-ID: https://github.com/python/cpython/commit/65f3a0d20c8198443c5c6cb44410114fe8c4bf4e commit: 65f3a0d20c8198443c5c6cb44410114fe8c4bf4e branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-05T17:48:33-08:00 summary: bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757) Previous wording implied that only the result of call N and N+1 could be meaningfully compared, whereas comparing call N and N+M is fine. (cherry picked from commit ff5f05934db241dfafc604989b2de3487b09ca82) Co-authored-by: Alex Willmer files: A Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst M Doc/library/time.rst diff --git a/Doc/library/time.rst b/Doc/library/time.rst index cff6320b526db..11aba5dd842c5 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -271,7 +271,7 @@ Functions Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the - difference between the results of consecutive calls is valid. + difference between the results of two calls is valid. .. versionadded:: 3.3 .. versionchanged:: 3.5 @@ -293,7 +293,7 @@ Functions clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so that only the difference between - the results of consecutive calls is valid. + the results of two calls is valid. .. versionadded:: 3.3 @@ -315,7 +315,7 @@ Functions CPU time of the current process. It does not include time elapsed during sleep. It is process-wide by definition. The reference point of the returned value is undefined, so that only the difference between the results - of consecutive calls is valid. + of two calls is valid. .. versionadded:: 3.3 @@ -593,7 +593,7 @@ Functions CPU time of the current thread. It does not include time elapsed during sleep. It is thread-specific by definition. The reference point of the returned value is undefined, so that only the difference between the results - of consecutive calls in the same thread is valid. + of two calls in the same thread is valid. .. availability:: Windows, Linux, Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``. diff --git a/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst new file mode 100644 index 0000000000000..615e3d016307c --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst @@ -0,0 +1,4 @@ +Clarified that a result from :func:`time.monotonic`, +:func:`time.perf_counter`, :func:`time.process_time`, or +:func:`time.thread_time` can be compared with the result from any following +call to the same function - not just the next immediate call. From webhook-mailer at python.org Sat Mar 6 10:07:54 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 06 Mar 2021 15:07:54 -0000 Subject: [Python-checkins] [3.9] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) (GH-24761) Message-ID: https://github.com/python/cpython/commit/1385f8355a036fd65aaf9c7e7ab48467ca922bcf commit: 1385f8355a036fd65aaf9c7e7ab48467ca922bcf branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-06T07:07:46-08:00 summary: [3.9] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) (GH-24761) We can receive signals (at the C level, in `trip_signal()` in signalmodule.c) while `signal.signal` is being called to modify the corresponding handler. Later when `PyErr_CheckSignals()` is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception. (cherry picked from commit 68245b7a1030287294c65c298975ab9026543fd2) Co-authored-by: Antoine Pitrou files: A Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst M Lib/test/test_signal.py M Modules/signalmodule.c diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 45553a6a42de7..b69daa7f02306 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -6,6 +6,7 @@ import statistics import subprocess import sys +import threading import time import unittest from test import support @@ -1243,6 +1244,55 @@ def handler(signum, frame): # Python handler self.assertEqual(len(sigs), N, "Some signals were lost") + @unittest.skipUnless(hasattr(signal, "SIGUSR1"), + "test needs SIGUSR1") + def test_stress_modifying_handlers(self): + # bpo-43406: race condition between trip_signal() and signal.signal + signum = signal.SIGUSR1 + num_sent_signals = 0 + num_received_signals = 0 + do_stop = False + + def custom_handler(signum, frame): + nonlocal num_received_signals + num_received_signals += 1 + + def set_interrupts(): + nonlocal num_sent_signals + while not do_stop: + signal.raise_signal(signum) + num_sent_signals += 1 + + def cycle_handlers(): + while num_sent_signals < 100: + for i in range(20000): + # Cycle between a Python-defined and a non-Python handler + for handler in [custom_handler, signal.SIG_IGN]: + signal.signal(signum, handler) + + old_handler = signal.signal(signum, custom_handler) + self.addCleanup(signal.signal, signum, old_handler) + t = threading.Thread(target=set_interrupts) + t.start() + try: + with support.catch_unraisable_exception() as cm: + cycle_handlers() + if cm.unraisable is not None: + # An unraisable exception may be printed out when + # a signal is ignored due to the aforementioned + # race condition, check it. + self.assertIsInstance(cm.unraisable.exc_value, OSError) + self.assertIn( + f"Signal {signum} ignored due to race condition", + str(cm.unraisable.exc_value)) + # Sanity check that some signals were received, but not all + self.assertGreater(num_received_signals, 0) + self.assertLess(num_received_signals, num_sent_signals) + finally: + do_stop = True + t.join() + + class RaiseSignalTest(unittest.TestCase): def test_sigint(self): diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst new file mode 100644 index 0000000000000..c18a55ef32306 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst @@ -0,0 +1,2 @@ +Fix a possible race condition where ``PyErr_CheckSignals`` tries to execute a +non-Python signal handler. diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 540e2d9044804..de564c2db8353 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1714,10 +1714,34 @@ _PyErr_CheckSignalsTstate(PyThreadState *tstate) } _Py_atomic_store_relaxed(&Handlers[i].tripped, 0); + /* Signal handlers can be modified while a signal is received, + * and therefore the fact that trip_signal() or PyErr_SetInterrupt() + * was called doesn't guarantee that there is still a Python + * signal handler for it by the time PyErr_CheckSignals() is called + * (see bpo-43406). + */ + PyObject *func = Handlers[i].func; + if (func == NULL || func == Py_None || func == IgnoreHandler || + func == DefaultHandler) { + /* No Python signal handler due to aforementioned race condition. + * We can't call raise() as it would break the assumption + * that PyErr_SetInterrupt() only *simulates* an incoming + * signal (i.e. it will never kill the process). + * We also don't want to interrupt user code with a cryptic + * asynchronous exception, so instead just write out an + * unraisable error. + */ + PyErr_Format(PyExc_OSError, + "Signal %i ignored due to race condition", + i); + PyErr_WriteUnraisable(Py_None); + continue; + } + PyObject *arglist = Py_BuildValue("(iO)", i, frame); PyObject *result; if (arglist) { - result = _PyObject_Call(tstate, Handlers[i].func, arglist, NULL); + result = _PyObject_Call(tstate, func, arglist, NULL); Py_DECREF(arglist); } else { From webhook-mailer at python.org Sat Mar 6 10:08:05 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 06 Mar 2021 15:08:05 -0000 Subject: [Python-checkins] [3.8] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) (GH-24762) Message-ID: https://github.com/python/cpython/commit/4715be8a4384159e47fb09e5f3bd077734842655 commit: 4715be8a4384159e47fb09e5f3bd077734842655 branch: 3.8 author: Antoine Pitrou committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-06T07:08:01-08:00 summary: [3.8] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) (GH-24762) We can receive signals (at the C level, in `trip_signal()` in signalmodule.c) while `signal.signal` is being called to modify the corresponding handler. Later when `PyErr_CheckSignals()` is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception.. (cherry picked from commit 68245b7a1030287294c65c298975ab9026543fd2) Co-authored-by: Antoine Pitrou files: A Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst M Lib/test/test_signal.py M Modules/signalmodule.c diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index d41e94b07f430..865e0102637c2 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -6,6 +6,7 @@ import statistics import subprocess import sys +import threading import time import unittest from test import support @@ -1243,6 +1244,55 @@ def handler(signum, frame): # Python handler self.assertEqual(len(sigs), N, "Some signals were lost") + @unittest.skipUnless(hasattr(signal, "SIGUSR1"), + "test needs SIGUSR1") + def test_stress_modifying_handlers(self): + # bpo-43406: race condition between trip_signal() and signal.signal + signum = signal.SIGUSR1 + num_sent_signals = 0 + num_received_signals = 0 + do_stop = False + + def custom_handler(signum, frame): + nonlocal num_received_signals + num_received_signals += 1 + + def set_interrupts(): + nonlocal num_sent_signals + while not do_stop: + signal.raise_signal(signum) + num_sent_signals += 1 + + def cycle_handlers(): + while num_sent_signals < 100: + for i in range(20000): + # Cycle between a Python-defined and a non-Python handler + for handler in [custom_handler, signal.SIG_IGN]: + signal.signal(signum, handler) + + old_handler = signal.signal(signum, custom_handler) + self.addCleanup(signal.signal, signum, old_handler) + t = threading.Thread(target=set_interrupts) + t.start() + try: + with support.catch_unraisable_exception() as cm: + cycle_handlers() + if cm.unraisable is not None: + # An unraisable exception may be printed out when + # a signal is ignored due to the aforementioned + # race condition, check it. + self.assertIsInstance(cm.unraisable.exc_value, OSError) + self.assertIn( + f"Signal {signum} ignored due to race condition", + str(cm.unraisable.exc_value)) + # Sanity check that some signals were received, but not all + self.assertGreater(num_received_signals, 0) + self.assertLess(num_received_signals, num_sent_signals) + finally: + do_stop = True + t.join() + + class RaiseSignalTest(unittest.TestCase): def test_sigint(self): diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst new file mode 100644 index 0000000000000..c18a55ef32306 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst @@ -0,0 +1,2 @@ +Fix a possible race condition where ``PyErr_CheckSignals`` tries to execute a +non-Python signal handler. diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index c63ede97b5ab9..4b855d6f3078d 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1675,23 +1675,47 @@ _PyErr_CheckSignals(void) f = Py_None; for (i = 1; i < NSIG; i++) { - if (_Py_atomic_load_relaxed(&Handlers[i].tripped)) { - PyObject *result = NULL; - PyObject *arglist = Py_BuildValue("(iO)", i, f); - _Py_atomic_store_relaxed(&Handlers[i].tripped, 0); - - if (arglist) { - result = PyEval_CallObject(Handlers[i].func, - arglist); - Py_DECREF(arglist); - } - if (!result) { - _Py_atomic_store(&is_tripped, 1); - return -1; - } + if (!_Py_atomic_load_relaxed(&Handlers[i].tripped)) { + continue; + } + _Py_atomic_store_relaxed(&Handlers[i].tripped, 0); - Py_DECREF(result); + /* Signal handlers can be modified while a signal is received, + * and therefore the fact that trip_signal() or PyErr_SetInterrupt() + * was called doesn't guarantee that there is still a Python + * signal handler for it by the time PyErr_CheckSignals() is called + * (see bpo-43406). + */ + PyObject *func = Handlers[i].func; + if (func == NULL || func == Py_None || func == IgnoreHandler || + func == DefaultHandler) { + /* No Python signal handler due to aforementioned race condition. + * We can't call raise() as it would break the assumption + * that PyErr_SetInterrupt() only *simulates* an incoming + * signal (i.e. it will never kill the process). + * We also don't want to interrupt user code with a cryptic + * asynchronous exception, so instead just write out an + * unraisable error. + */ + PyErr_Format(PyExc_OSError, + "Signal %i ignored due to race condition", + i); + PyErr_WriteUnraisable(Py_None); + continue; + } + + PyObject *result = NULL; + PyObject *arglist = Py_BuildValue("(iO)", i, f); + if (arglist) { + result = PyEval_CallObject(func, arglist); + Py_DECREF(arglist); } + if (!result) { + /* On error, re-schedule a call to PyErr_CheckSignals() */ + _Py_atomic_store(&is_tripped, 1); + return -1; + } + Py_DECREF(result); } return 0; From webhook-mailer at python.org Sat Mar 6 11:26:01 2021 From: webhook-mailer at python.org (brettcannon) Date: Sat, 06 Mar 2021 16:26:01 -0000 Subject: [Python-checkins] Put contextvars docs into the concurrency category (GH-24760) Message-ID: https://github.com/python/cpython/commit/5eb7796b7f3aae91b145ccea51b528662f3b5ce1 commit: 5eb7796b7f3aae91b145ccea51b528662f3b5ce1 branch: master author: Brett Cannon committer: brettcannon date: 2021-03-06T08:25:54-08:00 summary: Put contextvars docs into the concurrency category (GH-24760) files: M Doc/library/concurrency.rst M Doc/library/index.rst diff --git a/Doc/library/concurrency.rst b/Doc/library/concurrency.rst index b150990b83b75..5be1a1106b09a 100644 --- a/Doc/library/concurrency.rst +++ b/Doc/library/concurrency.rst @@ -21,6 +21,7 @@ multitasking). Here's an overview: subprocess.rst sched.rst queue.rst + contextvars.rst The following are support modules for some of the above services: diff --git a/Doc/library/index.rst b/Doc/library/index.rst index 42f994f8b87d1..1a9e52ec5ccfb 100644 --- a/Doc/library/index.rst +++ b/Doc/library/index.rst @@ -56,7 +56,6 @@ the `Python Package Index `_. crypto.rst allos.rst concurrency.rst - contextvars.rst ipc.rst netdata.rst markup.rst From webhook-mailer at python.org Sat Mar 6 11:42:30 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 06 Mar 2021 16:42:30 -0000 Subject: [Python-checkins] Put contextvars docs into the concurrency category (GH-24760) Message-ID: https://github.com/python/cpython/commit/0ecfe5fca44ee4b3a4a8763e8e972b13850dd135 commit: 0ecfe5fca44ee4b3a4a8763e8e972b13850dd135 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-06T08:42:20-08:00 summary: Put contextvars docs into the concurrency category (GH-24760) (cherry picked from commit 5eb7796b7f3aae91b145ccea51b528662f3b5ce1) Co-authored-by: Brett Cannon files: M Doc/library/concurrency.rst M Doc/library/index.rst diff --git a/Doc/library/concurrency.rst b/Doc/library/concurrency.rst index 39cd9ff482659..9813e9344f93a 100644 --- a/Doc/library/concurrency.rst +++ b/Doc/library/concurrency.rst @@ -21,6 +21,7 @@ multitasking). Here's an overview: subprocess.rst sched.rst queue.rst + contextvars.rst The following are support modules for some of the above services: diff --git a/Doc/library/index.rst b/Doc/library/index.rst index bebf7429b0e63..2cddb417da82e 100644 --- a/Doc/library/index.rst +++ b/Doc/library/index.rst @@ -56,7 +56,6 @@ the `Python Package Index `_. crypto.rst allos.rst concurrency.rst - contextvars.rst ipc.rst netdata.rst markup.rst From webhook-mailer at python.org Sat Mar 6 11:48:32 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 06 Mar 2021 16:48:32 -0000 Subject: [Python-checkins] Put contextvars docs into the concurrency category (GH-24760) Message-ID: https://github.com/python/cpython/commit/2c0a0b04a42dc4965fcfaef936f497e44f06dea5 commit: 2c0a0b04a42dc4965fcfaef936f497e44f06dea5 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-06T08:48:12-08:00 summary: Put contextvars docs into the concurrency category (GH-24760) (cherry picked from commit 5eb7796b7f3aae91b145ccea51b528662f3b5ce1) Co-authored-by: Brett Cannon files: M Doc/library/concurrency.rst M Doc/library/index.rst diff --git a/Doc/library/concurrency.rst b/Doc/library/concurrency.rst index b150990b83b75..5be1a1106b09a 100644 --- a/Doc/library/concurrency.rst +++ b/Doc/library/concurrency.rst @@ -21,6 +21,7 @@ multitasking). Here's an overview: subprocess.rst sched.rst queue.rst + contextvars.rst The following are support modules for some of the above services: diff --git a/Doc/library/index.rst b/Doc/library/index.rst index bebf7429b0e63..2cddb417da82e 100644 --- a/Doc/library/index.rst +++ b/Doc/library/index.rst @@ -56,7 +56,6 @@ the `Python Package Index `_. crypto.rst allos.rst concurrency.rst - contextvars.rst ipc.rst netdata.rst markup.rst From webhook-mailer at python.org Sat Mar 6 16:34:08 2021 From: webhook-mailer at python.org (nascheme) Date: Sat, 06 Mar 2021 21:34:08 -0000 Subject: [Python-checkins] bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759) Message-ID: https://github.com/python/cpython/commit/87ec26b812e9c4095c017dc60f246eda37b83ab2 commit: 87ec26b812e9c4095c017dc60f246eda37b83ab2 branch: master author: Neil Schemenauer committer: nascheme date: 2021-03-06T13:34:03-08:00 summary: bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759) This approach ensures the code matches the interpreter version. Previously, PYTHON_FOR_REGEN was used to generate the code, which might be wrong. The marshal format for code objects has changed with bpo-42246, commit 877df851. Update the code and the expected code sizes in ctypes test_frozentable. files: A Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst M Lib/ctypes/test/test_values.py M Makefile.pre.in M Python/frozen.c M Python/frozen_hello.h diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py index 44128298390d9..b38b63f870a65 100644 --- a/Lib/ctypes/test/test_values.py +++ b/Lib/ctypes/test/test_values.py @@ -80,9 +80,9 @@ class struct_frozen(Structure): continue items.append((entry.name.decode("ascii"), entry.size)) - expected = [("__hello__", 125), - ("__phello__", -125), - ("__phello__.spam", 125), + expected = [("__hello__", 139), + ("__phello__", -139), + ("__phello__.spam", 139), ] self.assertEqual(items, expected, "PyImport_FrozenModules example " "in Doc/library/ctypes.rst may be out of date") diff --git a/Makefile.pre.in b/Makefile.pre.in index 0f59700952989..5d230ecb3d1f0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -871,9 +871,13 @@ regen-opcode: $(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new .PHONY: regen-frozen -regen-frozen: +regen-frozen: Programs/_freeze_importlib # Regenerate code for frozen module "__hello__". - $(PYTHON_FOR_REGEN) $(srcdir)/Tools/freeze/regen_frozen.py $(srcdir)/Python/frozen_hello.h + ./Programs/_freeze_importlib hello \ + $(srcdir)/Tools/freeze/flag.py \ + $(srcdir)/Python/frozen_hello.h.new + $(UPDATE_FILE) $(srcdir)/Python/frozen_hello.h \ + $(srcdir)/Python/frozen_hello.h.new .PHONY: regen-token regen-token: diff --git a/Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst b/Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst new file mode 100644 index 0000000000000..e9c6f2a916492 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst @@ -0,0 +1,5 @@ +Use ``_freeze_importlib`` to generate code for the ``__hello__`` module. +This approach ensures the code matches the interpreter version. Previously, +PYTHON_FOR_REGEN was used to generate the code, which might be wrong. The +marshal format for code objects has changed with bpo-42246, commit 877df851. +Update the code and the expected code sizes in ctypes test_frozentable. diff --git a/Python/frozen.c b/Python/frozen.c index d4104e166401a..7f433ff80ca12 100644 --- a/Python/frozen.c +++ b/Python/frozen.c @@ -11,12 +11,11 @@ some famous words... */ /* Run "make regen-frozen" to regen the file below (e.g. after a bytecode - * format change). The file is created by Tools/frozen/regen_frozen.py. The - * include file defines M___hello__ as an array of bytes. + * format change). The include file defines _Py_M__hello as an array of bytes. */ #include "frozen_hello.h" -#define SIZE (int)sizeof(M___hello__) +#define SIZE (int)sizeof(_Py_M__hello) static const struct _frozen _PyImport_FrozenModules[] = { /* importlib */ @@ -27,10 +26,10 @@ static const struct _frozen _PyImport_FrozenModules[] = { {"zipimport", _Py_M__zipimport, (int)sizeof(_Py_M__zipimport)}, /* Test module */ - {"__hello__", M___hello__, SIZE}, + {"__hello__", _Py_M__hello, SIZE}, /* Test package (negative size indicates package-ness) */ - {"__phello__", M___hello__, -SIZE}, - {"__phello__.spam", M___hello__, SIZE}, + {"__phello__", _Py_M__hello, -SIZE}, + {"__phello__.spam", _Py_M__hello, SIZE}, {0, 0, 0} /* sentinel */ }; diff --git a/Python/frozen_hello.h b/Python/frozen_hello.h index 9c566cc81ebf0..c2101f425b41e 100644 --- a/Python/frozen_hello.h +++ b/Python/frozen_hello.h @@ -1,13 +1,12 @@ -/* Generated with Tools/freeze/regen_frozen.py */ -static unsigned char M___hello__[] = { - 227,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,2,0,0,0,64,0,0,0,115, - 16,0,0,0,100,0,90,0,101,1,100,1,131, - 1,1,0,100,2,83,0,41,3,84,122,12,72, - 101,108,108,111,32,119,111,114,108,100,33,78,41, - 2,90,11,105,110,105,116,105,97,108,105,122,101, - 100,218,5,112,114,105,110,116,169,0,114,2,0, - 0,0,114,2,0,0,0,218,4,110,111,110,101, - 218,8,60,109,111,100,117,108,101,62,1,0,0, - 0,115,2,0,0,0,4,1, +/* Auto-generated by Programs/_freeze_importlib.c */ +const unsigned char _Py_M__hello[] = { + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,64,0,0,0,115,16,0,0,0,100,0, + 90,0,101,1,100,1,131,1,1,0,100,2,83,0,41,3, + 84,122,12,72,101,108,108,111,32,119,111,114,108,100,33,78, + 41,2,90,11,105,110,105,116,105,97,108,105,122,101,100,218, + 5,112,114,105,110,116,169,0,114,1,0,0,0,114,1,0, + 0,0,122,14,60,102,114,111,122,101,110,32,104,101,108,108, + 111,62,218,8,60,109,111,100,117,108,101,62,1,0,0,0, + 115,6,0,0,0,4,0,12,1,255,128, }; From webhook-mailer at python.org Sun Mar 7 01:12:42 2021 From: webhook-mailer at python.org (methane) Date: Sun, 07 Mar 2021 06:12:42 -0000 Subject: [Python-checkins] bpo-43405: Fix DeprecationWarnings in test_unicode (GH-24754) Message-ID: https://github.com/python/cpython/commit/8aabfa8550692a76d8a96e138c48faf5a7b2752c commit: 8aabfa8550692a76d8a96e138c48faf5a7b2752c branch: master author: Zackery Spytz committer: methane date: 2021-03-07T15:12:35+09:00 summary: bpo-43405: Fix DeprecationWarnings in test_unicode (GH-24754) DeprecationWarnings were being raised in the test_encode_decimal() and test_transform_decimal() methods after 91a639a0949. files: M Lib/test/test_unicode.py diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 2626be6281c94..42c77f0f4e868 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -2938,31 +2938,35 @@ def test_copycharacters(self): @support.requires_legacy_unicode_capi def test_encode_decimal(self): from _testcapi import unicode_encodedecimal - self.assertEqual(unicode_encodedecimal('123'), - b'123') - self.assertEqual(unicode_encodedecimal('\u0663.\u0661\u0664'), - b'3.14') - self.assertEqual(unicode_encodedecimal("\N{EM SPACE}3.14\N{EN SPACE}"), - b' 3.14 ') - self.assertRaises(UnicodeEncodeError, - unicode_encodedecimal, "123\u20ac", "strict") - self.assertRaisesRegex( - ValueError, - "^'decimal' codec can't encode character", - unicode_encodedecimal, "123\u20ac", "replace") + with warnings_helper.check_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + self.assertEqual(unicode_encodedecimal('123'), + b'123') + self.assertEqual(unicode_encodedecimal('\u0663.\u0661\u0664'), + b'3.14') + self.assertEqual(unicode_encodedecimal( + "\N{EM SPACE}3.14\N{EN SPACE}"), b' 3.14 ') + self.assertRaises(UnicodeEncodeError, + unicode_encodedecimal, "123\u20ac", "strict") + self.assertRaisesRegex( + ValueError, + "^'decimal' codec can't encode character", + unicode_encodedecimal, "123\u20ac", "replace") @support.cpython_only @support.requires_legacy_unicode_capi def test_transform_decimal(self): from _testcapi import unicode_transformdecimaltoascii as transform_decimal - self.assertEqual(transform_decimal('123'), - '123') - self.assertEqual(transform_decimal('\u0663.\u0661\u0664'), - '3.14') - self.assertEqual(transform_decimal("\N{EM SPACE}3.14\N{EN SPACE}"), - "\N{EM SPACE}3.14\N{EN SPACE}") - self.assertEqual(transform_decimal('123\u20ac'), - '123\u20ac') + with warnings_helper.check_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + self.assertEqual(transform_decimal('123'), + '123') + self.assertEqual(transform_decimal('\u0663.\u0661\u0664'), + '3.14') + self.assertEqual(transform_decimal("\N{EM SPACE}3.14\N{EN SPACE}"), + "\N{EM SPACE}3.14\N{EN SPACE}") + self.assertEqual(transform_decimal('123\u20ac'), + '123\u20ac') @support.cpython_only def test_pep393_utf8_caching_bug(self): From webhook-mailer at python.org Sun Mar 7 04:08:58 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 07 Mar 2021 09:08:58 -0000 Subject: [Python-checkins] bpo-43319: Fixed the tutorial on venv about standard library (GH-24740) Message-ID: https://github.com/python/cpython/commit/8d00462850b32da4649c3403692ed5515e6a96d1 commit: 8d00462850b32da4649c3403692ed5515e6a96d1 branch: master author: cmhzc committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-07T01:08:50-08:00 summary: bpo-43319: Fixed the tutorial on venv about standard library (GH-24740) In the [official tutorial on virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments) > This will create the tutorial-env directory if it doesn?t exist, and also create directories inside it containing a copy of the Python interpreter, **the standard library**, and various supporting files. According to the actual behavior of `venv` and [PEP 405](https://www.python.org/dev/peps/pep-0405/#id15)'s description about virtual environment, no standard library file is included in the virtual environment's directory. Automerge-Triggered-By: GH:vsajip files: M Doc/tutorial/venv.rst diff --git a/Doc/tutorial/venv.rst b/Doc/tutorial/venv.rst index f422146aae8a3..c4ae6b6e9931f 100644 --- a/Doc/tutorial/venv.rst +++ b/Doc/tutorial/venv.rst @@ -48,7 +48,7 @@ place it, and run the :mod:`venv` module as a script with the directory path:: This will create the ``tutorial-env`` directory if it doesn't exist, and also create directories inside it containing a copy of the Python -interpreter, the standard library, and various supporting files. +interpreter and various supporting files. A common directory location for a virtual environment is ``.venv``. This name keeps the directory typically hidden in your shell and thus From webhook-mailer at python.org Mon Mar 8 02:35:28 2021 From: webhook-mailer at python.org (gpshead) Date: Mon, 08 Mar 2021 07:35:28 -0000 Subject: [Python-checkins] bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780) Message-ID: https://github.com/python/cpython/commit/c25910a135c2245accadb324b40dd6453015e056 commit: c25910a135c2245accadb324b40dd6453015e056 branch: master author: Gregory P. Smith committer: gpshead date: 2021-03-07T23:35:13-08:00 summary: bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780) We now buffer the CONNECT request + tunnel HTTP headers into a single send call. This prevents the OS from generating multiple network packets for connection setup when not necessary, improving efficiency. files: A Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst M Lib/http/client.py M Lib/test/test_httplib.py diff --git a/Lib/http/client.py b/Lib/http/client.py index 4eca93ef2685a..b339f20fc957a 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -901,23 +901,24 @@ def set_debuglevel(self, level): self.debuglevel = level def _tunnel(self): - connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host, - self._tunnel_port) - connect_bytes = connect_str.encode("ascii") - self.send(connect_bytes) + connect = b"CONNECT %s:%d HTTP/1.0\r\n" % ( + self._tunnel_host.encode("ascii"), self._tunnel_port) + headers = [connect] for header, value in self._tunnel_headers.items(): - header_str = "%s: %s\r\n" % (header, value) - header_bytes = header_str.encode("latin-1") - self.send(header_bytes) - self.send(b'\r\n') + headers.append(f"{header}: {value}\r\n".encode("latin-1")) + headers.append(b"\r\n") + # Making a single send() call instead of one per line encourages + # the host OS to use a more optimal packet size instead of + # potentially emitting a series of small packets. + self.send(b"".join(headers)) + del headers response = self.response_class(self.sock, method=self._method) (version, code, message) = response._read_status() if code != http.HTTPStatus.OK: self.close() - raise OSError("Tunnel connection failed: %d %s" % (code, - message.strip())) + raise OSError(f"Tunnel connection failed: {code} {message.strip()}") while True: line = response.fp.readline(_MAXLINE + 1) if len(line) > _MAXLINE: diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 4abff60230b54..5fb45924e5082 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -10,6 +10,7 @@ import warnings import unittest +from unittest import mock TestCase = unittest.TestCase from test import support @@ -2051,6 +2052,23 @@ def test_connect_with_tunnel(self): # This test should be removed when CONNECT gets the HTTP/1.1 blessing self.assertNotIn(b'Host: proxy.com', self.conn.sock.data) + def test_tunnel_connect_single_send_connection_setup(self): + """Regresstion test for https://bugs.python.org/issue43332.""" + with mock.patch.object(self.conn, 'send') as mock_send: + self.conn.set_tunnel('destination.com') + self.conn.connect() + self.conn.request('GET', '/') + mock_send.assert_called() + # Likely 2, but this test only cares about the first. + self.assertGreater( + len(mock_send.mock_calls), 1, + msg=f'unexpected number of send calls: {mock_send.mock_calls}') + proxy_setup_data_sent = mock_send.mock_calls[0][1][0] + self.assertIn(b'CONNECT destination.com', proxy_setup_data_sent) + self.assertTrue( + proxy_setup_data_sent.endswith(b'\r\n\r\n'), + msg=f'unexpected proxy data sent {proxy_setup_data_sent!r}') + def test_connect_put_request(self): self.conn.set_tunnel('destination.com') self.conn.request('PUT', '/', '') diff --git a/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst b/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst new file mode 100644 index 0000000000000..c40be95c194db --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst @@ -0,0 +1,3 @@ +Improves the networking efficiency of :mod:`http.client` when using a proxy +via :meth:`~HTTPConnection.set_tunnel`. Fewer small send calls are made +during connection setup. From webhook-mailer at python.org Mon Mar 8 02:59:57 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 08 Mar 2021 07:59:57 -0000 Subject: [Python-checkins] bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780) Message-ID: https://github.com/python/cpython/commit/c6e7cf1ee09c88d35e6703c33a61eca7b9db54f3 commit: c6e7cf1ee09c88d35e6703c33a61eca7b9db54f3 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-07T23:59:37-08:00 summary: bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780) We now buffer the CONNECT request + tunnel HTTP headers into a single send call. This prevents the OS from generating multiple network packets for connection setup when not necessary, improving efficiency. (cherry picked from commit c25910a135c2245accadb324b40dd6453015e056) Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst M Lib/http/client.py M Lib/test/test_httplib.py diff --git a/Lib/http/client.py b/Lib/http/client.py index 16afc871ea6d7..a96fd5ebb2e86 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -886,23 +886,24 @@ def set_debuglevel(self, level): self.debuglevel = level def _tunnel(self): - connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host, - self._tunnel_port) - connect_bytes = connect_str.encode("ascii") - self.send(connect_bytes) + connect = b"CONNECT %s:%d HTTP/1.0\r\n" % ( + self._tunnel_host.encode("ascii"), self._tunnel_port) + headers = [connect] for header, value in self._tunnel_headers.items(): - header_str = "%s: %s\r\n" % (header, value) - header_bytes = header_str.encode("latin-1") - self.send(header_bytes) - self.send(b'\r\n') + headers.append(f"{header}: {value}\r\n".encode("latin-1")) + headers.append(b"\r\n") + # Making a single send() call instead of one per line encourages + # the host OS to use a more optimal packet size instead of + # potentially emitting a series of small packets. + self.send(b"".join(headers)) + del headers response = self.response_class(self.sock, method=self._method) (version, code, message) = response._read_status() if code != http.HTTPStatus.OK: self.close() - raise OSError("Tunnel connection failed: %d %s" % (code, - message.strip())) + raise OSError(f"Tunnel connection failed: {code} {message.strip()}") while True: line = response.fp.readline(_MAXLINE + 1) if len(line) > _MAXLINE: diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 28943f02564fb..0fe8ead3cef1e 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -10,6 +10,7 @@ import warnings import unittest +from unittest import mock TestCase = unittest.TestCase from test import support @@ -2021,6 +2022,23 @@ def test_connect_with_tunnel(self): # This test should be removed when CONNECT gets the HTTP/1.1 blessing self.assertNotIn(b'Host: proxy.com', self.conn.sock.data) + def test_tunnel_connect_single_send_connection_setup(self): + """Regresstion test for https://bugs.python.org/issue43332.""" + with mock.patch.object(self.conn, 'send') as mock_send: + self.conn.set_tunnel('destination.com') + self.conn.connect() + self.conn.request('GET', '/') + mock_send.assert_called() + # Likely 2, but this test only cares about the first. + self.assertGreater( + len(mock_send.mock_calls), 1, + msg=f'unexpected number of send calls: {mock_send.mock_calls}') + proxy_setup_data_sent = mock_send.mock_calls[0][1][0] + self.assertIn(b'CONNECT destination.com', proxy_setup_data_sent) + self.assertTrue( + proxy_setup_data_sent.endswith(b'\r\n\r\n'), + msg=f'unexpected proxy data sent {proxy_setup_data_sent!r}') + def test_connect_put_request(self): self.conn.set_tunnel('destination.com') self.conn.request('PUT', '/', '') diff --git a/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst b/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst new file mode 100644 index 0000000000000..c40be95c194db --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst @@ -0,0 +1,3 @@ +Improves the networking efficiency of :mod:`http.client` when using a proxy +via :meth:`~HTTPConnection.set_tunnel`. Fewer small send calls are made +during connection setup. From webhook-mailer at python.org Mon Mar 8 06:16:38 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 08 Mar 2021 11:16:38 -0000 Subject: [Python-checkins] bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) Message-ID: https://github.com/python/cpython/commit/bbba28212ce0f58096a4043f32442c6e727b74fc commit: bbba28212ce0f58096a4043f32442c6e727b74fc branch: master author: Mariusz Felisiak committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-08T03:16:20-08:00 summary: bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) [bpo-43353]() Automerge-Triggered-By: GH:vsajip files: M Doc/library/logging.rst M Lib/logging/__init__.py diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 431a5849fa9bf..70a703dde18a0 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -1113,18 +1113,27 @@ functions. .. function:: getLevelName(level) - Returns the textual representation of logging level *level*. If the level is one - of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`, - :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you - have associated levels with names using :func:`addLevelName` then the name you - have associated with *level* is returned. If a numeric value corresponding to one - of the defined levels is passed in, the corresponding string representation is - returned. Otherwise, the string 'Level %s' % level is returned. + Returns the textual or numeric representation of logging level *level*. + + If *level* is one of the predefined levels :const:`CRITICAL`, :const:`ERROR`, + :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the + corresponding string. If you have associated levels with names using + :func:`addLevelName` then the name you have associated with *level* is + returned. If a numeric value corresponding to one of the defined levels is + passed in, the corresponding string representation is returned. + + The *level* parameter also accepts a string representation of the level such + as 'INFO'. In such cases, this functions returns the corresponding numeric + value of the level. + + If no matching numeric or string value is passed in, the string + 'Level %s' % level is returned. .. note:: Levels are internally integers (as they need to be compared in the logging logic). This function is used to convert between an integer level and the level name displayed in the formatted log output by means of the - ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`). + ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and + vice versa. .. versionchanged:: 3.4 In Python versions earlier than 3.4, this function could also be passed a diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 50b7378cd6386..411aa53a0b620 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -118,7 +118,7 @@ def getLevelName(level): """ - Return the textual representation of logging level 'level'. + Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have @@ -128,7 +128,11 @@ def getLevelName(level): If a numeric value corresponding to one of the defined levels is passed in, the corresponding string representation is returned. - Otherwise, the string "Level %s" % level is returned. + If a string representation of the level is passed in, the corresponding + numeric value is returned. + + If no matching numeric or string value is passed in, the string + 'Level %s' % level is returned. """ # See Issues #22386, #27937 and #29220 for why it's this way result = _levelToName.get(level) From webhook-mailer at python.org Mon Mar 8 15:06:10 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 08 Mar 2021 20:06:10 -0000 Subject: [Python-checkins] bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159) Message-ID: https://github.com/python/cpython/commit/3abf6f010243a91bf57cbf357dac33193f7b8407 commit: 3abf6f010243a91bf57cbf357dac33193f7b8407 branch: master author: Desmond Cheong committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-08T12:06:02-08:00 summary: bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159) Added an invalidate_caches() method to the zipimport.zipimporter class based on the implementation of importlib.FileFinder.invalidate_caches(). This was done by adding a get_files() method and an _archive_mtime attribute to zipimport.zipimporter to check for updates or cache invalidation whenever the cache of files and toc entry information in the zipimporter is accessed. files: A Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst M Doc/library/zipimport.rst M Lib/test/test_zipimport.py M Lib/zipimport.py M Python/importlib_zipimport.h diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst index 62e1e47e980e1..cd7030fed0173 100644 --- a/Doc/library/zipimport.rst +++ b/Doc/library/zipimport.rst @@ -166,6 +166,15 @@ zipimporter Objects Use :meth:`exec_module` instead. + + .. method:: invalidate_caches() + + Clear out the internal cache of information about files found within + the ZIP archive. + + .. versionadded:: 3.10 + + .. attribute:: archive The file name of the importer's associated ZIP file, without a possible diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index d59ef1ed6ff81..dfc4a060ec6cc 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -506,6 +506,47 @@ def testZipImporterMethods(self): self.assertEqual(zi2.archive, TEMP_ZIP) self.assertEqual(zi2.prefix, TESTPACK + os.sep) + def testInvalidateCaches(self): + packdir = TESTPACK + os.sep + packdir2 = packdir + TESTPACK2 + os.sep + files = {packdir + "__init__" + pyc_ext: (NOW, test_pyc), + packdir2 + "__init__" + pyc_ext: (NOW, test_pyc), + packdir2 + TESTMOD + pyc_ext: (NOW, test_pyc), + "spam" + pyc_ext: (NOW, test_pyc)} + self.addCleanup(os_helper.unlink, TEMP_ZIP) + with ZipFile(TEMP_ZIP, "w") as z: + for name, (mtime, data) in files.items(): + zinfo = ZipInfo(name, time.localtime(mtime)) + zinfo.compress_type = self.compression + zinfo.comment = b"spam" + z.writestr(zinfo, data) + + zi = zipimport.zipimporter(TEMP_ZIP) + self.assertEqual(zi._files.keys(), files.keys()) + # Check that the file information remains accurate after reloading + zi.invalidate_caches() + self.assertEqual(zi._files.keys(), files.keys()) + # Add a new file to the ZIP archive + newfile = {"spam2" + pyc_ext: (NOW, test_pyc)} + files.update(newfile) + with ZipFile(TEMP_ZIP, "a") as z: + for name, (mtime, data) in newfile.items(): + zinfo = ZipInfo(name, time.localtime(mtime)) + zinfo.compress_type = self.compression + zinfo.comment = b"spam" + z.writestr(zinfo, data) + # Check that we can detect the new file after invalidating the cache + zi.invalidate_caches() + self.assertEqual(zi._files.keys(), files.keys()) + spec = zi.find_spec('spam2') + self.assertIsNotNone(spec) + self.assertIsInstance(spec.loader, zipimport.zipimporter) + # Check that the cached data is removed if the file is deleted + os.remove(TEMP_ZIP) + zi.invalidate_caches() + self.assertIsNone(zi._files) + self.assertIsNone(zipimport._zip_directory_cache.get(zi.archive)) + def testZipImporterMethodsInSubDirectory(self): packdir = TESTPACK + os.sep packdir2 = packdir + TESTPACK2 + os.sep diff --git a/Lib/zipimport.py b/Lib/zipimport.py index ce3e00e24faf2..e88d7a2c5a724 100644 --- a/Lib/zipimport.py +++ b/Lib/zipimport.py @@ -321,6 +321,16 @@ def get_resource_reader(self, fullname): return ZipReader(self, fullname) + def invalidate_caches(self): + """Reload the file data of the archive path.""" + try: + self._files = _read_directory(self.archive) + _zip_directory_cache[self.archive] = self._files + except ZipImportError: + _zip_directory_cache.pop(self.archive, None) + self._files = None + + def __repr__(self): return f'' diff --git a/Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst b/Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst new file mode 100644 index 0000000000000..127650c4f8063 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst @@ -0,0 +1,3 @@ +Add an invalidate_caches() method to the zipimport.zipimporter class to +support importlib.invalidate_caches(). +Patch by Desmond Cheong. diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index 5b78adfb3353c..9af8d7b10489d 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -76,959 +76,977 @@ const unsigned char _Py_M__zipimport[] = { 115,6,0,0,0,8,0,4,1,255,128,233,22,0,0,0, 115,4,0,0,0,80,75,5,6,105,255,255,0,0,99,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,64,0,0,0,115,118,0,0,0,101,0,90,1, + 0,0,0,64,0,0,0,115,126,0,0,0,101,0,90,1, 100,0,90,2,100,1,90,3,100,2,100,3,132,0,90,4, - 100,27,100,5,100,6,132,1,90,5,100,28,100,7,100,8, - 132,1,90,6,100,29,100,9,100,10,132,1,90,7,100,11, + 100,29,100,5,100,6,132,1,90,5,100,30,100,7,100,8, + 132,1,90,6,100,31,100,9,100,10,132,1,90,7,100,11, 100,12,132,0,90,8,100,13,100,14,132,0,90,9,100,15, 100,16,132,0,90,10,100,17,100,18,132,0,90,11,100,19, 100,20,132,0,90,12,100,21,100,22,132,0,90,13,100,23, - 100,24,132,0,90,14,100,25,100,26,132,0,90,15,100,4, - 83,0,41,30,114,4,0,0,0,97,255,1,0,0,122,105, - 112,105,109,112,111,114,116,101,114,40,97,114,99,104,105,118, - 101,112,97,116,104,41,32,45,62,32,122,105,112,105,109,112, - 111,114,116,101,114,32,111,98,106,101,99,116,10,10,32,32, - 32,32,67,114,101,97,116,101,32,97,32,110,101,119,32,122, - 105,112,105,109,112,111,114,116,101,114,32,105,110,115,116,97, - 110,99,101,46,32,39,97,114,99,104,105,118,101,112,97,116, - 104,39,32,109,117,115,116,32,98,101,32,97,32,112,97,116, - 104,32,116,111,10,32,32,32,32,97,32,122,105,112,102,105, - 108,101,44,32,111,114,32,116,111,32,97,32,115,112,101,99, - 105,102,105,99,32,112,97,116,104,32,105,110,115,105,100,101, - 32,97,32,122,105,112,102,105,108,101,46,32,70,111,114,32, - 101,120,97,109,112,108,101,44,32,105,116,32,99,97,110,32, - 98,101,10,32,32,32,32,39,47,116,109,112,47,109,121,105, - 109,112,111,114,116,46,122,105,112,39,44,32,111,114,32,39, + 100,24,132,0,90,14,100,25,100,26,132,0,90,15,100,27, + 100,28,132,0,90,16,100,4,83,0,41,32,114,4,0,0, + 0,97,255,1,0,0,122,105,112,105,109,112,111,114,116,101, + 114,40,97,114,99,104,105,118,101,112,97,116,104,41,32,45, + 62,32,122,105,112,105,109,112,111,114,116,101,114,32,111,98, + 106,101,99,116,10,10,32,32,32,32,67,114,101,97,116,101, + 32,97,32,110,101,119,32,122,105,112,105,109,112,111,114,116, + 101,114,32,105,110,115,116,97,110,99,101,46,32,39,97,114, + 99,104,105,118,101,112,97,116,104,39,32,109,117,115,116,32, + 98,101,32,97,32,112,97,116,104,32,116,111,10,32,32,32, + 32,97,32,122,105,112,102,105,108,101,44,32,111,114,32,116, + 111,32,97,32,115,112,101,99,105,102,105,99,32,112,97,116, + 104,32,105,110,115,105,100,101,32,97,32,122,105,112,102,105, + 108,101,46,32,70,111,114,32,101,120,97,109,112,108,101,44, + 32,105,116,32,99,97,110,32,98,101,10,32,32,32,32,39, 47,116,109,112,47,109,121,105,109,112,111,114,116,46,122,105, - 112,47,109,121,100,105,114,101,99,116,111,114,121,39,44,32, - 105,102,32,109,121,100,105,114,101,99,116,111,114,121,32,105, - 115,32,97,10,32,32,32,32,118,97,108,105,100,32,100,105, - 114,101,99,116,111,114,121,32,105,110,115,105,100,101,32,116, - 104,101,32,97,114,99,104,105,118,101,46,10,10,32,32,32, - 32,39,90,105,112,73,109,112,111,114,116,69,114,114,111,114, - 32,105,115,32,114,97,105,115,101,100,32,105,102,32,39,97, - 114,99,104,105,118,101,112,97,116,104,39,32,100,111,101,115, - 110,39,116,32,112,111,105,110,116,32,116,111,32,97,32,118, - 97,108,105,100,32,90,105,112,10,32,32,32,32,97,114,99, - 104,105,118,101,46,10,10,32,32,32,32,84,104,101,32,39, - 97,114,99,104,105,118,101,39,32,97,116,116,114,105,98,117, - 116,101,32,111,102,32,122,105,112,105,109,112,111,114,116,101, - 114,32,111,98,106,101,99,116,115,32,99,111,110,116,97,105, - 110,115,32,116,104,101,32,110,97,109,101,32,111,102,32,116, - 104,101,10,32,32,32,32,122,105,112,102,105,108,101,32,116, - 97,114,103,101,116,101,100,46,10,32,32,32,32,99,2,0, - 0,0,0,0,0,0,0,0,0,0,8,0,0,0,9,0, - 0,0,67,0,0,0,115,40,1,0,0,116,0,124,1,116, - 1,131,2,115,28,100,1,100,0,108,2,125,2,124,2,160, - 3,124,1,161,1,125,1,124,1,115,44,116,4,100,2,124, - 1,100,3,141,2,130,1,116,5,114,60,124,1,160,6,116, - 5,116,7,161,2,125,1,103,0,125,3,9,0,122,14,116, - 8,160,9,124,1,161,1,125,4,87,0,110,70,4,0,116, - 10,116,11,102,2,144,1,121,38,1,0,1,0,1,0,116, - 8,160,12,124,1,161,1,92,2,125,5,125,6,124,5,124, - 1,107,2,114,134,116,4,100,5,124,1,100,3,141,2,130, - 1,124,5,125,1,124,3,160,13,124,6,161,1,1,0,89, - 0,110,28,124,4,106,14,100,6,64,0,100,7,107,3,114, - 178,116,4,100,5,124,1,100,3,141,2,130,1,113,182,113, - 66,122,12,116,15,124,1,25,0,125,7,87,0,110,32,4, - 0,116,16,144,1,121,36,1,0,1,0,1,0,116,17,124, - 1,131,1,125,7,124,7,116,15,124,1,60,0,89,0,124, - 7,124,0,95,18,124,1,124,0,95,19,116,8,106,20,124, - 3,100,0,100,0,100,8,133,3,25,0,142,0,124,0,95, - 21,124,0,106,21,144,1,114,32,124,0,4,0,106,21,116, - 7,55,0,2,0,95,21,100,0,83,0,100,0,83,0,119, - 0,119,0,41,9,78,114,0,0,0,0,122,21,97,114,99, - 104,105,118,101,32,112,97,116,104,32,105,115,32,101,109,112, - 116,121,169,1,218,4,112,97,116,104,84,122,14,110,111,116, - 32,97,32,90,105,112,32,102,105,108,101,105,0,240,0,0, - 105,0,128,0,0,233,255,255,255,255,41,22,218,10,105,115, - 105,110,115,116,97,110,99,101,218,3,115,116,114,218,2,111, - 115,90,8,102,115,100,101,99,111,100,101,114,3,0,0,0, - 218,12,97,108,116,95,112,97,116,104,95,115,101,112,218,7, - 114,101,112,108,97,99,101,218,8,112,97,116,104,95,115,101, - 112,218,19,95,98,111,111,116,115,116,114,97,112,95,101,120, - 116,101,114,110,97,108,90,10,95,112,97,116,104,95,115,116, - 97,116,218,7,79,83,69,114,114,111,114,218,10,86,97,108, - 117,101,69,114,114,111,114,90,11,95,112,97,116,104,95,115, - 112,108,105,116,218,6,97,112,112,101,110,100,90,7,115,116, - 95,109,111,100,101,218,20,95,122,105,112,95,100,105,114,101, - 99,116,111,114,121,95,99,97,99,104,101,218,8,75,101,121, - 69,114,114,111,114,218,15,95,114,101,97,100,95,100,105,114, - 101,99,116,111,114,121,218,6,95,102,105,108,101,115,218,7, - 97,114,99,104,105,118,101,218,10,95,112,97,116,104,95,106, - 111,105,110,218,6,112,114,101,102,105,120,41,8,218,4,115, - 101,108,102,114,13,0,0,0,114,17,0,0,0,114,31,0, - 0,0,90,2,115,116,90,7,100,105,114,110,97,109,101,90, - 8,98,97,115,101,110,97,109,101,218,5,102,105,108,101,115, - 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, - 8,95,95,105,110,105,116,95,95,64,0,0,0,115,70,0, - 0,0,10,1,8,1,10,1,4,1,12,1,4,1,12,1, - 4,2,2,1,2,1,14,1,18,1,14,3,8,1,12,1, - 4,1,14,1,14,3,12,2,2,1,2,240,2,18,12,1, - 14,1,8,1,10,1,6,1,6,1,22,2,8,1,18,1, - 4,255,2,249,2,239,255,128,122,20,122,105,112,105,109,112, - 111,114,116,101,114,46,95,95,105,110,105,116,95,95,78,99, - 3,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0, - 4,0,0,0,67,0,0,0,115,78,0,0,0,116,0,124, - 0,124,1,131,2,125,3,124,3,100,1,117,1,114,26,124, - 0,103,0,102,2,83,0,116,1,124,0,124,1,131,2,125, - 4,116,2,124,0,124,4,131,2,114,70,100,1,124,0,106, - 3,155,0,116,4,155,0,124,4,155,0,157,3,103,1,102, - 2,83,0,100,1,103,0,102,2,83,0,41,2,97,47,2, - 0,0,102,105,110,100,95,108,111,97,100,101,114,40,102,117, - 108,108,110,97,109,101,44,32,112,97,116,104,61,78,111,110, - 101,41,32,45,62,32,115,101,108,102,44,32,115,116,114,32, - 111,114,32,78,111,110,101,46,10,10,32,32,32,32,32,32, - 32,32,83,101,97,114,99,104,32,102,111,114,32,97,32,109, - 111,100,117,108,101,32,115,112,101,99,105,102,105,101,100,32, - 98,121,32,39,102,117,108,108,110,97,109,101,39,46,32,39, - 102,117,108,108,110,97,109,101,39,32,109,117,115,116,32,98, - 101,32,116,104,101,10,32,32,32,32,32,32,32,32,102,117, - 108,108,121,32,113,117,97,108,105,102,105,101,100,32,40,100, - 111,116,116,101,100,41,32,109,111,100,117,108,101,32,110,97, - 109,101,46,32,73,116,32,114,101,116,117,114,110,115,32,116, - 104,101,32,122,105,112,105,109,112,111,114,116,101,114,10,32, - 32,32,32,32,32,32,32,105,110,115,116,97,110,99,101,32, - 105,116,115,101,108,102,32,105,102,32,116,104,101,32,109,111, - 100,117,108,101,32,119,97,115,32,102,111,117,110,100,44,32, - 97,32,115,116,114,105,110,103,32,99,111,110,116,97,105,110, - 105,110,103,32,116,104,101,10,32,32,32,32,32,32,32,32, - 102,117,108,108,32,112,97,116,104,32,110,97,109,101,32,105, - 102,32,105,116,39,115,32,112,111,115,115,105,98,108,121,32, - 97,32,112,111,114,116,105,111,110,32,111,102,32,97,32,110, - 97,109,101,115,112,97,99,101,32,112,97,99,107,97,103,101, - 44,10,32,32,32,32,32,32,32,32,111,114,32,78,111,110, - 101,32,111,116,104,101,114,119,105,115,101,46,32,84,104,101, - 32,111,112,116,105,111,110,97,108,32,39,112,97,116,104,39, - 32,97,114,103,117,109,101,110,116,32,105,115,32,105,103,110, - 111,114,101,100,32,45,45,32,105,116,39,115,10,32,32,32, - 32,32,32,32,32,116,104,101,114,101,32,102,111,114,32,99, - 111,109,112,97,116,105,98,105,108,105,116,121,32,119,105,116, - 104,32,116,104,101,32,105,109,112,111,114,116,101,114,32,112, - 114,111,116,111,99,111,108,46,10,10,32,32,32,32,32,32, - 32,32,68,101,112,114,101,99,97,116,101,100,32,115,105,110, - 99,101,32,80,121,116,104,111,110,32,51,46,49,48,46,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,32,32,32,32,32,32,32, - 32,78,41,5,218,16,95,103,101,116,95,109,111,100,117,108, - 101,95,105,110,102,111,218,16,95,103,101,116,95,109,111,100, - 117,108,101,95,112,97,116,104,218,7,95,105,115,95,100,105, - 114,114,29,0,0,0,114,20,0,0,0,41,5,114,32,0, - 0,0,218,8,102,117,108,108,110,97,109,101,114,13,0,0, - 0,218,2,109,105,218,7,109,111,100,112,97,116,104,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,218,11,102, - 105,110,100,95,108,111,97,100,101,114,110,0,0,0,115,16, - 0,0,0,10,12,8,1,8,2,10,7,10,1,24,4,8, - 2,255,128,122,23,122,105,112,105,109,112,111,114,116,101,114, - 46,102,105,110,100,95,108,111,97,100,101,114,99,3,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0, - 0,67,0,0,0,115,16,0,0,0,124,0,160,0,124,1, - 124,2,161,2,100,1,25,0,83,0,41,3,97,203,1,0, - 0,102,105,110,100,95,109,111,100,117,108,101,40,102,117,108, - 108,110,97,109,101,44,32,112,97,116,104,61,78,111,110,101, - 41,32,45,62,32,115,101,108,102,32,111,114,32,78,111,110, - 101,46,10,10,32,32,32,32,32,32,32,32,83,101,97,114, - 99,104,32,102,111,114,32,97,32,109,111,100,117,108,101,32, - 115,112,101,99,105,102,105,101,100,32,98,121,32,39,102,117, - 108,108,110,97,109,101,39,46,32,39,102,117,108,108,110,97, - 109,101,39,32,109,117,115,116,32,98,101,32,116,104,101,10, - 32,32,32,32,32,32,32,32,102,117,108,108,121,32,113,117, - 97,108,105,102,105,101,100,32,40,100,111,116,116,101,100,41, - 32,109,111,100,117,108,101,32,110,97,109,101,46,32,73,116, - 32,114,101,116,117,114,110,115,32,116,104,101,32,122,105,112, - 105,109,112,111,114,116,101,114,10,32,32,32,32,32,32,32, - 32,105,110,115,116,97,110,99,101,32,105,116,115,101,108,102, - 32,105,102,32,116,104,101,32,109,111,100,117,108,101,32,119, - 97,115,32,102,111,117,110,100,44,32,111,114,32,78,111,110, - 101,32,105,102,32,105,116,32,119,97,115,110,39,116,46,10, - 32,32,32,32,32,32,32,32,84,104,101,32,111,112,116,105, - 111,110,97,108,32,39,112,97,116,104,39,32,97,114,103,117, - 109,101,110,116,32,105,115,32,105,103,110,111,114,101,100,32, - 45,45,32,105,116,39,115,32,116,104,101,114,101,32,102,111, - 114,32,99,111,109,112,97,116,105,98,105,108,105,116,121,10, - 32,32,32,32,32,32,32,32,119,105,116,104,32,116,104,101, - 32,105,109,112,111,114,116,101,114,32,112,114,111,116,111,99, - 111,108,46,10,10,32,32,32,32,32,32,32,32,68,101,112, - 114,101,99,97,116,101,100,32,115,105,110,99,101,32,80,121, - 116,104,111,110,32,51,46,49,48,46,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,32,32,32,32,32,32,32,32,114,0,0,0, - 0,78,41,1,114,41,0,0,0,41,3,114,32,0,0,0, - 114,38,0,0,0,114,13,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,218,11,102,105,110,100,95, - 109,111,100,117,108,101,144,0,0,0,115,4,0,0,0,16, - 11,255,128,122,23,122,105,112,105,109,112,111,114,116,101,114, - 46,102,105,110,100,95,109,111,100,117,108,101,99,3,0,0, - 0,0,0,0,0,0,0,0,0,7,0,0,0,5,0,0, - 0,67,0,0,0,115,108,0,0,0,116,0,124,0,124,1, - 131,2,125,3,124,3,100,1,117,1,114,34,116,1,106,2, - 124,1,124,0,124,3,100,2,141,3,83,0,116,3,124,0, - 124,1,131,2,125,4,116,4,124,0,124,4,131,2,114,104, - 124,0,106,5,155,0,116,6,155,0,124,4,155,0,157,3, - 125,5,116,1,106,7,124,1,100,1,100,3,100,4,141,3, - 125,6,124,6,106,8,160,9,124,5,161,1,1,0,124,6, - 83,0,100,1,83,0,41,5,122,107,67,114,101,97,116,101, - 32,97,32,77,111,100,117,108,101,83,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,78,111,110,101,32,105,102, - 32,116,104,101,32,109,111,100,117,108,101,32,99,97,110,110, - 111,116,32,98,101,32,102,111,117,110,100,46,10,32,32,32, - 32,32,32,32,32,78,41,1,218,10,105,115,95,112,97,99, - 107,97,103,101,84,41,3,218,4,110,97,109,101,90,6,108, - 111,97,100,101,114,114,43,0,0,0,41,10,114,35,0,0, - 0,218,10,95,98,111,111,116,115,116,114,97,112,90,16,115, - 112,101,99,95,102,114,111,109,95,108,111,97,100,101,114,114, - 36,0,0,0,114,37,0,0,0,114,29,0,0,0,114,20, - 0,0,0,90,10,77,111,100,117,108,101,83,112,101,99,90, - 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,114,24,0,0,0, - 41,7,114,32,0,0,0,114,38,0,0,0,90,6,116,97, - 114,103,101,116,90,11,109,111,100,117,108,101,95,105,110,102, - 111,114,40,0,0,0,114,13,0,0,0,90,4,115,112,101, - 99,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, - 218,9,102,105,110,100,95,115,112,101,99,157,0,0,0,115, - 26,0,0,0,10,5,8,1,16,1,10,7,10,1,18,4, - 8,1,2,1,6,255,12,2,4,1,4,2,255,128,122,21, - 122,105,112,105,109,112,111,114,116,101,114,46,102,105,110,100, - 95,115,112,101,99,99,2,0,0,0,0,0,0,0,0,0, - 0,0,5,0,0,0,3,0,0,0,67,0,0,0,115,20, - 0,0,0,116,0,124,0,124,1,131,2,92,3,125,2,125, - 3,125,4,124,2,83,0,41,2,122,166,103,101,116,95,99, - 111,100,101,40,102,117,108,108,110,97,109,101,41,32,45,62, - 32,99,111,100,101,32,111,98,106,101,99,116,46,10,10,32, - 32,32,32,32,32,32,32,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,115,112,101,99,105,102,105,101,100,32, - 109,111,100,117,108,101,46,32,82,97,105,115,101,32,90,105, - 112,73,109,112,111,114,116,69,114,114,111,114,10,32,32,32, - 32,32,32,32,32,105,102,32,116,104,101,32,109,111,100,117, - 108,101,32,99,111,117,108,100,110,39,116,32,98,101,32,105, - 109,112,111,114,116,101,100,46,10,32,32,32,32,32,32,32, - 32,78,169,1,218,16,95,103,101,116,95,109,111,100,117,108, - 101,95,99,111,100,101,169,5,114,32,0,0,0,114,38,0, - 0,0,218,4,99,111,100,101,218,9,105,115,112,97,99,107, - 97,103,101,114,40,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,8,103,101,116,95,99,111,100, - 101,184,0,0,0,115,6,0,0,0,16,6,4,1,255,128, - 122,20,122,105,112,105,109,112,111,114,116,101,114,46,103,101, - 116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,4,0,0,0,8,0,0,0,67,0,0,0,115, - 112,0,0,0,116,0,114,16,124,1,160,1,116,0,116,2, - 161,2,125,1,124,1,125,2,124,1,160,3,124,0,106,4, - 116,2,23,0,161,1,114,58,124,1,116,5,124,0,106,4, - 116,2,23,0,131,1,100,1,133,2,25,0,125,2,122,14, - 124,0,106,6,124,2,25,0,125,3,87,0,110,24,4,0, - 116,7,121,110,1,0,1,0,1,0,116,8,100,2,100,3, - 124,2,131,3,130,1,116,9,124,0,106,4,124,3,131,2, - 83,0,119,0,41,4,122,154,103,101,116,95,100,97,116,97, - 40,112,97,116,104,110,97,109,101,41,32,45,62,32,115,116, - 114,105,110,103,32,119,105,116,104,32,102,105,108,101,32,100, - 97,116,97,46,10,10,32,32,32,32,32,32,32,32,82,101, - 116,117,114,110,32,116,104,101,32,100,97,116,97,32,97,115, - 115,111,99,105,97,116,101,100,32,119,105,116,104,32,39,112, - 97,116,104,110,97,109,101,39,46,32,82,97,105,115,101,32, - 79,83,69,114,114,111,114,32,105,102,10,32,32,32,32,32, - 32,32,32,116,104,101,32,102,105,108,101,32,119,97,115,110, - 39,116,32,102,111,117,110,100,46,10,32,32,32,32,32,32, - 32,32,78,114,0,0,0,0,218,0,41,10,114,18,0,0, - 0,114,19,0,0,0,114,20,0,0,0,218,10,115,116,97, - 114,116,115,119,105,116,104,114,29,0,0,0,218,3,108,101, - 110,114,28,0,0,0,114,26,0,0,0,114,22,0,0,0, - 218,9,95,103,101,116,95,100,97,116,97,41,4,114,32,0, - 0,0,218,8,112,97,116,104,110,97,109,101,90,3,107,101, - 121,218,9,116,111,99,95,101,110,116,114,121,114,9,0,0, - 0,114,9,0,0,0,114,10,0,0,0,218,8,103,101,116, - 95,100,97,116,97,194,0,0,0,115,24,0,0,0,4,6, - 12,1,4,2,16,1,22,1,2,2,14,1,12,1,12,1, - 12,1,2,254,255,128,122,20,122,105,112,105,109,112,111,114, - 116,101,114,46,103,101,116,95,100,97,116,97,99,2,0,0, - 0,0,0,0,0,0,0,0,0,5,0,0,0,3,0,0, - 0,67,0,0,0,115,20,0,0,0,116,0,124,0,124,1, - 131,2,92,3,125,2,125,3,125,4,124,4,83,0,41,2, - 122,165,103,101,116,95,102,105,108,101,110,97,109,101,40,102, - 117,108,108,110,97,109,101,41,32,45,62,32,102,105,108,101, - 110,97,109,101,32,115,116,114,105,110,103,46,10,10,32,32, - 32,32,32,32,32,32,82,101,116,117,114,110,32,116,104,101, - 32,102,105,108,101,110,97,109,101,32,102,111,114,32,116,104, - 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, - 108,101,32,111,114,32,114,97,105,115,101,32,90,105,112,73, - 109,112,111,114,116,69,114,114,111,114,10,32,32,32,32,32, - 32,32,32,105,102,32,105,116,32,99,111,117,108,100,110,39, - 116,32,98,101,32,105,109,112,111,114,116,101,100,46,10,32, - 32,32,32,32,32,32,32,78,114,47,0,0,0,114,49,0, - 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,218,12,103,101,116,95,102,105,108,101,110,97,109,101,215, - 0,0,0,115,6,0,0,0,16,8,4,1,255,128,122,24, - 122,105,112,105,109,112,111,114,116,101,114,46,103,101,116,95, - 102,105,108,101,110,97,109,101,99,2,0,0,0,0,0,0, - 0,0,0,0,0,6,0,0,0,8,0,0,0,67,0,0, - 0,115,126,0,0,0,116,0,124,0,124,1,131,2,125,2, - 124,2,100,1,117,0,114,36,116,1,100,2,124,1,155,2, - 157,2,124,1,100,3,141,2,130,1,116,2,124,0,124,1, - 131,2,125,3,124,2,114,64,116,3,160,4,124,3,100,4, - 161,2,125,4,110,10,124,3,155,0,100,5,157,2,125,4, - 122,14,124,0,106,5,124,4,25,0,125,5,87,0,110,18, - 4,0,116,6,121,124,1,0,1,0,1,0,89,0,100,1, - 83,0,116,7,124,0,106,8,124,5,131,2,160,9,161,0, - 83,0,119,0,41,6,122,253,103,101,116,95,115,111,117,114, - 99,101,40,102,117,108,108,110,97,109,101,41,32,45,62,32, - 115,111,117,114,99,101,32,115,116,114,105,110,103,46,10,10, - 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,116, - 104,101,32,115,111,117,114,99,101,32,99,111,100,101,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,32,82,97,105,115,101,32,90, - 105,112,73,109,112,111,114,116,69,114,114,111,114,10,32,32, - 32,32,32,32,32,32,105,102,32,116,104,101,32,109,111,100, - 117,108,101,32,99,111,117,108,100,110,39,116,32,98,101,32, - 102,111,117,110,100,44,32,114,101,116,117,114,110,32,78,111, - 110,101,32,105,102,32,116,104,101,32,97,114,99,104,105,118, - 101,32,100,111,101,115,10,32,32,32,32,32,32,32,32,99, - 111,110,116,97,105,110,32,116,104,101,32,109,111,100,117,108, - 101,44,32,98,117,116,32,104,97,115,32,110,111,32,115,111, - 117,114,99,101,32,102,111,114,32,105,116,46,10,32,32,32, - 32,32,32,32,32,78,250,18,99,97,110,39,116,32,102,105, - 110,100,32,109,111,100,117,108,101,32,169,1,114,44,0,0, - 0,250,11,95,95,105,110,105,116,95,95,46,112,121,250,3, - 46,112,121,41,10,114,35,0,0,0,114,3,0,0,0,114, - 36,0,0,0,114,21,0,0,0,114,30,0,0,0,114,28, - 0,0,0,114,26,0,0,0,114,56,0,0,0,114,29,0, - 0,0,218,6,100,101,99,111,100,101,41,6,114,32,0,0, - 0,114,38,0,0,0,114,39,0,0,0,114,13,0,0,0, - 218,8,102,117,108,108,112,97,116,104,114,58,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,10, - 103,101,116,95,115,111,117,114,99,101,227,0,0,0,115,28, - 0,0,0,10,7,8,1,18,1,10,2,4,1,14,1,10, - 2,2,2,14,1,12,1,6,2,16,1,2,253,255,128,122, - 22,122,105,112,105,109,112,111,114,116,101,114,46,103,101,116, - 95,115,111,117,114,99,101,99,2,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,4,0,0,0,67,0,0,0, - 115,40,0,0,0,116,0,124,0,124,1,131,2,125,2,124, - 2,100,1,117,0,114,36,116,1,100,2,124,1,155,2,157, - 2,124,1,100,3,141,2,130,1,124,2,83,0,41,4,122, - 171,105,115,95,112,97,99,107,97,103,101,40,102,117,108,108, - 110,97,109,101,41,32,45,62,32,98,111,111,108,46,10,10, - 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,84, - 114,117,101,32,105,102,32,116,104,101,32,109,111,100,117,108, - 101,32,115,112,101,99,105,102,105,101,100,32,98,121,32,102, - 117,108,108,110,97,109,101,32,105,115,32,97,32,112,97,99, - 107,97,103,101,46,10,32,32,32,32,32,32,32,32,82,97, - 105,115,101,32,90,105,112,73,109,112,111,114,116,69,114,114, - 111,114,32,105,102,32,116,104,101,32,109,111,100,117,108,101, - 32,99,111,117,108,100,110,39,116,32,98,101,32,102,111,117, - 110,100,46,10,32,32,32,32,32,32,32,32,78,114,61,0, - 0,0,114,62,0,0,0,41,2,114,35,0,0,0,114,3, - 0,0,0,41,3,114,32,0,0,0,114,38,0,0,0,114, - 39,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, - 0,0,0,114,43,0,0,0,253,0,0,0,115,10,0,0, - 0,10,6,8,1,18,1,4,1,255,128,122,22,122,105,112, - 105,109,112,111,114,116,101,114,46,105,115,95,112,97,99,107, - 97,103,101,99,2,0,0,0,0,0,0,0,0,0,0,0, - 9,0,0,0,8,0,0,0,67,0,0,0,115,252,0,0, - 0,100,1,125,2,116,0,160,1,124,2,116,2,161,2,1, - 0,116,3,124,0,124,1,131,2,92,3,125,3,125,4,125, - 5,116,4,106,5,160,6,124,1,161,1,125,6,124,6,100, - 2,117,0,115,62,116,7,124,6,116,8,131,2,115,80,116, - 8,124,1,131,1,125,6,124,6,116,4,106,5,124,1,60, - 0,124,0,124,6,95,9,122,84,124,4,114,124,116,10,124, - 0,124,1,131,2,125,7,116,11,160,12,124,0,106,13,124, - 7,161,2,125,8,124,8,103,1,124,6,95,14,116,15,124, - 6,100,3,131,2,115,140,116,16,124,6,95,16,116,11,160, - 17,124,6,106,18,124,1,124,5,161,3,1,0,116,19,124, - 3,124,6,106,18,131,2,1,0,87,0,110,16,1,0,1, - 0,1,0,116,4,106,5,124,1,61,0,130,0,122,14,116, - 4,106,5,124,1,25,0,125,6,87,0,110,28,4,0,116, - 20,121,250,1,0,1,0,1,0,116,21,100,4,124,1,155, - 2,100,5,157,3,131,1,130,1,116,22,160,23,100,6,124, - 1,124,5,161,3,1,0,124,6,83,0,119,0,41,7,97, - 64,1,0,0,108,111,97,100,95,109,111,100,117,108,101,40, - 102,117,108,108,110,97,109,101,41,32,45,62,32,109,111,100, - 117,108,101,46,10,10,32,32,32,32,32,32,32,32,76,111, - 97,100,32,116,104,101,32,109,111,100,117,108,101,32,115,112, + 112,39,44,32,111,114,32,39,47,116,109,112,47,109,121,105, + 109,112,111,114,116,46,122,105,112,47,109,121,100,105,114,101, + 99,116,111,114,121,39,44,32,105,102,32,109,121,100,105,114, + 101,99,116,111,114,121,32,105,115,32,97,10,32,32,32,32, + 118,97,108,105,100,32,100,105,114,101,99,116,111,114,121,32, + 105,110,115,105,100,101,32,116,104,101,32,97,114,99,104,105, + 118,101,46,10,10,32,32,32,32,39,90,105,112,73,109,112, + 111,114,116,69,114,114,111,114,32,105,115,32,114,97,105,115, + 101,100,32,105,102,32,39,97,114,99,104,105,118,101,112,97, + 116,104,39,32,100,111,101,115,110,39,116,32,112,111,105,110, + 116,32,116,111,32,97,32,118,97,108,105,100,32,90,105,112, + 10,32,32,32,32,97,114,99,104,105,118,101,46,10,10,32, + 32,32,32,84,104,101,32,39,97,114,99,104,105,118,101,39, + 32,97,116,116,114,105,98,117,116,101,32,111,102,32,122,105, + 112,105,109,112,111,114,116,101,114,32,111,98,106,101,99,116, + 115,32,99,111,110,116,97,105,110,115,32,116,104,101,32,110, + 97,109,101,32,111,102,32,116,104,101,10,32,32,32,32,122, + 105,112,102,105,108,101,32,116,97,114,103,101,116,101,100,46, + 10,32,32,32,32,99,2,0,0,0,0,0,0,0,0,0, + 0,0,8,0,0,0,9,0,0,0,67,0,0,0,115,40, + 1,0,0,116,0,124,1,116,1,131,2,115,28,100,1,100, + 0,108,2,125,2,124,2,160,3,124,1,161,1,125,1,124, + 1,115,44,116,4,100,2,124,1,100,3,141,2,130,1,116, + 5,114,60,124,1,160,6,116,5,116,7,161,2,125,1,103, + 0,125,3,9,0,122,14,116,8,160,9,124,1,161,1,125, + 4,87,0,110,70,4,0,116,10,116,11,102,2,144,1,121, + 38,1,0,1,0,1,0,116,8,160,12,124,1,161,1,92, + 2,125,5,125,6,124,5,124,1,107,2,114,134,116,4,100, + 5,124,1,100,3,141,2,130,1,124,5,125,1,124,3,160, + 13,124,6,161,1,1,0,89,0,110,28,124,4,106,14,100, + 6,64,0,100,7,107,3,114,178,116,4,100,5,124,1,100, + 3,141,2,130,1,113,182,113,66,122,12,116,15,124,1,25, + 0,125,7,87,0,110,32,4,0,116,16,144,1,121,36,1, + 0,1,0,1,0,116,17,124,1,131,1,125,7,124,7,116, + 15,124,1,60,0,89,0,124,7,124,0,95,18,124,1,124, + 0,95,19,116,8,106,20,124,3,100,0,100,0,100,8,133, + 3,25,0,142,0,124,0,95,21,124,0,106,21,144,1,114, + 32,124,0,4,0,106,21,116,7,55,0,2,0,95,21,100, + 0,83,0,100,0,83,0,119,0,119,0,41,9,78,114,0, + 0,0,0,122,21,97,114,99,104,105,118,101,32,112,97,116, + 104,32,105,115,32,101,109,112,116,121,169,1,218,4,112,97, + 116,104,84,122,14,110,111,116,32,97,32,90,105,112,32,102, + 105,108,101,105,0,240,0,0,105,0,128,0,0,233,255,255, + 255,255,41,22,218,10,105,115,105,110,115,116,97,110,99,101, + 218,3,115,116,114,218,2,111,115,90,8,102,115,100,101,99, + 111,100,101,114,3,0,0,0,218,12,97,108,116,95,112,97, + 116,104,95,115,101,112,218,7,114,101,112,108,97,99,101,218, + 8,112,97,116,104,95,115,101,112,218,19,95,98,111,111,116, + 115,116,114,97,112,95,101,120,116,101,114,110,97,108,90,10, + 95,112,97,116,104,95,115,116,97,116,218,7,79,83,69,114, + 114,111,114,218,10,86,97,108,117,101,69,114,114,111,114,90, + 11,95,112,97,116,104,95,115,112,108,105,116,218,6,97,112, + 112,101,110,100,90,7,115,116,95,109,111,100,101,218,20,95, + 122,105,112,95,100,105,114,101,99,116,111,114,121,95,99,97, + 99,104,101,218,8,75,101,121,69,114,114,111,114,218,15,95, + 114,101,97,100,95,100,105,114,101,99,116,111,114,121,218,6, + 95,102,105,108,101,115,218,7,97,114,99,104,105,118,101,218, + 10,95,112,97,116,104,95,106,111,105,110,218,6,112,114,101, + 102,105,120,41,8,218,4,115,101,108,102,114,13,0,0,0, + 114,17,0,0,0,114,31,0,0,0,90,2,115,116,90,7, + 100,105,114,110,97,109,101,90,8,98,97,115,101,110,97,109, + 101,218,5,102,105,108,101,115,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,8,95,95,105,110,105,116,95, + 95,64,0,0,0,115,70,0,0,0,10,1,8,1,10,1, + 4,1,12,1,4,1,12,1,4,2,2,1,2,1,14,1, + 18,1,14,3,8,1,12,1,4,1,14,1,14,3,12,2, + 2,1,2,240,2,18,12,1,14,1,8,1,10,1,6,1, + 6,1,22,2,8,1,18,1,4,255,2,249,2,239,255,128, + 122,20,122,105,112,105,109,112,111,114,116,101,114,46,95,95, + 105,110,105,116,95,95,78,99,3,0,0,0,0,0,0,0, + 0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,0, + 115,78,0,0,0,116,0,124,0,124,1,131,2,125,3,124, + 3,100,1,117,1,114,26,124,0,103,0,102,2,83,0,116, + 1,124,0,124,1,131,2,125,4,116,2,124,0,124,4,131, + 2,114,70,100,1,124,0,106,3,155,0,116,4,155,0,124, + 4,155,0,157,3,103,1,102,2,83,0,100,1,103,0,102, + 2,83,0,41,2,97,47,2,0,0,102,105,110,100,95,108, + 111,97,100,101,114,40,102,117,108,108,110,97,109,101,44,32, + 112,97,116,104,61,78,111,110,101,41,32,45,62,32,115,101, + 108,102,44,32,115,116,114,32,111,114,32,78,111,110,101,46, + 10,10,32,32,32,32,32,32,32,32,83,101,97,114,99,104, + 32,102,111,114,32,97,32,109,111,100,117,108,101,32,115,112, 101,99,105,102,105,101,100,32,98,121,32,39,102,117,108,108, 110,97,109,101,39,46,32,39,102,117,108,108,110,97,109,101, 39,32,109,117,115,116,32,98,101,32,116,104,101,10,32,32, 32,32,32,32,32,32,102,117,108,108,121,32,113,117,97,108, 105,102,105,101,100,32,40,100,111,116,116,101,100,41,32,109, 111,100,117,108,101,32,110,97,109,101,46,32,73,116,32,114, - 101,116,117,114,110,115,32,116,104,101,32,105,109,112,111,114, - 116,101,100,10,32,32,32,32,32,32,32,32,109,111,100,117, - 108,101,44,32,111,114,32,114,97,105,115,101,115,32,90,105, - 112,73,109,112,111,114,116,69,114,114,111,114,32,105,102,32, - 105,116,32,99,111,117,108,100,32,110,111,116,32,98,101,32, - 105,109,112,111,114,116,101,100,46,10,10,32,32,32,32,32, - 32,32,32,68,101,112,114,101,99,97,116,101,100,32,115,105, - 110,99,101,32,80,121,116,104,111,110,32,51,46,49,48,46, - 32,85,115,101,32,101,120,101,99,95,109,111,100,117,108,101, + 101,116,117,114,110,115,32,116,104,101,32,122,105,112,105,109, + 112,111,114,116,101,114,10,32,32,32,32,32,32,32,32,105, + 110,115,116,97,110,99,101,32,105,116,115,101,108,102,32,105, + 102,32,116,104,101,32,109,111,100,117,108,101,32,119,97,115, + 32,102,111,117,110,100,44,32,97,32,115,116,114,105,110,103, + 32,99,111,110,116,97,105,110,105,110,103,32,116,104,101,10, + 32,32,32,32,32,32,32,32,102,117,108,108,32,112,97,116, + 104,32,110,97,109,101,32,105,102,32,105,116,39,115,32,112, + 111,115,115,105,98,108,121,32,97,32,112,111,114,116,105,111, + 110,32,111,102,32,97,32,110,97,109,101,115,112,97,99,101, + 32,112,97,99,107,97,103,101,44,10,32,32,32,32,32,32, + 32,32,111,114,32,78,111,110,101,32,111,116,104,101,114,119, + 105,115,101,46,32,84,104,101,32,111,112,116,105,111,110,97, + 108,32,39,112,97,116,104,39,32,97,114,103,117,109,101,110, + 116,32,105,115,32,105,103,110,111,114,101,100,32,45,45,32, + 105,116,39,115,10,32,32,32,32,32,32,32,32,116,104,101, + 114,101,32,102,111,114,32,99,111,109,112,97,116,105,98,105, + 108,105,116,121,32,119,105,116,104,32,116,104,101,32,105,109, + 112,111,114,116,101,114,32,112,114,111,116,111,99,111,108,46, + 10,10,32,32,32,32,32,32,32,32,68,101,112,114,101,99, + 97,116,101,100,32,115,105,110,99,101,32,80,121,116,104,111, + 110,32,51,46,49,48,46,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,32,32,32,32,32,32,32,32,78,41,5,218,16,95,103, + 101,116,95,109,111,100,117,108,101,95,105,110,102,111,218,16, + 95,103,101,116,95,109,111,100,117,108,101,95,112,97,116,104, + 218,7,95,105,115,95,100,105,114,114,29,0,0,0,114,20, + 0,0,0,41,5,114,32,0,0,0,218,8,102,117,108,108, + 110,97,109,101,114,13,0,0,0,218,2,109,105,218,7,109, + 111,100,112,97,116,104,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,11,102,105,110,100,95,108,111,97,100, + 101,114,110,0,0,0,115,16,0,0,0,10,12,8,1,8, + 2,10,7,10,1,24,4,8,2,255,128,122,23,122,105,112, + 105,109,112,111,114,116,101,114,46,102,105,110,100,95,108,111, + 97,100,101,114,99,3,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,4,0,0,0,67,0,0,0,115,16,0, + 0,0,124,0,160,0,124,1,124,2,161,2,100,1,25,0, + 83,0,41,3,97,203,1,0,0,102,105,110,100,95,109,111, + 100,117,108,101,40,102,117,108,108,110,97,109,101,44,32,112, + 97,116,104,61,78,111,110,101,41,32,45,62,32,115,101,108, + 102,32,111,114,32,78,111,110,101,46,10,10,32,32,32,32, + 32,32,32,32,83,101,97,114,99,104,32,102,111,114,32,97, + 32,109,111,100,117,108,101,32,115,112,101,99,105,102,105,101, + 100,32,98,121,32,39,102,117,108,108,110,97,109,101,39,46, + 32,39,102,117,108,108,110,97,109,101,39,32,109,117,115,116, + 32,98,101,32,116,104,101,10,32,32,32,32,32,32,32,32, + 102,117,108,108,121,32,113,117,97,108,105,102,105,101,100,32, + 40,100,111,116,116,101,100,41,32,109,111,100,117,108,101,32, + 110,97,109,101,46,32,73,116,32,114,101,116,117,114,110,115, + 32,116,104,101,32,122,105,112,105,109,112,111,114,116,101,114, + 10,32,32,32,32,32,32,32,32,105,110,115,116,97,110,99, + 101,32,105,116,115,101,108,102,32,105,102,32,116,104,101,32, + 109,111,100,117,108,101,32,119,97,115,32,102,111,117,110,100, + 44,32,111,114,32,78,111,110,101,32,105,102,32,105,116,32, + 119,97,115,110,39,116,46,10,32,32,32,32,32,32,32,32, + 84,104,101,32,111,112,116,105,111,110,97,108,32,39,112,97, + 116,104,39,32,97,114,103,117,109,101,110,116,32,105,115,32, + 105,103,110,111,114,101,100,32,45,45,32,105,116,39,115,32, + 116,104,101,114,101,32,102,111,114,32,99,111,109,112,97,116, + 105,98,105,108,105,116,121,10,32,32,32,32,32,32,32,32, + 119,105,116,104,32,116,104,101,32,105,109,112,111,114,116,101, + 114,32,112,114,111,116,111,99,111,108,46,10,10,32,32,32, + 32,32,32,32,32,68,101,112,114,101,99,97,116,101,100,32, + 115,105,110,99,101,32,80,121,116,104,111,110,32,51,46,49, + 48,46,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,32,32,32,32, - 32,32,32,32,122,114,122,105,112,105,109,112,111,114,116,46, - 122,105,112,105,109,112,111,114,116,101,114,46,108,111,97,100, - 95,109,111,100,117,108,101,40,41,32,105,115,32,100,101,112, - 114,101,99,97,116,101,100,32,97,110,100,32,115,108,97,116, - 101,100,32,102,111,114,32,114,101,109,111,118,97,108,32,105, - 110,32,80,121,116,104,111,110,32,51,46,49,50,59,32,117, - 115,101,32,101,120,101,99,95,109,111,100,117,108,101,40,41, - 32,105,110,115,116,101,97,100,78,218,12,95,95,98,117,105, - 108,116,105,110,115,95,95,122,14,76,111,97,100,101,100,32, - 109,111,100,117,108,101,32,122,25,32,110,111,116,32,102,111, - 117,110,100,32,105,110,32,115,121,115,46,109,111,100,117,108, - 101,115,122,30,105,109,112,111,114,116,32,123,125,32,35,32, - 108,111,97,100,101,100,32,102,114,111,109,32,90,105,112,32, - 123,125,41,24,218,9,95,119,97,114,110,105,110,103,115,90, - 4,119,97,114,110,218,18,68,101,112,114,101,99,97,116,105, - 111,110,87,97,114,110,105,110,103,114,48,0,0,0,218,3, - 115,121,115,218,7,109,111,100,117,108,101,115,218,3,103,101, - 116,114,15,0,0,0,218,12,95,109,111,100,117,108,101,95, - 116,121,112,101,218,10,95,95,108,111,97,100,101,114,95,95, - 114,36,0,0,0,114,21,0,0,0,114,30,0,0,0,114, - 29,0,0,0,90,8,95,95,112,97,116,104,95,95,218,7, - 104,97,115,97,116,116,114,114,68,0,0,0,90,14,95,102, - 105,120,95,117,112,95,109,111,100,117,108,101,218,8,95,95, - 100,105,99,116,95,95,218,4,101,120,101,99,114,26,0,0, - 0,218,11,73,109,112,111,114,116,69,114,114,111,114,114,45, - 0,0,0,218,16,95,118,101,114,98,111,115,101,95,109,101, - 115,115,97,103,101,41,9,114,32,0,0,0,114,38,0,0, - 0,218,3,109,115,103,114,50,0,0,0,114,51,0,0,0, - 114,40,0,0,0,90,3,109,111,100,114,13,0,0,0,114, - 66,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, - 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, - 10,1,0,0,115,56,0,0,0,4,9,12,2,16,1,12, - 1,18,1,8,1,10,1,6,1,2,2,4,1,10,3,14, - 1,8,1,10,2,6,1,16,1,16,1,6,1,8,1,2, - 1,2,2,14,1,12,1,16,1,14,1,4,1,2,253,255, - 128,122,23,122,105,112,105,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,0,0,0,0,3,0,0,0,8,0,0,0,67, - 0,0,0,115,64,0,0,0,122,20,124,0,160,0,124,1, - 161,1,115,18,87,0,100,1,83,0,87,0,110,18,4,0, - 116,1,121,62,1,0,1,0,1,0,89,0,100,1,83,0, - 100,2,100,3,108,2,109,3,125,2,1,0,124,2,124,0, - 124,1,131,2,83,0,119,0,41,4,122,204,82,101,116,117, - 114,110,32,116,104,101,32,82,101,115,111,117,114,99,101,82, - 101,97,100,101,114,32,102,111,114,32,97,32,112,97,99,107, - 97,103,101,32,105,110,32,97,32,122,105,112,32,102,105,108, - 101,46,10,10,32,32,32,32,32,32,32,32,73,102,32,39, - 102,117,108,108,110,97,109,101,39,32,105,115,32,97,32,112, - 97,99,107,97,103,101,32,119,105,116,104,105,110,32,116,104, - 101,32,122,105,112,32,102,105,108,101,44,32,114,101,116,117, - 114,110,32,116,104,101,10,32,32,32,32,32,32,32,32,39, - 82,101,115,111,117,114,99,101,82,101,97,100,101,114,39,32, - 111,98,106,101,99,116,32,102,111,114,32,116,104,101,32,112, - 97,99,107,97,103,101,46,32,32,79,116,104,101,114,119,105, - 115,101,32,114,101,116,117,114,110,32,78,111,110,101,46,10, - 32,32,32,32,32,32,32,32,78,114,0,0,0,0,41,1, - 218,9,90,105,112,82,101,97,100,101,114,41,4,114,43,0, - 0,0,114,3,0,0,0,90,17,105,109,112,111,114,116,108, - 105,98,46,114,101,97,100,101,114,115,114,83,0,0,0,41, - 3,114,32,0,0,0,114,38,0,0,0,114,83,0,0,0, + 32,32,32,32,114,0,0,0,0,78,41,1,114,41,0,0, + 0,41,3,114,32,0,0,0,114,38,0,0,0,114,13,0, + 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,218,11,102,105,110,100,95,109,111,100,117,108,101,144,0, + 0,0,115,4,0,0,0,16,11,255,128,122,23,122,105,112, + 105,109,112,111,114,116,101,114,46,102,105,110,100,95,109,111, + 100,117,108,101,99,3,0,0,0,0,0,0,0,0,0,0, + 0,7,0,0,0,5,0,0,0,67,0,0,0,115,108,0, + 0,0,116,0,124,0,124,1,131,2,125,3,124,3,100,1, + 117,1,114,34,116,1,106,2,124,1,124,0,124,3,100,2, + 141,3,83,0,116,3,124,0,124,1,131,2,125,4,116,4, + 124,0,124,4,131,2,114,104,124,0,106,5,155,0,116,6, + 155,0,124,4,155,0,157,3,125,5,116,1,106,7,124,1, + 100,1,100,3,100,4,141,3,125,6,124,6,106,8,160,9, + 124,5,161,1,1,0,124,6,83,0,100,1,83,0,41,5, + 122,107,67,114,101,97,116,101,32,97,32,77,111,100,117,108, + 101,83,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,78,111,110,101,32,105,102,32,116,104,101,32,109,111,100, + 117,108,101,32,99,97,110,110,111,116,32,98,101,32,102,111, + 117,110,100,46,10,32,32,32,32,32,32,32,32,78,41,1, + 218,10,105,115,95,112,97,99,107,97,103,101,84,41,3,218, + 4,110,97,109,101,90,6,108,111,97,100,101,114,114,43,0, + 0,0,41,10,114,35,0,0,0,218,10,95,98,111,111,116, + 115,116,114,97,112,90,16,115,112,101,99,95,102,114,111,109, + 95,108,111,97,100,101,114,114,36,0,0,0,114,37,0,0, + 0,114,29,0,0,0,114,20,0,0,0,90,10,77,111,100, + 117,108,101,83,112,101,99,90,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,114,24,0,0,0,41,7,114,32,0,0,0,114, + 38,0,0,0,90,6,116,97,114,103,101,116,90,11,109,111, + 100,117,108,101,95,105,110,102,111,114,40,0,0,0,114,13, + 0,0,0,90,4,115,112,101,99,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,9,102,105,110,100,95,115, + 112,101,99,157,0,0,0,115,26,0,0,0,10,5,8,1, + 16,1,10,7,10,1,18,4,8,1,2,1,6,255,12,2, + 4,1,4,2,255,128,122,21,122,105,112,105,109,112,111,114, + 116,101,114,46,102,105,110,100,95,115,112,101,99,99,2,0, + 0,0,0,0,0,0,0,0,0,0,5,0,0,0,3,0, + 0,0,67,0,0,0,115,20,0,0,0,116,0,124,0,124, + 1,131,2,92,3,125,2,125,3,125,4,124,2,83,0,41, + 2,122,166,103,101,116,95,99,111,100,101,40,102,117,108,108, + 110,97,109,101,41,32,45,62,32,99,111,100,101,32,111,98, + 106,101,99,116,46,10,10,32,32,32,32,32,32,32,32,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,115,112, + 101,99,105,102,105,101,100,32,109,111,100,117,108,101,46,32, + 82,97,105,115,101,32,90,105,112,73,109,112,111,114,116,69, + 114,114,111,114,10,32,32,32,32,32,32,32,32,105,102,32, + 116,104,101,32,109,111,100,117,108,101,32,99,111,117,108,100, + 110,39,116,32,98,101,32,105,109,112,111,114,116,101,100,46, + 10,32,32,32,32,32,32,32,32,78,169,1,218,16,95,103, + 101,116,95,109,111,100,117,108,101,95,99,111,100,101,169,5, + 114,32,0,0,0,114,38,0,0,0,218,4,99,111,100,101, + 218,9,105,115,112,97,99,107,97,103,101,114,40,0,0,0, 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, - 19,103,101,116,95,114,101,115,111,117,114,99,101,95,114,101, - 97,100,101,114,53,1,0,0,115,20,0,0,0,2,6,10, - 1,6,1,4,255,12,2,6,1,12,1,10,1,2,253,255, - 128,122,31,122,105,112,105,109,112,111,114,116,101,114,46,103, - 101,116,95,114,101,115,111,117,114,99,101,95,114,101,97,100, - 101,114,99,1,0,0,0,0,0,0,0,0,0,0,0,1, - 0,0,0,5,0,0,0,67,0,0,0,115,24,0,0,0, - 100,1,124,0,106,0,155,0,116,1,155,0,124,0,106,2, - 155,0,100,2,157,5,83,0,41,3,78,122,21,60,122,105, - 112,105,109,112,111,114,116,101,114,32,111,98,106,101,99,116, - 32,34,122,2,34,62,41,3,114,29,0,0,0,114,20,0, - 0,0,114,31,0,0,0,41,1,114,32,0,0,0,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,218,8,95, - 95,114,101,112,114,95,95,68,1,0,0,115,4,0,0,0, - 24,1,255,128,122,20,122,105,112,105,109,112,111,114,116,101, - 114,46,95,95,114,101,112,114,95,95,41,1,78,41,1,78, - 41,1,78,41,16,114,6,0,0,0,114,7,0,0,0,114, - 8,0,0,0,218,7,95,95,100,111,99,95,95,114,34,0, - 0,0,114,41,0,0,0,114,42,0,0,0,114,46,0,0, - 0,114,52,0,0,0,114,59,0,0,0,114,60,0,0,0, - 114,67,0,0,0,114,43,0,0,0,114,82,0,0,0,114, - 84,0,0,0,114,85,0,0,0,114,9,0,0,0,114,9, + 8,103,101,116,95,99,111,100,101,184,0,0,0,115,6,0, + 0,0,16,6,4,1,255,128,122,20,122,105,112,105,109,112, + 111,114,116,101,114,46,103,101,116,95,99,111,100,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,8, + 0,0,0,67,0,0,0,115,112,0,0,0,116,0,114,16, + 124,1,160,1,116,0,116,2,161,2,125,1,124,1,125,2, + 124,1,160,3,124,0,106,4,116,2,23,0,161,1,114,58, + 124,1,116,5,124,0,106,4,116,2,23,0,131,1,100,1, + 133,2,25,0,125,2,122,14,124,0,106,6,124,2,25,0, + 125,3,87,0,110,24,4,0,116,7,121,110,1,0,1,0, + 1,0,116,8,100,2,100,3,124,2,131,3,130,1,116,9, + 124,0,106,4,124,3,131,2,83,0,119,0,41,4,122,154, + 103,101,116,95,100,97,116,97,40,112,97,116,104,110,97,109, + 101,41,32,45,62,32,115,116,114,105,110,103,32,119,105,116, + 104,32,102,105,108,101,32,100,97,116,97,46,10,10,32,32, + 32,32,32,32,32,32,82,101,116,117,114,110,32,116,104,101, + 32,100,97,116,97,32,97,115,115,111,99,105,97,116,101,100, + 32,119,105,116,104,32,39,112,97,116,104,110,97,109,101,39, + 46,32,82,97,105,115,101,32,79,83,69,114,114,111,114,32, + 105,102,10,32,32,32,32,32,32,32,32,116,104,101,32,102, + 105,108,101,32,119,97,115,110,39,116,32,102,111,117,110,100, + 46,10,32,32,32,32,32,32,32,32,78,114,0,0,0,0, + 218,0,41,10,114,18,0,0,0,114,19,0,0,0,114,20, + 0,0,0,218,10,115,116,97,114,116,115,119,105,116,104,114, + 29,0,0,0,218,3,108,101,110,114,28,0,0,0,114,26, + 0,0,0,114,22,0,0,0,218,9,95,103,101,116,95,100, + 97,116,97,41,4,114,32,0,0,0,218,8,112,97,116,104, + 110,97,109,101,90,3,107,101,121,218,9,116,111,99,95,101, + 110,116,114,121,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,218,8,103,101,116,95,100,97,116,97,194,0,0, + 0,115,24,0,0,0,4,6,12,1,4,2,16,1,22,1, + 2,2,14,1,12,1,12,1,12,1,2,254,255,128,122,20, + 122,105,112,105,109,112,111,114,116,101,114,46,103,101,116,95, + 100,97,116,97,99,2,0,0,0,0,0,0,0,0,0,0, + 0,5,0,0,0,3,0,0,0,67,0,0,0,115,20,0, + 0,0,116,0,124,0,124,1,131,2,92,3,125,2,125,3, + 125,4,124,4,83,0,41,2,122,165,103,101,116,95,102,105, + 108,101,110,97,109,101,40,102,117,108,108,110,97,109,101,41, + 32,45,62,32,102,105,108,101,110,97,109,101,32,115,116,114, + 105,110,103,46,10,10,32,32,32,32,32,32,32,32,82,101, + 116,117,114,110,32,116,104,101,32,102,105,108,101,110,97,109, + 101,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102, + 105,101,100,32,109,111,100,117,108,101,32,111,114,32,114,97, + 105,115,101,32,90,105,112,73,109,112,111,114,116,69,114,114, + 111,114,10,32,32,32,32,32,32,32,32,105,102,32,105,116, + 32,99,111,117,108,100,110,39,116,32,98,101,32,105,109,112, + 111,114,116,101,100,46,10,32,32,32,32,32,32,32,32,78, + 114,47,0,0,0,114,49,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,218,12,103,101,116,95,102, + 105,108,101,110,97,109,101,215,0,0,0,115,6,0,0,0, + 16,8,4,1,255,128,122,24,122,105,112,105,109,112,111,114, + 116,101,114,46,103,101,116,95,102,105,108,101,110,97,109,101, + 99,2,0,0,0,0,0,0,0,0,0,0,0,6,0,0, + 0,8,0,0,0,67,0,0,0,115,126,0,0,0,116,0, + 124,0,124,1,131,2,125,2,124,2,100,1,117,0,114,36, + 116,1,100,2,124,1,155,2,157,2,124,1,100,3,141,2, + 130,1,116,2,124,0,124,1,131,2,125,3,124,2,114,64, + 116,3,160,4,124,3,100,4,161,2,125,4,110,10,124,3, + 155,0,100,5,157,2,125,4,122,14,124,0,106,5,124,4, + 25,0,125,5,87,0,110,18,4,0,116,6,121,124,1,0, + 1,0,1,0,89,0,100,1,83,0,116,7,124,0,106,8, + 124,5,131,2,160,9,161,0,83,0,119,0,41,6,122,253, + 103,101,116,95,115,111,117,114,99,101,40,102,117,108,108,110, + 97,109,101,41,32,45,62,32,115,111,117,114,99,101,32,115, + 116,114,105,110,103,46,10,10,32,32,32,32,32,32,32,32, + 82,101,116,117,114,110,32,116,104,101,32,115,111,117,114,99, + 101,32,99,111,100,101,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, + 32,82,97,105,115,101,32,90,105,112,73,109,112,111,114,116, + 69,114,114,111,114,10,32,32,32,32,32,32,32,32,105,102, + 32,116,104,101,32,109,111,100,117,108,101,32,99,111,117,108, + 100,110,39,116,32,98,101,32,102,111,117,110,100,44,32,114, + 101,116,117,114,110,32,78,111,110,101,32,105,102,32,116,104, + 101,32,97,114,99,104,105,118,101,32,100,111,101,115,10,32, + 32,32,32,32,32,32,32,99,111,110,116,97,105,110,32,116, + 104,101,32,109,111,100,117,108,101,44,32,98,117,116,32,104, + 97,115,32,110,111,32,115,111,117,114,99,101,32,102,111,114, + 32,105,116,46,10,32,32,32,32,32,32,32,32,78,250,18, + 99,97,110,39,116,32,102,105,110,100,32,109,111,100,117,108, + 101,32,169,1,114,44,0,0,0,250,11,95,95,105,110,105, + 116,95,95,46,112,121,250,3,46,112,121,41,10,114,35,0, + 0,0,114,3,0,0,0,114,36,0,0,0,114,21,0,0, + 0,114,30,0,0,0,114,28,0,0,0,114,26,0,0,0, + 114,56,0,0,0,114,29,0,0,0,218,6,100,101,99,111, + 100,101,41,6,114,32,0,0,0,114,38,0,0,0,114,39, + 0,0,0,114,13,0,0,0,218,8,102,117,108,108,112,97, + 116,104,114,58,0,0,0,114,9,0,0,0,114,9,0,0, + 0,114,10,0,0,0,218,10,103,101,116,95,115,111,117,114, + 99,101,227,0,0,0,115,28,0,0,0,10,7,8,1,18, + 1,10,2,4,1,14,1,10,2,2,2,14,1,12,1,6, + 2,16,1,2,253,255,128,122,22,122,105,112,105,109,112,111, + 114,116,101,114,46,103,101,116,95,115,111,117,114,99,101,99, + 2,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, + 4,0,0,0,67,0,0,0,115,40,0,0,0,116,0,124, + 0,124,1,131,2,125,2,124,2,100,1,117,0,114,36,116, + 1,100,2,124,1,155,2,157,2,124,1,100,3,141,2,130, + 1,124,2,83,0,41,4,122,171,105,115,95,112,97,99,107, + 97,103,101,40,102,117,108,108,110,97,109,101,41,32,45,62, + 32,98,111,111,108,46,10,10,32,32,32,32,32,32,32,32, + 82,101,116,117,114,110,32,84,114,117,101,32,105,102,32,116, + 104,101,32,109,111,100,117,108,101,32,115,112,101,99,105,102, + 105,101,100,32,98,121,32,102,117,108,108,110,97,109,101,32, + 105,115,32,97,32,112,97,99,107,97,103,101,46,10,32,32, + 32,32,32,32,32,32,82,97,105,115,101,32,90,105,112,73, + 109,112,111,114,116,69,114,114,111,114,32,105,102,32,116,104, + 101,32,109,111,100,117,108,101,32,99,111,117,108,100,110,39, + 116,32,98,101,32,102,111,117,110,100,46,10,32,32,32,32, + 32,32,32,32,78,114,61,0,0,0,114,62,0,0,0,41, + 2,114,35,0,0,0,114,3,0,0,0,41,3,114,32,0, + 0,0,114,38,0,0,0,114,39,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,114,43,0,0,0, + 253,0,0,0,115,10,0,0,0,10,6,8,1,18,1,4, + 1,255,128,122,22,122,105,112,105,109,112,111,114,116,101,114, + 46,105,115,95,112,97,99,107,97,103,101,99,2,0,0,0, + 0,0,0,0,0,0,0,0,9,0,0,0,8,0,0,0, + 67,0,0,0,115,252,0,0,0,100,1,125,2,116,0,160, + 1,124,2,116,2,161,2,1,0,116,3,124,0,124,1,131, + 2,92,3,125,3,125,4,125,5,116,4,106,5,160,6,124, + 1,161,1,125,6,124,6,100,2,117,0,115,62,116,7,124, + 6,116,8,131,2,115,80,116,8,124,1,131,1,125,6,124, + 6,116,4,106,5,124,1,60,0,124,0,124,6,95,9,122, + 84,124,4,114,124,116,10,124,0,124,1,131,2,125,7,116, + 11,160,12,124,0,106,13,124,7,161,2,125,8,124,8,103, + 1,124,6,95,14,116,15,124,6,100,3,131,2,115,140,116, + 16,124,6,95,16,116,11,160,17,124,6,106,18,124,1,124, + 5,161,3,1,0,116,19,124,3,124,6,106,18,131,2,1, + 0,87,0,110,16,1,0,1,0,1,0,116,4,106,5,124, + 1,61,0,130,0,122,14,116,4,106,5,124,1,25,0,125, + 6,87,0,110,28,4,0,116,20,121,250,1,0,1,0,1, + 0,116,21,100,4,124,1,155,2,100,5,157,3,131,1,130, + 1,116,22,160,23,100,6,124,1,124,5,161,3,1,0,124, + 6,83,0,119,0,41,7,97,64,1,0,0,108,111,97,100, + 95,109,111,100,117,108,101,40,102,117,108,108,110,97,109,101, + 41,32,45,62,32,109,111,100,117,108,101,46,10,10,32,32, + 32,32,32,32,32,32,76,111,97,100,32,116,104,101,32,109, + 111,100,117,108,101,32,115,112,101,99,105,102,105,101,100,32, + 98,121,32,39,102,117,108,108,110,97,109,101,39,46,32,39, + 102,117,108,108,110,97,109,101,39,32,109,117,115,116,32,98, + 101,32,116,104,101,10,32,32,32,32,32,32,32,32,102,117, + 108,108,121,32,113,117,97,108,105,102,105,101,100,32,40,100, + 111,116,116,101,100,41,32,109,111,100,117,108,101,32,110,97, + 109,101,46,32,73,116,32,114,101,116,117,114,110,115,32,116, + 104,101,32,105,109,112,111,114,116,101,100,10,32,32,32,32, + 32,32,32,32,109,111,100,117,108,101,44,32,111,114,32,114, + 97,105,115,101,115,32,90,105,112,73,109,112,111,114,116,69, + 114,114,111,114,32,105,102,32,105,116,32,99,111,117,108,100, + 32,110,111,116,32,98,101,32,105,109,112,111,114,116,101,100, + 46,10,10,32,32,32,32,32,32,32,32,68,101,112,114,101, + 99,97,116,101,100,32,115,105,110,99,101,32,80,121,116,104, + 111,110,32,51,46,49,48,46,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,32,32,32,32,32,32,32,32,122,114,122,105, + 112,105,109,112,111,114,116,46,122,105,112,105,109,112,111,114, + 116,101,114,46,108,111,97,100,95,109,111,100,117,108,101,40, + 41,32,105,115,32,100,101,112,114,101,99,97,116,101,100,32, + 97,110,100,32,115,108,97,116,101,100,32,102,111,114,32,114, + 101,109,111,118,97,108,32,105,110,32,80,121,116,104,111,110, + 32,51,46,49,50,59,32,117,115,101,32,101,120,101,99,95, + 109,111,100,117,108,101,40,41,32,105,110,115,116,101,97,100, + 78,218,12,95,95,98,117,105,108,116,105,110,115,95,95,122, + 14,76,111,97,100,101,100,32,109,111,100,117,108,101,32,122, + 25,32,110,111,116,32,102,111,117,110,100,32,105,110,32,115, + 121,115,46,109,111,100,117,108,101,115,122,30,105,109,112,111, + 114,116,32,123,125,32,35,32,108,111,97,100,101,100,32,102, + 114,111,109,32,90,105,112,32,123,125,41,24,218,9,95,119, + 97,114,110,105,110,103,115,90,4,119,97,114,110,218,18,68, + 101,112,114,101,99,97,116,105,111,110,87,97,114,110,105,110, + 103,114,48,0,0,0,218,3,115,121,115,218,7,109,111,100, + 117,108,101,115,218,3,103,101,116,114,15,0,0,0,218,12, + 95,109,111,100,117,108,101,95,116,121,112,101,218,10,95,95, + 108,111,97,100,101,114,95,95,114,36,0,0,0,114,21,0, + 0,0,114,30,0,0,0,114,29,0,0,0,90,8,95,95, + 112,97,116,104,95,95,218,7,104,97,115,97,116,116,114,114, + 68,0,0,0,90,14,95,102,105,120,95,117,112,95,109,111, + 100,117,108,101,218,8,95,95,100,105,99,116,95,95,218,4, + 101,120,101,99,114,26,0,0,0,218,11,73,109,112,111,114, + 116,69,114,114,111,114,114,45,0,0,0,218,16,95,118,101, + 114,98,111,115,101,95,109,101,115,115,97,103,101,41,9,114, + 32,0,0,0,114,38,0,0,0,218,3,109,115,103,114,50, + 0,0,0,114,51,0,0,0,114,40,0,0,0,90,3,109, + 111,100,114,13,0,0,0,114,66,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,218,11,108,111,97, + 100,95,109,111,100,117,108,101,10,1,0,0,115,56,0,0, + 0,4,9,12,2,16,1,12,1,18,1,8,1,10,1,6, + 1,2,2,4,1,10,3,14,1,8,1,10,2,6,1,16, + 1,16,1,6,1,8,1,2,1,2,2,14,1,12,1,16, + 1,14,1,4,1,2,253,255,128,122,23,122,105,112,105,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,0,0,0,0,3, + 0,0,0,8,0,0,0,67,0,0,0,115,64,0,0,0, + 122,20,124,0,160,0,124,1,161,1,115,18,87,0,100,1, + 83,0,87,0,110,18,4,0,116,1,121,62,1,0,1,0, + 1,0,89,0,100,1,83,0,100,2,100,3,108,2,109,3, + 125,2,1,0,124,2,124,0,124,1,131,2,83,0,119,0, + 41,4,122,204,82,101,116,117,114,110,32,116,104,101,32,82, + 101,115,111,117,114,99,101,82,101,97,100,101,114,32,102,111, + 114,32,97,32,112,97,99,107,97,103,101,32,105,110,32,97, + 32,122,105,112,32,102,105,108,101,46,10,10,32,32,32,32, + 32,32,32,32,73,102,32,39,102,117,108,108,110,97,109,101, + 39,32,105,115,32,97,32,112,97,99,107,97,103,101,32,119, + 105,116,104,105,110,32,116,104,101,32,122,105,112,32,102,105, + 108,101,44,32,114,101,116,117,114,110,32,116,104,101,10,32, + 32,32,32,32,32,32,32,39,82,101,115,111,117,114,99,101, + 82,101,97,100,101,114,39,32,111,98,106,101,99,116,32,102, + 111,114,32,116,104,101,32,112,97,99,107,97,103,101,46,32, + 32,79,116,104,101,114,119,105,115,101,32,114,101,116,117,114, + 110,32,78,111,110,101,46,10,32,32,32,32,32,32,32,32, + 78,114,0,0,0,0,41,1,218,9,90,105,112,82,101,97, + 100,101,114,41,4,114,43,0,0,0,114,3,0,0,0,90, + 17,105,109,112,111,114,116,108,105,98,46,114,101,97,100,101, + 114,115,114,83,0,0,0,41,3,114,32,0,0,0,114,38, + 0,0,0,114,83,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,19,103,101,116,95,114,101,115, + 111,117,114,99,101,95,114,101,97,100,101,114,53,1,0,0, + 115,20,0,0,0,2,6,10,1,6,1,4,255,12,2,6, + 1,12,1,10,1,2,253,255,128,122,31,122,105,112,105,109, + 112,111,114,116,101,114,46,103,101,116,95,114,101,115,111,117, + 114,99,101,95,114,101,97,100,101,114,99,1,0,0,0,0, + 0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,67, + 0,0,0,115,72,0,0,0,122,30,116,0,124,0,106,1, + 131,1,124,0,95,2,124,0,106,2,116,3,124,0,106,1, + 60,0,87,0,100,1,83,0,4,0,116,4,121,70,1,0, + 1,0,1,0,116,3,160,5,124,0,106,1,100,1,161,2, + 1,0,100,1,124,0,95,2,89,0,100,1,83,0,119,0, + 41,2,122,41,82,101,108,111,97,100,32,116,104,101,32,102, + 105,108,101,32,100,97,116,97,32,111,102,32,116,104,101,32, + 97,114,99,104,105,118,101,32,112,97,116,104,46,78,41,6, + 114,27,0,0,0,114,29,0,0,0,114,28,0,0,0,114, + 25,0,0,0,114,3,0,0,0,218,3,112,111,112,169,1, + 114,32,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,218,17,105,110,118,97,108,105,100,97,116,101, + 95,99,97,99,104,101,115,68,1,0,0,115,16,0,0,0, + 2,2,12,1,18,1,12,1,14,1,12,1,2,254,255,128, + 122,29,122,105,112,105,109,112,111,114,116,101,114,46,105,110, + 118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,99, + 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, + 5,0,0,0,67,0,0,0,115,24,0,0,0,100,1,124, + 0,106,0,155,0,116,1,155,0,124,0,106,2,155,0,100, + 2,157,5,83,0,41,3,78,122,21,60,122,105,112,105,109, + 112,111,114,116,101,114,32,111,98,106,101,99,116,32,34,122, + 2,34,62,41,3,114,29,0,0,0,114,20,0,0,0,114, + 31,0,0,0,114,86,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,8,95,95,114,101,112,114, + 95,95,78,1,0,0,115,4,0,0,0,24,1,255,128,122, + 20,122,105,112,105,109,112,111,114,116,101,114,46,95,95,114, + 101,112,114,95,95,41,1,78,41,1,78,41,1,78,41,17, + 114,6,0,0,0,114,7,0,0,0,114,8,0,0,0,218, + 7,95,95,100,111,99,95,95,114,34,0,0,0,114,41,0, + 0,0,114,42,0,0,0,114,46,0,0,0,114,52,0,0, + 0,114,59,0,0,0,114,60,0,0,0,114,67,0,0,0, + 114,43,0,0,0,114,82,0,0,0,114,84,0,0,0,114, + 87,0,0,0,114,88,0,0,0,114,9,0,0,0,114,9, 0,0,0,114,9,0,0,0,114,10,0,0,0,114,4,0, - 0,0,46,0,0,0,115,30,0,0,0,8,0,4,1,8, + 0,0,46,0,0,0,115,32,0,0,0,8,0,4,1,8, 17,10,46,10,34,10,13,8,27,8,10,8,21,8,12,8, - 26,8,13,8,43,12,15,255,128,122,12,95,95,105,110,105, - 116,95,95,46,112,121,99,84,114,63,0,0,0,70,41,3, - 122,4,46,112,121,99,84,70,41,3,114,64,0,0,0,70, - 70,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,67,0,0,0,115,20,0,0,0,124, - 0,106,0,124,1,160,1,100,1,161,1,100,2,25,0,23, - 0,83,0,41,3,78,218,1,46,233,2,0,0,0,41,2, - 114,31,0,0,0,218,10,114,112,97,114,116,105,116,105,111, - 110,41,2,114,32,0,0,0,114,38,0,0,0,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,114,36,0,0, - 0,86,1,0,0,115,4,0,0,0,20,1,255,128,114,36, - 0,0,0,99,2,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,2,0,0,0,67,0,0,0,115,18,0,0, - 0,124,1,116,0,23,0,125,2,124,2,124,0,106,1,118, - 0,83,0,169,1,78,41,2,114,20,0,0,0,114,28,0, - 0,0,41,3,114,32,0,0,0,114,13,0,0,0,90,7, - 100,105,114,112,97,116,104,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,114,37,0,0,0,90,1,0,0,115, - 6,0,0,0,8,4,10,2,255,128,114,37,0,0,0,99, - 2,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0, - 4,0,0,0,67,0,0,0,115,56,0,0,0,116,0,124, - 0,124,1,131,2,125,2,116,1,68,0,93,36,92,3,125, - 3,125,4,125,5,124,2,124,3,23,0,125,6,124,6,124, - 0,106,2,118,0,114,50,124,5,2,0,1,0,83,0,113, - 14,100,0,83,0,114,90,0,0,0,41,3,114,36,0,0, - 0,218,16,95,122,105,112,95,115,101,97,114,99,104,111,114, - 100,101,114,114,28,0,0,0,41,7,114,32,0,0,0,114, - 38,0,0,0,114,13,0,0,0,218,6,115,117,102,102,105, - 120,218,10,105,115,98,121,116,101,99,111,100,101,114,51,0, - 0,0,114,66,0,0,0,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,114,35,0,0,0,99,1,0,0,115, - 16,0,0,0,10,1,14,1,8,1,10,1,8,1,2,255, - 4,2,255,128,114,35,0,0,0,99,1,0,0,0,0,0, - 0,0,0,0,0,0,26,0,0,0,9,0,0,0,67,0, - 0,0,115,236,4,0,0,122,14,116,0,160,1,124,0,161, - 1,125,1,87,0,110,32,4,0,116,2,144,4,121,234,1, - 0,1,0,1,0,116,3,100,1,124,0,155,2,157,2,124, - 0,100,2,141,2,130,1,124,1,144,4,143,130,1,0,122, - 36,124,1,160,4,116,5,11,0,100,3,161,2,1,0,124, - 1,160,6,161,0,125,2,124,1,160,7,116,5,161,1,125, - 3,87,0,110,32,4,0,116,2,144,4,121,232,1,0,1, - 0,1,0,116,3,100,4,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,116,8,124,3,131,1,116,5,107,3,114, - 156,116,3,100,4,124,0,155,2,157,2,124,0,100,2,141, - 2,130,1,124,3,100,0,100,5,133,2,25,0,116,9,107, - 3,144,1,114,152,122,24,124,1,160,4,100,6,100,3,161, - 2,1,0,124,1,160,6,161,0,125,4,87,0,110,32,4, - 0,116,2,144,4,121,230,1,0,1,0,1,0,116,3,100, - 4,124,0,155,2,157,2,124,0,100,2,141,2,130,1,116, - 10,124,4,116,11,24,0,116,5,24,0,100,6,131,2,125, - 5,122,22,124,1,160,4,124,5,161,1,1,0,124,1,160, - 7,161,0,125,6,87,0,110,32,4,0,116,2,144,4,121, - 228,1,0,1,0,1,0,116,3,100,4,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,124,6,160,12,116,9,161, - 1,125,7,124,7,100,6,107,0,144,1,114,88,116,3,100, - 7,124,0,155,2,157,2,124,0,100,2,141,2,130,1,124, - 6,124,7,124,7,116,5,23,0,133,2,25,0,125,3,116, - 8,124,3,131,1,116,5,107,3,144,1,114,136,116,3,100, - 8,124,0,155,2,157,2,124,0,100,2,141,2,130,1,124, - 4,116,8,124,6,131,1,24,0,124,7,23,0,125,2,116, - 13,124,3,100,9,100,10,133,2,25,0,131,1,125,8,116, - 13,124,3,100,10,100,11,133,2,25,0,131,1,125,9,124, - 2,124,8,107,0,144,1,114,212,116,3,100,12,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,124,2,124,9,107, - 0,144,1,114,240,116,3,100,13,124,0,155,2,157,2,124, - 0,100,2,141,2,130,1,124,2,124,8,56,0,125,2,124, - 2,124,9,24,0,125,10,124,10,100,6,107,0,144,2,114, - 28,116,3,100,14,124,0,155,2,157,2,124,0,100,2,141, - 2,130,1,105,0,125,11,100,6,125,12,122,14,124,1,160, - 4,124,2,161,1,1,0,87,0,110,32,4,0,116,2,144, - 4,121,226,1,0,1,0,1,0,116,3,100,4,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,9,0,124,1,160, - 7,100,16,161,1,125,3,116,8,124,3,131,1,100,5,107, - 0,144,2,114,118,116,14,100,17,131,1,130,1,124,3,100, - 0,100,5,133,2,25,0,100,18,107,3,144,2,114,140,144, - 4,113,170,116,8,124,3,131,1,100,16,107,3,144,2,114, - 162,116,14,100,17,131,1,130,1,116,15,124,3,100,19,100, - 20,133,2,25,0,131,1,125,13,116,15,124,3,100,20,100, - 9,133,2,25,0,131,1,125,14,116,15,124,3,100,9,100, - 21,133,2,25,0,131,1,125,15,116,15,124,3,100,21,100, - 10,133,2,25,0,131,1,125,16,116,13,124,3,100,10,100, - 11,133,2,25,0,131,1,125,17,116,13,124,3,100,11,100, - 22,133,2,25,0,131,1,125,18,116,13,124,3,100,22,100, - 23,133,2,25,0,131,1,125,4,116,15,124,3,100,23,100, - 24,133,2,25,0,131,1,125,19,116,15,124,3,100,24,100, - 25,133,2,25,0,131,1,125,20,116,15,124,3,100,25,100, - 26,133,2,25,0,131,1,125,21,116,13,124,3,100,27,100, - 16,133,2,25,0,131,1,125,22,124,19,124,20,23,0,124, - 21,23,0,125,8,124,22,124,9,107,4,144,3,114,122,116, - 3,100,28,124,0,155,2,157,2,124,0,100,2,141,2,130, - 1,124,22,124,10,55,0,125,22,122,14,124,1,160,7,124, - 19,161,1,125,23,87,0,110,32,4,0,116,2,144,4,121, - 224,1,0,1,0,1,0,116,3,100,4,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,116,8,124,23,131,1,124, - 19,107,3,144,3,114,210,116,3,100,4,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,122,50,116,8,124,1,160, - 7,124,8,124,19,24,0,161,1,131,1,124,8,124,19,24, - 0,107,3,144,4,114,2,116,3,100,4,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,87,0,110,32,4,0,116, - 2,144,4,121,222,1,0,1,0,1,0,116,3,100,4,124, - 0,155,2,157,2,124,0,100,2,141,2,130,1,124,13,100, - 29,64,0,144,4,114,58,124,23,160,16,161,0,125,23,110, - 48,122,14,124,23,160,16,100,30,161,1,125,23,87,0,110, - 32,4,0,116,17,144,4,121,220,1,0,1,0,1,0,124, - 23,160,16,100,31,161,1,160,18,116,19,161,1,125,23,89, - 0,124,23,160,20,100,32,116,21,161,2,125,23,116,22,160, - 23,124,0,124,23,161,2,125,24,124,24,124,14,124,18,124, - 4,124,22,124,15,124,16,124,17,102,8,125,25,124,25,124, - 11,124,23,60,0,124,12,100,33,55,0,125,12,144,2,113, - 86,87,0,100,0,4,0,4,0,131,3,1,0,110,18,49, - 0,144,4,115,192,119,1,1,0,1,0,1,0,89,0,1, - 0,116,24,160,25,100,34,124,12,124,0,161,3,1,0,124, - 11,83,0,119,0,119,0,119,0,119,0,119,0,119,0,119, - 0,119,0,41,35,78,122,21,99,97,110,39,116,32,111,112, - 101,110,32,90,105,112,32,102,105,108,101,58,32,114,12,0, - 0,0,114,88,0,0,0,250,21,99,97,110,39,116,32,114, - 101,97,100,32,90,105,112,32,102,105,108,101,58,32,233,4, - 0,0,0,114,0,0,0,0,122,16,110,111,116,32,97,32, - 90,105,112,32,102,105,108,101,58,32,122,18,99,111,114,114, - 117,112,116,32,90,105,112,32,102,105,108,101,58,32,233,12, - 0,0,0,233,16,0,0,0,233,20,0,0,0,122,28,98, + 26,8,13,8,43,8,15,12,10,255,128,122,12,95,95,105, + 110,105,116,95,95,46,112,121,99,84,114,63,0,0,0,70, + 41,3,122,4,46,112,121,99,84,70,41,3,114,64,0,0, + 0,70,70,99,2,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,4,0,0,0,67,0,0,0,115,20,0,0, + 0,124,0,106,0,124,1,160,1,100,1,161,1,100,2,25, + 0,23,0,83,0,41,3,78,218,1,46,233,2,0,0,0, + 41,2,114,31,0,0,0,218,10,114,112,97,114,116,105,116, + 105,111,110,41,2,114,32,0,0,0,114,38,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,36, + 0,0,0,96,1,0,0,115,4,0,0,0,20,1,255,128, + 114,36,0,0,0,99,2,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,2,0,0,0,67,0,0,0,115,18, + 0,0,0,124,1,116,0,23,0,125,2,124,2,124,0,106, + 1,118,0,83,0,169,1,78,41,2,114,20,0,0,0,114, + 28,0,0,0,41,3,114,32,0,0,0,114,13,0,0,0, + 90,7,100,105,114,112,97,116,104,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,37,0,0,0,100,1,0, + 0,115,6,0,0,0,8,4,10,2,255,128,114,37,0,0, + 0,99,2,0,0,0,0,0,0,0,0,0,0,0,7,0, + 0,0,4,0,0,0,67,0,0,0,115,56,0,0,0,116, + 0,124,0,124,1,131,2,125,2,116,1,68,0,93,36,92, + 3,125,3,125,4,125,5,124,2,124,3,23,0,125,6,124, + 6,124,0,106,2,118,0,114,50,124,5,2,0,1,0,83, + 0,113,14,100,0,83,0,114,93,0,0,0,41,3,114,36, + 0,0,0,218,16,95,122,105,112,95,115,101,97,114,99,104, + 111,114,100,101,114,114,28,0,0,0,41,7,114,32,0,0, + 0,114,38,0,0,0,114,13,0,0,0,218,6,115,117,102, + 102,105,120,218,10,105,115,98,121,116,101,99,111,100,101,114, + 51,0,0,0,114,66,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,35,0,0,0,109,1,0, + 0,115,16,0,0,0,10,1,14,1,8,1,10,1,8,1, + 2,255,4,2,255,128,114,35,0,0,0,99,1,0,0,0, + 0,0,0,0,0,0,0,0,26,0,0,0,9,0,0,0, + 67,0,0,0,115,236,4,0,0,122,14,116,0,160,1,124, + 0,161,1,125,1,87,0,110,32,4,0,116,2,144,4,121, + 234,1,0,1,0,1,0,116,3,100,1,124,0,155,2,157, + 2,124,0,100,2,141,2,130,1,124,1,144,4,143,130,1, + 0,122,36,124,1,160,4,116,5,11,0,100,3,161,2,1, + 0,124,1,160,6,161,0,125,2,124,1,160,7,116,5,161, + 1,125,3,87,0,110,32,4,0,116,2,144,4,121,232,1, + 0,1,0,1,0,116,3,100,4,124,0,155,2,157,2,124, + 0,100,2,141,2,130,1,116,8,124,3,131,1,116,5,107, + 3,114,156,116,3,100,4,124,0,155,2,157,2,124,0,100, + 2,141,2,130,1,124,3,100,0,100,5,133,2,25,0,116, + 9,107,3,144,1,114,152,122,24,124,1,160,4,100,6,100, + 3,161,2,1,0,124,1,160,6,161,0,125,4,87,0,110, + 32,4,0,116,2,144,4,121,230,1,0,1,0,1,0,116, + 3,100,4,124,0,155,2,157,2,124,0,100,2,141,2,130, + 1,116,10,124,4,116,11,24,0,116,5,24,0,100,6,131, + 2,125,5,122,22,124,1,160,4,124,5,161,1,1,0,124, + 1,160,7,161,0,125,6,87,0,110,32,4,0,116,2,144, + 4,121,228,1,0,1,0,1,0,116,3,100,4,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,124,6,160,12,116, + 9,161,1,125,7,124,7,100,6,107,0,144,1,114,88,116, + 3,100,7,124,0,155,2,157,2,124,0,100,2,141,2,130, + 1,124,6,124,7,124,7,116,5,23,0,133,2,25,0,125, + 3,116,8,124,3,131,1,116,5,107,3,144,1,114,136,116, + 3,100,8,124,0,155,2,157,2,124,0,100,2,141,2,130, + 1,124,4,116,8,124,6,131,1,24,0,124,7,23,0,125, + 2,116,13,124,3,100,9,100,10,133,2,25,0,131,1,125, + 8,116,13,124,3,100,10,100,11,133,2,25,0,131,1,125, + 9,124,2,124,8,107,0,144,1,114,212,116,3,100,12,124, + 0,155,2,157,2,124,0,100,2,141,2,130,1,124,2,124, + 9,107,0,144,1,114,240,116,3,100,13,124,0,155,2,157, + 2,124,0,100,2,141,2,130,1,124,2,124,8,56,0,125, + 2,124,2,124,9,24,0,125,10,124,10,100,6,107,0,144, + 2,114,28,116,3,100,14,124,0,155,2,157,2,124,0,100, + 2,141,2,130,1,105,0,125,11,100,6,125,12,122,14,124, + 1,160,4,124,2,161,1,1,0,87,0,110,32,4,0,116, + 2,144,4,121,226,1,0,1,0,1,0,116,3,100,4,124, + 0,155,2,157,2,124,0,100,2,141,2,130,1,9,0,124, + 1,160,7,100,16,161,1,125,3,116,8,124,3,131,1,100, + 5,107,0,144,2,114,118,116,14,100,17,131,1,130,1,124, + 3,100,0,100,5,133,2,25,0,100,18,107,3,144,2,114, + 140,144,4,113,170,116,8,124,3,131,1,100,16,107,3,144, + 2,114,162,116,14,100,17,131,1,130,1,116,15,124,3,100, + 19,100,20,133,2,25,0,131,1,125,13,116,15,124,3,100, + 20,100,9,133,2,25,0,131,1,125,14,116,15,124,3,100, + 9,100,21,133,2,25,0,131,1,125,15,116,15,124,3,100, + 21,100,10,133,2,25,0,131,1,125,16,116,13,124,3,100, + 10,100,11,133,2,25,0,131,1,125,17,116,13,124,3,100, + 11,100,22,133,2,25,0,131,1,125,18,116,13,124,3,100, + 22,100,23,133,2,25,0,131,1,125,4,116,15,124,3,100, + 23,100,24,133,2,25,0,131,1,125,19,116,15,124,3,100, + 24,100,25,133,2,25,0,131,1,125,20,116,15,124,3,100, + 25,100,26,133,2,25,0,131,1,125,21,116,13,124,3,100, + 27,100,16,133,2,25,0,131,1,125,22,124,19,124,20,23, + 0,124,21,23,0,125,8,124,22,124,9,107,4,144,3,114, + 122,116,3,100,28,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,124,22,124,10,55,0,125,22,122,14,124,1,160, + 7,124,19,161,1,125,23,87,0,110,32,4,0,116,2,144, + 4,121,224,1,0,1,0,1,0,116,3,100,4,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,116,8,124,23,131, + 1,124,19,107,3,144,3,114,210,116,3,100,4,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,122,50,116,8,124, + 1,160,7,124,8,124,19,24,0,161,1,131,1,124,8,124, + 19,24,0,107,3,144,4,114,2,116,3,100,4,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,87,0,110,32,4, + 0,116,2,144,4,121,222,1,0,1,0,1,0,116,3,100, + 4,124,0,155,2,157,2,124,0,100,2,141,2,130,1,124, + 13,100,29,64,0,144,4,114,58,124,23,160,16,161,0,125, + 23,110,48,122,14,124,23,160,16,100,30,161,1,125,23,87, + 0,110,32,4,0,116,17,144,4,121,220,1,0,1,0,1, + 0,124,23,160,16,100,31,161,1,160,18,116,19,161,1,125, + 23,89,0,124,23,160,20,100,32,116,21,161,2,125,23,116, + 22,160,23,124,0,124,23,161,2,125,24,124,24,124,14,124, + 18,124,4,124,22,124,15,124,16,124,17,102,8,125,25,124, + 25,124,11,124,23,60,0,124,12,100,33,55,0,125,12,144, + 2,113,86,87,0,100,0,4,0,4,0,131,3,1,0,110, + 18,49,0,144,4,115,192,119,1,1,0,1,0,1,0,89, + 0,1,0,116,24,160,25,100,34,124,12,124,0,161,3,1, + 0,124,11,83,0,119,0,119,0,119,0,119,0,119,0,119, + 0,119,0,119,0,41,35,78,122,21,99,97,110,39,116,32, + 111,112,101,110,32,90,105,112,32,102,105,108,101,58,32,114, + 12,0,0,0,114,91,0,0,0,250,21,99,97,110,39,116, + 32,114,101,97,100,32,90,105,112,32,102,105,108,101,58,32, + 233,4,0,0,0,114,0,0,0,0,122,16,110,111,116,32, + 97,32,90,105,112,32,102,105,108,101,58,32,122,18,99,111, + 114,114,117,112,116,32,90,105,112,32,102,105,108,101,58,32, + 233,12,0,0,0,233,16,0,0,0,233,20,0,0,0,122, + 28,98,97,100,32,99,101,110,116,114,97,108,32,100,105,114, + 101,99,116,111,114,121,32,115,105,122,101,58,32,122,30,98, + 97,100,32,99,101,110,116,114,97,108,32,100,105,114,101,99, + 116,111,114,121,32,111,102,102,115,101,116,58,32,122,38,98, 97,100,32,99,101,110,116,114,97,108,32,100,105,114,101,99, - 116,111,114,121,32,115,105,122,101,58,32,122,30,98,97,100, - 32,99,101,110,116,114,97,108,32,100,105,114,101,99,116,111, - 114,121,32,111,102,102,115,101,116,58,32,122,38,98,97,100, - 32,99,101,110,116,114,97,108,32,100,105,114,101,99,116,111, - 114,121,32,115,105,122,101,32,111,114,32,111,102,102,115,101, - 116,58,32,84,233,46,0,0,0,250,27,69,79,70,32,114, - 101,97,100,32,119,104,101,114,101,32,110,111,116,32,101,120, - 112,101,99,116,101,100,115,4,0,0,0,80,75,1,2,233, - 8,0,0,0,233,10,0,0,0,233,14,0,0,0,233,24, - 0,0,0,233,28,0,0,0,233,30,0,0,0,233,32,0, - 0,0,233,34,0,0,0,233,42,0,0,0,122,25,98,97, - 100,32,108,111,99,97,108,32,104,101,97,100,101,114,32,111, - 102,102,115,101,116,58,32,105,0,8,0,0,218,5,97,115, - 99,105,105,90,6,108,97,116,105,110,49,250,1,47,114,5, - 0,0,0,122,33,122,105,112,105,109,112,111,114,116,58,32, - 102,111,117,110,100,32,123,125,32,110,97,109,101,115,32,105, - 110,32,123,33,114,125,41,26,218,3,95,105,111,218,9,111, - 112,101,110,95,99,111,100,101,114,22,0,0,0,114,3,0, - 0,0,218,4,115,101,101,107,218,20,69,78,68,95,67,69, - 78,84,82,65,76,95,68,73,82,95,83,73,90,69,90,4, - 116,101,108,108,218,4,114,101,97,100,114,55,0,0,0,218, - 18,83,84,82,73,78,71,95,69,78,68,95,65,82,67,72, - 73,86,69,218,3,109,97,120,218,15,77,65,88,95,67,79, - 77,77,69,78,84,95,76,69,78,218,5,114,102,105,110,100, - 114,2,0,0,0,218,8,69,79,70,69,114,114,111,114,114, - 1,0,0,0,114,65,0,0,0,218,18,85,110,105,99,111, - 100,101,68,101,99,111,100,101,69,114,114,111,114,218,9,116, - 114,97,110,115,108,97,116,101,218,11,99,112,52,51,55,95, - 116,97,98,108,101,114,19,0,0,0,114,20,0,0,0,114, - 21,0,0,0,114,30,0,0,0,114,45,0,0,0,114,80, - 0,0,0,41,26,114,29,0,0,0,218,2,102,112,90,15, - 104,101,97,100,101,114,95,112,111,115,105,116,105,111,110,218, - 6,98,117,102,102,101,114,218,9,102,105,108,101,95,115,105, - 122,101,90,17,109,97,120,95,99,111,109,109,101,110,116,95, - 115,116,97,114,116,218,4,100,97,116,97,90,3,112,111,115, - 218,11,104,101,97,100,101,114,95,115,105,122,101,90,13,104, - 101,97,100,101,114,95,111,102,102,115,101,116,90,10,97,114, - 99,95,111,102,102,115,101,116,114,33,0,0,0,218,5,99, - 111,117,110,116,218,5,102,108,97,103,115,218,8,99,111,109, - 112,114,101,115,115,218,4,116,105,109,101,218,4,100,97,116, - 101,218,3,99,114,99,218,9,100,97,116,97,95,115,105,122, - 101,218,9,110,97,109,101,95,115,105,122,101,218,10,101,120, - 116,114,97,95,115,105,122,101,90,12,99,111,109,109,101,110, - 116,95,115,105,122,101,218,11,102,105,108,101,95,111,102,102, - 115,101,116,114,44,0,0,0,114,13,0,0,0,218,1,116, - 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,114, - 27,0,0,0,130,1,0,0,115,240,0,0,0,2,1,14, - 1,14,1,18,1,8,2,2,1,14,1,8,1,14,1,14, - 1,18,1,12,1,18,1,18,1,2,3,12,1,12,1,14, - 1,10,1,2,1,6,255,8,2,2,1,2,255,2,1,4, - 255,2,2,10,1,12,1,14,1,10,1,2,1,6,255,10, - 2,10,1,10,1,2,1,6,255,16,2,14,1,10,1,2, - 1,6,255,16,2,16,2,16,1,10,1,18,1,10,1,18, - 1,8,1,8,1,10,1,18,1,4,2,4,2,2,1,14, - 1,14,1,18,1,2,1,10,1,14,1,8,1,18,2,4, - 1,14,1,8,1,16,1,16,1,16,1,16,1,16,1,16, - 1,16,1,16,1,16,1,16,1,16,1,12,1,10,1,18, - 1,8,1,2,2,14,1,14,1,18,1,14,1,18,1,2, - 4,28,1,18,1,4,255,14,2,18,1,10,2,10,2,2, - 3,14,1,14,1,18,1,12,2,12,1,20,1,8,1,8, - 1,4,202,14,6,18,128,14,49,4,1,2,247,2,246,2, - 246,2,227,2,227,2,248,2,246,2,248,255,128,114,27,0, - 0,0,117,190,1,0,0,0,1,2,3,4,5,6,7,8, - 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24, - 25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, - 41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56, - 57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72, - 73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88, - 89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104, - 105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120, - 121,122,123,124,125,126,127,195,135,195,188,195,169,195,162,195, - 164,195,160,195,165,195,167,195,170,195,171,195,168,195,175,195, - 174,195,172,195,132,195,133,195,137,195,166,195,134,195,180,195, - 182,195,178,195,187,195,185,195,191,195,150,195,156,194,162,194, - 163,194,165,226,130,167,198,146,195,161,195,173,195,179,195,186, - 195,177,195,145,194,170,194,186,194,191,226,140,144,194,172,194, - 189,194,188,194,161,194,171,194,187,226,150,145,226,150,146,226, - 150,147,226,148,130,226,148,164,226,149,161,226,149,162,226,149, - 150,226,149,149,226,149,163,226,149,145,226,149,151,226,149,157, - 226,149,156,226,149,155,226,148,144,226,148,148,226,148,180,226, - 148,172,226,148,156,226,148,128,226,148,188,226,149,158,226,149, - 159,226,149,154,226,149,148,226,149,169,226,149,166,226,149,160, - 226,149,144,226,149,172,226,149,167,226,149,168,226,149,164,226, - 149,165,226,149,153,226,149,152,226,149,146,226,149,147,226,149, - 171,226,149,170,226,148,152,226,148,140,226,150,136,226,150,132, - 226,150,140,226,150,144,226,150,128,206,177,195,159,206,147,207, - 128,206,163,207,131,194,181,207,132,206,166,206,152,206,169,206, - 180,226,136,158,207,134,206,181,226,136,169,226,137,161,194,177, - 226,137,165,226,137,164,226,140,160,226,140,161,195,183,226,137, - 136,194,176,226,136,153,194,183,226,136,154,226,129,191,194,178, - 226,150,160,194,160,99,0,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,8,0,0,0,67,0,0,0,115,106, - 0,0,0,116,0,114,22,116,1,160,2,100,1,161,1,1, - 0,116,3,100,2,131,1,130,1,100,3,97,0,122,56,122, - 16,100,4,100,5,108,4,109,5,125,0,1,0,87,0,110, - 30,4,0,116,6,121,104,1,0,1,0,1,0,116,1,160, - 2,100,1,161,1,1,0,116,3,100,2,131,1,130,1,87, - 0,100,6,97,0,110,6,100,6,97,0,119,0,116,1,160, - 2,100,7,161,1,1,0,124,0,83,0,119,0,41,8,78, - 122,27,122,105,112,105,109,112,111,114,116,58,32,122,108,105, - 98,32,85,78,65,86,65,73,76,65,66,76,69,250,41,99, - 97,110,39,116,32,100,101,99,111,109,112,114,101,115,115,32, - 100,97,116,97,59,32,122,108,105,98,32,110,111,116,32,97, - 118,97,105,108,97,98,108,101,84,114,0,0,0,0,169,1, - 218,10,100,101,99,111,109,112,114,101,115,115,70,122,25,122, - 105,112,105,109,112,111,114,116,58,32,122,108,105,98,32,97, - 118,97,105,108,97,98,108,101,41,7,218,15,95,105,109,112, - 111,114,116,105,110,103,95,122,108,105,98,114,45,0,0,0, - 114,80,0,0,0,114,3,0,0,0,90,4,122,108,105,98, - 114,143,0,0,0,218,9,69,120,99,101,112,116,105,111,110, - 114,142,0,0,0,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,218,20,95,103,101,116,95,100,101,99,111,109, - 112,114,101,115,115,95,102,117,110,99,32,2,0,0,115,30, - 0,0,0,4,2,10,3,8,1,4,2,4,1,16,1,12, - 1,10,1,8,1,2,253,12,5,10,2,4,1,2,249,255, - 128,114,146,0,0,0,99,2,0,0,0,0,0,0,0,0, - 0,0,0,17,0,0,0,9,0,0,0,67,0,0,0,115, - 134,1,0,0,124,1,92,8,125,2,125,3,125,4,125,5, - 125,6,125,7,125,8,125,9,124,4,100,1,107,0,114,36, - 116,0,100,2,131,1,130,1,116,1,160,2,124,0,161,1, - 144,1,143,4,125,10,122,14,124,10,160,3,124,6,161,1, - 1,0,87,0,110,32,4,0,116,4,144,1,121,132,1,0, - 1,0,1,0,116,0,100,3,124,0,155,2,157,2,124,0, - 100,4,141,2,130,1,124,10,160,5,100,5,161,1,125,11, - 116,6,124,11,131,1,100,5,107,3,114,128,116,7,100,6, - 131,1,130,1,124,11,100,0,100,7,133,2,25,0,100,8, - 107,3,114,162,116,0,100,9,124,0,155,2,157,2,124,0, - 100,4,141,2,130,1,116,8,124,11,100,10,100,11,133,2, - 25,0,131,1,125,12,116,8,124,11,100,11,100,5,133,2, - 25,0,131,1,125,13,100,5,124,12,23,0,124,13,23,0, - 125,14,124,6,124,14,55,0,125,6,122,14,124,10,160,3, - 124,6,161,1,1,0,87,0,110,32,4,0,116,4,144,1, - 121,130,1,0,1,0,1,0,116,0,100,3,124,0,155,2, - 157,2,124,0,100,4,141,2,130,1,124,10,160,5,124,4, - 161,1,125,15,116,6,124,15,131,1,124,4,107,3,144,1, - 114,38,116,4,100,12,131,1,130,1,87,0,100,0,4,0, - 4,0,131,3,1,0,110,18,49,0,144,1,115,60,119,1, - 1,0,1,0,1,0,89,0,1,0,124,3,100,1,107,2, - 144,1,114,84,124,15,83,0,122,10,116,9,131,0,125,16, - 87,0,110,22,4,0,116,10,144,1,121,128,1,0,1,0, - 1,0,116,0,100,13,131,1,130,1,124,16,124,15,100,14, - 131,2,83,0,119,0,119,0,119,0,41,15,78,114,0,0, - 0,0,122,18,110,101,103,97,116,105,118,101,32,100,97,116, - 97,32,115,105,122,101,114,94,0,0,0,114,12,0,0,0, - 114,106,0,0,0,114,100,0,0,0,114,95,0,0,0,115, - 4,0,0,0,80,75,3,4,122,23,98,97,100,32,108,111, - 99,97,108,32,102,105,108,101,32,104,101,97,100,101,114,58, - 32,233,26,0,0,0,114,105,0,0,0,122,26,122,105,112, - 105,109,112,111,114,116,58,32,99,97,110,39,116,32,114,101, - 97,100,32,100,97,116,97,114,141,0,0,0,105,241,255,255, - 255,41,11,114,3,0,0,0,114,112,0,0,0,114,113,0, - 0,0,114,114,0,0,0,114,22,0,0,0,114,116,0,0, - 0,114,55,0,0,0,114,121,0,0,0,114,1,0,0,0, - 114,146,0,0,0,114,145,0,0,0,41,17,114,29,0,0, - 0,114,58,0,0,0,90,8,100,97,116,97,112,97,116,104, - 114,132,0,0,0,114,136,0,0,0,114,127,0,0,0,114, - 139,0,0,0,114,133,0,0,0,114,134,0,0,0,114,135, - 0,0,0,114,125,0,0,0,114,126,0,0,0,114,137,0, - 0,0,114,138,0,0,0,114,129,0,0,0,90,8,114,97, - 119,95,100,97,116,97,114,143,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,114,56,0,0,0,53, - 2,0,0,115,74,0,0,0,20,1,8,1,8,1,14,2, - 2,2,14,1,14,1,18,1,10,1,12,1,8,1,16,2, - 18,2,16,2,16,1,12,1,8,1,2,1,14,1,14,1, - 18,1,10,1,14,1,8,1,14,255,18,128,10,3,4,2, - 2,3,10,1,14,1,8,1,10,1,2,254,2,243,2,240, - 255,128,114,56,0,0,0,99,2,0,0,0,0,0,0,0, - 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, - 115,16,0,0,0,116,0,124,0,124,1,24,0,131,1,100, - 1,107,1,83,0,41,2,78,114,5,0,0,0,41,1,218, - 3,97,98,115,41,2,90,2,116,49,90,2,116,50,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,218,9,95, - 101,113,95,109,116,105,109,101,99,2,0,0,115,4,0,0, - 0,16,2,255,128,114,149,0,0,0,99,5,0,0,0,0, - 0,0,0,0,0,0,0,14,0,0,0,6,0,0,0,67, - 0,0,0,115,254,0,0,0,124,3,124,2,100,1,156,2, - 125,5,116,0,160,1,124,4,124,3,124,5,161,3,125,6, - 124,6,100,2,64,0,100,3,107,3,125,7,124,7,114,126, - 124,6,100,4,64,0,100,3,107,3,125,8,116,2,106,3, - 100,5,107,3,114,124,124,8,115,76,116,2,106,3,100,6, - 107,2,114,124,116,4,124,0,124,2,131,2,125,9,124,9, - 100,0,117,1,114,124,116,2,160,5,116,0,106,6,124,9, - 161,2,125,10,116,0,160,7,124,4,124,10,124,3,124,5, - 161,4,1,0,110,80,116,8,124,0,124,2,131,2,92,2, - 125,11,125,12,124,11,114,206,116,9,116,10,124,4,100,7, - 100,8,133,2,25,0,131,1,124,11,131,2,114,186,116,10, - 124,4,100,8,100,9,133,2,25,0,131,1,124,12,107,3, - 114,206,116,11,160,12,100,10,124,3,155,2,157,2,161,1, - 1,0,100,0,83,0,116,13,160,14,124,4,100,9,100,0, - 133,2,25,0,161,1,125,13,116,15,124,13,116,16,131,2, - 115,250,116,17,100,11,124,1,155,2,100,12,157,3,131,1, - 130,1,124,13,83,0,41,13,78,41,2,114,44,0,0,0, - 114,13,0,0,0,114,5,0,0,0,114,0,0,0,0,114, - 88,0,0,0,90,5,110,101,118,101,114,90,6,97,108,119, - 97,121,115,114,101,0,0,0,114,96,0,0,0,114,97,0, - 0,0,122,22,98,121,116,101,99,111,100,101,32,105,115,32, - 115,116,97,108,101,32,102,111,114,32,122,16,99,111,109,112, - 105,108,101,100,32,109,111,100,117,108,101,32,122,21,32,105, - 115,32,110,111,116,32,97,32,99,111,100,101,32,111,98,106, - 101,99,116,41,18,114,21,0,0,0,90,13,95,99,108,97, - 115,115,105,102,121,95,112,121,99,218,4,95,105,109,112,90, - 21,99,104,101,99,107,95,104,97,115,104,95,98,97,115,101, - 100,95,112,121,99,115,218,15,95,103,101,116,95,112,121,99, - 95,115,111,117,114,99,101,218,11,115,111,117,114,99,101,95, - 104,97,115,104,90,17,95,82,65,87,95,77,65,71,73,67, - 95,78,85,77,66,69,82,90,18,95,118,97,108,105,100,97, - 116,101,95,104,97,115,104,95,112,121,99,218,29,95,103,101, - 116,95,109,116,105,109,101,95,97,110,100,95,115,105,122,101, - 95,111,102,95,115,111,117,114,99,101,114,149,0,0,0,114, - 2,0,0,0,114,45,0,0,0,114,80,0,0,0,218,7, - 109,97,114,115,104,97,108,90,5,108,111,97,100,115,114,15, - 0,0,0,218,10,95,99,111,100,101,95,116,121,112,101,218, - 9,84,121,112,101,69,114,114,111,114,41,14,114,32,0,0, - 0,114,57,0,0,0,114,66,0,0,0,114,38,0,0,0, - 114,128,0,0,0,90,11,101,120,99,95,100,101,116,97,105, - 108,115,114,131,0,0,0,90,10,104,97,115,104,95,98,97, - 115,101,100,90,12,99,104,101,99,107,95,115,111,117,114,99, - 101,90,12,115,111,117,114,99,101,95,98,121,116,101,115,114, - 152,0,0,0,90,12,115,111,117,114,99,101,95,109,116,105, - 109,101,90,11,115,111,117,114,99,101,95,115,105,122,101,114, - 50,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, - 0,0,0,218,15,95,117,110,109,97,114,115,104,97,108,95, - 99,111,100,101,107,2,0,0,115,74,0,0,0,2,2,2, - 1,6,254,14,5,12,2,4,1,12,1,10,1,2,1,2, - 255,8,1,2,255,10,2,8,1,4,1,4,1,2,1,4, - 254,4,5,8,1,4,255,2,128,8,4,6,255,4,3,22, - 3,18,1,2,255,4,2,8,1,4,255,4,2,18,2,10, - 1,16,1,4,1,255,128,114,157,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0, - 0,67,0,0,0,115,28,0,0,0,124,0,160,0,100,1, - 100,2,161,2,125,0,124,0,160,0,100,3,100,2,161,2, - 125,0,124,0,83,0,41,4,78,115,2,0,0,0,13,10, - 243,1,0,0,0,10,243,1,0,0,0,13,41,1,114,19, - 0,0,0,41,1,218,6,115,111,117,114,99,101,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,218,23,95,110, - 111,114,109,97,108,105,122,101,95,108,105,110,101,95,101,110, - 100,105,110,103,115,152,2,0,0,115,8,0,0,0,12,1, - 12,1,4,1,255,128,114,161,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,6,0,0,0, - 67,0,0,0,115,24,0,0,0,116,0,124,1,131,1,125, - 1,116,1,124,1,124,0,100,1,100,2,100,3,141,4,83, - 0,41,4,78,114,78,0,0,0,84,41,1,90,12,100,111, - 110,116,95,105,110,104,101,114,105,116,41,2,114,161,0,0, - 0,218,7,99,111,109,112,105,108,101,41,2,114,57,0,0, - 0,114,160,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,15,95,99,111,109,112,105,108,101,95, - 115,111,117,114,99,101,159,2,0,0,115,6,0,0,0,8, - 1,16,1,255,128,114,163,0,0,0,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,67, - 0,0,0,115,68,0,0,0,116,0,160,1,124,0,100,1, - 63,0,100,2,23,0,124,0,100,3,63,0,100,4,64,0, - 124,0,100,5,64,0,124,1,100,6,63,0,124,1,100,3, - 63,0,100,7,64,0,124,1,100,5,64,0,100,8,20,0, - 100,9,100,9,100,9,102,9,161,1,83,0,41,10,78,233, - 9,0,0,0,105,188,7,0,0,233,5,0,0,0,233,15, - 0,0,0,233,31,0,0,0,233,11,0,0,0,233,63,0, - 0,0,114,88,0,0,0,114,14,0,0,0,41,2,114,133, - 0,0,0,90,6,109,107,116,105,109,101,41,2,218,1,100, - 114,140,0,0,0,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,218,14,95,112,97,114,115,101,95,100,111,115, - 116,105,109,101,165,2,0,0,115,20,0,0,0,4,1,10, - 1,10,1,6,1,6,1,10,1,10,1,6,1,6,249,255, - 128,114,171,0,0,0,99,2,0,0,0,0,0,0,0,0, - 0,0,0,6,0,0,0,10,0,0,0,67,0,0,0,115, - 110,0,0,0,122,82,124,1,100,1,100,0,133,2,25,0, - 100,2,118,0,115,22,74,0,130,1,124,1,100,0,100,1, - 133,2,25,0,125,1,124,0,106,0,124,1,25,0,125,2, - 124,2,100,3,25,0,125,3,124,2,100,4,25,0,125,4, - 124,2,100,5,25,0,125,5,116,1,124,4,124,3,131,2, - 124,5,102,2,87,0,83,0,4,0,116,2,116,3,116,4, - 102,3,121,108,1,0,1,0,1,0,89,0,100,6,83,0, - 119,0,41,7,78,114,14,0,0,0,169,2,218,1,99,218, - 1,111,114,165,0,0,0,233,6,0,0,0,233,3,0,0, - 0,41,2,114,0,0,0,0,114,0,0,0,0,41,5,114, - 28,0,0,0,114,171,0,0,0,114,26,0,0,0,218,10, - 73,110,100,101,120,69,114,114,111,114,114,156,0,0,0,41, - 6,114,32,0,0,0,114,13,0,0,0,114,58,0,0,0, - 114,133,0,0,0,114,134,0,0,0,90,17,117,110,99,111, - 109,112,114,101,115,115,101,100,95,115,105,122,101,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,114,153,0,0, - 0,178,2,0,0,115,24,0,0,0,2,1,20,2,12,1, - 10,1,8,3,8,1,8,1,16,1,18,1,6,1,2,255, - 255,128,114,153,0,0,0,99,2,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,8,0,0,0,67,0,0,0, - 115,80,0,0,0,124,1,100,1,100,0,133,2,25,0,100, - 2,118,0,115,20,74,0,130,1,124,1,100,0,100,1,133, - 2,25,0,125,1,122,14,124,0,106,0,124,1,25,0,125, - 2,87,0,110,18,4,0,116,1,121,78,1,0,1,0,1, - 0,89,0,100,0,83,0,116,2,124,0,106,3,124,2,131, - 2,83,0,119,0,41,3,78,114,14,0,0,0,114,172,0, - 0,0,41,4,114,28,0,0,0,114,26,0,0,0,114,56, - 0,0,0,114,29,0,0,0,41,3,114,32,0,0,0,114, - 13,0,0,0,114,58,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,151,0,0,0,197,2,0, - 0,115,18,0,0,0,20,2,12,1,2,2,14,1,12,1, - 6,1,12,2,2,253,255,128,114,151,0,0,0,99,2,0, - 0,0,0,0,0,0,0,0,0,0,14,0,0,0,11,0, - 0,0,67,0,0,0,115,18,1,0,0,116,0,124,0,124, - 1,131,2,125,2,100,0,125,3,116,1,68,0,93,204,92, - 3,125,4,125,5,125,6,124,2,124,4,23,0,125,7,116, - 2,106,3,100,1,124,0,106,4,116,5,124,7,100,2,100, - 3,141,5,1,0,122,14,124,0,106,6,124,7,25,0,125, - 8,87,0,110,18,4,0,116,7,144,1,121,16,1,0,1, - 0,1,0,89,0,113,18,124,8,100,4,25,0,125,9,116, - 8,124,0,106,4,124,8,131,2,125,10,100,0,125,11,124, - 5,114,182,122,20,116,9,124,0,124,9,124,7,124,1,124, - 10,131,5,125,11,87,0,110,50,4,0,116,10,144,1,121, - 14,1,0,125,12,1,0,122,16,124,12,125,3,87,0,89, - 0,100,0,125,12,126,12,110,18,100,0,125,12,126,12,119, - 1,116,11,124,9,124,10,131,2,125,11,124,11,100,0,117, - 0,114,202,113,18,124,8,100,4,25,0,125,9,124,11,124, - 6,124,9,102,3,2,0,1,0,83,0,124,3,114,252,100, - 5,124,3,155,0,157,2,125,13,116,12,124,13,124,1,100, - 6,141,2,124,3,130,2,116,12,100,7,124,1,155,2,157, - 2,124,1,100,6,141,2,130,1,119,0,119,0,41,8,78, - 122,13,116,114,121,105,110,103,32,123,125,123,125,123,125,114, - 88,0,0,0,41,1,90,9,118,101,114,98,111,115,105,116, - 121,114,0,0,0,0,122,20,109,111,100,117,108,101,32,108, - 111,97,100,32,102,97,105,108,101,100,58,32,114,62,0,0, - 0,114,61,0,0,0,41,13,114,36,0,0,0,114,91,0, - 0,0,114,45,0,0,0,114,80,0,0,0,114,29,0,0, - 0,114,20,0,0,0,114,28,0,0,0,114,26,0,0,0, - 114,56,0,0,0,114,157,0,0,0,114,79,0,0,0,114, - 163,0,0,0,114,3,0,0,0,41,14,114,32,0,0,0, - 114,38,0,0,0,114,13,0,0,0,90,12,105,109,112,111, - 114,116,95,101,114,114,111,114,114,92,0,0,0,114,93,0, - 0,0,114,51,0,0,0,114,66,0,0,0,114,58,0,0, - 0,114,40,0,0,0,114,128,0,0,0,114,50,0,0,0, - 90,3,101,120,99,114,81,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,114,48,0,0,0,212,2, - 0,0,115,60,0,0,0,10,1,4,1,14,1,8,1,22, - 1,2,1,14,1,14,1,4,1,8,2,12,1,4,1,4, - 1,2,1,20,1,16,1,16,1,8,128,10,2,8,1,2, - 3,8,1,14,1,4,2,10,1,14,1,18,2,2,241,2, - 247,255,128,114,48,0,0,0,41,46,114,86,0,0,0,90, - 26,95,102,114,111,122,101,110,95,105,109,112,111,114,116,108, - 105,98,95,101,120,116,101,114,110,97,108,114,21,0,0,0, - 114,1,0,0,0,114,2,0,0,0,90,17,95,102,114,111, - 122,101,110,95,105,109,112,111,114,116,108,105,98,114,45,0, - 0,0,114,150,0,0,0,114,112,0,0,0,114,154,0,0, - 0,114,71,0,0,0,114,133,0,0,0,114,69,0,0,0, - 90,7,95,95,97,108,108,95,95,114,20,0,0,0,90,15, - 112,97,116,104,95,115,101,112,97,114,97,116,111,114,115,114, - 18,0,0,0,114,79,0,0,0,114,3,0,0,0,114,25, - 0,0,0,218,4,116,121,112,101,114,74,0,0,0,114,115, - 0,0,0,114,117,0,0,0,114,119,0,0,0,90,13,95, - 76,111,97,100,101,114,66,97,115,105,99,115,114,4,0,0, - 0,114,91,0,0,0,114,36,0,0,0,114,37,0,0,0, - 114,35,0,0,0,114,27,0,0,0,114,124,0,0,0,114, - 144,0,0,0,114,146,0,0,0,114,56,0,0,0,114,149, - 0,0,0,114,157,0,0,0,218,8,95,95,99,111,100,101, - 95,95,114,155,0,0,0,114,161,0,0,0,114,163,0,0, - 0,114,171,0,0,0,114,153,0,0,0,114,151,0,0,0, - 114,48,0,0,0,114,9,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,218,8,60,109,111,100,117, - 108,101,62,1,0,0,0,115,92,0,0,0,4,0,8,16, - 16,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1, - 8,2,6,3,14,1,16,3,4,4,8,2,4,2,4,1, - 4,1,18,2,0,127,0,127,12,34,12,1,2,1,2,1, - 4,252,8,9,8,4,8,9,8,31,2,126,2,254,4,29, - 8,5,8,21,8,46,8,8,10,40,8,5,8,7,8,6, - 8,13,8,19,12,15,255,128, + 116,111,114,121,32,115,105,122,101,32,111,114,32,111,102,102, + 115,101,116,58,32,84,233,46,0,0,0,250,27,69,79,70, + 32,114,101,97,100,32,119,104,101,114,101,32,110,111,116,32, + 101,120,112,101,99,116,101,100,115,4,0,0,0,80,75,1, + 2,233,8,0,0,0,233,10,0,0,0,233,14,0,0,0, + 233,24,0,0,0,233,28,0,0,0,233,30,0,0,0,233, + 32,0,0,0,233,34,0,0,0,233,42,0,0,0,122,25, + 98,97,100,32,108,111,99,97,108,32,104,101,97,100,101,114, + 32,111,102,102,115,101,116,58,32,105,0,8,0,0,218,5, + 97,115,99,105,105,90,6,108,97,116,105,110,49,250,1,47, + 114,5,0,0,0,122,33,122,105,112,105,109,112,111,114,116, + 58,32,102,111,117,110,100,32,123,125,32,110,97,109,101,115, + 32,105,110,32,123,33,114,125,41,26,218,3,95,105,111,218, + 9,111,112,101,110,95,99,111,100,101,114,22,0,0,0,114, + 3,0,0,0,218,4,115,101,101,107,218,20,69,78,68,95, + 67,69,78,84,82,65,76,95,68,73,82,95,83,73,90,69, + 90,4,116,101,108,108,218,4,114,101,97,100,114,55,0,0, + 0,218,18,83,84,82,73,78,71,95,69,78,68,95,65,82, + 67,72,73,86,69,218,3,109,97,120,218,15,77,65,88,95, + 67,79,77,77,69,78,84,95,76,69,78,218,5,114,102,105, + 110,100,114,2,0,0,0,218,8,69,79,70,69,114,114,111, + 114,114,1,0,0,0,114,65,0,0,0,218,18,85,110,105, + 99,111,100,101,68,101,99,111,100,101,69,114,114,111,114,218, + 9,116,114,97,110,115,108,97,116,101,218,11,99,112,52,51, + 55,95,116,97,98,108,101,114,19,0,0,0,114,20,0,0, + 0,114,21,0,0,0,114,30,0,0,0,114,45,0,0,0, + 114,80,0,0,0,41,26,114,29,0,0,0,218,2,102,112, + 90,15,104,101,97,100,101,114,95,112,111,115,105,116,105,111, + 110,218,6,98,117,102,102,101,114,218,9,102,105,108,101,95, + 115,105,122,101,90,17,109,97,120,95,99,111,109,109,101,110, + 116,95,115,116,97,114,116,218,4,100,97,116,97,90,3,112, + 111,115,218,11,104,101,97,100,101,114,95,115,105,122,101,90, + 13,104,101,97,100,101,114,95,111,102,102,115,101,116,90,10, + 97,114,99,95,111,102,102,115,101,116,114,33,0,0,0,218, + 5,99,111,117,110,116,218,5,102,108,97,103,115,218,8,99, + 111,109,112,114,101,115,115,218,4,116,105,109,101,218,4,100, + 97,116,101,218,3,99,114,99,218,9,100,97,116,97,95,115, + 105,122,101,218,9,110,97,109,101,95,115,105,122,101,218,10, + 101,120,116,114,97,95,115,105,122,101,90,12,99,111,109,109, + 101,110,116,95,115,105,122,101,218,11,102,105,108,101,95,111, + 102,102,115,101,116,114,44,0,0,0,114,13,0,0,0,218, + 1,116,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,114,27,0,0,0,140,1,0,0,115,240,0,0,0,2, + 1,14,1,14,1,18,1,8,2,2,1,14,1,8,1,14, + 1,14,1,18,1,12,1,18,1,18,1,2,3,12,1,12, + 1,14,1,10,1,2,1,6,255,8,2,2,1,2,255,2, + 1,4,255,2,2,10,1,12,1,14,1,10,1,2,1,6, + 255,10,2,10,1,10,1,2,1,6,255,16,2,14,1,10, + 1,2,1,6,255,16,2,16,2,16,1,10,1,18,1,10, + 1,18,1,8,1,8,1,10,1,18,1,4,2,4,2,2, + 1,14,1,14,1,18,1,2,1,10,1,14,1,8,1,18, + 2,4,1,14,1,8,1,16,1,16,1,16,1,16,1,16, + 1,16,1,16,1,16,1,16,1,16,1,16,1,12,1,10, + 1,18,1,8,1,2,2,14,1,14,1,18,1,14,1,18, + 1,2,4,28,1,18,1,4,255,14,2,18,1,10,2,10, + 2,2,3,14,1,14,1,18,1,12,2,12,1,20,1,8, + 1,8,1,4,202,14,6,18,128,14,49,4,1,2,247,2, + 246,2,246,2,227,2,227,2,248,2,246,2,248,255,128,114, + 27,0,0,0,117,190,1,0,0,0,1,2,3,4,5,6, + 7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, + 23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38, + 39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54, + 55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70, + 71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86, + 87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102, + 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118, + 119,120,121,122,123,124,125,126,127,195,135,195,188,195,169,195, + 162,195,164,195,160,195,165,195,167,195,170,195,171,195,168,195, + 175,195,174,195,172,195,132,195,133,195,137,195,166,195,134,195, + 180,195,182,195,178,195,187,195,185,195,191,195,150,195,156,194, + 162,194,163,194,165,226,130,167,198,146,195,161,195,173,195,179, + 195,186,195,177,195,145,194,170,194,186,194,191,226,140,144,194, + 172,194,189,194,188,194,161,194,171,194,187,226,150,145,226,150, + 146,226,150,147,226,148,130,226,148,164,226,149,161,226,149,162, + 226,149,150,226,149,149,226,149,163,226,149,145,226,149,151,226, + 149,157,226,149,156,226,149,155,226,148,144,226,148,148,226,148, + 180,226,148,172,226,148,156,226,148,128,226,148,188,226,149,158, + 226,149,159,226,149,154,226,149,148,226,149,169,226,149,166,226, + 149,160,226,149,144,226,149,172,226,149,167,226,149,168,226,149, + 164,226,149,165,226,149,153,226,149,152,226,149,146,226,149,147, + 226,149,171,226,149,170,226,148,152,226,148,140,226,150,136,226, + 150,132,226,150,140,226,150,144,226,150,128,206,177,195,159,206, + 147,207,128,206,163,207,131,194,181,207,132,206,166,206,152,206, + 169,206,180,226,136,158,207,134,206,181,226,136,169,226,137,161, + 194,177,226,137,165,226,137,164,226,140,160,226,140,161,195,183, + 226,137,136,194,176,226,136,153,194,183,226,136,154,226,129,191, + 194,178,226,150,160,194,160,99,0,0,0,0,0,0,0,0, + 0,0,0,0,1,0,0,0,8,0,0,0,67,0,0,0, + 115,106,0,0,0,116,0,114,22,116,1,160,2,100,1,161, + 1,1,0,116,3,100,2,131,1,130,1,100,3,97,0,122, + 56,122,16,100,4,100,5,108,4,109,5,125,0,1,0,87, + 0,110,30,4,0,116,6,121,104,1,0,1,0,1,0,116, + 1,160,2,100,1,161,1,1,0,116,3,100,2,131,1,130, + 1,87,0,100,6,97,0,110,6,100,6,97,0,119,0,116, + 1,160,2,100,7,161,1,1,0,124,0,83,0,119,0,41, + 8,78,122,27,122,105,112,105,109,112,111,114,116,58,32,122, + 108,105,98,32,85,78,65,86,65,73,76,65,66,76,69,250, + 41,99,97,110,39,116,32,100,101,99,111,109,112,114,101,115, + 115,32,100,97,116,97,59,32,122,108,105,98,32,110,111,116, + 32,97,118,97,105,108,97,98,108,101,84,114,0,0,0,0, + 169,1,218,10,100,101,99,111,109,112,114,101,115,115,70,122, + 25,122,105,112,105,109,112,111,114,116,58,32,122,108,105,98, + 32,97,118,97,105,108,97,98,108,101,41,7,218,15,95,105, + 109,112,111,114,116,105,110,103,95,122,108,105,98,114,45,0, + 0,0,114,80,0,0,0,114,3,0,0,0,90,4,122,108, + 105,98,114,146,0,0,0,218,9,69,120,99,101,112,116,105, + 111,110,114,145,0,0,0,114,9,0,0,0,114,9,0,0, + 0,114,10,0,0,0,218,20,95,103,101,116,95,100,101,99, + 111,109,112,114,101,115,115,95,102,117,110,99,42,2,0,0, + 115,30,0,0,0,4,2,10,3,8,1,4,2,4,1,16, + 1,12,1,10,1,8,1,2,253,12,5,10,2,4,1,2, + 249,255,128,114,149,0,0,0,99,2,0,0,0,0,0,0, + 0,0,0,0,0,17,0,0,0,9,0,0,0,67,0,0, + 0,115,134,1,0,0,124,1,92,8,125,2,125,3,125,4, + 125,5,125,6,125,7,125,8,125,9,124,4,100,1,107,0, + 114,36,116,0,100,2,131,1,130,1,116,1,160,2,124,0, + 161,1,144,1,143,4,125,10,122,14,124,10,160,3,124,6, + 161,1,1,0,87,0,110,32,4,0,116,4,144,1,121,132, + 1,0,1,0,1,0,116,0,100,3,124,0,155,2,157,2, + 124,0,100,4,141,2,130,1,124,10,160,5,100,5,161,1, + 125,11,116,6,124,11,131,1,100,5,107,3,114,128,116,7, + 100,6,131,1,130,1,124,11,100,0,100,7,133,2,25,0, + 100,8,107,3,114,162,116,0,100,9,124,0,155,2,157,2, + 124,0,100,4,141,2,130,1,116,8,124,11,100,10,100,11, + 133,2,25,0,131,1,125,12,116,8,124,11,100,11,100,5, + 133,2,25,0,131,1,125,13,100,5,124,12,23,0,124,13, + 23,0,125,14,124,6,124,14,55,0,125,6,122,14,124,10, + 160,3,124,6,161,1,1,0,87,0,110,32,4,0,116,4, + 144,1,121,130,1,0,1,0,1,0,116,0,100,3,124,0, + 155,2,157,2,124,0,100,4,141,2,130,1,124,10,160,5, + 124,4,161,1,125,15,116,6,124,15,131,1,124,4,107,3, + 144,1,114,38,116,4,100,12,131,1,130,1,87,0,100,0, + 4,0,4,0,131,3,1,0,110,18,49,0,144,1,115,60, + 119,1,1,0,1,0,1,0,89,0,1,0,124,3,100,1, + 107,2,144,1,114,84,124,15,83,0,122,10,116,9,131,0, + 125,16,87,0,110,22,4,0,116,10,144,1,121,128,1,0, + 1,0,1,0,116,0,100,13,131,1,130,1,124,16,124,15, + 100,14,131,2,83,0,119,0,119,0,119,0,41,15,78,114, + 0,0,0,0,122,18,110,101,103,97,116,105,118,101,32,100, + 97,116,97,32,115,105,122,101,114,97,0,0,0,114,12,0, + 0,0,114,109,0,0,0,114,103,0,0,0,114,98,0,0, + 0,115,4,0,0,0,80,75,3,4,122,23,98,97,100,32, + 108,111,99,97,108,32,102,105,108,101,32,104,101,97,100,101, + 114,58,32,233,26,0,0,0,114,108,0,0,0,122,26,122, + 105,112,105,109,112,111,114,116,58,32,99,97,110,39,116,32, + 114,101,97,100,32,100,97,116,97,114,144,0,0,0,105,241, + 255,255,255,41,11,114,3,0,0,0,114,115,0,0,0,114, + 116,0,0,0,114,117,0,0,0,114,22,0,0,0,114,119, + 0,0,0,114,55,0,0,0,114,124,0,0,0,114,1,0, + 0,0,114,149,0,0,0,114,148,0,0,0,41,17,114,29, + 0,0,0,114,58,0,0,0,90,8,100,97,116,97,112,97, + 116,104,114,135,0,0,0,114,139,0,0,0,114,130,0,0, + 0,114,142,0,0,0,114,136,0,0,0,114,137,0,0,0, + 114,138,0,0,0,114,128,0,0,0,114,129,0,0,0,114, + 140,0,0,0,114,141,0,0,0,114,132,0,0,0,90,8, + 114,97,119,95,100,97,116,97,114,146,0,0,0,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,114,56,0,0, + 0,63,2,0,0,115,74,0,0,0,20,1,8,1,8,1, + 14,2,2,2,14,1,14,1,18,1,10,1,12,1,8,1, + 16,2,18,2,16,2,16,1,12,1,8,1,2,1,14,1, + 14,1,18,1,10,1,14,1,8,1,14,255,18,128,10,3, + 4,2,2,3,10,1,14,1,8,1,10,1,2,254,2,243, + 2,240,255,128,114,56,0,0,0,99,2,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, + 0,0,115,16,0,0,0,116,0,124,0,124,1,24,0,131, + 1,100,1,107,1,83,0,41,2,78,114,5,0,0,0,41, + 1,218,3,97,98,115,41,2,90,2,116,49,90,2,116,50, + 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, + 9,95,101,113,95,109,116,105,109,101,109,2,0,0,115,4, + 0,0,0,16,2,255,128,114,152,0,0,0,99,5,0,0, + 0,0,0,0,0,0,0,0,0,14,0,0,0,6,0,0, + 0,67,0,0,0,115,254,0,0,0,124,3,124,2,100,1, + 156,2,125,5,116,0,160,1,124,4,124,3,124,5,161,3, + 125,6,124,6,100,2,64,0,100,3,107,3,125,7,124,7, + 114,126,124,6,100,4,64,0,100,3,107,3,125,8,116,2, + 106,3,100,5,107,3,114,124,124,8,115,76,116,2,106,3, + 100,6,107,2,114,124,116,4,124,0,124,2,131,2,125,9, + 124,9,100,0,117,1,114,124,116,2,160,5,116,0,106,6, + 124,9,161,2,125,10,116,0,160,7,124,4,124,10,124,3, + 124,5,161,4,1,0,110,80,116,8,124,0,124,2,131,2, + 92,2,125,11,125,12,124,11,114,206,116,9,116,10,124,4, + 100,7,100,8,133,2,25,0,131,1,124,11,131,2,114,186, + 116,10,124,4,100,8,100,9,133,2,25,0,131,1,124,12, + 107,3,114,206,116,11,160,12,100,10,124,3,155,2,157,2, + 161,1,1,0,100,0,83,0,116,13,160,14,124,4,100,9, + 100,0,133,2,25,0,161,1,125,13,116,15,124,13,116,16, + 131,2,115,250,116,17,100,11,124,1,155,2,100,12,157,3, + 131,1,130,1,124,13,83,0,41,13,78,41,2,114,44,0, + 0,0,114,13,0,0,0,114,5,0,0,0,114,0,0,0, + 0,114,91,0,0,0,90,5,110,101,118,101,114,90,6,97, + 108,119,97,121,115,114,104,0,0,0,114,99,0,0,0,114, + 100,0,0,0,122,22,98,121,116,101,99,111,100,101,32,105, + 115,32,115,116,97,108,101,32,102,111,114,32,122,16,99,111, + 109,112,105,108,101,100,32,109,111,100,117,108,101,32,122,21, + 32,105,115,32,110,111,116,32,97,32,99,111,100,101,32,111, + 98,106,101,99,116,41,18,114,21,0,0,0,90,13,95,99, + 108,97,115,115,105,102,121,95,112,121,99,218,4,95,105,109, + 112,90,21,99,104,101,99,107,95,104,97,115,104,95,98,97, + 115,101,100,95,112,121,99,115,218,15,95,103,101,116,95,112, + 121,99,95,115,111,117,114,99,101,218,11,115,111,117,114,99, + 101,95,104,97,115,104,90,17,95,82,65,87,95,77,65,71, + 73,67,95,78,85,77,66,69,82,90,18,95,118,97,108,105, + 100,97,116,101,95,104,97,115,104,95,112,121,99,218,29,95, + 103,101,116,95,109,116,105,109,101,95,97,110,100,95,115,105, + 122,101,95,111,102,95,115,111,117,114,99,101,114,152,0,0, + 0,114,2,0,0,0,114,45,0,0,0,114,80,0,0,0, + 218,7,109,97,114,115,104,97,108,90,5,108,111,97,100,115, + 114,15,0,0,0,218,10,95,99,111,100,101,95,116,121,112, + 101,218,9,84,121,112,101,69,114,114,111,114,41,14,114,32, + 0,0,0,114,57,0,0,0,114,66,0,0,0,114,38,0, + 0,0,114,131,0,0,0,90,11,101,120,99,95,100,101,116, + 97,105,108,115,114,134,0,0,0,90,10,104,97,115,104,95, + 98,97,115,101,100,90,12,99,104,101,99,107,95,115,111,117, + 114,99,101,90,12,115,111,117,114,99,101,95,98,121,116,101, + 115,114,155,0,0,0,90,12,115,111,117,114,99,101,95,109, + 116,105,109,101,90,11,115,111,117,114,99,101,95,115,105,122, + 101,114,50,0,0,0,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,15,95,117,110,109,97,114,115,104,97, + 108,95,99,111,100,101,117,2,0,0,115,74,0,0,0,2, + 2,2,1,6,254,14,5,12,2,4,1,12,1,10,1,2, + 1,2,255,8,1,2,255,10,2,8,1,4,1,4,1,2, + 1,4,254,4,5,8,1,4,255,2,128,8,4,6,255,4, + 3,22,3,18,1,2,255,4,2,8,1,4,255,4,2,18, + 2,10,1,16,1,4,1,255,128,114,160,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4, + 0,0,0,67,0,0,0,115,28,0,0,0,124,0,160,0, + 100,1,100,2,161,2,125,0,124,0,160,0,100,3,100,2, + 161,2,125,0,124,0,83,0,41,4,78,115,2,0,0,0, + 13,10,243,1,0,0,0,10,243,1,0,0,0,13,41,1, + 114,19,0,0,0,41,1,218,6,115,111,117,114,99,101,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,23, + 95,110,111,114,109,97,108,105,122,101,95,108,105,110,101,95, + 101,110,100,105,110,103,115,162,2,0,0,115,8,0,0,0, + 12,1,12,1,4,1,255,128,114,164,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,6,0, + 0,0,67,0,0,0,115,24,0,0,0,116,0,124,1,131, + 1,125,1,116,1,124,1,124,0,100,1,100,2,100,3,141, + 4,83,0,41,4,78,114,78,0,0,0,84,41,1,90,12, + 100,111,110,116,95,105,110,104,101,114,105,116,41,2,114,164, + 0,0,0,218,7,99,111,109,112,105,108,101,41,2,114,57, + 0,0,0,114,163,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,15,95,99,111,109,112,105,108, + 101,95,115,111,117,114,99,101,169,2,0,0,115,6,0,0, + 0,8,1,16,1,255,128,114,166,0,0,0,99,2,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,11,0,0, + 0,67,0,0,0,115,68,0,0,0,116,0,160,1,124,0, + 100,1,63,0,100,2,23,0,124,0,100,3,63,0,100,4, + 64,0,124,0,100,5,64,0,124,1,100,6,63,0,124,1, + 100,3,63,0,100,7,64,0,124,1,100,5,64,0,100,8, + 20,0,100,9,100,9,100,9,102,9,161,1,83,0,41,10, + 78,233,9,0,0,0,105,188,7,0,0,233,5,0,0,0, + 233,15,0,0,0,233,31,0,0,0,233,11,0,0,0,233, + 63,0,0,0,114,91,0,0,0,114,14,0,0,0,41,2, + 114,136,0,0,0,90,6,109,107,116,105,109,101,41,2,218, + 1,100,114,143,0,0,0,114,9,0,0,0,114,9,0,0, + 0,114,10,0,0,0,218,14,95,112,97,114,115,101,95,100, + 111,115,116,105,109,101,175,2,0,0,115,20,0,0,0,4, + 1,10,1,10,1,6,1,6,1,10,1,10,1,6,1,6, + 249,255,128,114,174,0,0,0,99,2,0,0,0,0,0,0, + 0,0,0,0,0,6,0,0,0,10,0,0,0,67,0,0, + 0,115,110,0,0,0,122,82,124,1,100,1,100,0,133,2, + 25,0,100,2,118,0,115,22,74,0,130,1,124,1,100,0, + 100,1,133,2,25,0,125,1,124,0,106,0,124,1,25,0, + 125,2,124,2,100,3,25,0,125,3,124,2,100,4,25,0, + 125,4,124,2,100,5,25,0,125,5,116,1,124,4,124,3, + 131,2,124,5,102,2,87,0,83,0,4,0,116,2,116,3, + 116,4,102,3,121,108,1,0,1,0,1,0,89,0,100,6, + 83,0,119,0,41,7,78,114,14,0,0,0,169,2,218,1, + 99,218,1,111,114,168,0,0,0,233,6,0,0,0,233,3, + 0,0,0,41,2,114,0,0,0,0,114,0,0,0,0,41, + 5,114,28,0,0,0,114,174,0,0,0,114,26,0,0,0, + 218,10,73,110,100,101,120,69,114,114,111,114,114,159,0,0, + 0,41,6,114,32,0,0,0,114,13,0,0,0,114,58,0, + 0,0,114,136,0,0,0,114,137,0,0,0,90,17,117,110, + 99,111,109,112,114,101,115,115,101,100,95,115,105,122,101,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,156, + 0,0,0,188,2,0,0,115,24,0,0,0,2,1,20,2, + 12,1,10,1,8,3,8,1,8,1,16,1,18,1,6,1, + 2,255,255,128,114,156,0,0,0,99,2,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,8,0,0,0,67,0, + 0,0,115,80,0,0,0,124,1,100,1,100,0,133,2,25, + 0,100,2,118,0,115,20,74,0,130,1,124,1,100,0,100, + 1,133,2,25,0,125,1,122,14,124,0,106,0,124,1,25, + 0,125,2,87,0,110,18,4,0,116,1,121,78,1,0,1, + 0,1,0,89,0,100,0,83,0,116,2,124,0,106,3,124, + 2,131,2,83,0,119,0,41,3,78,114,14,0,0,0,114, + 175,0,0,0,41,4,114,28,0,0,0,114,26,0,0,0, + 114,56,0,0,0,114,29,0,0,0,41,3,114,32,0,0, + 0,114,13,0,0,0,114,58,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,114,154,0,0,0,207, + 2,0,0,115,18,0,0,0,20,2,12,1,2,2,14,1, + 12,1,6,1,12,2,2,253,255,128,114,154,0,0,0,99, + 2,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0, + 11,0,0,0,67,0,0,0,115,18,1,0,0,116,0,124, + 0,124,1,131,2,125,2,100,0,125,3,116,1,68,0,93, + 204,92,3,125,4,125,5,125,6,124,2,124,4,23,0,125, + 7,116,2,106,3,100,1,124,0,106,4,116,5,124,7,100, + 2,100,3,141,5,1,0,122,14,124,0,106,6,124,7,25, + 0,125,8,87,0,110,18,4,0,116,7,144,1,121,16,1, + 0,1,0,1,0,89,0,113,18,124,8,100,4,25,0,125, + 9,116,8,124,0,106,4,124,8,131,2,125,10,100,0,125, + 11,124,5,114,182,122,20,116,9,124,0,124,9,124,7,124, + 1,124,10,131,5,125,11,87,0,110,50,4,0,116,10,144, + 1,121,14,1,0,125,12,1,0,122,16,124,12,125,3,87, + 0,89,0,100,0,125,12,126,12,110,18,100,0,125,12,126, + 12,119,1,116,11,124,9,124,10,131,2,125,11,124,11,100, + 0,117,0,114,202,113,18,124,8,100,4,25,0,125,9,124, + 11,124,6,124,9,102,3,2,0,1,0,83,0,124,3,114, + 252,100,5,124,3,155,0,157,2,125,13,116,12,124,13,124, + 1,100,6,141,2,124,3,130,2,116,12,100,7,124,1,155, + 2,157,2,124,1,100,6,141,2,130,1,119,0,119,0,41, + 8,78,122,13,116,114,121,105,110,103,32,123,125,123,125,123, + 125,114,91,0,0,0,41,1,90,9,118,101,114,98,111,115, + 105,116,121,114,0,0,0,0,122,20,109,111,100,117,108,101, + 32,108,111,97,100,32,102,97,105,108,101,100,58,32,114,62, + 0,0,0,114,61,0,0,0,41,13,114,36,0,0,0,114, + 94,0,0,0,114,45,0,0,0,114,80,0,0,0,114,29, + 0,0,0,114,20,0,0,0,114,28,0,0,0,114,26,0, + 0,0,114,56,0,0,0,114,160,0,0,0,114,79,0,0, + 0,114,166,0,0,0,114,3,0,0,0,41,14,114,32,0, + 0,0,114,38,0,0,0,114,13,0,0,0,90,12,105,109, + 112,111,114,116,95,101,114,114,111,114,114,95,0,0,0,114, + 96,0,0,0,114,51,0,0,0,114,66,0,0,0,114,58, + 0,0,0,114,40,0,0,0,114,131,0,0,0,114,50,0, + 0,0,90,3,101,120,99,114,81,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,114,48,0,0,0, + 222,2,0,0,115,60,0,0,0,10,1,4,1,14,1,8, + 1,22,1,2,1,14,1,14,1,4,1,8,2,12,1,4, + 1,4,1,2,1,20,1,16,1,16,1,8,128,10,2,8, + 1,2,3,8,1,14,1,4,2,10,1,14,1,18,2,2, + 241,2,247,255,128,114,48,0,0,0,41,46,114,89,0,0, + 0,90,26,95,102,114,111,122,101,110,95,105,109,112,111,114, + 116,108,105,98,95,101,120,116,101,114,110,97,108,114,21,0, + 0,0,114,1,0,0,0,114,2,0,0,0,90,17,95,102, + 114,111,122,101,110,95,105,109,112,111,114,116,108,105,98,114, + 45,0,0,0,114,153,0,0,0,114,115,0,0,0,114,157, + 0,0,0,114,71,0,0,0,114,136,0,0,0,114,69,0, + 0,0,90,7,95,95,97,108,108,95,95,114,20,0,0,0, + 90,15,112,97,116,104,95,115,101,112,97,114,97,116,111,114, + 115,114,18,0,0,0,114,79,0,0,0,114,3,0,0,0, + 114,25,0,0,0,218,4,116,121,112,101,114,74,0,0,0, + 114,118,0,0,0,114,120,0,0,0,114,122,0,0,0,90, + 13,95,76,111,97,100,101,114,66,97,115,105,99,115,114,4, + 0,0,0,114,94,0,0,0,114,36,0,0,0,114,37,0, + 0,0,114,35,0,0,0,114,27,0,0,0,114,127,0,0, + 0,114,147,0,0,0,114,149,0,0,0,114,56,0,0,0, + 114,152,0,0,0,114,160,0,0,0,218,8,95,95,99,111, + 100,101,95,95,114,158,0,0,0,114,164,0,0,0,114,166, + 0,0,0,114,174,0,0,0,114,156,0,0,0,114,154,0, + 0,0,114,48,0,0,0,114,9,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,218,8,60,109,111, + 100,117,108,101,62,1,0,0,0,115,92,0,0,0,4,0, + 8,16,16,1,8,1,8,1,8,1,8,1,8,1,8,1, + 8,1,8,2,6,3,14,1,16,3,4,4,8,2,4,2, + 4,1,4,1,18,2,0,127,0,127,12,44,12,1,2,1, + 2,1,4,252,8,9,8,4,8,9,8,31,2,126,2,254, + 4,29,8,5,8,21,8,46,8,8,10,40,8,5,8,7, + 8,6,8,13,8,19,12,15,255,128, }; From webhook-mailer at python.org Mon Mar 8 16:56:42 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 08 Mar 2021 21:56:42 -0000 Subject: [Python-checkins] bpo-37146: Move _PyEval_DeactivateOpCache() to the internal C API (GH-24786) Message-ID: https://github.com/python/cpython/commit/9f672a52f55ce198d5689b5771948350028b4a3b commit: 9f672a52f55ce198d5689b5771948350028b4a3b branch: master author: Victor Stinner committer: vstinner date: 2021-03-08T22:56:37+01:00 summary: bpo-37146: Move _PyEval_DeactivateOpCache() to the internal C API (GH-24786) Don't export the symbol anymore. files: M Include/cpython/ceval.h M Include/internal/pycore_ceval.h diff --git a/Include/cpython/ceval.h b/Include/cpython/ceval.h index 05dcfac2ed634..06338928f6738 100644 --- a/Include/cpython/ceval.h +++ b/Include/cpython/ceval.h @@ -28,5 +28,3 @@ PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc); PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); - -PyAPI_FUNC(void) _PyEval_DeactivateOpCache(void); diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index f07959da770d9..f573c3e508680 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -62,6 +62,8 @@ extern void _PyEval_FiniGIL(PyInterpreterState *interp); extern void _PyEval_ReleaseLock(PyThreadState *tstate); +extern void _PyEval_DeactivateOpCache(void); + /* --- _Py_EnterRecursiveCall() ----------------------------------------- */ From webhook-mailer at python.org Mon Mar 8 17:51:00 2021 From: webhook-mailer at python.org (ericvsmith) Date: Mon, 08 Mar 2021 22:51:00 -0000 Subject: [Python-checkins] bpo-43415: Fix typo on dataclasses.rst (#24789) Message-ID: https://github.com/python/cpython/commit/0554044ddccdb7bf1fa4a8bc880e7a7b59f6479c commit: 0554044ddccdb7bf1fa4a8bc880e7a7b59f6479c branch: master author: Guilherme Martins Crocetti committer: ericvsmith date: 2021-03-08T17:50:39-05:00 summary: bpo-43415: Fix typo on dataclasses.rst (#24789) files: M Doc/library/dataclasses.rst diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index e706f7fcc566d..133cc0a065cac 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -136,7 +136,7 @@ Module-level decorators, classes, and functions attribute ``__hash__ = None`` has a specific meaning to Python, as described in the :meth:`__hash__` documentation. - If :meth:`__hash__` is not explicit defined, or if it is set to ``None``, + If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. Although not recommended, you can force :func:`dataclass` to create a :meth:`__hash__` method with ``unsafe_hash=True``. This might be the case From webhook-mailer at python.org Mon Mar 8 17:52:52 2021 From: webhook-mailer at python.org (ericvsmith) Date: Mon, 08 Mar 2021 22:52:52 -0000 Subject: [Python-checkins] bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24790) Message-ID: https://github.com/python/cpython/commit/fb3b0310305acdfad7c26705c2ee9a8712a43cf4 commit: fb3b0310305acdfad7c26705c2ee9a8712a43cf4 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ericvsmith date: 2021-03-08T17:52:43-05:00 summary: bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24790) (cherry picked from commit 0554044ddccdb7bf1fa4a8bc880e7a7b59f6479c) Co-authored-by: Guilherme Martins Crocetti Co-authored-by: Guilherme Martins Crocetti files: M Doc/library/dataclasses.rst diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index e706f7fcc566d..133cc0a065cac 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -136,7 +136,7 @@ Module-level decorators, classes, and functions attribute ``__hash__ = None`` has a specific meaning to Python, as described in the :meth:`__hash__` documentation. - If :meth:`__hash__` is not explicit defined, or if it is set to ``None``, + If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. Although not recommended, you can force :func:`dataclass` to create a :meth:`__hash__` method with ``unsafe_hash=True``. This might be the case From webhook-mailer at python.org Mon Mar 8 17:53:31 2021 From: webhook-mailer at python.org (ericvsmith) Date: Mon, 08 Mar 2021 22:53:31 -0000 Subject: [Python-checkins] bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24791) Message-ID: https://github.com/python/cpython/commit/6d4273356764a3837c914b2aced7a668c534e0be commit: 6d4273356764a3837c914b2aced7a668c534e0be branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ericvsmith date: 2021-03-08T17:53:22-05:00 summary: bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24791) (cherry picked from commit 0554044ddccdb7bf1fa4a8bc880e7a7b59f6479c) Co-authored-by: Guilherme Martins Crocetti Co-authored-by: Guilherme Martins Crocetti files: M Doc/library/dataclasses.rst diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index a7fbaaa106707..24acd7417d84d 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -136,7 +136,7 @@ Module-level decorators, classes, and functions attribute ``__hash__ = None`` has a specific meaning to Python, as described in the :meth:`__hash__` documentation. - If :meth:`__hash__` is not explicit defined, or if it is set to ``None``, + If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. Although not recommended, you can force :func:`dataclass` to create a :meth:`__hash__` method with ``unsafe_hash=True``. This might be the case From webhook-mailer at python.org Tue Mar 9 06:17:07 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 09 Mar 2021 11:17:07 -0000 Subject: [Python-checkins] bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795) Message-ID: https://github.com/python/cpython/commit/0d6bd1ca7c683137d52041194f3a2b02219f225a commit: 0d6bd1ca7c683137d52041194f3a2b02219f225a branch: master author: Victor Stinner committer: vstinner date: 2021-03-09T12:16:42+01:00 summary: bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795) files: M Doc/c-api/memory.rst diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 588668ee853c6..d2d212b25d7ec 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -555,7 +555,7 @@ Customize pymalloc Arena Allocator +--------------------------------------------------+---------------------------------------+ | ``void* alloc(void *ctx, size_t size)`` | allocate an arena of size bytes | +--------------------------------------------------+---------------------------------------+ - | ``void free(void *ctx, size_t size, void *ptr)`` | free an arena | + | ``void free(void *ctx, void *ptr, size_t size)`` | free an arena | +--------------------------------------------------+---------------------------------------+ .. c:function:: void PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator) From webhook-mailer at python.org Tue Mar 9 06:27:31 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 09 Mar 2021 11:27:31 -0000 Subject: [Python-checkins] bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795) Message-ID: https://github.com/python/cpython/commit/5ca02c4799c07dba5192f87f9f2378dc24097166 commit: 5ca02c4799c07dba5192f87f9f2378dc24097166 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-09T03:27:19-08:00 summary: bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795) (cherry picked from commit 0d6bd1ca7c683137d52041194f3a2b02219f225a) Co-authored-by: Victor Stinner files: M Doc/c-api/memory.rst diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 87425bcf1e71f..91b901d726e61 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -516,7 +516,7 @@ Customize pymalloc Arena Allocator +--------------------------------------------------+---------------------------------------+ | ``void* alloc(void *ctx, size_t size)`` | allocate an arena of size bytes | +--------------------------------------------------+---------------------------------------+ - | ``void free(void *ctx, size_t size, void *ptr)`` | free an arena | + | ``void free(void *ctx, void *ptr, size_t size)`` | free an arena | +--------------------------------------------------+---------------------------------------+ .. c:function:: void PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator) From webhook-mailer at python.org Tue Mar 9 06:39:49 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 09 Mar 2021 11:39:49 -0000 Subject: [Python-checkins] bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795) Message-ID: https://github.com/python/cpython/commit/ea46c7bc503d1103d60c0ec7023bb52c5defa11d commit: ea46c7bc503d1103d60c0ec7023bb52c5defa11d branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-09T03:39:39-08:00 summary: bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795) (cherry picked from commit 0d6bd1ca7c683137d52041194f3a2b02219f225a) Co-authored-by: Victor Stinner files: M Doc/c-api/memory.rst diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 87425bcf1e71f..91b901d726e61 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -516,7 +516,7 @@ Customize pymalloc Arena Allocator +--------------------------------------------------+---------------------------------------+ | ``void* alloc(void *ctx, size_t size)`` | allocate an arena of size bytes | +--------------------------------------------------+---------------------------------------+ - | ``void free(void *ctx, size_t size, void *ptr)`` | free an arena | + | ``void free(void *ctx, void *ptr, size_t size)`` | free an arena | +--------------------------------------------------+---------------------------------------+ .. c:function:: void PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator) From webhook-mailer at python.org Tue Mar 9 15:59:51 2021 From: webhook-mailer at python.org (zooba) Date: Tue, 09 Mar 2021 20:59:51 -0000 Subject: [Python-checkins] bpo-43440 : Enable SQLite R*Tree support for windows builds (GH-24797) Message-ID: https://github.com/python/cpython/commit/31818e98d3b845d815e9caf2a3d330341bdc1b33 commit: 31818e98d3b845d815e9caf2a3d330341bdc1b33 branch: master author: Erlend Egeberg Aasland committer: zooba date: 2021-03-09T20:59:44Z summary: bpo-43440 : Enable SQLite R*Tree support for windows builds (GH-24797) files: A Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst M PCbuild/sqlite3.vcxproj diff --git a/Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst b/Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst new file mode 100644 index 0000000000000..2116ef3a8718a --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst @@ -0,0 +1,2 @@ +Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch by Erlend E. +Aasland. diff --git a/PCbuild/sqlite3.vcxproj b/PCbuild/sqlite3.vcxproj index 7351a6dda2c76..39f10c5abd69d 100644 --- a/PCbuild/sqlite3.vcxproj +++ b/PCbuild/sqlite3.vcxproj @@ -98,7 +98,7 @@ $(sqlite3Dir);%(AdditionalIncludeDirectories) - SQLITE_ENABLE_JSON1;SQLITE_ENABLE_FTS4;SQLITE_ENABLE_FTS5;SQLITE_API=__declspec(dllexport);%(PreprocessorDefinitions) + SQLITE_ENABLE_JSON1;SQLITE_ENABLE_FTS4;SQLITE_ENABLE_FTS5;SQLITE_ENABLE_RTREE;SQLITE_API=__declspec(dllexport);%(PreprocessorDefinitions) Level1 From webhook-mailer at python.org Tue Mar 9 18:41:51 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Tue, 09 Mar 2021 23:41:51 -0000 Subject: [Python-checkins] bpo-43446: Fix markup in sqlite3 footnote (GH-24806) Message-ID: https://github.com/python/cpython/commit/62a03cd490f81c0fb01eaceb31aa8a4c7800ed0e commit: 62a03cd490f81c0fb01eaceb31aa8a4c7800ed0e branch: master author: Kamil Turek committer: berkerpeksag date: 2021-03-10T01:41:41+02:00 summary: bpo-43446: Fix markup in sqlite3 footnote (GH-24806) files: M Doc/library/sqlite3.rst diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 172ce6c6bb03b..1da5c7f3ab187 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1090,5 +1090,5 @@ committed: .. [#f1] The sqlite3 module is not built with loadable extension support by default, because some platforms (notably Mac OS X) have SQLite libraries which are compiled without this feature. To get loadable - extension support, you must pass --enable-loadable-sqlite-extensions to + extension support, you must pass ``--enable-loadable-sqlite-extensions`` to configure. From webhook-mailer at python.org Tue Mar 9 18:43:26 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Tue, 09 Mar 2021 23:43:26 -0000 Subject: [Python-checkins] bpo-43446: Fix markup in sqlite3 footnote (GH-24806) Message-ID: https://github.com/python/cpython/commit/da602560a4816c88dcf4d75b3e4eea56c8d3bbc2 commit: da602560a4816c88dcf4d75b3e4eea56c8d3bbc2 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: berkerpeksag date: 2021-03-10T01:43:17+02:00 summary: bpo-43446: Fix markup in sqlite3 footnote (GH-24806) (cherry picked from commit 62a03cd490f81c0fb01eaceb31aa8a4c7800ed0e) Co-authored-by: Kamil Turek files: M Doc/library/sqlite3.rst diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 600e85944f3a0..8e935c32abef8 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1094,5 +1094,5 @@ committed: .. [#f1] The sqlite3 module is not built with loadable extension support by default, because some platforms (notably Mac OS X) have SQLite libraries which are compiled without this feature. To get loadable - extension support, you must pass --enable-loadable-sqlite-extensions to + extension support, you must pass ``--enable-loadable-sqlite-extensions`` to configure. From webhook-mailer at python.org Tue Mar 9 18:43:46 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Tue, 09 Mar 2021 23:43:46 -0000 Subject: [Python-checkins] bpo-43446: Fix markup in sqlite3 footnote (GH-24806) Message-ID: https://github.com/python/cpython/commit/e89380765df8f0f02c90ad417e164d1597bd0b05 commit: e89380765df8f0f02c90ad417e164d1597bd0b05 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: berkerpeksag date: 2021-03-10T01:43:38+02:00 summary: bpo-43446: Fix markup in sqlite3 footnote (GH-24806) (cherry picked from commit 62a03cd490f81c0fb01eaceb31aa8a4c7800ed0e) Co-authored-by: Kamil Turek files: M Doc/library/sqlite3.rst diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 0ceaed556bf0b..ac13ac49b570d 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1094,5 +1094,5 @@ committed: .. [#f1] The sqlite3 module is not built with loadable extension support by default, because some platforms (notably Mac OS X) have SQLite libraries which are compiled without this feature. To get loadable - extension support, you must pass --enable-loadable-sqlite-extensions to + extension support, you must pass ``--enable-loadable-sqlite-extensions`` to configure. From webhook-mailer at python.org Tue Mar 9 19:54:04 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 10 Mar 2021 00:54:04 -0000 Subject: [Python-checkins] bpo-43439: Add audit hooks for gc functions (GH-24794) Message-ID: https://github.com/python/cpython/commit/b4f9089d4aa787c5b74134c98e5f0f11d9e63095 commit: b4f9089d4aa787c5b74134c98e5f0f11d9e63095 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-10T00:53:57Z summary: bpo-43439: Add audit hooks for gc functions (GH-24794) files: A Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst M Doc/library/gc.rst M Doc/whatsnew/3.10.rst M Lib/test/audit-tests.py M Lib/test/test_audit.py M Modules/gcmodule.c diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index a3d201d5055c8..69a1a8313b759 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -72,6 +72,8 @@ The :mod:`gc` module provides the following functions: .. versionchanged:: 3.8 New *generation* parameter. + .. audit-event:: gc.get_objects generation gc.get_objects + .. function:: get_stats() Return a list of three per-generation dictionaries containing collection @@ -141,6 +143,8 @@ The :mod:`gc` module provides the following functions: invalid state. Avoid using :func:`get_referrers` for any purpose other than debugging. + .. audit-event:: gc.get_referrers objs gc.get_referrers + .. function:: get_referents(*objs) @@ -152,6 +156,7 @@ The :mod:`gc` module provides the following functions: be involved in a cycle. So, for example, if an integer is directly reachable from an argument, that integer object may or may not appear in the result list. + .. audit-event:: gc.get_referents objs gc.get_referents .. function:: is_tracked(obj) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index db71f061f14df..814594a052595 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -673,9 +673,16 @@ When a module does not define ``__loader__``, fall back to ``__spec__.loader``. encodings --------- + :func:`encodings.normalize_encoding` now ignores non-ASCII characters. (Contributed by Hai Shi in :issue:`39337`.) +gc +-- + +Added audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and +:func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.) + glob ---- diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index ee6fc93351b75..8e66594e52429 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -323,6 +323,24 @@ def hook(event, args): sock.close() +def test_gc(): + import gc + + def hook(event, args): + if event.startswith("gc."): + print(event, *args) + + sys.addaudithook(hook) + + gc.get_objects(generation=1) + + x = object() + y = [x] + + gc.get_referrers(x) + gc.get_referents(y) + + if __name__ == "__main__": from test.support import suppress_msvcrt_asserts diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py index 4f8d06a3ebcbe..58180e147a49a 100644 --- a/Lib/test/test_audit.py +++ b/Lib/test/test_audit.py @@ -118,5 +118,18 @@ def test_socket(self): self.assertEqual(events[2][0], "socket.bind") self.assertTrue(events[2][2].endswith("('127.0.0.1', 8080)")) + def test_gc(self): + returncode, events, stderr = self.run_python("test_gc") + if returncode: + self.fail(stderr) + + if support.verbose: + print(*events, sep='\n') + self.assertEqual( + [event[0] for event in events], + ["gc.get_objects", "gc.get_referrers", "gc.get_referents"] + ) + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst new file mode 100644 index 0000000000000..518650303683d --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst @@ -0,0 +1,2 @@ +Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and +:func:`gc.get_referents`. Patch by Pablo Galindo. diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 21f6bd1a9b6d0..225da2b209592 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1690,6 +1690,10 @@ Return the list of objects that directly refer to any of objs."); static PyObject * gc_get_referrers(PyObject *self, PyObject *args) { + if (PySys_Audit("gc.get_referrers", "O", args) < 0) { + return NULL; + } + PyObject *result = PyList_New(0); if (!result) { return NULL; @@ -1720,6 +1724,9 @@ static PyObject * gc_get_referents(PyObject *self, PyObject *args) { Py_ssize_t i; + if (PySys_Audit("gc.get_referents", "O", args) < 0) { + return NULL; + } PyObject *result = PyList_New(0); if (result == NULL) @@ -1762,6 +1769,10 @@ gc_get_objects_impl(PyObject *module, Py_ssize_t generation) PyObject* result; GCState *gcstate = &tstate->interp->gc; + if (PySys_Audit("gc.get_objects", "n", generation) < 0) { + return NULL; + } + result = PyList_New(0); if (result == NULL) { return NULL; From webhook-mailer at python.org Wed Mar 10 03:50:48 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 10 Mar 2021 08:50:48 -0000 Subject: [Python-checkins] [3.9] bpo-43439: Add audit hooks for gc functions (GH-24794). (GH-24811) Message-ID: https://github.com/python/cpython/commit/f814675376318e0bf9e14fc62826a113cb4ca652 commit: f814675376318e0bf9e14fc62826a113cb4ca652 branch: 3.9 author: Pablo Galindo committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-10T00:50:29-08:00 summary: [3.9] bpo-43439: Add audit hooks for gc functions (GH-24794). (GH-24811) (cherry picked from commit b4f9089d4aa787c5b74134c98e5f0f11d9e63095) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst M Doc/library/gc.rst M Lib/test/audit-tests.py M Lib/test/test_audit.py M Modules/gcmodule.c diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 2d85cd3431711..4558081b1dbe8 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -72,6 +72,8 @@ The :mod:`gc` module provides the following functions: .. versionchanged:: 3.8 New *generation* parameter. + .. audit-event:: gc.get_objects generation gc.get_objects + .. function:: get_stats() Return a list of three per-generation dictionaries containing collection @@ -140,6 +142,8 @@ The :mod:`gc` module provides the following functions: invalid state. Avoid using :func:`get_referrers` for any purpose other than debugging. + .. audit-event:: gc.get_referrers objs gc.get_referrers + .. function:: get_referents(*objs) @@ -151,6 +155,7 @@ The :mod:`gc` module provides the following functions: be involved in a cycle. So, for example, if an integer is directly reachable from an argument, that integer object may or may not appear in the result list. + .. audit-event:: gc.get_referents objs gc.get_referents .. function:: is_tracked(obj) diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index ee6fc93351b75..8e66594e52429 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -323,6 +323,24 @@ def hook(event, args): sock.close() +def test_gc(): + import gc + + def hook(event, args): + if event.startswith("gc."): + print(event, *args) + + sys.addaudithook(hook) + + gc.get_objects(generation=1) + + x = object() + y = [x] + + gc.get_referrers(x) + gc.get_referents(y) + + if __name__ == "__main__": from test.support import suppress_msvcrt_asserts diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py index f79edbc4bd0d9..a9ac6fee446f8 100644 --- a/Lib/test/test_audit.py +++ b/Lib/test/test_audit.py @@ -115,5 +115,18 @@ def test_socket(self): self.assertEqual(events[2][0], "socket.bind") self.assertTrue(events[2][2].endswith("('127.0.0.1', 8080)")) + def test_gc(self): + returncode, events, stderr = self.run_python("test_gc") + if returncode: + self.fail(stderr) + + if support.verbose: + print(*events, sep='\n') + self.assertEqual( + [event[0] for event in events], + ["gc.get_objects", "gc.get_referrers", "gc.get_referents"] + ) + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst new file mode 100644 index 0000000000000..518650303683d --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst @@ -0,0 +1,2 @@ +Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and +:func:`gc.get_referents`. Patch by Pablo Galindo. diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 56dcb101e0005..52443debb1250 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1674,6 +1674,11 @@ gc_get_referrers(PyObject *self, PyObject *args) { PyThreadState *tstate = _PyThreadState_GET(); int i; + + if (PySys_Audit("gc.get_referrers", "O", args) < 0) { + return NULL; + } + PyObject *result = PyList_New(0); if (!result) { return NULL; @@ -1704,6 +1709,9 @@ static PyObject * gc_get_referents(PyObject *self, PyObject *args) { Py_ssize_t i; + if (PySys_Audit("gc.get_referents", "O", args) < 0) { + return NULL; + } PyObject *result = PyList_New(0); if (result == NULL) @@ -1746,6 +1754,10 @@ gc_get_objects_impl(PyObject *module, Py_ssize_t generation) PyObject* result; GCState *gcstate = &tstate->interp->gc; + if (PySys_Audit("gc.get_objects", "n", generation) < 0) { + return NULL; + } + result = PyList_New(0); if (result == NULL) { return NULL; From webhook-mailer at python.org Wed Mar 10 03:50:48 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 10 Mar 2021 08:50:48 -0000 Subject: [Python-checkins] [3.8] bpo-43439: Add audit hooks for gc functions (GH-24794). (GH-24810) Message-ID: https://github.com/python/cpython/commit/a6d0182879d0bf275c4feb38b57f73236ab9c06c commit: a6d0182879d0bf275c4feb38b57f73236ab9c06c branch: 3.8 author: Pablo Galindo committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-10T00:50:16-08:00 summary: [3.8] bpo-43439: Add audit hooks for gc functions (GH-24794). (GH-24810) (cherry picked from commit b4f9089d4aa787c5b74134c98e5f0f11d9e63095) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst M Doc/library/gc.rst M Lib/test/audit-tests.py M Lib/test/test_audit.py M Modules/gcmodule.c diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 073391d9058bf..dcbfe7f1d9db5 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -72,6 +72,8 @@ The :mod:`gc` module provides the following functions: .. versionchanged:: 3.8 New *generation* parameter. + .. audit-event:: gc.get_objects generation gc.get_objects + .. function:: get_stats() Return a list of three per-generation dictionaries containing collection @@ -141,6 +143,8 @@ The :mod:`gc` module provides the following functions: invalid state. Avoid using :func:`get_referrers` for any purpose other than debugging. + .. audit-event:: gc.get_referrers objs gc.get_referrers + .. function:: get_referents(*objs) @@ -152,6 +156,7 @@ The :mod:`gc` module provides the following functions: be involved in a cycle. So, for example, if an integer is directly reachable from an argument, that integer object may or may not appear in the result list. + .. audit-event:: gc.get_referents objs gc.get_referents .. function:: is_tracked(obj) diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index ee6fc93351b75..8e66594e52429 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -323,6 +323,24 @@ def hook(event, args): sock.close() +def test_gc(): + import gc + + def hook(event, args): + if event.startswith("gc."): + print(event, *args) + + sys.addaudithook(hook) + + gc.get_objects(generation=1) + + x = object() + y = [x] + + gc.get_referrers(x) + gc.get_referents(y) + + if __name__ == "__main__": from test.support import suppress_msvcrt_asserts diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py index f79edbc4bd0d9..a9ac6fee446f8 100644 --- a/Lib/test/test_audit.py +++ b/Lib/test/test_audit.py @@ -115,5 +115,18 @@ def test_socket(self): self.assertEqual(events[2][0], "socket.bind") self.assertTrue(events[2][2].endswith("('127.0.0.1', 8080)")) + def test_gc(self): + returncode, events, stderr = self.run_python("test_gc") + if returncode: + self.fail(stderr) + + if support.verbose: + print(*events, sep='\n') + self.assertEqual( + [event[0] for event in events], + ["gc.get_objects", "gc.get_referrers", "gc.get_referents"] + ) + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst new file mode 100644 index 0000000000000..518650303683d --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst @@ -0,0 +1,2 @@ +Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and +:func:`gc.get_referents`. Patch by Pablo Galindo. diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 5a6a81d81364d..7a37a1650d108 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1480,6 +1480,10 @@ static PyObject * gc_get_referrers(PyObject *self, PyObject *args) { int i; + if (PySys_Audit("gc.get_referrers", "O", args) < 0) { + return NULL; + } + PyObject *result = PyList_New(0); if (!result) return NULL; @@ -1508,6 +1512,9 @@ static PyObject * gc_get_referents(PyObject *self, PyObject *args) { Py_ssize_t i; + if (PySys_Audit("gc.get_referents", "O", args) < 0) { + return NULL; + } PyObject *result = PyList_New(0); if (result == NULL) @@ -1549,6 +1556,10 @@ gc_get_objects_impl(PyObject *module, Py_ssize_t generation) PyObject* result; struct _gc_runtime_state *state = &_PyRuntime.gc; + if (PySys_Audit("gc.get_objects", "n", generation) < 0) { + return NULL; + } + result = PyList_New(0); if (result == NULL) { return NULL; From webhook-mailer at python.org Wed Mar 10 05:14:37 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 10 Mar 2021 10:14:37 -0000 Subject: [Python-checkins] bpo-43445: Add frozen modules to sys.stdlib_module_names (GH-24798) Message-ID: https://github.com/python/cpython/commit/307745aa42196ad3fd97fee4a1ae6496bb895596 commit: 307745aa42196ad3fd97fee4a1ae6496bb895596 branch: master author: Victor Stinner committer: vstinner date: 2021-03-10T11:14:07+01:00 summary: bpo-43445: Add frozen modules to sys.stdlib_module_names (GH-24798) Add frozen modules to sys.stdlib_module_names. For example, add "_frozen_importlib" and "_frozen_importlib_external" names. Add "list_frozen" command to Programs/_testembed. files: A Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst M Makefile.pre.in M Programs/_testembed.c M Python/stdlib_module_names.h M Tools/scripts/generate_stdlib_module_names.py diff --git a/Makefile.pre.in b/Makefile.pre.in index 5d230ecb3d1f0..50bd75c63a44d 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -913,7 +913,7 @@ regen-keyword: $(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new .PHONY: regen-stdlib-module-names -regen-stdlib-module-names: build_all +regen-stdlib-module-names: build_all Programs/_testembed # Regenerate Python/stdlib_module_names.h # using Tools/scripts/generate_stdlib_module_names.py $(RUNSHARED) ./$(BUILDPYTHON) \ diff --git a/Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst b/Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst new file mode 100644 index 0000000000000..703cd027f0b76 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst @@ -0,0 +1,2 @@ +Add frozen modules to :data:`sys.stdlib_module_names`. For example, add +``"_frozen_importlib"`` and ``"_frozen_importlib_external"`` names. diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 52c56746813a3..0901933bfbb85 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1721,6 +1721,20 @@ static int test_unicode_id_init(void) } +// List frozen modules. +// Command used by Tools/scripts/generate_stdlib_module_names.py script. +static int list_frozen(void) +{ + const struct _frozen *p; + for (p = PyImport_FrozenModules; ; p++) { + if (p->name == NULL) + break; + printf("%s\n", p->name); + } + return 0; +} + + /* ********************************************************* * List of test cases and the function that implements it. @@ -1792,6 +1806,8 @@ static struct TestCase TestCases[] = { {"test_audit_run_stdin", test_audit_run_stdin}, {"test_unicode_id_init", test_unicode_id_init}, + + {"list_frozen", list_frozen}, {NULL, NULL} }; diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h index 01aa6753e4201..33fba383fea33 100644 --- a/Python/stdlib_module_names.h +++ b/Python/stdlib_module_names.h @@ -32,6 +32,8 @@ static const char* _Py_stdlib_module_names[] = { "_dbm", "_decimal", "_elementtree", +"_frozen_importlib", +"_frozen_importlib_external", "_functools", "_gdbm", "_hashlib", diff --git a/Tools/scripts/generate_stdlib_module_names.py b/Tools/scripts/generate_stdlib_module_names.py index 379b262e822db..b8afc898db421 100644 --- a/Tools/scripts/generate_stdlib_module_names.py +++ b/Tools/scripts/generate_stdlib_module_names.py @@ -11,14 +11,16 @@ STDLIB_PATH = os.path.join(SRC_DIR, 'Lib') MODULES_SETUP = os.path.join(SRC_DIR, 'Modules', 'Setup') SETUP_PY = os.path.join(SRC_DIR, 'setup.py') +TEST_EMBED = os.path.join(SRC_DIR, 'Programs', '_testembed') IGNORE = { '__init__', '__pycache__', 'site-packages', - # test modules - '__phello__.foo', + # Test modules and packages + '__hello__', + '__phello__', '_ctypes_test', '_testbuffer', '_testcapi', @@ -103,13 +105,40 @@ def list_modules_setup_extensions(names): names.add(name) +# List frozen modules of the PyImport_FrozenModules list (Python/frozen.c). +# Use the "./Programs/_testembed list_frozen" command. +def list_frozen(names): + args = [TEST_EMBED, 'list_frozen'] + proc = subprocess.run(args, stdout=subprocess.PIPE, text=True) + exitcode = proc.returncode + if exitcode: + cmd = ' '.join(args) + print(f"{cmd} failed with exitcode {exitcode}") + sys.exit(exitcode) + for line in proc.stdout.splitlines(): + name = line.strip() + names.add(name) + + def list_modules(): names = set(sys.builtin_module_names) | set(WINDOWS_MODULES) list_modules_setup_extensions(names) list_setup_extensions(names) list_packages(names) list_python_modules(names) - names -= set(IGNORE) + list_frozen(names) + + # Remove ignored packages and modules + for name in list(names): + package_name = name.split('.')[0] + # package_name can be equal to name + if package_name in IGNORE: + names.discard(name) + + for name in names: + if "." in name: + raise Exception("sub-modules must not be listed") + return names From webhook-mailer at python.org Wed Mar 10 05:40:03 2021 From: webhook-mailer at python.org (markshannon) Date: Wed, 10 Mar 2021 10:40:03 -0000 Subject: [Python-checkins] Fix typo in compile.c (GH-24812) Message-ID: https://github.com/python/cpython/commit/57827f87542726fe359991185db63b59ae08a69b commit: 57827f87542726fe359991185db63b59ae08a69b branch: master author: Ikko Ashimine committer: markshannon date: 2021-03-10T10:39:51Z summary: Fix typo in compile.c (GH-24812) guranteed -> guaranteed files: M Python/compile.c diff --git a/Python/compile.c b/Python/compile.c index b0d3127ff6878..a841288520b88 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -5754,7 +5754,7 @@ compiler_pattern_mapping(struct compiler *c, expr_ty p, pattern_context *pc) asdl_expr_seq *keys = p->v.Dict.keys; asdl_expr_seq *values = p->v.Dict.values; Py_ssize_t size = asdl_seq_LEN(values); - // A starred pattern will be a keyless value. It is guranteed to be last: + // A starred pattern will be a keyless value. It is guaranteed to be last: int star = size ? !asdl_seq_GET(keys, size - 1) : 0; ADDOP(c, MATCH_MAPPING); ADDOP_JUMP(c, POP_JUMP_IF_FALSE, fail_pop_1); From webhook-mailer at python.org Wed Mar 10 06:10:27 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 10 Mar 2021 11:10:27 -0000 Subject: [Python-checkins] bpo-43456: Remove _xxsubinterpreters from sys.stdlib_module_names (GH-24814) Message-ID: https://github.com/python/cpython/commit/a9c03d7fb78ab79710f79190f0584a09d9fd1a61 commit: a9c03d7fb78ab79710f79190f0584a09d9fd1a61 branch: master author: Victor Stinner committer: vstinner date: 2021-03-10T12:10:01+01:00 summary: bpo-43456: Remove _xxsubinterpreters from sys.stdlib_module_names (GH-24814) files: M Python/stdlib_module_names.h M Tools/scripts/generate_stdlib_module_names.py diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h index 33fba383fea33..980438545ac2f 100644 --- a/Python/stdlib_module_names.h +++ b/Python/stdlib_module_names.h @@ -85,7 +85,6 @@ static const char* _Py_stdlib_module_names[] = { "_weakref", "_weakrefset", "_winapi", -"_xxsubinterpreters", "_zoneinfo", "abc", "aifc", diff --git a/Tools/scripts/generate_stdlib_module_names.py b/Tools/scripts/generate_stdlib_module_names.py index b8afc898db421..046b9eb1d2df6 100644 --- a/Tools/scripts/generate_stdlib_module_names.py +++ b/Tools/scripts/generate_stdlib_module_names.py @@ -28,6 +28,7 @@ '_testimportmultiple', '_testinternalcapi', '_testmultiphase', + '_xxsubinterpreters', '_xxtestfuzz', 'distutils.tests', 'idlelib.idle_test', From webhook-mailer at python.org Wed Mar 10 09:27:03 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 10 Mar 2021 14:27:03 -0000 Subject: [Python-checkins] bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) Message-ID: https://github.com/python/cpython/commit/1fa17e8cc62775a2e34b158135ce8589f9394f03 commit: 1fa17e8cc62775a2e34b158135ce8589f9394f03 branch: master author: Victor Stinner committer: vstinner date: 2021-03-10T15:26:45+01:00 summary: bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) Fix a race condition of test_stress_modifying_handlers() of test_signal: only raise signals while we are in the catch_unraisable_exception() context manager. Moreover, don't check if we received at least one signal if at least one signal got ignored. files: M Lib/test/test_signal.py diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index c9de4a4e015a3..f973d4fe08be3 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -1280,11 +1280,16 @@ def cycle_handlers(): old_handler = signal.signal(signum, custom_handler) self.addCleanup(signal.signal, signum, old_handler) + t = threading.Thread(target=set_interrupts) - t.start() try: + ignored = False with support.catch_unraisable_exception() as cm: + t.start() cycle_handlers() + do_stop = True + t.join() + if cm.unraisable is not None: # An unraisable exception may be printed out when # a signal is ignored due to the aforementioned @@ -1293,8 +1298,13 @@ def cycle_handlers(): self.assertIn( f"Signal {signum} ignored due to race condition", str(cm.unraisable.exc_value)) - # Sanity check that some signals were received, but not all - self.assertGreater(num_received_signals, 0) + ignored = True + + # bpo-43406: Even if it is unlikely, it's technically possible that + # all signals were ignored because of race conditions. + if not ignored: + # Sanity check that some signals were received, but not all + self.assertGreater(num_received_signals, 0) self.assertLess(num_received_signals, num_sent_signals) finally: do_stop = True From webhook-mailer at python.org Wed Mar 10 09:49:36 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 10 Mar 2021 14:49:36 -0000 Subject: [Python-checkins] bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) Message-ID: https://github.com/python/cpython/commit/ac5e23c540f5ec20fc390c72e097e0fdaf8b7ac9 commit: ac5e23c540f5ec20fc390c72e097e0fdaf8b7ac9 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-10T06:49:27-08:00 summary: bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) Fix a race condition of test_stress_modifying_handlers() of test_signal: only raise signals while we are in the catch_unraisable_exception() context manager. Moreover, don't check if we received at least one signal if at least one signal got ignored. (cherry picked from commit 1fa17e8cc62775a2e34b158135ce8589f9394f03) Co-authored-by: Victor Stinner files: M Lib/test/test_signal.py diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 865e0102637c2..758e292fd5e37 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -1272,11 +1272,16 @@ def cycle_handlers(): old_handler = signal.signal(signum, custom_handler) self.addCleanup(signal.signal, signum, old_handler) + t = threading.Thread(target=set_interrupts) - t.start() try: + ignored = False with support.catch_unraisable_exception() as cm: + t.start() cycle_handlers() + do_stop = True + t.join() + if cm.unraisable is not None: # An unraisable exception may be printed out when # a signal is ignored due to the aforementioned @@ -1285,8 +1290,13 @@ def cycle_handlers(): self.assertIn( f"Signal {signum} ignored due to race condition", str(cm.unraisable.exc_value)) - # Sanity check that some signals were received, but not all - self.assertGreater(num_received_signals, 0) + ignored = True + + # bpo-43406: Even if it is unlikely, it's technically possible that + # all signals were ignored because of race conditions. + if not ignored: + # Sanity check that some signals were received, but not all + self.assertGreater(num_received_signals, 0) self.assertLess(num_received_signals, num_sent_signals) finally: do_stop = True From webhook-mailer at python.org Wed Mar 10 10:11:06 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 10 Mar 2021 15:11:06 -0000 Subject: [Python-checkins] bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) (GH-24817) Message-ID: https://github.com/python/cpython/commit/531f2ebd60a662111c78107935d249d3d52f9a4f commit: 531f2ebd60a662111c78107935d249d3d52f9a4f branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vstinner date: 2021-03-10T16:10:57+01:00 summary: bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) (GH-24817) Fix a race condition of test_stress_modifying_handlers() of test_signal: only raise signals while we are in the catch_unraisable_exception() context manager. Moreover, don't check if we received at least one signal if at least one signal got ignored. (cherry picked from commit 1fa17e8cc62775a2e34b158135ce8589f9394f03) Co-authored-by: Victor Stinner Co-authored-by: Victor Stinner files: M Lib/test/test_signal.py diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index b69daa7f02306..f18e72f6fc96b 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -1272,11 +1272,16 @@ def cycle_handlers(): old_handler = signal.signal(signum, custom_handler) self.addCleanup(signal.signal, signum, old_handler) + t = threading.Thread(target=set_interrupts) - t.start() try: + ignored = False with support.catch_unraisable_exception() as cm: + t.start() cycle_handlers() + do_stop = True + t.join() + if cm.unraisable is not None: # An unraisable exception may be printed out when # a signal is ignored due to the aforementioned @@ -1285,8 +1290,13 @@ def cycle_handlers(): self.assertIn( f"Signal {signum} ignored due to race condition", str(cm.unraisable.exc_value)) - # Sanity check that some signals were received, but not all - self.assertGreater(num_received_signals, 0) + ignored = True + + # bpo-43406: Even if it is unlikely, it's technically possible that + # all signals were ignored because of race conditions. + if not ignored: + # Sanity check that some signals were received, but not all + self.assertGreater(num_received_signals, 0) self.assertLess(num_received_signals, num_sent_signals) finally: do_stop = True From webhook-mailer at python.org Wed Mar 10 10:58:40 2021 From: webhook-mailer at python.org (brandtbucher) Date: Wed, 10 Mar 2021 15:58:40 -0000 Subject: [Python-checkins] Fix error in documentation for ast.match_case (GH-24807) Message-ID: https://github.com/python/cpython/commit/0a30f0e93495355900fc7add10cc3bddd648bac5 commit: 0a30f0e93495355900fc7add10cc3bddd648bac5 branch: master author: Adrian Freund committer: brandtbucher date: 2021-03-10T07:58:31-08:00 summary: Fix error in documentation for ast.match_case (GH-24807) files: M Doc/library/ast.rst diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index b5e1be8269115..4bc9906e8568a 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -1252,7 +1252,7 @@ Control flow :class:`match_case` nodes with the different cases. -.. class:: match_case(context_expr, optional_vars) +.. class:: match_case(pattern, guard, body) A single case pattern in a ``match`` statement. ``pattern`` contains the match pattern that will be used to match the subject against. Notice that From webhook-mailer at python.org Wed Mar 10 11:40:03 2021 From: webhook-mailer at python.org (corona10) Date: Wed, 10 Mar 2021 16:40:03 -0000 Subject: [Python-checkins] bpo-43287: Use PEP 590 vectorcall to speed up filter() (GH-24611) Message-ID: https://github.com/python/cpython/commit/9a9c11ad41d7887f3d6440e0f0e8966156d959b5 commit: 9a9c11ad41d7887f3d6440e0f0e8966156d959b5 branch: master author: Dong-hee Na committer: corona10 date: 2021-03-11T01:39:52+09:00 summary: bpo-43287: Use PEP 590 vectorcall to speed up filter() (GH-24611) files: A Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst M Python/bltinmodule.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst new file mode 100644 index 0000000000000..d8d5b2f2a9ceb --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst @@ -0,0 +1,2 @@ +Speed up calls to ``filter()`` by using the :pep:`590` ``vectorcall`` +calling convention. Patch by Dong-hee Na. diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index dec2984a068df..52591c4a46f3d 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -533,8 +533,40 @@ filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) Py_DECREF(it); return NULL; } - Py_INCREF(func); - lz->func = func; + + lz->func = Py_NewRef(func); + lz->it = it; + + return (PyObject *)lz; +} + +static PyObject * +filter_vectorcall(PyObject *type, PyObject * const*args, + size_t nargsf, PyObject *kwnames) +{ + PyTypeObject *tp = (PyTypeObject *)type; + if (tp == &PyFilter_Type && !_PyArg_NoKwnames("filter", kwnames)) { + return NULL; + } + + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); + if (!_PyArg_CheckPositional("filter", nargs, 2, 2)) { + return NULL; + } + + PyObject *it = PyObject_GetIter(args[1]); + if (it == NULL) { + return NULL; + } + + filterobject *lz = (filterobject *)tp->tp_alloc(tp, 0); + + if (lz == NULL) { + Py_DECREF(it); + return NULL; + } + + lz->func = Py_NewRef(args[0]); lz->it = it; return (PyObject *)lz; @@ -653,6 +685,7 @@ PyTypeObject PyFilter_Type = { PyType_GenericAlloc, /* tp_alloc */ filter_new, /* tp_new */ PyObject_GC_Del, /* tp_free */ + .tp_vectorcall = (vectorcallfunc)filter_vectorcall }; From webhook-mailer at python.org Wed Mar 10 14:01:00 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 10 Mar 2021 19:01:00 -0000 Subject: [Python-checkins] bpo-43311: Create GIL autoTSSkey ealier (GH-24819) Message-ID: https://github.com/python/cpython/commit/87f649a409da9d99682e78a55a83fc43225a8729 commit: 87f649a409da9d99682e78a55a83fc43225a8729 branch: master author: Victor Stinner committer: vstinner date: 2021-03-10T20:00:46+01:00 summary: bpo-43311: Create GIL autoTSSkey ealier (GH-24819) At Python startup, call _PyGILState_Init() before PyInterpreterState_New() which calls _PyThreadState_GET(). When Python is built using --with-experimental-isolated-subinterpreters, _PyThreadState_GET() uses autoTSSkey. files: M Include/internal/pycore_pylifecycle.h M Python/pylifecycle.c M Python/pystate.c diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h index 75f4cdbf9a735..a7d84a9b5883c 100644 --- a/Include/internal/pycore_pylifecycle.h +++ b/Include/internal/pycore_pylifecycle.h @@ -8,6 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif +#include "pycore_runtime.h" // _PyRuntimeState + /* Forward declarations */ struct _PyArgv; struct pyruntimestate; @@ -88,7 +90,8 @@ extern void _PyWarnings_Fini(PyInterpreterState *interp); extern void _PyAST_Fini(PyInterpreterState *interp); extern void _PyAtExit_Fini(PyInterpreterState *interp); -extern PyStatus _PyGILState_Init(PyThreadState *tstate); +extern PyStatus _PyGILState_Init(_PyRuntimeState *runtime); +extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate); extern void _PyGILState_Fini(PyInterpreterState *interp); PyAPI_FUNC(void) _PyGC_DumpShutdownStats(PyInterpreterState *interp); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index d03c6c07f7108..1b8c4357362d2 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -577,7 +577,7 @@ init_interp_create_gil(PyThreadState *tstate) _PyEval_FiniGIL(tstate->interp); /* Auto-thread-state API */ - status = _PyGILState_Init(tstate); + status = _PyGILState_SetTstate(tstate); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -597,12 +597,19 @@ pycore_create_interpreter(_PyRuntimeState *runtime, const PyConfig *config, PyThreadState **tstate_p) { + /* Auto-thread-state API */ + PyStatus status = _PyGILState_Init(runtime); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + PyInterpreterState *interp = PyInterpreterState_New(); if (interp == NULL) { return _PyStatus_ERR("can't make main interpreter"); } + assert(_Py_IsMainInterpreter(interp)); - PyStatus status = _PyConfig_Copy(&interp->config, config); + status = _PyConfig_Copy(&interp->config, config); if (_PyStatus_EXCEPTION(status)) { return status; } diff --git a/Python/pystate.c b/Python/pystate.c index e7c085d1f83a9..c8b2530f68dfe 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1327,7 +1327,21 @@ PyThreadState_IsCurrent(PyThreadState *tstate) Py_Initialize/Py_FinalizeEx */ PyStatus -_PyGILState_Init(PyThreadState *tstate) +_PyGILState_Init(_PyRuntimeState *runtime) +{ + struct _gilstate_runtime_state *gilstate = &runtime->gilstate; + if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { + return _PyStatus_NO_MEMORY(); + } + // PyThreadState_New() calls _PyGILState_NoteThreadState() which does + // nothing before autoInterpreterState is set. + assert(gilstate->autoInterpreterState == NULL); + return _PyStatus_OK(); +} + + +PyStatus +_PyGILState_SetTstate(PyThreadState *tstate) { if (!_Py_IsMainInterpreter(tstate->interp)) { /* Currently, PyGILState is shared by all interpreters. The main @@ -1341,9 +1355,6 @@ _PyGILState_Init(PyThreadState *tstate) struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; - if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { - return _PyStatus_NO_MEMORY(); - } gilstate->autoInterpreterState = tstate->interp; assert(PyThread_tss_get(&gilstate->autoTSSkey) == NULL); assert(tstate->gilstate_counter == 0); From webhook-mailer at python.org Thu Mar 11 14:43:51 2021 From: webhook-mailer at python.org (gpshead) Date: Thu, 11 Mar 2021 19:43:51 -0000 Subject: [Python-checkins] bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777) Message-ID: https://github.com/python/cpython/commit/b4fc44bb2d209182390b4f9fdf074a46b0165a2f commit: b4fc44bb2d209182390b4f9fdf074a46b0165a2f branch: master author: Chris Griffith committer: gpshead date: 2021-03-11T11:43:29-08:00 summary: bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777) Check to make sure stdout and stderr are not empty before selecting an item from them in Windows subprocess._communicate. Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst M Lib/subprocess.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index e4ca5f500c21a..d375514b2dd0a 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1535,10 +1535,8 @@ def _communicate(self, input, endtime, orig_timeout): self.stderr.close() # All data exchanged. Translate lists into strings. - if stdout is not None: - stdout = stdout[0] - if stderr is not None: - stderr = stderr[0] + stdout = stdout[0] if stdout else None + stderr = stderr[0] if stderr else None return (stdout, stderr) diff --git a/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst new file mode 100644 index 0000000000000..290d7fbd91800 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst @@ -0,0 +1,2 @@ +:func:`subprocess.communicate` no longer raises an IndexError when there is an +empty stdout or stderr IO buffer during a timeout on Windows. From webhook-mailer at python.org Thu Mar 11 17:36:02 2021 From: webhook-mailer at python.org (pitrou) Date: Thu, 11 Mar 2021 22:36:02 -0000 Subject: [Python-checkins] bpo-43356: Allow passing a signal number to interrupt_main() (GH-24755) Message-ID: https://github.com/python/cpython/commit/ba251c2ae6654bfc8abd9d886b219698ad34ac3c commit: ba251c2ae6654bfc8abd9d886b219698ad34ac3c branch: master author: Antoine Pitrou committer: pitrou date: 2021-03-11T23:35:45+01:00 summary: bpo-43356: Allow passing a signal number to interrupt_main() (GH-24755) Also introduce a new C API ``PyErr_SetInterruptEx(int signum)``. files: A Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst M Doc/c-api/exceptions.rst M Doc/data/stable_abi.dat M Doc/library/_thread.rst M Doc/whatsnew/3.10.rst M Include/internal/pycore_pylifecycle.h M Include/pyerrors.h M Lib/test/test_threading.py M Modules/_threadmodule.c M Modules/signalmodule.c M PC/python3dll.c diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 4e99a0167a632..158672d86b325 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -505,29 +505,73 @@ Signal Handling single: SIGINT single: KeyboardInterrupt (built-in exception) - This function interacts with Python's signal handling. It checks whether a - signal has been sent to the processes and if so, invokes the corresponding - signal handler. If the :mod:`signal` module is supported, this can invoke a - signal handler written in Python. In all cases, the default effect for - :const:`SIGINT` is to raise the :exc:`KeyboardInterrupt` exception. If an - exception is raised the error indicator is set and the function returns ``-1``; - otherwise the function returns ``0``. The error indicator may or may not be - cleared if it was previously set. + This function interacts with Python's signal handling. + + If the function is called from the main thread and under the main Python + interpreter, it checks whether a signal has been sent to the processes + and if so, invokes the corresponding signal handler. If the :mod:`signal` + module is supported, this can invoke a signal handler written in Python. + + The function attemps to handle all pending signals, and then returns ``0``. + However, if a Python signal handler raises an exception, the error + indicator is set and the function returns ``-1`` immediately (such that + other pending signals may not have been handled yet: they will be on the + next :c:func:`PyErr_CheckSignals()` invocation). + + If the function is called from a non-main thread, or under a non-main + Python interpreter, it does nothing and returns ``0``. + + This function can be called by long-running C code that wants to + be interruptible by user requests (such as by pressing Ctrl-C). + + .. note:: + The default Python signal handler for :const:`SIGINT` raises the + :exc:`KeyboardInterrupt` exception. .. c:function:: void PyErr_SetInterrupt() .. index:: + module: signal single: SIGINT single: KeyboardInterrupt (built-in exception) - Simulate the effect of a :const:`SIGINT` signal arriving. The next time + Simulate the effect of a :const:`SIGINT` signal arriving. + This is equivalent to ``PyErr_SetInterruptEx(SIGINT)``. + + .. note:: + This function is async-signal-safe. It can be called without + the :term:`GIL` and from a C signal handler. + + +.. c:function:: int PyErr_SetInterruptEx(int signum) + + .. index:: + module: signal + single: KeyboardInterrupt (built-in exception) + + Simulate the effect of a signal arriving. The next time :c:func:`PyErr_CheckSignals` is called, the Python signal handler for - :const:`SIGINT` will be called. + the given signal number will be called. + + This function can be called by C code that sets up its own signal handling + and wants Python signal handlers to be invoked as expected when an + interruption is requested (for example when the user presses Ctrl-C + to interrupt an operation). + + If the given signal isn't handled by Python (it was set to + :data:`signal.SIG_DFL` or :data:`signal.SIG_IGN`), it will be ignored. + + If *signum* is outside of the allowed range of signal numbers, ``-1`` + is returned. Otherwise, ``0`` is returned. The error indicator is + never changed by this function. + + .. note:: + This function is async-signal-safe. It can be called without + the :term:`GIL` and from a C signal handler. + + .. versionadded:: 3.10 - If :const:`SIGINT` isn't handled by Python (it was set to - :data:`signal.SIG_DFL` or :data:`signal.SIG_IGN`), this function does - nothing. .. c:function:: int PySignal_SetWakeupFd(int fd) diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index c2c9c6e11e4ce..906b0a72d1368 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -36,6 +36,7 @@ PyCFunction_Call PyCFunction_GetFlags PyCFunction_GetFunction PyCFunction_GetSelf +PyCFunction_New PyCFunction_NewEx PyCFunction_Type PyCMethod_New @@ -144,6 +145,7 @@ PyErr_SetFromErrnoWithFilenameObjects PyErr_SetImportError PyErr_SetImportErrorSubclass PyErr_SetInterrupt +PyErr_SetInterruptEx PyErr_SetNone PyErr_SetObject PyErr_SetString diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst index bd653ab32bb9c..1e6452b7b826f 100644 --- a/Doc/library/_thread.rst +++ b/Doc/library/_thread.rst @@ -61,15 +61,27 @@ This module defines the following constants and functions: :func:`sys.unraisablehook` is now used to handle unhandled exceptions. -.. function:: interrupt_main() +.. function:: interrupt_main(signum=signal.SIGINT, /) - Simulate the effect of a :data:`signal.SIGINT` signal arriving in the main - thread. A thread can use this function to interrupt the main thread. + Simulate the effect of a signal arriving in the main thread. + A thread can use this function to interrupt the main thread, though + there is no guarantee that the interruption will happen immediately. - If :data:`signal.SIGINT` isn't handled by Python (it was set to + If given, *signum* is the number of the signal to simulate. + If *signum* is not given, :data:`signal.SIGINT` is simulated. + + If the given signal isn't handled by Python (it was set to :data:`signal.SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing. + .. versionchanged:: 3.10 + The *signum* argument is added to customize the signal number. + + .. note:: + This does not emit the corresponding signal but schedules a call to + the associated handler (if it exists). + If you want to truly emit the signal, use :func:`signal.raise_signal`. + .. function:: exit() diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 814594a052595..db36f69e8d711 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -788,6 +788,13 @@ Add :data:`sys.stdlib_module_names`, containing the list of the standard library module names. (Contributed by Victor Stinner in :issue:`42955`.) +_thread +------- + +:func:`_thread.interrupt_main` now takes an optional signal number to +simulate (the default is still :data:`signal.SIGINT`). +(Contributed by Antoine Pitrou in :issue:`43356`.) + threading --------- @@ -1210,6 +1217,11 @@ New Features object is an instance of :class:`set` but not an instance of a subtype. (Contributed by Pablo Galindo in :issue:`43277`.) +* Added :c:func:`PyErr_SetInterruptEx` which allows passing a signal number + to simulate. + (Contributed by Antoine Pitrou in :issue:`43356`.) + + Porting to Python 3.10 ---------------------- diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h index a7d84a9b5883c..7ae107d73dae3 100644 --- a/Include/internal/pycore_pylifecycle.h +++ b/Include/internal/pycore_pylifecycle.h @@ -8,8 +8,24 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif +#ifdef HAVE_SIGNAL_H +#include +#endif + #include "pycore_runtime.h" // _PyRuntimeState +#ifndef NSIG +# if defined(_NSIG) +# define NSIG _NSIG /* For BSD/SysV */ +# elif defined(_SIGMAX) +# define NSIG (_SIGMAX + 1) /* For QNX */ +# elif defined(SIGMAX) +# define NSIG (SIGMAX + 1) /* For djgpp */ +# else +# define NSIG 64 /* Use a reasonable default value */ +# endif +#endif + /* Forward declarations */ struct _PyArgv; struct pyruntimestate; diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 692d67175741e..14129d3533cbe 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -224,6 +224,9 @@ PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); /* In signalmodule.c */ PyAPI_FUNC(int) PyErr_CheckSignals(void); PyAPI_FUNC(void) PyErr_SetInterrupt(void); +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000 +PyAPI_FUNC(int) PyErr_SetInterruptEx(int signum); +#endif /* Support for adding program text to SyntaxErrors */ PyAPI_FUNC(void) PyErr_SyntaxLocation( diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index a7a716ed59fc4..933935ba2ce2c 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1489,6 +1489,29 @@ def test__all__(self): class InterruptMainTests(unittest.TestCase): + def check_interrupt_main_with_signal_handler(self, signum): + def handler(signum, frame): + 1/0 + + old_handler = signal.signal(signum, handler) + self.addCleanup(signal.signal, signum, old_handler) + + with self.assertRaises(ZeroDivisionError): + _thread.interrupt_main() + + def check_interrupt_main_noerror(self, signum): + handler = signal.getsignal(signum) + try: + # No exception should arise. + signal.signal(signum, signal.SIG_IGN) + _thread.interrupt_main(signum) + + signal.signal(signum, signal.SIG_DFL) + _thread.interrupt_main(signum) + finally: + # Restore original handler + signal.signal(signum, handler) + def test_interrupt_main_subthread(self): # Calling start_new_thread with a function that executes interrupt_main # should raise KeyboardInterrupt upon completion. @@ -1506,18 +1529,18 @@ def test_interrupt_main_mainthread(self): with self.assertRaises(KeyboardInterrupt): _thread.interrupt_main() + def test_interrupt_main_with_signal_handler(self): + self.check_interrupt_main_with_signal_handler(signal.SIGINT) + self.check_interrupt_main_with_signal_handler(signal.SIGTERM) + def test_interrupt_main_noerror(self): - handler = signal.getsignal(signal.SIGINT) - try: - # No exception should arise. - signal.signal(signal.SIGINT, signal.SIG_IGN) - _thread.interrupt_main() + self.check_interrupt_main_noerror(signal.SIGINT) + self.check_interrupt_main_noerror(signal.SIGTERM) - signal.signal(signal.SIGINT, signal.SIG_DFL) - _thread.interrupt_main() - finally: - # Restore original handler - signal.signal(signal.SIGINT, handler) + def test_interrupt_main_invalid_signal(self): + self.assertRaises(ValueError, _thread.interrupt_main, -1) + self.assertRaises(ValueError, _thread.interrupt_main, signal.NSIG) + self.assertRaises(ValueError, _thread.interrupt_main, 1000000) class AtexitTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst b/Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst new file mode 100644 index 0000000000000..8b106f830f59b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst @@ -0,0 +1 @@ +Allow passing a signal number to ``_thread.interrupt_main()``. diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index f6217e672f7aa..0613dfd3070c5 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -9,6 +9,10 @@ #include // offsetof() #include "structmember.h" // PyMemberDef +#ifdef HAVE_SIGNAL_H +# include // SIGINT +#endif + // ThreadError is just an alias to PyExc_RuntimeError #define ThreadError PyExc_RuntimeError @@ -1173,17 +1177,29 @@ This is synonymous to ``raise SystemExit''. It will cause the current\n\ thread to exit silently unless the exception is caught."); static PyObject * -thread_PyThread_interrupt_main(PyObject * self, PyObject *Py_UNUSED(ignored)) +thread_PyThread_interrupt_main(PyObject *self, PyObject *args) { - PyErr_SetInterrupt(); + int signum = SIGINT; + if (!PyArg_ParseTuple(args, "|i:signum", &signum)) { + return NULL; + } + + if (PyErr_SetInterruptEx(signum)) { + PyErr_SetString(PyExc_ValueError, "signal number out of range"); + return NULL; + } Py_RETURN_NONE; } PyDoc_STRVAR(interrupt_doc, -"interrupt_main()\n\ +"interrupt_main(signum=signal.SIGINT, /)\n\ +\n\ +Simulate the arrival of the given signal in the main thread,\n\ +where the corresponding signal handler will be executed.\n\ +If *signum* is omitted, SIGINT is assumed.\n\ +A subthread can use this function to interrupt the main thread.\n\ \n\ -Raise a KeyboardInterrupt in the main thread.\n\ -A subthread can use this function to interrupt the main thread." +Note: the default signal hander for SIGINT raises ``KeyboardInterrupt``." ); static lockobject *newlockobject(PyObject *module); @@ -1527,8 +1543,8 @@ static PyMethodDef thread_methods[] = { METH_NOARGS, exit_doc}, {"exit", thread_PyThread_exit_thread, METH_NOARGS, exit_doc}, - {"interrupt_main", thread_PyThread_interrupt_main, - METH_NOARGS, interrupt_doc}, + {"interrupt_main", (PyCFunction)thread_PyThread_interrupt_main, + METH_VARARGS, interrupt_doc}, {"get_ident", thread_get_ident, METH_NOARGS, get_ident_doc}, #ifdef PY_HAVE_THREAD_NATIVE_ID diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index c6564be9c6aab..98a938f197673 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -8,6 +8,7 @@ #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_pyerrors.h" +#include "pycore_pylifecycle.h" #include "pycore_pystate.h" // _PyThreadState_GET() #ifndef MS_WINDOWS @@ -49,18 +50,6 @@ #define SIG_ERR ((PyOS_sighandler_t)(-1)) #endif -#ifndef NSIG -# if defined(_NSIG) -# define NSIG _NSIG /* For BSD/SysV */ -# elif defined(_SIGMAX) -# define NSIG (_SIGMAX + 1) /* For QNX */ -# elif defined(SIGMAX) -# define NSIG (SIGMAX + 1) /* For djgpp */ -# else -# define NSIG 64 /* Use a reasonable default value */ -# endif -#endif - #include "clinic/signalmodule.c.h" /*[clinic input] @@ -106,7 +95,10 @@ class sigset_t_converter(CConverter): static volatile struct { _Py_atomic_int tripped; - PyObject *func; + /* func is atomic to ensure that PyErr_SetInterrupt is async-signal-safe + * (even though it would probably be otherwise, anyway). + */ + _Py_atomic_address func; } Handlers[NSIG]; #ifdef MS_WINDOWS @@ -143,6 +135,16 @@ static HANDLE sigint_event = NULL; static PyObject *ItimerError; #endif +Py_LOCAL_INLINE(PyObject *) +get_handler(int i) { + return (PyObject *)_Py_atomic_load(&Handlers[i].func); +} + +Py_LOCAL_INLINE(void) +SetHandler(int i, PyObject* func) { + _Py_atomic_store(&Handlers[i].func, (uintptr_t)func); +} + #ifdef HAVE_GETITIMER /* auxiliary functions for setitimer */ static int @@ -516,8 +518,8 @@ signal_signal_impl(PyObject *module, int signalnum, PyObject *handler) return NULL; } - old_handler = Handlers[signalnum].func; - Handlers[signalnum].func = Py_NewRef(handler); + old_handler = get_handler(signalnum); + SetHandler(signalnum, Py_NewRef(handler)); if (old_handler != NULL) { return old_handler; @@ -553,7 +555,7 @@ signal_getsignal_impl(PyObject *module, int signalnum) "signal number out of range"); return NULL; } - old_handler = Handlers[signalnum].func; + old_handler = get_handler(signalnum); if (old_handler != NULL) { return Py_NewRef(old_handler); } @@ -1584,17 +1586,21 @@ signal_module_exec(PyObject *m) } // If signal_module_exec() is called more than one, we must // clear the strong reference to the previous function. - Py_XSETREF(Handlers[signum].func, Py_NewRef(func)); + PyObject* old_func = get_handler(signum); + SetHandler(signum, Py_NewRef(func)); + Py_XDECREF(old_func); } // Instal Python SIGINT handler which raises KeyboardInterrupt - if (Handlers[SIGINT].func == DefaultHandler) { + PyObject* sigint_func = get_handler(SIGINT); + if (sigint_func == DefaultHandler) { PyObject *int_handler = PyMapping_GetItemString(d, "default_int_handler"); if (!int_handler) { return -1; } - Py_SETREF(Handlers[SIGINT].func, int_handler); + SetHandler(SIGINT, int_handler); + Py_DECREF(sigint_func); PyOS_setsig(SIGINT, signal_handler); } @@ -1630,9 +1636,9 @@ _PySignal_Fini(void) { // Restore default signals and clear handlers for (int signum = 1; signum < NSIG; signum++) { - PyObject *func = Handlers[signum].func; + PyObject *func = get_handler(signum); _Py_atomic_store_relaxed(&Handlers[signum].tripped, 0); - Handlers[signum].func = NULL; + SetHandler(signum, NULL); if (func != NULL && func != Py_None && func != DefaultHandler @@ -1712,7 +1718,7 @@ _PyErr_CheckSignalsTstate(PyThreadState *tstate) * signal handler for it by the time PyErr_CheckSignals() is called * (see bpo-43406). */ - PyObject *func = Handlers[i].func; + PyObject *func = get_handler(i); if (func == NULL || func == Py_None || func == IgnoreHandler || func == DefaultHandler) { /* No Python signal handler due to aforementioned race condition. @@ -1761,18 +1767,27 @@ _PyErr_CheckSignals(void) } -/* Simulate the effect of a signal.SIGINT signal arriving. The next time - PyErr_CheckSignals is called, the Python SIGINT signal handler will be - raised. +/* Simulate the effect of a signal arriving. The next time PyErr_CheckSignals + is called, the corresponding Python signal handler will be raised. + + Missing signal handler for the given signal number is silently ignored. */ +int +PyErr_SetInterruptEx(int signum) +{ + if (signum < 1 || signum >= NSIG) { + return -1; + } + PyObject* func = get_handler(signum); + if (func != IgnoreHandler && func != DefaultHandler) { + trip_signal(signum); + } + return 0; +} - Missing signal handler for the SIGINT signal is silently ignored. */ void PyErr_SetInterrupt(void) { - if ((Handlers[SIGINT].func != IgnoreHandler) && - (Handlers[SIGINT].func != DefaultHandler)) { - trip_signal(SIGINT); - } + (void) PyErr_SetInterruptEx(SIGINT); } static int diff --git a/PC/python3dll.c b/PC/python3dll.c index 3f87b70b44848..027d4b1c6e386 100644 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -209,6 +209,7 @@ EXPORT_FUNC(PyErr_SetFromWindowsErrWithFilename) EXPORT_FUNC(PyErr_SetImportError) EXPORT_FUNC(PyErr_SetImportErrorSubclass) EXPORT_FUNC(PyErr_SetInterrupt) +EXPORT_FUNC(PyErr_SetInterruptEx) EXPORT_FUNC(PyErr_SetNone) EXPORT_FUNC(PyErr_SetObject) EXPORT_FUNC(PyErr_SetString) From webhook-mailer at python.org Thu Mar 11 20:53:00 2021 From: webhook-mailer at python.org (miss-islington) Date: Fri, 12 Mar 2021 01:53:00 -0000 Subject: [Python-checkins] bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777) Message-ID: https://github.com/python/cpython/commit/1a5001c606b55226c03fa1046aa8f5e1db2fa67d commit: 1a5001c606b55226c03fa1046aa8f5e1db2fa67d branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-11T17:52:50-08:00 summary: bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777) Check to make sure stdout and stderr are not empty before selecting an item from them in Windows subprocess._communicate. Co-authored-by: Gregory P. Smith (cherry picked from commit b4fc44bb2d209182390b4f9fdf074a46b0165a2f) Co-authored-by: Chris Griffith files: A Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst M Lib/subprocess.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index eecb1e7f253fb..d4d04a5c3436a 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1416,10 +1416,8 @@ def _communicate(self, input, endtime, orig_timeout): self.stderr.close() # All data exchanged. Translate lists into strings. - if stdout is not None: - stdout = stdout[0] - if stderr is not None: - stderr = stderr[0] + stdout = stdout[0] if stdout else None + stderr = stderr[0] if stderr else None return (stdout, stderr) diff --git a/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst new file mode 100644 index 0000000000000..290d7fbd91800 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst @@ -0,0 +1,2 @@ +:func:`subprocess.communicate` no longer raises an IndexError when there is an +empty stdout or stderr IO buffer during a timeout on Windows. From webhook-mailer at python.org Thu Mar 11 20:56:50 2021 From: webhook-mailer at python.org (miss-islington) Date: Fri, 12 Mar 2021 01:56:50 -0000 Subject: [Python-checkins] bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777) Message-ID: https://github.com/python/cpython/commit/ad83fde75463dad2df878ff264f52436eb48bc6b commit: ad83fde75463dad2df878ff264f52436eb48bc6b branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-11T17:56:35-08:00 summary: bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777) Check to make sure stdout and stderr are not empty before selecting an item from them in Windows subprocess._communicate. Co-authored-by: Gregory P. Smith (cherry picked from commit b4fc44bb2d209182390b4f9fdf074a46b0165a2f) Co-authored-by: Chris Griffith files: A Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst M Lib/subprocess.py diff --git a/Lib/subprocess.py b/Lib/subprocess.py index ddf1128fdd1c7..0311e3a1f83e8 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1525,10 +1525,8 @@ def _communicate(self, input, endtime, orig_timeout): self.stderr.close() # All data exchanged. Translate lists into strings. - if stdout is not None: - stdout = stdout[0] - if stderr is not None: - stderr = stderr[0] + stdout = stdout[0] if stdout else None + stderr = stderr[0] if stderr else None return (stdout, stderr) diff --git a/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst new file mode 100644 index 0000000000000..290d7fbd91800 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst @@ -0,0 +1,2 @@ +:func:`subprocess.communicate` no longer raises an IndexError when there is an +empty stdout or stderr IO buffer during a timeout on Windows. From webhook-mailer at python.org Fri Mar 12 03:46:36 2021 From: webhook-mailer at python.org (miss-islington) Date: Fri, 12 Mar 2021 08:46:36 -0000 Subject: [Python-checkins] [3.9] bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) (GH-24826) Message-ID: https://github.com/python/cpython/commit/4d7f11e05731f67fd2c07ec2972c6cb9861d52be commit: 4d7f11e05731f67fd2c07ec2972c6cb9861d52be branch: 3.9 author: Mariusz Felisiak committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-12T00:46:07-08:00 summary: [3.9] bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) (GH-24826) (cherry picked from commit bbba28212ce0f58096a4043f32442c6e727b74fc) Automerge-Triggered-By: GH:vsajip files: M Doc/library/logging.rst M Lib/logging/__init__.py diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index e63475d3b5a02..788925fed52ac 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -1106,18 +1106,27 @@ functions. .. function:: getLevelName(level) - Returns the textual representation of logging level *level*. If the level is one - of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`, - :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you - have associated levels with names using :func:`addLevelName` then the name you - have associated with *level* is returned. If a numeric value corresponding to one - of the defined levels is passed in, the corresponding string representation is - returned. Otherwise, the string 'Level %s' % level is returned. + Returns the textual or numeric representation of logging level *level*. + + If *level* is one of the predefined levels :const:`CRITICAL`, :const:`ERROR`, + :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the + corresponding string. If you have associated levels with names using + :func:`addLevelName` then the name you have associated with *level* is + returned. If a numeric value corresponding to one of the defined levels is + passed in, the corresponding string representation is returned. + + The *level* parameter also accepts a string representation of the level such + as 'INFO'. In such cases, this functions returns the corresponding numeric + value of the level. + + If no matching numeric or string value is passed in, the string + 'Level %s' % level is returned. .. note:: Levels are internally integers (as they need to be compared in the logging logic). This function is used to convert between an integer level and the level name displayed in the formatted log output by means of the - ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`). + ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and + vice versa. .. versionchanged:: 3.4 In Python versions earlier than 3.4, this function could also be passed a diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 6920a7b654a59..1ab35a8c21a10 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -118,7 +118,7 @@ def getLevelName(level): """ - Return the textual representation of logging level 'level'. + Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have @@ -128,7 +128,11 @@ def getLevelName(level): If a numeric value corresponding to one of the defined levels is passed in, the corresponding string representation is returned. - Otherwise, the string "Level %s" % level is returned. + If a string representation of the level is passed in, the corresponding + numeric value is returned. + + If no matching numeric or string value is passed in, the string + 'Level %s' % level is returned. """ # See Issues #22386, #27937 and #29220 for why it's this way result = _levelToName.get(level) From webhook-mailer at python.org Fri Mar 12 18:25:55 2021 From: webhook-mailer at python.org (orsenthil) Date: Fri, 12 Mar 2021 23:25:55 -0000 Subject: [Python-checkins] bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) Message-ID: https://github.com/python/cpython/commit/7591d9455eb37525c832da3d65e1a7b3e6dbf613 commit: 7591d9455eb37525c832da3d65e1a7b3e6dbf613 branch: master author: Pandu E POLUAN committer: orsenthil date: 2021-03-12T15:25:49-08:00 summary: bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) * Fix auth_login logic (bpo-27820) * Also fix a longstanding bug in the SimSMTPChannel.found_terminator() method that causes inability to test SMTP AUTH with initial_response_ok=False. files: A Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst M Lib/smtplib.py M Lib/test/test_smtplib.py diff --git a/Lib/smtplib.py b/Lib/smtplib.py index e81a9f05d60c4..0317248b74988 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -64,6 +64,7 @@ CRLF = "\r\n" bCRLF = b"\r\n" _MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3 +_MAXCHALLENGE = 5 # Maximum number of AUTH challenges sent OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) @@ -248,6 +249,7 @@ def __init__(self, host='', port=0, local_hostname=None, self.esmtp_features = {} self.command_encoding = 'ascii' self.source_address = source_address + self._auth_challenge_count = 0 if host: (code, msg) = self.connect(host, port) @@ -633,14 +635,23 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True): if initial_response is not None: response = encode_base64(initial_response.encode('ascii'), eol='') (code, resp) = self.docmd("AUTH", mechanism + " " + response) + self._auth_challenge_count = 1 else: (code, resp) = self.docmd("AUTH", mechanism) + self._auth_challenge_count = 0 # If server responds with a challenge, send the response. - if code == 334: + while code == 334: + self._auth_challenge_count += 1 challenge = base64.decodebytes(resp) response = encode_base64( authobject(challenge).encode('ascii'), eol='') (code, resp) = self.docmd(response) + # If server keeps sending challenges, something is wrong. + if self._auth_challenge_count > _MAXCHALLENGE: + raise SMTPException( + "Server AUTH mechanism infinite loop. Last response: " + + repr((code, resp)) + ) if code in (235, 503): return (code, resp) raise SMTPAuthenticationError(code, resp) @@ -662,7 +673,7 @@ def auth_plain(self, challenge=None): def auth_login(self, challenge=None): """ Authobject to use with LOGIN authentication. Requires self.user and self.password to be set.""" - if challenge is None: + if challenge is None or self._auth_challenge_count < 2: return self.user else: return self.password diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 1ad45d8c780d1..f3d33ab0772dd 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -785,7 +785,7 @@ def found_terminator(self): except ResponseException as e: self.smtp_state = self.COMMAND self.push('%s %s' % (e.smtp_code, e.smtp_error)) - return + return super().found_terminator() @@ -851,6 +851,11 @@ def _auth_login(self, arg=None): self._authenticated(self._auth_login_user, password == sim_auth[1]) del self._auth_login_user + def _auth_buggy(self, arg=None): + # This AUTH mechanism will 'trap' client in a neverending 334 + # base64 encoded 'BuGgYbUgGy' + self.push('334 QnVHZ1liVWdHeQ==') + def _auth_cram_md5(self, arg=None): if arg is None: self.push('334 {}'.format(sim_cram_md5_challenge)) @@ -1069,6 +1074,44 @@ def testAUTH_LOGIN(self): self.assertEqual(resp, (235, b'Authentication Succeeded')) smtp.close() + def testAUTH_LOGIN_initial_response_ok(self): + self.serv.add_feature("AUTH LOGIN") + with smtplib.SMTP(HOST, self.port, local_hostname='localhost', + timeout=support.LOOPBACK_TIMEOUT) as smtp: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_login") + resp = smtp.auth("LOGIN", smtp.auth_login, initial_response_ok=True) + self.assertEqual(resp, (235, b'Authentication Succeeded')) + + def testAUTH_LOGIN_initial_response_notok(self): + self.serv.add_feature("AUTH LOGIN") + with smtplib.SMTP(HOST, self.port, local_hostname='localhost', + timeout=support.LOOPBACK_TIMEOUT) as smtp: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_login") + resp = smtp.auth("LOGIN", smtp.auth_login, initial_response_ok=False) + self.assertEqual(resp, (235, b'Authentication Succeeded')) + + def testAUTH_BUGGY(self): + self.serv.add_feature("AUTH BUGGY") + + def auth_buggy(challenge=None): + self.assertEqual(b"BuGgYbUgGy", challenge) + return "\0" + + smtp = smtplib.SMTP( + HOST, self.port, local_hostname='localhost', + timeout=support.LOOPBACK_TIMEOUT + ) + try: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_buggy") + expect = r"^Server AUTH mechanism infinite loop.*" + with self.assertRaisesRegex(smtplib.SMTPException, expect) as cm: + smtp.auth("BUGGY", auth_buggy, initial_response_ok=False) + finally: + smtp.close() + @hashlib_helper.requires_hashdigest('md5') def testAUTH_CRAM_MD5(self): self.serv.add_feature("AUTH CRAM-MD5") diff --git a/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst new file mode 100644 index 0000000000000..7f1014d723b6a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst @@ -0,0 +1,8 @@ +Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with +initial_response_ok=False will fail. + +The cause is that SMTP.auth_login _always_ returns a password if provided +with a challenge string, thus non-compliant with the standard for AUTH +LOGIN. + +Also fixes bug with the test for smtpd. From webhook-mailer at python.org Fri Mar 12 19:15:33 2021 From: webhook-mailer at python.org (orsenthil) Date: Sat, 13 Mar 2021 00:15:33 -0000 Subject: [Python-checkins] bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) (#24832) Message-ID: https://github.com/python/cpython/commit/32717b982d3347e30ae53eb434e2a32e0d03d51e commit: 32717b982d3347e30ae53eb434e2a32e0d03d51e branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: orsenthil date: 2021-03-12T16:15:23-08:00 summary: bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) (#24832) * Fix auth_login logic (bpo-27820) * Also fix a longstanding bug in the SimSMTPChannel.found_terminator() method that causes inability to test SMTP AUTH with initial_response_ok=False. (cherry picked from commit 7591d9455eb37525c832da3d65e1a7b3e6dbf613) Co-authored-by: Pandu E POLUAN files: A Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst M Lib/smtplib.py M Lib/test/test_smtplib.py diff --git a/Lib/smtplib.py b/Lib/smtplib.py index f0472317de919..7b039692159bd 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -64,6 +64,7 @@ CRLF = "\r\n" bCRLF = b"\r\n" _MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3 +_MAXCHALLENGE = 5 # Maximum number of AUTH challenges sent OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) @@ -248,6 +249,7 @@ def __init__(self, host='', port=0, local_hostname=None, self.esmtp_features = {} self.command_encoding = 'ascii' self.source_address = source_address + self._auth_challenge_count = 0 if host: (code, msg) = self.connect(host, port) @@ -633,14 +635,23 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True): if initial_response is not None: response = encode_base64(initial_response.encode('ascii'), eol='') (code, resp) = self.docmd("AUTH", mechanism + " " + response) + self._auth_challenge_count = 1 else: (code, resp) = self.docmd("AUTH", mechanism) + self._auth_challenge_count = 0 # If server responds with a challenge, send the response. - if code == 334: + while code == 334: + self._auth_challenge_count += 1 challenge = base64.decodebytes(resp) response = encode_base64( authobject(challenge).encode('ascii'), eol='') (code, resp) = self.docmd(response) + # If server keeps sending challenges, something is wrong. + if self._auth_challenge_count > _MAXCHALLENGE: + raise SMTPException( + "Server AUTH mechanism infinite loop. Last response: " + + repr((code, resp)) + ) if code in (235, 503): return (code, resp) raise SMTPAuthenticationError(code, resp) @@ -662,7 +673,7 @@ def auth_plain(self, challenge=None): def auth_login(self, challenge=None): """ Authobject to use with LOGIN authentication. Requires self.user and self.password to be set.""" - if challenge is None: + if challenge is None or self._auth_challenge_count < 2: return self.user else: return self.password diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 3451f3a411e9a..c8c4d3ce49910 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -785,7 +785,7 @@ def found_terminator(self): except ResponseException as e: self.smtp_state = self.COMMAND self.push('%s %s' % (e.smtp_code, e.smtp_error)) - return + return super().found_terminator() @@ -851,6 +851,11 @@ def _auth_login(self, arg=None): self._authenticated(self._auth_login_user, password == sim_auth[1]) del self._auth_login_user + def _auth_buggy(self, arg=None): + # This AUTH mechanism will 'trap' client in a neverending 334 + # base64 encoded 'BuGgYbUgGy' + self.push('334 QnVHZ1liVWdHeQ==') + def _auth_cram_md5(self, arg=None): if arg is None: self.push('334 {}'.format(sim_cram_md5_challenge)) @@ -1069,6 +1074,44 @@ def testAUTH_LOGIN(self): self.assertEqual(resp, (235, b'Authentication Succeeded')) smtp.close() + def testAUTH_LOGIN_initial_response_ok(self): + self.serv.add_feature("AUTH LOGIN") + with smtplib.SMTP(HOST, self.port, local_hostname='localhost', + timeout=support.LOOPBACK_TIMEOUT) as smtp: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_login") + resp = smtp.auth("LOGIN", smtp.auth_login, initial_response_ok=True) + self.assertEqual(resp, (235, b'Authentication Succeeded')) + + def testAUTH_LOGIN_initial_response_notok(self): + self.serv.add_feature("AUTH LOGIN") + with smtplib.SMTP(HOST, self.port, local_hostname='localhost', + timeout=support.LOOPBACK_TIMEOUT) as smtp: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_login") + resp = smtp.auth("LOGIN", smtp.auth_login, initial_response_ok=False) + self.assertEqual(resp, (235, b'Authentication Succeeded')) + + def testAUTH_BUGGY(self): + self.serv.add_feature("AUTH BUGGY") + + def auth_buggy(challenge=None): + self.assertEqual(b"BuGgYbUgGy", challenge) + return "\0" + + smtp = smtplib.SMTP( + HOST, self.port, local_hostname='localhost', + timeout=support.LOOPBACK_TIMEOUT + ) + try: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_buggy") + expect = r"^Server AUTH mechanism infinite loop.*" + with self.assertRaisesRegex(smtplib.SMTPException, expect) as cm: + smtp.auth("BUGGY", auth_buggy, initial_response_ok=False) + finally: + smtp.close() + @hashlib_helper.requires_hashdigest('md5') def testAUTH_CRAM_MD5(self): self.serv.add_feature("AUTH CRAM-MD5") diff --git a/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst new file mode 100644 index 0000000000000..7f1014d723b6a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst @@ -0,0 +1,8 @@ +Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with +initial_response_ok=False will fail. + +The cause is that SMTP.auth_login _always_ returns a password if provided +with a challenge string, thus non-compliant with the standard for AUTH +LOGIN. + +Also fixes bug with the test for smtpd. From webhook-mailer at python.org Fri Mar 12 19:53:24 2021 From: webhook-mailer at python.org (orsenthil) Date: Sat, 13 Mar 2021 00:53:24 -0000 Subject: [Python-checkins] [3.8] bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) (#24833) Message-ID: https://github.com/python/cpython/commit/8cadc2c9cacfa1710cb5ca28a70f7782cacf09aa commit: 8cadc2c9cacfa1710cb5ca28a70f7782cacf09aa branch: 3.8 author: Senthil Kumaran committer: orsenthil date: 2021-03-12T16:53:13-08:00 summary: [3.8] bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) (#24833) * bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) * Fix auth_login logic (bpo-27820) * Also fix a longstanding bug in the SimSMTPChannel.found_terminator() method that causes inability to test SMTP AUTH with initial_response_ok=False. (cherry picked from commit 7591d9455eb37525c832da3d65e1a7b3e6dbf613) * Set timeout to 15 directly. Co-authored-by: Pandu E POLUAN files: A Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst M Lib/smtplib.py M Lib/test/test_smtplib.py diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 6513842eb6c61..b7a2715cd5899 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -64,6 +64,7 @@ CRLF = "\r\n" bCRLF = b"\r\n" _MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3 +_MAXCHALLENGE = 5 # Maximum number of AUTH challenges sent OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) @@ -248,6 +249,7 @@ def __init__(self, host='', port=0, local_hostname=None, self.esmtp_features = {} self.command_encoding = 'ascii' self.source_address = source_address + self._auth_challenge_count = 0 if host: (code, msg) = self.connect(host, port) @@ -631,14 +633,23 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True): if initial_response is not None: response = encode_base64(initial_response.encode('ascii'), eol='') (code, resp) = self.docmd("AUTH", mechanism + " " + response) + self._auth_challenge_count = 1 else: (code, resp) = self.docmd("AUTH", mechanism) + self._auth_challenge_count = 0 # If server responds with a challenge, send the response. - if code == 334: + while code == 334: + self._auth_challenge_count += 1 challenge = base64.decodebytes(resp) response = encode_base64( authobject(challenge).encode('ascii'), eol='') (code, resp) = self.docmd(response) + # If server keeps sending challenges, something is wrong. + if self._auth_challenge_count > _MAXCHALLENGE: + raise SMTPException( + "Server AUTH mechanism infinite loop. Last response: " + + repr((code, resp)) + ) if code in (235, 503): return (code, resp) raise SMTPAuthenticationError(code, resp) @@ -660,7 +671,7 @@ def auth_plain(self, challenge=None): def auth_login(self, challenge=None): """ Authobject to use with LOGIN authentication. Requires self.user and self.password to be set.""" - if challenge is None: + if challenge is None or self._auth_challenge_count < 2: return self.user else: return self.password diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index d0c9862edea93..c9205ae7ffa50 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -733,7 +733,7 @@ def found_terminator(self): except ResponseException as e: self.smtp_state = self.COMMAND self.push('%s %s' % (e.smtp_code, e.smtp_error)) - return + return super().found_terminator() @@ -799,6 +799,11 @@ def _auth_login(self, arg=None): self._authenticated(self._auth_login_user, password == sim_auth[1]) del self._auth_login_user + def _auth_buggy(self, arg=None): + # This AUTH mechanism will 'trap' client in a neverending 334 + # base64 encoded 'BuGgYbUgGy' + self.push('334 QnVHZ1liVWdHeQ==') + def _auth_cram_md5(self, arg=None): if arg is None: self.push('334 {}'.format(sim_cram_md5_challenge)) @@ -1011,6 +1016,39 @@ def testAUTH_LOGIN(self): self.assertEqual(resp, (235, b'Authentication Succeeded')) smtp.close() + def testAUTH_LOGIN_initial_response_ok(self): + self.serv.add_feature("AUTH LOGIN") + with smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) as smtp: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_login") + resp = smtp.auth("LOGIN", smtp.auth_login, initial_response_ok=True) + self.assertEqual(resp, (235, b'Authentication Succeeded')) + + def testAUTH_LOGIN_initial_response_notok(self): + self.serv.add_feature("AUTH LOGIN") + with smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) as smtp: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_login") + resp = smtp.auth("LOGIN", smtp.auth_login, initial_response_ok=False) + self.assertEqual(resp, (235, b'Authentication Succeeded')) + + def testAUTH_BUGGY(self): + self.serv.add_feature("AUTH BUGGY") + + def auth_buggy(challenge=None): + self.assertEqual(b"BuGgYbUgGy", challenge) + return "\0" + + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + try: + smtp.user, smtp.password = sim_auth + smtp.ehlo("test_auth_buggy") + expect = r"^Server AUTH mechanism infinite loop.*" + with self.assertRaisesRegex(smtplib.SMTPException, expect) as cm: + smtp.auth("BUGGY", auth_buggy, initial_response_ok=False) + finally: + smtp.close() + @requires_hashdigest('md5') def testAUTH_CRAM_MD5(self): self.serv.add_feature("AUTH CRAM-MD5") diff --git a/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst new file mode 100644 index 0000000000000..7f1014d723b6a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst @@ -0,0 +1,8 @@ +Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with +initial_response_ok=False will fail. + +The cause is that SMTP.auth_login _always_ returns a password if provided +with a challenge string, thus non-compliant with the standard for AUTH +LOGIN. + +Also fixes bug with the test for smtpd. From webhook-mailer at python.org Sat Mar 13 07:22:19 2021 From: webhook-mailer at python.org (orsenthil) Date: Sat, 13 Mar 2021 12:22:19 -0000 Subject: [Python-checkins] Update client.py (GH-24827) Message-ID: https://github.com/python/cpython/commit/b6884ad2688451dd3cbc5984b23da5840e1b6df8 commit: b6884ad2688451dd3cbc5984b23da5840e1b6df8 branch: master author: G?ry Ogam committer: orsenthil date: 2021-03-13T04:22:03-08:00 summary: Update client.py (GH-24827) files: M Lib/http/client.py diff --git a/Lib/http/client.py b/Lib/http/client.py index b339f20fc957a..c526380dcabfc 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -349,9 +349,6 @@ def begin(self): # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked" self.length = None length = self.headers.get("content-length") - - # are we using the chunked-style of transfer encoding? - tr_enc = self.headers.get("transfer-encoding") if length and not self.chunked: try: self.length = int(length) From webhook-mailer at python.org Sat Mar 13 07:26:14 2021 From: webhook-mailer at python.org (orsenthil) Date: Sat, 13 Mar 2021 12:26:14 -0000 Subject: [Python-checkins] Update link to Django's Context class. (#24805) Message-ID: https://github.com/python/cpython/commit/d0a445490e2c0e1d2aef3005f14211d9a85196bf commit: d0a445490e2c0e1d2aef3005f14211d9a85196bf branch: master author: Mariusz Felisiak committer: orsenthil date: 2021-03-13T04:26:11-08:00 summary: Update link to Django's Context class. (#24805) * Update link to Django's Context class. * Update link to get-pip.py. files: M Doc/library/collections.rst M Doc/library/venv.rst diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index aa0acfaae45a5..540db2002343e 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -123,7 +123,7 @@ The class can be used to simulate nested scopes and is useful in templating. writing to any mapping in the chain. * Django's `Context class - `_ + `_ for templating is a read-only chain of mappings. It also features pushing and popping of contexts similar to the :meth:`~collections.ChainMap.new_child` method and the diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index 5d4a36481f1dc..2a4eede91a7c1 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -404,7 +404,7 @@ subclass which installs setuptools and pip into a created virtual environment:: :param context: The information for the virtual environment creation request being processed. """ - url = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py' + url = 'https://bootstrap.pypa.io/get-pip.py' self.install_script(context, 'pip', url) def main(args=None): From webhook-mailer at python.org Sat Mar 13 07:34:42 2021 From: webhook-mailer at python.org (orsenthil) Date: Sat, 13 Mar 2021 12:34:42 -0000 Subject: [Python-checkins] Update link to Django's Context class. (GH-24805) (#24842) Message-ID: https://github.com/python/cpython/commit/db2762c3f24be3a1783e9d1e5fadb1a7d8d22a7c commit: db2762c3f24be3a1783e9d1e5fadb1a7d8d22a7c branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: orsenthil date: 2021-03-13T04:34:38-08:00 summary: Update link to Django's Context class. (GH-24805) (#24842) * Update link to Django's Context class. * Update link to get-pip.py. (cherry picked from commit d0a445490e2c0e1d2aef3005f14211d9a85196bf) Co-authored-by: Mariusz Felisiak files: M Doc/library/collections.rst M Doc/library/venv.rst diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index d4297166597b6..7cbc1721df151 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -125,7 +125,7 @@ The class can be used to simulate nested scopes and is useful in templating. writing to any mapping in the chain. * Django's `Context class - `_ + `_ for templating is a read-only chain of mappings. It also features pushing and popping of contexts similar to the :meth:`~collections.ChainMap.new_child` method and the diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index 59b251837a489..593ba96cf38be 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -386,7 +386,7 @@ subclass which installs setuptools and pip into a created virtual environment:: :param context: The information for the virtual environment creation request being processed. """ - url = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py' + url = 'https://bootstrap.pypa.io/get-pip.py' self.install_script(context, 'pip', url) def main(args=None): From webhook-mailer at python.org Sat Mar 13 07:34:50 2021 From: webhook-mailer at python.org (orsenthil) Date: Sat, 13 Mar 2021 12:34:50 -0000 Subject: [Python-checkins] Update link to Django's Context class. (GH-24805) (#24841) Message-ID: https://github.com/python/cpython/commit/5c674e44798ba3235e7786b3cf3bc43a4d4e8102 commit: 5c674e44798ba3235e7786b3cf3bc43a4d4e8102 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: orsenthil date: 2021-03-13T04:34:46-08:00 summary: Update link to Django's Context class. (GH-24805) (#24841) * Update link to Django's Context class. * Update link to get-pip.py. (cherry picked from commit d0a445490e2c0e1d2aef3005f14211d9a85196bf) Co-authored-by: Mariusz Felisiak files: M Doc/library/collections.rst M Doc/library/venv.rst diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 2ffdb49dbe6da..4dc1b9fc2ec74 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -128,7 +128,7 @@ The class can be used to simulate nested scopes and is useful in templating. writing to any mapping in the chain. * Django's `Context class - `_ + `_ for templating is a read-only chain of mappings. It also features pushing and popping of contexts similar to the :meth:`~collections.ChainMap.new_child` method and the diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index 8abadc4df3cac..e020570896acb 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -400,7 +400,7 @@ subclass which installs setuptools and pip into a created virtual environment:: :param context: The information for the virtual environment creation request being processed. """ - url = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py' + url = 'https://bootstrap.pypa.io/get-pip.py' self.install_script(context, 'pip', url) def main(args=None): From webhook-mailer at python.org Sat Mar 13 07:44:40 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 13 Mar 2021 12:44:40 -0000 Subject: [Python-checkins] Update client.py (GH-24827) Message-ID: https://github.com/python/cpython/commit/53ab4af4444a01ef3848e49278a0b46c8f9e99cf commit: 53ab4af4444a01ef3848e49278a0b46c8f9e99cf branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-13T04:44:36-08:00 summary: Update client.py (GH-24827) (cherry picked from commit b6884ad2688451dd3cbc5984b23da5840e1b6df8) Co-authored-by: G?ry Ogam files: M Lib/http/client.py diff --git a/Lib/http/client.py b/Lib/http/client.py index a96fd5ebb2e86..df417cf65e204 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -349,9 +349,6 @@ def begin(self): # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked" self.length = None length = self.headers.get("content-length") - - # are we using the chunked-style of transfer encoding? - tr_enc = self.headers.get("transfer-encoding") if length and not self.chunked: try: self.length = int(length) From webhook-mailer at python.org Sat Mar 13 08:09:07 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 13 Mar 2021 13:09:07 -0000 Subject: [Python-checkins] Update client.py (GH-24827) Message-ID: https://github.com/python/cpython/commit/9f935fabab36ec1a94f7dab828f5bb48300994d2 commit: 9f935fabab36ec1a94f7dab828f5bb48300994d2 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-13T05:09:03-08:00 summary: Update client.py (GH-24827) (cherry picked from commit b6884ad2688451dd3cbc5984b23da5840e1b6df8) Co-authored-by: G?ry Ogam files: M Lib/http/client.py diff --git a/Lib/http/client.py b/Lib/http/client.py index 16afc871ea6d7..20a25de855625 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -349,9 +349,6 @@ def begin(self): # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked" self.length = None length = self.headers.get("content-length") - - # are we using the chunked-style of transfer encoding? - tr_enc = self.headers.get("transfer-encoding") if length and not self.chunked: try: self.length = int(length) From webhook-mailer at python.org Sat Mar 13 08:25:31 2021 From: webhook-mailer at python.org (vstinner) Date: Sat, 13 Mar 2021 13:25:31 -0000 Subject: [Python-checkins] bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821) Message-ID: https://github.com/python/cpython/commit/5bd1059184b154d339f1bd53d23c98b5bcf14c8c commit: 5bd1059184b154d339f1bd53d23c98b5bcf14c8c branch: master author: junyixie committer: vstinner date: 2021-03-13T14:25:14+01:00 summary: bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821) files: M Include/internal/pycore_dtoa.h M Include/internal/pycore_interp.h M Python/dtoa.c diff --git a/Include/internal/pycore_dtoa.h b/Include/internal/pycore_dtoa.h index 3faf8cf6b2eef..0f61e75140858 100644 --- a/Include/internal/pycore_dtoa.h +++ b/Include/internal/pycore_dtoa.h @@ -1,4 +1,6 @@ #ifndef PY_NO_SHORT_FLOAT_REPR +#ifndef Py_INTERNAL_DTOA_H +#define Py_INTERNAL_DTOA_H #ifdef __cplusplus extern "C" { #endif @@ -17,7 +19,21 @@ PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); PyAPI_FUNC(double) _Py_dg_stdnan(int sign); PyAPI_FUNC(double) _Py_dg_infinity(int sign); +#define _PyDtoa_Kmax 7 + +typedef uint32_t _PyDtoa_ULong; +typedef int32_t _PyDtoa_Long; +typedef uint64_t _PyDtoa_ULLong; + +struct +_PyDtoa_Bigint { + struct _PyDtoa_Bigint *next; + int k, maxwds, sign, wds; + _PyDtoa_ULong x[1]; +}; + #ifdef __cplusplus } #endif +#endif /* !Py_INTERNAL_DTOA_H */ #endif /* !PY_NO_SHORT_FLOAT_REPR */ diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 477cbf0c24586..ea770daedd8a1 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -13,6 +13,7 @@ extern "C" { #include "pycore_gil.h" // struct _gil_runtime_state #include "pycore_gc.h" // struct _gc_runtime_state #include "pycore_warnings.h" // struct _warnings_runtime_state +#include "pycore_dtoa.h" struct _pending_calls { PyThread_type_lock lock; @@ -321,6 +322,9 @@ struct _is { struct ast_state ast; struct type_cache type_cache; +#ifndef PY_NO_SHORT_FLOAT_REPR + struct _PyDtoa_Bigint *dtoa_freelist[_PyDtoa_Kmax + 1]; +#endif }; extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); diff --git a/Python/dtoa.c b/Python/dtoa.c index e629b296426f3..c7002e5d86d51 100644 --- a/Python/dtoa.c +++ b/Python/dtoa.c @@ -119,6 +119,16 @@ #include "Python.h" #include "pycore_dtoa.h" +#include "pycore_interp.h" +#include "pycore_pystate.h" + +#define ULong _PyDtoa_ULong +#define Long _PyDtoa_Long +#define ULLong _PyDtoa_ULLong +#define Kmax _PyDtoa_Kmax + +typedef struct _PyDtoa_Bigint Bigint; + /* if PY_NO_SHORT_FLOAT_REPR is defined, then don't even try to compile the following code */ @@ -154,11 +164,6 @@ #error "doubles and ints have incompatible endianness" #endif - -typedef uint32_t ULong; -typedef int32_t Long; -typedef uint64_t ULLong; - #undef DEBUG #ifdef Py_DEBUG #define DEBUG @@ -297,8 +302,6 @@ BCinfo { #define FFFFFFFF 0xffffffffUL -#define Kmax 7 - /* struct Bigint is used to represent arbitrary-precision integers. These integers are stored in sign-magnitude format, with the magnitude stored as an array of base 2**32 digits. Bigints are always normalized: if x is a @@ -321,14 +324,6 @@ BCinfo { significant (x[0]) to most significant (x[wds-1]). */ -struct -Bigint { - struct Bigint *next; - int k, maxwds, sign, wds; - ULong x[1]; -}; - -typedef struct Bigint Bigint; #ifndef Py_USING_MEMORY_DEBUGGER @@ -351,7 +346,13 @@ typedef struct Bigint Bigint; Bfree to PyMem_Free. Investigate whether this has any significant performance on impact. */ -static Bigint *freelist[Kmax+1]; + +/* Get Bigint freelist from interpreter */ +static Bigint ** +get_freelist(void) { + PyInterpreterState *interp = _PyInterpreterState_GET(); + return interp->dtoa_freelist; +} /* Allocate space for a Bigint with up to 1<next; else { @@ -393,6 +394,7 @@ Bfree(Bigint *v) if (v->k > Kmax) FREE((void*)v); else { + Bigint **freelist = get_freelist(); v->next = freelist[v->k]; freelist[v->k] = v; } From webhook-mailer at python.org Sat Mar 13 08:38:44 2021 From: webhook-mailer at python.org (vstinner) Date: Sat, 13 Mar 2021 13:38:44 -0000 Subject: [Python-checkins] bpo-43441: Fix _PyType_ClearCache() for subinterpreters (GH-24822) Message-ID: https://github.com/python/cpython/commit/75048c8a38005845f10f8cb1dd33a31e0052cae0 commit: 75048c8a38005845f10f8cb1dd33a31e0052cae0 branch: master author: junyixie committer: vstinner date: 2021-03-13T14:38:36+01:00 summary: bpo-43441: Fix _PyType_ClearCache() for subinterpreters (GH-24822) _PyType_ClearCache() now only resets next_version_tag in the main interpreter. Co-authored-by: Victor Stinner files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 9e7121448f87d..650e4144f1627 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -39,6 +39,7 @@ class object "PyObject *" "&PyBaseObject_Type" PyUnicode_IS_READY(name) && \ (PyUnicode_GET_LENGTH(name) <= MCACHE_MAX_ATTR_SIZE) +// bpo-42745: next_version_tag remains shared by all interpreters because of static types // Used to set PyTypeObject.tp_version_tag static unsigned int next_version_tag = 0; @@ -252,8 +253,9 @@ _PyType_InitCache(PyInterpreterState *interp) static unsigned int -_PyType_ClearCache(struct type_cache *cache) +_PyType_ClearCache(PyInterpreterState *interp) { + struct type_cache *cache = &interp->type_cache; #if MCACHE_STATS size_t total = cache->hits + cache->collisions + cache->misses; fprintf(stderr, "-- Method cache hits = %zd (%d%%)\n", @@ -267,7 +269,10 @@ _PyType_ClearCache(struct type_cache *cache) #endif unsigned int cur_version_tag = next_version_tag - 1; - next_version_tag = 0; + if (_Py_IsMainInterpreter(interp)) { + next_version_tag = 0; + } + type_cache_clear(cache, 0); return cur_version_tag; @@ -277,15 +282,15 @@ _PyType_ClearCache(struct type_cache *cache) unsigned int PyType_ClearCache(void) { - struct type_cache *cache = get_type_cache(); - return _PyType_ClearCache(cache); + PyInterpreterState *interp = _PyInterpreterState_GET(); + return _PyType_ClearCache(interp); } void _PyType_Fini(PyInterpreterState *interp) { - _PyType_ClearCache(&interp->type_cache); + _PyType_ClearCache(interp); if (_Py_IsMainInterpreter(interp)) { clear_slotdefs(); } From webhook-mailer at python.org Sat Mar 13 10:33:47 2021 From: webhook-mailer at python.org (berkerpeksag) Date: Sat, 13 Mar 2021 15:33:47 -0000 Subject: [Python-checkins] bpo-43444: Move sqlite3 MODULE_NAME from setup.py to module.h (GH-24801) Message-ID: https://github.com/python/cpython/commit/2256a2876b5214a5a7492bf78bd86cf8beb690bf commit: 2256a2876b5214a5a7492bf78bd86cf8beb690bf branch: master author: Erlend Egeberg Aasland committer: berkerpeksag date: 2021-03-13T17:33:39+02:00 summary: bpo-43444: Move sqlite3 MODULE_NAME from setup.py to module.h (GH-24801) files: M Modules/_sqlite/cache.h M Modules/_sqlite/module.h M Modules/_sqlite/prepare_protocol.h M PCbuild/_sqlite3.vcxproj M setup.py diff --git a/Modules/_sqlite/cache.h b/Modules/_sqlite/cache.h index 4a1977fcd2cd2..083356f93f9e4 100644 --- a/Modules/_sqlite/cache.h +++ b/Modules/_sqlite/cache.h @@ -23,8 +23,7 @@ #ifndef PYSQLITE_CACHE_H #define PYSQLITE_CACHE_H -#define PY_SSIZE_T_CLEAN -#include "Python.h" +#include "module.h" /* The LRU cache is implemented as a combination of a doubly-linked with a * dictionary. The list items are of type 'Node' and the dictionary has the diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h index 3185ec9788856..9aede92ea33c9 100644 --- a/Modules/_sqlite/module.h +++ b/Modules/_sqlite/module.h @@ -27,6 +27,7 @@ #include "Python.h" #define PYSQLITE_VERSION "2.6.0" +#define MODULE_NAME "sqlite3" extern PyObject* pysqlite_Error; extern PyObject* pysqlite_Warning; diff --git a/Modules/_sqlite/prepare_protocol.h b/Modules/_sqlite/prepare_protocol.h index 42d07cbe9f16f..593961331c90d 100644 --- a/Modules/_sqlite/prepare_protocol.h +++ b/Modules/_sqlite/prepare_protocol.h @@ -23,8 +23,7 @@ #ifndef PYSQLITE_PREPARE_PROTOCOL_H #define PYSQLITE_PREPARE_PROTOCOL_H -#define PY_SSIZE_T_CLEAN -#include "Python.h" +#include "module.h" typedef struct { diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj index 7e0062692b8f8..5eb8559d2925e 100644 --- a/PCbuild/_sqlite3.vcxproj +++ b/PCbuild/_sqlite3.vcxproj @@ -94,7 +94,6 @@ $(sqlite3Dir);%(AdditionalIncludeDirectories) - MODULE_NAME="sqlite3";%(PreprocessorDefinitions) diff --git a/setup.py b/setup.py index 554772217785d..3467f559e5808 100644 --- a/setup.py +++ b/setup.py @@ -1571,12 +1571,7 @@ def detect_sqlite(self): '_sqlite/row.c', '_sqlite/statement.c', '_sqlite/util.c', ] - sqlite_defines = [] - if not MS_WINDOWS: - sqlite_defines.append(('MODULE_NAME', '"sqlite3"')) - else: - sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"')) # Enable support for loadable extensions in the sqlite3 module # if --enable-loadable-sqlite-extensions configure option is used. From webhook-mailer at python.org Sat Mar 13 11:32:00 2021 From: webhook-mailer at python.org (jaraco) Date: Sat, 13 Mar 2021 16:32:00 -0000 Subject: [Python-checkins] bpo-43428: Sync with importlib_metadata 3.7. (GH-24782) Message-ID: https://github.com/python/cpython/commit/f917efccf8d5aa2b8315d2a832a520339e668187 commit: f917efccf8d5aa2b8315d2a832a520339e668187 branch: master author: Jason R. Coombs committer: jaraco date: 2021-03-13T11:31:45-05:00 summary: bpo-43428: Sync with importlib_metadata 3.7. (GH-24782) * bpo-43428: Sync with importlib_metadata 3.7.2 (67234b6) * Add blurb * Reformat blurb to create separate paragraphs for each change included. files: A Lib/importlib/_itertools.py A Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst M Doc/library/importlib.metadata.rst M Lib/importlib/metadata.py M Lib/test/test_importlib/fixtures.py M Lib/test/test_importlib/test_main.py M Lib/test/test_importlib/test_metadata_api.py M Lib/test/test_importlib/test_zip.py diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 7f154ea02cc4f..ffce1bae979b5 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -74,18 +74,20 @@ This package provides the following functionality via its public API. Entry points ------------ -The ``entry_points()`` function returns a dictionary of all entry points, -keyed by group. Entry points are represented by ``EntryPoint`` instances; +The ``entry_points()`` function returns a collection of entry points. +Entry points are represented by ``EntryPoint`` instances; each ``EntryPoint`` has a ``.name``, ``.group``, and ``.value`` attributes and a ``.load()`` method to resolve the value. There are also ``.module``, ``.attr``, and ``.extras`` attributes for getting the components of the ``.value`` attribute:: >>> eps = entry_points() # doctest: +SKIP - >>> list(eps) # doctest: +SKIP + >>> sorted(eps.groups) # doctest: +SKIP ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation'] - >>> scripts = eps['console_scripts'] # doctest: +SKIP - >>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0] # doctest: +SKIP + >>> scripts = eps.select(group='console_scripts') # doctest: +SKIP + >>> 'wheel' in scripts.names # doctest: +SKIP + True + >>> wheel = scripts['wheel'] # doctest: +SKIP >>> wheel # doctest: +SKIP EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts') >>> wheel.module # doctest: +SKIP @@ -187,6 +189,17 @@ function:: ["pytest (>=3.0.0) ; extra == 'test'", "pytest-cov ; extra == 'test'"] +Package distributions +--------------------- + +A convience method to resolve the distribution or +distributions (in the case of a namespace package) for top-level +Python packages or modules:: + + >>> packages_distributions() + {'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': ['jaraco.classes', 'jaraco.functools'], ...} + + Distributions ============= diff --git a/Lib/importlib/_itertools.py b/Lib/importlib/_itertools.py new file mode 100644 index 0000000000000..dd45f2f096630 --- /dev/null +++ b/Lib/importlib/_itertools.py @@ -0,0 +1,19 @@ +from itertools import filterfalse + + +def unique_everseen(iterable, key=None): + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen = set() + seen_add = seen.add + if key is None: + for element in filterfalse(seen.__contains__, iterable): + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element diff --git a/Lib/importlib/metadata.py b/Lib/importlib/metadata.py index 36bb42ee21d9c..8a731858cad70 100644 --- a/Lib/importlib/metadata.py +++ b/Lib/importlib/metadata.py @@ -4,20 +4,24 @@ import csv import sys import email +import inspect import pathlib import zipfile import operator +import warnings import functools import itertools import posixpath -import collections +import collections.abc + +from ._itertools import unique_everseen from configparser import ConfigParser from contextlib import suppress from importlib import import_module from importlib.abc import MetaPathFinder from itertools import starmap -from typing import Any, List, Optional, Protocol, TypeVar, Union +from typing import Any, List, Mapping, Optional, Protocol, TypeVar, Union __all__ = [ @@ -120,18 +124,19 @@ def _from_text(cls, text): config.read_string(text) return cls._from_config(config) - @classmethod - def _from_text_for(cls, text, dist): - return (ep._for(dist) for ep in cls._from_text(text)) - def _for(self, dist): self.dist = dist return self def __iter__(self): """ - Supply iter so one may construct dicts of EntryPoints easily. + Supply iter so one may construct dicts of EntryPoints by name. """ + msg = ( + "Construction of dict of EntryPoints is deprecated in " + "favor of EntryPoints." + ) + warnings.warn(msg, DeprecationWarning) return iter((self.name, self)) def __reduce__(self): @@ -140,6 +145,143 @@ def __reduce__(self): (self.name, self.value, self.group), ) + def matches(self, **params): + attrs = (getattr(self, param) for param in params) + return all(map(operator.eq, params.values(), attrs)) + + +class EntryPoints(tuple): + """ + An immutable collection of selectable EntryPoint objects. + """ + + __slots__ = () + + def __getitem__(self, name): # -> EntryPoint: + try: + return next(iter(self.select(name=name))) + except StopIteration: + raise KeyError(name) + + def select(self, **params): + return EntryPoints(ep for ep in self if ep.matches(**params)) + + @property + def names(self): + return set(ep.name for ep in self) + + @property + def groups(self): + """ + For coverage while SelectableGroups is present. + >>> EntryPoints().groups + set() + """ + return set(ep.group for ep in self) + + @classmethod + def _from_text_for(cls, text, dist): + return cls(ep._for(dist) for ep in EntryPoint._from_text(text)) + + +def flake8_bypass(func): + is_flake8 = any('flake8' in str(frame.filename) for frame in inspect.stack()[:5]) + return func if not is_flake8 else lambda: None + + +class Deprecated: + """ + Compatibility add-in for mapping to indicate that + mapping behavior is deprecated. + + >>> recwarn = getfixture('recwarn') + >>> class DeprecatedDict(Deprecated, dict): pass + >>> dd = DeprecatedDict(foo='bar') + >>> dd.get('baz', None) + >>> dd['foo'] + 'bar' + >>> list(dd) + ['foo'] + >>> list(dd.keys()) + ['foo'] + >>> 'foo' in dd + True + >>> list(dd.values()) + ['bar'] + >>> len(recwarn) + 1 + """ + + _warn = functools.partial( + warnings.warn, + "SelectableGroups dict interface is deprecated. Use select.", + DeprecationWarning, + stacklevel=2, + ) + + def __getitem__(self, name): + self._warn() + return super().__getitem__(name) + + def get(self, name, default=None): + flake8_bypass(self._warn)() + return super().get(name, default) + + def __iter__(self): + self._warn() + return super().__iter__() + + def __contains__(self, *args): + self._warn() + return super().__contains__(*args) + + def keys(self): + self._warn() + return super().keys() + + def values(self): + self._warn() + return super().values() + + +class SelectableGroups(dict): + """ + A backward- and forward-compatible result from + entry_points that fully implements the dict interface. + """ + + @classmethod + def load(cls, eps): + by_group = operator.attrgetter('group') + ordered = sorted(eps, key=by_group) + grouped = itertools.groupby(ordered, by_group) + return cls((group, EntryPoints(eps)) for group, eps in grouped) + + @property + def _all(self): + """ + Reconstruct a list of all entrypoints from the groups. + """ + return EntryPoints(itertools.chain.from_iterable(self.values())) + + @property + def groups(self): + return self._all.groups + + @property + def names(self): + """ + for coverage: + >>> SelectableGroups().names + set() + """ + return self._all.names + + def select(self, **params): + if not params: + return self + return self._all.select(**params) + class PackagePath(pathlib.PurePosixPath): """A reference to a path in a package""" @@ -296,7 +438,7 @@ def version(self): @property def entry_points(self): - return list(EntryPoint._from_text_for(self.read_text('entry_points.txt'), self)) + return EntryPoints._from_text_for(self.read_text('entry_points.txt'), self) @property def files(self): @@ -485,15 +627,22 @@ class Prepared: """ normalized = None - suffixes = '.dist-info', '.egg-info' + suffixes = 'dist-info', 'egg-info' exact_matches = [''][:0] + egg_prefix = '' + versionless_egg_name = '' def __init__(self, name): self.name = name if name is None: return self.normalized = self.normalize(name) - self.exact_matches = [self.normalized + suffix for suffix in self.suffixes] + self.exact_matches = [ + self.normalized + '.' + suffix for suffix in self.suffixes + ] + legacy_normalized = self.legacy_normalize(self.name) + self.egg_prefix = legacy_normalized + '-' + self.versionless_egg_name = legacy_normalized + '.egg' @staticmethod def normalize(name): @@ -512,8 +661,9 @@ def legacy_normalize(name): def matches(self, cand, base): low = cand.lower() - pre, ext = os.path.splitext(low) - name, sep, rest = pre.partition('-') + # rpartition is faster than splitext and suitable for this purpose. + pre, _, ext = low.rpartition('.') + name, _, rest = pre.partition('-') return ( low in self.exact_matches or ext in self.suffixes @@ -524,12 +674,9 @@ def matches(self, cand, base): ) def is_egg(self, base): - normalized = self.legacy_normalize(self.name or '') - prefix = normalized + '-' if normalized else '' - versionless_egg_name = normalized + '.egg' if self.name else '' return ( - base == versionless_egg_name - or base.startswith(prefix) + base == self.versionless_egg_name + or base.startswith(self.egg_prefix) and base.endswith('.egg') ) @@ -551,8 +698,9 @@ def find_distributions(cls, context=DistributionFinder.Context()): @classmethod def _search_paths(cls, name, paths): """Find metadata directories in paths heuristically.""" + prepared = Prepared(name) return itertools.chain.from_iterable( - path.search(Prepared(name)) for path in map(FastPath, paths) + path.search(prepared) for path in map(FastPath, paths) ) @@ -617,16 +765,28 @@ def version(distribution_name): return distribution(distribution_name).version -def entry_points(): +def entry_points(**params) -> Union[EntryPoints, SelectableGroups]: """Return EntryPoint objects for all installed packages. - :return: EntryPoint objects for all installed packages. + Pass selection parameters (group or name) to filter the + result to entry points matching those properties (see + EntryPoints.select()). + + For compatibility, returns ``SelectableGroups`` object unless + selection parameters are supplied. In the future, this function + will return ``EntryPoints`` instead of ``SelectableGroups`` + even when no selection parameters are supplied. + + For maximum future compatibility, pass selection parameters + or invoke ``.select`` with parameters on the result. + + :return: EntryPoints or SelectableGroups for all installed packages. """ - eps = itertools.chain.from_iterable(dist.entry_points for dist in distributions()) - by_group = operator.attrgetter('group') - ordered = sorted(eps, key=by_group) - grouped = itertools.groupby(ordered, by_group) - return {group: tuple(eps) for group, eps in grouped} + unique = functools.partial(unique_everseen, key=operator.attrgetter('name')) + eps = itertools.chain.from_iterable( + dist.entry_points for dist in unique(distributions()) + ) + return SelectableGroups.load(eps).select(**params) def files(distribution_name): @@ -646,3 +806,19 @@ def requires(distribution_name): packaging.requirement.Requirement. """ return distribution(distribution_name).requires + + +def packages_distributions() -> Mapping[str, List[str]]: + """ + Return a mapping of top-level packages to their + distributions. + + >>> pkgs = packages_distributions() + >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values()) + True + """ + pkg_to_dist = collections.defaultdict(list) + for dist in distributions(): + for pkg in (dist.read_text('top_level.txt') or '').split(): + pkg_to_dist[pkg].append(dist.metadata['Name']) + return dict(pkg_to_dist) diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index acf6bc87c74e9..429313e9efb98 100644 --- a/Lib/test/test_importlib/fixtures.py +++ b/Lib/test/test_importlib/fixtures.py @@ -5,7 +5,6 @@ import tempfile import textwrap import contextlib -import unittest from test.support.os_helper import FS_NONASCII from typing import Dict, Union @@ -221,7 +220,6 @@ def setUp(self): build_files(self.files) - def build_files(file_defs, prefix=pathlib.Path()): """Build a set of files/directories, as described by the @@ -260,9 +258,6 @@ class FileBuilder: def unicode_filename(self): return FS_NONASCII or self.skip("File system does not support non-ascii.") - def skip(self, reason): - raise unittest.SkipTest(reason) - def DALS(str): "Dedent and left-strip" diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py index c937361e8fdd0..02e8a573437a5 100644 --- a/Lib/test/test_importlib/test_main.py +++ b/Lib/test/test_importlib/test_main.py @@ -3,6 +3,7 @@ import pickle import textwrap import unittest +import warnings import importlib.metadata try: @@ -58,13 +59,11 @@ def test_import_nonexistent_module(self): importlib.import_module('does_not_exist') def test_resolve(self): - entries = dict(entry_points()['entries']) - ep = entries['main'] + ep = entry_points(group='entries')['main'] self.assertEqual(ep.load().__name__, "main") def test_entrypoint_with_colon_in_name(self): - entries = dict(entry_points()['entries']) - ep = entries['ns:sub'] + ep = entry_points(group='entries')['ns:sub'] self.assertEqual(ep.value, 'mod:main') def test_resolve_without_attr(self): @@ -250,7 +249,8 @@ def test_json_dump(self): json should not expect to be able to dump an EntryPoint """ with self.assertRaises(Exception): - json.dumps(self.ep) + with warnings.catch_warnings(record=True): + json.dumps(self.ep) def test_module(self): assert self.ep.module == 'value' diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index df00ae9375b86..a0f9d511f8433 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++ b/Lib/test/test_importlib/test_metadata_api.py @@ -1,6 +1,7 @@ import re import textwrap import unittest +import warnings from . import fixtures from importlib.metadata import ( @@ -64,18 +65,97 @@ def test_read_text(self): self.assertEqual(top_level.read_text(), 'mod\n') def test_entry_points(self): - entries = dict(entry_points()['entries']) + eps = entry_points() + assert 'entries' in eps.groups + entries = eps.select(group='entries') + assert 'main' in entries.names ep = entries['main'] self.assertEqual(ep.value, 'mod:main') self.assertEqual(ep.extras, []) def test_entry_points_distribution(self): - entries = dict(entry_points()['entries']) + entries = entry_points(group='entries') for entry in ("main", "ns:sub"): ep = entries[entry] self.assertIn(ep.dist.name, ('distinfo-pkg', 'egginfo-pkg')) self.assertEqual(ep.dist.version, "1.0.0") + def test_entry_points_unique_packages(self): + """ + Entry points should only be exposed for the first package + on sys.path with a given name. + """ + alt_site_dir = self.fixtures.enter_context(fixtures.tempdir()) + self.fixtures.enter_context(self.add_sys_path(alt_site_dir)) + alt_pkg = { + "distinfo_pkg-1.1.0.dist-info": { + "METADATA": """ + Name: distinfo-pkg + Version: 1.1.0 + """, + "entry_points.txt": """ + [entries] + main = mod:altmain + """, + }, + } + fixtures.build_files(alt_pkg, alt_site_dir) + entries = entry_points(group='entries') + assert not any( + ep.dist.name == 'distinfo-pkg' and ep.dist.version == '1.0.0' + for ep in entries + ) + # ns:sub doesn't exist in alt_pkg + assert 'ns:sub' not in entries + + def test_entry_points_missing_name(self): + with self.assertRaises(KeyError): + entry_points(group='entries')['missing'] + + def test_entry_points_missing_group(self): + assert entry_points(group='missing') == () + + def test_entry_points_dict_construction(self): + """ + Prior versions of entry_points() returned simple lists and + allowed casting those lists into maps by name using ``dict()``. + Capture this now deprecated use-case. + """ + with warnings.catch_warnings(record=True) as caught: + warnings.filterwarnings("default", category=DeprecationWarning) + eps = dict(entry_points(group='entries')) + + assert 'main' in eps + assert eps['main'] == entry_points(group='entries')['main'] + + # check warning + expected = next(iter(caught)) + assert expected.category is DeprecationWarning + assert "Construction of dict of EntryPoints is deprecated" in str(expected) + + def test_entry_points_groups_getitem(self): + """ + Prior versions of entry_points() returned a dict. Ensure + that callers using '.__getitem__()' are supported but warned to + migrate. + """ + with warnings.catch_warnings(record=True): + entry_points()['entries'] == entry_points(group='entries') + + with self.assertRaises(KeyError): + entry_points()['missing'] + + def test_entry_points_groups_get(self): + """ + Prior versions of entry_points() returned a dict. Ensure + that callers using '.get()' are supported but warned to + migrate. + """ + with warnings.catch_warnings(record=True): + entry_points().get('missing', 'default') == 'default' + entry_points().get('entries', 'default') == entry_points()['entries'] + entry_points().get('missing', ()) == () + def test_metadata_for_this_package(self): md = metadata('egginfo-pkg') assert md['author'] == 'Steven Ma' diff --git a/Lib/test/test_importlib/test_zip.py b/Lib/test/test_importlib/test_zip.py index 74783fc98b99b..83e041385e0e8 100644 --- a/Lib/test/test_importlib/test_zip.py +++ b/Lib/test/test_importlib/test_zip.py @@ -41,7 +41,7 @@ def test_zip_version_does_not_match(self): version('definitely-not-installed') def test_zip_entry_points(self): - scripts = dict(entry_points()['console_scripts']) + scripts = entry_points(group='console_scripts') entry_point = scripts['example'] self.assertEqual(entry_point.value, 'example:main') entry_point = scripts['Example'] diff --git a/Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst b/Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst new file mode 100644 index 0000000000000..38361070b39f7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst @@ -0,0 +1,17 @@ +Include changes from `importlib_metadata 3.7 +`_: + +Performance enhancements to distribution discovery. + +``entry_points`` only returns unique distributions. + +Introduces new ``EntryPoints`` object +for containing a set of entry points with convenience methods for selecting +entry points by group or name. ``entry_points`` now returns this object if +selection parameters are supplied but continues to return a dict object for +compatibility. Users are encouraged to rely on the selection interface. The +dict object result is likely to be deprecated in the future. + +Added +packages_distributions function to return a mapping of packages to the +distributions that provide them. From webhook-mailer at python.org Sat Mar 13 16:46:42 2021 From: webhook-mailer at python.org (rhettinger) Date: Sat, 13 Mar 2021 21:46:42 -0000 Subject: [Python-checkins] bpo-43427: Separte the method overview from the static method specifics. (GH-24787) Message-ID: https://github.com/python/cpython/commit/f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a commit: f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a branch: master author: Raymond Hettinger committer: rhettinger date: 2021-03-13T13:46:32-08:00 summary: bpo-43427: Separte the method overview from the static method specifics. (GH-24787) files: M Doc/howto/descriptor.rst diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst index 94a8b4e6b40b9..94aadd6f73a83 100644 --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -1139,8 +1139,8 @@ If you have ever wondered where *self* comes from in regular methods or where *cls* comes from in class methods, this is it! -Static methods --------------- +Other kinds of methods +---------------------- Non-data descriptors provide a simple mechanism for variations on the usual patterns of binding functions into methods. @@ -1163,6 +1163,10 @@ This chart summarizes the binding and its two most useful variants: | classmethod | f(type(obj), \*args) | f(cls, \*args) | +-----------------+----------------------+------------------+ + +Static methods +-------------- + Static methods return the underlying function without changes. Calling either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object.__getattribute__(c, "f")`` or ``object.__getattribute__(C, "f")``. As a From webhook-mailer at python.org Sat Mar 13 19:28:13 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 14 Mar 2021 00:28:13 -0000 Subject: [Python-checkins] Fix typos in unittest documentation (GH-24194) Message-ID: https://github.com/python/cpython/commit/bb46c135ad04211aca00dd58fd2c4128f23dde8f commit: bb46c135ad04211aca00dd58fd2c4128f23dde8f branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-13T16:27:53-08:00 summary: Fix typos in unittest documentation (GH-24194) * addCleanupClass -> addClassCleanup * doCleanupsClass -> doClassCleanups (cherry picked from commit e0e398ef1855f3db708c682f70adc412f0877d59) Co-authored-by: Conchylicultor files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index d05e15e7808f9..ebed5c08082d0 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1479,11 +1479,11 @@ Test cases after :meth:`setUpClass` if :meth:`setUpClass` raises an exception. It is responsible for calling all the cleanup functions added by - :meth:`addCleanupClass`. If you need cleanup functions to be called + :meth:`addClassCleanup`. If you need cleanup functions to be called *prior* to :meth:`tearDownClass` then you can call - :meth:`doCleanupsClass` yourself. + :meth:`doClassCleanups` yourself. - :meth:`doCleanupsClass` pops methods off the stack of cleanup + :meth:`doClassCleanups` pops methods off the stack of cleanup functions one at a time, so it can be called at any time. .. versionadded:: 3.8 From webhook-mailer at python.org Sat Mar 13 20:00:42 2021 From: webhook-mailer at python.org (willingc) Date: Sun, 14 Mar 2021 01:00:42 -0000 Subject: [Python-checkins] Fix some minor errors in the docs (GH-24834) Message-ID: https://github.com/python/cpython/commit/f2b45367f1c049da76f81fb2920449b4909e0638 commit: f2b45367f1c049da76f81fb2920449b4909e0638 branch: master author: Zackery Spytz committer: willingc date: 2021-03-13T17:00:28-08:00 summary: Fix some minor errors in the docs (GH-24834) files: M Doc/library/ast.rst M Doc/library/asyncio-api-index.rst M Doc/library/readline.rst M Doc/library/statistics.rst M Doc/library/xml.sax.handler.rst diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 4bc9906e8568a..ff3fd99f5d4f4 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -838,7 +838,7 @@ Statements context), ``op`` is :class:`Add`, and ``value`` is a :class:`Constant` with value for 1. - The ``target`` attribute connot be of class :class:`Tuple` or :class:`List`, + The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, unlike the targets of :class:`Assign`. .. doctest:: diff --git a/Doc/library/asyncio-api-index.rst b/Doc/library/asyncio-api-index.rst index 047e5bbc58cca..f558724d4a3ff 100644 --- a/Doc/library/asyncio-api-index.rst +++ b/Doc/library/asyncio-api-index.rst @@ -49,7 +49,7 @@ await on multiple things with timeouts. - Task object. * - :func:`to_thread` - - Asychronously run a function in a separate OS thread. + - Asynchronously run a function in a separate OS thread. * - :func:`run_coroutine_threadsafe` - Schedule a coroutine from another OS thread. diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 3ff64885f7fce..4d485d25b5402 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -259,7 +259,7 @@ with a custom completer, a different set of word delimiters should be set. These indexes are the *start* and *end* arguments passed to the :c:data:`rl_attempted_completion_function` callback of the underlying library. The values may be different in the same - input editing scenario based on the underlying C readline implemtation. + input editing scenario based on the underlying C readline implementation. Ex: libedit is known to behave differently than libreadline. diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst index 6b6d3154a2881..695fb4969909d 100644 --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -51,7 +51,7 @@ or sample. :func:`median_high` High median of data. :func:`median_grouped` Median, or 50th percentile, of grouped data. :func:`mode` Single mode (most common value) of discrete or nominal data. -:func:`multimode` List of modes (most common values) of discrete or nomimal data. +:func:`multimode` List of modes (most common values) of discrete or nominal data. :func:`quantiles` Divide data into intervals with equal probability. ======================= =============================================================== diff --git a/Doc/library/xml.sax.handler.rst b/Doc/library/xml.sax.handler.rst index 3746a58c9b955..59d0d1b3b0117 100644 --- a/Doc/library/xml.sax.handler.rst +++ b/Doc/library/xml.sax.handler.rst @@ -50,7 +50,7 @@ module :mod:`xml.sax.handler`, so that all methods get default implementations. .. class:: LexicalHandler - Interface used by the parser to represent low freqency events which may not + Interface used by the parser to represent low frequency events which may not be of interest to many applications. In addition to these classes, :mod:`xml.sax.handler` provides symbolic constants From webhook-mailer at python.org Sat Mar 13 21:31:44 2021 From: webhook-mailer at python.org (rhettinger) Date: Sun, 14 Mar 2021 02:31:44 -0000 Subject: [Python-checkins] bpo-43427: Separte the method overview from the static method specifics. (GH-24787) (GH-24849) Message-ID: https://github.com/python/cpython/commit/45d9c8cda3db7da9fe209bd215ec9a120265ee65 commit: 45d9c8cda3db7da9fe209bd215ec9a120265ee65 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: rhettinger date: 2021-03-13T18:31:33-08:00 summary: bpo-43427: Separte the method overview from the static method specifics. (GH-24787) (GH-24849) files: M Doc/howto/descriptor.rst diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst index 0f999c95596aa..032d08009f442 100644 --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -1129,8 +1129,8 @@ If you have ever wondered where *self* comes from in regular methods or where *cls* comes from in class methods, this is it! -Static methods --------------- +Other kinds of methods +---------------------- Non-data descriptors provide a simple mechanism for variations on the usual patterns of binding functions into methods. @@ -1153,6 +1153,10 @@ This chart summarizes the binding and its two most useful variants: | classmethod | f(type(obj), \*args) | f(cls, \*args) | +-----------------+----------------------+------------------+ + +Static methods +-------------- + Static methods return the underlying function without changes. Calling either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object.__getattribute__(c, "f")`` or ``object.__getattribute__(C, "f")``. As a From webhook-mailer at python.org Sat Mar 13 22:04:55 2021 From: webhook-mailer at python.org (pablogsal) Date: Sun, 14 Mar 2021 03:04:55 -0000 Subject: [Python-checkins] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) Message-ID: https://github.com/python/cpython/commit/9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8 commit: 9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-14T04:04:47+01:00 summary: bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) files: M Modules/gcmodule.c diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 225da2b209592..d6b51426c4e2d 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1690,7 +1690,7 @@ Return the list of objects that directly refer to any of objs."); static PyObject * gc_get_referrers(PyObject *self, PyObject *args) { - if (PySys_Audit("gc.get_referrers", "O", args) < 0) { + if (PySys_Audit("gc.get_referrers", "(O)", args) < 0) { return NULL; } @@ -1724,7 +1724,7 @@ static PyObject * gc_get_referents(PyObject *self, PyObject *args) { Py_ssize_t i; - if (PySys_Audit("gc.get_referents", "O", args) < 0) { + if (PySys_Audit("gc.get_referents", "(O)", args) < 0) { return NULL; } PyObject *result = PyList_New(0); From webhook-mailer at python.org Sat Mar 13 22:15:51 2021 From: webhook-mailer at python.org (rhettinger) Date: Sun, 14 Mar 2021 03:15:51 -0000 Subject: [Python-checkins] bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788) Message-ID: https://github.com/python/cpython/commit/9923df96413a0b480a34ec1d537b66ca0eeb0fdc commit: 9923df96413a0b480a34ec1d537b66ca0eeb0fdc branch: master author: Kamil Turek committer: rhettinger date: 2021-03-13T19:15:44-08:00 summary: bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788) files: A Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst M Doc/library/collections.rst M Lib/collections/__init__.py M Lib/test/test_collections.py diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 540db2002343e..723c9da7be8d7 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -72,19 +72,23 @@ The class can be used to simulate nested scopes and is useful in templating. be modified to change which mappings are searched. The list should always contain at least one mapping. - .. method:: new_child(m=None) + .. method:: new_child(m=None, **kwargs) Returns a new :class:`ChainMap` containing a new map followed by all of the maps in the current instance. If ``m`` is specified, it becomes the new map at the front of the list of mappings; if not specified, an empty dict is used, so that a call to ``d.new_child()`` - is equivalent to: ``ChainMap({}, *d.maps)``. This method is used for - creating subcontexts that can be updated without altering values in any - of the parent mappings. + is equivalent to: ``ChainMap({}, *d.maps)``. If any keyword arguments + are specified, they update passed map or new empty dict. This method + is used for creating subcontexts that can be updated without altering + values in any of the parent mappings. .. versionchanged:: 3.4 The optional ``m`` parameter was added. + .. versionchanged:: 3.10 + Keyword arguments support was added. + .. attribute:: parents Property returning a new :class:`ChainMap` containing all of the maps in diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index 6404ea9022457..89c73bbf2c10d 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -1010,12 +1010,15 @@ def copy(self): __copy__ = copy - def new_child(self, m=None): # like Django's Context.push() + def new_child(self, m=None, **kwargs): # like Django's Context.push() '''New ChainMap with a new map followed by all previous maps. If no map is provided, an empty dict is used. + Keyword arguments update the map or new empty dict. ''' if m is None: - m = {} + m = kwargs + elif kwargs: + m.update(kwargs) return self.__class__(m, *self.maps) @property diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index d1c305a4a39c9..30303f00ba5c1 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -249,6 +249,10 @@ def __contains__(self, key): for k, v in dict(a=1, B=20, C=30, z=100).items(): # check get self.assertEqual(d.get(k, 100), v) + c = ChainMap({'a': 1, 'b': 2}) + d = c.new_child(b=20, c=30) + self.assertEqual(d.maps, [{'b': 20, 'c': 30}, {'a': 1, 'b': 2}]) + def test_union_operators(self): cm1 = ChainMap(dict(a=1, b=2), dict(c=3, d=4)) cm2 = ChainMap(dict(a=10, e=5), dict(b=20, d=4)) diff --git a/Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst b/Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst new file mode 100644 index 0000000000000..394318fb1e867 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst @@ -0,0 +1 @@ +Add keyword arguments support to ``ChainMap.new_child()``. \ No newline at end of file From webhook-mailer at python.org Sat Mar 13 22:38:55 2021 From: webhook-mailer at python.org (pablogsal) Date: Sun, 14 Mar 2021 03:38:55 -0000 Subject: [Python-checkins] bpo-43410: Fix crash in the parser when producing syntax errors when reading from stdin (GH-24763) Message-ID: https://github.com/python/cpython/commit/cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a commit: cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-14T04:38:40+01:00 summary: bpo-43410: Fix crash in the parser when producing syntax errors when reading from stdin (GH-24763) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst M Lib/test/test_cmd_line.py M Parser/pegen.c M Parser/tokenizer.c M Parser/tokenizer.h diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index f12dff3202fe3..95ab9d8c13965 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -816,9 +816,16 @@ def test_sys_flags_not_set(self): PYTHONVERBOSE="1", ) +class SyntaxErrorTests(unittest.TestCase): + def test_tokenizer_error_with_stdin(self): + proc = subprocess.run([sys.executable, "-"], input = b"(1+2+3", + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.assertNotEqual(proc.returncode, 0) + self.assertNotEqual(proc.stderr, None) + self.assertIn(b"\nSyntaxError", proc.stderr) def test_main(): - support.run_unittest(CmdLineTest, IgnoreEnvironmentTest) + support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests) support.reap_children() if __name__ == "__main__": diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst new file mode 100644 index 0000000000000..245bda5ff72dd --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst @@ -0,0 +1,2 @@ +Fix a bug that was causing the parser to crash when emiting syntax errors +when reading input from stdin. Patch by Pablo Galindo diff --git a/Parser/pegen.c b/Parser/pegen.c index 68f0e329f083d..301199368651d 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -397,7 +397,8 @@ get_error_line(Parser *p, Py_ssize_t lineno) are stored in p->tok->stdin_content */ assert(p->tok->fp == NULL || p->tok->fp == stdin); - char *cur_line = p->tok->fp == NULL ? p->tok->str : p->tok->stdin_content; + char *cur_line = p->tok->fp_interactive ? p->tok->interactive_src_start : p->tok->str; + for (int i = 0; i < lineno - 1; i++) { cur_line = strchr(cur_line, '\n') + 1; } @@ -440,7 +441,10 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype, goto error; } - if (p->start_rule == Py_file_input) { + if (p->tok->fp_interactive) { + error_line = get_error_line(p, lineno); + } + else if (p->start_rule == Py_file_input) { error_line = PyErr_ProgramTextObject(p->tok->filename, (int) lineno); } @@ -1232,7 +1236,7 @@ _PyPegen_run_parser(Parser *p) if (p->fill == 0) { RAISE_SYNTAX_ERROR("error at start before reading any input"); } - else if (p->tok->done == E_EOF) { + else if (p->tok->done == E_EOF) { if (p->tok->level) { raise_unclosed_parentheses_error(p); } else { @@ -1287,6 +1291,10 @@ _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filena } return NULL; } + if (!tok->fp || ps1 != NULL || ps2 != NULL || + PyUnicode_CompareWithASCIIString(filename_ob, "") == 0) { + tok->fp_interactive = 1; + } // This transfers the ownership to the tokenizer tok->filename = filename_ob; Py_INCREF(filename_ob); diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index d9334aaf148ba..09d8b88cadf35 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -56,6 +56,9 @@ tok_new(void) if (tok == NULL) return NULL; tok->buf = tok->cur = tok->inp = NULL; + tok->fp_interactive = 0; + tok->interactive_src_start = NULL; + tok->interactive_src_end = NULL; tok->start = NULL; tok->end = NULL; tok->done = E_OK; @@ -80,8 +83,6 @@ tok_new(void) tok->decoding_readline = NULL; tok->decoding_buffer = NULL; tok->type_comments = 0; - tok->stdin_content = NULL; - tok->async_hacks = 0; tok->async_def = 0; tok->async_def_indent = 0; @@ -323,6 +324,35 @@ check_bom(int get_char(struct tok_state *), return 1; } +static int tok_concatenate_interactive_new_line(struct tok_state* tok, char* line) { + assert(tok->fp_interactive); + + if (!line) { + return 0; + } + + Py_ssize_t current_size = tok->interactive_src_end - tok->interactive_src_start; + Py_ssize_t line_size = strlen(line); + char* new_str = tok->interactive_src_start; + + new_str = PyMem_Realloc(new_str, current_size + line_size + 1); + if (!new_str) { + if (tok->interactive_src_start) { + PyMem_Free(tok->interactive_src_start); + } + tok->interactive_src_start = NULL; + tok->interactive_src_end = NULL; + tok->done = E_NOMEM; + return -1; + } + strcpy(new_str + current_size, line); + + tok->interactive_src_start = new_str; + tok->interactive_src_end = new_str + current_size + line_size; + return 0; +} + + /* Read a line of text from TOK into S, using the stream in TOK. Return NULL on failure, else S. @@ -552,6 +582,12 @@ decoding_fgets(char *s, int size, struct tok_state *tok) badchar, tok->filename, tok->lineno + 1); return error_ret(tok); } + + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, line) == -1) { + return NULL; + } + return line; } @@ -807,17 +843,21 @@ PyTokenizer_FromFile(FILE *fp, const char* enc, void PyTokenizer_Free(struct tok_state *tok) { - if (tok->encoding != NULL) + if (tok->encoding != NULL) { PyMem_Free(tok->encoding); + } Py_XDECREF(tok->decoding_readline); Py_XDECREF(tok->decoding_buffer); Py_XDECREF(tok->filename); - if (tok->fp != NULL && tok->buf != NULL) + if (tok->fp != NULL && tok->buf != NULL) { PyMem_Free(tok->buf); - if (tok->input) + } + if (tok->input) { PyMem_Free(tok->input); - if (tok->stdin_content) - PyMem_Free(tok->stdin_content); + } + if (tok->interactive_src_start != NULL) { + PyMem_Free(tok->interactive_src_start); + } PyMem_Free(tok); } @@ -858,24 +898,6 @@ tok_nextc(struct tok_state *tok) if (translated == NULL) return EOF; newtok = translated; - if (tok->stdin_content == NULL) { - tok->stdin_content = PyMem_Malloc(strlen(translated) + 1); - if (tok->stdin_content == NULL) { - tok->done = E_NOMEM; - return EOF; - } - sprintf(tok->stdin_content, "%s", translated); - } - else { - char *new_str = PyMem_Malloc(strlen(tok->stdin_content) + strlen(translated) + 1); - if (new_str == NULL) { - tok->done = E_NOMEM; - return EOF; - } - sprintf(new_str, "%s%s", tok->stdin_content, translated); - PyMem_Free(tok->stdin_content); - tok->stdin_content = new_str; - } } if (tok->encoding && newtok && *newtok) { /* Recode to UTF-8 */ @@ -898,6 +920,10 @@ tok_nextc(struct tok_state *tok) strcpy(newtok, buf); Py_DECREF(u); } + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, newtok) == -1) { + return EOF; + } if (tok->nextprompt != NULL) tok->prompt = tok->nextprompt; if (newtok == NULL) @@ -958,7 +984,7 @@ tok_nextc(struct tok_state *tok) } if (decoding_fgets(tok->buf, (int)(tok->end - tok->buf), tok) == NULL) { - if (!tok->decoding_erred) + if (!tok->decoding_erred && !(tok->done == E_NOMEM)) tok->done = E_EOF; done = 1; } diff --git a/Parser/tokenizer.h b/Parser/tokenizer.h index 56074b61ae100..111126c67f2d5 100644 --- a/Parser/tokenizer.h +++ b/Parser/tokenizer.h @@ -26,6 +26,9 @@ struct tok_state { char *buf; /* Input buffer, or NULL; malloc'ed if fp != NULL */ char *cur; /* Next character in buffer */ char *inp; /* End of data in buffer */ + int fp_interactive; /* If the file descriptor is interactive */ + char *interactive_src_start; /* The start of the source parsed so far in interactive mode */ + char *interactive_src_end; /* The end of the source parsed so far in interactive mode */ const char *end; /* End of input buffer if buf != NULL */ const char *start; /* Start of current token if not NULL */ int done; /* E_OK normally, E_EOF at EOF, otherwise error code */ @@ -37,7 +40,6 @@ struct tok_state { int atbol; /* Nonzero if at begin of new line */ int pendin; /* Pending indents (if > 0) or dedents (if < 0) */ const char *prompt, *nextprompt; /* For interactive prompting */ - char *stdin_content; int lineno; /* Current line number */ int first_lineno; /* First line of a single line or multi line string expression (cf. issue 16806) */ From webhook-mailer at python.org Sat Mar 13 23:30:47 2021 From: webhook-mailer at python.org (pablogsal) Date: Sun, 14 Mar 2021 04:30:47 -0000 Subject: [Python-checkins] [3.8] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) (GH24854) Message-ID: https://github.com/python/cpython/commit/1e7a47ab86d5d6a5103e67ba71389f6daa18ea2d commit: 1e7a47ab86d5d6a5103e67ba71389f6daa18ea2d branch: 3.8 author: Pablo Galindo committer: pablogsal date: 2021-03-14T04:30:40Z summary: [3.8] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) (GH24854) (cherry picked from commit 9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8) Co-authored-by: Pablo Galindo files: M Modules/gcmodule.c diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 7a37a1650d108..81737251b725e 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1480,7 +1480,7 @@ static PyObject * gc_get_referrers(PyObject *self, PyObject *args) { int i; - if (PySys_Audit("gc.get_referrers", "O", args) < 0) { + if (PySys_Audit("gc.get_referrers", "(O)", args) < 0) { return NULL; } @@ -1512,7 +1512,7 @@ static PyObject * gc_get_referents(PyObject *self, PyObject *args) { Py_ssize_t i; - if (PySys_Audit("gc.get_referents", "O", args) < 0) { + if (PySys_Audit("gc.get_referents", "(O)", args) < 0) { return NULL; } PyObject *result = PyList_New(0); From webhook-mailer at python.org Sun Mar 14 00:28:41 2021 From: webhook-mailer at python.org (pablogsal) Date: Sun, 14 Mar 2021 05:28:41 -0000 Subject: [Python-checkins] [3.9] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) (GH-24855) Message-ID: https://github.com/python/cpython/commit/e6bf1e1001a6844a36f2f90f58ab12b9e09e3887 commit: e6bf1e1001a6844a36f2f90f58ab12b9e09e3887 branch: 3.9 author: Pablo Galindo committer: pablogsal date: 2021-03-14T05:28:37Z summary: [3.9] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) (GH-24855) * [3.9] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836). (cherry picked from commit 9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8) Co-authored-by: Pablo Galindo * Update gcmodule.c * Update gcmodule.c * Update gcmodule.c files: M Modules/gcmodule.c diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 52443debb1250..2c6ef9252eae8 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1675,7 +1675,7 @@ gc_get_referrers(PyObject *self, PyObject *args) PyThreadState *tstate = _PyThreadState_GET(); int i; - if (PySys_Audit("gc.get_referrers", "O", args) < 0) { + if (PySys_Audit("gc.get_referrers", "(O)", args) < 0) { return NULL; } @@ -1709,7 +1709,7 @@ static PyObject * gc_get_referents(PyObject *self, PyObject *args) { Py_ssize_t i; - if (PySys_Audit("gc.get_referents", "O", args) < 0) { + if (PySys_Audit("gc.get_referents", "(O)", args) < 0) { return NULL; } PyObject *result = PyList_New(0); From webhook-mailer at python.org Sun Mar 14 08:17:40 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 14 Mar 2021 12:17:40 -0000 Subject: [Python-checkins] bpo-39943: Fix MSVC warnings in sre extension (GH-20508) Message-ID: https://github.com/python/cpython/commit/cf8d6ef9629dc1bffadfcec251a2ffe30d5addaa commit: cf8d6ef9629dc1bffadfcec251a2ffe30d5addaa branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-14T05:17:26-07:00 summary: bpo-39943: Fix MSVC warnings in sre extension (GH-20508) (cherry picked from commit 06e3a27a3c863495390a07c695171a8e62a6e0d2) Co-authored-by: Ammar Askar files: M Modules/_sre.c M Modules/sre_lib.h diff --git a/Modules/_sre.c b/Modules/_sre.c index 244e4f1f84dff..bdc427822d7e1 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -454,7 +454,10 @@ state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string, return string; err: - PyMem_Del(state->mark); + /* We add an explicit cast here because MSVC has a bug when + compiling C code where it believes that `const void**` cannot be + safely casted to `void*`, see bpo-39943 for details. */ + PyMem_Del((void*) state->mark); state->mark = NULL; if (state->buffer.buf) PyBuffer_Release(&state->buffer); @@ -468,7 +471,8 @@ state_fini(SRE_STATE* state) PyBuffer_Release(&state->buffer); Py_XDECREF(state->string); data_stack_dealloc(state); - PyMem_Del(state->mark); + /* See above PyMem_Del for why we explicitly cast here. */ + PyMem_Del((void*) state->mark); state->mark = NULL; } diff --git a/Modules/sre_lib.h b/Modules/sre_lib.h index 9cc786321c560..2657d8d82c6f1 100644 --- a/Modules/sre_lib.h +++ b/Modules/sre_lib.h @@ -448,12 +448,15 @@ do { \ state->data_stack_base += size; \ } while (0) +/* We add an explicit cast to memcpy here because MSVC has a bug when + compiling C code where it believes that `const void**` cannot be + safely casted to `void*`, see bpo-39943 for details. */ #define DATA_STACK_POP(state, data, size, discard) \ do { \ TRACE(("copy data to %p from %" PY_FORMAT_SIZE_T "d " \ "(%" PY_FORMAT_SIZE_T "d)\n", \ data, state->data_stack_base-size, size)); \ - memcpy(data, state->data_stack+state->data_stack_base-size, size); \ + memcpy((void*) data, state->data_stack+state->data_stack_base-size, size); \ if (discard) \ state->data_stack_base -= size; \ } while (0) From webhook-mailer at python.org Sun Mar 14 14:01:48 2021 From: webhook-mailer at python.org (markshannon) Date: Sun, 14 Mar 2021 18:01:48 -0000 Subject: [Python-checkins] bpo-39316: Make sure that attribute accesses and stores, including method calls, conform to PEP 626. (GH-24859) Message-ID: https://github.com/python/cpython/commit/d48848c83e0f3e41b65c8f741f3fb6dbce5b9c29 commit: d48848c83e0f3e41b65c8f741f3fb6dbce5b9c29 branch: master author: Mark Shannon committer: markshannon date: 2021-03-14T18:01:30Z summary: bpo-39316: Make sure that attribute accesses and stores, including method calls, conform to PEP 626. (GH-24859) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst M Lib/test/test_compile.py M Python/compile.c M Python/importlib.h M Python/importlib_external.h diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 1f125242e156f..aa08c97c3ada8 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -837,6 +837,51 @@ def no_code2(): self.assertEqual(end, len(code.co_code)) self.assertEqual(line, code.co_firstlineno) + def test_lineno_attribute(self): + def load_attr(): + return ( + o. + a + ) + load_attr_lines = [ 2, 3, 1 ] + + def load_method(): + return ( + o. + m( + 0 + ) + ) + load_method_lines = [ 2, 3, 4, 3, 1 ] + + def store_attr(): + ( + o. + a + ) = ( + v + ) + store_attr_lines = [ 5, 2, 3 ] + + def aug_store_attr(): + ( + o. + a + ) += ( + v + ) + aug_store_attr_lines = [ 2, 3, 5, 1, 3 ] + + funcs = [ load_attr, load_method, store_attr, aug_store_attr] + func_lines = [ load_attr_lines, load_method_lines, + store_attr_lines, aug_store_attr_lines] + + for func, lines in zip(funcs, func_lines, strict=True): + with self.subTest(func=func): + code_lines = [ line-func.__code__.co_firstlineno + for (_, _, line) in func.__code__.co_lines() ] + self.assertEqual(lines, code_lines) + def test_big_dict_literal(self): # The compiler has a flushing point in "compiler_dict" that calls compiles diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst new file mode 100644 index 0000000000000..bebd9e83db435 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst @@ -0,0 +1,3 @@ +Tracing now has correct line numbers for attribute accesses when the +the attribute is on a different line from the object. +Improves debugging and profiling for multi-line method chains. diff --git a/Python/compile.c b/Python/compile.c index a841288520b88..942614fdab850 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4145,9 +4145,12 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) /* Alright, we can optimize the code. */ VISIT(c, expr, meth->v.Attribute.value); + int old_lineno = c->u->u_lineno; + c->u->u_lineno = meth->end_lineno; ADDOP_NAME(c, LOAD_METHOD, meth->v.Attribute.attr, names); VISIT_SEQ(c, expr, e->v.Call.args); ADDOP_I(c, CALL_METHOD, asdl_seq_LEN(e->v.Call.args)); + c->u->u_lineno = old_lineno; return 1; } @@ -5113,12 +5116,21 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) VISIT(c, expr, e->v.Attribute.value); switch (e->v.Attribute.ctx) { case Load: + { + int old_lineno = c->u->u_lineno; + c->u->u_lineno = e->end_lineno; ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names); + c->u->u_lineno = old_lineno; break; + } case Store: - if (forbidden_name(c, e->v.Attribute.attr, e->v.Attribute.ctx)) + if (forbidden_name(c, e->v.Attribute.attr, e->v.Attribute.ctx)) { return 0; + } + int old_lineno = c->u->u_lineno; + c->u->u_lineno = e->end_lineno; ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names); + c->u->u_lineno = old_lineno; break; case Del: ADDOP_NAME(c, DELETE_ATTR, e->v.Attribute.attr, names); @@ -5182,7 +5194,10 @@ compiler_augassign(struct compiler *c, stmt_ty s) case Attribute_kind: VISIT(c, expr, e->v.Attribute.value); ADDOP(c, DUP_TOP); + int old_lineno = c->u->u_lineno; + c->u->u_lineno = e->end_lineno; ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names); + c->u->u_lineno = old_lineno; break; case Subscript_kind: VISIT(c, expr, e->v.Subscript.value); @@ -5211,6 +5226,7 @@ compiler_augassign(struct compiler *c, stmt_ty s) switch (e->kind) { case Attribute_kind: + c->u->u_lineno = e->end_lineno; ADDOP(c, ROT_TWO); ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names); break; diff --git a/Python/importlib.h b/Python/importlib.h index 880343bcda308..90cfa4cc2daed 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -694,7 +694,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 218,4,106,111,105,110,41,2,114,33,0,0,0,114,62,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, 0,114,53,0,0,0,123,1,0,0,115,22,0,0,0,10, - 1,10,1,4,255,10,2,18,1,10,1,8,1,4,1,6, + 1,10,1,4,255,10,2,18,1,10,1,6,1,8,1,4, 255,22,2,255,128,122,19,77,111,100,117,108,101,83,112,101, 99,46,95,95,114,101,112,114,95,95,99,2,0,0,0,0, 0,0,0,0,0,0,0,3,0,0,0,8,0,0,0,67, @@ -1552,8 +1552,8 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,114,82,0,0,0,114,5,0,0,0,114,5,0,0,0, 114,6,0,0,0,218,14,95,102,105,110,100,95,97,110,100, 95,108,111,97,100,253,3,0,0,115,28,0,0,0,10,2, - 14,1,8,1,24,1,14,255,16,128,8,3,4,1,2,1, - 4,255,12,2,8,2,4,1,255,128,114,227,0,0,0,114, + 14,1,8,1,24,1,14,255,16,128,8,3,2,1,6,1, + 2,255,12,2,8,2,4,1,255,128,114,227,0,0,0,114, 25,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, 0,3,0,0,0,4,0,0,0,67,0,0,0,115,42,0, 0,0,116,0,124,0,124,1,124,2,131,3,1,0,124,2, diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 108f59e2631c4..f9045892885f2 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1173,8 +1173,8 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 3,114,130,0,0,0,218,6,109,111,100,117,108,101,114,175, 0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, 0,0,218,11,101,120,101,99,95,109,111,100,117,108,101,60, - 3,0,0,115,14,0,0,0,12,2,8,1,6,1,4,1, - 6,255,20,2,255,128,122,25,95,76,111,97,100,101,114,66, + 3,0,0,115,14,0,0,0,12,2,8,1,4,1,8,1, + 4,255,20,2,255,128,122,25,95,76,111,97,100,101,114,66, 97,115,105,99,115,46,101,120,101,99,95,109,111,100,117,108, 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, 0,0,4,0,0,0,67,0,0,0,115,12,0,0,0,116, From webhook-mailer at python.org Sun Mar 14 14:07:05 2021 From: webhook-mailer at python.org (gvanrossum) Date: Sun, 14 Mar 2021 18:07:05 -0000 Subject: [Python-checkins] bpo-29982: Add "ignore_cleanup_errors" param to tempfile.TemporaryDirectory() (GH-24793) Message-ID: https://github.com/python/cpython/commit/bd2fa3c416ffe6107b500a2180fa1764645c0a61 commit: bd2fa3c416ffe6107b500a2180fa1764645c0a61 branch: master author: CAM Gerlach committer: gvanrossum date: 2021-03-14T11:06:56-07:00 summary: bpo-29982: Add "ignore_cleanup_errors" param to tempfile.TemporaryDirectory() (GH-24793) files: A Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst M Doc/library/tempfile.rst M Lib/tempfile.py M Lib/test/test_tempfile.py diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index 2b8a35e2651e7..f84319180830e 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -118,12 +118,12 @@ The module defines the following user-callable items: Added *errors* parameter. -.. function:: TemporaryDirectory(suffix=None, prefix=None, dir=None) +.. function:: TemporaryDirectory(suffix=None, prefix=None, dir=None, ignore_cleanup_errors=False) This function securely creates a temporary directory using the same rules as :func:`mkdtemp`. The resulting object can be used as a context manager (see :ref:`tempfile-examples`). On completion of the context or destruction - of the temporary directory object the newly created temporary directory + of the temporary directory object, the newly created temporary directory and all its contents are removed from the filesystem. The directory name can be retrieved from the :attr:`name` attribute of the @@ -132,12 +132,21 @@ The module defines the following user-callable items: the :keyword:`with` statement, if there is one. The directory can be explicitly cleaned up by calling the - :func:`cleanup` method. + :func:`cleanup` method. If *ignore_cleanup_errors* is true, any unhandled + exceptions during explicit or implicit cleanup (such as a + :exc:`PermissionError` removing open files on Windows) will be ignored, + and the remaining removable items deleted on a "best-effort" basis. + Otherwise, errors will be raised in whatever context cleanup occurs + (the :func:`cleanup` call, exiting the context manager, when the object + is garbage-collected or during interpreter shutdown). .. audit-event:: tempfile.mkdtemp fullpath tempfile.TemporaryDirectory .. versionadded:: 3.2 + .. versionchanged:: 3.10 + Added *ignore_cleanup_errors* parameter. + .. function:: mkstemp(suffix=None, prefix=None, dir=None, text=False) diff --git a/Lib/tempfile.py b/Lib/tempfile.py index dc088d9d7e448..4b2547c98f1c7 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -768,7 +768,7 @@ def writelines(self, iterable): return rv -class TemporaryDirectory(object): +class TemporaryDirectory: """Create and return a temporary directory. This has the same behavior as mkdtemp but can be used as a context manager. For example: @@ -780,14 +780,17 @@ class TemporaryDirectory(object): in it are removed. """ - def __init__(self, suffix=None, prefix=None, dir=None): + def __init__(self, suffix=None, prefix=None, dir=None, + ignore_cleanup_errors=False): self.name = mkdtemp(suffix, prefix, dir) + self._ignore_cleanup_errors = ignore_cleanup_errors self._finalizer = _weakref.finalize( self, self._cleanup, self.name, - warn_message="Implicitly cleaning up {!r}".format(self)) + warn_message="Implicitly cleaning up {!r}".format(self), + ignore_errors=self._ignore_cleanup_errors) @classmethod - def _rmtree(cls, name): + def _rmtree(cls, name, ignore_errors=False): def onerror(func, path, exc_info): if issubclass(exc_info[0], PermissionError): def resetperms(path): @@ -806,19 +809,20 @@ def resetperms(path): _os.unlink(path) # PermissionError is raised on FreeBSD for directories except (IsADirectoryError, PermissionError): - cls._rmtree(path) + cls._rmtree(path, ignore_errors=ignore_errors) except FileNotFoundError: pass elif issubclass(exc_info[0], FileNotFoundError): pass else: - raise + if not ignore_errors: + raise _shutil.rmtree(name, onerror=onerror) @classmethod - def _cleanup(cls, name, warn_message): - cls._rmtree(name) + def _cleanup(cls, name, warn_message, ignore_errors=False): + cls._rmtree(name, ignore_errors=ignore_errors) _warnings.warn(warn_message, ResourceWarning) def __repr__(self): @@ -831,7 +835,7 @@ def __exit__(self, exc, value, tb): self.cleanup() def cleanup(self): - if self._finalizer.detach(): - self._rmtree(self.name) + if self._finalizer.detach() or _os.path.exists(self.name): + self._rmtree(self.name, ignore_errors=self._ignore_cleanup_errors) __class_getitem__ = classmethod(_types.GenericAlias) diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 5822c7535e378..3a3f6a999ce0a 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1365,13 +1365,17 @@ def __exit__(self, *exc_info): d.clear() d.update(c) + class TestTemporaryDirectory(BaseTestCase): """Test TemporaryDirectory().""" - def do_create(self, dir=None, pre="", suf="", recurse=1, dirs=1, files=1): + def do_create(self, dir=None, pre="", suf="", recurse=1, dirs=1, files=1, + ignore_cleanup_errors=False): if dir is None: dir = tempfile.gettempdir() - tmp = tempfile.TemporaryDirectory(dir=dir, prefix=pre, suffix=suf) + tmp = tempfile.TemporaryDirectory( + dir=dir, prefix=pre, suffix=suf, + ignore_cleanup_errors=ignore_cleanup_errors) self.nameCheck(tmp.name, dir, pre, suf) self.do_create2(tmp.name, recurse, dirs, files) return tmp @@ -1410,6 +1414,30 @@ def test_explicit_cleanup(self): finally: os.rmdir(dir) + def test_explict_cleanup_ignore_errors(self): + """Test that cleanup doesn't return an error when ignoring them.""" + with tempfile.TemporaryDirectory() as working_dir: + temp_dir = self.do_create( + dir=working_dir, ignore_cleanup_errors=True) + temp_path = pathlib.Path(temp_dir.name) + self.assertTrue(temp_path.exists(), + f"TemporaryDirectory {temp_path!s} does not exist") + with open(temp_path / "a_file.txt", "w+t") as open_file: + open_file.write("Hello world!\n") + temp_dir.cleanup() + self.assertEqual(len(list(temp_path.glob("*"))), + int(sys.platform.startswith("win")), + "Unexpected number of files in " + f"TemporaryDirectory {temp_path!s}") + self.assertEqual( + temp_path.exists(), + sys.platform.startswith("win"), + f"TemporaryDirectory {temp_path!s} existance state unexpected") + temp_dir.cleanup() + self.assertFalse( + temp_path.exists(), + f"TemporaryDirectory {temp_path!s} exists after cleanup") + @os_helper.skip_unless_symlink def test_cleanup_with_symlink_to_a_directory(self): # cleanup() should not follow symlinks to directories (issue #12464) @@ -1444,6 +1472,27 @@ def test_del_on_collection(self): finally: os.rmdir(dir) + @support.cpython_only + def test_del_on_collection_ignore_errors(self): + """Test that ignoring errors works when TemporaryDirectory is gced.""" + with tempfile.TemporaryDirectory() as working_dir: + temp_dir = self.do_create( + dir=working_dir, ignore_cleanup_errors=True) + temp_path = pathlib.Path(temp_dir.name) + self.assertTrue(temp_path.exists(), + f"TemporaryDirectory {temp_path!s} does not exist") + with open(temp_path / "a_file.txt", "w+t") as open_file: + open_file.write("Hello world!\n") + del temp_dir + self.assertEqual(len(list(temp_path.glob("*"))), + int(sys.platform.startswith("win")), + "Unexpected number of files in " + f"TemporaryDirectory {temp_path!s}") + self.assertEqual( + temp_path.exists(), + sys.platform.startswith("win"), + f"TemporaryDirectory {temp_path!s} existance state unexpected") + def test_del_on_shutdown(self): # A TemporaryDirectory may be cleaned up during shutdown with self.do_create() as dir: @@ -1476,6 +1525,43 @@ def test_del_on_shutdown(self): self.assertNotIn("Exception ", err) self.assertIn("ResourceWarning: Implicitly cleaning up", err) + def test_del_on_shutdown_ignore_errors(self): + """Test ignoring errors works when a tempdir is gc'ed on shutdown.""" + with tempfile.TemporaryDirectory() as working_dir: + code = """if True: + import pathlib + import sys + import tempfile + import warnings + + temp_dir = tempfile.TemporaryDirectory( + dir={working_dir!r}, ignore_cleanup_errors=True) + sys.stdout.buffer.write(temp_dir.name.encode()) + + temp_dir_2 = pathlib.Path(temp_dir.name) / "test_dir" + temp_dir_2.mkdir() + with open(temp_dir_2 / "test0.txt", "w") as test_file: + test_file.write("Hello world!") + open_file = open(temp_dir_2 / "open_file.txt", "w") + open_file.write("Hello world!") + + warnings.filterwarnings("always", category=ResourceWarning) + """.format(working_dir=working_dir) + __, out, err = script_helper.assert_python_ok("-c", code) + temp_path = pathlib.Path(out.decode().strip()) + self.assertEqual(len(list(temp_path.glob("*"))), + int(sys.platform.startswith("win")), + "Unexpected number of files in " + f"TemporaryDirectory {temp_path!s}") + self.assertEqual( + temp_path.exists(), + sys.platform.startswith("win"), + f"TemporaryDirectory {temp_path!s} existance state unexpected") + err = err.decode('utf-8', 'backslashreplace') + self.assertNotIn("Exception", err) + self.assertNotIn("Error", err) + self.assertIn("ResourceWarning: Implicitly cleaning up", err) + def test_exit_on_shutdown(self): # Issue #22427 with self.do_create() as dir: diff --git a/Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst b/Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst new file mode 100644 index 0000000000000..fd71bc6e4e0df --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst @@ -0,0 +1,3 @@ +Add optional parameter *ignore_cleanup_errors* to +:func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup` attempts. +Contributed by C.A.M. Gerlach. From webhook-mailer at python.org Sun Mar 14 18:12:17 2021 From: webhook-mailer at python.org (terryjreedy) Date: Sun, 14 Mar 2021 22:12:17 -0000 Subject: [Python-checkins] bpo-43199: Briefly explain why no goto (GH-24852) Message-ID: https://github.com/python/cpython/commit/5e29021a5eb10baa9147fd977cab82fa3f652bf0 commit: 5e29021a5eb10baa9147fd977cab82fa3f652bf0 branch: master author: Terry Jan Reedy committer: terryjreedy date: 2021-03-14T18:12:04-04:00 summary: bpo-43199: Briefly explain why no goto (GH-24852) Answer "Why is there no goto?" in the Design and History FAQ. files: A Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 7fe1c6d58f58a..f1f54eff86e87 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -600,7 +600,15 @@ test cases at all. Why is there no goto? --------------------- -You can use exceptions to provide a "structured goto" that even works across +In the 1970s people realized that unrestricted goto could lead +to messy "sphagetti" code that was hard to understand and revise. +In a high-level language, it is also unneeded as long as there +are ways to branch (in Python, with ``if`` statements and ``or``, +``and``, and ``if-else`` expressions) and loop (with ``while`` +and ``for`` statements, possibly containing ``continue`` and ``break``). + +One can also use exceptions to provide a "structured goto" +that works even across function calls. Many feel that exceptions can conveniently emulate all reasonable uses of the "go" or "goto" constructs of C, Fortran, and other languages. For example:: diff --git a/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst new file mode 100644 index 0000000000000..d1b454fabd7f8 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst @@ -0,0 +1 @@ +Answer "Why is there no goto?" in the Design and History FAQ. From webhook-mailer at python.org Sun Mar 14 22:20:58 2021 From: webhook-mailer at python.org (jaraco) Date: Mon, 15 Mar 2021 02:20:58 -0000 Subject: [Python-checkins] bpo-43428: Improve documentation for importlib.metadata changes. (GH-24858) Message-ID: https://github.com/python/cpython/commit/35d5068928ab5485e5f28b60b1e33062bc2c46cc commit: 35d5068928ab5485e5f28b60b1e33062bc2c46cc branch: master author: Jason R. Coombs committer: jaraco date: 2021-03-14T22:20:49-04:00 summary: bpo-43428: Improve documentation for importlib.metadata changes. (GH-24858) * bpo-43428: Sync with importlib_metadata 3.7.3 (16ac3a95) * Add 'versionadded' for importlib.metadata.packages_distributions * Add section in what's new for Python 3.10 highlighting most salient changes and relevant backport. files: M Doc/library/importlib.metadata.rst M Doc/whatsnew/3.10.rst M Lib/importlib/metadata.py diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index ffce1bae979b5..fee5e677823f7 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -79,15 +79,43 @@ Entry points are represented by ``EntryPoint`` instances; each ``EntryPoint`` has a ``.name``, ``.group``, and ``.value`` attributes and a ``.load()`` method to resolve the value. There are also ``.module``, ``.attr``, and ``.extras`` attributes for getting the components of the -``.value`` attribute:: +``.value`` attribute. + +Query all entry points:: >>> eps = entry_points() # doctest: +SKIP + +The ``entry_points()`` function returns an ``EntryPoints`` object, +a sequence of all ``EntryPoint`` objects with ``names`` and ``groups`` +attributes for convenience:: + >>> sorted(eps.groups) # doctest: +SKIP ['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation'] + +``EntryPoints`` has a ``select`` method to select entry points +matching specific properties. Select entry points in the +``console_scripts`` group:: + >>> scripts = eps.select(group='console_scripts') # doctest: +SKIP + +Equivalently, since ``entry_points`` passes keyword arguments +through to select:: + + >>> scripts = entry_points(group='console_scripts') # doctest: +SKIP + +Pick out a specific script named "wheel" (found in the wheel project):: + >>> 'wheel' in scripts.names # doctest: +SKIP True >>> wheel = scripts['wheel'] # doctest: +SKIP + +Equivalently, query for that entry point during selection:: + + >>> (wheel,) = entry_points(group='console_scripts', name='wheel') # doctest: +SKIP + >>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') # doctest: +SKIP + +Inspect the resolved entry point:: + >>> wheel # doctest: +SKIP EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts') >>> wheel.module # doctest: +SKIP @@ -106,6 +134,17 @@ group. Read `the setuptools docs `_ for more information on entry points, their definition, and usage. +*Compatibility Note* + +The "selectable" entry points were introduced in ``importlib_metadata`` +3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted +no parameters and always returned a dictionary of entry points, keyed +by group. For compatibility, if no parameters are passed to entry_points, +a ``SelectableGroups`` object is returned, implementing that dict +interface. In the future, calling ``entry_points`` with no parameters +will return an ``EntryPoints`` object. Users should rely on the selection +interface to retrieve entry points by group. + .. _metadata: @@ -199,6 +238,8 @@ Python packages or modules:: >>> packages_distributions() {'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': ['jaraco.classes', 'jaraco.functools'], ...} +.. versionadded:: 3.10 + Distributions ============= diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index db36f69e8d711..c4c282e5a04ea 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -690,6 +690,19 @@ Added the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:`~glob.iglob` which allow to specify the root directory for searching. (Contributed by Serhiy Storchaka in :issue:`38144`.) +importlib.metadata +------------------ + +Feature parity with ``importlib_metadata`` 3.7. + +:func:`importlib.metadata.entry_points` now provides a nicer experience +for selecting entry points by group and name through a new +:class:`importlib.metadata.EntryPoints` class. + +Added :func:`importlib.metadata.packages_distributions` for resolving +top-level Python modules and packages to their +:class:`importlib.metadata.Distribution`. + inspect ------- diff --git a/Lib/importlib/metadata.py b/Lib/importlib/metadata.py index 8a731858cad70..53c1a145f5c43 100644 --- a/Lib/importlib/metadata.py +++ b/Lib/importlib/metadata.py @@ -4,7 +4,6 @@ import csv import sys import email -import inspect import pathlib import zipfile import operator @@ -12,7 +11,7 @@ import functools import itertools import posixpath -import collections.abc +import collections from ._itertools import unique_everseen @@ -33,6 +32,7 @@ 'entry_points', 'files', 'metadata', + 'packages_distributions', 'requires', 'version', ] @@ -158,21 +158,33 @@ class EntryPoints(tuple): __slots__ = () def __getitem__(self, name): # -> EntryPoint: + """ + Get the EntryPoint in self matching name. + """ try: return next(iter(self.select(name=name))) except StopIteration: raise KeyError(name) def select(self, **params): + """ + Select entry points from self that match the + given parameters (typically group and/or name). + """ return EntryPoints(ep for ep in self if ep.matches(**params)) @property def names(self): + """ + Return the set of all names of all entry points. + """ return set(ep.name for ep in self) @property def groups(self): """ + Return the set of all groups of all entry points. + For coverage while SelectableGroups is present. >>> EntryPoints().groups set() @@ -185,6 +197,9 @@ def _from_text_for(cls, text, dist): def flake8_bypass(func): + # defer inspect import as performance optimization. + import inspect + is_flake8 = any('flake8' in str(frame.filename) for frame in inspect.stack()[:5]) return func if not is_flake8 else lambda: None @@ -813,6 +828,7 @@ def packages_distributions() -> Mapping[str, List[str]]: Return a mapping of top-level packages to their distributions. + >>> import collections.abc >>> pkgs = packages_distributions() >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values()) True From webhook-mailer at python.org Mon Mar 15 00:21:44 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 15 Mar 2021 04:21:44 -0000 Subject: [Python-checkins] bpo-43199: Briefly explain why no goto (GH-24852) Message-ID: https://github.com/python/cpython/commit/c3f03333c3a9c7aa213a463c5928d33fd4049060 commit: c3f03333c3a9c7aa213a463c5928d33fd4049060 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-14T21:21:36-07:00 summary: bpo-43199: Briefly explain why no goto (GH-24852) Answer "Why is there no goto?" in the Design and History FAQ. (cherry picked from commit 5e29021a5eb10baa9147fd977cab82fa3f652bf0) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 8cf271c302408..77c8ca9b6cb05 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -601,7 +601,15 @@ test cases at all. Why is there no goto? --------------------- -You can use exceptions to provide a "structured goto" that even works across +In the 1970s people realized that unrestricted goto could lead +to messy "sphagetti" code that was hard to understand and revise. +In a high-level language, it is also unneeded as long as there +are ways to branch (in Python, with ``if`` statements and ``or``, +``and``, and ``if-else`` expressions) and loop (with ``while`` +and ``for`` statements, possibly containing ``continue`` and ``break``). + +One can also use exceptions to provide a "structured goto" +that works even across function calls. Many feel that exceptions can conveniently emulate all reasonable uses of the "go" or "goto" constructs of C, Fortran, and other languages. For example:: diff --git a/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst new file mode 100644 index 0000000000000..d1b454fabd7f8 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst @@ -0,0 +1 @@ +Answer "Why is there no goto?" in the Design and History FAQ. From webhook-mailer at python.org Mon Mar 15 00:21:57 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 15 Mar 2021 04:21:57 -0000 Subject: [Python-checkins] bpo-43199: Briefly explain why no goto (GH-24852) Message-ID: https://github.com/python/cpython/commit/59f2741c4a1a53d4122d2cb512337f4b88619de9 commit: 59f2741c4a1a53d4122d2cb512337f4b88619de9 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-14T21:21:52-07:00 summary: bpo-43199: Briefly explain why no goto (GH-24852) Answer "Why is there no goto?" in the Design and History FAQ. (cherry picked from commit 5e29021a5eb10baa9147fd977cab82fa3f652bf0) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index f91b51bf8f86c..65d6a8e70dbba 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -599,7 +599,15 @@ sloppy and not write test cases at all. Why is there no goto? --------------------- -You can use exceptions to provide a "structured goto" that even works across +In the 1970s people realized that unrestricted goto could lead +to messy "sphagetti" code that was hard to understand and revise. +In a high-level language, it is also unneeded as long as there +are ways to branch (in Python, with ``if`` statements and ``or``, +``and``, and ``if-else`` expressions) and loop (with ``while`` +and ``for`` statements, possibly containing ``continue`` and ``break``). + +One can also use exceptions to provide a "structured goto" +that works even across function calls. Many feel that exceptions can conveniently emulate all reasonable uses of the "go" or "goto" constructs of C, Fortran, and other languages. For example:: diff --git a/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst new file mode 100644 index 0000000000000..d1b454fabd7f8 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst @@ -0,0 +1 @@ +Answer "Why is there no goto?" in the Design and History FAQ. From webhook-mailer at python.org Mon Mar 15 05:41:11 2021 From: webhook-mailer at python.org (vsajip) Date: Mon, 15 Mar 2021 09:41:11 -0000 Subject: [Python-checkins] [3.9] [doc] Document logging.basicConfig default format (GH-23710) (GH-24835) Message-ID: https://github.com/python/cpython/commit/2fe408497e6838b6fb761e42e8f8ffc70bd6f3b1 commit: 2fe408497e6838b6fb761e42e8f8ffc70bd6f3b1 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vsajip date: 2021-03-15T09:41:00Z summary: [3.9] [doc] Document logging.basicConfig default format (GH-23710) (GH-24835) (cherry picked from commit 35cacce5253c50eed0d285836f9ca0ac568991ca) files: M Doc/library/logging.rst diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 788925fed52ac..a7f815e9983e8 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -1176,7 +1176,9 @@ functions. | | to ``'a'``. | +--------------+---------------------------------------------+ | *format* | Use the specified format string for the | - | | handler. | + | | handler. Defaults to attributes | + | | ``levelname``, ``name`` and ``message`` | + | | separated by colons. | +--------------+---------------------------------------------+ | *datefmt* | Use the specified date/time format, as | | | accepted by :func:`time.strftime`. | From webhook-mailer at python.org Mon Mar 15 05:43:39 2021 From: webhook-mailer at python.org (vsajip) Date: Mon, 15 Mar 2021 09:43:39 -0000 Subject: [Python-checkins] [3.8] [doc] Document logging.basicConfig default format (GH-23710) (GH-24847) Message-ID: https://github.com/python/cpython/commit/d42a332a98a31d4db5ea5f980151039f48944427 commit: d42a332a98a31d4db5ea5f980151039f48944427 branch: 3.8 author: Andre Delfino committer: vsajip date: 2021-03-15T09:43:29Z summary: [3.8] [doc] Document logging.basicConfig default format (GH-23710) (GH-24847) (cherry picked from commit 35cacce5253c50eed0d285836f9ca0ac568991ca) files: M Doc/library/logging.rst diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 5bbbd443a9887..0a6b0d290fdfa 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -1161,7 +1161,9 @@ functions. | | to ``'a'``. | +--------------+---------------------------------------------+ | *format* | Use the specified format string for the | - | | handler. | + | | handler. Defaults to attributes | + | | ``levelname``, ``name`` and ``message`` | + | | separated by colons. | +--------------+---------------------------------------------+ | *datefmt* | Use the specified date/time format, as | | | accepted by :func:`time.strftime`. | From webhook-mailer at python.org Mon Mar 15 10:24:38 2021 From: webhook-mailer at python.org (markshannon) Date: Mon, 15 Mar 2021 14:24:38 -0000 Subject: [Python-checkins] Mark POP_TOP at end of expression statement as artificial, to conform to PEP 626. (GH-24860) Message-ID: https://github.com/python/cpython/commit/c5440937efab6a99d54340c902dfb21e86874bc3 commit: c5440937efab6a99d54340c902dfb21e86874bc3 branch: master author: Mark Shannon committer: markshannon date: 2021-03-15T14:24:25Z summary: Mark POP_TOP at end of expression statement as artificial, to conform to PEP 626. (GH-24860) files: M Lib/test/test_compile.py M Python/compile.c diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index aa08c97c3ada8..591d5bb00b264 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -786,6 +786,14 @@ def or_false(x): self.assertIn('LOAD_', opcodes[0].opname) self.assertEqual('RETURN_VALUE', opcodes[1].opname) + def test_lineno_procedure_call(self): + def call(): + ( + print() + ) + line1 = call.__code__.co_firstlineno + 1 + assert line1 not in [line for (_, _, line) in call.__code__.co_lines()] + def test_lineno_after_implicit_return(self): TRUE = True # Don't use constant True or False, as compiler will remove test diff --git a/Python/compile.c b/Python/compile.c index 942614fdab850..ea1bf6bf923af 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3397,6 +3397,8 @@ compiler_visit_stmt_expr(struct compiler *c, expr_ty value) } VISIT(c, expr, value); + /* Mark POP_TOP as artificial */ + c->u->u_lineno = -1; ADDOP(c, POP_TOP); return 1; } From webhook-mailer at python.org Mon Mar 15 13:23:25 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 15 Mar 2021 17:23:25 -0000 Subject: [Python-checkins] Fix typo in the word "spaghetti" (GH-24866) Message-ID: https://github.com/python/cpython/commit/93d33b47af70ede473f82d7953509a0607259c31 commit: 93d33b47af70ede473f82d7953509a0607259c31 branch: master author: Kazantcev Andrey <45011689+heckad at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-15T10:23:03-07:00 summary: Fix typo in the word "spaghetti" (GH-24866) Automerge-Triggered-By: GH:Mariatta files: M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index f1f54eff86e87..68570b33e2f62 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -601,7 +601,7 @@ Why is there no goto? --------------------- In the 1970s people realized that unrestricted goto could lead -to messy "sphagetti" code that was hard to understand and revise. +to messy "spaghetti" code that was hard to understand and revise. In a high-level language, it is also unneeded as long as there are ways to branch (in Python, with ``if`` statements and ``or``, ``and``, and ``if-else`` expressions) and loop (with ``while`` From webhook-mailer at python.org Mon Mar 15 13:45:13 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 15 Mar 2021 17:45:13 -0000 Subject: [Python-checkins] Fix typo in the word "spaghetti" (GH-24866) Message-ID: https://github.com/python/cpython/commit/83f676092e6936a17cf4a209681f021a49e2e171 commit: 83f676092e6936a17cf4a209681f021a49e2e171 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-15T10:45:04-07:00 summary: Fix typo in the word "spaghetti" (GH-24866) Automerge-Triggered-By: GH:Mariatta (cherry picked from commit 93d33b47af70ede473f82d7953509a0607259c31) Co-authored-by: Kazantcev Andrey <45011689+heckad at users.noreply.github.com> files: M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 77c8ca9b6cb05..5c59fcccb6c74 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -602,7 +602,7 @@ Why is there no goto? --------------------- In the 1970s people realized that unrestricted goto could lead -to messy "sphagetti" code that was hard to understand and revise. +to messy "spaghetti" code that was hard to understand and revise. In a high-level language, it is also unneeded as long as there are ways to branch (in Python, with ``if`` statements and ``or``, ``and``, and ``if-else`` expressions) and loop (with ``while`` From webhook-mailer at python.org Mon Mar 15 13:45:16 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 15 Mar 2021 17:45:16 -0000 Subject: [Python-checkins] Fix typo in the word "spaghetti" (GH-24866) Message-ID: https://github.com/python/cpython/commit/233f58f467a51fbb4e31a0c90619298be8f6095f commit: 233f58f467a51fbb4e31a0c90619298be8f6095f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-15T10:45:12-07:00 summary: Fix typo in the word "spaghetti" (GH-24866) Automerge-Triggered-By: GH:Mariatta (cherry picked from commit 93d33b47af70ede473f82d7953509a0607259c31) Co-authored-by: Kazantcev Andrey <45011689+heckad at users.noreply.github.com> files: M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 65d6a8e70dbba..0d4c8d8fd27ae 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -600,7 +600,7 @@ Why is there no goto? --------------------- In the 1970s people realized that unrestricted goto could lead -to messy "sphagetti" code that was hard to understand and revise. +to messy "spaghetti" code that was hard to understand and revise. In a high-level language, it is also unneeded as long as there are ways to branch (in Python, with ``if`` statements and ``or``, ``and``, and ``if-else`` expressions) and loop (with ``while`` From webhook-mailer at python.org Mon Mar 15 14:39:39 2021 From: webhook-mailer at python.org (gpshead) Date: Mon, 15 Mar 2021 18:39:39 -0000 Subject: [Python-checkins] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) Message-ID: https://github.com/python/cpython/commit/0ab152c6b5d95caa2dc1a30fa96e10258b5f188e commit: 0ab152c6b5d95caa2dc1a30fa96e10258b5f188e branch: master author: Gregory P. Smith committer: gpshead date: 2021-03-15T11:39:31-07:00 summary: bpo-43285 Make ftplib not trust the PASV response. (GH-24838) bpo-43285: Make ftplib not trust the PASV response. The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True. files: A Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst M Lib/ftplib.py M Lib/test/test_ftplib.py diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 1f760ed1ce0bf..7c5a50715f6dc 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -102,7 +102,9 @@ class FTP: sock = None file = None welcome = None - passiveserver = 1 + passiveserver = True + # Disables https://bugs.python.org/issue43285 security if set to True. + trust_server_pasv_ipv4_address = False def __init__(self, host='', user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, @@ -320,8 +322,13 @@ def makeport(self): return sock def makepasv(self): + """Internal: Does the PASV or EPSV handshake -> (address, port)""" if self.af == socket.AF_INET: - host, port = parse227(self.sendcmd('PASV')) + untrusted_host, port = parse227(self.sendcmd('PASV')) + if self.trust_server_pasv_ipv4_address: + host = untrusted_host + else: + host = self.sock.getpeername()[0] else: host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername()) return host, port diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 2424911c7ac5e..154dce15e2c37 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -103,6 +103,10 @@ def __init__(self, conn, encoding=DEFAULT_ENCODING): self.next_retr_data = RETR_DATA self.push('220 welcome') self.encoding = encoding + # We use this as the string IPv4 address to direct the client + # to in response to a PASV command. To test security behavior. + # https://bugs.python.org/issue43285/. + self.fake_pasv_server_ip = '252.253.254.255' def collect_incoming_data(self, data): self.in_buffer.append(data) @@ -143,7 +147,8 @@ def cmd_port(self, arg): def cmd_pasv(self, arg): with socket.create_server((self.socket.getsockname()[0], 0)) as sock: sock.settimeout(TIMEOUT) - ip, port = sock.getsockname()[:2] + port = sock.getsockname()[1] + ip = self.fake_pasv_server_ip ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256 self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2)) conn, addr = sock.accept() @@ -707,6 +712,26 @@ def test_makepasv(self): # IPv4 is in use, just make sure send_epsv has not been used self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv') + def test_makepasv_issue43285_security_disabled(self): + """Test the opt-in to the old vulnerable behavior.""" + self.client.trust_server_pasv_ipv4_address = True + bad_host, port = self.client.makepasv() + self.assertEqual( + bad_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((self.client.sock.getpeername()[0], port), + timeout=TIMEOUT).close() + + def test_makepasv_issue43285_security_enabled_default(self): + self.assertFalse(self.client.trust_server_pasv_ipv4_address) + trusted_host, port = self.client.makepasv() + self.assertNotEqual( + trusted_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((trusted_host, port), timeout=TIMEOUT).close() + def test_with_statement(self): self.client.quit() diff --git a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst new file mode 100644 index 0000000000000..8312b7e885441 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst @@ -0,0 +1,8 @@ +:mod:`ftplib` no longer trusts the IP address value returned from the server +in response to the PASV command by default. This prevents a malicious FTP +server from using the response to probe IPv4 address and port combinations +on the client network. + +Code that requires the former vulnerable behavior may set a +``trust_server_pasv_ipv4_address`` attribute on their +:class:`ftplib.FTP` instances to ``True`` to re-enable it. From webhook-mailer at python.org Mon Mar 15 15:02:54 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 15 Mar 2021 19:02:54 -0000 Subject: [Python-checkins] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) Message-ID: https://github.com/python/cpython/commit/7dcb4baa4f0fde3aef5122a8e9f6a41853ec9335 commit: 7dcb4baa4f0fde3aef5122a8e9f6a41853ec9335 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-15T12:02:45-07:00 summary: bpo-43285 Make ftplib not trust the PASV response. (GH-24838) bpo-43285: Make ftplib not trust the PASV response. The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True. (cherry picked from commit 0ab152c6b5d95caa2dc1a30fa96e10258b5f188e) Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst M Lib/ftplib.py M Lib/test/test_ftplib.py diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 1f760ed1ce0bf..7c5a50715f6dc 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -102,7 +102,9 @@ class FTP: sock = None file = None welcome = None - passiveserver = 1 + passiveserver = True + # Disables https://bugs.python.org/issue43285 security if set to True. + trust_server_pasv_ipv4_address = False def __init__(self, host='', user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, @@ -320,8 +322,13 @@ def makeport(self): return sock def makepasv(self): + """Internal: Does the PASV or EPSV handshake -> (address, port)""" if self.af == socket.AF_INET: - host, port = parse227(self.sendcmd('PASV')) + untrusted_host, port = parse227(self.sendcmd('PASV')) + if self.trust_server_pasv_ipv4_address: + host = untrusted_host + else: + host = self.sock.getpeername()[0] else: host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername()) return host, port diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index e424076d7d317..b76287bfe1c27 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -101,6 +101,10 @@ def __init__(self, conn, encoding=DEFAULT_ENCODING): self.next_retr_data = RETR_DATA self.push('220 welcome') self.encoding = encoding + # We use this as the string IPv4 address to direct the client + # to in response to a PASV command. To test security behavior. + # https://bugs.python.org/issue43285/. + self.fake_pasv_server_ip = '252.253.254.255' def collect_incoming_data(self, data): self.in_buffer.append(data) @@ -141,7 +145,8 @@ def cmd_port(self, arg): def cmd_pasv(self, arg): with socket.create_server((self.socket.getsockname()[0], 0)) as sock: sock.settimeout(TIMEOUT) - ip, port = sock.getsockname()[:2] + port = sock.getsockname()[1] + ip = self.fake_pasv_server_ip ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256 self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2)) conn, addr = sock.accept() @@ -705,6 +710,26 @@ def test_makepasv(self): # IPv4 is in use, just make sure send_epsv has not been used self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv') + def test_makepasv_issue43285_security_disabled(self): + """Test the opt-in to the old vulnerable behavior.""" + self.client.trust_server_pasv_ipv4_address = True + bad_host, port = self.client.makepasv() + self.assertEqual( + bad_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((self.client.sock.getpeername()[0], port), + timeout=TIMEOUT).close() + + def test_makepasv_issue43285_security_enabled_default(self): + self.assertFalse(self.client.trust_server_pasv_ipv4_address) + trusted_host, port = self.client.makepasv() + self.assertNotEqual( + trusted_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((trusted_host, port), timeout=TIMEOUT).close() + def test_with_statement(self): self.client.quit() diff --git a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst new file mode 100644 index 0000000000000..8312b7e885441 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst @@ -0,0 +1,8 @@ +:mod:`ftplib` no longer trusts the IP address value returned from the server +in response to the PASV command by default. This prevents a malicious FTP +server from using the response to probe IPv4 address and port combinations +on the client network. + +Code that requires the former vulnerable behavior may set a +``trust_server_pasv_ipv4_address`` attribute on their +:class:`ftplib.FTP` instances to ``True`` to re-enable it. From webhook-mailer at python.org Mon Mar 15 15:04:57 2021 From: webhook-mailer at python.org (gpshead) Date: Mon, 15 Mar 2021 19:04:57 -0000 Subject: [Python-checkins] [3.8] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) Message-ID: https://github.com/python/cpython/commit/664d1d16274b47eea6ec92572e1ebf3939a6fa0c commit: 664d1d16274b47eea6ec92572e1ebf3939a6fa0c branch: 3.8 author: Gregory P. Smith committer: gpshead date: 2021-03-15T12:04:49-07:00 summary: [3.8] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) bpo-43285: Make ftplib not trust the PASV response. The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True.. (cherry picked from commit 0ab152c6b5d95caa2dc1a30fa96e10258b5f188e) Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst M Lib/ftplib.py M Lib/test/test_ftplib.py diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 58a46bca4a367..f0044ffde77b8 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -104,6 +104,8 @@ class FTP: welcome = None passiveserver = 1 encoding = "latin-1" + # Disables https://bugs.python.org/issue43285 security if set to True. + trust_server_pasv_ipv4_address = False # Initialization method (called by class instantiation). # Initialize host to localhost, port to standard ftp port @@ -316,8 +318,13 @@ def makeport(self): return sock def makepasv(self): + """Internal: Does the PASV or EPSV handshake -> (address, port)""" if self.af == socket.AF_INET: - host, port = parse227(self.sendcmd('PASV')) + untrusted_host, port = parse227(self.sendcmd('PASV')) + if self.trust_server_pasv_ipv4_address: + host = untrusted_host + else: + host = self.sock.getpeername()[0] else: host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername()) return host, port diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index b0e46411a2e2b..89beaa1d341c9 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -94,6 +94,10 @@ def __init__(self, conn): self.rest = None self.next_retr_data = RETR_DATA self.push('220 welcome') + # We use this as the string IPv4 address to direct the client + # to in response to a PASV command. To test security behavior. + # https://bugs.python.org/issue43285/. + self.fake_pasv_server_ip = '252.253.254.255' def collect_incoming_data(self, data): self.in_buffer.append(data) @@ -134,7 +138,8 @@ def cmd_port(self, arg): def cmd_pasv(self, arg): with socket.create_server((self.socket.getsockname()[0], 0)) as sock: sock.settimeout(TIMEOUT) - ip, port = sock.getsockname()[:2] + port = sock.getsockname()[1] + ip = self.fake_pasv_server_ip ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256 self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2)) conn, addr = sock.accept() @@ -695,6 +700,26 @@ def test_makepasv(self): # IPv4 is in use, just make sure send_epsv has not been used self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv') + def test_makepasv_issue43285_security_disabled(self): + """Test the opt-in to the old vulnerable behavior.""" + self.client.trust_server_pasv_ipv4_address = True + bad_host, port = self.client.makepasv() + self.assertEqual( + bad_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((self.client.sock.getpeername()[0], port), + timeout=TIMEOUT).close() + + def test_makepasv_issue43285_security_enabled_default(self): + self.assertFalse(self.client.trust_server_pasv_ipv4_address) + trusted_host, port = self.client.makepasv() + self.assertNotEqual( + trusted_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((trusted_host, port), timeout=TIMEOUT).close() + def test_with_statement(self): self.client.quit() diff --git a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst new file mode 100644 index 0000000000000..8312b7e885441 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst @@ -0,0 +1,8 @@ +:mod:`ftplib` no longer trusts the IP address value returned from the server +in response to the PASV command by default. This prevents a malicious FTP +server from using the response to probe IPv4 address and port combinations +on the client network. + +Code that requires the former vulnerable behavior may set a +``trust_server_pasv_ipv4_address`` attribute on their +:class:`ftplib.FTP` instances to ``True`` to re-enable it. From webhook-mailer at python.org Mon Mar 15 18:50:57 2021 From: webhook-mailer at python.org (JulienPalard) Date: Mon, 15 Mar 2021 22:50:57 -0000 Subject: [Python-checkins] bpo-41933: Clarify wording for s * n in Common Sequence Operations (GH-22570) Message-ID: https://github.com/python/cpython/commit/0269ce87c9347542c54a653dd78b9f60bb9fa822 commit: 0269ce87c9347542c54a653dd78b9f60bb9fa822 branch: master author: Chavdar Yotov committer: JulienPalard date: 2021-03-15T23:50:49+01:00 summary: bpo-41933: Clarify wording for s * n in Common Sequence Operations (GH-22570) files: A Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst M Lib/pydoc_data/topics.py diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index 0048f79b8cf25..a86d42247c3d0 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -13956,9 +13956,9 @@ '| "s + t" | the concatenation of *s* and *t* ' '| (6)(7) |\n' '+----------------------------+----------------------------------+------------+\n' - '| "s * n" or "n * s" | equivalent to adding *s* to ' + '| "s * n" or "n * s" | equivalent to *n* copies of the ' '| (2)(7) |\n' - '| | itself *n* times ' + '| | *s* sequence ' '| |\n' '+----------------------------+----------------------------------+------------+\n' '| "s[i]" | *i*th item of *s*, origin 0 ' diff --git a/Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst b/Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst new file mode 100644 index 0000000000000..f6316df5d8b15 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst @@ -0,0 +1 @@ +Clarified wording of s * n in the Common Sequence Operations \ No newline at end of file From webhook-mailer at python.org Mon Mar 15 22:54:06 2021 From: webhook-mailer at python.org (rhettinger) Date: Tue, 16 Mar 2021 02:54:06 -0000 Subject: [Python-checkins] Minor updates to the vector demo (GH-24853) Message-ID: https://github.com/python/cpython/commit/d69ae758a0606c142c305123dcbad3e3e42d664f commit: d69ae758a0606c142c305123dcbad3e3e42d664f branch: master author: Raymond Hettinger committer: rhettinger date: 2021-03-15T19:53:58-07:00 summary: Minor updates to the vector demo (GH-24853) files: M Tools/demo/vector.py diff --git a/Tools/demo/vector.py b/Tools/demo/vector.py index da5b3891d18c6..6df1f50a8998e 100755 --- a/Tools/demo/vector.py +++ b/Tools/demo/vector.py @@ -27,7 +27,17 @@ class Vec: or on the right >>> a * 3.0 Vec(3.0, 6.0, 9.0) + + and dot product + >>> a.dot(b) + 10 + + and printed in vector notation + >>> print(a) + <1 2 3> + """ + def __init__(self, *v): self.v = list(v) @@ -40,8 +50,12 @@ def fromlist(cls, v): return inst def __repr__(self): - args = ', '.join(repr(x) for x in self.v) - return 'Vec({})'.format(args) + args = ', '.join([repr(x) for x in self.v]) + return f'{type(self).__name__}({args})' + + def __str__(self): + components = ' '.join([str(x) for x in self.v]) + return f'<{components}>' def __len__(self): return len(self.v) @@ -50,22 +64,28 @@ def __getitem__(self, i): return self.v[i] def __add__(self, other): - # Element-wise addition + "Element-wise addition" v = [x + y for x, y in zip(self.v, other.v)] return Vec.fromlist(v) def __sub__(self, other): - # Element-wise subtraction + "Element-wise subtraction" v = [x - y for x, y in zip(self.v, other.v)] return Vec.fromlist(v) def __mul__(self, scalar): - # Multiply by scalar + "Multiply by scalar" v = [x * scalar for x in self.v] return Vec.fromlist(v) __rmul__ = __mul__ + def dot(self, other): + "Vector dot product" + if not isinstance(other, Vec): + raise TypeError + return sum(x_i * y_i for (x_i, y_i) in zip(self, other)) + def test(): import doctest From webhook-mailer at python.org Tue Mar 16 00:02:34 2021 From: webhook-mailer at python.org (rhettinger) Date: Tue, 16 Mar 2021 04:02:34 -0000 Subject: [Python-checkins] bpo-41361: Optimized argument parsing for deque_rotate (GH-24796) Message-ID: https://github.com/python/cpython/commit/448801da96c70699e2ca0798efdfe86d45f37f06 commit: 448801da96c70699e2ca0798efdfe86d45f37f06 branch: master author: Dennis Sweeney <36520290+sweeneyde at users.noreply.github.com> committer: rhettinger date: 2021-03-15T21:02:25-07:00 summary: bpo-41361: Optimized argument parsing for deque_rotate (GH-24796) files: A Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst M Modules/_collectionsmodule.c diff --git a/Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst b/Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst new file mode 100644 index 0000000000000..19e08f810bb7c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst @@ -0,0 +1 @@ +:meth:`~collections.deque.rotate` calls are now slightly faster due to faster argument parsing. \ No newline at end of file diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 90bafb0ea86d9..ca63f710cd864 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -880,9 +880,20 @@ deque_rotate(dequeobject *deque, PyObject *const *args, Py_ssize_t nargs) { Py_ssize_t n=1; - if (!_PyArg_ParseStack(args, nargs, "|n:rotate", &n)) { + if (!_PyArg_CheckPositional("deque.rotate", nargs, 0, 1)) { return NULL; } + if (nargs) { + PyObject *index = _PyNumber_Index(args[0]); + if (index == NULL) { + return NULL; + } + n = PyLong_AsSsize_t(index); + Py_DECREF(index); + if (n == -1 && PyErr_Occurred()) { + return NULL; + } + } if (!_deque_rotate(deque, n)) Py_RETURN_NONE; From webhook-mailer at python.org Tue Mar 16 00:24:37 2021 From: webhook-mailer at python.org (methane) Date: Tue, 16 Mar 2021 04:24:37 -0000 Subject: [Python-checkins] bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) Message-ID: https://github.com/python/cpython/commit/1330338583d183250186a8123b99d2283e945b4f commit: 1330338583d183250186a8123b99d2283e945b4f branch: master author: Inada Naoki committer: methane date: 2021-03-16T13:24:27+09:00 summary: bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) See PEP 624. files: M Doc/c-api/unicode.rst diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index b603f580a8ef0..8d4eef87db9fb 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -725,6 +725,10 @@ Extension modules can continue using them, as they will not be removed in Python :c:type:`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9 according to their decimal value. Return ``NULL`` if an exception occurs. + .. deprecated-removed:: 3.3 3.11 + Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using + :c:func:`Py_UNICODE_TODECIMAL`. + .. c:function:: Py_UNICODE* PyUnicode_AsUnicodeAndSize(PyObject *unicode, Py_ssize_t *size) @@ -1043,7 +1047,7 @@ These are the generic codec APIs: to be used is looked up using the Python codec registry. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsEncodedString`. @@ -1116,7 +1120,7 @@ These are the UTF-8 codec APIs: return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or :c:func:`PyUnicode_AsEncodedString`. @@ -1190,7 +1194,7 @@ These are the UTF-32 codec APIs: Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1265,7 +1269,7 @@ These are the UTF-16 codec APIs: Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1303,7 +1307,7 @@ These are the UTF-7 codec APIs: nonzero, whitespace will be encoded in base-64. Both are set to zero for the Python "utf-7" codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsEncodedString`. @@ -1333,7 +1337,7 @@ These are the "Unicode Escape" codec APIs: Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-Escape and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUnicodeEscapeString`. @@ -1364,7 +1368,7 @@ These are the "Raw Unicode Escape" codec APIs: Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsRawUnicodeEscapeString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1396,7 +1400,7 @@ ordinals and only these are accepted by the codecs during encoding. return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsLatin1String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1428,7 +1432,7 @@ codes generate errors. return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsASCIIString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1480,7 +1484,7 @@ These are the mapping codec APIs: *mapping* object and return the result as a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsCharmapString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1512,7 +1516,7 @@ The following codec API is special in that maps Unicode to Unicode. character *mapping* table to it and return the resulting Unicode object. Return ``NULL`` when an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_Translate`. or :ref:`generic codec based API ` From webhook-mailer at python.org Tue Mar 16 00:38:06 2021 From: webhook-mailer at python.org (gpshead) Date: Tue, 16 Mar 2021 04:38:06 -0000 Subject: [Python-checkins] [3.9] bpo-43285: Add a What's New entry for 3.9.3. (GH-24888) Message-ID: https://github.com/python/cpython/commit/d0312cece9ce89d783687ff6dddaae6495e19fcf commit: d0312cece9ce89d783687ff6dddaae6495e19fcf branch: 3.9 author: Gregory P. Smith committer: gpshead date: 2021-03-15T21:37:58-07:00 summary: [3.9] bpo-43285: Add a What's New entry for 3.9.3. (GH-24888) Covers the ftplib security fix. files: M Doc/whatsnew/3.9.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 3086930569dc9..4cb49406d6b77 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -1529,3 +1529,12 @@ separator key, with ``&`` as the default. This change also affects functions internally. For more details, please see their respective documentation. (Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.) + +Notable changes in Python 3.9.3 +=============================== + +A security fix alters the :class:`ftplib.FTP` behavior to not trust the +IPv4 address sent from the remote server when setting up a passive data +channel. We reuse the ftp server IP address instead. For unusual code +requiring the old behavior, set a ``trust_server_pasv_ipv4_address`` +attribute on your FTP instance to ``True``. (See :issue:`43285`) From webhook-mailer at python.org Tue Mar 16 00:38:32 2021 From: webhook-mailer at python.org (gpshead) Date: Tue, 16 Mar 2021 04:38:32 -0000 Subject: [Python-checkins] [3.8] bpo-43285: Whats New entry for 3.8.9. (GH-24889) Message-ID: https://github.com/python/cpython/commit/9eda0dfff2884bf9272f37d4151ef2335f55066f commit: 9eda0dfff2884bf9272f37d4151ef2335f55066f branch: 3.8 author: Gregory P. Smith committer: gpshead date: 2021-03-15T21:38:24-07:00 summary: [3.8] bpo-43285: Whats New entry for 3.8.9. (GH-24889) Covers the ftplib security fix. files: M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 632ccc1f2c40a..d4a9ee707f5a7 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -2264,3 +2264,12 @@ separator key, with ``&`` as the default. This change also affects functions internally. For more details, please see their respective documentation. (Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.) + +Notable changes in Python 3.8.9 +=============================== + +A security fix alters the :class:`ftplib.FTP` behavior to not trust the +IPv4 address sent from the remote server when setting up a passive data +channel. We reuse the ftp server IP address instead. For unusual code +requiring the old behavior, set a ``trust_server_pasv_ipv4_address`` +attribute on your FTP instance to ``True``. (See :issue:`43285`) From webhook-mailer at python.org Tue Mar 16 00:48:21 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 16 Mar 2021 04:48:21 -0000 Subject: [Python-checkins] bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) Message-ID: https://github.com/python/cpython/commit/a838e477a009bae4549f10bfd3396b8d5678415d commit: a838e477a009bae4549f10bfd3396b8d5678415d branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-15T21:48:12-07:00 summary: bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) See PEP 624. (cherry picked from commit 1330338583d183250186a8123b99d2283e945b4f) Co-authored-by: Inada Naoki files: M Doc/c-api/unicode.rst diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 61841c2c205cd..8b1ed0810fb0c 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -727,6 +727,10 @@ Extension modules can continue using them, as they will not be removed in Python :c:type:`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9 according to their decimal value. Return ``NULL`` if an exception occurs. + .. deprecated-removed:: 3.3 3.11 + Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using + :c:func:`Py_UNICODE_TODECIMAL`. + .. c:function:: Py_UNICODE* PyUnicode_AsUnicodeAndSize(PyObject *unicode, Py_ssize_t *size) @@ -1060,7 +1064,7 @@ These are the generic codec APIs: to be used is looked up using the Python codec registry. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsEncodedString`. @@ -1130,7 +1134,7 @@ These are the UTF-8 codec APIs: return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or :c:func:`PyUnicode_AsEncodedString`. @@ -1204,7 +1208,7 @@ These are the UTF-32 codec APIs: Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1279,7 +1283,7 @@ These are the UTF-16 codec APIs: Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1317,7 +1321,7 @@ These are the UTF-7 codec APIs: nonzero, whitespace will be encoded in base-64. Both are set to zero for the Python "utf-7" codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsEncodedString`. @@ -1347,7 +1351,7 @@ These are the "Unicode Escape" codec APIs: Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-Escape and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUnicodeEscapeString`. @@ -1378,7 +1382,7 @@ These are the "Raw Unicode Escape" codec APIs: Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsRawUnicodeEscapeString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1410,7 +1414,7 @@ ordinals and only these are accepted by the codecs during encoding. return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsLatin1String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1442,7 +1446,7 @@ codes generate errors. return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsASCIIString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1494,7 +1498,7 @@ These are the mapping codec APIs: *mapping* object and return the result as a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsCharmapString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1526,7 +1530,7 @@ The following codec API is special in that maps Unicode to Unicode. character *mapping* table to it and return the resulting Unicode object. Return ``NULL`` when an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_Translate`. or :ref:`generic codec based API ` From webhook-mailer at python.org Tue Mar 16 01:24:33 2021 From: webhook-mailer at python.org (methane) Date: Tue, 16 Mar 2021 05:24:33 -0000 Subject: [Python-checkins] bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) Message-ID: https://github.com/python/cpython/commit/dc8558ef302f1b14b45c21abd7451e4fb56b4604 commit: dc8558ef302f1b14b45c21abd7451e4fb56b4604 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: methane date: 2021-03-16T14:24:26+09:00 summary: bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) See PEP 624. (cherry picked from commit 1330338583d183250186a8123b99d2283e945b4f) files: M Doc/c-api/unicode.rst diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index bb5091ce425e6..6805ad48d9676 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -722,6 +722,10 @@ Extension modules can continue using them, as they will not be removed in Python :c:type:`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9 according to their decimal value. Return ``NULL`` if an exception occurs. + .. deprecated-removed:: 3.3 3.11 + Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using + :c:func:`Py_UNICODE_TODECIMAL`. + .. c:function:: Py_UNICODE* PyUnicode_AsUnicodeAndSize(PyObject *unicode, Py_ssize_t *size) @@ -1055,7 +1059,7 @@ These are the generic codec APIs: to be used is looked up using the Python codec registry. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsEncodedString`. @@ -1125,7 +1129,7 @@ These are the UTF-8 codec APIs: return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or :c:func:`PyUnicode_AsEncodedString`. @@ -1199,7 +1203,7 @@ These are the UTF-32 codec APIs: Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1274,7 +1278,7 @@ These are the UTF-16 codec APIs: Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1312,7 +1316,7 @@ These are the UTF-7 codec APIs: nonzero, whitespace will be encoded in base-64. Both are set to zero for the Python "utf-7" codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsEncodedString`. @@ -1342,7 +1346,7 @@ These are the "Unicode Escape" codec APIs: Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-Escape and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsUnicodeEscapeString`. @@ -1373,7 +1377,7 @@ These are the "Raw Unicode Escape" codec APIs: Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsRawUnicodeEscapeString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1405,7 +1409,7 @@ ordinals and only these are accepted by the codecs during encoding. return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsLatin1String` or :c:func:`PyUnicode_AsEncodedString`. @@ -1437,7 +1441,7 @@ codes generate errors. return a Python bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsASCIIString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1489,7 +1493,7 @@ These are the mapping codec APIs: *mapping* object and return the result as a bytes object. Return ``NULL`` if an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_AsCharmapString` or :c:func:`PyUnicode_AsEncodedString`. @@ -1521,7 +1525,7 @@ The following codec API is special in that maps Unicode to Unicode. character *mapping* table to it and return the resulting Unicode object. Return ``NULL`` when an exception was raised by the codec. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.11 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:func:`PyUnicode_Translate`. or :ref:`generic codec based API ` From webhook-mailer at python.org Tue Mar 16 02:03:51 2021 From: webhook-mailer at python.org (serhiy-storchaka) Date: Tue, 16 Mar 2021 06:03:51 -0000 Subject: [Python-checkins] bpo-43499: Silence compiler warnings about using legacy C API on Windows (GH-24873) Message-ID: https://github.com/python/cpython/commit/651fc30af7ac6138764106b87632cabca56a98bb commit: 651fc30af7ac6138764106b87632cabca56a98bb branch: 3.9 author: Serhiy Storchaka committer: serhiy-storchaka date: 2021-03-16T08:03:37+02:00 summary: bpo-43499: Silence compiler warnings about using legacy C API on Windows (GH-24873) files: M Modules/_ctypes/callproc.c M Modules/_io/fileio.c M Modules/posixmodule.c M Objects/unicodeobject.c M PC/_msi.c M PC/winreg.c M Python/dynload_win.c M Python/fileutils.c diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index f2506de54498e..18984d15abe17 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1358,7 +1358,10 @@ static PyObject *load_library(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "U|i:LoadLibrary", &nameobj, &load_flags)) return NULL; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS name = _PyUnicode_AsUnicode(nameobj); +_Py_COMP_DIAG_POP if (!name) return NULL; diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index caf91dfdb749e..048484bde5461 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -276,7 +276,10 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, if (!PyUnicode_FSDecoder(nameobj, &stringobj)) { return -1; } +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS widename = PyUnicode_AsUnicode(stringobj); +_Py_COMP_DIAG_POP if (widename == NULL) return -1; #else diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5e33502721c19..f83150f1ef343 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1159,7 +1159,10 @@ path_converter(PyObject *o, void *p) if (is_unicode) { #ifdef MS_WINDOWS +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wide = PyUnicode_AsUnicodeAndSize(o, &length); +_Py_COMP_DIAG_POP if (!wide) { goto error_exit; } @@ -1250,7 +1253,10 @@ path_converter(PyObject *o, void *p) goto error_exit; } +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wide = PyUnicode_AsUnicodeAndSize(wo, &length); +_Py_COMP_DIAG_POP if (!wide) { goto error_exit; } @@ -13238,7 +13244,10 @@ DirEntry_fetch_stat(PyObject *module, DirEntry *self, int follow_symlinks) #ifdef MS_WINDOWS if (!PyUnicode_FSDecoder(self->path, &ub)) return NULL; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS const wchar_t *path = PyUnicode_AsUnicode(ub); +_Py_COMP_DIAG_POP #else /* POSIX */ if (!PyUnicode_FSConverter(self->path, &ub)) return NULL; @@ -13460,7 +13469,10 @@ os_DirEntry_inode_impl(DirEntry *self) if (!PyUnicode_FSDecoder(self->path, &unicode)) return NULL; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS path = PyUnicode_AsUnicode(unicode); +_Py_COMP_DIAG_POP result = LSTAT(path, &stat); Py_DECREF(unicode); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index ffd13f7dd3892..9cc04eea0597c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -4321,7 +4321,10 @@ unicode_decode_call_errorhandler_wchar( goto onError; } +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS repwstr = PyUnicode_AsUnicodeAndSize(repunicode, &repwlen); +_Py_COMP_DIAG_POP if (repwstr == NULL) goto onError; /* need more space? (at least enough for what we @@ -7654,7 +7657,10 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, substring = PyUnicode_Substring(unicode, offset, offset+len); if (substring == NULL) return -1; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS p = PyUnicode_AsUnicodeAndSize(substring, &size); +_Py_COMP_DIAG_POP if (p == NULL) { Py_DECREF(substring); return -1; diff --git a/PC/_msi.c b/PC/_msi.c index 58c1cfd997bf8..913d3b85abb5f 100644 --- a/PC/_msi.c +++ b/PC/_msi.c @@ -625,7 +625,10 @@ summary_setproperty(msiobj* si, PyObject *args) return NULL; if (PyUnicode_Check(data)) { +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS const WCHAR *value = _PyUnicode_AsUnicode(data); +_Py_COMP_DIAG_POP if (value == NULL) { return NULL; } diff --git a/PC/winreg.c b/PC/winreg.c index 1305b7030fada..01e3e9f14ba2f 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -646,7 +646,10 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) t = PyList_GET_ITEM(value, j); if (!PyUnicode_Check(t)) return FALSE; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wstr = PyUnicode_AsUnicodeAndSize(t, &len); +_Py_COMP_DIAG_POP if (wstr == NULL) return FALSE; size += Py_SAFE_DOWNCAST((len + 1) * sizeof(wchar_t), @@ -669,7 +672,10 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) Py_ssize_t len; t = PyList_GET_ITEM(value, j); +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wstr = PyUnicode_AsUnicodeAndSize(t, &len); +_Py_COMP_DIAG_POP assert(wstr); wcscpy(P, wstr); P += (len + 1); diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 8431c5b3b2f30..81787e5f22ad0 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -170,7 +170,10 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, _Py_CheckPython3(); +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpathname = _PyUnicode_AsUnicode(pathname); +_Py_COMP_DIAG_POP if (wpathname == NULL) return NULL; diff --git a/Python/fileutils.c b/Python/fileutils.c index ddc090988f158..cf11e9297d78f 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1010,7 +1010,10 @@ _Py_stat(PyObject *path, struct stat *statbuf) struct _stat wstatbuf; const wchar_t *wpath; +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpath = _PyUnicode_AsUnicode(path); +_Py_COMP_DIAG_POP if (wpath == NULL) return -2; @@ -1455,7 +1458,10 @@ _Py_fopen_obj(PyObject *path, const char *mode) Py_TYPE(path)); return NULL; } +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wpath = _PyUnicode_AsUnicode(path); +_Py_COMP_DIAG_POP if (wpath == NULL) return NULL; From webhook-mailer at python.org Tue Mar 16 07:14:49 2021 From: webhook-mailer at python.org (markshannon) Date: Tue, 16 Mar 2021 11:14:49 -0000 Subject: [Python-checkins] bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. (GH-24867) Message-ID: https://github.com/python/cpython/commit/a8ef4572a6b28bcfc0b10b34fa4204954b9dd761 commit: a8ef4572a6b28bcfc0b10b34fa4204954b9dd761 branch: master author: tsukasa-au committer: markshannon date: 2021-03-16T11:14:41Z summary: bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. (GH-24867) * bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. Add a test that shows that a tuple constant (a tuple, where all of its members are also compile-time constants) produces a SyntaxWarning. Then fix this failure. * Make SyntaxWarnings also work when "optimized". * Split tests for SyntaxWarning to SyntaxError conversion SyntaxWarnings emitted by the compiler when configured to be errors are actually raised as SyntaxError exceptions. Move these tests into their own method and add a test to ensure they are raised. Previously we only tested that they were not raised for a "valid" assertion statement. files: A Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.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 0be869ef69b7c..c15f10b8bc747 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -279,6 +279,7 @@ class GrammarTests(unittest.TestCase): from test.support import check_syntax_error from test.support.warnings_helper import check_syntax_warning + from test.support.warnings_helper import check_no_warnings # single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE # XXX can't test in a script -- this rule is only used when interactive @@ -1194,7 +1195,7 @@ def test_assert(self): # these tests fail if python is run with -O, so check __debug__ @unittest.skipUnless(__debug__, "Won't work if __debug__ is False") - def testAssert2(self): + def test_assert_failures(self): try: assert 0, "msg" except AssertionError as e: @@ -1209,11 +1210,36 @@ def testAssert2(self): else: self.fail("AssertionError not raised by 'assert False'") + def test_assert_syntax_warnings(self): + # Ensure that we warn users if they provide a non-zero length tuple as + # the assertion test. self.check_syntax_warning('assert(x, "msg")', 'assertion is always true') + self.check_syntax_warning('assert(False, "msg")', + 'assertion is always true') + self.check_syntax_warning('assert(False,)', + 'assertion is always true') + + with self.check_no_warnings(category=SyntaxWarning): + compile('assert x, "msg"', '', 'exec') + compile('assert False, "msg"', '', 'exec') + + def test_assert_warning_promotes_to_syntax_error(self): + # If SyntaxWarning is configured to be an error, it actually raises a + # SyntaxError. + # https://bugs.python.org/issue35029 with warnings.catch_warnings(): warnings.simplefilter('error', SyntaxWarning) - compile('assert x, "msg"', '', 'exec') + try: + compile('assert x, "msg" ', '', 'exec') + except SyntaxError: + self.fail('SyntaxError incorrectly raised for \'assert x, "msg"\'') + with self.assertRaises(SyntaxError): + compile('assert(x, "msg")', '', 'exec') + with self.assertRaises(SyntaxError): + compile('assert(False, "msg")', '', 'exec') + with self.assertRaises(SyntaxError): + compile('assert(False,)', '', 'exec') ### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.rst new file mode 100644 index 0000000000000..d30677fc5bc15 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.rst @@ -0,0 +1 @@ +Emit SyntaxWarnings for assertions with tuple constants, this is a regression introduced in python3.7 \ No newline at end of file diff --git a/Python/compile.c b/Python/compile.c index ea1bf6bf923af..a1260aadd62e4 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3355,10 +3355,12 @@ compiler_assert(struct compiler *c, stmt_ty s) { basicblock *end; - if (c->c_optimize) - return 1; - if (s->v.Assert.test->kind == Tuple_kind && - asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) + /* Always emit a warning if the test is a non-zero length tuple */ + if ((s->v.Assert.test->kind == Tuple_kind && + asdl_seq_LEN(s->v.Assert.test->v.Tuple.elts) > 0) || + (s->v.Assert.test->kind == Constant_kind && + PyTuple_Check(s->v.Assert.test->v.Constant.value) && + PyTuple_Size(s->v.Assert.test->v.Constant.value) > 0)) { if (!compiler_warn(c, "assertion is always true, " "perhaps remove parentheses?")) @@ -3366,6 +3368,8 @@ compiler_assert(struct compiler *c, stmt_ty s) return 0; } } + if (c->c_optimize) + return 1; end = compiler_new_block(c); if (end == NULL) return 0; From webhook-mailer at python.org Tue Mar 16 09:44:03 2021 From: webhook-mailer at python.org (markshannon) Date: Tue, 16 Mar 2021 13:44:03 -0000 Subject: [Python-checkins] Add PEP 626 to what's new in 3.10. (#24892) Message-ID: https://github.com/python/cpython/commit/6086ae7fd4aeb4089282189673f9bd0cc33abf9b commit: 6086ae7fd4aeb4089282189673f9bd0cc33abf9b branch: master author: Mark Shannon committer: markshannon date: 2021-03-16T13:43:58Z summary: Add PEP 626 to what's new in 3.10. (#24892) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index c4c282e5a04ea..00b0f985e3386 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -167,6 +167,14 @@ These improvements are inspired by previous work in the PyPy interpreter. (Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in :issue:`40176`.) +PEP 626: Precise line numbers for debugging and other tools +----------------------------------------------------------- + +PEP 626 brings more precise and reliable line numbers for debugging, profiling and coverage tools. +Tracing events, with the correct line number, are generated for all lines of code executed and only for lines of code that are executed. + +The ``f_lineo`` attribute of frame objects will always contain the expected line number. + PEP 634: Structural Pattern Matching ------------------------------------ From webhook-mailer at python.org Tue Mar 16 13:36:51 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 16 Mar 2021 17:36:51 -0000 Subject: [Python-checkins] bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387) (GH-24894) Message-ID: https://github.com/python/cpython/commit/1f0cde678406749524d11e852a16bf243cef5c5f commit: 1f0cde678406749524d11e852a16bf243cef5c5f branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vstinner date: 2021-03-16T18:36:41+01:00 summary: bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387) (GH-24894) Fix warning: Objects\exceptions.c(2324,56): warning C4098: 'MemoryError_dealloc': 'void' function returning a value (cherry picked from commit bbeb223e9a5e9f9374df384efa386b4068a65c0e) Co-authored-by: Victor Stinner Co-authored-by: Victor Stinner files: M Objects/exceptions.c diff --git a/Objects/exceptions.c b/Objects/exceptions.c index eb72de53e98c1..e67ecfab858fb 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2310,7 +2310,8 @@ MemoryError_dealloc(PyBaseExceptionObject *self) BaseException_clear(self); if (!Py_IS_TYPE(self, (PyTypeObject *) PyExc_MemoryError)) { - return Py_TYPE(self)->tp_free((PyObject *)self); + Py_TYPE(self)->tp_free((PyObject *)self); + return; } _PyObject_GC_UNTRACK(self); From webhook-mailer at python.org Tue Mar 16 17:08:38 2021 From: webhook-mailer at python.org (ned-deily) Date: Tue, 16 Mar 2021 21:08:38 -0000 Subject: [Python-checkins] [3.6] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) (GH-24882) Message-ID: https://github.com/python/cpython/commit/4134f154ae2f621f25c5d698cc0f1748035a1b88 commit: 4134f154ae2f621f25c5d698cc0f1748035a1b88 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ned-deily date: 2021-03-16T17:08:30-04:00 summary: [3.6] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) (GH-24882) The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True.. (cherry picked from commit 0ab152c6b5d95caa2dc1a30fa96e10258b5f188e) Co-authored-by: Gregory P. Smith (cherry picked from commit 664d1d16274b47eea6ec92572e1ebf3939a6fa0c) files: A Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst M Doc/whatsnew/3.6.rst M Lib/ftplib.py M Lib/test/test_ftplib.py diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 296935adadd0c..561fb67d6696a 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2472,3 +2472,12 @@ separator key, with ``&`` as the default. This change also affects functions internally. For more details, please see their respective documentation. (Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.) + +Notable changes in Python 3.6.14 +================================ + +A security fix alters the :class:`ftplib.FTP` behavior to not trust the +IPv4 address sent from the remote server when setting up a passive data +channel. We reuse the ftp server IP address instead. For unusual code +requiring the old behavior, set a ``trust_server_pasv_ipv4_address`` +attribute on your FTP instance to ``True``. (See :issue:`43285`) diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 2ff251a0f7d99..385e4324c6f5d 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -104,6 +104,8 @@ class FTP: welcome = None passiveserver = 1 encoding = "latin-1" + # Disables https://bugs.python.org/issue43285 security if set to True. + trust_server_pasv_ipv4_address = False # Initialization method (called by class instantiation). # Initialize host to localhost, port to standard ftp port @@ -333,8 +335,13 @@ def makeport(self): return sock def makepasv(self): + """Internal: Does the PASV or EPSV handshake -> (address, port)""" if self.af == socket.AF_INET: - host, port = parse227(self.sendcmd('PASV')) + untrusted_host, port = parse227(self.sendcmd('PASV')) + if self.trust_server_pasv_ipv4_address: + host = untrusted_host + else: + host = self.sock.getpeername()[0] else: host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername()) return host, port diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 4ff2f71afb837..3ca7cc1c30cac 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -94,6 +94,10 @@ def __init__(self, conn): self.rest = None self.next_retr_data = RETR_DATA self.push('220 welcome') + # We use this as the string IPv4 address to direct the client + # to in response to a PASV command. To test security behavior. + # https://bugs.python.org/issue43285/. + self.fake_pasv_server_ip = '252.253.254.255' def collect_incoming_data(self, data): self.in_buffer.append(data) @@ -136,7 +140,8 @@ def cmd_pasv(self, arg): sock.bind((self.socket.getsockname()[0], 0)) sock.listen() sock.settimeout(TIMEOUT) - ip, port = sock.getsockname()[:2] + port = sock.getsockname()[1] + ip = self.fake_pasv_server_ip ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256 self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2)) conn, addr = sock.accept() @@ -694,6 +699,26 @@ def test_makepasv(self): # IPv4 is in use, just make sure send_epsv has not been used self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv') + def test_makepasv_issue43285_security_disabled(self): + """Test the opt-in to the old vulnerable behavior.""" + self.client.trust_server_pasv_ipv4_address = True + bad_host, port = self.client.makepasv() + self.assertEqual( + bad_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((self.client.sock.getpeername()[0], port), + timeout=TIMEOUT).close() + + def test_makepasv_issue43285_security_enabled_default(self): + self.assertFalse(self.client.trust_server_pasv_ipv4_address) + trusted_host, port = self.client.makepasv() + self.assertNotEqual( + trusted_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((trusted_host, port), timeout=TIMEOUT).close() + def test_with_statement(self): self.client.quit() diff --git a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst new file mode 100644 index 0000000000000..8312b7e885441 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst @@ -0,0 +1,8 @@ +:mod:`ftplib` no longer trusts the IP address value returned from the server +in response to the PASV command by default. This prevents a malicious FTP +server from using the response to probe IPv4 address and port combinations +on the client network. + +Code that requires the former vulnerable behavior may set a +``trust_server_pasv_ipv4_address`` attribute on their +:class:`ftplib.FTP` instances to ``True`` to re-enable it. From webhook-mailer at python.org Tue Mar 16 17:20:04 2021 From: webhook-mailer at python.org (ned-deily) Date: Tue, 16 Mar 2021 21:20:04 -0000 Subject: [Python-checkins] [3.7] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) (GH-24883) Message-ID: https://github.com/python/cpython/commit/79373951b3eab585d42e0f0ab83718cbe1d0ee33 commit: 79373951b3eab585d42e0f0ab83718cbe1d0ee33 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ned-deily date: 2021-03-16T17:19:55-04:00 summary: [3.7] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) (GH-24883) The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True.. (cherry picked from commit 0ab152c6b5d95caa2dc1a30fa96e10258b5f188e) Co-authored-by: Gregory P. Smith (cherry picked from commit 664d1d16274b47eea6ec92572e1ebf3939a6fa0c) files: A Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst M Doc/whatsnew/3.7.rst M Lib/ftplib.py M Lib/test/test_ftplib.py diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 25e231dcc7dfa..85f924b2e41f3 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -2585,3 +2585,12 @@ separator key, with ``&`` as the default. This change also affects functions internally. For more details, please see their respective documentation. (Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.) + +Notable changes in Python 3.7.11 +================================ + +A security fix alters the :class:`ftplib.FTP` behavior to not trust the +IPv4 address sent from the remote server when setting up a passive data +channel. We reuse the ftp server IP address instead. For unusual code +requiring the old behavior, set a ``trust_server_pasv_ipv4_address`` +attribute on your FTP instance to ``True``. (See :issue:`43285`) diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 9611282ecacb2..83ed0aa9c140e 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -104,6 +104,8 @@ class FTP: welcome = None passiveserver = 1 encoding = "latin-1" + # Disables https://bugs.python.org/issue43285 security if set to True. + trust_server_pasv_ipv4_address = False # Initialization method (called by class instantiation). # Initialize host to localhost, port to standard ftp port @@ -333,8 +335,13 @@ def makeport(self): return sock def makepasv(self): + """Internal: Does the PASV or EPSV handshake -> (address, port)""" if self.af == socket.AF_INET: - host, port = parse227(self.sendcmd('PASV')) + untrusted_host, port = parse227(self.sendcmd('PASV')) + if self.trust_server_pasv_ipv4_address: + host = untrusted_host + else: + host = self.sock.getpeername()[0] else: host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername()) return host, port diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index da8ba32917be7..73a6250a5e4ae 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -94,6 +94,10 @@ def __init__(self, conn): self.rest = None self.next_retr_data = RETR_DATA self.push('220 welcome') + # We use this as the string IPv4 address to direct the client + # to in response to a PASV command. To test security behavior. + # https://bugs.python.org/issue43285/. + self.fake_pasv_server_ip = '252.253.254.255' def collect_incoming_data(self, data): self.in_buffer.append(data) @@ -136,7 +140,8 @@ def cmd_pasv(self, arg): sock.bind((self.socket.getsockname()[0], 0)) sock.listen() sock.settimeout(TIMEOUT) - ip, port = sock.getsockname()[:2] + port = sock.getsockname()[1] + ip = self.fake_pasv_server_ip ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256 self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2)) conn, addr = sock.accept() @@ -698,6 +703,26 @@ def test_makepasv(self): # IPv4 is in use, just make sure send_epsv has not been used self.assertEqual(self.server.handler_instance.last_received_cmd, 'pasv') + def test_makepasv_issue43285_security_disabled(self): + """Test the opt-in to the old vulnerable behavior.""" + self.client.trust_server_pasv_ipv4_address = True + bad_host, port = self.client.makepasv() + self.assertEqual( + bad_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((self.client.sock.getpeername()[0], port), + timeout=TIMEOUT).close() + + def test_makepasv_issue43285_security_enabled_default(self): + self.assertFalse(self.client.trust_server_pasv_ipv4_address) + trusted_host, port = self.client.makepasv() + self.assertNotEqual( + trusted_host, self.server.handler_instance.fake_pasv_server_ip) + # Opening and closing a connection keeps the dummy server happy + # instead of timing out on accept. + socket.create_connection((trusted_host, port), timeout=TIMEOUT).close() + def test_with_statement(self): self.client.quit() diff --git a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst new file mode 100644 index 0000000000000..8312b7e885441 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst @@ -0,0 +1,8 @@ +:mod:`ftplib` no longer trusts the IP address value returned from the server +in response to the PASV command by default. This prevents a malicious FTP +server from using the response to probe IPv4 address and port combinations +on the client network. + +Code that requires the former vulnerable behavior may set a +``trust_server_pasv_ipv4_address`` attribute on their +:class:`ftplib.FTP` instances to ``True`` to re-enable it. From webhook-mailer at python.org Wed Mar 17 08:16:09 2021 From: webhook-mailer at python.org (freddrake) Date: Wed, 17 Mar 2021 12:16:09 -0000 Subject: [Python-checkins] bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) (#24825) Message-ID: https://github.com/python/cpython/commit/9bdb5802361016704fb3434369741cc6c5e08f02 commit: 9bdb5802361016704fb3434369741cc6c5e08f02 branch: 3.8 author: Mariusz Felisiak committer: freddrake date: 2021-03-17T08:15:59-04:00 summary: bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) (#24825) (cherry picked from commit bbba28212ce0f58096a4043f32442c6e727b74fc) Automerge-Triggered-By: GH:vsajip files: M Doc/library/logging.rst M Lib/logging/__init__.py diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 0a6b0d290fdfa..f01aa98efc638 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -1100,18 +1100,27 @@ functions. .. function:: getLevelName(level) - Returns the textual representation of logging level *level*. If the level is one - of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`, - :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you - have associated levels with names using :func:`addLevelName` then the name you - have associated with *level* is returned. If a numeric value corresponding to one - of the defined levels is passed in, the corresponding string representation is - returned. Otherwise, the string 'Level %s' % level is returned. + Returns the textual or numeric representation of logging level *level*. + + If *level* is one of the predefined levels :const:`CRITICAL`, :const:`ERROR`, + :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the + corresponding string. If you have associated levels with names using + :func:`addLevelName` then the name you have associated with *level* is + returned. If a numeric value corresponding to one of the defined levels is + passed in, the corresponding string representation is returned. + + The *level* parameter also accepts a string representation of the level such + as 'INFO'. In such cases, this functions returns the corresponding numeric + value of the level. + + If no matching numeric or string value is passed in, the string + 'Level %s' % level is returned. .. note:: Levels are internally integers (as they need to be compared in the logging logic). This function is used to convert between an integer level and the level name displayed in the formatted log output by means of the - ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`). + ``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and + vice versa. .. versionchanged:: 3.4 In Python versions earlier than 3.4, this function could also be passed a diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index da3f7b1f73422..b393ddde87599 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -118,7 +118,7 @@ def getLevelName(level): """ - Return the textual representation of logging level 'level'. + Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have @@ -128,7 +128,11 @@ def getLevelName(level): If a numeric value corresponding to one of the defined levels is passed in, the corresponding string representation is returned. - Otherwise, the string "Level %s" % level is returned. + If a string representation of the level is passed in, the corresponding + numeric value is returned. + + If no matching numeric or string value is passed in, the string + 'Level %s' % level is returned. """ # See Issues #22386, #27937 and #29220 for why it's this way result = _levelToName.get(level) From webhook-mailer at python.org Wed Mar 17 14:26:47 2021 From: webhook-mailer at python.org (serhiy-storchaka) Date: Wed, 17 Mar 2021 18:26:47 -0000 Subject: [Python-checkins] [3.9] bpo-43499: Restrict co_code to be under INT_MAX in codeobject (GH-20628) (GH-24896) Message-ID: https://github.com/python/cpython/commit/db733761060be92915b5f5cba209dcaada88f94e commit: db733761060be92915b5f5cba209dcaada88f94e branch: 3.9 author: Ammar Askar committer: serhiy-storchaka date: 2021-03-17T20:26:38+02:00 summary: [3.9] bpo-43499: Restrict co_code to be under INT_MAX in codeobject (GH-20628) (GH-24896) (cherry picked from commit 3b3b83c965447a8329b34cb4befe6e9908880ee5) files: M Objects/codeobject.c M Objects/frameobject.c diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 737635943aced..cb4fb68124333 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -166,6 +166,14 @@ PyCode_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, return NULL; } + /* Make sure that code is indexable with an int, this is + a long running assumption in ceval.c and many parts of + the interpreter. */ + if (PyBytes_GET_SIZE(code) > INT_MAX) { + PyErr_SetString(PyExc_OverflowError, "co_code larger than INT_MAX"); + return NULL; + } + /* Check for any inner or outer closure references */ n_cellvars = PyTuple_GET_SIZE(cellvars); if (!n_cellvars && !PyTuple_GET_SIZE(freevars)) { diff --git a/Objects/frameobject.c b/Objects/frameobject.c index a2fc0a423747f..b511e4c832c77 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -397,7 +397,9 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore return -1; } - int len = PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT); + /* PyCode_NewWithPosOnlyArgs limits co_code to be under INT_MAX so this + * should never overflow. */ + int len = (int)(PyBytes_GET_SIZE(f->f_code->co_code) / sizeof(_Py_CODEUNIT)); int *lines = marklines(f->f_code, len); if (lines == NULL) { return -1; From webhook-mailer at python.org Wed Mar 17 16:47:04 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 17 Mar 2021 20:47:04 -0000 Subject: [Python-checkins] bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) Message-ID: https://github.com/python/cpython/commit/9976834f807ea63ca51bc4f89be457d734148682 commit: 9976834f807ea63ca51bc4f89be457d734148682 branch: master author: Victor Stinner committer: vstinner date: 2021-03-17T21:46:53+01:00 summary: bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range. Use MAX_UNICODE constant in unicodeobject.c. files: A Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst M Lib/test/test_cmd_line.py M Objects/unicodeobject.c M Python/fileutils.c diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 95ab9d8c13965..e87eede0c2676 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -200,38 +200,72 @@ def test_undecodable_code(self): if not stdout.startswith(pattern): raise AssertionError("%a doesn't start with %a" % (stdout, pattern)) + @unittest.skipIf(sys.platform == 'win32', + 'Windows has a native unicode API') + def test_invalid_utf8_arg(self): + # bpo-35883: Py_DecodeLocale() must escape b'\xfd\xbf\xbf\xbb\xba\xba' + # byte sequence with surrogateescape rather than decoding it as the + # U+7fffbeba character which is outside the [U+0000; U+10ffff] range of + # Python Unicode characters. + # + # Test with default config, in the C locale, in the Python UTF-8 Mode. + code = 'import sys, os; s=os.fsencode(sys.argv[1]); print(ascii(s))' + base_cmd = [sys.executable, '-c', code] + + def run_default(arg): + cmd = [sys.executable, '-c', code, arg] + return subprocess.run(cmd, stdout=subprocess.PIPE, text=True) + + def run_c_locale(arg): + cmd = [sys.executable, '-c', code, arg] + env = dict(os.environ) + env['LC_ALL'] = 'C' + return subprocess.run(cmd, stdout=subprocess.PIPE, + text=True, env=env) + + def run_utf8_mode(arg): + cmd = [sys.executable, '-X', 'utf8', '-c', code, arg] + return subprocess.run(cmd, stdout=subprocess.PIPE, text=True) + + valid_utf8 = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') + # invalid UTF-8 byte sequences with a valid UTF-8 sequence + # in the middle. + invalid_utf8 = ( + b'\xff' # invalid byte + b'\xc3\xff' # invalid byte sequence + b'\xc3\xa9' # valid utf-8: U+00E9 character + b'\xed\xa0\x80' # lone surrogate character (invalid) + b'\xfd\xbf\xbf\xbb\xba\xba' # character outside [U+0000; U+10ffff] + ) + test_args = [valid_utf8, invalid_utf8] + + for run_cmd in (run_default, run_c_locale, run_utf8_mode): + with self.subTest(run_cmd=run_cmd): + for arg in test_args: + proc = run_cmd(arg) + self.assertEqual(proc.stdout.rstrip(), ascii(arg)) + @unittest.skipUnless((sys.platform == 'darwin' or support.is_android), 'test specific to Mac OS X and Android') def test_osx_android_utf8(self): - def check_output(text): - decoded = text.decode('utf-8', 'surrogateescape') - expected = ascii(decoded).encode('ascii') + b'\n' + text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') + code = "import sys; print(ascii(sys.argv[1]))" - env = os.environ.copy() - # C locale gives ASCII locale encoding, but Python uses UTF-8 - # to parse the command line arguments on Mac OS X and Android. - env['LC_ALL'] = 'C' + decoded = text.decode('utf-8', 'surrogateescape') + expected = ascii(decoded).encode('ascii') + b'\n' - p = subprocess.Popen( - (sys.executable, "-c", "import sys; print(ascii(sys.argv[1]))", text), - stdout=subprocess.PIPE, - env=env) - stdout, stderr = p.communicate() - self.assertEqual(stdout, expected) - self.assertEqual(p.returncode, 0) + env = os.environ.copy() + # C locale gives ASCII locale encoding, but Python uses UTF-8 + # to parse the command line arguments on Mac OS X and Android. + env['LC_ALL'] = 'C' - # test valid utf-8 - text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') - check_output(text) - - # test invalid utf-8 - text = ( - b'\xff' # invalid byte - b'\xc3\xa9' # valid utf-8 character - b'\xc3\xff' # invalid byte sequence - b'\xed\xa0\x80' # lone surrogate character (invalid) - ) - check_output(text) + p = subprocess.Popen( + (sys.executable, "-c", code, text), + stdout=subprocess.PIPE, + env=env) + stdout, stderr = p.communicate() + self.assertEqual(stdout, expected) + self.assertEqual(p.returncode, 0) def test_non_interactive_output_buffering(self): code = textwrap.dedent(""" diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst new file mode 100644 index 0000000000000..46742429db64b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst @@ -0,0 +1,4 @@ +Python no longer fails at startup with a fatal error if a command line +argument contains an invalid Unicode character. The +:c:func:`Py_DecodeLocale` function now escapes byte sequences which would be +decoded as Unicode characters outside the [U+0000; U+10ffff] range. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 0b08b0e8f0740..a7a3151547099 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -94,7 +94,8 @@ NOTE: In the interpreter's initialization phase, some globals are currently extern "C" { #endif -/* Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) */ +// Maximum code point of Unicode 6.0: 0x10ffff (1,114,111). +// The value must be the same in fileutils.c. #define MAX_UNICODE 0x10ffff #ifdef Py_DEBUG @@ -1784,8 +1785,8 @@ find_maxchar_surrogates(const wchar_t *begin, const wchar_t *end, *maxchar = ch; if (*maxchar > MAX_UNICODE) { PyErr_Format(PyExc_ValueError, - "character U+%x is not in range [U+0000; U+10ffff]", - ch); + "character U+%x is not in range [U+0000; U+%x]", + ch, MAX_UNICODE); return -1; } } @@ -14089,7 +14090,7 @@ _PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, { case PyUnicode_1BYTE_KIND: maxchar = 0xff; break; case PyUnicode_2BYTE_KIND: maxchar = 0xffff; break; - case PyUnicode_4BYTE_KIND: maxchar = 0x10ffff; break; + case PyUnicode_4BYTE_KIND: maxchar = MAX_UNICODE; break; default: Py_UNREACHABLE(); } diff --git a/Python/fileutils.c b/Python/fileutils.c index f2b4681ea849c..4997f922251c1 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -34,6 +34,13 @@ extern int winerror_to_errno(int); int _Py_open_cloexec_works = -1; #endif +// The value must be the same in unicodeobject.c. +#define MAX_UNICODE 0x10ffff + +// mbstowcs() and mbrtowc() errors +static const size_t DECODE_ERROR = ((size_t)-1); +static const size_t INCOMPLETE_CHARACTER = (size_t)-2; + static int get_surrogateescape(_Py_error_handler errors, int *surrogateescape) @@ -82,6 +89,57 @@ _Py_device_encoding(int fd) #endif } + +static size_t +is_valid_wide_char(wchar_t ch) +{ + if (Py_UNICODE_IS_SURROGATE(ch)) { + // Reject lone surrogate characters + return 0; + } + if (ch > MAX_UNICODE) { + // bpo-35883: Reject characters outside [U+0000; U+10ffff] range. + // The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629, + // it creates characters outside the [U+0000; U+10ffff] range: + // https://sourceware.org/bugzilla/show_bug.cgi?id=2373 + return 0; + } + return 1; +} + + +static size_t +_Py_mbstowcs(wchar_t *dest, const char *src, size_t n) +{ + size_t count = mbstowcs(dest, src, n); + if (dest != NULL && count != DECODE_ERROR) { + for (size_t i=0; i < count; i++) { + wchar_t ch = dest[i]; + if (!is_valid_wide_char(ch)) { + return DECODE_ERROR; + } + } + } + return count; +} + + +#ifdef HAVE_MBRTOWC +static size_t +_Py_mbrtowc(wchar_t *pwc, const char *str, size_t len, mbstate_t *pmbs) +{ + assert(pwc != NULL); + size_t count = mbrtowc(pwc, str, len, pmbs); + if (count != 0 && count != DECODE_ERROR && count != INCOMPLETE_CHARACTER) { + if (!is_valid_wide_char(*pwc)) { + return DECODE_ERROR; + } + } + return count; +} +#endif + + #if !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) #define USE_FORCE_ASCII @@ -148,8 +206,8 @@ check_force_ascii(void) size_t res; ch = (unsigned char)0xA7; - res = mbstowcs(&wch, (char*)&ch, 1); - if (res != (size_t)-1 && wch == L'\xA7') { + res = _Py_mbstowcs(&wch, (char*)&ch, 1); + if (res != DECODE_ERROR && wch == L'\xA7') { /* On HP-UX withe C locale or the POSIX locale, nl_langinfo(CODESET) announces "roman8", whereas mbstowcs() uses Latin1 encoding in practice. Force ASCII in this case. @@ -196,8 +254,8 @@ check_force_ascii(void) unsigned uch = (unsigned char)i; ch[0] = (char)uch; - res = mbstowcs(wch, ch, 1); - if (res != (size_t)-1) { + res = _Py_mbstowcs(wch, ch, 1); + if (res != DECODE_ERROR) { /* decoding a non-ASCII character from the locale encoding succeed: the locale encoding is not ASCII, force ASCII */ return 1; @@ -387,9 +445,9 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, */ argsize = strlen(arg); #else - argsize = mbstowcs(NULL, arg, 0); + argsize = _Py_mbstowcs(NULL, arg, 0); #endif - if (argsize != (size_t)-1) { + if (argsize != DECODE_ERROR) { if (argsize > PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { return -1; } @@ -398,21 +456,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, return -1; } - count = mbstowcs(res, arg, argsize + 1); - if (count != (size_t)-1) { - wchar_t *tmp; - /* Only use the result if it contains no - surrogate characters. */ - for (tmp = res; *tmp != 0 && - !Py_UNICODE_IS_SURROGATE(*tmp); tmp++) - ; - if (*tmp == 0) { - if (wlen != NULL) { - *wlen = count; - } - *wstr = res; - return 0; + count = _Py_mbstowcs(res, arg, argsize + 1); + if (count != DECODE_ERROR) { + *wstr = res; + if (wlen != NULL) { + *wlen = count; } + return 0; } PyMem_RawFree(res); } @@ -436,13 +486,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, out = res; memset(&mbs, 0, sizeof mbs); while (argsize) { - size_t converted = mbrtowc(out, (char*)in, argsize, &mbs); + size_t converted = _Py_mbrtowc(out, (char*)in, argsize, &mbs); if (converted == 0) { /* Reached end of string; null char stored. */ break; } - if (converted == (size_t)-2) { + if (converted == INCOMPLETE_CHARACTER) { /* Incomplete character. This should never happen, since we provide everything that we have - unless there is a bug in the C library, or I @@ -450,32 +500,22 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, goto decode_error; } - if (converted == (size_t)-1) { + if (converted == DECODE_ERROR) { if (!surrogateescape) { goto decode_error; } - /* Conversion error. Escape as UTF-8b, and start over - in the initial shift state. */ + /* Decoding error. Escape as UTF-8b, and start over in the initial + shift state. */ *out++ = 0xdc00 + *in++; argsize--; memset(&mbs, 0, sizeof mbs); continue; } - if (Py_UNICODE_IS_SURROGATE(*out)) { - if (!surrogateescape) { - goto decode_error; - } + // _Py_mbrtowc() reject lone surrogate characters + assert(!Py_UNICODE_IS_SURROGATE(*out)); - /* Surrogate character. Escape the original - byte sequence with surrogateescape. */ - argsize -= converted; - while (converted--) { - *out++ = 0xdc00 + *in++; - } - continue; - } /* successfully converted some bytes */ in += converted; argsize -= converted; @@ -652,7 +692,7 @@ encode_current_locale(const wchar_t *text, char **str, else { converted = wcstombs(NULL, buf, 0); } - if (converted == (size_t)-1) { + if (converted == DECODE_ERROR) { goto encode_error; } if (bytes != NULL) { @@ -1440,7 +1480,7 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode) char cmode[10]; size_t r; r = wcstombs(cmode, mode, 10); - if (r == (size_t)-1 || r >= 10) { + if (r == DECODE_ERROR || r >= 10) { errno = EINVAL; return NULL; } From webhook-mailer at python.org Wed Mar 17 17:11:24 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 17 Mar 2021 21:11:24 -0000 Subject: [Python-checkins] bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) Message-ID: https://github.com/python/cpython/commit/aa967ec4d4c2fc844f8f16b339140b050ae4d5e2 commit: aa967ec4d4c2fc844f8f16b339140b050ae4d5e2 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-17T14:11:14-07:00 summary: bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range. Use MAX_UNICODE constant in unicodeobject.c. (cherry picked from commit 9976834f807ea63ca51bc4f89be457d734148682) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst M Lib/test/test_cmd_line.py M Objects/unicodeobject.c M Python/fileutils.c diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 051c092eb6c39..a3560b4b1fd9b 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -191,38 +191,72 @@ def test_undecodable_code(self): if not stdout.startswith(pattern): raise AssertionError("%a doesn't start with %a" % (stdout, pattern)) + @unittest.skipIf(sys.platform == 'win32', + 'Windows has a native unicode API') + def test_invalid_utf8_arg(self): + # bpo-35883: Py_DecodeLocale() must escape b'\xfd\xbf\xbf\xbb\xba\xba' + # byte sequence with surrogateescape rather than decoding it as the + # U+7fffbeba character which is outside the [U+0000; U+10ffff] range of + # Python Unicode characters. + # + # Test with default config, in the C locale, in the Python UTF-8 Mode. + code = 'import sys, os; s=os.fsencode(sys.argv[1]); print(ascii(s))' + base_cmd = [sys.executable, '-c', code] + + def run_default(arg): + cmd = [sys.executable, '-c', code, arg] + return subprocess.run(cmd, stdout=subprocess.PIPE, text=True) + + def run_c_locale(arg): + cmd = [sys.executable, '-c', code, arg] + env = dict(os.environ) + env['LC_ALL'] = 'C' + return subprocess.run(cmd, stdout=subprocess.PIPE, + text=True, env=env) + + def run_utf8_mode(arg): + cmd = [sys.executable, '-X', 'utf8', '-c', code, arg] + return subprocess.run(cmd, stdout=subprocess.PIPE, text=True) + + valid_utf8 = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') + # invalid UTF-8 byte sequences with a valid UTF-8 sequence + # in the middle. + invalid_utf8 = ( + b'\xff' # invalid byte + b'\xc3\xff' # invalid byte sequence + b'\xc3\xa9' # valid utf-8: U+00E9 character + b'\xed\xa0\x80' # lone surrogate character (invalid) + b'\xfd\xbf\xbf\xbb\xba\xba' # character outside [U+0000; U+10ffff] + ) + test_args = [valid_utf8, invalid_utf8] + + for run_cmd in (run_default, run_c_locale, run_utf8_mode): + with self.subTest(run_cmd=run_cmd): + for arg in test_args: + proc = run_cmd(arg) + self.assertEqual(proc.stdout.rstrip(), ascii(arg)) + @unittest.skipUnless((sys.platform == 'darwin' or support.is_android), 'test specific to Mac OS X and Android') def test_osx_android_utf8(self): - def check_output(text): - decoded = text.decode('utf-8', 'surrogateescape') - expected = ascii(decoded).encode('ascii') + b'\n' + text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') + code = "import sys; print(ascii(sys.argv[1]))" - env = os.environ.copy() - # C locale gives ASCII locale encoding, but Python uses UTF-8 - # to parse the command line arguments on Mac OS X and Android. - env['LC_ALL'] = 'C' + decoded = text.decode('utf-8', 'surrogateescape') + expected = ascii(decoded).encode('ascii') + b'\n' - p = subprocess.Popen( - (sys.executable, "-c", "import sys; print(ascii(sys.argv[1]))", text), - stdout=subprocess.PIPE, - env=env) - stdout, stderr = p.communicate() - self.assertEqual(stdout, expected) - self.assertEqual(p.returncode, 0) + env = os.environ.copy() + # C locale gives ASCII locale encoding, but Python uses UTF-8 + # to parse the command line arguments on Mac OS X and Android. + env['LC_ALL'] = 'C' - # test valid utf-8 - text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') - check_output(text) - - # test invalid utf-8 - text = ( - b'\xff' # invalid byte - b'\xc3\xa9' # valid utf-8 character - b'\xc3\xff' # invalid byte sequence - b'\xed\xa0\x80' # lone surrogate character (invalid) - ) - check_output(text) + p = subprocess.Popen( + (sys.executable, "-c", code, text), + stdout=subprocess.PIPE, + env=env) + stdout, stderr = p.communicate() + self.assertEqual(stdout, expected) + self.assertEqual(p.returncode, 0) def test_non_interactive_output_buffering(self): code = textwrap.dedent(""" diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst new file mode 100644 index 0000000000000..46742429db64b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst @@ -0,0 +1,4 @@ +Python no longer fails at startup with a fatal error if a command line +argument contains an invalid Unicode character. The +:c:func:`Py_DecodeLocale` function now escapes byte sequences which would be +decoded as Unicode characters outside the [U+0000; U+10ffff] range. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9cc04eea0597c..19326fa60e58c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -93,7 +93,8 @@ NOTE: In the interpreter's initialization phase, some globals are currently extern "C" { #endif -/* Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) */ +// Maximum code point of Unicode 6.0: 0x10ffff (1,114,111). +// The value must be the same in fileutils.c. #define MAX_UNICODE 0x10ffff #ifdef Py_DEBUG @@ -1789,8 +1790,8 @@ find_maxchar_surrogates(const wchar_t *begin, const wchar_t *end, *maxchar = ch; if (*maxchar > MAX_UNICODE) { PyErr_Format(PyExc_ValueError, - "character U+%x is not in range [U+0000; U+10ffff]", - ch); + "character U+%x is not in range [U+0000; U+%x]", + ch, MAX_UNICODE); return -1; } } @@ -13934,7 +13935,7 @@ _PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, { case PyUnicode_1BYTE_KIND: maxchar = 0xff; break; case PyUnicode_2BYTE_KIND: maxchar = 0xffff; break; - case PyUnicode_4BYTE_KIND: maxchar = 0x10ffff; break; + case PyUnicode_4BYTE_KIND: maxchar = MAX_UNICODE; break; default: Py_UNREACHABLE(); } diff --git a/Python/fileutils.c b/Python/fileutils.c index cf11e9297d78f..769ab591ab43f 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -33,6 +33,13 @@ extern int winerror_to_errno(int); int _Py_open_cloexec_works = -1; #endif +// The value must be the same in unicodeobject.c. +#define MAX_UNICODE 0x10ffff + +// mbstowcs() and mbrtowc() errors +static const size_t DECODE_ERROR = ((size_t)-1); +static const size_t INCOMPLETE_CHARACTER = (size_t)-2; + static int get_surrogateescape(_Py_error_handler errors, int *surrogateescape) @@ -85,6 +92,57 @@ _Py_device_encoding(int fd) Py_RETURN_NONE; } + +static size_t +is_valid_wide_char(wchar_t ch) +{ + if (Py_UNICODE_IS_SURROGATE(ch)) { + // Reject lone surrogate characters + return 0; + } + if (ch > MAX_UNICODE) { + // bpo-35883: Reject characters outside [U+0000; U+10ffff] range. + // The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629, + // it creates characters outside the [U+0000; U+10ffff] range: + // https://sourceware.org/bugzilla/show_bug.cgi?id=2373 + return 0; + } + return 1; +} + + +static size_t +_Py_mbstowcs(wchar_t *dest, const char *src, size_t n) +{ + size_t count = mbstowcs(dest, src, n); + if (dest != NULL && count != DECODE_ERROR) { + for (size_t i=0; i < count; i++) { + wchar_t ch = dest[i]; + if (!is_valid_wide_char(ch)) { + return DECODE_ERROR; + } + } + } + return count; +} + + +#ifdef HAVE_MBRTOWC +static size_t +_Py_mbrtowc(wchar_t *pwc, const char *str, size_t len, mbstate_t *pmbs) +{ + assert(pwc != NULL); + size_t count = mbrtowc(pwc, str, len, pmbs); + if (count != 0 && count != DECODE_ERROR && count != INCOMPLETE_CHARACTER) { + if (!is_valid_wide_char(*pwc)) { + return DECODE_ERROR; + } + } + return count; +} +#endif + + #if !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) #define USE_FORCE_ASCII @@ -151,8 +209,8 @@ check_force_ascii(void) size_t res; ch = (unsigned char)0xA7; - res = mbstowcs(&wch, (char*)&ch, 1); - if (res != (size_t)-1 && wch == L'\xA7') { + res = _Py_mbstowcs(&wch, (char*)&ch, 1); + if (res != DECODE_ERROR && wch == L'\xA7') { /* On HP-UX withe C locale or the POSIX locale, nl_langinfo(CODESET) announces "roman8", whereas mbstowcs() uses Latin1 encoding in practice. Force ASCII in this case. @@ -199,8 +257,8 @@ check_force_ascii(void) unsigned uch = (unsigned char)i; ch[0] = (char)uch; - res = mbstowcs(wch, ch, 1); - if (res != (size_t)-1) { + res = _Py_mbstowcs(wch, ch, 1); + if (res != DECODE_ERROR) { /* decoding a non-ASCII character from the locale encoding succeed: the locale encoding is not ASCII, force ASCII */ return 1; @@ -390,9 +448,9 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, */ argsize = strlen(arg); #else - argsize = mbstowcs(NULL, arg, 0); + argsize = _Py_mbstowcs(NULL, arg, 0); #endif - if (argsize != (size_t)-1) { + if (argsize != DECODE_ERROR) { if (argsize > PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { return -1; } @@ -401,21 +459,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, return -1; } - count = mbstowcs(res, arg, argsize + 1); - if (count != (size_t)-1) { - wchar_t *tmp; - /* Only use the result if it contains no - surrogate characters. */ - for (tmp = res; *tmp != 0 && - !Py_UNICODE_IS_SURROGATE(*tmp); tmp++) - ; - if (*tmp == 0) { - if (wlen != NULL) { - *wlen = count; - } - *wstr = res; - return 0; + count = _Py_mbstowcs(res, arg, argsize + 1); + if (count != DECODE_ERROR) { + *wstr = res; + if (wlen != NULL) { + *wlen = count; } + return 0; } PyMem_RawFree(res); } @@ -439,13 +489,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, out = res; memset(&mbs, 0, sizeof mbs); while (argsize) { - size_t converted = mbrtowc(out, (char*)in, argsize, &mbs); + size_t converted = _Py_mbrtowc(out, (char*)in, argsize, &mbs); if (converted == 0) { /* Reached end of string; null char stored. */ break; } - if (converted == (size_t)-2) { + if (converted == INCOMPLETE_CHARACTER) { /* Incomplete character. This should never happen, since we provide everything that we have - unless there is a bug in the C library, or I @@ -453,32 +503,22 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, goto decode_error; } - if (converted == (size_t)-1) { + if (converted == DECODE_ERROR) { if (!surrogateescape) { goto decode_error; } - /* Conversion error. Escape as UTF-8b, and start over - in the initial shift state. */ + /* Decoding error. Escape as UTF-8b, and start over in the initial + shift state. */ *out++ = 0xdc00 + *in++; argsize--; memset(&mbs, 0, sizeof mbs); continue; } - if (Py_UNICODE_IS_SURROGATE(*out)) { - if (!surrogateescape) { - goto decode_error; - } + // _Py_mbrtowc() reject lone surrogate characters + assert(!Py_UNICODE_IS_SURROGATE(*out)); - /* Surrogate character. Escape the original - byte sequence with surrogateescape. */ - argsize -= converted; - while (converted--) { - *out++ = 0xdc00 + *in++; - } - continue; - } /* successfully converted some bytes */ in += converted; argsize -= converted; @@ -655,7 +695,7 @@ encode_current_locale(const wchar_t *text, char **str, else { converted = wcstombs(NULL, buf, 0); } - if (converted == (size_t)-1) { + if (converted == DECODE_ERROR) { goto encode_error; } if (bytes != NULL) { @@ -1374,7 +1414,7 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode) char cmode[10]; size_t r; r = wcstombs(cmode, mode, 10); - if (r == (size_t)-1 || r >= 10) { + if (r == DECODE_ERROR || r >= 10) { errno = EINVAL; return NULL; } From webhook-mailer at python.org Wed Mar 17 18:07:25 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 17 Mar 2021 22:07:25 -0000 Subject: [Python-checkins] Remove unnecessary imports in the grammar parser (GH-24904) Message-ID: https://github.com/python/cpython/commit/e272528bbd5e0b081dbffa73b1a6908f3992d13c commit: e272528bbd5e0b081dbffa73b1a6908f3992d13c branch: master author: Elisha Hollander committer: pablogsal date: 2021-03-17T22:07:17Z summary: Remove unnecessary imports in the grammar parser (GH-24904) files: M Tools/peg_generator/pegen/grammar_parser.py M Tools/peg_generator/pegen/python_generator.py diff --git a/Tools/peg_generator/pegen/grammar_parser.py b/Tools/peg_generator/pegen/grammar_parser.py index fde0145ee8891..d94f01ad1a00c 100644 --- a/Tools/peg_generator/pegen/grammar_parser.py +++ b/Tools/peg_generator/pegen/grammar_parser.py @@ -2,10 +2,7 @@ # @generated by pegen from ./Tools/peg_generator/pegen/metagrammar.gram import ast -import sys -import tokenize - -from typing import Any, Optional +from typing import Optional from pegen.parser import memoize, memoize_left_rec, logger, Parser from ast import literal_eval diff --git a/Tools/peg_generator/pegen/python_generator.py b/Tools/peg_generator/pegen/python_generator.py index b786de7fee5b4..61827a6349b41 100644 --- a/Tools/peg_generator/pegen/python_generator.py +++ b/Tools/peg_generator/pegen/python_generator.py @@ -27,10 +27,7 @@ # @generated by pegen from {filename} import ast -import sys -import tokenize - -from typing import Any, Optional +from typing import Optional from pegen.parser import memoize, memoize_left_rec, logger, Parser From webhook-mailer at python.org Wed Mar 17 18:11:11 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 17 Mar 2021 22:11:11 -0000 Subject: [Python-checkins] bpo-43244: Rename pycore_ast.h to pycore_ast_state.h (GH-24907) Message-ID: https://github.com/python/cpython/commit/b4536e1c6abe4c6219177a89e16575d05ea22f64 commit: b4536e1c6abe4c6219177a89e16575d05ea22f64 branch: master author: Victor Stinner committer: vstinner date: 2021-03-17T23:11:03+01:00 summary: bpo-43244: Rename pycore_ast.h to pycore_ast_state.h (GH-24907) files: A Include/internal/pycore_ast_state.h D Include/internal/pycore_ast.h M Include/internal/pycore_interp.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M PCbuild/regen.vcxproj M Parser/asdl_c.py M Python/Python-ast.c diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast_state.h similarity index 98% rename from Include/internal/pycore_ast.h rename to Include/internal/pycore_ast_state.h index 2d0c5fb97a778..c5ae224217792 100644 --- a/Include/internal/pycore_ast.h +++ b/Include/internal/pycore_ast_state.h @@ -1,7 +1,7 @@ // File automatically generated by Parser/asdl_c.py. -#ifndef Py_INTERNAL_AST_H -#define Py_INTERNAL_AST_H +#ifndef Py_INTERNAL_AST_STATE_H +#define Py_INTERNAL_AST_STATE_H #ifdef __cplusplus extern "C" { #endif @@ -240,5 +240,5 @@ struct ast_state { #ifdef __cplusplus } #endif -#endif /* !Py_INTERNAL_AST_H */ +#endif /* !Py_INTERNAL_AST_STATE_H */ diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index ea770daedd8a1..1e4b3ff71eed4 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -9,7 +9,7 @@ extern "C" { #endif #include "pycore_atomic.h" // _Py_atomic_address -#include "pycore_ast.h" // struct ast_state +#include "pycore_ast_state.h" // struct ast_state #include "pycore_gil.h" // struct _gil_runtime_state #include "pycore_gc.h" // struct _gc_runtime_state #include "pycore_warnings.h" // struct _warnings_runtime_state diff --git a/Makefile.pre.in b/Makefile.pre.in index 50bd75c63a44d..ee93ab6ca150e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -854,11 +854,11 @@ regen-ast: $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \ $(srcdir)/Parser/Python.asdl \ -H $(srcdir)/Include/Python-ast.h.new \ - -I $(srcdir)/Include/internal/pycore_ast.h.new \ + -I $(srcdir)/Include/internal/pycore_ast_state.h.new \ -C $(srcdir)/Python/Python-ast.c.new $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new - $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new + $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new .PHONY: regen-opcode @@ -1135,6 +1135,7 @@ PYTHON_HEADERS= \ \ $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ + $(srcdir)/Include/internal/pycore_ast_state.h \ $(srcdir)/Include/internal/pycore_atomic.h \ $(srcdir)/Include/internal/pycore_atomic_funcs.h \ $(srcdir)/Include/internal/pycore_bitutils.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 92355a886d91a..655c831ed5ff6 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -175,6 +175,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index d0b69dbc5b64f..fba4af536fec9 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -486,6 +486,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 936f5fd24646a..166468a93bfc3 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -137,7 +137,7 @@ - + @@ -163,15 +163,15 @@ - - + + - + @@ -209,7 +209,7 @@ - + diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 8c167bc79c779..e96f1f3504567 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1429,7 +1429,7 @@ def generate_module_def(mod, f, internal_h): print(textwrap.dedent(f""" #ifdef Py_BUILD_CORE - # include "pycore_ast.h" // struct ast_state + # include "pycore_ast_state.h" // struct ast_state # include "pycore_interp.h" // _PyInterpreterState.ast # include "pycore_pystate.h" // _PyInterpreterState_GET() #else @@ -1522,8 +1522,8 @@ def write_header(mod, f): def write_internal_h_header(mod, f): print(textwrap.dedent(""" - #ifndef Py_INTERNAL_AST_H - #define Py_INTERNAL_AST_H + #ifndef Py_INTERNAL_AST_STATE_H + #define Py_INTERNAL_AST_STATE_H #ifdef __cplusplus extern "C" { #endif @@ -1540,7 +1540,7 @@ def write_internal_h_footer(mod, f): #ifdef __cplusplus } #endif - #endif /* !Py_INTERNAL_AST_H */ + #endif /* !Py_INTERNAL_AST_STATE_H */ """), file=f) diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 439da8f2512ef..59acce7968407 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -6,7 +6,7 @@ #include "Python.h" #ifdef Py_BUILD_CORE -# include "pycore_ast.h" // struct ast_state +# include "pycore_ast_state.h" // struct ast_state # include "pycore_interp.h" // _PyInterpreterState.ast # include "pycore_pystate.h" // _PyInterpreterState_GET() #else From webhook-mailer at python.org Wed Mar 17 18:51:10 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 17 Mar 2021 22:51:10 -0000 Subject: [Python-checkins] bpo-43244: Add pycore_ast.h header file (GH-24908) Message-ID: https://github.com/python/cpython/commit/526fdeb2278b61653df704d7cfcaedde504dee48 commit: 526fdeb2278b61653df704d7cfcaedde504dee48 branch: master author: Victor Stinner committer: vstinner date: 2021-03-17T23:50:50+01:00 summary: bpo-43244: Add pycore_ast.h header file (GH-24908) Move _PyAST_GetDocString() and _PyAST_ExprAsUnicode() functions the internal C API: from Include/ast.h to a new Include/internal/pycore_ast.h header file. Don't export these functions anymore: replace PyAPI_FUNC() with extern. Remove also unused includes. files: A Include/internal/pycore_ast.h M Include/ast.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/ast_opt.c M Python/compile.c M Python/future.c diff --git a/Include/ast.h b/Include/ast.h index 434ee18dd91b2..2f19b1a870dac 100644 --- a/Include/ast.h +++ b/Include/ast.h @@ -9,14 +9,6 @@ extern "C" { PyAPI_FUNC(int) PyAST_Validate(mod_ty); -/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ -PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty); - -/* Return the borrowed reference to the first literal string in the - sequence of statements or NULL if it doesn't start from a literal string. - Doesn't set exception. */ -PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_stmt_seq *); - #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast.h new file mode 100644 index 0000000000000..38c9212b07ca0 --- /dev/null +++ b/Include/internal/pycore_ast.h @@ -0,0 +1,25 @@ +#ifndef Py_INTERNAL_AST_H +#define Py_INTERNAL_AST_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "Python-ast.h" // expr_ty + +/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ +extern PyObject* _PyAST_ExprAsUnicode(expr_ty); + +/* Return the borrowed reference to the first literal string in the + sequence of statements or NULL if it doesn't start from a literal string. + Doesn't set exception. */ +extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_AST_H */ + diff --git a/Makefile.pre.in b/Makefile.pre.in index ee93ab6ca150e..5ad304e30d022 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1135,6 +1135,7 @@ PYTHON_HEADERS= \ \ $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ + $(srcdir)/Include/internal/pycore_ast.h \ $(srcdir)/Include/internal/pycore_ast_state.h \ $(srcdir)/Include/internal/pycore_atomic.h \ $(srcdir)/Include/internal/pycore_atomic_funcs.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 655c831ed5ff6..37c60af4f74d7 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -175,6 +175,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index fba4af536fec9..76894079890fd 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -486,6 +486,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 6ad00dcf93cbd..c76b428f97298 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -1,7 +1,6 @@ /* AST Optimizer */ #include "Python.h" -#include "Python-ast.h" -#include "ast.h" +#include "pycore_ast.h" // _PyAST_GetDocString() static int diff --git a/Python/compile.c b/Python/compile.c index a1260aadd62e4..6ef5d5f69896c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -22,16 +22,15 @@ */ #include "Python.h" +#include "pycore_ast.h" // _PyAST_GetDocString() #include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_long.h" // _PyLong_GetZero() -#include "Python-ast.h" -#include "ast.h" -#include "code.h" -#include "symtable.h" +#include "symtable.h" // struct symtable #define NEED_OPCODE_JUMP_TABLES -#include "opcode.h" -#include "wordcode_helpers.h" +#include "opcode.h" // EXTENDED_ARG +#include "wordcode_helpers.h" // instrsize() + #define DEFAULT_BLOCK_SIZE 16 #define DEFAULT_BLOCKS 8 diff --git a/Python/future.c b/Python/future.c index 4b73eb6412905..37e7a22f81c2b 100644 --- a/Python/future.c +++ b/Python/future.c @@ -1,9 +1,5 @@ #include "Python.h" -#include "Python-ast.h" -#include "token.h" -#include "code.h" -#include "symtable.h" -#include "ast.h" +#include "pycore_ast.h" // _PyAST_GetDocString() #define UNDEFINED_FUTURE_FEATURE "future feature %.100s is not defined" #define ERR_LATE_FUTURE \ From webhook-mailer at python.org Wed Mar 17 20:26:15 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 00:26:15 -0000 Subject: [Python-checkins] Add a warning block around the get_referrers() documentation (GH-24511) Message-ID: https://github.com/python/cpython/commit/4cc9e2348b6a8430dc21cb7ff8c9850d16f772f9 commit: 4cc9e2348b6a8430dc21cb7ff8c9850d16f772f9 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-17T17:26:07-07:00 summary: Add a warning block around the get_referrers() documentation (GH-24511) (cherry picked from commit 813db24f7c2c536d587d1832c3c52b44fa9e242e) Co-authored-by: Pablo Galindo files: M Doc/library/gc.rst diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 4558081b1dbe8..69a1a8313b759 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -137,10 +137,11 @@ The :mod:`gc` module provides the following functions: resulting referrers. To get only currently live objects, call :func:`collect` before calling :func:`get_referrers`. - Care must be taken when using objects returned by :func:`get_referrers` because - some of them could still be under construction and hence in a temporarily - invalid state. Avoid using :func:`get_referrers` for any purpose other than - debugging. + .. warning:: + Care must be taken when using objects returned by :func:`get_referrers` because + some of them could still be under construction and hence in a temporarily + invalid state. Avoid using :func:`get_referrers` for any purpose other than + debugging. .. audit-event:: gc.get_referrers objs gc.get_referrers From webhook-mailer at python.org Wed Mar 17 21:03:37 2021 From: webhook-mailer at python.org (pablogsal) Date: Thu, 18 Mar 2021 01:03:37 -0000 Subject: [Python-checkins] bpo-42128: Add 'missing :' syntax error message to match statements (GH-24733) Message-ID: https://github.com/python/cpython/commit/08fb8ac99ab03d767aa0f1cfab3573eddf9df018 commit: 08fb8ac99ab03d767aa0f1cfab3573eddf9df018 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-18T01:03:11Z summary: bpo-42128: Add 'missing :' syntax error message to match statements (GH-24733) files: M Grammar/python.gram M Lib/test/test_syntax.py M Parser/parser.c diff --git a/Grammar/python.gram b/Grammar/python.gram index a225664ebb8aa..7247962d3b971 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -211,6 +211,7 @@ finally_block[asdl_stmt_seq*]: 'finally' ':' a=block { a } match_stmt[stmt_ty]: | "match" subject=subject_expr ':' NEWLINE INDENT cases[asdl_match_case_seq*]=case_block+ DEDENT { CHECK_VERSION(stmt_ty, 10, "Pattern matching is", _Py_Match(subject, cases, EXTRA)) } + | invalid_match_stmt subject_expr[expr_ty]: | value=star_named_expression ',' values=star_named_expressions? { _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, value, values)), Load, EXTRA) } @@ -218,6 +219,7 @@ subject_expr[expr_ty]: case_block[match_case_ty]: | "case" pattern=patterns guard=guard? ':' body=block { _Py_match_case(pattern, guard, body, p->arena) } + | invalid_case_block guard[expr_ty]: 'if' guard=named_expression { guard } patterns[expr_ty]: @@ -853,3 +855,9 @@ invalid_except_block: RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "exception group must be parenthesized") } | 'except' expression ['as' NAME ] &&':' | 'except' &&':' + +invalid_match_stmt: + | "match" subject_expr !':' { CHECK_VERSION(void*, 10, "Pattern matching is", RAISE_SYNTAX_ERROR("expected ':'") ) } + +invalid_case_block: + | "case" patterns guard? !':' { RAISE_SYNTAX_ERROR("expected ':'") } diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 47df0579f1ea6..24233b29171f8 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -825,6 +825,24 @@ Traceback (most recent call last): SyntaxError: expected ':' + >>> match x + ... case list(): + ... pass + Traceback (most recent call last): + SyntaxError: expected ':' + + >>> match x: + ... case list() + ... pass + Traceback (most recent call last): + SyntaxError: expected ':' + + >>> match x: + ... case [y] if y > 0 + ... pass + Traceback (most recent call last): + SyntaxError: expected ':' + Make sure that the old "raise X, Y[, Z]" form is gone: >>> raise X, Y Traceback (most recent call last): @@ -1159,6 +1177,24 @@ def test_error_parenthesis(self): for paren in ")]}": self._check_error(paren + "1 + 2", f"unmatched '\\{paren}'") + def test_match_call_does_not_raise_syntax_error(self): + code = """ +def match(x): + return 1+1 + +match(34) +""" + compile(code, "", "exec") + + def test_case_call_does_not_raise_syntax_error(self): + code = """ +def case(x): + return 1+1 + +case(34) +""" + compile(code, "", "exec") + def test_main(): support.run_unittest(SyntaxTestCase) diff --git a/Parser/parser.c b/Parser/parser.c index 9432746921a2e..acfaf80094c0f 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -263,188 +263,190 @@ static KeywordToken *reserved_keywords[] = { #define invalid_import_from_targets_type 1194 #define invalid_with_stmt_type 1195 #define invalid_except_block_type 1196 -#define _loop0_1_type 1197 -#define _loop0_2_type 1198 -#define _loop0_4_type 1199 -#define _gather_3_type 1200 -#define _loop0_6_type 1201 -#define _gather_5_type 1202 -#define _loop0_8_type 1203 -#define _gather_7_type 1204 -#define _loop0_10_type 1205 -#define _gather_9_type 1206 -#define _loop1_11_type 1207 -#define _loop0_13_type 1208 -#define _gather_12_type 1209 -#define _tmp_14_type 1210 -#define _tmp_15_type 1211 -#define _tmp_16_type 1212 -#define _tmp_17_type 1213 -#define _tmp_18_type 1214 -#define _tmp_19_type 1215 -#define _tmp_20_type 1216 -#define _tmp_21_type 1217 -#define _loop1_22_type 1218 -#define _tmp_23_type 1219 -#define _tmp_24_type 1220 -#define _loop0_26_type 1221 -#define _gather_25_type 1222 -#define _loop0_28_type 1223 -#define _gather_27_type 1224 -#define _tmp_29_type 1225 -#define _tmp_30_type 1226 -#define _loop0_31_type 1227 -#define _loop1_32_type 1228 -#define _loop0_34_type 1229 -#define _gather_33_type 1230 -#define _tmp_35_type 1231 -#define _loop0_37_type 1232 -#define _gather_36_type 1233 -#define _tmp_38_type 1234 -#define _loop0_40_type 1235 -#define _gather_39_type 1236 -#define _loop0_42_type 1237 -#define _gather_41_type 1238 -#define _loop0_44_type 1239 -#define _gather_43_type 1240 -#define _loop0_46_type 1241 -#define _gather_45_type 1242 -#define _tmp_47_type 1243 -#define _loop1_48_type 1244 -#define _tmp_49_type 1245 -#define _loop1_50_type 1246 -#define _loop0_52_type 1247 -#define _gather_51_type 1248 -#define _tmp_53_type 1249 -#define _tmp_54_type 1250 -#define _tmp_55_type 1251 -#define _loop0_57_type 1252 -#define _gather_56_type 1253 -#define _tmp_58_type 1254 -#define _loop0_60_type 1255 -#define _gather_59_type 1256 -#define _tmp_61_type 1257 -#define _loop0_63_type 1258 -#define _gather_62_type 1259 -#define _loop0_65_type 1260 -#define _gather_64_type 1261 -#define _tmp_66_type 1262 -#define _tmp_67_type 1263 -#define _tmp_68_type 1264 -#define _tmp_69_type 1265 -#define _loop0_70_type 1266 -#define _loop0_71_type 1267 -#define _loop0_72_type 1268 -#define _loop1_73_type 1269 -#define _loop0_74_type 1270 -#define _loop1_75_type 1271 -#define _loop1_76_type 1272 -#define _loop1_77_type 1273 -#define _loop0_78_type 1274 -#define _loop1_79_type 1275 -#define _loop0_80_type 1276 -#define _loop1_81_type 1277 -#define _loop0_82_type 1278 -#define _loop1_83_type 1279 -#define _loop1_84_type 1280 -#define _tmp_85_type 1281 -#define _loop1_86_type 1282 -#define _loop0_88_type 1283 -#define _gather_87_type 1284 -#define _loop1_89_type 1285 -#define _loop0_90_type 1286 -#define _loop0_91_type 1287 -#define _loop0_92_type 1288 -#define _loop1_93_type 1289 -#define _loop0_94_type 1290 -#define _loop1_95_type 1291 -#define _loop1_96_type 1292 -#define _loop1_97_type 1293 -#define _loop0_98_type 1294 -#define _loop1_99_type 1295 -#define _loop0_100_type 1296 -#define _loop1_101_type 1297 -#define _loop0_102_type 1298 -#define _loop1_103_type 1299 -#define _loop1_104_type 1300 -#define _loop1_105_type 1301 -#define _loop1_106_type 1302 -#define _tmp_107_type 1303 -#define _loop0_109_type 1304 -#define _gather_108_type 1305 -#define _tmp_110_type 1306 -#define _tmp_111_type 1307 -#define _tmp_112_type 1308 -#define _tmp_113_type 1309 -#define _loop1_114_type 1310 -#define _tmp_115_type 1311 -#define _tmp_116_type 1312 -#define _loop0_118_type 1313 -#define _gather_117_type 1314 -#define _loop1_119_type 1315 -#define _loop0_120_type 1316 -#define _loop0_121_type 1317 -#define _loop0_123_type 1318 -#define _gather_122_type 1319 -#define _tmp_124_type 1320 -#define _loop0_126_type 1321 -#define _gather_125_type 1322 -#define _loop0_128_type 1323 -#define _gather_127_type 1324 -#define _loop0_130_type 1325 -#define _gather_129_type 1326 -#define _loop0_132_type 1327 -#define _gather_131_type 1328 -#define _loop0_133_type 1329 -#define _loop0_135_type 1330 -#define _gather_134_type 1331 -#define _loop1_136_type 1332 -#define _tmp_137_type 1333 -#define _loop0_139_type 1334 -#define _gather_138_type 1335 -#define _loop0_141_type 1336 -#define _gather_140_type 1337 -#define _tmp_142_type 1338 -#define _loop0_143_type 1339 -#define _loop0_144_type 1340 -#define _loop0_145_type 1341 -#define _tmp_146_type 1342 -#define _tmp_147_type 1343 -#define _tmp_148_type 1344 -#define _loop0_149_type 1345 -#define _loop1_150_type 1346 -#define _loop0_151_type 1347 -#define _loop1_152_type 1348 -#define _tmp_153_type 1349 -#define _tmp_154_type 1350 -#define _tmp_155_type 1351 -#define _loop0_157_type 1352 -#define _gather_156_type 1353 -#define _loop0_159_type 1354 -#define _gather_158_type 1355 -#define _tmp_160_type 1356 -#define _tmp_161_type 1357 -#define _tmp_162_type 1358 -#define _tmp_163_type 1359 -#define _tmp_164_type 1360 -#define _tmp_165_type 1361 -#define _tmp_166_type 1362 -#define _tmp_167_type 1363 -#define _tmp_168_type 1364 -#define _tmp_169_type 1365 -#define _tmp_170_type 1366 -#define _tmp_171_type 1367 -#define _tmp_172_type 1368 -#define _tmp_173_type 1369 -#define _tmp_174_type 1370 -#define _tmp_175_type 1371 -#define _tmp_176_type 1372 -#define _tmp_177_type 1373 -#define _tmp_178_type 1374 -#define _tmp_179_type 1375 -#define _tmp_180_type 1376 -#define _tmp_181_type 1377 -#define _tmp_182_type 1378 +#define invalid_match_stmt_type 1197 +#define invalid_case_block_type 1198 +#define _loop0_1_type 1199 +#define _loop0_2_type 1200 +#define _loop0_4_type 1201 +#define _gather_3_type 1202 +#define _loop0_6_type 1203 +#define _gather_5_type 1204 +#define _loop0_8_type 1205 +#define _gather_7_type 1206 +#define _loop0_10_type 1207 +#define _gather_9_type 1208 +#define _loop1_11_type 1209 +#define _loop0_13_type 1210 +#define _gather_12_type 1211 +#define _tmp_14_type 1212 +#define _tmp_15_type 1213 +#define _tmp_16_type 1214 +#define _tmp_17_type 1215 +#define _tmp_18_type 1216 +#define _tmp_19_type 1217 +#define _tmp_20_type 1218 +#define _tmp_21_type 1219 +#define _loop1_22_type 1220 +#define _tmp_23_type 1221 +#define _tmp_24_type 1222 +#define _loop0_26_type 1223 +#define _gather_25_type 1224 +#define _loop0_28_type 1225 +#define _gather_27_type 1226 +#define _tmp_29_type 1227 +#define _tmp_30_type 1228 +#define _loop0_31_type 1229 +#define _loop1_32_type 1230 +#define _loop0_34_type 1231 +#define _gather_33_type 1232 +#define _tmp_35_type 1233 +#define _loop0_37_type 1234 +#define _gather_36_type 1235 +#define _tmp_38_type 1236 +#define _loop0_40_type 1237 +#define _gather_39_type 1238 +#define _loop0_42_type 1239 +#define _gather_41_type 1240 +#define _loop0_44_type 1241 +#define _gather_43_type 1242 +#define _loop0_46_type 1243 +#define _gather_45_type 1244 +#define _tmp_47_type 1245 +#define _loop1_48_type 1246 +#define _tmp_49_type 1247 +#define _loop1_50_type 1248 +#define _loop0_52_type 1249 +#define _gather_51_type 1250 +#define _tmp_53_type 1251 +#define _tmp_54_type 1252 +#define _tmp_55_type 1253 +#define _loop0_57_type 1254 +#define _gather_56_type 1255 +#define _tmp_58_type 1256 +#define _loop0_60_type 1257 +#define _gather_59_type 1258 +#define _tmp_61_type 1259 +#define _loop0_63_type 1260 +#define _gather_62_type 1261 +#define _loop0_65_type 1262 +#define _gather_64_type 1263 +#define _tmp_66_type 1264 +#define _tmp_67_type 1265 +#define _tmp_68_type 1266 +#define _tmp_69_type 1267 +#define _loop0_70_type 1268 +#define _loop0_71_type 1269 +#define _loop0_72_type 1270 +#define _loop1_73_type 1271 +#define _loop0_74_type 1272 +#define _loop1_75_type 1273 +#define _loop1_76_type 1274 +#define _loop1_77_type 1275 +#define _loop0_78_type 1276 +#define _loop1_79_type 1277 +#define _loop0_80_type 1278 +#define _loop1_81_type 1279 +#define _loop0_82_type 1280 +#define _loop1_83_type 1281 +#define _loop1_84_type 1282 +#define _tmp_85_type 1283 +#define _loop1_86_type 1284 +#define _loop0_88_type 1285 +#define _gather_87_type 1286 +#define _loop1_89_type 1287 +#define _loop0_90_type 1288 +#define _loop0_91_type 1289 +#define _loop0_92_type 1290 +#define _loop1_93_type 1291 +#define _loop0_94_type 1292 +#define _loop1_95_type 1293 +#define _loop1_96_type 1294 +#define _loop1_97_type 1295 +#define _loop0_98_type 1296 +#define _loop1_99_type 1297 +#define _loop0_100_type 1298 +#define _loop1_101_type 1299 +#define _loop0_102_type 1300 +#define _loop1_103_type 1301 +#define _loop1_104_type 1302 +#define _loop1_105_type 1303 +#define _loop1_106_type 1304 +#define _tmp_107_type 1305 +#define _loop0_109_type 1306 +#define _gather_108_type 1307 +#define _tmp_110_type 1308 +#define _tmp_111_type 1309 +#define _tmp_112_type 1310 +#define _tmp_113_type 1311 +#define _loop1_114_type 1312 +#define _tmp_115_type 1313 +#define _tmp_116_type 1314 +#define _loop0_118_type 1315 +#define _gather_117_type 1316 +#define _loop1_119_type 1317 +#define _loop0_120_type 1318 +#define _loop0_121_type 1319 +#define _loop0_123_type 1320 +#define _gather_122_type 1321 +#define _tmp_124_type 1322 +#define _loop0_126_type 1323 +#define _gather_125_type 1324 +#define _loop0_128_type 1325 +#define _gather_127_type 1326 +#define _loop0_130_type 1327 +#define _gather_129_type 1328 +#define _loop0_132_type 1329 +#define _gather_131_type 1330 +#define _loop0_133_type 1331 +#define _loop0_135_type 1332 +#define _gather_134_type 1333 +#define _loop1_136_type 1334 +#define _tmp_137_type 1335 +#define _loop0_139_type 1336 +#define _gather_138_type 1337 +#define _loop0_141_type 1338 +#define _gather_140_type 1339 +#define _tmp_142_type 1340 +#define _loop0_143_type 1341 +#define _loop0_144_type 1342 +#define _loop0_145_type 1343 +#define _tmp_146_type 1344 +#define _tmp_147_type 1345 +#define _tmp_148_type 1346 +#define _loop0_149_type 1347 +#define _loop1_150_type 1348 +#define _loop0_151_type 1349 +#define _loop1_152_type 1350 +#define _tmp_153_type 1351 +#define _tmp_154_type 1352 +#define _tmp_155_type 1353 +#define _loop0_157_type 1354 +#define _gather_156_type 1355 +#define _loop0_159_type 1356 +#define _gather_158_type 1357 +#define _tmp_160_type 1358 +#define _tmp_161_type 1359 +#define _tmp_162_type 1360 +#define _tmp_163_type 1361 +#define _tmp_164_type 1362 +#define _tmp_165_type 1363 +#define _tmp_166_type 1364 +#define _tmp_167_type 1365 +#define _tmp_168_type 1366 +#define _tmp_169_type 1367 +#define _tmp_170_type 1368 +#define _tmp_171_type 1369 +#define _tmp_172_type 1370 +#define _tmp_173_type 1371 +#define _tmp_174_type 1372 +#define _tmp_175_type 1373 +#define _tmp_176_type 1374 +#define _tmp_177_type 1375 +#define _tmp_178_type 1376 +#define _tmp_179_type 1377 +#define _tmp_180_type 1378 +#define _tmp_181_type 1379 +#define _tmp_182_type 1380 static mod_ty file_rule(Parser *p); static mod_ty interactive_rule(Parser *p); @@ -643,6 +645,8 @@ static void *invalid_group_rule(Parser *p); static void *invalid_import_from_targets_rule(Parser *p); static void *invalid_with_stmt_rule(Parser *p); static void *invalid_except_block_rule(Parser *p); +static void *invalid_match_stmt_rule(Parser *p); +static void *invalid_case_block_rule(Parser *p); static asdl_seq *_loop0_1_rule(Parser *p); static asdl_seq *_loop0_2_rule(Parser *p); static asdl_seq *_loop0_4_rule(Parser *p); @@ -4848,7 +4852,9 @@ finally_block_rule(Parser *p) return _res; } -// match_stmt: "match" subject_expr ':' NEWLINE INDENT case_block+ DEDENT +// match_stmt: +// | "match" subject_expr ':' NEWLINE INDENT case_block+ DEDENT +// | invalid_match_stmt static stmt_ty match_stmt_rule(Parser *p) { @@ -4919,6 +4925,25 @@ match_stmt_rule(Parser *p) D(fprintf(stderr, "%*c%s match_stmt[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"match\" subject_expr ':' NEWLINE INDENT case_block+ DEDENT")); } + if (p->call_invalid_rules) { // invalid_match_stmt + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> match_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_match_stmt")); + void *invalid_match_stmt_var; + if ( + (invalid_match_stmt_var = invalid_match_stmt_rule(p)) // invalid_match_stmt + ) + { + D(fprintf(stderr, "%*c+ match_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_match_stmt")); + _res = invalid_match_stmt_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s match_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_match_stmt")); + } _res = NULL; done: D(p->level--); @@ -5009,7 +5034,7 @@ subject_expr_rule(Parser *p) return _res; } -// case_block: "case" patterns guard? ':' block +// case_block: "case" patterns guard? ':' block | invalid_case_block static match_case_ty case_block_rule(Parser *p) { @@ -5056,6 +5081,25 @@ case_block_rule(Parser *p) D(fprintf(stderr, "%*c%s case_block[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"case\" patterns guard? ':' block")); } + if (p->call_invalid_rules) { // invalid_case_block + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> case_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_case_block")); + void *invalid_case_block_var; + if ( + (invalid_case_block_var = invalid_case_block_rule(p)) // invalid_case_block + ) + { + D(fprintf(stderr, "%*c+ case_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_case_block")); + _res = invalid_case_block_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s case_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_case_block")); + } _res = NULL; done: D(p->level--); @@ -18531,6 +18575,102 @@ invalid_except_block_rule(Parser *p) return _res; } +// invalid_match_stmt: "match" subject_expr !':' +static void * +invalid_match_stmt_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // "match" subject_expr !':' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_match_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"match\" subject_expr !':'")); + expr_ty _keyword; + expr_ty subject_expr_var; + if ( + (_keyword = _PyPegen_expect_soft_keyword(p, "match")) // soft_keyword='"match"' + && + (subject_expr_var = subject_expr_rule(p)) // subject_expr + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 11) // token=':' + ) + { + D(fprintf(stderr, "%*c+ invalid_match_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"match\" subject_expr !':'")); + _res = CHECK_VERSION ( void * , 10 , "Pattern matching is" , RAISE_SYNTAX_ERROR ( "expected ':'" ) ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_match_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"match\" subject_expr !':'")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// invalid_case_block: "case" patterns guard? !':' +static void * +invalid_case_block_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // "case" patterns guard? !':' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_case_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"case\" patterns guard? !':'")); + expr_ty _keyword; + void *_opt_var; + UNUSED(_opt_var); // Silence compiler warnings + expr_ty patterns_var; + if ( + (_keyword = _PyPegen_expect_soft_keyword(p, "case")) // soft_keyword='"case"' + && + (patterns_var = patterns_rule(p)) // patterns + && + (_opt_var = guard_rule(p), 1) // guard? + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 11) // token=':' + ) + { + D(fprintf(stderr, "%*c+ invalid_case_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"case\" patterns guard? !':'")); + _res = RAISE_SYNTAX_ERROR ( "expected ':'" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_case_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"case\" patterns guard? !':'")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + // _loop0_1: NEWLINE static asdl_seq * _loop0_1_rule(Parser *p) From webhook-mailer at python.org Wed Mar 17 21:46:30 2021 From: webhook-mailer at python.org (vstinner) Date: Thu, 18 Mar 2021 01:46:30 -0000 Subject: [Python-checkins] bpo-43244: Fix test_peg_generator for PyAST_Validate() (GH-24912) Message-ID: https://github.com/python/cpython/commit/e0bf70d08c4a4a68782702e747e6bf7670667591 commit: e0bf70d08c4a4a68782702e747e6bf7670667591 branch: master author: Victor Stinner committer: vstinner date: 2021-03-18T02:46:06+01:00 summary: bpo-43244: Fix test_peg_generator for PyAST_Validate() (GH-24912) test_peg_generator now defines _Py_TEST_PEGEN macro when building C code to not call PyAST_Validate() in Parser/pegen.c. Moreover, it defines Py_BUILD_CORE_MODULE macro to get access to the internal C API. Remove "global_ast_state" from Python-ast.c when it's built by test_peg_generator: always get the AST state from the current interpreter. files: M Parser/asdl_c.py M Parser/pegen.c M Python/Python-ast.c M Tools/peg_generator/pegen/build.py diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index e96f1f3504567..aefea12c64857 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1373,17 +1373,13 @@ def generate_ast_fini(module_state, f): f.write(textwrap.dedent(""" void _PyAST_Fini(PyInterpreterState *interp) { - #ifdef Py_BUILD_CORE struct ast_state *state = &interp->ast; - #else - struct ast_state *state = &global_ast_state; - #endif """)) for s in module_state: f.write(" Py_CLEAR(state->" + s + ');\n') f.write(textwrap.dedent(""" - #if defined(Py_BUILD_CORE) && !defined(NDEBUG) + #if !defined(NDEBUG) state->initialized = -1; #else state->initialized = 0; @@ -1428,24 +1424,15 @@ def generate_module_def(mod, f, internal_h): generate_ast_state(module_state, internal_h) print(textwrap.dedent(f""" - #ifdef Py_BUILD_CORE - # include "pycore_ast_state.h" // struct ast_state - # include "pycore_interp.h" // _PyInterpreterState.ast - # include "pycore_pystate.h" // _PyInterpreterState_GET() - #else - """).strip(), file=f) - - generate_ast_state(module_state, f) - - print(textwrap.dedent(f""" - #endif // Py_BUILD_CORE + #include "pycore_ast_state.h" // struct ast_state + #include "pycore_interp.h" // _PyInterpreterState.ast + #include "pycore_pystate.h" // _PyInterpreterState_GET() """).rstrip(), file=f) f.write(""" // Forward declaration static int init_types(struct ast_state *state); -#ifdef Py_BUILD_CORE static struct ast_state* get_ast_state(void) { @@ -1456,19 +1443,6 @@ def generate_module_def(mod, f, internal_h): } return state; } -#else -static struct ast_state global_ast_state; - -static struct ast_state* -get_ast_state(void) -{ - struct ast_state *state = &global_ast_state; - if (!init_types(state)) { - return NULL; - } - return state; -} -#endif // Py_BUILD_CORE """) # f-string for {mod.name} diff --git a/Parser/pegen.c b/Parser/pegen.c index 301199368651d..84bdf8dd3f89e 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -1265,7 +1265,8 @@ _PyPegen_run_parser(Parser *p) return RAISE_SYNTAX_ERROR("multiple statements found while compiling a single statement"); } -#if defined(Py_DEBUG) && defined(Py_BUILD_CORE) + // test_peg_generator defines _Py_TEST_PEGEN to not call PyAST_Validate() +#if defined(Py_DEBUG) && !defined(_Py_TEST_PEGEN) if (p->start_rule == Py_single_input || p->start_rule == Py_file_input || p->start_rule == Py_eval_input) diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 59acce7968407..4524877dd4278 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -5,243 +5,14 @@ #include "Python.h" -#ifdef Py_BUILD_CORE -# include "pycore_ast_state.h" // struct ast_state -# include "pycore_interp.h" // _PyInterpreterState.ast -# include "pycore_pystate.h" // _PyInterpreterState_GET() -#else -struct ast_state { - int initialized; - PyObject *AST_type; - PyObject *Add_singleton; - PyObject *Add_type; - PyObject *And_singleton; - PyObject *And_type; - PyObject *AnnAssign_type; - PyObject *Assert_type; - PyObject *Assign_type; - PyObject *AsyncFor_type; - PyObject *AsyncFunctionDef_type; - PyObject *AsyncWith_type; - PyObject *Attribute_type; - PyObject *AugAssign_type; - PyObject *Await_type; - PyObject *BinOp_type; - PyObject *BitAnd_singleton; - PyObject *BitAnd_type; - PyObject *BitOr_singleton; - PyObject *BitOr_type; - PyObject *BitXor_singleton; - PyObject *BitXor_type; - PyObject *BoolOp_type; - PyObject *Break_type; - PyObject *Call_type; - PyObject *ClassDef_type; - PyObject *Compare_type; - PyObject *Constant_type; - PyObject *Continue_type; - PyObject *Del_singleton; - PyObject *Del_type; - PyObject *Delete_type; - PyObject *DictComp_type; - PyObject *Dict_type; - PyObject *Div_singleton; - PyObject *Div_type; - PyObject *Eq_singleton; - PyObject *Eq_type; - PyObject *ExceptHandler_type; - PyObject *Expr_type; - PyObject *Expression_type; - PyObject *FloorDiv_singleton; - PyObject *FloorDiv_type; - PyObject *For_type; - PyObject *FormattedValue_type; - PyObject *FunctionDef_type; - PyObject *FunctionType_type; - PyObject *GeneratorExp_type; - PyObject *Global_type; - PyObject *GtE_singleton; - PyObject *GtE_type; - PyObject *Gt_singleton; - PyObject *Gt_type; - PyObject *IfExp_type; - PyObject *If_type; - PyObject *ImportFrom_type; - PyObject *Import_type; - PyObject *In_singleton; - PyObject *In_type; - PyObject *Interactive_type; - PyObject *Invert_singleton; - PyObject *Invert_type; - PyObject *IsNot_singleton; - PyObject *IsNot_type; - PyObject *Is_singleton; - PyObject *Is_type; - PyObject *JoinedStr_type; - PyObject *LShift_singleton; - PyObject *LShift_type; - PyObject *Lambda_type; - PyObject *ListComp_type; - PyObject *List_type; - PyObject *Load_singleton; - PyObject *Load_type; - PyObject *LtE_singleton; - PyObject *LtE_type; - PyObject *Lt_singleton; - PyObject *Lt_type; - PyObject *MatMult_singleton; - PyObject *MatMult_type; - PyObject *MatchAs_type; - PyObject *MatchOr_type; - PyObject *Match_type; - PyObject *Mod_singleton; - PyObject *Mod_type; - PyObject *Module_type; - PyObject *Mult_singleton; - PyObject *Mult_type; - PyObject *Name_type; - PyObject *NamedExpr_type; - PyObject *Nonlocal_type; - PyObject *NotEq_singleton; - PyObject *NotEq_type; - PyObject *NotIn_singleton; - PyObject *NotIn_type; - PyObject *Not_singleton; - PyObject *Not_type; - PyObject *Or_singleton; - PyObject *Or_type; - PyObject *Pass_type; - PyObject *Pow_singleton; - PyObject *Pow_type; - PyObject *RShift_singleton; - PyObject *RShift_type; - PyObject *Raise_type; - PyObject *Return_type; - PyObject *SetComp_type; - PyObject *Set_type; - PyObject *Slice_type; - PyObject *Starred_type; - PyObject *Store_singleton; - PyObject *Store_type; - PyObject *Sub_singleton; - PyObject *Sub_type; - PyObject *Subscript_type; - PyObject *Try_type; - PyObject *Tuple_type; - PyObject *TypeIgnore_type; - PyObject *UAdd_singleton; - PyObject *UAdd_type; - PyObject *USub_singleton; - PyObject *USub_type; - PyObject *UnaryOp_type; - PyObject *While_type; - PyObject *With_type; - PyObject *YieldFrom_type; - PyObject *Yield_type; - PyObject *__dict__; - PyObject *__doc__; - PyObject *__match_args__; - PyObject *__module__; - PyObject *_attributes; - PyObject *_fields; - PyObject *alias_type; - PyObject *annotation; - PyObject *arg; - PyObject *arg_type; - PyObject *args; - PyObject *argtypes; - PyObject *arguments_type; - PyObject *asname; - PyObject *ast; - PyObject *attr; - PyObject *bases; - PyObject *body; - PyObject *boolop_type; - PyObject *cases; - PyObject *cause; - PyObject *cmpop_type; - PyObject *col_offset; - PyObject *comparators; - PyObject *comprehension_type; - PyObject *context_expr; - PyObject *conversion; - PyObject *ctx; - PyObject *decorator_list; - PyObject *defaults; - PyObject *elt; - PyObject *elts; - PyObject *end_col_offset; - PyObject *end_lineno; - PyObject *exc; - PyObject *excepthandler_type; - PyObject *expr_context_type; - PyObject *expr_type; - PyObject *finalbody; - PyObject *format_spec; - PyObject *func; - PyObject *generators; - PyObject *guard; - PyObject *handlers; - PyObject *id; - PyObject *ifs; - PyObject *is_async; - PyObject *items; - PyObject *iter; - PyObject *key; - PyObject *keys; - PyObject *keyword_type; - PyObject *keywords; - PyObject *kind; - PyObject *kw_defaults; - PyObject *kwarg; - PyObject *kwonlyargs; - PyObject *left; - PyObject *level; - PyObject *lineno; - PyObject *lower; - PyObject *match_case_type; - PyObject *mod_type; - PyObject *module; - PyObject *msg; - PyObject *name; - PyObject *names; - PyObject *op; - PyObject *operand; - PyObject *operator_type; - PyObject *ops; - PyObject *optional_vars; - PyObject *orelse; - PyObject *pattern; - PyObject *patterns; - PyObject *posonlyargs; - PyObject *returns; - PyObject *right; - PyObject *simple; - PyObject *slice; - PyObject *step; - PyObject *stmt_type; - PyObject *subject; - PyObject *tag; - PyObject *target; - PyObject *targets; - PyObject *test; - PyObject *type; - PyObject *type_comment; - PyObject *type_ignore_type; - PyObject *type_ignores; - PyObject *unaryop_type; - PyObject *upper; - PyObject *value; - PyObject *values; - PyObject *vararg; - PyObject *withitem_type; -}; -#endif // Py_BUILD_CORE + +#include "pycore_ast_state.h" // struct ast_state +#include "pycore_interp.h" // _PyInterpreterState.ast +#include "pycore_pystate.h" // _PyInterpreterState_GET() // Forward declaration static int init_types(struct ast_state *state); -#ifdef Py_BUILD_CORE static struct ast_state* get_ast_state(void) { @@ -252,19 +23,6 @@ get_ast_state(void) } return state; } -#else -static struct ast_state global_ast_state; - -static struct ast_state* -get_ast_state(void) -{ - struct ast_state *state = &global_ast_state; - if (!init_types(state)) { - return NULL; - } - return state; -} -#endif // Py_BUILD_CORE // Include Python-ast.h after pycore_interp.h to avoid conflicts // with the Yield macro redefined by @@ -273,11 +31,7 @@ get_ast_state(void) void _PyAST_Fini(PyInterpreterState *interp) { -#ifdef Py_BUILD_CORE struct ast_state *state = &interp->ast; -#else - struct ast_state *state = &global_ast_state; -#endif Py_CLEAR(state->AST_type); Py_CLEAR(state->Add_singleton); @@ -503,7 +257,7 @@ void _PyAST_Fini(PyInterpreterState *interp) Py_CLEAR(state->vararg); Py_CLEAR(state->withitem_type); -#if defined(Py_BUILD_CORE) && !defined(NDEBUG) +#if !defined(NDEBUG) state->initialized = -1; #else state->initialized = 0; diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index 9edde372e8d13..b80fc85423919 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -56,6 +56,9 @@ def compile_c_extension( source_file_path = pathlib.Path(generated_source_path) extension_name = source_file_path.stem extra_compile_args = get_extra_flags("CFLAGS", "PY_CFLAGS_NODIST") + extra_compile_args.append("-DPy_BUILD_CORE_MODULE") + # Define _Py_TEST_PEGEN to not call PyAST_Validate() in Parser/pegen.c + extra_compile_args.append('-D_Py_TEST_PEGEN') extra_link_args = get_extra_flags("LDFLAGS", "PY_LDFLAGS_NODIST") if keep_asserts: extra_compile_args.append("-UNDEBUG") From webhook-mailer at python.org Thu Mar 18 04:24:10 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 08:24:10 -0000 Subject: [Python-checkins] bpo-39342: Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl module (GH-18011) Message-ID: https://github.com/python/cpython/commit/e0b4aa0f5c3c2b2c60f5d8b20cf291442a8df8a5 commit: e0b4aa0f5c3c2b2c60f5d8b20cf291442a8df8a5 branch: master author: Chris Burr committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-18T01:24:01-07:00 summary: bpo-39342: Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl module (GH-18011) Exposes the `X509_V_FLAG_ALLOW_PROXY_CERTS` constant as `ssl.VERIFY_ALLOW_PROXY_CERTS` to allow for proxy certificate validation as described in: https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html files: A Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst M Doc/library/ssl.rst M Lib/test/test_ssl.py M Modules/_ssl.c diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 1cfd165202d0e..1adac843f4eec 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -634,6 +634,13 @@ Constants .. versionadded:: 3.4 +.. data:: VERIFY_ALLOW_PROXY_CERTS + + Possible value for :attr:`SSLContext.verify_flags` to enables proxy + certificate verification. + + .. versionadded:: 3.10 + .. data:: VERIFY_X509_TRUSTED_FIRST Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 67850c34e00c2..1710dda4389a0 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1305,6 +1305,8 @@ def test_verify_flags(self): self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_CHAIN) ctx.verify_flags = ssl.VERIFY_DEFAULT self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT) + ctx.verify_flags = ssl.VERIFY_ALLOW_PROXY_CERTS + self.assertEqual(ctx.verify_flags, ssl.VERIFY_ALLOW_PROXY_CERTS) # supports any value ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT self.assertEqual(ctx.verify_flags, diff --git a/Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst b/Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst new file mode 100644 index 0000000000000..6eb83a95b5e2c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst @@ -0,0 +1,4 @@ +Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as +:data:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate validation +as explained in +https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 96d2796fcfad4..bea144cd9f956 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -6181,6 +6181,8 @@ sslmodule_init_constants(PyObject *m) X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); PyModule_AddIntConstant(m, "VERIFY_X509_STRICT", X509_V_FLAG_X509_STRICT); + PyModule_AddIntConstant(m, "VERIFY_ALLOW_PROXY_CERTS", + X509_V_FLAG_ALLOW_PROXY_CERTS); #ifdef X509_V_FLAG_TRUSTED_FIRST PyModule_AddIntConstant(m, "VERIFY_X509_TRUSTED_FIRST", X509_V_FLAG_TRUSTED_FIRST); From webhook-mailer at python.org Thu Mar 18 04:54:26 2021 From: webhook-mailer at python.org (vstinner) Date: Thu, 18 Mar 2021 08:54:26 -0000 Subject: [Python-checkins] bpo-43244: Fix test_peg_generators on Windows (GH-24913) Message-ID: https://github.com/python/cpython/commit/6af528b4ab342805534c0bfe61d84ed7bb519468 commit: 6af528b4ab342805534c0bfe61d84ed7bb519468 branch: master author: Victor Stinner committer: vstinner date: 2021-03-18T09:54:13+01:00 summary: bpo-43244: Fix test_peg_generators on Windows (GH-24913) Don't redefine Py_DebugFlag, it's already defined in pydebug.h which is included by Python.h files: M Parser/parser.c M Tools/peg_generator/pegen/c_generator.py diff --git a/Parser/parser.c b/Parser/parser.c index acfaf80094c0f..6efaebe179b9c 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -2,10 +2,9 @@ #include "pegen.h" #if defined(Py_DEBUG) && defined(Py_BUILD_CORE) -extern int Py_DebugFlag; -#define D(x) if (Py_DebugFlag) x; +# define D(x) if (Py_DebugFlag) x; #else -#define D(x) +# define D(x) #endif static const int n_keyword_lists = 9; static KeywordToken *reserved_keywords[] = { diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index 929ec4f547e17..24418ea70e448 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -31,10 +31,9 @@ #include "pegen.h" #if defined(Py_DEBUG) && defined(Py_BUILD_CORE) -extern int Py_DebugFlag; -#define D(x) if (Py_DebugFlag) x; +# define D(x) if (Py_DebugFlag) x; #else -#define D(x) +# define D(x) #endif """ From webhook-mailer at python.org Thu Mar 18 09:51:43 2021 From: webhook-mailer at python.org (vstinner) Date: Thu, 18 Mar 2021 13:51:43 -0000 Subject: [Python-checkins] bpo-43541: Fix PyEval_EvalCodeEx() regression (GH-24918) Message-ID: https://github.com/python/cpython/commit/fc980e0be19776ee05dfc5380eb5d6a8092935cb commit: fc980e0be19776ee05dfc5380eb5d6a8092935cb branch: master author: Victor Stinner committer: vstinner date: 2021-03-18T14:51:24+01:00 summary: bpo-43541: Fix PyEval_EvalCodeEx() regression (GH-24918) * Remove an assertion which required CO_NEWLOCALS and CO_OPTIMIZED code flags. It is ok to call this function on a code with these flags set. * Fix reference counting on builtins: remove Py_DECREF(). Fix regression introduced in the commit 46496f9d12582bf11f4911ad0f23315d6f277907. Add also a comment to document that _PyEval_BuiltinsFromGlobals() returns a borrowed reference. files: A Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst M Objects/frameobject.c M Objects/funcobject.c M Python/ceval.c diff --git a/Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst b/Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst new file mode 100644 index 0000000000000..0f5d9384942be --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst @@ -0,0 +1,2 @@ +Fix a ``PyEval_EvalCodeEx()`` regression: fix reference counting on +builtins. Patch by Victor Stinner. diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 056d42a0d9ebb..a1413d79cc248 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -847,7 +847,7 @@ PyFrameObject* PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, PyObject *locals) { - PyObject *builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); + PyObject *builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); // borrowed ref if (builtins == NULL) { return NULL; } diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 36df88a28100d..45135a8c98a70 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -50,7 +50,7 @@ PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname } Py_XINCREF(module); - builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); + builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); // borrowed ref if (builtins == NULL) { goto error; } diff --git a/Python/ceval.c b/Python/ceval.c index 7418b15176d2a..3a37017c000d4 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1127,7 +1127,7 @@ PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals) if (locals == NULL) { locals = globals; } - PyObject *builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); + PyObject *builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); // borrowed ref if (builtins == NULL) { return NULL; } @@ -5140,12 +5140,11 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, if (defaults == NULL) { return NULL; } - PyObject *builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); + PyObject *builtins = _PyEval_BuiltinsFromGlobals(tstate, globals); // borrowed ref if (builtins == NULL) { Py_DECREF(defaults); return NULL; } - assert ((((PyCodeObject *)_co)->co_flags & (CO_NEWLOCALS | CO_OPTIMIZED)) == 0); if (locals == NULL) { locals = globals; } @@ -5208,7 +5207,6 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, } fail: Py_DECREF(defaults); - Py_DECREF(builtins); return res; } From webhook-mailer at python.org Thu Mar 18 09:57:57 2021 From: webhook-mailer at python.org (vstinner) Date: Thu, 18 Mar 2021 13:57:57 -0000 Subject: [Python-checkins] bpo-43244: Remove the PyAST_Validate() function (GH-24911) Message-ID: https://github.com/python/cpython/commit/eec8e61992fb654d4cf58de4d727c18622b8303e commit: eec8e61992fb654d4cf58de4d727c18622b8303e branch: master author: Victor Stinner committer: vstinner date: 2021-03-18T14:57:49+01:00 summary: bpo-43244: Remove the PyAST_Validate() function (GH-24911) Remove the PyAST_Validate() function. It is no longer possible to build a AST object (mod_ty type) with the public C API. The function was already excluded from the limited C API (PEP 384). Rename PyAST_Validate() function to _PyAST_Validate(), move it to the internal C API, and don't export it anymore (replace PyAPI_FUNC with extern). The function was added in bpo-12575 by the commit 832bfe2ebd5ecfa92031cd40c8b41835ba90487f. files: A Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst M Doc/whatsnew/3.10.rst M Include/ast.h M Include/internal/pycore_ast.h M Parser/pegen.c M Python/ast.c M Python/bltinmodule.c diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 00b0f985e3386..25f71c4253d84 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1353,3 +1353,8 @@ Removed Python already implicitly installs signal handlers: see :c:member:`PyConfig.install_signal_handlers`. (Contributed by Victor Stinner in :issue:`41713`.) + +* Remove the ``PyAST_Validate()`` function. It is no longer possible to build a + AST object (``mod_ty`` type) with the public C API. The function was already + excluded from the limited C API (:pep:`384`). + (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Include/ast.h b/Include/ast.h index 2f19b1a870dac..82bfa4800cdd5 100644 --- a/Include/ast.h +++ b/Include/ast.h @@ -7,8 +7,6 @@ extern "C" { #include "Python-ast.h" /* mod_ty */ -PyAPI_FUNC(int) PyAST_Validate(mod_ty); - #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast.h index 38c9212b07ca0..6cc0b9b3b000f 100644 --- a/Include/internal/pycore_ast.h +++ b/Include/internal/pycore_ast.h @@ -10,6 +10,8 @@ extern "C" { #include "Python-ast.h" // expr_ty +extern int _PyAST_Validate(mod_ty); + /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ extern PyObject* _PyAST_ExprAsUnicode(expr_ty); diff --git a/Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst b/Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst new file mode 100644 index 0000000000000..6632ace472289 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst @@ -0,0 +1,3 @@ +Remove the ``PyAST_Validate()`` function. It is no longer possible to build a +AST object (``mod_ty`` type) with the public C API. The function was already +excluded from the limited C API (:pep:`384`). Patch by Victor Stinner. diff --git a/Parser/pegen.c b/Parser/pegen.c index 84bdf8dd3f89e..24aa3af336c34 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -1,4 +1,5 @@ #include +#include "pycore_ast.h" // _PyAST_Validate() #include #include "tokenizer.h" @@ -1271,7 +1272,7 @@ _PyPegen_run_parser(Parser *p) p->start_rule == Py_file_input || p->start_rule == Py_eval_input) { - if (!PyAST_Validate(res)) { + if (!_PyAST_Validate(res)) { return NULL; } } diff --git a/Python/ast.c b/Python/ast.c index c58b4a69b1e32..8ac2e60c92fde 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -551,7 +551,7 @@ validate_exprs(asdl_expr_seq *exprs, expr_context_ty ctx, int null_ok) } int -PyAST_Validate(mod_ty mod) +_PyAST_Validate(mod_ty mod) { int res = 0; diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 52591c4a46f3d..4683103e09437 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -4,6 +4,7 @@ #include #include "ast.h" #undef Yield /* undefine macro conflicting with */ +#include "pycore_ast.h" // _PyAST_Validate() #include "pycore_object.h" // _Py_AddToAllObjects() #include "pycore_pyerrors.h" // _PyErr_NoMemory() #include "pycore_pystate.h" // _PyThreadState_GET() @@ -835,7 +836,7 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, PyArena_Free(arena); goto error; } - if (!PyAST_Validate(mod)) { + if (!_PyAST_Validate(mod)) { PyArena_Free(arena); goto error; } From webhook-mailer at python.org Thu Mar 18 13:36:23 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 17:36:23 -0000 Subject: [Python-checkins] bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897) Message-ID: https://github.com/python/cpython/commit/08ff4369afca84587b1c82034af4e9f64caddbf2 commit: 08ff4369afca84587b1c82034af4e9f64caddbf2 branch: master author: Kodi Arfer committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-18T10:36:06-07:00 summary: bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897) Automerge-Triggered-By: GH:pablogsal files: A Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst M Lib/ast.py M Lib/test/test_unparse.py diff --git a/Lib/ast.py b/Lib/ast.py index 03ae2ec44e099..e46ab43d5cfd3 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -1199,8 +1199,13 @@ def _write_docstring(self, node): def _write_constant(self, value): if isinstance(value, (float, complex)): - # Substitute overflowing decimal literal for AST infinities. - self.write(repr(value).replace("inf", _INFSTR)) + # Substitute overflowing decimal literal for AST infinities, + # and inf - inf for NaNs. + self.write( + repr(value) + .replace("inf", _INFSTR) + .replace("nan", f"({_INFSTR}-{_INFSTR})") + ) elif self._avoid_backslashes and isinstance(value, str): self._write_str_avoiding_backslashes(value) else: @@ -1273,10 +1278,13 @@ def visit_IfExp(self, node): self.traverse(node.orelse) def visit_Set(self, node): - if not node.elts: - raise ValueError("Set node should have at least one item") - with self.delimit("{", "}"): - self.interleave(lambda: self.write(", "), self.traverse, node.elts) + if node.elts: + with self.delimit("{", "}"): + self.interleave(lambda: self.write(", "), self.traverse, node.elts) + else: + # `{}` would be interpreted as a dictionary literal, and + # `set` might be shadowed. Thus: + self.write('{*()}') def visit_Dict(self, node): def write_key_value_pair(k, v): diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index c7c8613ea2793..ce03272ad30b2 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -199,6 +199,12 @@ def test_huge_float(self): self.check_ast_roundtrip("1e1000j") self.check_ast_roundtrip("-1e1000j") + def test_nan(self): + self.assertASTEqual( + ast.parse(ast.unparse(ast.Constant(value=float('nan')))), + ast.parse('1e1000 - 1e1000') + ) + def test_min_int(self): self.check_ast_roundtrip(str(-(2 ** 31))) self.check_ast_roundtrip(str(-(2 ** 63))) @@ -252,6 +258,12 @@ def test_annotations(self): def test_set_literal(self): self.check_ast_roundtrip("{'a', 'b', 'c'}") + def test_empty_set(self): + self.assertASTEqual( + ast.parse(ast.unparse(ast.Set(elts=[]))), + ast.parse('{*()}') + ) + def test_set_comprehension(self): self.check_ast_roundtrip("{x for x in range(5)}") @@ -326,9 +338,6 @@ def test_invalid_fstring_conversion(self): def test_invalid_fstring_backslash(self): self.check_invalid(ast.FormattedValue(value=ast.Constant(value="\\\\"))) - def test_invalid_set(self): - self.check_invalid(ast.Set(elts=[])) - def test_invalid_yield_from(self): self.check_invalid(ast.YieldFrom(value=None)) diff --git a/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst b/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst new file mode 100644 index 0000000000000..e6895674437a5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst @@ -0,0 +1 @@ +``ast.unparse`` can now render NaNs and empty sets. From webhook-mailer at python.org Thu Mar 18 18:06:58 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 22:06:58 -0000 Subject: [Python-checkins] bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) Message-ID: https://github.com/python/cpython/commit/f6c6b5821bff815bdc810de53992fd1fbdb2edd4 commit: f6c6b5821bff815bdc810de53992fd1fbdb2edd4 branch: master author: Christian Heimes committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-18T15:06:50-07:00 summary: bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) Ubuntu 20.04 comes with a patched OpenSSL 1.1.1. Default security level 2 blocks TLS 1.0 and 1.1 connections. Regular OpenSSL 1.1.1 builds allow TLS 1.0 and 1.1 on security level 2. See: See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1899878 See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1917625 Signed-off-by: Christian Heimes files: A Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst M .github/workflows/build.yml M Lib/test/test_ssl.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef54865ed964c..d6be2b6864266 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,7 +127,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 1710dda4389a0..ade7ef529e812 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -151,6 +151,27 @@ def data_file(*name): OP_CIPHER_SERVER_PREFERENCE = getattr(ssl, "OP_CIPHER_SERVER_PREFERENCE", 0) OP_ENABLE_MIDDLEBOX_COMPAT = getattr(ssl, "OP_ENABLE_MIDDLEBOX_COMPAT", 0) +# Ubuntu has patched OpenSSL and changed behavior of security level 2 +# see https://bugs.python.org/issue41561#msg389003 +def is_ubuntu(): + try: + # Assume that any references of "ubuntu" implies Ubuntu-like distro + # The workaround is not required for 18.04, but doesn't hurt either. + with open("/etc/os-release", encoding="utf-8") as f: + return "ubuntu" in f.read() + except FileNotFoundError: + return False + +if is_ubuntu(): + def seclevel_workaround(*ctxs): + """"Lower security level to '1' and allow all ciphers for TLS 1.0/1""" + for ctx in ctxs: + if ctx.minimum_version <= ssl.TLSVersion.TLSv1_1: + ctx.set_ciphers("@SECLEVEL=1:ALL") +else: + def seclevel_workaround(*ctxs): + pass + def has_tls_protocol(protocol): """Check if a TLS protocol is available and enabled @@ -2802,6 +2823,8 @@ def try_protocol_combo(server_protocol, client_protocol, expect_success, if client_context.protocol == ssl.PROTOCOL_TLS: client_context.set_ciphers("ALL") + seclevel_workaround(server_context, client_context) + for ctx in (client_context, server_context): ctx.verify_mode = certsreqs ctx.load_cert_chain(SIGNED_CERTFILE) @@ -2843,6 +2866,7 @@ def test_echo(self): with self.subTest(protocol=ssl._PROTOCOL_NAMES[protocol]): context = ssl.SSLContext(protocol) context.load_cert_chain(CERTFILE) + seclevel_workaround(context) server_params_test(context, context, chatty=True, connectionchatty=True) @@ -3847,6 +3871,7 @@ def test_min_max_version_tlsv1_1(self): client_context.maximum_version = ssl.TLSVersion.TLSv1_2 server_context.minimum_version = ssl.TLSVersion.TLSv1 server_context.maximum_version = ssl.TLSVersion.TLSv1_1 + seclevel_workaround(client_context, server_context) with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), @@ -3864,6 +3889,8 @@ def test_min_max_version_mismatch(self): server_context.minimum_version = ssl.TLSVersion.TLSv1_2 client_context.maximum_version = ssl.TLSVersion.TLSv1 client_context.minimum_version = ssl.TLSVersion.TLSv1 + seclevel_workaround(client_context, server_context) + with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: @@ -3878,6 +3905,8 @@ def test_min_max_version_sslv3(self): server_context.minimum_version = ssl.TLSVersion.SSLv3 client_context.minimum_version = ssl.TLSVersion.SSLv3 client_context.maximum_version = ssl.TLSVersion.SSLv3 + seclevel_workaround(client_context, server_context) + with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: diff --git a/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst new file mode 100644 index 0000000000000..214350729bff6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst @@ -0,0 +1 @@ +Add workaround for Ubuntu's custom OpenSSL security level policy. From webhook-mailer at python.org Thu Mar 18 18:31:44 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 22:31:44 -0000 Subject: [Python-checkins] bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) Message-ID: https://github.com/python/cpython/commit/3365e684a83a6bc9e2e2198dca54b42711bd3c90 commit: 3365e684a83a6bc9e2e2198dca54b42711bd3c90 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-18T15:31:34-07:00 summary: bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) Ubuntu 20.04 comes with a patched OpenSSL 1.1.1. Default security level 2 blocks TLS 1.0 and 1.1 connections. Regular OpenSSL 1.1.1 builds allow TLS 1.0 and 1.1 on security level 2. See: See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1899878 See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1917625 Signed-off-by: Christian Heimes (cherry picked from commit f6c6b5821bff815bdc810de53992fd1fbdb2edd4) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst M .github/workflows/build.yml M Lib/test/test_ssl.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01370954feaae..9fa6033a9dc35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,7 +121,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 27cb884e072e0..e5b4b11d37fe6 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -147,6 +147,27 @@ def data_file(*name): OP_CIPHER_SERVER_PREFERENCE = getattr(ssl, "OP_CIPHER_SERVER_PREFERENCE", 0) OP_ENABLE_MIDDLEBOX_COMPAT = getattr(ssl, "OP_ENABLE_MIDDLEBOX_COMPAT", 0) +# Ubuntu has patched OpenSSL and changed behavior of security level 2 +# see https://bugs.python.org/issue41561#msg389003 +def is_ubuntu(): + try: + # Assume that any references of "ubuntu" implies Ubuntu-like distro + # The workaround is not required for 18.04, but doesn't hurt either. + with open("/etc/os-release", encoding="utf-8") as f: + return "ubuntu" in f.read() + except FileNotFoundError: + return False + +if is_ubuntu(): + def seclevel_workaround(*ctxs): + """"Lower security level to '1' and allow all ciphers for TLS 1.0/1""" + for ctx in ctxs: + if ctx.minimum_version <= ssl.TLSVersion.TLSv1_1: + ctx.set_ciphers("@SECLEVEL=1:ALL") +else: + def seclevel_workaround(*ctxs): + pass + def has_tls_protocol(protocol): """Check if a TLS protocol is available and enabled @@ -2777,6 +2798,8 @@ def try_protocol_combo(server_protocol, client_protocol, expect_success, if client_context.protocol == ssl.PROTOCOL_TLS: client_context.set_ciphers("ALL") + seclevel_workaround(server_context, client_context) + for ctx in (client_context, server_context): ctx.verify_mode = certsreqs ctx.load_cert_chain(SIGNED_CERTFILE) @@ -2818,6 +2841,7 @@ def test_echo(self): with self.subTest(protocol=ssl._PROTOCOL_NAMES[protocol]): context = ssl.SSLContext(protocol) context.load_cert_chain(CERTFILE) + seclevel_workaround(context) server_params_test(context, context, chatty=True, connectionchatty=True) @@ -3822,6 +3846,7 @@ def test_min_max_version_tlsv1_1(self): client_context.maximum_version = ssl.TLSVersion.TLSv1_2 server_context.minimum_version = ssl.TLSVersion.TLSv1 server_context.maximum_version = ssl.TLSVersion.TLSv1_1 + seclevel_workaround(client_context, server_context) with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), @@ -3839,6 +3864,8 @@ def test_min_max_version_mismatch(self): server_context.minimum_version = ssl.TLSVersion.TLSv1_2 client_context.maximum_version = ssl.TLSVersion.TLSv1 client_context.minimum_version = ssl.TLSVersion.TLSv1 + seclevel_workaround(client_context, server_context) + with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: @@ -3853,6 +3880,8 @@ def test_min_max_version_sslv3(self): server_context.minimum_version = ssl.TLSVersion.SSLv3 client_context.minimum_version = ssl.TLSVersion.SSLv3 client_context.maximum_version = ssl.TLSVersion.SSLv3 + seclevel_workaround(client_context, server_context) + with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: diff --git a/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst new file mode 100644 index 0000000000000..214350729bff6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst @@ -0,0 +1 @@ +Add workaround for Ubuntu's custom OpenSSL security level policy. From webhook-mailer at python.org Thu Mar 18 18:41:21 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 22:41:21 -0000 Subject: [Python-checkins] bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) Message-ID: https://github.com/python/cpython/commit/50511677f59464e612cfef0cd0e139fe07e87737 commit: 50511677f59464e612cfef0cd0e139fe07e87737 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-18T15:41:11-07:00 summary: bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) Ubuntu 20.04 comes with a patched OpenSSL 1.1.1. Default security level 2 blocks TLS 1.0 and 1.1 connections. Regular OpenSSL 1.1.1 builds allow TLS 1.0 and 1.1 on security level 2. See: See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1899878 See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1917625 Signed-off-by: Christian Heimes (cherry picked from commit f6c6b5821bff815bdc810de53992fd1fbdb2edd4) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst M .github/workflows/build.yml M Lib/test/test_ssl.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5822428e34a86..20d3040770f6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: build_ubuntu: name: 'Ubuntu' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 850d174272ec9..9a886c73dee87 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -143,6 +143,27 @@ def data_file(*name): OP_CIPHER_SERVER_PREFERENCE = getattr(ssl, "OP_CIPHER_SERVER_PREFERENCE", 0) OP_ENABLE_MIDDLEBOX_COMPAT = getattr(ssl, "OP_ENABLE_MIDDLEBOX_COMPAT", 0) +# Ubuntu has patched OpenSSL and changed behavior of security level 2 +# see https://bugs.python.org/issue41561#msg389003 +def is_ubuntu(): + try: + # Assume that any references of "ubuntu" implies Ubuntu-like distro + # The workaround is not required for 18.04, but doesn't hurt either. + with open("/etc/os-release", encoding="utf-8") as f: + return "ubuntu" in f.read() + except FileNotFoundError: + return False + +if is_ubuntu(): + def seclevel_workaround(*ctxs): + """"Lower security level to '1' and allow all ciphers for TLS 1.0/1""" + for ctx in ctxs: + if ctx.minimum_version <= ssl.TLSVersion.TLSv1_1: + ctx.set_ciphers("@SECLEVEL=1:ALL") +else: + def seclevel_workaround(*ctxs): + pass + def has_tls_protocol(protocol): """Check if a TLS protocol is available and enabled @@ -2772,6 +2793,8 @@ def try_protocol_combo(server_protocol, client_protocol, expect_success, if client_context.protocol == ssl.PROTOCOL_TLS: client_context.set_ciphers("ALL") + seclevel_workaround(server_context, client_context) + for ctx in (client_context, server_context): ctx.verify_mode = certsreqs ctx.load_cert_chain(SIGNED_CERTFILE) @@ -2813,6 +2836,7 @@ def test_echo(self): with self.subTest(protocol=ssl._PROTOCOL_NAMES[protocol]): context = ssl.SSLContext(protocol) context.load_cert_chain(CERTFILE) + seclevel_workaround(context) server_params_test(context, context, chatty=True, connectionchatty=True) @@ -3817,6 +3841,7 @@ def test_min_max_version_tlsv1_1(self): client_context.maximum_version = ssl.TLSVersion.TLSv1_2 server_context.minimum_version = ssl.TLSVersion.TLSv1 server_context.maximum_version = ssl.TLSVersion.TLSv1_1 + seclevel_workaround(client_context, server_context) with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), @@ -3834,6 +3859,8 @@ def test_min_max_version_mismatch(self): server_context.minimum_version = ssl.TLSVersion.TLSv1_2 client_context.maximum_version = ssl.TLSVersion.TLSv1 client_context.minimum_version = ssl.TLSVersion.TLSv1 + seclevel_workaround(client_context, server_context) + with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: @@ -3848,6 +3875,8 @@ def test_min_max_version_sslv3(self): server_context.minimum_version = ssl.TLSVersion.SSLv3 client_context.minimum_version = ssl.TLSVersion.SSLv3 client_context.maximum_version = ssl.TLSVersion.SSLv3 + seclevel_workaround(client_context, server_context) + with ThreadedEchoServer(context=server_context) as server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: diff --git a/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst new file mode 100644 index 0000000000000..214350729bff6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst @@ -0,0 +1 @@ +Add workaround for Ubuntu's custom OpenSSL security level policy. From webhook-mailer at python.org Thu Mar 18 18:51:57 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 18 Mar 2021 22:51:57 -0000 Subject: [Python-checkins] bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897) Message-ID: https://github.com/python/cpython/commit/e8e341993e3f80a3c456fb8e0219530c93c13151 commit: e8e341993e3f80a3c456fb8e0219530c93c13151 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-18T15:51:47-07:00 summary: bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897) Automerge-Triggered-By: GH:pablogsal (cherry picked from commit 08ff4369afca84587b1c82034af4e9f64caddbf2) Co-authored-by: Kodi Arfer files: A Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst M Lib/ast.py M Lib/test/test_unparse.py diff --git a/Lib/ast.py b/Lib/ast.py index ecd4895f7570c..5d32621841e4a 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -1196,8 +1196,13 @@ def _write_docstring(self, node): def _write_constant(self, value): if isinstance(value, (float, complex)): - # Substitute overflowing decimal literal for AST infinities. - self.write(repr(value).replace("inf", _INFSTR)) + # Substitute overflowing decimal literal for AST infinities, + # and inf - inf for NaNs. + self.write( + repr(value) + .replace("inf", _INFSTR) + .replace("nan", f"({_INFSTR}-{_INFSTR})") + ) elif self._avoid_backslashes and isinstance(value, str): self._write_str_avoiding_backslashes(value) else: @@ -1270,10 +1275,13 @@ def visit_IfExp(self, node): self.traverse(node.orelse) def visit_Set(self, node): - if not node.elts: - raise ValueError("Set node should have at least one item") - with self.delimit("{", "}"): - self.interleave(lambda: self.write(", "), self.traverse, node.elts) + if node.elts: + with self.delimit("{", "}"): + self.interleave(lambda: self.write(", "), self.traverse, node.elts) + else: + # `{}` would be interpreted as a dictionary literal, and + # `set` might be shadowed. Thus: + self.write('{*()}') def visit_Dict(self, node): def write_key_value_pair(k, v): diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index c7c8613ea2793..ce03272ad30b2 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -199,6 +199,12 @@ def test_huge_float(self): self.check_ast_roundtrip("1e1000j") self.check_ast_roundtrip("-1e1000j") + def test_nan(self): + self.assertASTEqual( + ast.parse(ast.unparse(ast.Constant(value=float('nan')))), + ast.parse('1e1000 - 1e1000') + ) + def test_min_int(self): self.check_ast_roundtrip(str(-(2 ** 31))) self.check_ast_roundtrip(str(-(2 ** 63))) @@ -252,6 +258,12 @@ def test_annotations(self): def test_set_literal(self): self.check_ast_roundtrip("{'a', 'b', 'c'}") + def test_empty_set(self): + self.assertASTEqual( + ast.parse(ast.unparse(ast.Set(elts=[]))), + ast.parse('{*()}') + ) + def test_set_comprehension(self): self.check_ast_roundtrip("{x for x in range(5)}") @@ -326,9 +338,6 @@ def test_invalid_fstring_conversion(self): def test_invalid_fstring_backslash(self): self.check_invalid(ast.FormattedValue(value=ast.Constant(value="\\\\"))) - def test_invalid_set(self): - self.check_invalid(ast.Set(elts=[])) - def test_invalid_yield_from(self): self.check_invalid(ast.YieldFrom(value=None)) diff --git a/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst b/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst new file mode 100644 index 0000000000000..e6895674437a5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst @@ -0,0 +1 @@ +``ast.unparse`` can now render NaNs and empty sets. From webhook-mailer at python.org Fri Mar 19 03:38:23 2021 From: webhook-mailer at python.org (methane) Date: Fri, 19 Mar 2021 07:38:23 -0000 Subject: [Python-checkins] Fix a typo in c-analyzer (GH-24468) Message-ID: https://github.com/python/cpython/commit/ff8c77fe96c1e0e1822f3b821e9c6dcfbec22a56 commit: ff8c77fe96c1e0e1822f3b821e9c6dcfbec22a56 branch: master author: Ikko Ashimine committer: methane date: 2021-03-19T16:38:12+09:00 summary: Fix a typo in c-analyzer (GH-24468) files: M Tools/c-analyzer/c_parser/parser/__init__.py diff --git a/Tools/c-analyzer/c_parser/parser/__init__.py b/Tools/c-analyzer/c_parser/parser/__init__.py index 4b201c6354023..39056099f5e91 100644 --- a/Tools/c-analyzer/c_parser/parser/__init__.py +++ b/Tools/c-analyzer/c_parser/parser/__init__.py @@ -158,7 +158,7 @@ def _parse(srclines, anon_name): source = _iter_source(srclines) #source = _iter_source(srclines, showtext=True) for result in parse_globals(source, anon_name): - # XXX Handle blocks here insted of in parse_globals(). + # XXX Handle blocks here instead of in parse_globals(). yield result From webhook-mailer at python.org Fri Mar 19 05:29:38 2021 From: webhook-mailer at python.org (tiran) Date: Fri, 19 Mar 2021 09:29:38 -0000 Subject: [Python-checkins] bpo-43466: Add --with-openssl-rpath configure option (GH-24820) Message-ID: https://github.com/python/cpython/commit/32eba61ea431c76f15a910c0a4eded7f5f8b9b34 commit: 32eba61ea431c76f15a910c0a4eded7f5f8b9b34 branch: master author: Christian Heimes committer: tiran date: 2021-03-19T10:29:25+01:00 summary: bpo-43466: Add --with-openssl-rpath configure option (GH-24820) files: A Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst M Doc/using/unix.rst M Doc/whatsnew/3.10.rst M Makefile.pre.in M Tools/ssl/multissltests.py M aclocal.m4 M configure M configure.ac M setup.py diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst index c0a5643fc2c24..d5f073cd9f3b4 100644 --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -134,3 +134,53 @@ some Unices may not have the :program:`env` command, so you may need to hardcode ``/usr/bin/python3`` as the interpreter path. To use shell commands in your Python scripts, look at the :mod:`subprocess` module. + + +Custom OpenSSL +============== + +1. To use your vendor's OpenSSL configuration and system trust store, locate + the directory with ``openssl.cnf`` file or symlink in ``/etc``. On most + distribution the file is either in ``/etc/ssl`` or ``/etc/pki/tls``. The + directory should also contain a ``cert.pem`` file and/or a ``certs`` + directory. + + .. code-block:: shell-session + + $ find /etc/ -name openssl.cnf -printf "%h\n" + /etc/ssl + +2. Download, build, and install OpenSSL. Make sure you use ``install_sw`` and + not ``install``. The ``install_sw`` target does not override + ``openssl.cnf``. + + .. code-block:: shell-session + + $ curl -O https://www.openssl.org/source/openssl-VERSION.tar.gz + $ tar xzf openssl-VERSION + $ pushd openssl-VERSION + $ ./config \ + --prefix=/usr/local/custom-openssl \ + --openssldir=/etc/ssl + $ make -j1 depend + $ make -j8 + $ make install_sw + $ popd + +3. Build Python with custom OpenSSL + + .. code-block:: shell-session + + $ pushd python-3.x.x + $ ./configure -C \ + --with-openssl=/usr/local/custom-openssl \ + --with-openssl-rpath=auto \ + --prefix=/usr/local/python-3.x.x + $ make -j8 + $ make altinstall + +.. note:: + + Patch releases of OpenSSL have a backwards compatible ABI. You don't need + to recompile Python to update OpenSSL. It's sufficient to replace the + custom OpenSSL installation with a newer version. diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 25f71c4253d84..362ce8f12b633 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1181,6 +1181,12 @@ Build Changes and ``--with-tcltk-libs`` configuration options. (Contributed by Manolis Stamatogiannakis in :issue:`42603`.) +* Add ``--with-openssl-rpath`` option to ``configure`` script. The option + simplifies building Python with a custom OpenSSL installation, e.g. + ``./configure --with-openssl=/path/to/openssl --with-openssl-rpath=auto``. + (Contributed by Christian Heimes in :issue:`43466`.) + + C API Changes ============= diff --git a/Makefile.pre.in b/Makefile.pre.in index 5ad304e30d022..6ca47d3dc2b61 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -202,6 +202,7 @@ ENSUREPIP= @ENSUREPIP@ OPENSSL_INCLUDES=@OPENSSL_INCLUDES@ OPENSSL_LIBS=@OPENSSL_LIBS@ OPENSSL_LDFLAGS=@OPENSSL_LDFLAGS@ +OPENSSL_RPATH=@OPENSSL_RPATH@ # Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var TZPATH=@TZPATH@ diff --git a/Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst b/Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst new file mode 100644 index 0000000000000..801404b1c80a7 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst @@ -0,0 +1 @@ +The ``configure`` script now supports ``--with-openssl-rpath`` option. diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index 3818165a836fb..7afa1eea2efb2 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -48,8 +48,8 @@ ] OPENSSL_RECENT_VERSIONS = [ - "1.1.1g", - # "3.0.0-alpha2" + "1.1.1j", + # "3.0.0-alpha12" ] LIBRESSL_OLD_VERSIONS = [ @@ -57,7 +57,7 @@ ] LIBRESSL_RECENT_VERSIONS = [ - "3.1.0", + "3.2.4", ] # store files in ../multissl @@ -169,7 +169,9 @@ class AbstractBuilder(object): url_templates = None src_template = None build_template = None + depend_target = None install_target = 'install' + jobs = os.cpu_count() module_files = ("Modules/_ssl.c", "Modules/_hashopenssl.c") @@ -321,8 +323,11 @@ def _build_src(self): if self.system: env['SYSTEM'] = self.system self._subprocess_call(cmd, cwd=cwd, env=env) - # Old OpenSSL versions do not support parallel builds. - self._subprocess_call(["make", "-j1"], cwd=cwd, env=env) + if self.depend_target: + self._subprocess_call( + ["make", "-j1", self.depend_target], cwd=cwd, env=env + ) + self._subprocess_call(["make", f"-j{self.jobs}"], cwd=cwd, env=env) def _make_install(self): self._subprocess_call( @@ -409,6 +414,7 @@ class BuildOpenSSL(AbstractBuilder): build_template = "openssl-{}" # only install software, skip docs install_target = 'install_sw' + depend_target = 'depend' def _post_install(self): if self.version.startswith("3.0"): @@ -434,11 +440,11 @@ def _post_install_300(self): self.openssl_cli, "fipsinstall", "-out", fipsinstall_cnf, "-module", fips_mod, - "-provider_name", "fips", - "-mac_name", "HMAC", - "-macopt", "digest:SHA256", - "-macopt", "hexkey:00", - "-section_name", "fips_sect" + # "-provider_name", "fips", + # "-mac_name", "HMAC", + # "-macopt", "digest:SHA256", + # "-macopt", "hexkey:00", + # "-section_name", "fips_sect" ] ) with open(openssl_fips_cnf, "w") as f: diff --git a/aclocal.m4 b/aclocal.m4 index c003f3c705538..99913e7f3b85c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -67,7 +67,7 @@ AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 12 (pkg-config-0.29.2) +# serial 11 (pkg-config-0.29.1) dnl Copyright ? 2004 Scott James Remnant . dnl Copyright ? 2012-2015 Dan Nicholson @@ -109,7 +109,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.2]) +[m4_define([PKG_MACROS_VERSION], [0.29.1]) 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 @@ -210,7 +210,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $2]) +AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -220,11 +220,11 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -241,7 +241,7 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full @@ -342,5 +342,73 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + m4_include([m4/ax_c_float_words_bigendian.m4]) m4_include([m4/ax_check_openssl.m4]) diff --git a/configure b/configure index 5ada8fc43e75d..2ddca07986062 100755 --- a/configure +++ b/configure @@ -1,12 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for python 3.10. +# Generated by GNU Autoconf 2.69 for python 3.10. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, -# Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -17,16 +16,14 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -36,46 +33,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -84,6 +81,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -92,12 +96,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -109,10 +109,30 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -134,22 +154,20 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop +else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -169,53 +187,42 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : -else \$as_nop +else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : + if (eval "$as_required") 2>/dev/null; then : as_have_required=yes -else $as_nop +else as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -else $as_nop +else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base + as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi @@ -223,21 +230,14 @@ fi esac as_found=false done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi +fi; } +IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x -then : + if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -255,19 +255,18 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - printf "%s\n" "$0: Please tell bug-autoconf at gnu.org and + $as_echo "$0: Please tell bug-autoconf at gnu.org and $0: https://bugs.python.org/ about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script @@ -295,7 +294,6 @@ as_fn_unset () } as_unset=as_fn_unset - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -313,14 +311,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -335,7 +325,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -344,7 +334,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -383,13 +373,12 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -401,27 +390,18 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -433,9 +413,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -462,7 +442,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -506,7 +486,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -520,10 +500,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -537,13 +513,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -619,40 +588,45 @@ PACKAGE_URL='' ac_unique_file="Include/object.h" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include +#include +#ifdef HAVE_SYS_TYPES_H +# include #endif -#ifdef HAVE_STDLIB_H +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS # include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif #endif #ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif #ifdef HAVE_UNISTD_H # include #endif" -ac_header_c_list= ac_subst_vars='LTLIBOBJS TEST_MODULES LIBRARY_DEPS STATIC_LIBPYTHON +OPENSSL_RPATH OPENSSL_LDFLAGS OPENSSL_LIBS OPENSSL_INCLUDES @@ -701,7 +675,6 @@ LDSHARED SHLIB_SUFFIX LIBTOOL_CRUFT OTHER_LIBTOOL_OPT -EGREP UNIVERSAL_ARCH_FLAGS LDFLAGS_NODIST CFLAGS_NODIST @@ -745,6 +718,7 @@ DLLLIBRARY LDLIBRARY LIBRARY BUILDEXEEXT +EGREP NO_AS_NEEDED MULTIARCH_CPPFLAGS PLATFORM_TRIPLET @@ -818,7 +792,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -883,6 +856,7 @@ with_readline with_computed_gotos with_ensurepip with_openssl +with_openssl_rpath with_ssl_default_suites with_builtin_hashlib_hashes with_experimental_isolated_subinterpreters @@ -941,7 +915,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -971,6 +944,8 @@ do *) ac_optarg=yes ;; esac + # Accept the important Cygnus configure options, so we can diagnose typos. + case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -1011,9 +986,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1037,9 +1012,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1192,15 +1167,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1250,9 +1216,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1266,9 +1232,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1312,9 +1278,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1330,7 +1296,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1338,7 +1304,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1394,7 +1360,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1491,7 +1457,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1630,6 +1595,11 @@ Optional Packages: "install" or "upgrade" using bundled pip (default is upgrade) --with-openssl=DIR override root of the OpenSSL directory to DIR + --with-openssl-rpath=[DIR|auto|no] + Set runtime library directory (rpath) for OpenSSL + libraries, no (default): don't set rpath, auto: + auto-detect rpath from --with-openssl and + pkg-config, DIR: set an explicit rpath --with-ssl-default-suites=[python|openssl|STRING] override default cipher suites string, python: use Python's preferred selection (default), openssl: @@ -1683,9 +1653,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1713,8 +1683,7 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. + # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1722,7 +1691,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1732,9 +1701,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF python configure 3.10 -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.69 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1751,14 +1720,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam + rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1766,15 +1735,14 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext -then : + } && test -s conftest.$ac_objext; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1796,7 +1764,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1804,15 +1772,14 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } -then : + }; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1828,14 +1795,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1843,18 +1810,17 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - } -then : + }; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1869,43 +1835,101 @@ fi } # ac_fn_c_try_link -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------------- ## +## Report this to https://bugs.python.org/ ## +## --------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_header_compile +} # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- -# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that -# executables *can* be run. +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1915,26 +1939,25 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -1945,6 +1968,37 @@ fi } # ac_fn_c_try_run +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -1952,18 +2006,17 @@ fi ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { if (sizeof ($2)) return 0; @@ -1971,13 +2024,12 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { if (sizeof (($2))) return 0; @@ -1985,19 +2037,18 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -else $as_nop +else eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -2016,7 +2067,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -2026,15 +2077,14 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2044,10 +2094,9 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break -else $as_nop +else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -2055,14 +2104,14 @@ else $as_nop fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -2072,15 +2121,14 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -2090,10 +2138,9 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break -else $as_nop +else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -2101,14 +2148,14 @@ else $as_nop fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done -else $as_nop +else ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -2116,7 +2163,7 @@ while test "x$ac_lo" != "x$ac_hi"; do /* end confdefs.h. */ $4 int -main (void) +main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2126,13 +2173,12 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid -else $as_nop +else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -2142,12 +2188,12 @@ esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval (void) { return $2; } -static unsigned long int ulongval (void) { return $2; } +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } #include #include int -main (void) +main () { FILE *f = fopen ("conftest.val", "w"); @@ -2175,10 +2221,9 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -2210,9 +2254,16 @@ else $as_nop #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2230,51 +2281,47 @@ choke me #endif int -main (void) +main () { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" -else $as_nop +else eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR -# ------------------------------------------------------------------ +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. -ac_fn_check_decl () +# accordingly. +ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -printf %s "checking whether $as_decl_name is declared... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - eval ac_save_FLAGS=\$$6 - as_fn_append $6 " $5" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { #ifndef $as_decl_name #ifdef __cplusplus @@ -2288,22 +2335,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" -else $as_nop +else eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval $6=\$ac_save_FLAGS - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_check_decl +} # ac_fn_c_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- @@ -2312,17 +2356,16 @@ printf "%s\n" "$ac_res" >&6; } ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -printf %s "checking for $2.$3... " >&6; } -if eval test \${$4+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main (void) +main () { static $2 ac_aggr; if (ac_aggr.$3) @@ -2331,15 +2374,14 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main (void) +main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) @@ -2348,50 +2390,29 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" -else $as_nop +else eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.10, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was - $ $0$ac_configure_args_raw + $ $0 $@ _ACEOF exec 5>>config.log @@ -2424,12 +2445,8 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -2464,7 +2481,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2499,13 +2516,11 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - printf "%s\n" "## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2516,8 +2531,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2541,7 +2556,7 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ) echo - printf "%s\n" "## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2549,14 +2564,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - printf "%s\n" "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2564,15 +2579,15 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - printf "%s\n" "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - printf "%s\n" "## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2580,8 +2595,8 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} echo fi test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2595,48 +2610,63 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -printf "%s\n" "/* confdefs.h */" > confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi - -for ac_site_file in $ac_site_files +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2646,504 +2676,85 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not \xHH hex character constants. - These do not provoke an error unfortunately, instead are silently treated - as an "x". The following induces an error, until -std is added to get - proper ANSI mode. Curiously \x00 != x always comes out true, for an - array size at least. It is necessary to write \x00 == 0 to get something - that is true only with -std. */ -int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) '\''x'\'' -int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" -as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" -as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" - -# Auxiliary files required by this configure script. -ac_aux_files="install-sh config.guess config.sub" - -# Locations in which to look for auxiliary files. -ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." - -# Search for a directory containing all of the required auxiliary files, -# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. -# If we don't find one directory that contains all the files we need, -# we report the set of missing files from the *first* directory in -# $ac_aux_dir_candidates and give up. -ac_missing_aux_files="" -ac_first_candidate=: -printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in $ac_aux_dir_candidates -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 - ac_aux_dir_found=yes - ac_install_sh= - for ac_aux in $ac_aux_files - do - # As a special case, if "install-sh" is required, that requirement - # can be satisfied by any of "install-sh", "install.sh", or "shtool", - # and $ac_install_sh is set appropriately for whichever one is found. - if test x"$ac_aux" = x"install-sh" - then - if test -f "${as_dir}install-sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 - ac_install_sh="${as_dir}install-sh -c" - elif test -f "${as_dir}install.sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 - ac_install_sh="${as_dir}install.sh -c" - elif test -f "${as_dir}shtool"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 - ac_install_sh="${as_dir}shtool install -c" - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} install-sh" - else - break - fi - fi - else - if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" - else - break - fi - fi - fi - done - if test "$ac_aux_dir_found" = yes; then - ac_aux_dir="$as_dir" - break - fi - ac_first_candidate=false - - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 -fi - - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -if test -f "${ac_aux_dir}config.guess"; then - ac_config_guess="$SHELL ${ac_aux_dir}config.guess" -fi -if test -f "${ac_aux_dir}config.sub"; then - ac_config_sub="$SHELL ${ac_aux_dir}config.sub" -fi -if test -f "$ac_aux_dir/configure"; then - ac_configure="$SHELL ${ac_aux_dir}configure" -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' - and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu @@ -3173,12 +2784,11 @@ if test -e $srcdir/.git then # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_HAS_GIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAS_GIT+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$HAS_GIT"; then ac_cv_prog_HAS_GIT="$HAS_GIT" # Let the user override the test. else @@ -3186,15 +2796,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAS_GIT="found" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3206,11 +2812,11 @@ fi fi HAS_GIT=$ac_cv_prog_HAS_GIT if test -n "$HAS_GIT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAS_GIT" >&5 -printf "%s\n" "$HAS_GIT" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_GIT" >&5 +$as_echo "$HAS_GIT" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3232,30 +2838,55 @@ fi ac_config_headers="$ac_config_headers pyconfig.h" +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - # Make sure we can run config.sub. -$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -printf %s "checking build system type... " >&6; } -if test ${ac_cv_build+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$ac_cv_build" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -3274,22 +2905,21 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -printf %s "checking host system type... " >&6; } -if test ${ac_cv_host+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$ac_cv_host" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -3318,12 +2948,11 @@ for ac_prog in python$PACKAGE_VERSION python3 python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PYTHON_FOR_REGEN+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PYTHON_FOR_REGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$PYTHON_FOR_REGEN"; then ac_cv_prog_PYTHON_FOR_REGEN="$PYTHON_FOR_REGEN" # Let the user override the test. else @@ -3331,15 +2960,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON_FOR_REGEN="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3350,11 +2975,11 @@ fi fi PYTHON_FOR_REGEN=$ac_cv_prog_PYTHON_FOR_REGEN if test -n "$PYTHON_FOR_REGEN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_FOR_REGEN" >&5 -printf "%s\n" "$PYTHON_FOR_REGEN" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_FOR_REGEN" >&5 +$as_echo "$PYTHON_FOR_REGEN" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3365,8 +2990,8 @@ test -n "$PYTHON_FOR_REGEN" || PYTHON_FOR_REGEN="python3" if test "$cross_compiling" = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 -printf %s "checking for python interpreter for cross build... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 +$as_echo_n "checking for python interpreter for cross build... " >&6; } if test -z "$PYTHON_FOR_BUILD"; then for interp in python$PACKAGE_VERSION python3 python; do which $interp >/dev/null 2>&1 || continue @@ -3378,8 +3003,8 @@ printf %s "checking for python interpreter for cross build... " >&6; } if test x$interp = x; then as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5 fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 -printf "%s\n" "$interp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 +$as_echo "$interp" >&6; } PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp fi elif test "$cross_compiling" = maybe; then @@ -3413,28 +3038,28 @@ SOVERSION=1.0 # The later defininition of _XOPEN_SOURCE disables certain features # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone). -printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h +$as_echo "#define _GNU_SOURCE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable # them. -printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h +$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable # them. -printf "%s\n" "#define __BSD_VISIBLE 1" >>confdefs.h +$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable # them. -printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h +$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h @@ -3444,11 +3069,10 @@ define_xopen_source=yes CONFIG_ARGS="$ac_configure_args" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5 -printf %s "checking for --enable-universalsdk... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5 +$as_echo_n "checking for --enable-universalsdk... " >&6; } # Check whether --enable-universalsdk was given. -if test ${enable_universalsdk+y} -then : +if test "${enable_universalsdk+set}" = set; then : enableval=$enable_universalsdk; case $enableval in yes) @@ -3480,7 +3104,7 @@ then : esac -else $as_nop +else UNIVERSALSDK= enable_universalsdk= @@ -3489,11 +3113,11 @@ fi if test -n "${UNIVERSALSDK}" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSALSDK}" >&5 -printf "%s\n" "${UNIVERSALSDK}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSALSDK}" >&5 +$as_echo "${UNIVERSALSDK}" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3515,12 +3139,11 @@ then fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-universal-archs" >&5 -printf %s "checking for --with-universal-archs... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-universal-archs" >&5 +$as_echo_n "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. -if test ${with_universal_archs+y} -then : +if test "${with_universal_archs+set}" = set; then : withval=$with_universal_archs; UNIVERSAL_ARCHS="$withval" @@ -3528,23 +3151,22 @@ fi if test -n "${UNIVERSALSDK}" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5 -printf "%s\n" "${UNIVERSAL_ARCHS}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5 +$as_echo "${UNIVERSAL_ARCHS}" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # Check whether --with-framework-name was given. -if test ${with_framework_name+y} -then : +if test "${with_framework_name+set}" = set; then : withval=$with_framework_name; PYTHONFRAMEWORK=${withval} PYTHONFRAMEWORKDIR=${withval}.framework PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr 'A-Z' 'a-z'` -else $as_nop +else PYTHONFRAMEWORK=Python PYTHONFRAMEWORKDIR=Python.framework @@ -3553,8 +3175,7 @@ else $as_nop fi # Check whether --enable-framework was given. -if test ${enable_framework+y} -then : +if test "${enable_framework+set}" = set; then : enableval=$enable_framework; case $enableval in yes) @@ -3643,7 +3264,7 @@ then : esac -else $as_nop +else PYTHONFRAMEWORK= PYTHONFRAMEWORKDIR=no-framework @@ -3678,7 +3299,9 @@ fi -printf "%s\n" "#define _PYTHONFRAMEWORK \"${PYTHONFRAMEWORK}\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define _PYTHONFRAMEWORK "${PYTHONFRAMEWORK}" +_ACEOF ##AC_ARG_WITH(dyld, @@ -3687,8 +3310,8 @@ printf "%s\n" "#define _PYTHONFRAMEWORK \"${PYTHONFRAMEWORK}\"" >>confdefs.h ## # Set name for machine-dependent library files -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MACHDEP" >&5 -printf %s "checking MACHDEP... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MACHDEP" >&5 +$as_echo_n "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then # avoid using uname for cross builds @@ -3738,8 +3361,8 @@ then '') MACHDEP="unknown";; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5 -printf "%s\n" "\"$MACHDEP\"" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5 +$as_echo "\"$MACHDEP\"" >&6; } if test "$cross_compiling" = yes; then @@ -3788,7 +3411,7 @@ case $ac_sys_system/$ac_sys_release in # also defined. This can be overridden by defining _BSD_SOURCE # As this has a different meaning on Linux, only define it on OpenBSD -printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h +$as_echo "#define _BSD_SOURCE 1" >>confdefs.h ;; OpenBSD/*) @@ -3796,7 +3419,7 @@ printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h # also defined. This can be overridden by defining _BSD_SOURCE # As this has a different meaning on Linux, only define it on OpenBSD -printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h +$as_echo "#define _BSD_SOURCE 1" >>confdefs.h ;; # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of @@ -3854,7 +3477,7 @@ if test $define_xopen_source = yes then # X/Open 7, incorporating POSIX.1-2008 -printf "%s\n" "#define _XOPEN_SOURCE 700" >>confdefs.h +$as_echo "#define _XOPEN_SOURCE 700" >>confdefs.h # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires @@ -3862,11 +3485,11 @@ printf "%s\n" "#define _XOPEN_SOURCE 700" >>confdefs.h # several APIs are not declared. Since this is also needed in some # cases for HP-UX, we define it globally. -printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h +$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h -printf "%s\n" "#define _POSIX_C_SOURCE 200809L" >>confdefs.h +$as_echo "#define _POSIX_C_SOURCE 200809L" >>confdefs.h fi @@ -3881,7 +3504,7 @@ esac if test $define_stdc_a1 = yes then -printf "%s\n" "#define _INCLUDE__STDC_A1_SOURCE 1" >>confdefs.h +$as_echo "#define _INCLUDE__STDC_A1_SOURCE 1" >>confdefs.h fi @@ -3945,8 +3568,8 @@ then then if test -n "`"$found_gcc" --version | grep llvm-gcc`" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Detected llvm-gcc, falling back to clang" >&5 -printf "%s\n" "$as_me: Detected llvm-gcc, falling back to clang" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Detected llvm-gcc, falling back to clang" >&5 +$as_echo "$as_me: Detected llvm-gcc, falling back to clang" >&6;} CC="$found_clang" CXX="$found_clang++" fi @@ -3954,8 +3577,8 @@ printf "%s\n" "$as_me: Detected llvm-gcc, falling back to clang" >&6;} elif test -z "$found_gcc" -a -n "$found_clang" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No GCC found, use CLANG" >&5 -printf "%s\n" "$as_me: No GCC found, use CLANG" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: No GCC found, use CLANG" >&5 +$as_echo "$as_me: No GCC found, use CLANG" >&6;} CC="$found_clang" CXX="$found_clang++" @@ -3964,8 +3587,8 @@ printf "%s\n" "$as_me: No GCC found, use CLANG" >&6;} found_clang=`/usr/bin/xcrun -find clang 2>/dev/null` if test -n "${found_clang}" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using clang from Xcode.app" >&5 -printf "%s\n" "$as_me: Using clang from Xcode.app" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Using clang from Xcode.app" >&5 +$as_echo "$as_me: Using clang from Xcode.app" >&6;} CC="${found_clang}" CXX="`/usr/bin/xcrun -find clang++`" @@ -3974,15 +3597,6 @@ printf "%s\n" "$as_me: Using clang from Xcode.app" >&6;} fi fi fi - - - - - - - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3991,12 +3605,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4004,15 +3617,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4023,11 +3632,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4036,12 +3645,11 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4049,15 +3657,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4068,11 +3672,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -4080,8 +3684,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4094,12 +3698,11 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4107,15 +3710,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4126,11 +3725,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4139,12 +3738,11 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4153,19 +3751,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4181,18 +3775,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4203,12 +3797,11 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4216,15 +3809,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4235,11 +3824,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4252,12 +3841,11 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4265,15 +3853,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4284,11 +3868,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4300,138 +3884,34 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi -else - CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do +for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4441,7 +3921,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -4449,7 +3929,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -4461,9 +3941,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -4484,12 +3964,11 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -4506,7 +3985,7 @@ do # certainly right. break;; *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -4522,46 +4001,44 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop +else ac_file='' fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -4575,15 +4052,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -4592,7 +4069,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -4604,8 +4081,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -4613,10 +4090,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4624,40 +4101,39 @@ printf "%s\n" "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -4671,12 +4147,11 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -4685,32 +4160,31 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { #ifndef __GNUC__ choke me @@ -4720,33 +4194,29 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes -else $as_nop +else ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+y} +ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4755,60 +4225,57 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else $as_nop +else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -else $as_nop +else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4823,144 +4290,94 @@ else CFLAGS= fi fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext conftest.beam +rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC -fi -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + fi ac_ext=c @@ -4974,36 +4391,40 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#ifdef __STDC__ +# include +#else +# include +#endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : -else $as_nop +else # Broken: fails on valid input. continue fi @@ -5015,11 +4436,10 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue -else $as_nop +else # Passes both tests. ac_preproc_ok=: break @@ -5029,8 +4449,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : +if $ac_preproc_ok; then : break fi @@ -5042,24 +4461,29 @@ fi else ac_cv_prog_CPP=$CPP fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#ifdef __STDC__ +# include +#else +# include +#endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : -else $as_nop +else # Broken: fails on valid input. continue fi @@ -5071,11 +4495,10 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue -else $as_nop +else # Passes both tests. ac_preproc_ok=: break @@ -5085,12 +4508,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : +if $ac_preproc_ok; then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -5101,12 +4523,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -5114,15 +4535,10 @@ else $as_nop for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -5131,13 +4547,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - printf %s 0123456789 >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5165,17 +4581,16 @@ else fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -5189,15 +4604,10 @@ else $as_nop for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in sed gsed - do + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -5206,13 +4616,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - printf %s 0123456789 >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "conftest.nl" + $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5240,20 +4650,19 @@ else fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=" >&5 -printf %s "checking for --with-cxx-main=... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=" >&5 +$as_echo_n "checking for --with-cxx-main=... " >&6; } # Check whether --with-cxx_main was given. -if test ${with_cxx_main+y} -then : +if test "${with_cxx_main+set}" = set; then : withval=$with_cxx_main; case $withval in @@ -5268,15 +4677,15 @@ then : CXX=$withval fi;; esac -else $as_nop +else with_cxx_main=no MAINCC='$(CC)' fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5 -printf "%s\n" "$with_cxx_main" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5 +$as_echo "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -5285,12 +4694,11 @@ then gcc) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args. set dummy ${ac_tool_prefix}g++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -5300,15 +4708,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$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 @@ -5320,11 +4724,11 @@ esac fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5333,12 +4737,11 @@ if test -z "$ac_cv_path_CXX"; then ac_pt_CXX=$CXX # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -5348,15 +4751,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$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 @@ -5368,11 +4767,11 @@ esac fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -printf "%s\n" "$ac_pt_CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +$as_echo "$ac_pt_CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -5380,8 +4779,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -5393,12 +4792,11 @@ fi cc) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}c++", so it can be a program name with args. set dummy ${ac_tool_prefix}c++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -5408,15 +4806,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$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 @@ -5428,11 +4822,11 @@ esac fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5441,12 +4835,11 @@ if test -z "$ac_cv_path_CXX"; then ac_pt_CXX=$CXX # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -5456,15 +4849,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$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 @@ -5476,11 +4865,11 @@ esac fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -printf "%s\n" "$ac_pt_CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +$as_echo "$ac_pt_CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -5488,8 +4877,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -5501,12 +4890,11 @@ fi clang|*/clang) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang++", so it can be a program name with args. set dummy ${ac_tool_prefix}clang++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -5516,15 +4904,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$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 @@ -5536,11 +4920,11 @@ esac fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5549,12 +4933,11 @@ if test -z "$ac_cv_path_CXX"; then ac_pt_CXX=$CXX # Extract the first word of "clang++", so it can be a program name with args. set dummy clang++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -5564,15 +4947,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$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 @@ -5584,11 +4963,11 @@ esac fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -printf "%s\n" "$ac_pt_CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +$as_echo "$ac_pt_CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -5596,8 +4975,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -5609,12 +4988,11 @@ fi icc|*/icc) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}icpc", so it can be a program name with args. set dummy ${ac_tool_prefix}icpc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -5624,15 +5002,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$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 @@ -5644,11 +5018,11 @@ esac fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5657,12 +5031,11 @@ if test -z "$ac_cv_path_CXX"; then ac_pt_CXX=$CXX # Extract the first word of "icpc", so it can be a program name with args. set dummy icpc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -5672,15 +5045,11 @@ else $as_nop for as_dir in notfound do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_CXX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$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 @@ -5692,11 +5061,11 @@ esac fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -printf "%s\n" "$ac_pt_CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +$as_echo "$ac_pt_CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -5704,8 +5073,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -5727,12 +5096,11 @@ then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -5740,15 +5108,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5759,11 +5123,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5776,12 +5140,11 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -5789,15 +5152,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5808,11 +5167,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5824,8 +5183,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -5839,12 +5198,12 @@ fi fi if test "$preset_cxx" != "$CXX" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: + { $as_echo "$as_me:${as_lineno-$LINENO}: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -printf "%s\n" "$as_me: +$as_echo "$as_me: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -5855,8 +5214,8 @@ fi MULTIARCH=$($CC --print-multiarch 2>/dev/null) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5 -printf %s "checking for the platform triplet based on compiler characteristics... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5 +$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; } cat >> conftest.c <conftest.out 2>/dev/null; then PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 -printf "%s\n" "$PLATFORM_TRIPLET" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 +$as_echo "$PLATFORM_TRIPLET" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } fi rm -f conftest.c conftest.out @@ -6026,8 +5385,8 @@ if test x$MULTIARCH != x; then fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5 -printf %s "checking for -Wl,--no-as-needed... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5 +$as_echo_n "checking for -Wl,--no-as-needed... " >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--no-as-needed" @@ -6035,203 +5394,290 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : NO_AS_NEEDED="-Wl,--no-as-needed" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else NO_AS_NEEDED="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" # checks for UNIX variants that set C preprocessor variables -ac_header= ac_cache= -for ac_item in $ac_header_c_list + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test ${ac_cv_safe_to_define___extensions__+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include +#include +#include -# define __EXTENSIONS__ 1 - $ac_includes_default int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 -printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } -if test ${ac_cv_should_define__xopen_source+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no - if test $ac_cv_header_wchar_h = yes -then : +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include - #include - mbstate_t x; -int -main (void) -{ +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi -else $as_nop +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif - #define _XOPEN_SOURCE 500 - #include - mbstate_t x; +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int -main (void) +main () { - - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_should_define__xopen_source=yes +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 -printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h - printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h +fi - printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF - printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h +fi - printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h +done - printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h - printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h - printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi - printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h - printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + if test "$MINIX" = yes; then - printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h - printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h - printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h +$as_echo "#define _MINIX 1" >>confdefs.h - printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + fi - if test $ac_cv_header_minix_config_h = yes -then : - MINIX=yes - printf "%s\n" "#define _MINIX 1" >>confdefs.h - printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ -else $as_nop - MINIX= + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no fi - if test $ac_cv_safe_to_define___extensions__ = yes -then : - printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $ac_cv_should_define__xopen_source = yes -then : - printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the Android API level" >&5 -printf %s "checking for the Android API level... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android API level" >&5 +$as_echo_n "checking for the Android API level... " >&6; } cat >> conftest.c <conftest.out 2>/dev/null; then ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out` _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5 -printf "%s\n" "$ANDROID_API_LEVEL" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5 +$as_echo "$ANDROID_API_LEVEL" >&6; } if test -z "$ANDROID_API_LEVEL"; then echo 'Fatal: you must define __ANDROID_API__' exit 1 fi -printf "%s\n" "#define ANDROID_API_LEVEL $ANDROID_API_LEVEL" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define ANDROID_API_LEVEL $ANDROID_API_LEVEL +_ACEOF - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the Android arm ABI" >&5 -printf %s "checking for the Android arm ABI... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_arm_arch" >&5 -printf "%s\n" "$_arm_arch" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android arm ABI" >&5 +$as_echo_n "checking for the Android arm ABI... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_arm_arch" >&5 +$as_echo "$_arm_arch" >&6; } if test "$_arm_arch" = 7; then BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16" LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8" fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 -printf "%s\n" "not Android" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 +$as_echo "not Android" >&6; } fi rm -f conftest.c conftest.out @@ -6277,12 +5725,11 @@ atheos*|Linux*/1*) esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-suffix" >&5 -printf %s "checking for --with-suffix... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-suffix" >&5 +$as_echo_n "checking for --with-suffix... " >&6; } # Check whether --with-suffix was given. -if test ${with_suffix+y} -then : +if test "${with_suffix+set}" = set; then : withval=$with_suffix; case $withval in no) EXEEXT=;; @@ -6291,26 +5738,26 @@ then : esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EXEEXT" >&5 -printf "%s\n" "$EXEEXT" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXEEXT" >&5 +$as_echo "$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for case-insensitive build directory" >&5 -printf %s "checking for case-insensitive build directory... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for case-insensitive build directory" >&5 +$as_echo_n "checking for case-insensitive build directory... " >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } BUILDEXEEXT=.exe else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -6323,14 +5770,14 @@ hp*|HP*) esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LIBRARY" >&5 -printf %s "checking LIBRARY... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBRARY" >&5 +$as_echo_n "checking LIBRARY... " >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5 -printf "%s\n" "$LIBRARY" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5 +$as_echo "$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -6369,8 +5816,8 @@ LDVERSION="$VERSION" # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable: # python might then depend on the C++ runtime -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LINKCC" >&5 -printf %s "checking LINKCC... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKCC" >&5 +$as_echo_n "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -6381,8 +5828,8 @@ then LINKCC=qcc;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LINKCC" >&5 -printf "%s\n" "$LINKCC" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKCC" >&5 +$as_echo "$LINKCC" >&6; } # EXPORTSYMS holds the list of exported symbols for AIX. # EXPORTSFROM holds the module name exporting symbols on AIX. @@ -6390,16 +5837,16 @@ EXPORTSYMS= EXPORTSFROM= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking EXPORTSYMS" >&5 -printf %s "checking EXPORTSYMS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking EXPORTSYMS" >&5 +$as_echo_n "checking EXPORTSYMS... " >&6; } case $ac_sys_system in AIX*) EXPORTSYMS="Modules/python.exp" EXPORTSFROM=. # the main executable ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EXPORTSYMS" >&5 -printf "%s\n" "$EXPORTSYMS" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPORTSYMS" >&5 +$as_echo "$EXPORTSYMS" >&6; } # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by @@ -6407,8 +5854,8 @@ printf "%s\n" "$EXPORTSYMS" >&6; } # to linker command lines, and failing to detect GNU ld simply results # in the same bahaviour as before. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -printf %s "checking for GNU ld... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } ac_prog=ld if test "$GCC" = yes; then ac_prog=`$CC -print-prog-name=ld` @@ -6419,14 +5866,13 @@ case `"$ac_prog" -V 2>&1 < /dev/null` in *) GNULD=no;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GNULD" >&5 -printf "%s\n" "$GNULD" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNULD" >&5 +$as_echo "$GNULD" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-shared" >&5 -printf %s "checking for --enable-shared... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-shared" >&5 +$as_echo_n "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. -if test ${enable_shared+y} -then : +if test "${enable_shared+set}" = set; then : enableval=$enable_shared; fi @@ -6440,14 +5886,13 @@ then enable_shared="no";; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -printf "%s\n" "$enable_shared" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-profiling" >&5 -printf %s "checking for --enable-profiling... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-profiling" >&5 +$as_echo_n "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. -if test ${enable_profiling+y} -then : +if test "${enable_profiling+set}" = set; then : enableval=$enable_profiling; fi @@ -6458,28 +5903,27 @@ if test "x$enable_profiling" = xyes; then /* end confdefs.h. */ int main() { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : -else $as_nop +else enable_profiling=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CC="$ac_save_cc" else enable_profiling=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_profiling" >&5 -printf "%s\n" "$enable_profiling" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_profiling" >&5 +$as_echo "$enable_profiling" >&6; } if test "x$enable_profiling" = xyes; then BASECFLAGS="-pg $BASECFLAGS" LDFLAGS="-pg $LDFLAGS" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LDLIBRARY" >&5 -printf %s "checking LDLIBRARY... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDLIBRARY" >&5 +$as_echo_n "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -6500,7 +5944,7 @@ fi if test $enable_shared = "yes"; then PY_ENABLE_SHARED=1 -printf "%s\n" "#define Py_ENABLE_SHARED 1" >>confdefs.h +$as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h case $ac_sys_system in CYGWIN*) @@ -6564,8 +6008,8 @@ if test "$cross_compiling" = yes; then RUNSHARED= fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5 -printf "%s\n" "$LDLIBRARY" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5 +$as_echo "$LDLIBRARY" >&6; } if test -n "$ac_tool_prefix"; then @@ -6573,12 +6017,11 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6586,15 +6029,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6605,11 +6044,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6622,12 +6061,11 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -6635,15 +6073,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6654,11 +6088,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6670,8 +6104,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6691,12 +6125,11 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_READELF+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$READELF"; then ac_cv_prog_READELF="$READELF" # Let the user override the test. else @@ -6704,15 +6137,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_READELF="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6723,11 +6152,11 @@ fi fi READELF=$ac_cv_prog_READELF if test -n "$READELF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -printf "%s\n" "$READELF" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +$as_echo "$READELF" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6740,12 +6169,11 @@ if test -z "$READELF"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_READELF+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_READELF"; then ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. else @@ -6753,15 +6181,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_READELF="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6772,11 +6196,11 @@ fi fi ac_ct_READELF=$ac_cv_prog_ac_ct_READELF if test -n "$ac_ct_READELF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 -printf "%s\n" "$ac_ct_READELF" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +$as_echo "$ac_ct_READELF" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6788,8 +6212,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac READELF=$ac_ct_READELF @@ -6814,8 +6238,7 @@ hp*|HP*) INSTALL="${srcdir}/install-sh -c" fi esac - - # Find a good install program. We prefer a C program (faster), +# Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -6829,25 +6252,20 @@ esac # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -printf %s "checking for a BSD-compatible install... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test ${ac_cv_path_install+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - # Account for fact that we put trailing slashes in our PATH walk. -case $as_dir in #(( - ./ | /[cC]/* | \ + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -6857,13 +6275,13 @@ case $as_dir in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -6871,12 +6289,12 @@ case $as_dir in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -6892,7 +6310,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test ${ac_cv_path_install+y}; then + if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -6902,8 +6320,8 @@ fi INSTALL=$ac_install_sh fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -printf "%s\n" "$INSTALL" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -6913,31 +6331,25 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 -printf %s "checking for a race-free mkdir -p... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test ${ac_cv_path_mkdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue - case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done @@ -6948,7 +6360,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test ${ac_cv_path_mkdir+y}; then + if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -6958,8 +6370,8 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -printf "%s\n" "$MKDIR_P" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } # Not every filesystem supports hard links @@ -6976,63 +6388,60 @@ fi ABIFLAGS="" # Check for --with-pydebug -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-pydebug" >&5 -printf %s "checking for --with-pydebug... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pydebug" >&5 +$as_echo_n "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. -if test ${with_pydebug+y} -then : +if test "${with_pydebug+set}" = set; then : withval=$with_pydebug; if test "$withval" != no then -printf "%s\n" "#define Py_DEBUG 1" >>confdefs.h +$as_echo "#define Py_DEBUG 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; Py_DEBUG='true' ABIFLAGS="${ABIFLAGS}d" -else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; Py_DEBUG='false' +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; Py_DEBUG='false' fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # Check for --with-trace-refs # --with-trace-refs -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-trace-refs" >&5 -printf %s "checking for --with-trace-refs... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-trace-refs" >&5 +$as_echo_n "checking for --with-trace-refs... " >&6; } # Check whether --with-trace-refs was given. -if test ${with_trace_refs+y} -then : +if test "${with_trace_refs+set}" = set; then : withval=$with_trace_refs; -else $as_nop +else with_trace_refs=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_trace_refs" >&5 -printf "%s\n" "$with_trace_refs" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_trace_refs" >&5 +$as_echo "$with_trace_refs" >&6; } if test "$with_trace_refs" = "yes" then -printf "%s\n" "#define Py_TRACE_REFS 1" >>confdefs.h +$as_echo "#define Py_TRACE_REFS 1" >>confdefs.h fi # Check for --with-assertions. # This allows enabling assertions without Py_DEBUG. assertions='false' -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-assertions" >&5 -printf %s "checking for --with-assertions... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-assertions" >&5 +$as_echo_n "checking for --with-assertions... " >&6; } # Check whether --with-assertions was given. -if test ${with_assertions+y} -then : +if test "${with_assertions+set}" = set; then : withval=$with_assertions; if test "$withval" != no then @@ -7041,40 +6450,39 @@ fi fi if test "$assertions" = 'true'; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } elif test "$Py_DEBUG" = 'true'; then assertions='true' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: implied by --with-pydebug" >&5 -printf "%s\n" "implied by --with-pydebug" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: implied by --with-pydebug" >&5 +$as_echo "implied by --with-pydebug" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # Enable optimization flags Py_OPT='false' -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-optimizations" >&5 -printf %s "checking for --enable-optimizations... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-optimizations" >&5 +$as_echo_n "checking for --enable-optimizations... " >&6; } # Check whether --enable-optimizations was given. -if test ${enable_optimizations+y} -then : +if test "${enable_optimizations+set}" = set; then : enableval=$enable_optimizations; if test "$enableval" != no then Py_OPT='true' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; else Py_OPT='false' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "$Py_OPT" = 'true' ; then @@ -7087,12 +6495,11 @@ if test "$Py_OPT" = 'true' ; then DEF_MAKE_RULE="build_all" case $CC in *gcc*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-semantic-interposition" >&5 -printf %s "checking whether C compiler accepts -fno-semantic-interposition... " >&6; } -if test ${ax_cv_check_cflags___fno_semantic_interposition+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-semantic-interposition" >&5 +$as_echo_n "checking whether C compiler accepts -fno-semantic-interposition... " >&6; } +if ${ax_cv_check_cflags___fno_semantic_interposition+:} false; then : + $as_echo_n "(cached) " >&6 +else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-semantic-interposition" @@ -7100,31 +6507,29 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ax_cv_check_cflags___fno_semantic_interposition=yes -else $as_nop +else ax_cv_check_cflags___fno_semantic_interposition=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_semantic_interposition" >&5 -printf "%s\n" "$ax_cv_check_cflags___fno_semantic_interposition" >&6; } -if test "x$ax_cv_check_cflags___fno_semantic_interposition" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_semantic_interposition" >&5 +$as_echo "$ax_cv_check_cflags___fno_semantic_interposition" >&6; } +if test "x$ax_cv_check_cflags___fno_semantic_interposition" = xyes; then : CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition" LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition" -else $as_nop +else : fi @@ -7139,14 +6544,14 @@ else fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking PROFILE_TASK" >&5 -printf %s "checking PROFILE_TASK... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PROFILE_TASK" >&5 +$as_echo_n "checking PROFILE_TASK... " >&6; } if test -z "$PROFILE_TASK" then PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)' fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PROFILE_TASK" >&5 -printf "%s\n" "$PROFILE_TASK" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROFILE_TASK" >&5 +$as_echo "$PROFILE_TASK" >&6; } # 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 @@ -7169,26 +6574,25 @@ then fi # Enable LTO flags -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 -printf %s "checking for --with-lto... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 +$as_echo_n "checking for --with-lto... " >&6; } # Check whether --with-lto was given. -if test ${with_lto+y} -then : +if test "${with_lto+set}" = set; then : withval=$with_lto; if test "$withval" != no then Py_LTO='true' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; else Py_LTO='false' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "$Py_LTO" = 'true' ; then @@ -7198,12 +6602,11 @@ if test "$Py_LTO" = 'true' ; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}llvm-ar", so it can be a program name with args. set dummy ${ac_tool_prefix}llvm-ar; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_LLVM_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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. @@ -7213,15 +6616,11 @@ else $as_nop for as_dir in ${llvm_path} do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + 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 @@ -7233,11 +6632,11 @@ esac fi LLVM_AR=$ac_cv_path_LLVM_AR if test -n "$LLVM_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LLVM_AR" >&5 -printf "%s\n" "$LLVM_AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_AR" >&5 +$as_echo "$LLVM_AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -7246,12 +6645,11 @@ if test -z "$ac_cv_path_LLVM_AR"; 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_LLVM_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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. @@ -7261,15 +6659,11 @@ else $as_nop for as_dir in ${llvm_path} do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + 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 @@ -7281,11 +6675,11 @@ esac fi ac_pt_LLVM_AR=$ac_cv_path_ac_pt_LLVM_AR if test -n "$ac_pt_LLVM_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_AR" >&5 -printf "%s\n" "$ac_pt_LLVM_AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_AR" >&5 +$as_echo "$ac_pt_LLVM_AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_LLVM_AR" = x; then @@ -7293,8 +6687,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LLVM_AR=$ac_pt_LLVM_AR @@ -7317,8 +6711,8 @@ fi then LLVM_AR='/usr/bin/xcrun llvm-ar' LLVM_AR_FOUND=found - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: llvm-ar found via xcrun: ${LLVM_AR}" >&5 -printf "%s\n" "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;} + { $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 @@ -7372,12 +6766,11 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}llvm-profdata", so it can be a program name with args. set dummy ${ac_tool_prefix}llvm-profdata; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_LLVM_PROFDATA+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_PROFDATA+:} false; then : + $as_echo_n "(cached) " >&6 +else case $LLVM_PROFDATA in [\\/]* | ?:[\\/]*) ac_cv_path_LLVM_PROFDATA="$LLVM_PROFDATA" # Let the user override the test with a path. @@ -7387,15 +6780,11 @@ else $as_nop for as_dir in ${llvm_path} do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_PROFDATA="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LLVM_PROFDATA="$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 @@ -7407,11 +6796,11 @@ esac fi LLVM_PROFDATA=$ac_cv_path_LLVM_PROFDATA if test -n "$LLVM_PROFDATA"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LLVM_PROFDATA" >&5 -printf "%s\n" "$LLVM_PROFDATA" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_PROFDATA" >&5 +$as_echo "$LLVM_PROFDATA" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -7420,12 +6809,11 @@ if test -z "$ac_cv_path_LLVM_PROFDATA"; then ac_pt_LLVM_PROFDATA=$LLVM_PROFDATA # Extract the first word of "llvm-profdata", so it can be a program name with args. set dummy llvm-profdata; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_LLVM_PROFDATA+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_PROFDATA+:} false; then : + $as_echo_n "(cached) " >&6 +else case $ac_pt_LLVM_PROFDATA in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_LLVM_PROFDATA="$ac_pt_LLVM_PROFDATA" # Let the user override the test with a path. @@ -7435,15 +6823,11 @@ else $as_nop for as_dir in ${llvm_path} do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_PROFDATA="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_LLVM_PROFDATA="$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 @@ -7455,11 +6839,11 @@ esac fi ac_pt_LLVM_PROFDATA=$ac_cv_path_ac_pt_LLVM_PROFDATA if test -n "$ac_pt_LLVM_PROFDATA"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_PROFDATA" >&5 -printf "%s\n" "$ac_pt_LLVM_PROFDATA" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_PROFDATA" >&5 +$as_echo "$ac_pt_LLVM_PROFDATA" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_LLVM_PROFDATA" = x; then @@ -7467,8 +6851,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LLVM_PROFDATA=$ac_pt_LLVM_PROFDATA @@ -7493,8 +6877,8 @@ then # https://apple.stackexchange.com/questions/197053/ LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata' LLVM_PROF_FOUND=found - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&5 -printf "%s\n" "$as_me: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&5 +$as_echo "$as_me: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&6;} fi fi LLVM_PROF_ERR=no @@ -7638,20 +7022,19 @@ case $GCC in yes) CFLAGS_NODIST="$CFLAGS_NODIST -std=c99" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5 -printf %s "checking for -Wextra... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5 +$as_echo_n "checking for -Wextra... " >&6; } ac_save_cc="$CC" CC="$CC -Wextra -Werror" - if test ${ac_cv_extra_warnings+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_extra_warnings+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7659,22 +7042,21 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_extra_warnings=yes -else $as_nop +else ac_cv_extra_warnings=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_extra_warnings" >&5 -printf "%s\n" "$ac_cv_extra_warnings" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_extra_warnings" >&5 +$as_echo "$ac_cv_extra_warnings" >&6; } if test $ac_cv_extra_warnings = yes then @@ -7685,21 +7067,20 @@ printf "%s\n" "$ac_cv_extra_warnings" >&6; } # GCC produce warnings for legal Python code. Enable # -fno-strict-aliasing on versions of GCC that support but produce # warnings. See Issue3326 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts and needs -fno-strict-aliasing" >&5 -printf %s "checking whether $CC accepts and needs -fno-strict-aliasing... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts and needs -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC accepts and needs -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" save_CFLAGS="$CFLAGS" - if test ${ac_cv_no_strict_aliasing+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_no_strict_aliasing+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7707,8 +7088,7 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : CC="$ac_save_cc -fstrict-aliasing" CFLAGS="$CFLAGS -Werror -Wstrict-aliasing" @@ -7717,7 +7097,7 @@ then : void f(int **x) {} int -main (void) +main () { double *x; f((int **) &x); ; @@ -7725,30 +7105,29 @@ double *x; f((int **) &x); } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_no_strict_aliasing=no -else $as_nop +else ac_cv_no_strict_aliasing=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else $as_nop +else ac_cv_no_strict_aliasing=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_no_strict_aliasing" >&5 -printf "%s\n" "$ac_cv_no_strict_aliasing" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_no_strict_aliasing" >&5 +$as_echo "$ac_cv_no_strict_aliasing" >&6; } if test $ac_cv_no_strict_aliasing = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -7761,21 +7140,20 @@ printf "%s\n" "$ac_cv_no_strict_aliasing" >&6; } ac_cv_disable_unused_result_warning=no ;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused result warning" >&5 -printf %s "checking if we can turn off $CC unused result warning... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused result warning" >&5 +$as_echo_n "checking if we can turn off $CC unused result warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wunused-result -Werror" save_CFLAGS="$CFLAGS" - if test ${ac_cv_disable_unused_result_warning+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_disable_unused_result_warning+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7783,23 +7161,22 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_disable_unused_result_warning=yes -else $as_nop +else ac_cv_disable_unused_result_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_result_warning" >&5 -printf "%s\n" "$ac_cv_disable_unused_result_warning" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_result_warning" >&5 +$as_echo "$ac_cv_disable_unused_result_warning" >&6; } ;; esac @@ -7809,20 +7186,19 @@ printf "%s\n" "$ac_cv_disable_unused_result_warning" >&6; } CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused parameter warning" >&5 -printf %s "checking if we can turn off $CC unused parameter warning... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused parameter warning" >&5 +$as_echo_n "checking if we can turn off $CC unused parameter warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wunused-parameter -Werror" - if test ${ac_cv_disable_unused_parameter_warning+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_disable_unused_parameter_warning+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7830,42 +7206,40 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_disable_unused_parameter_warning=yes -else $as_nop +else ac_cv_disable_unused_parameter_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_parameter_warning" >&5 -printf "%s\n" "$ac_cv_disable_unused_parameter_warning" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_parameter_warning" >&5 +$as_echo "$ac_cv_disable_unused_parameter_warning" >&6; } if test $ac_cv_disable_unused_parameter_warning = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC missing field initializers warning" >&5 -printf %s "checking if we can turn off $CC missing field initializers warning... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC missing field initializers warning" >&5 +$as_echo_n "checking if we can turn off $CC missing field initializers warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wmissing-field-initializers -Werror" - if test ${ac_cv_disable_missing_field_initializers+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_disable_missing_field_initializers+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7873,43 +7247,41 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_disable_missing_field_initializers=yes -else $as_nop +else ac_cv_disable_missing_field_initializers=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_missing_field_initializers" >&5 -printf "%s\n" "$ac_cv_disable_missing_field_initializers" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_missing_field_initializers" >&5 +$as_echo "$ac_cv_disable_missing_field_initializers" >&6; } if test $ac_cv_disable_missing_field_initializers = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC mixed sign comparison warning" >&5 -printf %s "checking if we can turn on $CC mixed sign comparison warning... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC mixed sign comparison warning" >&5 +$as_echo_n "checking if we can turn on $CC mixed sign comparison warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wsign-compare" save_CFLAGS="$CFLAGS" - if test ${ac_cv_enable_sign_compare_warning+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_enable_sign_compare_warning+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7917,44 +7289,42 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_enable_sign_compare_warning=yes -else $as_nop +else ac_cv_enable_sign_compare_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_sign_compare_warning" >&5 -printf "%s\n" "$ac_cv_enable_sign_compare_warning" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_sign_compare_warning" >&5 +$as_echo "$ac_cv_enable_sign_compare_warning" >&6; } if test $ac_cv_enable_sign_compare_warning = yes then BASECFLAGS="$BASECFLAGS -Wsign-compare" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC unreachable code warning" >&5 -printf %s "checking if we can turn on $CC unreachable code warning... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC unreachable code warning" >&5 +$as_echo_n "checking if we can turn on $CC unreachable code warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wunreachable-code" save_CFLAGS="$CFLAGS" - if test ${ac_cv_enable_unreachable_code_warning+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_enable_unreachable_code_warning+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -7962,17 +7332,16 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_enable_unreachable_code_warning=yes -else $as_nop +else ac_cv_enable_unreachable_code_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$save_CFLAGS" @@ -7993,23 +7362,22 @@ fi else ac_cv_enable_unreachable_code_warning=no fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5 -printf "%s\n" "$ac_cv_enable_unreachable_code_warning" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5 +$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC strict-prototypes warning" >&5 -printf %s "checking if we can turn on $CC strict-prototypes warning... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC strict-prototypes warning" >&5 +$as_echo_n "checking if we can turn on $CC strict-prototypes warning... " >&6; } ac_save_cc="$CC" CC="$CC -Werror -Wstrict-prototypes" - if test ${ac_cv_enable_enable_strict_prototypes_warning+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_enable_enable_strict_prototypes_warning+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -8017,42 +7385,40 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_enable_strict_prototypes_warning=yes -else $as_nop +else ac_cv_enable_strict_prototypes_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5 -printf "%s\n" "$ac_cv_enable_strict_prototypes_warning" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5 +$as_echo "$ac_cv_enable_strict_prototypes_warning" >&6; } if test $ac_cv_enable_strict_prototypes_warning = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can make implicit function declaration an error in $CC" >&5 -printf %s "checking if we can make implicit function declaration an error in $CC... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make implicit function declaration an error in $CC" >&5 +$as_echo_n "checking if we can make implicit function declaration an error in $CC... " >&6; } ac_save_cc="$CC" CC="$CC -Werror=implicit-function-declaration" - if test ${ac_cv_enable_implicit_function_declaration_error+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_enable_implicit_function_declaration_error+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -8060,42 +7426,40 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_enable_implicit_function_declaration_error=yes -else $as_nop +else ac_cv_enable_implicit_function_declaration_error=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_implicit_function_declaration_error" >&5 -printf "%s\n" "$ac_cv_enable_implicit_function_declaration_error" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_implicit_function_declaration_error" >&5 +$as_echo "$ac_cv_enable_implicit_function_declaration_error" >&6; } if test $ac_cv_enable_implicit_function_declaration_error = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can use visibility in $CC" >&5 -printf %s "checking if we can use visibility in $CC... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use visibility in $CC" >&5 +$as_echo_n "checking if we can use visibility in $CC... " >&6; } ac_save_cc="$CC" CC="$CC -fvisibility=hidden" - if test ${ac_cv_enable_visibility+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${ac_cv_enable_visibility+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -8103,22 +7467,21 @@ main (void) } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_enable_visibility=yes -else $as_nop +else ac_cv_enable_visibility=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_visibility" >&5 -printf "%s\n" "$ac_cv_enable_visibility" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_visibility" >&5 +$as_echo "$ac_cv_enable_visibility" >&6; } if test $ac_cv_enable_visibility = yes then @@ -8144,8 +7507,8 @@ printf "%s\n" "$ac_cv_enable_visibility" >&6; } # used to be here, but non-Apple gcc doesn't accept them. if test "${CC}" = gcc then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 -printf %s "checking which compiler should be used... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 +$as_echo_n "checking which compiler should be used... " >&6; } case "${UNIVERSALSDK}" in */MacOSX10.4u.sdk) # Build using 10.4 SDK, force usage of gcc when the @@ -8155,8 +7518,8 @@ printf %s "checking which compiler should be used... " >&6; } CPP=cpp-4.0 ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } fi if test "${enable_universalsdk}" @@ -8231,8 +7594,8 @@ printf "%s\n" "$CC" >&6; } # below to pick either 10.3, 10.4, or 10.5 as the target. # 4. If we are running on OS X 10.2 or earlier, good luck! - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which MACOSX_DEPLOYMENT_TARGET to use" >&5 -printf %s "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which MACOSX_DEPLOYMENT_TARGET to use" >&5 +$as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; } cur_target_major=`sw_vers -productVersion | \ sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'` cur_target_minor=`sw_vers -productVersion | \ @@ -8269,33 +7632,32 @@ printf %s "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; } MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET" export MACOSX_DEPLOYMENT_TARGET EXPORT_MACOSX_DEPLOYMENT_TARGET='' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5 -printf "%s\n" "$MACOSX_DEPLOYMENT_TARGET" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5 +$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5 -printf %s "checking if specified universal architectures work... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5 +$as_echo_n "checking if specified universal architectures work... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { printf("%d", 42); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # end of Darwin* tests @@ -8341,16 +7703,14 @@ fi # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available without options" >&5 -printf %s "checking whether pthreads are available without options... " >&6; } -if test ${ac_cv_pthread_is_default+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available without options" >&5 +$as_echo_n "checking whether pthreads are available without options... " >&6; } +if ${ac_cv_pthread_is_default+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_pthread_is_default=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8368,14 +7728,13 @@ int main(){ } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_pthread_is_default=yes ac_cv_kthread=no ac_cv_pthread=no -else $as_nop +else ac_cv_pthread_is_default=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8385,8 +7744,8 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_is_default" >&5 -printf "%s\n" "$ac_cv_pthread_is_default" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_is_default" >&5 +$as_echo "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -8398,18 +7757,16 @@ else # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kpthread" >&5 -printf %s "checking whether $CC accepts -Kpthread... " >&6; } -if test ${ac_cv_kpthread+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kpthread" >&5 +$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } +if ${ac_cv_kpthread+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_save_cc="$CC" CC="$CC -Kpthread" -if test "$cross_compiling" = yes -then : +if test "$cross_compiling" = yes; then : ac_cv_kpthread=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8427,10 +7784,9 @@ int main(){ } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_kpthread=yes -else $as_nop +else ac_cv_kpthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8440,8 +7796,8 @@ fi CC="$ac_save_cc" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kpthread" >&5 -printf "%s\n" "$ac_cv_kpthread" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kpthread" >&5 +$as_echo "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -8451,18 +7807,16 @@ then # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kthread" >&5 -printf %s "checking whether $CC accepts -Kthread... " >&6; } -if test ${ac_cv_kthread+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kthread" >&5 +$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } +if ${ac_cv_kthread+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_save_cc="$CC" CC="$CC -Kthread" -if test "$cross_compiling" = yes -then : +if test "$cross_compiling" = yes; then : ac_cv_kthread=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8480,10 +7834,9 @@ int main(){ } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_kthread=yes -else $as_nop +else ac_cv_kthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8493,8 +7846,8 @@ fi CC="$ac_save_cc" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kthread" >&5 -printf "%s\n" "$ac_cv_kthread" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kthread" >&5 +$as_echo "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -8504,18 +7857,16 @@ then # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -pthread" >&5 -printf %s "checking whether $CC accepts -pthread... " >&6; } -if test ${ac_cv_pthread+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -pthread" >&5 +$as_echo_n "checking whether $CC accepts -pthread... " >&6; } +if ${ac_cv_pthread+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_save_cc="$CC" CC="$CC -pthread" -if test "$cross_compiling" = yes -then : +if test "$cross_compiling" = yes; then : ac_cv_pthread=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8533,10 +7884,9 @@ int main(){ } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_pthread=yes -else $as_nop +else ac_cv_pthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8546,8 +7896,8 @@ fi CC="$ac_save_cc" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread" >&5 -printf "%s\n" "$ac_cv_pthread" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread" >&5 +$as_echo "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -8555,8 +7905,8 @@ fi ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5 -printf %s "checking whether $CXX also accepts flags for thread support... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5 +$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -8586,702 +7936,358 @@ then fi rm -fr conftest* fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5 -printf "%s\n" "$ac_cv_cxx_thread" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5 +$as_echo "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - -ac_fn_c_check_header_compile "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_types_h" = xyes -then : - printf "%s\n" "#define HAVE_ASM_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" -if test "x$ac_cv_header_crypt_h" = xyes -then : - printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "conio.h" "ac_cv_header_conio_h" "$ac_includes_default" -if test "x$ac_cv_header_conio_h" = xyes -then : - printf "%s\n" "#define HAVE_CONIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "direct.h" "ac_cv_header_direct_h" "$ac_includes_default" -if test "x$ac_cv_header_direct_h" = xyes -then : - printf "%s\n" "#define HAVE_DIRECT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -if test "x$ac_cv_header_dlfcn_h" = xyes -then : - printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include -fi -ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes -then : - printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no fi -ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = xyes -then : - printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_fn_c_check_header_compile "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" -if test "x$ac_cv_header_grp_h" = xyes -then : - printf "%s\n" "#define HAVE_GRP_H 1" >>confdefs.h +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -fi -ac_fn_c_check_header_compile "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" -if test "x$ac_cv_header_ieeefp_h" = xyes -then : - printf "%s\n" "#define HAVE_IEEEFP_H 1" >>confdefs.h +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : +else + ac_cv_header_stdc=no fi -ac_fn_c_check_header_compile "$LINENO" "io.h" "ac_cv_header_io_h" "$ac_includes_default" -if test "x$ac_cv_header_io_h" = xyes -then : - printf "%s\n" "#define HAVE_IO_H 1" >>confdefs.h +rm -f conftest* fi -ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_langinfo_h" = xyes -then : - printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" -if test "x$ac_cv_header_libintl_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -fi -ac_fn_c_check_header_compile "$LINENO" "process.h" "ac_cv_header_process_h" "$ac_includes_default" -if test "x$ac_cv_header_process_h" = xyes -then : - printf "%s\n" "#define HAVE_PROCESS_H 1" >>confdefs.h +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : +else + ac_cv_header_stdc=no fi -ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h +rm -f conftest* fi -ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sched_h" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default" -if test "x$ac_cv_header_shadow_h" = xyes -then : - printf "%s\n" "#define HAVE_SHADOW_H 1" >>confdefs.h +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -fi -ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_signal_h" = xyes -then : - printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : +else + ac_cv_header_stdc=no fi -ac_fn_c_check_header_compile "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default" -if test "x$ac_cv_header_stropts_h" = xyes -then : - printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" -if test "x$ac_cv_header_termios_h" = xyes -then : - printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" -if test "x$ac_cv_header_utime_h" = xyes -then : - printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h - fi -ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_poll_h" = xyes -then : - printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then -fi -ac_fn_c_check_header_compile "$LINENO" "sys/devpoll.h" "ac_cv_header_sys_devpoll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_devpoll_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_DEVPOLL_H 1" >>confdefs.h +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_epoll_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_poll_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_POLL_H 1" >>confdefs.h +for ac_header in asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \ +fcntl.h grp.h \ +ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ +sched.h shadow.h signal.h stropts.h termios.h \ +utime.h \ +poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ +sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ +sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ +sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ +sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ +sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ +libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ +linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \ +sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \ +sys/mman.h sys/eventfd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_audioio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_AUDIOIO_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_xattr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_XATTR_H 1" >>confdefs.h +done -fi -ac_fn_c_check_header_compile "$LINENO" "sys/bsdtty.h" "ac_cv_header_sys_bsdtty_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_bsdtty_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_BSDTTY_H 1" >>confdefs.h +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" fi -ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_event_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_file_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF +ac_header_dirent=$ac_hdr; break fi -ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "sys/kern_control.h" "ac_cv_header_sys_kern_control_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_kern_control_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_KERN_CONTROL_H 1" >>confdefs.h +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res fi -ac_fn_c_check_header_compile "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_loadavg_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_LOADAVG_H 1" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break fi -ac_fn_c_check_header_compile "$LINENO" "sys/lock.h" "ac_cv_header_sys_lock_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_lock_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_LOCK_H 1" >>confdefs.h +done +if ${ac_cv_search_opendir+:} false; then : +else + ac_cv_search_opendir=no fi -ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MKDEV_H 1" >>confdefs.h - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_modem_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_random_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sendfile.h" "ac_cv_header_sys_sendfile_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sendfile_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SENDFILE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_statvfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_stat_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_syscall_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sys_domain.h" "ac_cv_header_sys_sys_domain_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sys_domain_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYS_DOMAIN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/termio.h" "ac_cv_header_sys_termio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_termio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TERMIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/times.h" "ac_cv_header_sys_times_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_times_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TIMES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_types_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_uio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_un_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_utsname_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_wait_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "pty.h" "ac_cv_header_pty_h" "$ac_includes_default" -if test "x$ac_cv_header_pty_h" = xyes -then : - printf "%s\n" "#define HAVE_PTY_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default" -if test "x$ac_cv_header_libutil_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBUTIL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_resource_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netpacket/packet.h" "ac_cv_header_netpacket_packet_h" "$ac_includes_default" -if test "x$ac_cv_header_netpacket_packet_h" = xyes -then : - printf "%s\n" "#define HAVE_NETPACKET_PACKET_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default" -if test "x$ac_cv_header_sysexits_h" = xyes -then : - printf "%s\n" "#define HAVE_SYSEXITS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "bluetooth.h" "ac_cv_header_bluetooth_h" "$ac_includes_default" -if test "x$ac_cv_header_bluetooth_h" = xyes -then : - printf "%s\n" "#define HAVE_BLUETOOTH_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/tipc.h" "ac_cv_header_linux_tipc_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_tipc_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_TIPC_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/random.h" "ac_cv_header_linux_random_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_random_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_RANDOM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "spawn.h" "ac_cv_header_spawn_h" "$ac_includes_default" -if test "x$ac_cv_header_spawn_h" = xyes -then : - printf "%s\n" "#define HAVE_SPAWN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "util.h" "ac_cv_header_util_h" "$ac_includes_default" -if test "x$ac_cv_header_util_h" = xyes -then : - printf "%s\n" "#define HAVE_UTIL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" -if test "x$ac_cv_header_alloca_h" = xyes -then : - printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "endian.h" "ac_cv_header_endian_h" "$ac_includes_default" -if test "x$ac_cv_header_endian_h" = xyes -then : - printf "%s\n" "#define HAVE_ENDIAN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_endian_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSMACROS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/memfd.h" "ac_cv_header_linux_memfd_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_memfd_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_MEMFD_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/wait.h" "ac_cv_header_linux_wait_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_wait_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_WAIT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/memfd.h" "ac_cv_header_sys_memfd_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_memfd_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MEMFD_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_eventfd_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -printf %s "checking for $ac_hdr that defines DIR... " >&6; } -if eval test \${$as_ac_Header+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main (void) -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes" -then : - cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -printf %s "checking for library containing opendir... " >&6; } -if test ${ac_cv_search_opendir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char opendir (); int -main (void) +main () { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' dir -do +for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO" -then : + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test ${ac_cv_search_opendir+y} -then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test ${ac_cv_search_opendir+y} -then : +if ${ac_cv_search_opendir+:} false; then : -else $as_nop +else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -printf "%s\n" "$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir -if test "$ac_res" != no -then : +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } +if ${ac_cv_header_sys_types_h_makedev+:} false; then : + $as_echo_n "(cached) " >&6 else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -printf %s "checking for library containing opendir... " >&6; } -if test ${ac_cv_search_opendir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); +#include int -main (void) +main () { -return opendir (); +return makedev(0, 0); ; return 0; } _ACEOF -for ac_lib in '' x -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_opendir+y} -then : - break -fi -done -if test ${ac_cv_search_opendir+y} -then : - -else $as_nop - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_header_sys_types_h_makedev=yes +else + ac_cv_header_sys_types_h_makedev=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -printf "%s\n" "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } -fi +if test $ac_cv_header_sys_types_h_makedev = no; then +ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : +$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h -ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes -then : +fi -printf "%s\n" "#define MAJOR_IN_MKDEV 1" >>confdefs.h -fi -if test $ac_cv_header_sys_mkdev_h = no; then - ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes -then : + if test $ac_cv_header_sys_mkdev_h = no; then + ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : -printf "%s\n" "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h +$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h fi + + fi fi @@ -9289,17 +8295,24 @@ fi # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 SAVE_CFLAGS=$CFLAGS CFLAGS="-std=c99 $CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" -if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes -then : - printf "%s\n" "#define HAVE_BLUETOOTH_BLUETOOTH_H 1" >>confdefs.h +for ac_header in bluetooth/bluetooth.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" +if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BLUETOOTH_BLUETOOTH_H 1 +_ACEOF fi +done + CFLAGS=$SAVE_CFLAGS # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. -ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#include +for ac_header in net/if.h +do : + ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#include #ifdef STDC_HEADERS # include # include @@ -9313,15 +8326,20 @@ ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#incl #endif " -if test "x$ac_cv_header_net_if_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h +if test "x$ac_cv_header_net_if_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NET_IF_H 1 +_ACEOF fi +done + # On Linux, netlink.h requires asm/types.h -ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" " +for ac_header in linux/netlink.h +do : + ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" " #ifdef HAVE_ASM_TYPES_H #include #endif @@ -9330,15 +8348,20 @@ ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_net #endif " -if test "x$ac_cv_header_linux_netlink_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_NETLINK_H 1" >>confdefs.h +if test "x$ac_cv_header_linux_netlink_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_NETLINK_H 1 +_ACEOF fi +done + # On Linux, qrtr.h requires asm/types.h -ac_fn_c_check_header_compile "$LINENO" "linux/qrtr.h" "ac_cv_header_linux_qrtr_h" " +for ac_header in linux/qrtr.h +do : + ac_fn_c_check_header_compile "$LINENO" "linux/qrtr.h" "ac_cv_header_linux_qrtr_h" " #ifdef HAVE_ASM_TYPES_H #include #endif @@ -9347,101 +8370,80 @@ ac_fn_c_check_header_compile "$LINENO" "linux/qrtr.h" "ac_cv_header_linux_qrtr_h #endif " -if test "x$ac_cv_header_linux_qrtr_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_QRTR_H 1" >>confdefs.h +if test "x$ac_cv_header_linux_qrtr_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_QRTR_H 1 +_ACEOF fi - -ac_fn_c_check_header_compile "$LINENO" "linux/vm_sockets.h" "ac_cv_header_linux_vm_sockets_h" " -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -" -if test "x$ac_cv_header_linux_vm_sockets_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_VM_SOCKETS_H 1" >>confdefs.h - -fi +done -# On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h -ac_fn_c_check_header_compile "$LINENO" "linux/can.h" "ac_cv_header_linux_can_h" " +for ac_header in linux/vm_sockets.h +do : + ac_fn_c_check_header_compile "$LINENO" "linux/vm_sockets.h" "ac_cv_header_linux_vm_sockets_h" " #ifdef HAVE_SYS_SOCKET_H #include #endif " -if test "x$ac_cv_header_linux_can_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CAN_H 1" >>confdefs.h +if test "x$ac_cv_header_linux_vm_sockets_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_VM_SOCKETS_H 1 +_ACEOF fi -ac_fn_c_check_header_compile "$LINENO" "linux/can/bcm.h" "ac_cv_header_linux_can_bcm_h" " -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -" -if test "x$ac_cv_header_linux_can_bcm_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CAN_BCM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/can/j1939.h" "ac_cv_header_linux_can_j1939_h" " -#ifdef HAVE_SYS_SOCKET_H -#include -#endif +done -" -if test "x$ac_cv_header_linux_can_j1939_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CAN_J1939_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "linux/can/raw.h" "ac_cv_header_linux_can_raw_h" " +# On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h +for ac_header in linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " #ifdef HAVE_SYS_SOCKET_H #include #endif " -if test "x$ac_cv_header_linux_can_raw_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CAN_RAW_H 1" >>confdefs.h +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi +done + # checks for typedefs was_it_defined=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 -printf %s "checking for clock_t in time.h... " >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 +$as_echo_n "checking for clock_t in time.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "clock_t" >/dev/null 2>&1 -then : + $EGREP "clock_t" >/dev/null 2>&1; then : was_it_defined=yes -else $as_nop +else -printf "%s\n" "#define clock_t long" >>confdefs.h +$as_echo "#define clock_t long" >>confdefs.h fi -rm -rf conftest* +rm -f conftest* -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 -printf "%s\n" "$was_it_defined" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for makedev" >&5 -printf %s "checking for makedev... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for makedev" >&5 +$as_echo_n "checking for makedev... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9454,7 +8456,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main (void) +main () { makedev(0, 0) @@ -9463,25 +8465,24 @@ main (void) } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_has_makedev=yes -else $as_nop +else ac_cv_has_makedev=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_makedev" >&5 -printf "%s\n" "$ac_cv_has_makedev" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_makedev" >&5 +$as_echo "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then -printf "%s\n" "#define HAVE_MAKEDEV 1" >>confdefs.h +$as_echo "#define HAVE_MAKEDEV 1" >>confdefs.h fi # byte swapping -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for le64toh" >&5 -printf %s "checking for le64toh... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for le64toh" >&5 +$as_echo_n "checking for le64toh... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9492,7 +8493,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main (void) +main () { le64toh(1) @@ -9501,19 +8502,18 @@ main (void) } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_has_le64toh=yes -else $as_nop +else ac_cv_has_le64toh=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_le64toh" >&5 -printf "%s\n" "$ac_cv_has_le64toh" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_le64toh" >&5 +$as_echo "$ac_cv_has_le64toh" >&6; } if test "$ac_cv_has_le64toh" = "yes"; then -printf "%s\n" "#define HAVE_HTOLE64 1" >>confdefs.h +$as_echo "#define HAVE_HTOLE64 1" >>confdefs.h fi @@ -9529,15 +8529,15 @@ if test "$use_lfs" = "yes"; then case $ac_sys_system/$ac_sys_release in AIX*) -printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h +$as_echo "#define _LARGE_FILES 1" >>confdefs.h ;; esac -printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h +$as_echo "#define _LARGEFILE_SOURCE 1" >>confdefs.h -printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h +$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h fi @@ -9550,121 +8550,96 @@ EOF # Type availability checks ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes -then : +if test "x$ac_cv_type_mode_t" = xyes; then : -else $as_nop +else -printf "%s\n" "#define mode_t int" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes -then : +if test "x$ac_cv_type_off_t" = xyes; then : -else $as_nop +else -printf "%s\n" "#define off_t long int" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF fi +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : - ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : - -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif - -int -main (void) -{ - - ; - return 0; -} +else +cat >>confdefs.h <<_ACEOF +#define pid_t int _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - fi - -printf "%s\n" "#define RETSIGTYPE void" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE void +_ACEOF ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : +if test "x$ac_cv_type_size_t" = xyes; then : -else $as_nop +else -printf "%s\n" "#define size_t unsigned int" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 -then : + $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes -else $as_nop +else ac_cv_type_uid_t=no fi -rm -rf conftest* +rm -f conftest* fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then -printf "%s\n" "#define uid_t int" >>confdefs.h +$as_echo "#define uid_t int" >>confdefs.h -printf "%s\n" "#define gid_t int" >>confdefs.h +$as_echo "#define gid_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes -then : +if test "x$ac_cv_type_ssize_t" = xyes; then : -printf "%s\n" "#define HAVE_SSIZE_T 1" >>confdefs.h +$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default" -if test "x$ac_cv_type___uint128_t" = xyes -then : +if test "x$ac_cv_type___uint128_t" = xyes; then : -printf "%s\n" "#define HAVE_GCC_UINT128_T 1" >>confdefs.h +$as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h fi @@ -9675,19 +8650,17 @@ fi # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -printf %s "checking size of int... " >&6; } -if test ${ac_cv_sizeof_int+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else if test "$ac_cv_type_int" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else @@ -9696,31 +8669,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -printf "%s\n" "$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } -printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -printf %s "checking size of long... " >&6; } -if test ${ac_cv_sizeof_long+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else if test "$ac_cv_type_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -9729,31 +8702,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -printf "%s\n" "$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } -printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -printf %s "checking size of long long... " >&6; } -if test ${ac_cv_sizeof_long_long+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else if test "$ac_cv_type_long_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else @@ -9762,31 +8735,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } -printf "%s\n" "#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -printf %s "checking size of void *... " >&6; } -if test ${ac_cv_sizeof_void_p+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else if test "$ac_cv_type_void_p" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else @@ -9795,31 +8768,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -printf "%s\n" "$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } -printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -printf %s "checking size of short... " >&6; } -if test ${ac_cv_sizeof_short+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else if test "$ac_cv_type_short" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else @@ -9828,31 +8801,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -printf "%s\n" "$ac_cv_sizeof_short" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } -printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 -printf %s "checking size of float... " >&6; } -if test ${ac_cv_sizeof_float+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } +if ${ac_cv_sizeof_float+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : + +else if test "$ac_cv_type_float" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (float) See \`config.log' for more details" "$LINENO" 5; } else @@ -9861,31 +8834,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 -printf "%s\n" "$ac_cv_sizeof_float" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } -printf "%s\n" "#define SIZEOF_FLOAT $ac_cv_sizeof_float" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 -printf %s "checking size of double... " >&6; } -if test ${ac_cv_sizeof_double+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : + +else if test "$ac_cv_type_double" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double) See \`config.log' for more details" "$LINENO" 5; } else @@ -9894,31 +8867,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 -printf "%s\n" "$ac_cv_sizeof_double" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } -printf "%s\n" "#define SIZEOF_DOUBLE $ac_cv_sizeof_double" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5 -printf %s "checking size of fpos_t... " >&6; } -if test ${ac_cv_sizeof_fpos_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))" "ac_cv_sizeof_fpos_t" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5 +$as_echo_n "checking size of fpos_t... " >&6; } +if ${ac_cv_sizeof_fpos_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))" "ac_cv_sizeof_fpos_t" "$ac_includes_default"; then : + +else if test "$ac_cv_type_fpos_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (fpos_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9927,31 +8900,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fpos_t" >&5 -printf "%s\n" "$ac_cv_sizeof_fpos_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fpos_t" >&5 +$as_echo "$ac_cv_sizeof_fpos_t" >&6; } -printf "%s\n" "#define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -printf %s "checking size of size_t... " >&6; } -if test ${ac_cv_sizeof_size_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } +if ${ac_cv_sizeof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : + +else if test "$ac_cv_type_size_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9960,31 +8933,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } -printf "%s\n" "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 -printf %s "checking size of pid_t... " >&6; } -if test ${ac_cv_sizeof_pid_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 +$as_echo_n "checking size of pid_t... " >&6; } +if ${ac_cv_sizeof_pid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default"; then : + +else if test "$ac_cv_type_pid_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pid_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9993,31 +8966,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 -printf "%s\n" "$ac_cv_sizeof_pid_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 +$as_echo "$ac_cv_sizeof_pid_t" >&6; } -printf "%s\n" "#define SIZEOF_PID_T $ac_cv_sizeof_pid_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PID_T $ac_cv_sizeof_pid_t +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t" >&5 -printf %s "checking size of uintptr_t... " >&6; } -if test ${ac_cv_sizeof_uintptr_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))" "ac_cv_sizeof_uintptr_t" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t" >&5 +$as_echo_n "checking size of uintptr_t... " >&6; } +if ${ac_cv_sizeof_uintptr_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))" "ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then : + +else if test "$ac_cv_type_uintptr_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uintptr_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -10026,22 +8999,23 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uintptr_t" >&5 -printf "%s\n" "$ac_cv_sizeof_uintptr_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uintptr_t" >&5 +$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } -printf "%s\n" "#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t +_ACEOF - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 -printf %s "checking for long double... " >&6; } -if test ${ac_cv_type_long_double+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 +$as_echo_n "checking for long double... " >&6; } +if ${ac_cv_type_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else if test "$GCC" = yes; then ac_cv_type_long_double=yes else @@ -10051,7 +9025,7 @@ else $as_nop not support it. */ long double foo = 0.0L; int -main (void) +main () { static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ sizeof (double) <= sizeof (long double))]; @@ -10062,20 +9036,19 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_long_double=yes -else $as_nop +else ac_cv_type_long_double=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 -printf "%s\n" "$ac_cv_type_long_double" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 +$as_echo "$ac_cv_type_long_double" >&6; } if test $ac_cv_type_long_double = yes; then -printf "%s\n" "#define HAVE_LONG_DOUBLE 1" >>confdefs.h +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h fi @@ -10083,19 +9056,17 @@ printf "%s\n" "#define HAVE_LONG_DOUBLE 1" >>confdefs.h # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 -printf %s "checking size of long double... " >&6; } -if test ${ac_cv_sizeof_long_double+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } +if ${ac_cv_sizeof_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : + +else if test "$ac_cv_type_long_double" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long double) See \`config.log' for more details" "$LINENO" 5; } else @@ -10104,12 +9075,14 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 -printf "%s\n" "$ac_cv_sizeof_long_double" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } -printf "%s\n" "#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +_ACEOF @@ -10117,19 +9090,17 @@ printf "%s\n" "#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double" >>confdefs. # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5 -printf %s "checking size of _Bool... " >&6; } -if test ${ac_cv_sizeof__Bool+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))" "ac_cv_sizeof__Bool" "$ac_includes_default" -then : - -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5 +$as_echo_n "checking size of _Bool... " >&6; } +if ${ac_cv_sizeof__Bool+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))" "ac_cv_sizeof__Bool" "$ac_includes_default"; then : + +else if test "$ac_cv_type__Bool" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (_Bool) See \`config.log' for more details" "$LINENO" 5; } else @@ -10138,12 +9109,14 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof__Bool" >&5 -printf "%s\n" "$ac_cv_sizeof__Bool" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof__Bool" >&5 +$as_echo "$ac_cv_sizeof__Bool" >&6; } -printf "%s\n" "#define SIZEOF__BOOL $ac_cv_sizeof__Bool" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF__BOOL $ac_cv_sizeof__Bool +_ACEOF @@ -10151,24 +9124,22 @@ printf "%s\n" "#define SIZEOF__BOOL $ac_cv_sizeof__Bool" >>confdefs.h # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 -printf %s "checking size of off_t... " >&6; } -if test ${ac_cv_sizeof_off_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" " #ifdef HAVE_SYS_TYPES_H #include #endif -" -then : +"; then : -else $as_nop +else if test "$ac_cv_type_off_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -10177,39 +9148,40 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 -printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } -printf "%s\n" "#define SIZEOF_OFF_T $ac_cv_sizeof_off_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5 -printf %s "checking whether to enable large file support... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then -printf "%s\n" "#define HAVE_LARGEFILE_SUPPORT 1" >>confdefs.h +$as_echo "#define HAVE_LARGEFILE_SUPPORT 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 -printf %s "checking size of time_t... " >&6; } -if test ${ac_cv_sizeof_time_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } +if ${ac_cv_sizeof_time_t+:} false; then : + $as_echo_n "(cached) " >&6 +else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" " #ifdef HAVE_SYS_TYPES_H #include @@ -10218,13 +9190,12 @@ else $as_nop #include #endif -" -then : +"; then : -else $as_nop +else if test "$ac_cv_type_time_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -10233,12 +9204,14 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 -printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } -printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_TIME_T $ac_cv_sizeof_time_t +_ACEOF @@ -10252,15 +9225,15 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_t" >&5 -printf %s "checking for pthread_t... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_t" >&5 +$as_echo_n "checking for pthread_t... " >&6; } have_pthread_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { pthread_t x; x = *(pthread_t*)0; ; @@ -10268,36 +9241,33 @@ pthread_t x; x = *(pthread_t*)0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : have_pthread_t=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_pthread_t" >&5 -printf "%s\n" "$have_pthread_t" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread_t" >&5 +$as_echo "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 -printf %s "checking size of pthread_t... " >&6; } -if test ${ac_cv_sizeof_pthread_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } +if ${ac_cv_sizeof_pthread_t+:} false; then : + $as_echo_n "(cached) " >&6 +else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " #ifdef HAVE_PTHREAD_H #include #endif -" -then : +"; then : -else $as_nop +else if test "$ac_cv_type_pthread_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pthread_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -10306,12 +9276,14 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 -printf "%s\n" "$ac_cv_sizeof_pthread_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } -printf "%s\n" "#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t +_ACEOF fi @@ -10322,20 +9294,18 @@ fi # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pthread_key_t" >&5 -printf %s "checking size of pthread_key_t... " >&6; } -if test ${ac_cv_sizeof_pthread_key_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_key_t" >&5 +$as_echo_n "checking size of pthread_key_t... " >&6; } +if ${ac_cv_sizeof_pthread_key_t+:} false; then : + $as_echo_n "(cached) " >&6 +else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_key_t))" "ac_cv_sizeof_pthread_key_t" "#include -" -then : +"; then : -else $as_nop +else if test "$ac_cv_type_pthread_key_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pthread_key_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -10344,46 +9314,47 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_key_t" >&5 -printf "%s\n" "$ac_cv_sizeof_pthread_key_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_key_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_key_t" >&6; } -printf "%s\n" "#define SIZEOF_PTHREAD_KEY_T $ac_cv_sizeof_pthread_key_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTHREAD_KEY_T $ac_cv_sizeof_pthread_key_t +_ACEOF -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_key_t is compatible with int" >&5 -printf %s "checking whether pthread_key_t is compatible with int... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_key_t is compatible with int" >&5 +$as_echo_n "checking whether pthread_key_t is compatible with int... " >&6; } if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { pthread_key_t k; k * 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_pthread_key_t_is_arithmetic_type=yes -else $as_nop +else ac_pthread_key_t_is_arithmetic_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pthread_key_t_is_arithmetic_type" >&5 -printf "%s\n" "$ac_pthread_key_t_is_arithmetic_type" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pthread_key_t_is_arithmetic_type" >&5 +$as_echo "$ac_pthread_key_t_is_arithmetic_type" >&6; } if test "$ac_pthread_key_t_is_arithmetic_type" = yes ; then -printf "%s\n" "#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1" >>confdefs.h +$as_echo "#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1" >>confdefs.h fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi CC="$ac_save_cc" @@ -10417,10 +9388,9 @@ case $ac_sys_system/$ac_sys_release in else LIBTOOL_CRUFT="" fi - if test "$cross_compiling" = yes -then : + if test "$cross_compiling" = yes; then : ac_osx_32bit=yes -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10435,10 +9405,9 @@ else $as_nop } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_osx_32bit=yes -else $as_nop +else ac_osx_32bit=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -10480,40 +9449,40 @@ fi LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5 -printf %s "checking for --enable-framework... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5 +$as_echo_n "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" # -F. is needed to allow linking to the framework while # in the build location. -printf "%s\n" "#define WITH_NEXT_FRAMEWORK 1" >>confdefs.h +$as_echo "#define WITH_NEXT_FRAMEWORK 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } if test $enable_shared = "yes" then as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dyld" >&5 -printf %s "checking for dyld... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dyld" >&5 +$as_echo_n "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) -printf "%s\n" "#define WITH_DYLD 1" >>confdefs.h +$as_echo "#define WITH_DYLD 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: always on for Darwin" >&5 -printf "%s\n" "always on for Darwin" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: always on for Darwin" >&5 +$as_echo "always on for Darwin" >&6; } ;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ;; esac @@ -10527,8 +9496,8 @@ esac # SHLIB_SUFFIX is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the extension of shared libraries" >&5 -printf %s "checking the extension of shared libraries... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the extension of shared libraries" >&5 +$as_echo_n "checking the extension of shared libraries... " >&6; } if test -z "$SHLIB_SUFFIX"; then case $ac_sys_system in hp*|HP*) @@ -10541,15 +9510,15 @@ if test -z "$SHLIB_SUFFIX"; then *) SHLIB_SUFFIX=.so;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHLIB_SUFFIX" >&5 -printf "%s\n" "$SHLIB_SUFFIX" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLIB_SUFFIX" >&5 +$as_echo "$SHLIB_SUFFIX" >&6; } # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x. # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LDSHARED" >&5 -printf %s "checking LDSHARED... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -10679,14 +9648,14 @@ then *) LDSHARED="ld";; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDSHARED" >&5 -printf "%s\n" "$LDSHARED" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } LDCXXSHARED=${LDCXXSHARED-$LDSHARED} BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CCSHARED" >&5 -printf %s "checking CCSHARED... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -10717,12 +9686,12 @@ then CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic" esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5 -printf "%s\n" "$CCSHARED" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LINKFORSHARED" >&5 -printf %s "checking LINKFORSHARED... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -10779,13 +9748,13 @@ then LINKFORSHARED='-Wl,-export-dynamic';; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5 -printf "%s\n" "$LINKFORSHARED" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CFLAGSFORSHARED" >&5 -printf %s "checking CFLAGSFORSHARED... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGSFORSHARED" >&5 +$as_echo_n "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -10797,8 +9766,8 @@ then CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CFLAGSFORSHARED" >&5 -printf "%s\n" "$CFLAGSFORSHARED" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CFLAGSFORSHARED" >&5 +$as_echo "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -10809,23 +9778,22 @@ printf "%s\n" "$CFLAGSFORSHARED" >&6; } # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SHLIBS" >&5 -printf %s "checking SHLIBS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SHLIBS" >&5 +$as_echo_n "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHLIBS" >&5 -printf "%s\n" "$SHLIBS" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLIBS" >&5 +$as_echo "$SHLIBS" >&6; } # checks for libraries -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sendfile in -lsendfile" >&5 -printf %s "checking for sendfile in -lsendfile... " >&6; } -if test ${ac_cv_lib_sendfile_sendfile+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sendfile in -lsendfile" >&5 +$as_echo_n "checking for sendfile in -lsendfile... " >&6; } +if ${ac_cv_lib_sendfile_sendfile+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lsendfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10834,41 +9802,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char sendfile (); int -main (void) +main () { return sendfile (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sendfile_sendfile=yes -else $as_nop +else ac_cv_lib_sendfile_sendfile=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sendfile_sendfile" >&5 -printf "%s\n" "$ac_cv_lib_sendfile_sendfile" >&6; } -if test "x$ac_cv_lib_sendfile_sendfile" = xyes -then : - printf "%s\n" "#define HAVE_LIBSENDFILE 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sendfile_sendfile" >&5 +$as_echo "$ac_cv_lib_sendfile_sendfile" >&6; } +if test "x$ac_cv_lib_sendfile_sendfile" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSENDFILE 1 +_ACEOF LIBS="-lsendfile $LIBS" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10877,41 +9847,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char dlopen (); int -main (void) +main () { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes -else $as_nop +else ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : - printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF LIBS="-ldl $LIBS" fi # Dynamic linking for SunOS/Solaris and SYSV -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -printf %s "checking for shl_load in -ldld... " >&6; } -if test ${ac_cv_lib_dld_shl_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10920,30 +9892,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shl_load (); int -main (void) +main () { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes -else $as_nop +else ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes -then : - printf "%s\n" "#define HAVE_LIBDLD 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDLD 1 +_ACEOF LIBS="-ldld $LIBS" @@ -10951,27 +9926,27 @@ fi # Dynamic linking for HP-UX # checks for uuid.h location -ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_uuid_h" = xyes -then : - printf "%s\n" "#define HAVE_UUID_UUID_H 1" >>confdefs.h +for ac_header in uuid/uuid.h uuid.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -ac_fn_c_check_header_compile "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_h" = xyes -then : - printf "%s\n" "#define HAVE_UUID_H 1" >>confdefs.h -fi +done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5 -printf %s "checking for uuid_generate_time_safe... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5 +$as_echo_n "checking for uuid_generate_time_safe... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef uuid_generate_time_safe @@ -10982,29 +9957,28 @@ void *x = uuid_generate_time_safe return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h +$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007) # FreeBSD and OpenBSD provides support as well -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5 -printf %s "checking for uuid_create... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5 +$as_echo_n "checking for uuid_create... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef uuid_create @@ -11015,29 +9989,28 @@ void *x = uuid_create return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_UUID_CREATE 1" >>confdefs.h +$as_echo "#define HAVE_UUID_CREATE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet # stream in big-endian byte-order -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5 -printf %s "checking for uuid_enc_be... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5 +$as_echo_n "checking for uuid_enc_be... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef uuid_enc_be @@ -11048,29 +10021,27 @@ void *x = uuid_enc_be return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_UUID_ENC_BE 1" >>confdefs.h +$as_echo "#define HAVE_UUID_ENC_BE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 # pthread (first!) on Linux -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 -printf %s "checking for library containing sem_init... " >&6; } -if test ${ac_cv_search_sem_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } +if ${ac_cv_search_sem_init+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11078,60 +10049,57 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char sem_init (); int -main (void) +main () { return sem_init (); ; return 0; } _ACEOF -for ac_lib in '' pthread rt posix4 -do +for ac_lib in '' pthread rt posix4; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO" -then : + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_sem_init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test ${ac_cv_search_sem_init+y} -then : + if ${ac_cv_search_sem_init+:} false; then : break fi done -if test ${ac_cv_search_sem_init+y} -then : +if ${ac_cv_search_sem_init+:} false; then : -else $as_nop +else ac_cv_search_sem_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 -printf "%s\n" "$ac_cv_search_sem_init" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init -if test "$ac_res" != no -then : +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # check if we need libintl for locale functions -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl" >&5 -printf %s "checking for textdomain in -lintl... " >&6; } -if test ${ac_cv_lib_intl_textdomain+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl" >&5 +$as_echo_n "checking for textdomain in -lintl... " >&6; } +if ${ac_cv_lib_intl_textdomain+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11140,31 +10108,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char textdomain (); int -main (void) +main () { return textdomain (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_textdomain=yes -else $as_nop +else ac_cv_lib_intl_textdomain=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain" >&5 -printf "%s\n" "$ac_cv_lib_intl_textdomain" >&6; } -if test "x$ac_cv_lib_intl_textdomain" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain" >&5 +$as_echo "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = xyes; then : -printf "%s\n" "#define WITH_LIBINTL 1" >>confdefs.h +$as_echo "#define WITH_LIBINTL 1" >>confdefs.h LIBS="-lintl $LIBS" fi @@ -11172,14 +10141,14 @@ fi # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for genuine AIX C++ extensions support" >&5 -printf %s "checking for genuine AIX C++ extensions support... " >&6; } + AIX*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for genuine AIX C++ extensions support" >&5 +$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { loadAndInit("", 0, "") ; @@ -11187,49 +10156,48 @@ loadAndInit("", 0, "") } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : -printf "%s\n" "#define AIX_GENUINE_CPLUSPLUS 1" >>confdefs.h +$as_echo "#define AIX_GENUINE_CPLUSPLUS 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the platform_tag # of the AIX system used to build/package Python executable. This tag serves # as a baseline for bdist module packages - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the system builddate" >&5 -printf %s "checking for the system builddate... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the system builddate" >&5 +$as_echo_n "checking for the system builddate... " >&6; } AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }') -printf "%s\n" "#define AIX_BUILDDATE $AIX_BUILDDATE" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define AIX_BUILDDATE $AIX_BUILDDATE +_ACEOF - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AIX_BUILDDATE" >&5 -printf "%s\n" "$AIX_BUILDDATE" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AIX_BUILDDATE" >&5 +$as_echo "$AIX_BUILDDATE" >&6; } ;; *) ;; esac # check for systems that require aligned memory access -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking aligned memory access is required" >&5 -printf %s "checking aligned memory access is required... " >&6; } -if test ${ac_cv_aligned_required+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking aligned memory access is required" >&5 +$as_echo_n "checking aligned memory access is required... " >&6; } +if ${ac_cv_aligned_required+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_aligned_required=yes -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11246,10 +10214,9 @@ int main() return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_aligned_required=no -else $as_nop +else ac_cv_aligned_required=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -11259,33 +10226,32 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_aligned_required" >&5 -printf "%s\n" "$ac_cv_aligned_required" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_aligned_required" >&5 +$as_echo "$ac_cv_aligned_required" >&6; } if test "$ac_cv_aligned_required" = yes ; then -printf "%s\n" "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h +$as_echo "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h fi # str, bytes and memoryview hash algorithm -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-hash-algorithm" >&5 -printf %s "checking for --with-hash-algorithm... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-hash-algorithm" >&5 +$as_echo_n "checking for --with-hash-algorithm... " >&6; } # Check whether --with-hash_algorithm was given. -if test ${with_hash_algorithm+y} -then : +if test "${with_hash_algorithm+set}" = set; then : withval=$with_hash_algorithm; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } case "$withval" in siphash24) - printf "%s\n" "#define Py_HASH_ALGORITHM 1" >>confdefs.h + $as_echo "#define Py_HASH_ALGORITHM 1" >>confdefs.h ;; fnv) - printf "%s\n" "#define Py_HASH_ALGORITHM 2" >>confdefs.h + $as_echo "#define Py_HASH_ALGORITHM 2" >>confdefs.h ;; *) @@ -11293,9 +10259,9 @@ case "$withval" in ;; esac -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: default" >&5 -printf "%s\n" "default" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } fi @@ -11314,12 +10280,11 @@ validate_tzpath() { } TZPATH="/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-tzpath" >&5 -printf %s "checking for --with-tzpath... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-tzpath" >&5 +$as_echo_n "checking for --with-tzpath... " >&6; } # Check whether --with-tzpath was given. -if test ${with_tzpath+y} -then : +if test "${with_tzpath+set}" = set; then : withval=$with_tzpath; case "$withval" in yes) @@ -11328,84 +10293,80 @@ case "$withval" in *) validate_tzpath "$withval" TZPATH="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$withval\"" >&5 -printf "%s\n" "\"$withval\"" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$withval\"" >&5 +$as_echo "\"$withval\"" >&6; } ;; esac -else $as_nop +else validate_tzpath "$TZPATH" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$TZPATH\"" >&5 -printf "%s\n" "\"$TZPATH\"" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$TZPATH\"" >&5 +$as_echo "\"$TZPATH\"" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-address-sanitizer" >&5 -printf %s "checking for --with-address-sanitizer... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-address-sanitizer" >&5 +$as_echo_n "checking for --with-address-sanitizer... " >&6; } # Check whether --with-address_sanitizer was given. -if test ${with_address_sanitizer+y} -then : +if test "${with_address_sanitizer+set}" = set; then : withval=$with_address_sanitizer; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS" LDFLAGS="-fsanitize=address $LDFLAGS" # ASan works by controlling memory allocation, our own malloc interferes. with_pymalloc="no" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-memory-sanitizer" >&5 -printf %s "checking for --with-memory-sanitizer... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-memory-sanitizer" >&5 +$as_echo_n "checking for --with-memory-sanitizer... " >&6; } # Check whether --with-memory_sanitizer was given. -if test ${with_memory_sanitizer+y} -then : +if test "${with_memory_sanitizer+set}" = set; then : withval=$with_memory_sanitizer; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS" LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS" # MSan works by controlling memory allocation, our own malloc interferes. with_pymalloc="no" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-undefined-behavior-sanitizer" >&5 -printf %s "checking for --with-undefined-behavior-sanitizer... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-undefined-behavior-sanitizer" >&5 +$as_echo_n "checking for --with-undefined-behavior-sanitizer... " >&6; } # Check whether --with-undefined_behavior_sanitizer was given. -if test ${with_undefined_behavior_sanitizer+y} -then : +if test "${with_undefined_behavior_sanitizer+set}" = set; then : withval=$with_undefined_behavior_sanitizer; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } BASECFLAGS="-fsanitize=undefined $BASECFLAGS" LDFLAGS="-fsanitize=undefined $LDFLAGS" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 -printf %s "checking for t_open in -lnsl... " >&6; } -if test ${ac_cv_lib_nsl_t_open+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_t_open+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11414,38 +10375,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char t_open (); int -main (void) +main () { return t_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_t_open=yes -else $as_nop +else ac_cv_lib_nsl_t_open=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open" >&5 -printf "%s\n" "$ac_cv_lib_nsl_t_open" >&6; } -if test "x$ac_cv_lib_nsl_t_open" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = xyes; then : LIBS="-lnsl $LIBS" fi # SVR4 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -printf %s "checking for socket in -lsocket... " >&6; } -if test ${ac_cv_lib_socket_socket+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } +if ${ac_cv_lib_socket_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11454,47 +10415,47 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char socket (); int -main (void) +main () { return socket (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes -else $as_nop +else ac_cv_lib_socket_socket=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes; then : LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libs" >&5 -printf %s "checking for --with-libs... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libs" >&5 +$as_echo_n "checking for --with-libs... " >&6; } # Check whether --with-libs was given. -if test ${with_libs+y} -then : +if test "${with_libs+set}" = set; then : withval=$with_libs; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } LIBS="$withval $LIBS" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -11509,12 +10470,11 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -11524,15 +10484,11 @@ else $as_nop for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$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 @@ -11544,11 +10500,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -11557,12 +10513,11 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $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_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. @@ -11572,15 +10527,11 @@ else $as_nop for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$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 @@ -11592,11 +10543,11 @@ esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -11604,8 +10555,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -11617,41 +10568,39 @@ fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } PKG_CONFIG="" fi fi # Check for use of the system expat library -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5 -printf %s "checking for --with-system-expat... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5 +$as_echo_n "checking for --with-system-expat... " >&6; } # Check whether --with-system_expat was given. -if test ${with_system_expat+y} -then : +if test "${with_system_expat+set}" = set; then : withval=$with_system_expat; -else $as_nop +else with_system_expat="no" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_system_expat" >&5 -printf "%s\n" "$with_system_expat" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_expat" >&5 +$as_echo "$with_system_expat" >&6; } # Check for use of the system libffi library -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5 -printf %s "checking for --with-system-ffi... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5 +$as_echo_n "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. -if test ${with_system_ffi+y} -then : +if test "${with_system_ffi+set}" = set; then : withval=$with_system_ffi; fi @@ -11668,15 +10617,15 @@ then as_fn_error $? "--with-system-ffi accepts no arguments" "$LINENO" 5 ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5 -printf "%s\n" "$with_system_ffi" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5 +$as_echo "$with_system_ffi" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } if test "$with_system_ffi" != "" then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with(out)-system-ffi is ignored on this platform" >&5 -printf "%s\n" "$as_me: WARNING: --with(out)-system-ffi is ignored on this platform" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with(out)-system-ffi is ignored on this platform" >&5 +$as_echo "$as_me: WARNING: --with(out)-system-ffi is ignored on this platform" >&2;} fi with_system_ffi="yes" fi @@ -11689,30 +10638,28 @@ fi # Check for use of the system libmpdec library -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-system-libmpdec" >&5 -printf %s "checking for --with-system-libmpdec... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-libmpdec" >&5 +$as_echo_n "checking for --with-system-libmpdec... " >&6; } # Check whether --with-system_libmpdec was given. -if test ${with_system_libmpdec+y} -then : +if test "${with_system_libmpdec+set}" = set; then : withval=$with_system_libmpdec; -else $as_nop +else with_system_libmpdec="no" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_system_libmpdec" >&5 -printf "%s\n" "$with_system_libmpdec" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_libmpdec" >&5 +$as_echo "$with_system_libmpdec" >&6; } # Check whether _decimal should use a coroutine-local or thread-local context -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-decimal-contextvar" >&5 -printf %s "checking for --with-decimal-contextvar... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-decimal-contextvar" >&5 +$as_echo_n "checking for --with-decimal-contextvar... " >&6; } # Check whether --with-decimal_contextvar was given. -if test ${with_decimal_contextvar+y} -then : +if test "${with_decimal_contextvar+set}" = set; then : withval=$with_decimal_contextvar; -else $as_nop +else with_decimal_contextvar="yes" fi @@ -11720,57 +10667,54 @@ fi if test "$with_decimal_contextvar" != "no" then -printf "%s\n" "#define WITH_DECIMAL_CONTEXTVAR 1" >>confdefs.h +$as_echo "#define WITH_DECIMAL_CONTEXTVAR 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_decimal_contextvar" >&5 -printf "%s\n" "$with_decimal_contextvar" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_decimal_contextvar" >&5 +$as_echo "$with_decimal_contextvar" >&6; } # Check for support for loadable sqlite extensions -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-loadable-sqlite-extensions" >&5 -printf %s "checking for --enable-loadable-sqlite-extensions... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-loadable-sqlite-extensions" >&5 +$as_echo_n "checking for --enable-loadable-sqlite-extensions... " >&6; } # Check whether --enable-loadable-sqlite-extensions was given. -if test ${enable_loadable_sqlite_extensions+y} -then : +if test "${enable_loadable_sqlite_extensions+set}" = set; then : enableval=$enable_loadable_sqlite_extensions; -else $as_nop +else enable_loadable_sqlite_extensions="no" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_loadable_sqlite_extensions" >&5 -printf "%s\n" "$enable_loadable_sqlite_extensions" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_loadable_sqlite_extensions" >&5 +$as_echo "$enable_loadable_sqlite_extensions" >&6; } # Check for --with-tcltk-includes=path and --with-tcltk-libs=path -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-includes" >&5 -printf %s "checking for --with-tcltk-includes... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-includes" >&5 +$as_echo_n "checking for --with-tcltk-includes... " >&6; } # Check whether --with-tcltk-includes was given. -if test ${with_tcltk_includes+y} -then : +if test "${with_tcltk_includes+set}" = set; then : withval=$with_tcltk_includes; -else $as_nop +else with_tcltk_includes="default" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_includes" >&5 -printf "%s\n" "$with_tcltk_includes" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-libs" >&5 -printf %s "checking for --with-tcltk-libs... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_includes" >&5 +$as_echo "$with_tcltk_includes" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-libs" >&5 +$as_echo_n "checking for --with-tcltk-libs... " >&6; } # Check whether --with-tcltk-libs was given. -if test ${with_tcltk_libs+y} -then : +if test "${with_tcltk_libs+set}" = set; then : withval=$with_tcltk_libs; -else $as_nop +else with_tcltk_libs="default" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_libs" >&5 -printf "%s\n" "$with_tcltk_libs" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_libs" >&5 +$as_echo "$with_tcltk_libs" >&6; } if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault then if test "x$with_tcltk_includes" != "x$with_tcltk_libs" @@ -11790,12 +10734,11 @@ else fi # Check for --with-dbmliborder -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-dbmliborder" >&5 -printf %s "checking for --with-dbmliborder... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dbmliborder" >&5 +$as_echo_n "checking for --with-dbmliborder... " >&6; } # Check whether --with-dbmliborder was given. -if test ${with_dbmliborder+y} -then : +if test "${with_dbmliborder+set}" = set; then : withval=$with_dbmliborder; if test x$with_dbmliborder = xyes then @@ -11810,8 +10753,8 @@ else fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_dbmliborder" >&5 -printf "%s\n" "$with_dbmliborder" >&6; } +{ $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. @@ -11820,7 +10763,7 @@ printf "%s\n" "$with_dbmliborder" >&6; } if test "$ac_cv_pthread_is_default" = yes then # Defining _REENTRANT on system with POSIX threads should not hurt. - printf "%s\n" "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h posix_threads=yes if test "$ac_sys_system" = "SunOS"; then @@ -11855,8 +10798,8 @@ else # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _POSIX_THREADS in unistd.h" >&5 -printf %s "checking for _POSIX_THREADS in unistd.h... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _POSIX_THREADS in unistd.h" >&5 +$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11867,26 +10810,25 @@ yes _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : unistd_defines_pthreads=yes -else $as_nop +else unistd_defines_pthreads=no fi -rm -rf conftest* +rm -f conftest* - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unistd_defines_pthreads" >&5 -printf "%s\n" "$unistd_defines_pthreads" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unistd_defines_pthreads" >&5 +$as_echo "$unistd_defines_pthreads" >&6; } - printf "%s\n" "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -printf %s "checking for pthread_create in -lpthread... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11895,7 +10837,7 @@ printf %s "checking for pthread_create in -lpthread... " >&6; } void * start_routine (void *arg) { exit (0); } int -main (void) +main () { pthread_create (NULL, NULL, start_routine, NULL) @@ -11903,30 +10845,27 @@ pthread_create (NULL, NULL, start_routine, NULL) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } posix_threads=yes -else $as_nop +else LIBS=$_libs ac_fn_c_check_func "$LINENO" "pthread_detach" "ac_cv_func_pthread_detach" -if test "x$ac_cv_func_pthread_detach" = xyes -then : +if test "x$ac_cv_func_pthread_detach" = xyes; then : posix_threads=yes -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5 -printf %s "checking for pthread_create in -lpthreads... " >&6; } -if test ${ac_cv_lib_pthreads_pthread_create+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5 +$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } +if ${ac_cv_lib_pthreads_pthread_create+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11935,41 +10874,41 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_create (); int -main (void) +main () { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_create=yes -else $as_nop +else ac_cv_lib_pthreads_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5 -printf "%s\n" "$ac_cv_lib_pthreads_pthread_create" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_create" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then : posix_threads=yes LIBS="$LIBS -lpthreads" -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 -printf %s "checking for pthread_create in -lc_r... " >&6; } -if test ${ac_cv_lib_c_r_pthread_create+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 +$as_echo_n "checking for pthread_create in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_pthread_create+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11978,41 +10917,41 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_create (); int -main (void) +main () { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_create=yes -else $as_nop +else ac_cv_lib_c_r_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 -printf "%s\n" "$ac_cv_lib_c_r_pthread_create" >&6; } -if test "x$ac_cv_lib_c_r_pthread_create" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then : posix_threads=yes LIBS="$LIBS -lc_r" -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system in -lpthread" >&5 -printf %s "checking for __pthread_create_system in -lpthread... " >&6; } -if test ${ac_cv_lib_pthread___pthread_create_system+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system in -lpthread" >&5 +$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } +if ${ac_cv_lib_pthread___pthread_create_system+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12021,41 +10960,41 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char __pthread_create_system (); int -main (void) +main () { return __pthread_create_system (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread___pthread_create_system=yes -else $as_nop +else ac_cv_lib_pthread___pthread_create_system=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -printf "%s\n" "$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then : posix_threads=yes LIBS="$LIBS -lpthread" -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lcma" >&5 -printf %s "checking for pthread_create in -lcma... " >&6; } -if test ${ac_cv_lib_cma_pthread_create+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lcma" >&5 +$as_echo_n "checking for pthread_create in -lcma... " >&6; } +if ${ac_cv_lib_cma_pthread_create+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12064,34 +11003,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_create (); int -main (void) +main () { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cma_pthread_create=yes -else $as_nop +else ac_cv_lib_cma_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cma_pthread_create" >&5 -printf "%s\n" "$ac_cv_lib_cma_pthread_create" >&6; } -if test "x$ac_cv_lib_cma_pthread_create" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cma_pthread_create" >&5 +$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = xyes; then : posix_threads=yes LIBS="$LIBS -lcma" -else $as_nop +else as_fn_error $? "could not find pthreads on your system" "$LINENO" 5 @@ -12107,15 +11047,14 @@ fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc" >&5 -printf %s "checking for usconfig in -lmpc... " >&6; } -if test ${ac_cv_lib_mpc_usconfig+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc" >&5 +$as_echo_n "checking for usconfig in -lmpc... " >&6; } +if ${ac_cv_lib_mpc_usconfig+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12124,29 +11063,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char usconfig (); int -main (void) +main () { return usconfig (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mpc_usconfig=yes -else $as_nop +else ac_cv_lib_mpc_usconfig=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig" >&5 -printf "%s\n" "$ac_cv_lib_mpc_usconfig" >&6; } -if test "x$ac_cv_lib_mpc_usconfig" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig" >&5 +$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = xyes; then : LIBS="$LIBS -lmpc" @@ -12158,36 +11098,34 @@ fi if test "$posix_threads" = "yes"; then if test "$unistd_defines_pthreads" = "no"; then -printf "%s\n" "#define _POSIX_THREADS 1" >>confdefs.h +$as_echo "#define _POSIX_THREADS 1" >>confdefs.h fi # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. case $ac_sys_system/$ac_sys_release in SunOS/5.6) -printf "%s\n" "#define HAVE_PTHREAD_DESTRUCTOR 1" >>confdefs.h +$as_echo "#define HAVE_PTHREAD_DESTRUCTOR 1" >>confdefs.h ;; SunOS/5.8) -printf "%s\n" "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h ;; AIX/*) -printf "%s\n" "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -printf %s "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } - if test ${ac_cv_pthread_system_supported+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } + if ${ac_cv_pthread_system_supported+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_pthread_system_supported=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12205,10 +11143,9 @@ else $as_nop return (0); } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_pthread_system_supported=yes -else $as_nop +else ac_cv_pthread_system_supported=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -12218,61 +11155,64 @@ fi fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_system_supported" >&5 -printf "%s\n" "$ac_cv_pthread_system_supported" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_system_supported" >&5 +$as_echo "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then -printf "%s\n" "#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1" >>confdefs.h +$as_echo "#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1" >>confdefs.h fi - - for ac_func in pthread_sigmask + for ac_func in pthread_sigmask do : ac_fn_c_check_func "$LINENO" "pthread_sigmask" "ac_cv_func_pthread_sigmask" -if test "x$ac_cv_func_pthread_sigmask" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h +if test "x$ac_cv_func_pthread_sigmask" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_SIGMASK 1 +_ACEOF case $ac_sys_system in CYGWIN*) -printf "%s\n" "#define HAVE_BROKEN_PTHREAD_SIGMASK 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_PTHREAD_SIGMASK 1" >>confdefs.h ;; esac fi - done - ac_fn_c_check_func "$LINENO" "pthread_getcpuclockid" "ac_cv_func_pthread_getcpuclockid" -if test "x$ac_cv_func_pthread_getcpuclockid" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_GETCPUCLOCKID 1" >>confdefs.h + + for ac_func in pthread_getcpuclockid +do : + ac_fn_c_check_func "$LINENO" "pthread_getcpuclockid" "ac_cv_func_pthread_getcpuclockid" +if test "x$ac_cv_func_pthread_getcpuclockid" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_GETCPUCLOCKID 1 +_ACEOF fi +done fi # Check for enable-ipv6 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if --enable-ipv6 is specified" >&5 -printf %s "checking if --enable-ipv6 is specified... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-ipv6 is specified" >&5 +$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. -if test ${enable_ipv6+y} -then : +if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; case "$enableval" in no) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ipv6=no ;; - *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - printf "%s\n" "#define ENABLE_IPV6 1" >>confdefs.h + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define ENABLE_IPV6 1" >>confdefs.h ipv6=yes ;; esac -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12280,39 +11220,38 @@ else $as_nop #include #include int -main (void) +main () { int domain = AF_INET6; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ipv6" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5 -printf %s "checking if RFC2553 API is available... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5 +$as_echo_n "checking if RFC2553 API is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { struct sockaddr_in6 x; x.sin6_scope_id; @@ -12321,25 +11260,24 @@ struct sockaddr_in6 x; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - printf "%s\n" "#define ENABLE_IPV6 1" >>confdefs.h + $as_echo "#define ENABLE_IPV6 1" >>confdefs.h fi @@ -12351,8 +11289,8 @@ ipv6lib=none ipv6trylibc=no if test "$ipv6" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5 -printf %s "checking ipv6 stack type... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5 +$as_echo_n "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -12366,11 +11304,10 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i fi -rm -rf conftest* +rm -f conftest* ;; kame) @@ -12383,14 +11320,13 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6lib=inet6 ipv6libdir=/usr/local/v6/lib ipv6trylibc=yes fi -rm -rf conftest* +rm -f conftest* ;; linux-glibc) @@ -12403,12 +11339,11 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6trylibc=yes fi -rm -rf conftest* +rm -f conftest* ;; linux-inet6) @@ -12437,13 +11372,12 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi -rm -rf conftest* +rm -f conftest* ;; v6d) @@ -12456,14 +11390,13 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6lib=v6; ipv6libdir=/usr/local/v6/lib; BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" fi -rm -rf conftest* +rm -f conftest* ;; zeta) @@ -12476,13 +11409,12 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 -then : + $EGREP "yes" >/dev/null 2>&1; then : ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi -rm -rf conftest* +rm -f conftest* ;; esac @@ -12490,8 +11422,8 @@ rm -rf conftest* break fi done - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5 -printf "%s\n" "$ipv6type" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5 +$as_echo "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -12510,75 +11442,72 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_FD_FRAMES" >&5 -printf %s "checking for CAN_RAW_FD_FRAMES... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_FD_FRAMES" >&5 +$as_echo_n "checking for CAN_RAW_FD_FRAMES... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* CAN_RAW_FD_FRAMES available check */ #include int -main (void) +main () { int can_raw_fd_frames = CAN_RAW_FD_FRAMES; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1" >>confdefs.h +$as_echo "#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_JOIN_FILTERS" >&5 -printf %s "checking for CAN_RAW_JOIN_FILTERS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_JOIN_FILTERS" >&5 +$as_echo_n "checking for CAN_RAW_JOIN_FILTERS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { int can_raw_join_filters = CAN_RAW_JOIN_FILTERS; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1" >>confdefs.h +$as_echo "#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-doc-strings" >&5 -printf %s "checking for --with-doc-strings... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-doc-strings" >&5 +$as_echo_n "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. -if test ${with_doc_strings+y} -then : +if test "${with_doc_strings+set}" = set; then : withval=$with_doc_strings; fi @@ -12589,19 +11518,18 @@ fi if test "$with_doc_strings" != "no" then -printf "%s\n" "#define WITH_DOC_STRINGS 1" >>confdefs.h +$as_echo "#define WITH_DOC_STRINGS 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_doc_strings" >&5 -printf "%s\n" "$with_doc_strings" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_doc_strings" >&5 +$as_echo "$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc" >&5 -printf %s "checking for --with-pymalloc... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc" >&5 +$as_echo_n "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. -if test ${with_pymalloc+y} -then : +if test "${with_pymalloc+set}" = set; then : withval=$with_pymalloc; fi @@ -12613,19 +11541,18 @@ fi if test "$with_pymalloc" != "no" then -printf "%s\n" "#define WITH_PYMALLOC 1" >>confdefs.h +$as_echo "#define WITH_PYMALLOC 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 -printf "%s\n" "$with_pymalloc" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 +$as_echo "$with_pymalloc" >&6; } # Check for --with-c-locale-coercion -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 -printf %s "checking for --with-c-locale-coercion... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 +$as_echo_n "checking for --with-c-locale-coercion... " >&6; } # Check whether --with-c-locale-coercion was given. -if test ${with_c_locale_coercion+y} -then : +if test "${with_c_locale_coercion+set}" = set; then : withval=$with_c_locale_coercion; fi @@ -12637,55 +11564,53 @@ fi if test "$with_c_locale_coercion" != "no" then -printf "%s\n" "#define PY_COERCE_C_LOCALE 1" >>confdefs.h +$as_echo "#define PY_COERCE_C_LOCALE 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 -printf "%s\n" "$with_c_locale_coercion" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 +$as_echo "$with_c_locale_coercion" >&6; } # Check for Valgrind support -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 -printf %s "checking for --with-valgrind... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 +$as_echo_n "checking for --with-valgrind... " >&6; } # Check whether --with-valgrind was given. -if test ${with_valgrind+y} -then : +if test "${with_valgrind+set}" = set; then : withval=$with_valgrind; -else $as_nop +else with_valgrind=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_valgrind" >&5 -printf "%s\n" "$with_valgrind" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_valgrind" >&5 +$as_echo "$with_valgrind" >&6; } if test "$with_valgrind" != no; then - ac_fn_c_check_header_compile "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_valgrind_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" +if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then : -printf "%s\n" "#define WITH_VALGRIND 1" >>confdefs.h +$as_echo "#define WITH_VALGRIND 1" >>confdefs.h -else $as_nop +else as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 fi + OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi # Check for DTrace support -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace" >&5 -printf %s "checking for --with-dtrace... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace" >&5 +$as_echo_n "checking for --with-dtrace... " >&6; } # Check whether --with-dtrace was given. -if test ${with_dtrace+y} -then : +if test "${with_dtrace+set}" = set; then : withval=$with_dtrace; -else $as_nop +else with_dtrace=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5 -printf "%s\n" "$with_dtrace" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5 +$as_echo "$with_dtrace" >&6; } @@ -12699,12 +11624,11 @@ if test "$with_dtrace" = "yes" then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DTRACE+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DTRACE+:} false; then : + $as_echo_n "(cached) " >&6 +else case $DTRACE in [\\/]* | ?:[\\/]*) ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. @@ -12714,15 +11638,11 @@ else $as_nop for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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_DTRACE="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DTRACE="$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 @@ -12735,11 +11655,11 @@ esac fi DTRACE=$ac_cv_path_DTRACE if test -n "$DTRACE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -printf "%s\n" "$DTRACE" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 +$as_echo "$DTRACE" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -12747,7 +11667,7 @@ fi as_fn_error $? "dtrace command not found on \$PATH" "$LINENO" 5 fi -printf "%s\n" "#define WITH_DTRACE 1" >>confdefs.h +$as_echo "#define WITH_DTRACE 1" >>confdefs.h DTRACE_HEADERS="Include/pydtrace_probes.h" @@ -12755,20 +11675,19 @@ printf "%s\n" "#define WITH_DTRACE 1" >>confdefs.h # linked into the binary. Correspondingly, dtrace(1) is missing the ELF # generation flag '-G'. We check for presence of this flag, rather than # hardcoding support by OS, in the interest of robustness. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether DTrace probes require linking" >&5 -printf %s "checking whether DTrace probes require linking... " >&6; } -if test ${ac_cv_dtrace_link+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DTrace probes require linking" >&5 +$as_echo_n "checking whether DTrace probes require linking... " >&6; } +if ${ac_cv_dtrace_link+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_cv_dtrace_link=no echo 'BEGIN{}' > conftest.d "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \ ac_cv_dtrace_link=yes fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dtrace_link" >&5 -printf "%s\n" "$ac_cv_dtrace_link" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dtrace_link" >&5 +$as_echo "$ac_cv_dtrace_link" >&6; } if test "$ac_cv_dtrace_link" = "yes"; then DTRACE_OBJS="Python/pydtrace.o" fi @@ -12780,19 +11699,23 @@ DLINCLDIR=. # the dlopen() function means we might want to use dynload_shlib.o. some # platforms have dlopen(), but don't want to use it. -ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes -then : - printf "%s\n" "#define HAVE_DLOPEN 1" >>confdefs.h +for ac_func in dlopen +do : + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLOPEN 1 +_ACEOF fi +done # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking DYNLOADFILE" >&5 -printf %s "checking DYNLOADFILE... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking DYNLOADFILE" >&5 +$as_echo_n "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -12807,20 +11730,20 @@ then ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DYNLOADFILE" >&5 -printf "%s\n" "$DYNLOADFILE" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DYNLOADFILE" >&5 +$as_echo "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then -printf "%s\n" "#define HAVE_DYNAMIC_LOADING 1" >>confdefs.h +$as_echo "#define HAVE_DYNAMIC_LOADING 1" >>confdefs.h fi # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MACHDEP_OBJS" >&5 -printf %s "checking MACHDEP_OBJS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MACHDEP_OBJS" >&5 +$as_echo_n "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs @@ -12828,1315 +11751,282 @@ else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi if test -z "$MACHDEP_OBJS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACHDEP_OBJS" >&5 -printf "%s\n" "$MACHDEP_OBJS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACHDEP_OBJS" >&5 +$as_echo "$MACHDEP_OBJS" >&6; } fi # checks for library functions -ac_fn_c_check_func "$LINENO" "alarm" "ac_cv_func_alarm" -if test "x$ac_cv_func_alarm" = xyes -then : - printf "%s\n" "#define HAVE_ALARM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "accept4" "ac_cv_func_accept4" -if test "x$ac_cv_func_accept4" = xyes -then : - printf "%s\n" "#define HAVE_ACCEPT4 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setitimer" "ac_cv_func_setitimer" -if test "x$ac_cv_func_setitimer" = xyes -then : - printf "%s\n" "#define HAVE_SETITIMER 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getitimer" "ac_cv_func_getitimer" -if test "x$ac_cv_func_getitimer" = xyes -then : - printf "%s\n" "#define HAVE_GETITIMER 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" -if test "x$ac_cv_func_bind_textdomain_codeset" = xyes -then : - printf "%s\n" "#define HAVE_BIND_TEXTDOMAIN_CODESET 1" >>confdefs.h +for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ + clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \ + explicit_memset faccessat fchmod fchmodat fchown fchownat \ + fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ + futimens futimes gai_strerror getentropy \ + getgrgid_r getgrnam_r \ + getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ + getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \ + if_nameindex \ + initgroups kill killpg lchown lockf linkat lstat lutimes mmap \ + memrchr mbrtowc mkdirat mkfifo \ + madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ + posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \ + pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \ + readlink readlinkat readv realpath renameat \ + sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \ + setgid sethostname \ + setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \ + sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \ + sched_rr_get_interval \ + sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \ + sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \ + sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ + truncate uname unlinkat utimensat utimes vfork waitid waitpid wait3 wait4 \ + wcscoll wcsftime wcsxfrm wmemcmp writev _getpty rtpSpawn +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi -ac_fn_c_check_func "$LINENO" "chown" "ac_cv_func_chown" -if test "x$ac_cv_func_chown" = xyes -then : - printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h +done -fi -ac_fn_c_check_func "$LINENO" "clock" "ac_cv_func_clock" -if test "x$ac_cv_func_clock" = xyes -then : - printf "%s\n" "#define HAVE_CLOCK 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "confstr" "ac_cv_func_confstr" -if test "x$ac_cv_func_confstr" = xyes -then : - printf "%s\n" "#define HAVE_CONFSTR 1" >>confdefs.h +# Force lchmod off for Linux. Linux disallows changing the mode of symbolic +# links. Some libc implementations have a stub lchmod implementation that always +# returns an error. +if test "$MACHDEP" != linux; then + for ac_func in lchmod +do : + ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod" +if test "x$ac_cv_func_lchmod" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LCHMOD 1 +_ACEOF fi -ac_fn_c_check_func "$LINENO" "close_range" "ac_cv_func_close_range" -if test "x$ac_cv_func_close_range" = xyes -then : - printf "%s\n" "#define HAVE_CLOSE_RANGE 1" >>confdefs.h +done fi -ac_fn_c_check_func "$LINENO" "copy_file_range" "ac_cv_func_copy_file_range" -if test "x$ac_cv_func_copy_file_range" = xyes -then : - printf "%s\n" "#define HAVE_COPY_FILE_RANGE 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "ctermid" "ac_cv_func_ctermid" -if test "x$ac_cv_func_ctermid" = xyes -then : - printf "%s\n" "#define HAVE_CTERMID 1" >>confdefs.h +ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include + #include +" +if test "x$ac_cv_have_decl_dirfd" = xyes; then : -fi -ac_fn_c_check_func "$LINENO" "dup3" "ac_cv_func_dup3" -if test "x$ac_cv_func_dup3" = xyes -then : - printf "%s\n" "#define HAVE_DUP3 1" >>confdefs.h +$as_echo "#define HAVE_DIRFD 1" >>confdefs.h fi -ac_fn_c_check_func "$LINENO" "execv" "ac_cv_func_execv" -if test "x$ac_cv_func_execv" = xyes -then : - printf "%s\n" "#define HAVE_EXECV 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero" -if test "x$ac_cv_func_explicit_bzero" = xyes -then : - printf "%s\n" "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "explicit_memset" "ac_cv_func_explicit_memset" -if test "x$ac_cv_func_explicit_memset" = xyes -then : - printf "%s\n" "#define HAVE_EXPLICIT_MEMSET 1" >>confdefs.h +# For some functions, having a definition is not sufficient, since +# we want to take their address. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for chroot" >&5 +$as_echo_n "checking for chroot... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +void *x=chroot + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi -ac_fn_c_check_func "$LINENO" "faccessat" "ac_cv_func_faccessat" -if test "x$ac_cv_func_faccessat" = xyes -then : - printf "%s\n" "#define HAVE_FACCESSAT 1" >>confdefs.h +$as_echo "#define HAVE_CHROOT 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "fchmod" "ac_cv_func_fchmod" -if test "x$ac_cv_func_fchmod" = xyes -then : - printf "%s\n" "#define HAVE_FCHMOD 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_fn_c_check_func "$LINENO" "fchmodat" "ac_cv_func_fchmodat" -if test "x$ac_cv_func_fchmodat" = xyes -then : - printf "%s\n" "#define HAVE_FCHMODAT 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for link" >&5 +$as_echo_n "checking for link... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +void *x=link + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi -ac_fn_c_check_func "$LINENO" "fchown" "ac_cv_func_fchown" -if test "x$ac_cv_func_fchown" = xyes -then : - printf "%s\n" "#define HAVE_FCHOWN 1" >>confdefs.h +$as_echo "#define HAVE_LINK 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "fchownat" "ac_cv_func_fchownat" -if test "x$ac_cv_func_fchownat" = xyes -then : - printf "%s\n" "#define HAVE_FCHOWNAT 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_fn_c_check_func "$LINENO" "fdwalk" "ac_cv_func_fdwalk" -if test "x$ac_cv_func_fdwalk" = xyes -then : - printf "%s\n" "#define HAVE_FDWALK 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlink" >&5 +$as_echo_n "checking for symlink... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +void *x=symlink + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi -ac_fn_c_check_func "$LINENO" "fexecve" "ac_cv_func_fexecve" -if test "x$ac_cv_func_fexecve" = xyes -then : - printf "%s\n" "#define HAVE_FEXECVE 1" >>confdefs.h +$as_echo "#define HAVE_SYMLINK 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "fdopendir" "ac_cv_func_fdopendir" -if test "x$ac_cv_func_fdopendir" = xyes -then : - printf "%s\n" "#define HAVE_FDOPENDIR 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" -if test "x$ac_cv_func_fork" = xyes -then : - printf "%s\n" "#define HAVE_FORK 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fchdir" >&5 +$as_echo_n "checking for fchdir... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +void *x=fchdir + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi -ac_fn_c_check_func "$LINENO" "fpathconf" "ac_cv_func_fpathconf" -if test "x$ac_cv_func_fpathconf" = xyes -then : - printf "%s\n" "#define HAVE_FPATHCONF 1" >>confdefs.h +$as_echo "#define HAVE_FCHDIR 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "fstatat" "ac_cv_func_fstatat" -if test "x$ac_cv_func_fstatat" = xyes -then : - printf "%s\n" "#define HAVE_FSTATAT 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_fn_c_check_func "$LINENO" "ftime" "ac_cv_func_ftime" -if test "x$ac_cv_func_ftime" = xyes -then : - printf "%s\n" "#define HAVE_FTIME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" -if test "x$ac_cv_func_ftruncate" = xyes -then : - printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimesat" "ac_cv_func_futimesat" -if test "x$ac_cv_func_futimesat" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMESAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens" -if test "x$ac_cv_func_futimens" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMENS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimes" "ac_cv_func_futimes" -if test "x$ac_cv_func_futimes" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMES 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "gai_strerror" "ac_cv_func_gai_strerror" -if test "x$ac_cv_func_gai_strerror" = xyes -then : - printf "%s\n" "#define HAVE_GAI_STRERROR 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy" -if test "x$ac_cv_func_getentropy" = xyes -then : - printf "%s\n" "#define HAVE_GETENTROPY 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r" -if test "x$ac_cv_func_getgrgid_r" = xyes -then : - printf "%s\n" "#define HAVE_GETGRGID_R 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getgrnam_r" "ac_cv_func_getgrnam_r" -if test "x$ac_cv_func_getgrnam_r" = xyes -then : - printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist" -if test "x$ac_cv_func_getgrouplist" = xyes -then : - printf "%s\n" "#define HAVE_GETGROUPLIST 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups" -if test "x$ac_cv_func_getgroups" = xyes -then : - printf "%s\n" "#define HAVE_GETGROUPS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getlogin" "ac_cv_func_getlogin" -if test "x$ac_cv_func_getlogin" = xyes -then : - printf "%s\n" "#define HAVE_GETLOGIN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg" -if test "x$ac_cv_func_getloadavg" = xyes -then : - printf "%s\n" "#define HAVE_GETLOADAVG 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpeername" "ac_cv_func_getpeername" -if test "x$ac_cv_func_getpeername" = xyes -then : - printf "%s\n" "#define HAVE_GETPEERNAME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpgid" "ac_cv_func_getpgid" -if test "x$ac_cv_func_getpgid" = xyes -then : - printf "%s\n" "#define HAVE_GETPGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpid" "ac_cv_func_getpid" -if test "x$ac_cv_func_getpid" = xyes -then : - printf "%s\n" "#define HAVE_GETPID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpriority" "ac_cv_func_getpriority" -if test "x$ac_cv_func_getpriority" = xyes -then : - printf "%s\n" "#define HAVE_GETPRIORITY 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getresuid" "ac_cv_func_getresuid" -if test "x$ac_cv_func_getresuid" = xyes -then : - printf "%s\n" "#define HAVE_GETRESUID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getresgid" "ac_cv_func_getresgid" -if test "x$ac_cv_func_getresgid" = xyes -then : - printf "%s\n" "#define HAVE_GETRESGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpwent" "ac_cv_func_getpwent" -if test "x$ac_cv_func_getpwent" = xyes -then : - printf "%s\n" "#define HAVE_GETPWENT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpwnam_r" "ac_cv_func_getpwnam_r" -if test "x$ac_cv_func_getpwnam_r" = xyes -then : - printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" -if test "x$ac_cv_func_getpwuid_r" = xyes -then : - printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getspnam" "ac_cv_func_getspnam" -if test "x$ac_cv_func_getspnam" = xyes -then : - printf "%s\n" "#define HAVE_GETSPNAM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getspent" "ac_cv_func_getspent" -if test "x$ac_cv_func_getspent" = xyes -then : - printf "%s\n" "#define HAVE_GETSPENT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getsid" "ac_cv_func_getsid" -if test "x$ac_cv_func_getsid" = xyes -then : - printf "%s\n" "#define HAVE_GETSID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd" -if test "x$ac_cv_func_getwd" = xyes -then : - printf "%s\n" "#define HAVE_GETWD 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "if_nameindex" "ac_cv_func_if_nameindex" -if test "x$ac_cv_func_if_nameindex" = xyes -then : - printf "%s\n" "#define HAVE_IF_NAMEINDEX 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups" -if test "x$ac_cv_func_initgroups" = xyes -then : - printf "%s\n" "#define HAVE_INITGROUPS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "kill" "ac_cv_func_kill" -if test "x$ac_cv_func_kill" = xyes -then : - printf "%s\n" "#define HAVE_KILL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "killpg" "ac_cv_func_killpg" -if test "x$ac_cv_func_killpg" = xyes -then : - printf "%s\n" "#define HAVE_KILLPG 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown" -if test "x$ac_cv_func_lchown" = xyes -then : - printf "%s\n" "#define HAVE_LCHOWN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "lockf" "ac_cv_func_lockf" -if test "x$ac_cv_func_lockf" = xyes -then : - printf "%s\n" "#define HAVE_LOCKF 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "linkat" "ac_cv_func_linkat" -if test "x$ac_cv_func_linkat" = xyes -then : - printf "%s\n" "#define HAVE_LINKAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat" -if test "x$ac_cv_func_lstat" = xyes -then : - printf "%s\n" "#define HAVE_LSTAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "lutimes" "ac_cv_func_lutimes" -if test "x$ac_cv_func_lutimes" = xyes -then : - printf "%s\n" "#define HAVE_LUTIMES 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -if test "x$ac_cv_func_mmap" = xyes -then : - printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" -if test "x$ac_cv_func_memrchr" = xyes -then : - printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" -if test "x$ac_cv_func_mbrtowc" = xyes -then : - printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mkdirat" "ac_cv_func_mkdirat" -if test "x$ac_cv_func_mkdirat" = xyes -then : - printf "%s\n" "#define HAVE_MKDIRAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" -if test "x$ac_cv_func_mkfifo" = xyes -then : - printf "%s\n" "#define HAVE_MKFIFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "madvise" "ac_cv_func_madvise" -if test "x$ac_cv_func_madvise" = xyes -then : - printf "%s\n" "#define HAVE_MADVISE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mkfifoat" "ac_cv_func_mkfifoat" -if test "x$ac_cv_func_mkfifoat" = xyes -then : - printf "%s\n" "#define HAVE_MKFIFOAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mknod" "ac_cv_func_mknod" -if test "x$ac_cv_func_mknod" = xyes -then : - printf "%s\n" "#define HAVE_MKNOD 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mknodat" "ac_cv_func_mknodat" -if test "x$ac_cv_func_mknodat" = xyes -then : - printf "%s\n" "#define HAVE_MKNODAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" -if test "x$ac_cv_func_mktime" = xyes -then : - printf "%s\n" "#define HAVE_MKTIME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mremap" "ac_cv_func_mremap" -if test "x$ac_cv_func_mremap" = xyes -then : - printf "%s\n" "#define HAVE_MREMAP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice" -if test "x$ac_cv_func_nice" = xyes -then : - printf "%s\n" "#define HAVE_NICE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "openat" "ac_cv_func_openat" -if test "x$ac_cv_func_openat" = xyes -then : - printf "%s\n" "#define HAVE_OPENAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pathconf" "ac_cv_func_pathconf" -if test "x$ac_cv_func_pathconf" = xyes -then : - printf "%s\n" "#define HAVE_PATHCONF 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pause" "ac_cv_func_pause" -if test "x$ac_cv_func_pause" = xyes -then : - printf "%s\n" "#define HAVE_PAUSE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" -if test "x$ac_cv_func_pipe2" = xyes -then : - printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "plock" "ac_cv_func_plock" -if test "x$ac_cv_func_plock" = xyes -then : - printf "%s\n" "#define HAVE_PLOCK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" -if test "x$ac_cv_func_poll" = xyes -then : - printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" -if test "x$ac_cv_func_posix_fallocate" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" -if test "x$ac_cv_func_posix_fadvise" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn" -if test "x$ac_cv_func_posix_spawn" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_SPAWN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" -if test "x$ac_cv_func_posix_spawnp" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread" -if test "x$ac_cv_func_pread" = xyes -then : - printf "%s\n" "#define HAVE_PREAD 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "preadv" "ac_cv_func_preadv" -if test "x$ac_cv_func_preadv" = xyes -then : - printf "%s\n" "#define HAVE_PREADV 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "preadv2" "ac_cv_func_preadv2" -if test "x$ac_cv_func_preadv2" = xyes -then : - printf "%s\n" "#define HAVE_PREADV2 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pthread_condattr_setclock" "ac_cv_func_pthread_condattr_setclock" -if test "x$ac_cv_func_pthread_condattr_setclock" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pthread_init" "ac_cv_func_pthread_init" -if test "x$ac_cv_func_pthread_init" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_INIT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" -if test "x$ac_cv_func_pthread_kill" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_KILL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pwrite" "ac_cv_func_pwrite" -if test "x$ac_cv_func_pwrite" = xyes -then : - printf "%s\n" "#define HAVE_PWRITE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pwritev" "ac_cv_func_pwritev" -if test "x$ac_cv_func_pwritev" = xyes -then : - printf "%s\n" "#define HAVE_PWRITEV 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pwritev2" "ac_cv_func_pwritev2" -if test "x$ac_cv_func_pwritev2" = xyes -then : - printf "%s\n" "#define HAVE_PWRITEV2 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "readlink" "ac_cv_func_readlink" -if test "x$ac_cv_func_readlink" = xyes -then : - printf "%s\n" "#define HAVE_READLINK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "readlinkat" "ac_cv_func_readlinkat" -if test "x$ac_cv_func_readlinkat" = xyes -then : - printf "%s\n" "#define HAVE_READLINKAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "readv" "ac_cv_func_readv" -if test "x$ac_cv_func_readv" = xyes -then : - printf "%s\n" "#define HAVE_READV 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" -if test "x$ac_cv_func_realpath" = xyes -then : - printf "%s\n" "#define HAVE_REALPATH 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "renameat" "ac_cv_func_renameat" -if test "x$ac_cv_func_renameat" = xyes -then : - printf "%s\n" "#define HAVE_RENAMEAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sem_open" "ac_cv_func_sem_open" -if test "x$ac_cv_func_sem_open" = xyes -then : - printf "%s\n" "#define HAVE_SEM_OPEN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait" -if test "x$ac_cv_func_sem_timedwait" = xyes -then : - printf "%s\n" "#define HAVE_SEM_TIMEDWAIT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sem_getvalue" "ac_cv_func_sem_getvalue" -if test "x$ac_cv_func_sem_getvalue" = xyes -then : - printf "%s\n" "#define HAVE_SEM_GETVALUE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sem_unlink" "ac_cv_func_sem_unlink" -if test "x$ac_cv_func_sem_unlink" = xyes -then : - printf "%s\n" "#define HAVE_SEM_UNLINK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile" -if test "x$ac_cv_func_sendfile" = xyes -then : - printf "%s\n" "#define HAVE_SENDFILE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setegid" "ac_cv_func_setegid" -if test "x$ac_cv_func_setegid" = xyes -then : - printf "%s\n" "#define HAVE_SETEGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "seteuid" "ac_cv_func_seteuid" -if test "x$ac_cv_func_seteuid" = xyes -then : - printf "%s\n" "#define HAVE_SETEUID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setgid" "ac_cv_func_setgid" -if test "x$ac_cv_func_setgid" = xyes -then : - printf "%s\n" "#define HAVE_SETGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sethostname" "ac_cv_func_sethostname" -if test "x$ac_cv_func_sethostname" = xyes -then : - printf "%s\n" "#define HAVE_SETHOSTNAME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" -if test "x$ac_cv_func_setlocale" = xyes -then : - printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setregid" "ac_cv_func_setregid" -if test "x$ac_cv_func_setregid" = xyes -then : - printf "%s\n" "#define HAVE_SETREGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setreuid" "ac_cv_func_setreuid" -if test "x$ac_cv_func_setreuid" = xyes -then : - printf "%s\n" "#define HAVE_SETREUID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid" -if test "x$ac_cv_func_setresuid" = xyes -then : - printf "%s\n" "#define HAVE_SETRESUID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid" -if test "x$ac_cv_func_setresgid" = xyes -then : - printf "%s\n" "#define HAVE_SETRESGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" -if test "x$ac_cv_func_setsid" = xyes -then : - printf "%s\n" "#define HAVE_SETSID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setpgid" "ac_cv_func_setpgid" -if test "x$ac_cv_func_setpgid" = xyes -then : - printf "%s\n" "#define HAVE_SETPGID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setpgrp" "ac_cv_func_setpgrp" -if test "x$ac_cv_func_setpgrp" = xyes -then : - printf "%s\n" "#define HAVE_SETPGRP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setpriority" "ac_cv_func_setpriority" -if test "x$ac_cv_func_setpriority" = xyes -then : - printf "%s\n" "#define HAVE_SETPRIORITY 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setuid" "ac_cv_func_setuid" -if test "x$ac_cv_func_setuid" = xyes -then : - printf "%s\n" "#define HAVE_SETUID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setvbuf" "ac_cv_func_setvbuf" -if test "x$ac_cv_func_setvbuf" = xyes -then : - printf "%s\n" "#define HAVE_SETVBUF 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_get_priority_max" "ac_cv_func_sched_get_priority_max" -if test "x$ac_cv_func_sched_get_priority_max" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_GET_PRIORITY_MAX 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_setaffinity" "ac_cv_func_sched_setaffinity" -if test "x$ac_cv_func_sched_setaffinity" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" -if test "x$ac_cv_func_sched_setscheduler" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_SETSCHEDULER 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_setparam" "ac_cv_func_sched_setparam" -if test "x$ac_cv_func_sched_setparam" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_SETPARAM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_rr_get_interval" "ac_cv_func_sched_rr_get_interval" -if test "x$ac_cv_func_sched_rr_get_interval" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_RR_GET_INTERVAL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" -if test "x$ac_cv_func_sigaction" = xyes -then : - printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigaltstack" "ac_cv_func_sigaltstack" -if test "x$ac_cv_func_sigaltstack" = xyes -then : - printf "%s\n" "#define HAVE_SIGALTSTACK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigfillset" "ac_cv_func_sigfillset" -if test "x$ac_cv_func_sigfillset" = xyes -then : - printf "%s\n" "#define HAVE_SIGFILLSET 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "siginterrupt" "ac_cv_func_siginterrupt" -if test "x$ac_cv_func_siginterrupt" = xyes -then : - printf "%s\n" "#define HAVE_SIGINTERRUPT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigpending" "ac_cv_func_sigpending" -if test "x$ac_cv_func_sigpending" = xyes -then : - printf "%s\n" "#define HAVE_SIGPENDING 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigrelse" "ac_cv_func_sigrelse" -if test "x$ac_cv_func_sigrelse" = xyes -then : - printf "%s\n" "#define HAVE_SIGRELSE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigtimedwait" "ac_cv_func_sigtimedwait" -if test "x$ac_cv_func_sigtimedwait" = xyes -then : - printf "%s\n" "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait" -if test "x$ac_cv_func_sigwait" = xyes -then : - printf "%s\n" "#define HAVE_SIGWAIT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigwaitinfo" "ac_cv_func_sigwaitinfo" -if test "x$ac_cv_func_sigwaitinfo" = xyes -then : - printf "%s\n" "#define HAVE_SIGWAITINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" -if test "x$ac_cv_func_snprintf" = xyes -then : - printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "splice" "ac_cv_func_splice" -if test "x$ac_cv_func_splice" = xyes -then : - printf "%s\n" "#define HAVE_SPLICE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" -if test "x$ac_cv_func_strftime" = xyes -then : - printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" -if test "x$ac_cv_func_strlcpy" = xyes -then : - printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" -if test "x$ac_cv_func_strsignal" = xyes -then : - printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "symlinkat" "ac_cv_func_symlinkat" -if test "x$ac_cv_func_symlinkat" = xyes -then : - printf "%s\n" "#define HAVE_SYMLINKAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sync" "ac_cv_func_sync" -if test "x$ac_cv_func_sync" = xyes -then : - printf "%s\n" "#define HAVE_SYNC 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" -if test "x$ac_cv_func_sysconf" = xyes -then : - printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tcgetpgrp" "ac_cv_func_tcgetpgrp" -if test "x$ac_cv_func_tcgetpgrp" = xyes -then : - printf "%s\n" "#define HAVE_TCGETPGRP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tcsetpgrp" "ac_cv_func_tcsetpgrp" -if test "x$ac_cv_func_tcsetpgrp" = xyes -then : - printf "%s\n" "#define HAVE_TCSETPGRP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tempnam" "ac_cv_func_tempnam" -if test "x$ac_cv_func_tempnam" = xyes -then : - printf "%s\n" "#define HAVE_TEMPNAM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "timegm" "ac_cv_func_timegm" -if test "x$ac_cv_func_timegm" = xyes -then : - printf "%s\n" "#define HAVE_TIMEGM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "times" "ac_cv_func_times" -if test "x$ac_cv_func_times" = xyes -then : - printf "%s\n" "#define HAVE_TIMES 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tmpfile" "ac_cv_func_tmpfile" -if test "x$ac_cv_func_tmpfile" = xyes -then : - printf "%s\n" "#define HAVE_TMPFILE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tmpnam" "ac_cv_func_tmpnam" -if test "x$ac_cv_func_tmpnam" = xyes -then : - printf "%s\n" "#define HAVE_TMPNAM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tmpnam_r" "ac_cv_func_tmpnam_r" -if test "x$ac_cv_func_tmpnam_r" = xyes -then : - printf "%s\n" "#define HAVE_TMPNAM_R 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "truncate" "ac_cv_func_truncate" -if test "x$ac_cv_func_truncate" = xyes -then : - printf "%s\n" "#define HAVE_TRUNCATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" -if test "x$ac_cv_func_uname" = xyes -then : - printf "%s\n" "#define HAVE_UNAME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "unlinkat" "ac_cv_func_unlinkat" -if test "x$ac_cv_func_unlinkat" = xyes -then : - printf "%s\n" "#define HAVE_UNLINKAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "utimensat" "ac_cv_func_utimensat" -if test "x$ac_cv_func_utimensat" = xyes -then : - printf "%s\n" "#define HAVE_UTIMENSAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes" -if test "x$ac_cv_func_utimes" = xyes -then : - printf "%s\n" "#define HAVE_UTIMES 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" -if test "x$ac_cv_func_vfork" = xyes -then : - printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "waitid" "ac_cv_func_waitid" -if test "x$ac_cv_func_waitid" = xyes -then : - printf "%s\n" "#define HAVE_WAITID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" -if test "x$ac_cv_func_waitpid" = xyes -then : - printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3" -if test "x$ac_cv_func_wait3" = xyes -then : - printf "%s\n" "#define HAVE_WAIT3 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "wait4" "ac_cv_func_wait4" -if test "x$ac_cv_func_wait4" = xyes -then : - printf "%s\n" "#define HAVE_WAIT4 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "wcscoll" "ac_cv_func_wcscoll" -if test "x$ac_cv_func_wcscoll" = xyes -then : - printf "%s\n" "#define HAVE_WCSCOLL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "wcsftime" "ac_cv_func_wcsftime" -if test "x$ac_cv_func_wcsftime" = xyes -then : - printf "%s\n" "#define HAVE_WCSFTIME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "wcsxfrm" "ac_cv_func_wcsxfrm" -if test "x$ac_cv_func_wcsxfrm" = xyes -then : - printf "%s\n" "#define HAVE_WCSXFRM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "wmemcmp" "ac_cv_func_wmemcmp" -if test "x$ac_cv_func_wmemcmp" = xyes -then : - printf "%s\n" "#define HAVE_WMEMCMP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "writev" "ac_cv_func_writev" -if test "x$ac_cv_func_writev" = xyes -then : - printf "%s\n" "#define HAVE_WRITEV 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "_getpty" "ac_cv_func__getpty" -if test "x$ac_cv_func__getpty" = xyes -then : - printf "%s\n" "#define HAVE__GETPTY 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "rtpSpawn" "ac_cv_func_rtpSpawn" -if test "x$ac_cv_func_rtpSpawn" = xyes -then : - printf "%s\n" "#define HAVE_RTPSPAWN 1" >>confdefs.h - -fi - - -# Force lchmod off for Linux. Linux disallows changing the mode of symbolic -# links. Some libc implementations have a stub lchmod implementation that always -# returns an error. -if test "$MACHDEP" != linux; then - ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod" -if test "x$ac_cv_func_lchmod" = xyes -then : - printf "%s\n" "#define HAVE_LCHMOD 1" >>confdefs.h - -fi - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 -printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_c_undeclared_builtin_options+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS - ac_cv_c_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); - -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_arg" = x -then : - ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg -fi - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } - case $ac_cv_c_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_c_undeclared_builtin_options='' ;; #( - *) : - ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; -esac - -ac_fn_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include - #include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_dirfd" = xyes -then : - -printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h - -fi - -# For some functions, having a definition is not sufficient, since -# we want to take their address. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for chroot" >&5 -printf %s "checking for chroot... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -void *x=chroot - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -printf "%s\n" "#define HAVE_CHROOT 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for link" >&5 -printf %s "checking for link... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -void *x=link - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -printf "%s\n" "#define HAVE_LINK 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for symlink" >&5 -printf %s "checking for symlink... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -void *x=symlink - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -printf "%s\n" "#define HAVE_SYMLINK 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fchdir" >&5 -printf %s "checking for fchdir... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -void *x=fchdir - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -printf "%s\n" "#define HAVE_FCHDIR 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fsync" >&5 -printf %s "checking for fsync... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fsync" >&5 +$as_echo_n "checking for fsync... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=fsync ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_FSYNC 1" >>confdefs.h +$as_echo "#define HAVE_FSYNC 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fdatasync" >&5 -printf %s "checking for fdatasync... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync" >&5 +$as_echo_n "checking for fdatasync... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=fdatasync ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h +$as_echo "#define HAVE_FDATASYNC 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 -printf %s "checking for epoll... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 +$as_echo_n "checking for epoll... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=epoll_create ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_EPOLL 1" >>confdefs.h +$as_echo "#define HAVE_EPOLL 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for epoll_create1" >&5 -printf %s "checking for epoll_create1... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll_create1" >&5 +$as_echo_n "checking for epoll_create1... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=epoll_create1 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_EPOLL_CREATE1 1" >>confdefs.h +$as_echo "#define HAVE_EPOLL_CREATE1 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for kqueue" >&5 -printf %s "checking for kqueue... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kqueue" >&5 +$as_echo_n "checking for kqueue... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14144,28 +12034,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { int x=kqueue() ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h +$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for prlimit" >&5 -printf %s "checking for prlimit... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prlimit" >&5 +$as_echo_n "checking for prlimit... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14173,55 +12062,53 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { void *x=prlimit ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_PRLIMIT 1" >>confdefs.h +$as_echo "#define HAVE_PRLIMIT 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _dyld_shared_cache_contains_path" >&5 -printf %s "checking for _dyld_shared_cache_contains_path... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _dyld_shared_cache_contains_path" >&5 +$as_echo_n "checking for _dyld_shared_cache_contains_path... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=_dyld_shared_cache_contains_path ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH 1" >>confdefs.h +$as_echo "#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for memfd_create" >&5 -printf %s "checking for memfd_create... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for memfd_create" >&5 +$as_echo_n "checking for memfd_create... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14233,29 +12120,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main (void) +main () { void *x=memfd_create ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h +$as_echo "#define HAVE_MEMFD_CREATE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for eventfd" >&5 -printf %s "checking for eventfd... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for eventfd" >&5 +$as_echo_n "checking for eventfd... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14264,26 +12150,25 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main (void) +main () { int x = eventfd(0, EFD_CLOEXEC) ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h +$as_echo "#define HAVE_EVENTFD 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems (eg. FreeBSD 5), we would find a definition of the # functions ctermid_r, setgroups in the library, but no prototype @@ -14291,46 +12176,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ctermid_r" >&5 -printf %s "checking for ctermid_r... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctermid_r" >&5 +$as_echo_n "checking for ctermid_r... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void* p = ctermid_r ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CTERMID_R 1" >>confdefs.h +$as_echo "#define HAVE_CTERMID_R 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flock declaration" >&5 -printf %s "checking for flock declaration... " >&6; } -if test ${ac_cv_flock_decl+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration" >&5 +$as_echo_n "checking for flock declaration... " >&6; } +if ${ac_cv_flock_decl+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void* p = flock @@ -14338,34 +12221,32 @@ void* p = flock return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_flock_decl=yes -else $as_nop +else ac_cv_flock_decl=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_flock_decl" >&5 -printf "%s\n" "$ac_cv_flock_decl" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_flock_decl" >&5 +$as_echo "$ac_cv_flock_decl" >&6; } if test "x${ac_cv_flock_decl}" = xyes; then - for ac_func in flock do : ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock" -if test "x$ac_cv_func_flock" = xyes -then : - printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd" >&5 -printf %s "checking for flock in -lbsd... " >&6; } -if test ${ac_cv_lib_bsd_flock+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_flock" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FLOCK 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd" >&5 +$as_echo_n "checking for flock in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_flock+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14374,111 +12255,109 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char flock (); int -main (void) +main () { return flock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_flock=yes -else $as_nop +else ac_cv_lib_bsd_flock=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock" >&5 -printf "%s\n" "$ac_cv_lib_bsd_flock" >&6; } -if test "x$ac_cv_lib_bsd_flock" = xyes -then : - printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock" >&5 +$as_echo "$ac_cv_lib_bsd_flock" >&6; } +if test "x$ac_cv_lib_bsd_flock" = xyes; then : + $as_echo "#define HAVE_FLOCK 1" >>confdefs.h -printf "%s\n" "#define FLOCK_NEEDS_LIBBSD 1" >>confdefs.h +$as_echo "#define FLOCK_NEEDS_LIBBSD 1" >>confdefs.h fi fi - done + fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 -printf %s "checking for getpagesize... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void* p = getpagesize ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h +$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken unsetenv" >&5 -printf %s "checking for broken unsetenv... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken unsetenv" >&5 +$as_echo_n "checking for broken unsetenv... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { int res = unsetenv("DUMMY") ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -else $as_nop +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else -printf "%s\n" "#define HAVE_BROKEN_UNSETENV 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_UNSETENV 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext for ac_prog in true do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_TRUE+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_TRUE+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. else @@ -14486,15 +12365,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TRUE="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -14505,11 +12380,11 @@ fi fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TRUE" >&5 -printf "%s\n" "$TRUE" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TRUE" >&5 +$as_echo "$TRUE" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -14518,12 +12393,11 @@ done test -n "$TRUE" || TRUE="/bin/true" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc" >&5 -printf %s "checking for inet_aton in -lc... " >&6; } -if test ${ac_cv_lib_c_inet_aton+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc" >&5 +$as_echo_n "checking for inet_aton in -lc... " >&6; } +if ${ac_cv_lib_c_inet_aton+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14532,37 +12406,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char inet_aton (); int -main (void) +main () { return inet_aton (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_inet_aton=yes -else $as_nop +else ac_cv_lib_c_inet_aton=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton" >&5 -printf "%s\n" "$ac_cv_lib_c_inet_aton" >&6; } -if test "x$ac_cv_lib_c_inet_aton" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton" >&5 +$as_echo "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = xyes; then : $ac_cv_prog_TRUE -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 -printf %s "checking for inet_aton in -lresolv... " >&6; } -if test ${ac_cv_lib_resolv_inet_aton+y} -then : - printf %s "(cached) " >&6 -else $as_nop +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_inet_aton+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14571,30 +12445,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char inet_aton (); int -main (void) +main () { return inet_aton (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_inet_aton=yes -else $as_nop +else ac_cv_lib_resolv_inet_aton=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 -printf "%s\n" "$ac_cv_lib_resolv_inet_aton" >&6; } -if test "x$ac_cv_lib_resolv_inet_aton" = xyes -then : - printf "%s\n" "#define HAVE_LIBRESOLV 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRESOLV 1 +_ACEOF LIBS="-lresolv $LIBS" @@ -14606,16 +12483,14 @@ fi # On Tru64, chflags seems to be present, but calling it will # exit Python -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 -printf %s "checking for chflags... " >&6; } -if test ${ac_cv_have_chflags+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 +$as_echo_n "checking for chflags... " >&6; } +if ${ac_cv_have_chflags+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_have_chflags=cross -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14629,10 +12504,9 @@ int main(int argc, char*argv[]) } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_have_chflags=yes -else $as_nop +else ac_cv_have_chflags=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -14641,34 +12515,31 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_chflags" >&5 -printf "%s\n" "$ac_cv_have_chflags" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_chflags" >&5 +$as_echo "$ac_cv_have_chflags" >&6; } if test "$ac_cv_have_chflags" = cross ; then ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags" -if test "x$ac_cv_func_chflags" = xyes -then : +if test "x$ac_cv_func_chflags" = xyes; then : ac_cv_have_chflags="yes" -else $as_nop +else ac_cv_have_chflags="no" fi fi if test "$ac_cv_have_chflags" = yes ; then -printf "%s\n" "#define HAVE_CHFLAGS 1" >>confdefs.h +$as_echo "#define HAVE_CHFLAGS 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 -printf %s "checking for lchflags... " >&6; } -if test ${ac_cv_have_lchflags+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 +$as_echo_n "checking for lchflags... " >&6; } +if ${ac_cv_have_lchflags+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_have_lchflags=cross -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14682,10 +12553,9 @@ int main(int argc, char*argv[]) } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_have_lchflags=yes -else $as_nop +else ac_cv_have_lchflags=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -14694,21 +12564,20 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lchflags" >&5 -printf "%s\n" "$ac_cv_have_lchflags" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lchflags" >&5 +$as_echo "$ac_cv_have_lchflags" >&6; } if test "$ac_cv_have_lchflags" = cross ; then ac_fn_c_check_func "$LINENO" "lchflags" "ac_cv_func_lchflags" -if test "x$ac_cv_func_lchflags" = xyes -then : +if test "x$ac_cv_func_lchflags" = xyes; then : ac_cv_have_lchflags="yes" -else $as_nop +else ac_cv_have_lchflags="no" fi fi if test "$ac_cv_have_lchflags" = yes ; then -printf "%s\n" "#define HAVE_LCHFLAGS 1" >>confdefs.h +$as_echo "#define HAVE_LCHFLAGS 1" >>confdefs.h fi @@ -14721,12 +12590,11 @@ Darwin/*) ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 -printf %s "checking for inflateCopy in -lz... " >&6; } -if test ${ac_cv_lib_z_inflateCopy+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 +$as_echo_n "checking for inflateCopy in -lz... " >&6; } +if ${ac_cv_lib_z_inflateCopy+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14735,31 +12603,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char inflateCopy (); int -main (void) +main () { return inflateCopy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_inflateCopy=yes -else $as_nop +else ac_cv_lib_z_inflateCopy=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy" >&5 -printf "%s\n" "$ac_cv_lib_z_inflateCopy" >&6; } -if test "x$ac_cv_lib_z_inflateCopy" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy" >&5 +$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = xyes; then : -printf "%s\n" "#define HAVE_ZLIB_COPY 1" >>confdefs.h +$as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h fi @@ -14771,38 +12640,37 @@ Darwin/*) ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5 -printf %s "checking for hstrerror... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5 +$as_echo_n "checking for hstrerror... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void* p = hstrerror; hstrerror(0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : -printf "%s\n" "#define HAVE_HSTRERROR 1" >>confdefs.h +$as_echo "#define HAVE_HSTRERROR 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5 -printf %s "checking for inet_aton... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14812,30 +12680,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { void* p = inet_aton;inet_aton(0,0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : -printf "%s\n" "#define HAVE_INET_ATON 1" >>confdefs.h +$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5 -printf %s "checking for inet_pton... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5 +$as_echo_n "checking for inet_pton... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14845,30 +12712,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { void* p = inet_pton ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h +$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setgroups" >&5 -printf %s "checking for setgroups... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setgroups" >&5 +$as_echo_n "checking for setgroups... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14878,44 +12744,42 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main (void) +main () { void* p = setgroups ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_SETGROUPS 1" >>confdefs.h +$as_echo "#define HAVE_SETGROUPS 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check for openpty and forkpty - - for ac_func in openpty +for ac_func in openpty do : ac_fn_c_check_func "$LINENO" "openpty" "ac_cv_func_openpty" -if test "x$ac_cv_func_openpty" = xyes -then : - printf "%s\n" "#define HAVE_OPENPTY 1" >>confdefs.h - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil" >&5 -printf %s "checking for openpty in -lutil... " >&6; } -if test ${ac_cv_lib_util_openpty+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_openpty" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OPENPTY 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil" >&5 +$as_echo_n "checking for openpty in -lutil... " >&6; } +if ${ac_cv_lib_util_openpty+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14924,38 +12788,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char openpty (); int -main (void) +main () { return openpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_util_openpty=yes -else $as_nop +else ac_cv_lib_util_openpty=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty" >&5 -printf "%s\n" "$ac_cv_lib_util_openpty" >&6; } -if test "x$ac_cv_lib_util_openpty" = xyes -then : - printf "%s\n" "#define HAVE_OPENPTY 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty" >&5 +$as_echo "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = xyes; then : + $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h LIBS="$LIBS -lutil" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd" >&5 -printf %s "checking for openpty in -lbsd... " >&6; } -if test ${ac_cv_lib_bsd_openpty+y} -then : - printf %s "(cached) " >&6 -else $as_nop +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd" >&5 +$as_echo_n "checking for openpty in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_openpty+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14964,30 +12828,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char openpty (); int -main (void) +main () { return openpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_openpty=yes -else $as_nop +else ac_cv_lib_bsd_openpty=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty" >&5 -printf "%s\n" "$ac_cv_lib_bsd_openpty" >&6; } -if test "x$ac_cv_lib_bsd_openpty" = xyes -then : - printf "%s\n" "#define HAVE_OPENPTY 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty" >&5 +$as_echo "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = xyes; then : + $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h LIBS="$LIBS -lbsd" fi @@ -14996,23 +12861,22 @@ fi fi - done - for ac_func in forkpty +for ac_func in forkpty do : ac_fn_c_check_func "$LINENO" "forkpty" "ac_cv_func_forkpty" -if test "x$ac_cv_func_forkpty" = xyes -then : - printf "%s\n" "#define HAVE_FORKPTY 1" >>confdefs.h - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil" >&5 -printf %s "checking for forkpty in -lutil... " >&6; } -if test ${ac_cv_lib_util_forkpty+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_forkpty" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FORKPTY 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil" >&5 +$as_echo_n "checking for forkpty in -lutil... " >&6; } +if ${ac_cv_lib_util_forkpty+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15021,38 +12885,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char forkpty (); int -main (void) +main () { return forkpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_util_forkpty=yes -else $as_nop +else ac_cv_lib_util_forkpty=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty" >&5 -printf "%s\n" "$ac_cv_lib_util_forkpty" >&6; } -if test "x$ac_cv_lib_util_forkpty" = xyes -then : - printf "%s\n" "#define HAVE_FORKPTY 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty" >&5 +$as_echo "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = xyes; then : + $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h LIBS="$LIBS -lutil" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd" >&5 -printf %s "checking for forkpty in -lbsd... " >&6; } -if test ${ac_cv_lib_bsd_forkpty+y} -then : - printf %s "(cached) " >&6 -else $as_nop +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd" >&5 +$as_echo_n "checking for forkpty in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_forkpty+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15061,30 +12925,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char forkpty (); int -main (void) +main () { return forkpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_forkpty=yes -else $as_nop +else ac_cv_lib_bsd_forkpty=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty" >&5 -printf "%s\n" "$ac_cv_lib_bsd_forkpty" >&6; } -if test "x$ac_cv_lib_bsd_forkpty" = xyes -then : - printf "%s\n" "#define HAVE_FORKPTY 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty" >&5 +$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = xyes; then : + $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h LIBS="$LIBS -lbsd" fi @@ -15093,54 +12958,28 @@ fi fi - done -# check for long file support functions -ac_fn_c_check_func "$LINENO" "fseek64" "ac_cv_func_fseek64" -if test "x$ac_cv_func_fseek64" = xyes -then : - printf "%s\n" "#define HAVE_FSEEK64 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko" -if test "x$ac_cv_func_fseeko" = xyes -then : - printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "fstatvfs" "ac_cv_func_fstatvfs" -if test "x$ac_cv_func_fstatvfs" = xyes -then : - printf "%s\n" "#define HAVE_FSTATVFS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "ftell64" "ac_cv_func_ftell64" -if test "x$ac_cv_func_ftell64" = xyes -then : - printf "%s\n" "#define HAVE_FTELL64 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "ftello" "ac_cv_func_ftello" -if test "x$ac_cv_func_ftello" = xyes -then : - printf "%s\n" "#define HAVE_FTELLO 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs" -if test "x$ac_cv_func_statvfs" = xyes -then : - printf "%s\n" "#define HAVE_STATVFS 1" >>confdefs.h +# check for long file support functions +for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" -if test "x$ac_cv_func_dup2" = xyes -then : - printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h +if test "x$ac_cv_func_dup2" = xyes; then : + $as_echo "#define HAVE_DUP2 1" >>confdefs.h -else $as_nop +else case " $LIBOBJS " in *" dup2.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dup2.$ac_objext" @@ -15150,72 +12989,70 @@ esac fi - for ac_func in getpgrp +for ac_func in getpgrp do : ac_fn_c_check_func "$LINENO" "getpgrp" "ac_cv_func_getpgrp" -if test "x$ac_cv_func_getpgrp" = xyes -then : - printf "%s\n" "#define HAVE_GETPGRP 1" >>confdefs.h +if test "x$ac_cv_func_getpgrp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPGRP 1 +_ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { getpgrp(0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define GETPGRP_HAVE_ARG 1" >>confdefs.h +$as_echo "#define GETPGRP_HAVE_ARG 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - done - for ac_func in setpgrp +for ac_func in setpgrp do : ac_fn_c_check_func "$LINENO" "setpgrp" "ac_cv_func_setpgrp" -if test "x$ac_cv_func_setpgrp" = xyes -then : - printf "%s\n" "#define HAVE_SETPGRP 1" >>confdefs.h +if test "x$ac_cv_func_setpgrp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETPGRP 1 +_ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { setpgrp(0,0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define SETPGRP_HAVE_ARG 1" >>confdefs.h +$as_echo "#define SETPGRP_HAVE_ARG 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - done + # We search for both crypt and crypt_r as one or the other may be defined # This gets us our -lcrypt in LIBS when required on the target platform. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 -printf %s "checking for library containing crypt... " >&6; } -if test ${ac_cv_search_crypt+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 +$as_echo_n "checking for library containing crypt... " >&6; } +if ${ac_cv_search_crypt+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15223,58 +13060,55 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char crypt (); int -main (void) +main () { return crypt (); ; return 0; } _ACEOF -for ac_lib in '' crypt -do +for ac_lib in '' crypt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO" -then : + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_crypt=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test ${ac_cv_search_crypt+y} -then : + if ${ac_cv_search_crypt+:} false; then : break fi done -if test ${ac_cv_search_crypt+y} -then : +if ${ac_cv_search_crypt+:} false; then : -else $as_nop +else ac_cv_search_crypt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 -printf "%s\n" "$ac_cv_search_crypt" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 +$as_echo "$ac_cv_search_crypt" >&6; } ac_res=$ac_cv_search_crypt -if test "$ac_res" != no -then : +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt_r" >&5 -printf %s "checking for library containing crypt_r... " >&6; } -if test ${ac_cv_search_crypt_r+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt_r" >&5 +$as_echo_n "checking for library containing crypt_r... " >&6; } +if ${ac_cv_search_crypt_r+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15282,56 +13116,53 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char crypt_r (); int -main (void) +main () { return crypt_r (); ; return 0; } _ACEOF -for ac_lib in '' crypt -do +for ac_lib in '' crypt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO" -then : + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_crypt_r=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test ${ac_cv_search_crypt_r+y} -then : + if ${ac_cv_search_crypt_r+:} false; then : break fi done -if test ${ac_cv_search_crypt_r+y} -then : +if ${ac_cv_search_crypt_r+:} false; then : -else $as_nop +else ac_cv_search_crypt_r=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt_r" >&5 -printf "%s\n" "$ac_cv_search_crypt_r" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt_r" >&5 +$as_echo "$ac_cv_search_crypt_r" >&6; } ac_res=$ac_cv_search_crypt_r -if test "$ac_res" != no -then : +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_fn_c_check_func "$LINENO" "crypt_r" "ac_cv_func_crypt_r" -if test "x$ac_cv_func_crypt_r" = xyes -then : +if test "x$ac_cv_func_crypt_r" = xyes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15339,7 +13170,7 @@ then : #include int -main (void) +main () { struct crypt_data d; @@ -15349,33 +13180,31 @@ char *r = crypt_r("", "", &d); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CRYPT_R 1" >>confdefs.h +$as_echo "#define HAVE_CRYPT_R 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - - for ac_func in clock_gettime +for ac_func in clock_gettime do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" -if test "x$ac_cv_func_clock_gettime" = xyes -then : - printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 -printf %s "checking for clock_gettime in -lrt... " >&6; } -if test ${ac_cv_lib_rt_clock_gettime+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_clock_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_GETTIME 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15384,60 +13213,60 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char clock_gettime (); int -main (void) +main () { return clock_gettime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes -else $as_nop +else ac_cv_lib_rt_clock_gettime=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 -printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } -if test "x$ac_cv_lib_rt_clock_gettime" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : LIBS="$LIBS -lrt" - printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h -printf "%s\n" "#define TIMEMODULE_LIB rt" >>confdefs.h +$as_echo "#define TIMEMODULE_LIB rt" >>confdefs.h fi fi - done - for ac_func in clock_getres +for ac_func in clock_getres do : ac_fn_c_check_func "$LINENO" "clock_getres" "ac_cv_func_clock_getres" -if test "x$ac_cv_func_clock_getres" = xyes -then : - printf "%s\n" "#define HAVE_CLOCK_GETRES 1" >>confdefs.h - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_getres in -lrt" >&5 -printf %s "checking for clock_getres in -lrt... " >&6; } -if test ${ac_cv_lib_rt_clock_getres+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_clock_getres" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_GETRES 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_getres in -lrt" >&5 +$as_echo_n "checking for clock_getres in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_getres+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15446,56 +13275,56 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char clock_getres (); int -main (void) +main () { return clock_getres (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_getres=yes -else $as_nop +else ac_cv_lib_rt_clock_getres=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_getres" >&5 -printf "%s\n" "$ac_cv_lib_rt_clock_getres" >&6; } -if test "x$ac_cv_lib_rt_clock_getres" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_getres" >&5 +$as_echo "$ac_cv_lib_rt_clock_getres" >&6; } +if test "x$ac_cv_lib_rt_clock_getres" = xyes; then : - printf "%s\n" "#define HAVE_CLOCK_GETRES 1" >>confdefs.h + $as_echo "#define HAVE_CLOCK_GETRES 1" >>confdefs.h fi fi - done - for ac_func in clock_settime +for ac_func in clock_settime do : ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" -if test "x$ac_cv_func_clock_settime" = xyes -then : - printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_settime in -lrt" >&5 -printf %s "checking for clock_settime in -lrt... " >&6; } -if test ${ac_cv_lib_rt_clock_settime+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_clock_settime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_SETTIME 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_settime in -lrt" >&5 +$as_echo_n "checking for clock_settime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_settime+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15504,42 +13333,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char clock_settime (); int -main (void) +main () { return clock_settime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_settime=yes -else $as_nop +else ac_cv_lib_rt_clock_settime=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_settime" >&5 -printf "%s\n" "$ac_cv_lib_rt_clock_settime" >&6; } -if test "x$ac_cv_lib_rt_clock_settime" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_settime" >&5 +$as_echo "$ac_cv_lib_rt_clock_settime" >&6; } +if test "x$ac_cv_lib_rt_clock_settime" = xyes; then : - printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h + $as_echo "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h fi fi - done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for major" >&5 -printf %s "checking for major... " >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for major" >&5 +$as_echo_n "checking for major... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15552,7 +13382,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main (void) +main () { makedev(major(0),minor(0)); @@ -15561,28 +13391,27 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : -printf "%s\n" "#define HAVE_DEVICE_MACROS 1" >>confdefs.h +$as_echo "#define HAVE_DEVICE_MACROS 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 -printf %s "checking for getaddrinfo... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15592,40 +13421,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_getaddrinfo=yes -else $as_nop +else have_getaddrinfo=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_getaddrinfo" >&5 -printf "%s\n" "$have_getaddrinfo" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getaddrinfo" >&5 +$as_echo "$have_getaddrinfo" >&6; } if test $have_getaddrinfo = yes then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5 -printf %s "checking getaddrinfo bug... " >&6; } - if test ${ac_cv_buggy_getaddrinfo+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5 +$as_echo_n "checking getaddrinfo bug... " >&6; } + if ${ac_cv_buggy_getaddrinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : if test "${enable_ipv6+set}" = set; then ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6" else ac_cv_buggy_getaddrinfo=yes fi -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15719,10 +13545,9 @@ int main() } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_buggy_getaddrinfo=no -else $as_nop +else ac_cv_buggy_getaddrinfo=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -15733,8 +13558,8 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_getaddrinfo" >&5 -printf "%s\n" "$ac_cv_buggy_getaddrinfo" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_getaddrinfo" >&5 +$as_echo "$ac_cv_buggy_getaddrinfo" >&6; } if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes then @@ -15746,42 +13571,70 @@ then fi else -printf "%s\n" "#define HAVE_GETADDRINFO 1" >>confdefs.h +$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h fi -ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" -if test "x$ac_cv_func_getnameinfo" = xyes -then : - printf "%s\n" "#define HAVE_GETNAMEINFO 1" >>confdefs.h +for ac_func in getnameinfo +do : + ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" +if test "x$ac_cv_func_getnameinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETNAMEINFO 1 +_ACEOF fi +done # checks for structures +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then -# Obsolete code to be removed. -if test $ac_cv_header_sys_time_h = yes; then - -printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi -# End of obsolete code. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test ${ac_cv_struct_tm+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { struct tm tm; int *p = &tm.tm_sec; @@ -15790,19 +13643,18 @@ struct tm tm; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h -else $as_nop +else ac_cv_struct_tm=sys/time.h fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -printf "%s\n" "$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then -printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi @@ -15810,35 +13662,37 @@ ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_ #include <$ac_cv_struct_tm> " -if test "x$ac_cv_member_struct_tm_tm_zone" = xyes -then : +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TM_TM_ZONE 1 +_ACEOF fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then -printf "%s\n" "#define HAVE_TM_ZONE 1" >>confdefs.h +$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h else - ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_tzname" = xyes -then : + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include +" +if test "x$ac_cv_have_decl_tzname" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 -printf %s "checking for tzname... " >&6; } -if test ${ac_cv_var_tzname+y} -then : - printf %s "(cached) " >&6 -else $as_nop +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TZNAME $ac_have_decl +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } +if ${ac_cv_var_tzname+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15847,81 +13701,86 @@ extern char *tzname[]; #endif int -main (void) +main () { return tzname[0][0]; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_var_tzname=yes -else $as_nop +else ac_cv_var_tzname=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 -printf "%s\n" "$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then -printf "%s\n" "#define HAVE_TZNAME 1" >>confdefs.h +$as_echo "#define HAVE_TZNAME 1" >>confdefs.h fi fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_rdev" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_RDEV 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_flags" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_FLAGS 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_gen" "ac_cv_member_struct_stat_st_gen" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_gen" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_GEN 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_GEN 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blocks" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +_ACEOF fi @@ -15931,10 +13790,11 @@ ac_fn_c_check_member "$LINENO" "struct passwd" "pw_gecos" "ac_cv_member_struct_p #include " -if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes -then : +if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_GECOS 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PASSWD_PW_GECOS 1 +_ACEOF fi @@ -15943,10 +13803,11 @@ ac_fn_c_check_member "$LINENO" "struct passwd" "pw_passwd" "ac_cv_member_struct_ #include " -if test "x$ac_cv_member_struct_passwd_pw_passwd" = xyes -then : +if test "x$ac_cv_member_struct_passwd_pw_passwd" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_PASSWD 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PASSWD_PW_PASSWD 1 +_ACEOF fi @@ -15954,54 +13815,53 @@ fi # Issue #21085: In Cygwin, siginfo_t does not have si_band field. ac_fn_c_check_member "$LINENO" "siginfo_t" "si_band" "ac_cv_member_siginfo_t_si_band" "#include " -if test "x$ac_cv_member_siginfo_t_si_band" = xyes -then : +if test "x$ac_cv_member_siginfo_t_si_band" = xyes; then : -printf "%s\n" "#define HAVE_SIGINFO_T_SI_BAND 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_BAND 1 +_ACEOF fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5 -printf %s "checking for time.h that defines altzone... " >&6; } -if test ${ac_cv_header_time_altzone+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5 +$as_echo_n "checking for time.h that defines altzone... " >&6; } +if ${ac_cv_header_time_altzone+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { return altzone; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time_altzone=yes -else $as_nop +else ac_cv_header_time_altzone=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time_altzone" >&5 -printf "%s\n" "$ac_cv_header_time_altzone" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time_altzone" >&5 +$as_echo "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then -printf "%s\n" "#define HAVE_ALTZONE 1" >>confdefs.h +$as_echo "#define HAVE_ALTZONE 1" >>confdefs.h fi was_it_defined=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sys/select.h and sys/time.h may both be included" >&5 -printf %s "checking whether sys/select.h and sys/time.h may both be included... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/select.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16010,102 +13870,96 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { ; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h +$as_echo "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h was_it_defined=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 -printf "%s\n" "$was_it_defined" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5 -printf %s "checking for addrinfo... " >&6; } -if test ${ac_cv_struct_addrinfo+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5 +$as_echo_n "checking for addrinfo... " >&6; } +if ${ac_cv_struct_addrinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct addrinfo a ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_addrinfo=yes -else $as_nop +else ac_cv_struct_addrinfo=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_addrinfo" >&5 -printf "%s\n" "$ac_cv_struct_addrinfo" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_addrinfo" >&5 +$as_echo "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then -printf "%s\n" "#define HAVE_ADDRINFO 1" >>confdefs.h +$as_echo "#define HAVE_ADDRINFO 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 -printf %s "checking for sockaddr_storage... " >&6; } -if test ${ac_cv_struct_sockaddr_storage+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 +$as_echo_n "checking for sockaddr_storage... " >&6; } +if ${ac_cv_struct_sockaddr_storage+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include # include int -main (void) +main () { struct sockaddr_storage s ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_sockaddr_storage=yes -else $as_nop +else ac_cv_struct_sockaddr_storage=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_storage" >&5 -printf "%s\n" "$ac_cv_struct_sockaddr_storage" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then -printf "%s\n" "#define HAVE_SOCKADDR_STORAGE 1" >>confdefs.h +$as_echo "#define HAVE_SOCKADDR_STORAGE 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sockaddr_alg" >&5 -printf %s "checking for sockaddr_alg... " >&6; } -if test ${ac_cv_struct_sockaddr_alg+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_alg" >&5 +$as_echo_n "checking for sockaddr_alg... " >&6; } +if ${ac_cv_struct_sockaddr_alg+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16113,43 +13967,41 @@ else $as_nop # include # include int -main (void) +main () { struct sockaddr_alg s ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_sockaddr_alg=yes -else $as_nop +else ac_cv_struct_sockaddr_alg=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_alg" >&5 -printf "%s\n" "$ac_cv_struct_sockaddr_alg" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_alg" >&5 +$as_echo "$ac_cv_struct_sockaddr_alg" >&6; } if test $ac_cv_struct_sockaddr_alg = yes; then -printf "%s\n" "#define HAVE_SOCKADDR_ALG 1" >>confdefs.h +$as_echo "#define HAVE_SOCKADDR_ALG 1" >>confdefs.h fi # checks for compiler characteristics -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -printf %s "checking whether char is unsigned... " >&6; } -if test ${ac_cv_c_char_unsigned+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main (void) +main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0; @@ -16159,32 +14011,30 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_char_unsigned=no -else $as_nop +else ac_cv_c_char_unsigned=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } -if test $ac_cv_c_char_unsigned = yes; then - printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -printf %s "checking for an ANSI C-conforming const... " >&6; } -if test ${ac_cv_c_const+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { #ifndef __cplusplus @@ -16197,7 +14047,7 @@ main (void) /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* IBM XL C 1.02.0.0 rejects this. + /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -16225,7 +14075,7 @@ main (void) iptr p = 0; ++p; } - { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -16241,78 +14091,75 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes -else $as_nop +else ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -printf "%s\n" "$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -printf "%s\n" "#define const /**/" >>confdefs.h +$as_echo "#define const /**/" >>confdefs.h fi works=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working signed char" >&5 -printf %s "checking for working signed char... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working signed char" >&5 +$as_echo_n "checking for working signed char... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { signed char c; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : works=yes -else $as_nop +else -printf "%s\n" "#define signed /**/" >>confdefs.h +$as_echo "#define signed /**/" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $works" >&5 -printf "%s\n" "$works" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $works" >&5 +$as_echo "$works" >&6; } have_prototypes=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for prototypes" >&5 -printf %s "checking for prototypes... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prototypes" >&5 +$as_echo_n "checking for prototypes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(int x) { return 0; } int -main (void) +main () { return foo(10); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_PROTOTYPES 1" >>confdefs.h +$as_echo "#define HAVE_PROTOTYPES 1" >>confdefs.h have_prototypes=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_prototypes" >&5 -printf "%s\n" "$have_prototypes" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_prototypes" >&5 +$as_echo "$have_prototypes" >&6; } works=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable length prototypes and stdarg.h" >&5 -printf %s "checking for variable length prototypes and stdarg.h... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for variable length prototypes and stdarg.h" >&5 +$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16327,29 +14174,28 @@ int foo(int x, ...) { } int -main (void) +main () { return foo(10, "", 3.14); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_STDARG_PROTOTYPES 1" >>confdefs.h +$as_echo "#define HAVE_STDARG_PROTOTYPES 1" >>confdefs.h works=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $works" >&5 -printf "%s\n" "$works" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $works" >&5 +$as_echo "$works" >&6; } # check for socketpair -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socketpair" >&5 -printf %s "checking for socketpair... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socketpair" >&5 +$as_echo_n "checking for socketpair... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16357,36 +14203,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main (void) +main () { void *x=socketpair ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_SOCKETPAIR 1" >>confdefs.h +$as_echo "#define HAVE_SOCKETPAIR 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sockaddr has sa_len member" >&5 -printf %s "checking if sockaddr has sa_len member... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr has sa_len member" >&5 +$as_echo_n "checking if sockaddr has sa_len member... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { struct sockaddr x; x.sa_len = 0; @@ -16394,31 +14239,29 @@ x.sa_len = 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -printf "%s\n" "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h +$as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" -if test "x$ac_cv_func_gethostbyname_r" = xyes -then : +if test "x$ac_cv_func_gethostbyname_r" = xyes; then : - printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 6 args" >&5 -printf %s "checking gethostbyname_r with 6 args... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 6 args" >&5 +$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16427,7 +14270,7 @@ printf %s "checking gethostbyname_r with 6 args... " >&6; } # include int -main (void) +main () { char *name; @@ -16442,30 +14285,29 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : - printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6_ARG 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R_6_ARG 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 5 args" >&5 -printf %s "checking gethostbyname_r with 5 args... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 5 args" >&5 +$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include int -main (void) +main () { char *name; @@ -16480,30 +14322,29 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : - printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5_ARG 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R_5_ARG 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 3 args" >&5 -printf %s "checking gethostbyname_r with 3 args... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 3 args" >&5 +$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include int -main (void) +main () { char *name; @@ -16516,40 +14357,43 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : - printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3_ARG 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R_3_ARG 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$OLD_CFLAGS -else $as_nop +else + for ac_func in gethostbyname +do : ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes -then : - printf "%s\n" "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h +if test "x$ac_cv_func_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETHOSTBYNAME 1 +_ACEOF fi +done fi @@ -16565,16 +14409,14 @@ fi # Linux requires this for correct f.p. operations ac_fn_c_check_func "$LINENO" "__fpu_control" "ac_cv_func___fpu_control" -if test "x$ac_cv_func___fpu_control" = xyes -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in -lieee" >&5 -printf %s "checking for __fpu_control in -lieee... " >&6; } -if test ${ac_cv_lib_ieee___fpu_control+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func___fpu_control" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in -lieee" >&5 +$as_echo_n "checking for __fpu_control in -lieee... " >&6; } +if ${ac_cv_lib_ieee___fpu_control+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16583,30 +14425,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char __fpu_control (); int -main (void) +main () { return __fpu_control (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ieee___fpu_control=yes -else $as_nop +else ac_cv_lib_ieee___fpu_control=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee___fpu_control" >&5 -printf "%s\n" "$ac_cv_lib_ieee___fpu_control" >&6; } -if test "x$ac_cv_lib_ieee___fpu_control" = xyes -then : - printf "%s\n" "#define HAVE_LIBIEEE 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee___fpu_control" >&5 +$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBIEEE 1 +_ACEOF LIBS="-lieee $LIBS" @@ -16622,51 +14467,49 @@ case $ac_sys_system in Darwin) ;; *) LIBM=-lm esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libm=STRING" >&5 -printf %s "checking for --with-libm=STRING... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libm=STRING" >&5 +$as_echo_n "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. -if test ${with_libm+y} -then : +if test "${with_libm+set}" = set; then : withval=$with_libm; if test "$withval" = no then LIBM= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: force LIBM empty" >&5 -printf "%s\n" "force LIBM empty" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: force LIBM empty" >&5 +$as_echo "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 -printf "%s\n" "set LIBM=\"$withval\"" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 +$as_echo "set LIBM=\"$withval\"" >&6; } else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 -printf "%s\n" "default LIBM=\"$LIBM\"" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 +$as_echo "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libc=STRING" >&5 -printf %s "checking for --with-libc=STRING... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libc=STRING" >&5 +$as_echo_n "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. -if test ${with_libc+y} -then : +if test "${with_libc+set}" = set; then : withval=$with_libc; if test "$withval" = no then LIBC= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: force LIBC empty" >&5 -printf "%s\n" "force LIBC empty" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: force LIBC empty" >&5 +$as_echo "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 -printf "%s\n" "set LIBC=\"$withval\"" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 +$as_echo "set LIBC=\"$withval\"" >&6; } else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 -printf "%s\n" "default LIBC=\"$LIBC\"" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 +$as_echo "default LIBC=\"$LIBC\"" >&6; } fi @@ -16674,13 +14517,13 @@ fi # * Check for gcc x64 inline assembler * # ************************************** -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x64 gcc inline assembler" >&5 -printf %s "checking for x64 gcc inline assembler... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x64 gcc inline assembler" >&5 +$as_echo_n "checking for x64 gcc inline assembler... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { __asm__ __volatile__ ("movq %rcx, %rax"); @@ -16689,20 +14532,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_gcc_asm_for_x64=yes -else $as_nop +else have_gcc_asm_for_x64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x64" >&5 -printf "%s\n" "$have_gcc_asm_for_x64" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x64" >&5 +$as_echo "$have_gcc_asm_for_x64" >&6; } if test "$have_gcc_asm_for_x64" = yes then -printf "%s\n" "#define HAVE_GCC_ASM_FOR_X64 1" >>confdefs.h +$as_echo "#define HAVE_GCC_ASM_FOR_X64 1" >>confdefs.h fi @@ -16710,12 +14552,11 @@ fi # * Check for various properties of floating point * # ************************************************** -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether float word ordering is bigendian" >&5 -printf %s "checking whether float word ordering is bigendian... " >&6; } -if test ${ax_cv_c_float_words_bigendian+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether float word ordering is bigendian" >&5 +$as_echo_n "checking whether float word ordering is bigendian... " >&6; } +if ${ax_cv_c_float_words_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else ax_cv_c_float_words_bigendian=unknown @@ -16727,8 +14568,7 @@ double d = 909042349670368103374704789055050114762116927356156320147971208440534 _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : if $GREP noonsees conftest.$ac_objext >/dev/null ; then @@ -16744,15 +14584,15 @@ fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_float_words_bigendian" >&5 -printf "%s\n" "$ax_cv_c_float_words_bigendian" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_float_words_bigendian" >&5 +$as_echo "$ax_cv_c_float_words_bigendian" >&6; } case $ax_cv_c_float_words_bigendian in yes) -printf "%s\n" "#define FLOAT_WORDS_BIGENDIAN 1" >>confdefs.h +$as_echo "#define FLOAT_WORDS_BIGENDIAN 1" >>confdefs.h ;; no) ;; @@ -16769,12 +14609,12 @@ esac if test "$ax_cv_c_float_words_bigendian" = "yes" then -printf "%s\n" "#define DOUBLE_IS_BIG_ENDIAN_IEEE754 1" >>confdefs.h +$as_echo "#define DOUBLE_IS_BIG_ENDIAN_IEEE754 1" >>confdefs.h elif test "$ax_cv_c_float_words_bigendian" = "no" then -printf "%s\n" "#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1" >>confdefs.h +$as_echo "#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1" >>confdefs.h else # Some ARM platforms use a mixed-endian representation for doubles. @@ -16784,7 +14624,7 @@ else # FLOAT_WORDS_BIGENDIAN doesnt actually detect this case, but if it's not big # or little, then it must be this? -printf "%s\n" "#define DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 1" >>confdefs.h +$as_echo "#define DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 1" >>confdefs.h fi @@ -16798,13 +14638,13 @@ fi # This inline assembler syntax may also work for suncc and icc, # so we try it on all platforms. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 -printf %s "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 +$as_echo_n "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { unsigned short cw; @@ -16815,30 +14655,29 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_gcc_asm_for_x87=yes -else $as_nop +else have_gcc_asm_for_x87=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x87" >&5 -printf "%s\n" "$have_gcc_asm_for_x87" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x87" >&5 +$as_echo "$have_gcc_asm_for_x87" >&6; } if test "$have_gcc_asm_for_x87" = yes then -printf "%s\n" "#define HAVE_GCC_ASM_FOR_X87 1" >>confdefs.h +$as_echo "#define HAVE_GCC_ASM_FOR_X87 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set mc68881 fpcr" >&5 -printf %s "checking whether we can use gcc inline assembler to get and set mc68881 fpcr... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set mc68881 fpcr" >&5 +$as_echo_n "checking whether we can use gcc inline assembler to get and set mc68881 fpcr... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { unsigned int fpcr; @@ -16849,20 +14688,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_gcc_asm_for_mc68881=yes -else $as_nop +else have_gcc_asm_for_mc68881=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_mc68881" >&5 -printf "%s\n" "$have_gcc_asm_for_mc68881" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_mc68881" >&5 +$as_echo "$have_gcc_asm_for_mc68881" >&6; } if test "$have_gcc_asm_for_mc68881" = yes then -printf "%s\n" "#define HAVE_GCC_ASM_FOR_MC68881 1" >>confdefs.h +$as_echo "#define HAVE_GCC_ASM_FOR_MC68881 1" >>confdefs.h fi @@ -16871,15 +14709,14 @@ fi # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x87-style double rounding" >&5 -printf %s "checking for x87-style double rounding... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x87-style double rounding" >&5 +$as_echo_n "checking for x87-style double rounding... " >&6; } # $BASECFLAGS may affect the result ac_save_cc="$CC" CC="$CC $BASECFLAGS" -if test "$cross_compiling" = yes -then : +if test "$cross_compiling" = yes; then : ac_cv_x87_double_rounding=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16903,10 +14740,9 @@ int main() { } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_x87_double_rounding=no -else $as_nop +else ac_cv_x87_double_rounding=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16914,12 +14750,12 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi CC="$ac_save_cc" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x87_double_rounding" >&5 -printf "%s\n" "$ac_cv_x87_double_rounding" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x87_double_rounding" >&5 +$as_echo "$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then -printf "%s\n" "#define X87_DOUBLE_ROUNDING 1" >>confdefs.h +$as_echo "#define X87_DOUBLE_ROUNDING 1" >>confdefs.h fi @@ -16930,125 +14766,63 @@ fi LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" -ac_fn_c_check_func "$LINENO" "acosh" "ac_cv_func_acosh" -if test "x$ac_cv_func_acosh" = xyes -then : - printf "%s\n" "#define HAVE_ACOSH 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "asinh" "ac_cv_func_asinh" -if test "x$ac_cv_func_asinh" = xyes -then : - printf "%s\n" "#define HAVE_ASINH 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "atanh" "ac_cv_func_atanh" -if test "x$ac_cv_func_atanh" = xyes -then : - printf "%s\n" "#define HAVE_ATANH 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "copysign" "ac_cv_func_copysign" -if test "x$ac_cv_func_copysign" = xyes -then : - printf "%s\n" "#define HAVE_COPYSIGN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "erf" "ac_cv_func_erf" -if test "x$ac_cv_func_erf" = xyes -then : - printf "%s\n" "#define HAVE_ERF 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "erfc" "ac_cv_func_erfc" -if test "x$ac_cv_func_erfc" = xyes -then : - printf "%s\n" "#define HAVE_ERFC 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "expm1" "ac_cv_func_expm1" -if test "x$ac_cv_func_expm1" = xyes -then : - printf "%s\n" "#define HAVE_EXPM1 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite" -if test "x$ac_cv_func_finite" = xyes -then : - printf "%s\n" "#define HAVE_FINITE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "gamma" "ac_cv_func_gamma" -if test "x$ac_cv_func_gamma" = xyes -then : - printf "%s\n" "#define HAVE_GAMMA 1" >>confdefs.h - -fi - -ac_fn_c_check_func "$LINENO" "hypot" "ac_cv_func_hypot" -if test "x$ac_cv_func_hypot" = xyes -then : - printf "%s\n" "#define HAVE_HYPOT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "lgamma" "ac_cv_func_lgamma" -if test "x$ac_cv_func_lgamma" = xyes -then : - printf "%s\n" "#define HAVE_LGAMMA 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "log1p" "ac_cv_func_log1p" -if test "x$ac_cv_func_log1p" = xyes -then : - printf "%s\n" "#define HAVE_LOG1P 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "log2" "ac_cv_func_log2" -if test "x$ac_cv_func_log2" = xyes -then : - printf "%s\n" "#define HAVE_LOG2 1" >>confdefs.h +for ac_func in acosh asinh atanh copysign erf erfc expm1 finite gamma +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi -ac_fn_c_check_func "$LINENO" "round" "ac_cv_func_round" -if test "x$ac_cv_func_round" = xyes -then : - printf "%s\n" "#define HAVE_ROUND 1" >>confdefs.h +done -fi -ac_fn_c_check_func "$LINENO" "tgamma" "ac_cv_func_tgamma" -if test "x$ac_cv_func_tgamma" = xyes -then : - printf "%s\n" "#define HAVE_TGAMMA 1" >>confdefs.h +for ac_func in hypot lgamma log1p log2 round tgamma +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done -ac_fn_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_isinf" = xyes -then : +ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include +" +if test "x$ac_cv_have_decl_isinf" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_ISINF $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_isnan" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include +" +if test "x$ac_cv_have_decl_isnan" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_ISNAN $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_isfinite" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include +" +if test "x$ac_cv_have_decl_isfinite" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_ISFINITE $ac_have_decl" >>confdefs.h + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE $ac_have_decl +_ACEOF # For multiprocessing module, check that sem_open @@ -17056,16 +14830,14 @@ printf "%s\n" "#define HAVE_DECL_ISFINITE $ac_have_decl" >>confdefs.h # the kernel module that provides POSIX semaphores # isn't loaded by default, so an attempt to call # sem_open results in a 'Signal 12' error. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are enabled" >&5 -printf %s "checking whether POSIX semaphores are enabled... " >&6; } -if test ${ac_cv_posix_semaphores_enabled+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are enabled" >&5 +$as_echo_n "checking whether POSIX semaphores are enabled... " >&6; } +if ${ac_cv_posix_semaphores_enabled+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_posix_semaphores_enabled=yes -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17087,10 +14859,9 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_posix_semaphores_enabled=yes -else $as_nop +else ac_cv_posix_semaphores_enabled=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17100,26 +14871,24 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_posix_semaphores_enabled" >&5 -printf "%s\n" "$ac_cv_posix_semaphores_enabled" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_posix_semaphores_enabled" >&5 +$as_echo "$ac_cv_posix_semaphores_enabled" >&6; } if test $ac_cv_posix_semaphores_enabled = no then -printf "%s\n" "#define POSIX_SEMAPHORES_NOT_ENABLED 1" >>confdefs.h +$as_echo "#define POSIX_SEMAPHORES_NOT_ENABLED 1" >>confdefs.h fi # Multiprocessing check for broken sem_getvalue -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue" >&5 -printf %s "checking for broken sem_getvalue... " >&6; } -if test ${ac_cv_broken_sem_getvalue+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue" >&5 +$as_echo_n "checking for broken sem_getvalue... " >&6; } +if ${ac_cv_broken_sem_getvalue+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_broken_sem_getvalue=yes -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17145,10 +14914,9 @@ int main(void){ } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_broken_sem_getvalue=no -else $as_nop +else ac_cv_broken_sem_getvalue=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17158,95 +14926,110 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_sem_getvalue" >&5 -printf "%s\n" "$ac_cv_broken_sem_getvalue" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_sem_getvalue" >&5 +$as_echo "$ac_cv_broken_sem_getvalue" >&6; } if test $ac_cv_broken_sem_getvalue = yes then -printf "%s\n" "#define HAVE_BROKEN_SEM_GETVALUE 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_SEM_GETVALUE 1" >>confdefs.h fi -ac_fn_check_decl "$LINENO" "RTLD_LAZY" "ac_cv_have_decl_RTLD_LAZY" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_LAZY" = xyes -then : +ac_fn_c_check_decl "$LINENO" "RTLD_LAZY" "ac_cv_have_decl_RTLD_LAZY" "#include +" +if test "x$ac_cv_have_decl_RTLD_LAZY" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_LAZY $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_NOW" "ac_cv_have_decl_RTLD_NOW" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_NOW" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_LAZY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_NOW" "ac_cv_have_decl_RTLD_NOW" "#include +" +if test "x$ac_cv_have_decl_RTLD_NOW" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_NOW $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_GLOBAL" "ac_cv_have_decl_RTLD_GLOBAL" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_GLOBAL" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_NOW $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_GLOBAL" "ac_cv_have_decl_RTLD_GLOBAL" "#include +" +if test "x$ac_cv_have_decl_RTLD_GLOBAL" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_GLOBAL $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_LOCAL" "ac_cv_have_decl_RTLD_LOCAL" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_LOCAL" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_GLOBAL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_LOCAL" "ac_cv_have_decl_RTLD_LOCAL" "#include +" +if test "x$ac_cv_have_decl_RTLD_LOCAL" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_LOCAL $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_NODELETE" "ac_cv_have_decl_RTLD_NODELETE" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_NODELETE" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_LOCAL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_NODELETE" "ac_cv_have_decl_RTLD_NODELETE" "#include +" +if test "x$ac_cv_have_decl_RTLD_NODELETE" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_NODELETE $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_NOLOAD" "ac_cv_have_decl_RTLD_NOLOAD" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_NOLOAD" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_NODELETE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_NOLOAD" "ac_cv_have_decl_RTLD_NOLOAD" "#include +" +if test "x$ac_cv_have_decl_RTLD_NOLOAD" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_NOLOAD $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_DEEPBIND" "ac_cv_have_decl_RTLD_DEEPBIND" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_DEEPBIND" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_NOLOAD $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_DEEPBIND" "ac_cv_have_decl_RTLD_DEEPBIND" "#include +" +if test "x$ac_cv_have_decl_RTLD_DEEPBIND" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_DEEPBIND $ac_have_decl" >>confdefs.h -ac_fn_check_decl "$LINENO" "RTLD_MEMBER" "ac_cv_have_decl_RTLD_MEMBER" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RTLD_MEMBER" = xyes -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_DEEPBIND $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_MEMBER" "ac_cv_have_decl_RTLD_MEMBER" "#include +" +if test "x$ac_cv_have_decl_RTLD_MEMBER" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_RTLD_MEMBER $ac_have_decl" >>confdefs.h + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_MEMBER $ac_have_decl +_ACEOF # determine what size digit to use for Python's longs -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking digit size for Python's longs" >&5 -printf %s "checking digit size for Python's longs... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking digit size for Python's longs" >&5 +$as_echo_n "checking digit size for Python's longs... " >&6; } # Check whether --enable-big-digits was given. -if test ${enable_big_digits+y} -then : +if test "${enable_big_digits+set}" = set; then : enableval=$enable_big_digits; case $enable_big_digits in yes) enable_big_digits=30 ;; @@ -17257,34 +15040,36 @@ no) *) as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" "$LINENO" 5 ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits" >&5 -printf "%s\n" "$enable_big_digits" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits" >&5 +$as_echo "$enable_big_digits" >&6; } -printf "%s\n" "#define PYLONG_BITS_IN_DIGIT $enable_big_digits" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PYLONG_BITS_IN_DIGIT $enable_big_digits +_ACEOF -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 -printf "%s\n" "no value specified" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 +$as_echo "no value specified" >&6; } fi # check for wchar.h -ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" -if test "x$ac_cv_header_wchar_h" = xyes -then : +ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes; then : -printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h +$as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h wchar_h="yes" -else $as_nop +else wchar_h="no" fi + # determine wchar_t size if test "$wchar_h" = yes then @@ -17292,20 +15077,18 @@ then # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 -printf %s "checking size of wchar_t... " >&6; } -if test ${ac_cv_sizeof_wchar_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } +if ${ac_cv_sizeof_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "#include -" -then : +"; then : -else $as_nop +else if test "$ac_cv_type_wchar_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -17314,18 +15097,20 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 -printf "%s\n" "$ac_cv_sizeof_wchar_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } -printf "%s\n" "#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t +_ACEOF fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for UCS-4 tcl" >&5 -printf %s "checking for UCS-4 tcl... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UCS-4 tcl" >&5 +$as_echo_n "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17335,41 +15120,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext # error "NOT UCS4_TCL" #endif int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_UCS4_TCL 1" >>confdefs.h +$as_echo "#define HAVE_UCS4_TCL 1" >>confdefs.h have_ucs4_tcl=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_ucs4_tcl" >&5 -printf "%s\n" "$have_ucs4_tcl" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ucs4_tcl" >&5 +$as_echo "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed" >&5 -printf %s "checking whether wchar_t is signed... " >&6; } - if test ${ac_cv_wchar_t_signed+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - if test "$cross_compiling" = yes -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed" >&5 +$as_echo_n "checking whether wchar_t is signed... " >&6; } + if ${ac_cv_wchar_t_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : ac_cv_wchar_t_signed=yes -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17381,10 +15163,9 @@ else $as_nop } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_wchar_t_signed=yes -else $as_nop +else ac_cv_wchar_t_signed=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17393,33 +15174,32 @@ fi fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wchar_t_signed" >&5 -printf "%s\n" "$ac_cv_wchar_t_signed" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wchar_t_signed" >&5 +$as_echo "$ac_cv_wchar_t_signed" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is usable" >&5 -printf %s "checking whether wchar_t is usable... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is usable" >&5 +$as_echo_n "checking whether wchar_t is usable... " >&6; } # wchar_t is only usable if it maps to an unsigned type if test "$ac_cv_sizeof_wchar_t" -ge 2 \ -a "$ac_cv_wchar_t_signed" = "no" then -printf "%s\n" "#define HAVE_USABLE_WCHAR_T 1" >>confdefs.h +$as_echo "#define HAVE_USABLE_WCHAR_T 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # check for endianness - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -printf %s "checking whether byte ordering is bigendian... " >&6; } -if test ${ac_cv_c_bigendian+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17430,8 +15210,7 @@ else $as_nop typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -17455,7 +15234,7 @@ then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17464,7 +15243,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext #include int -main (void) +main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -17476,8 +15255,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17485,7 +15263,7 @@ then : #include int -main (void) +main () { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -17495,15 +15273,14 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes -else $as_nop +else ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -17512,7 +15289,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext #include int -main (void) +main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -17522,15 +15299,14 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef _BIG_ENDIAN not big endian @@ -17540,33 +15316,31 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes -else $as_nop +else ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes -then : + if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -unsigned short int ascii_mm[] = +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - unsigned short int ascii_ii[] = + short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - unsigned short int ebcdic_ii[] = + short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - unsigned short int ebcdic_mm[] = + short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -17574,15 +15348,14 @@ unsigned short int ascii_mm[] = extern int foo; int -main (void) +main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -17595,13 +15368,13 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main (void) +main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -17617,10 +15390,9 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no -else $as_nop +else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17629,17 +15401,17 @@ fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -printf "%s\n" "$ac_cv_c_bigendian" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -17664,15 +15436,15 @@ printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h # In Python 3.2 and older, --with-wide-unicode added a 'u' flag. # In Python 3.7 and older, --with-pymalloc added a 'm' flag. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ABIFLAGS" >&5 -printf %s "checking ABIFLAGS... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ABIFLAGS" >&5 -printf "%s\n" "$ABIFLAGS" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 -printf %s "checking SOABI... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ABIFLAGS" >&5 +$as_echo_n "checking ABIFLAGS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABIFLAGS" >&5 +$as_echo "$ABIFLAGS" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 +$as_echo_n "checking SOABI... " >&6; } SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5 -printf "%s\n" "$SOABI" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5 +$as_echo "$SOABI" >&6; } # Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then @@ -17680,18 +15452,20 @@ if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} -printf "%s\n" "#define ALT_SOABI \"${ALT_SOABI}\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define ALT_SOABI "${ALT_SOABI}" +_ACEOF fi EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 -printf %s "checking LDVERSION... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 +$as_echo_n "checking LDVERSION... " >&6; } LDVERSION='$(VERSION)$(ABIFLAGS)' -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5 -printf "%s\n" "$LDVERSION" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5 +$as_echo "$LDVERSION" >&6; } # On Android and Cygwin the shared libraries must be linked with libpython. @@ -17710,12 +15484,11 @@ BINLIBDEST='$(LIBDIR)/python$(VERSION)' # /usr/$LIDIRNAME/python$VERSION PLATLIBDIR="lib" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-platlibdir" >&5 -printf %s "checking for --with-platlibdir... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-platlibdir" >&5 +$as_echo_n "checking for --with-platlibdir... " >&6; } # Check whether --with-platlibdir was given. -if test ${with_platlibdir+y} -then : +if test "${with_platlibdir+set}" = set; then : withval=$with_platlibdir; # ignore 3 options: # --with-platlibdir @@ -17723,17 +15496,17 @@ then : # --without-platlibdir if test -n "$withval" -a "$withval" != yes -a "$withval" != no then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } PLATLIBDIR="$withval" BINLIBDEST='${exec_prefix}/${PLATLIBDIR}/python$(VERSION)' else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17749,40 +15522,37 @@ fi # Check for --with-wheel-pkg-dir=PATH WHEEL_PKG_DIR="" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-wheel-pkg-dir" >&5 -printf %s "checking for --with-wheel-pkg-dir... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wheel-pkg-dir" >&5 +$as_echo_n "checking for --with-wheel-pkg-dir... " >&6; } # Check whether --with-wheel-pkg-dir was given. -if test ${with_wheel_pkg_dir+y} -then : +if test "${with_wheel_pkg_dir+set}" = set; then : withval=$with_wheel_pkg_dir; if test -n "$withval"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } WHEEL_PKG_DIR="$withval" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5 -printf %s "checking whether right shift extends the sign bit... " >&6; } -if test ${ac_cv_rshift_extends_sign+y} -then : - printf %s "(cached) " >&6 -else $as_nop - -if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5 +$as_echo_n "checking whether right shift extends the sign bit... " >&6; } +if ${ac_cv_rshift_extends_sign+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test "$cross_compiling" = yes; then : ac_cv_rshift_extends_sign=yes -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17792,10 +15562,9 @@ int main() } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_rshift_extends_sign=yes -else $as_nop +else ac_cv_rshift_extends_sign=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17804,28 +15573,27 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rshift_extends_sign" >&5 -printf "%s\n" "$ac_cv_rshift_extends_sign" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rshift_extends_sign" >&5 +$as_echo "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then -printf "%s\n" "#define SIGNED_RIGHT_SHIFT_ZERO_FILLS 1" >>confdefs.h +$as_echo "#define SIGNED_RIGHT_SHIFT_ZERO_FILLS 1" >>confdefs.h fi # check for getc_unlocked and related locking functions -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and friends" >&5 -printf %s "checking for getc_unlocked() and friends... " >&6; } -if test ${ac_cv_have_getc_unlocked+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and friends" >&5 +$as_echo_n "checking for getc_unlocked() and friends... " >&6; } +if ${ac_cv_have_getc_unlocked+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { FILE *f = fopen("/dev/null", "r"); @@ -17837,31 +15605,29 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_have_getc_unlocked=yes -else $as_nop +else ac_cv_have_getc_unlocked=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_getc_unlocked" >&5 -printf "%s\n" "$ac_cv_have_getc_unlocked" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_getc_unlocked" >&5 +$as_echo "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then -printf "%s\n" "#define HAVE_GETC_UNLOCKED 1" >>confdefs.h +$as_echo "#define HAVE_GETC_UNLOCKED 1" >>confdefs.h fi # Check whether --with-readline was given. -if test ${with_readline+y} -then : +if test "${with_readline+set}" = set; then : withval=$with_readline; -else $as_nop +else with_readline=yes fi @@ -17876,7 +15642,7 @@ if test "$with_readline" != no; then editline|edit) LIBREADLINE=edit -printf "%s\n" "#define WITH_EDITLINE 1" >>confdefs.h +$as_echo "#define WITH_EDITLINE 1" >>confdefs.h ;; yes|readline) @@ -17890,8 +15656,8 @@ printf "%s\n" "#define WITH_EDITLINE 1" >>confdefs.h # On some systems we need to link readline to a termcap compatible # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link readline libs" >&5 -printf %s "checking how to link readline libs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link readline libs" >&5 +$as_echo_n "checking how to link readline libs... " >&6; } for py_libtermcap in "" tinfo ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-l$LIBREADLINE" @@ -17905,20 +15671,22 @@ printf %s "checking how to link readline libs... " >&6; } /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char readline (); int -main (void) +main () { return readline (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : py_cv_lib_readline=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then break @@ -17928,20 +15696,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ # Uncomment this line if you want to use READLINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READLINE_LIBS" >&5 -printf "%s\n" "$READLINE_LIBS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_LIBS" >&5 +$as_echo "$READLINE_LIBS" >&6; } -printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h +$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h fi fi if test "$py_cv_lib_readline" = yes; then # check for readline 2.2 - ac_fn_check_decl "$LINENO" "rl_completion_append_character" "ac_cv_have_decl_rl_completion_append_character" " + ac_fn_c_check_decl "$LINENO" "rl_completion_append_character" "ac_cv_have_decl_rl_completion_append_character" " #include /* Must be first for Gnu Readline */ #ifdef WITH_EDITLINE # include @@ -17949,14 +15717,14 @@ if test "$py_cv_lib_readline" = yes; then # include #endif -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_rl_completion_append_character" = xyes -then : +" +if test "x$ac_cv_have_decl_rl_completion_append_character" = xyes; then : -printf "%s\n" "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h +$as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h fi - ac_fn_check_decl "$LINENO" "rl_completion_suppress_append" "ac_cv_have_decl_rl_completion_suppress_append" " + + ac_fn_c_check_decl "$LINENO" "rl_completion_suppress_append" "ac_cv_have_decl_rl_completion_suppress_append" " #include /* Must be first for Gnu Readline */ #ifdef WITH_EDITLINE # include @@ -17964,22 +15732,21 @@ fi # include #endif -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_rl_completion_suppress_append" = xyes -then : +" +if test "x$ac_cv_have_decl_rl_completion_suppress_append" = xyes; then : -printf "%s\n" "#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1" >>confdefs.h +$as_echo "#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1" >>confdefs.h fi + # check for readline 4.0 - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_pre_input_hook" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -l$LIBREADLINE" >&5 -printf %s "checking for rl_pre_input_hook in -l$LIBREADLINE... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop + as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_pre_input_hook" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -l$LIBREADLINE" >&5 +$as_echo_n "checking for rl_pre_input_hook in -l$LIBREADLINE... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17988,44 +15755,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char rl_pre_input_hook (); int -main (void) +main () { return rl_pre_input_hook (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" -else $as_nop +else eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -printf "%s\n" "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h +$as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h fi # also in 4.0 - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_completion_display_matches_hook" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -l$LIBREADLINE" >&5 -printf %s "checking for rl_completion_display_matches_hook in -l$LIBREADLINE... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop + as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_completion_display_matches_hook" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -l$LIBREADLINE" >&5 +$as_echo_n "checking for rl_completion_display_matches_hook in -l$LIBREADLINE... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18034,44 +15801,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char rl_completion_display_matches_hook (); int -main (void) +main () { return rl_completion_display_matches_hook (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" -else $as_nop +else eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -printf "%s\n" "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h +$as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h fi # also in 4.0, but not in editline - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_resize_terminal" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -l$LIBREADLINE" >&5 -printf %s "checking for rl_resize_terminal in -l$LIBREADLINE... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop + as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_resize_terminal" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -l$LIBREADLINE" >&5 +$as_echo_n "checking for rl_resize_terminal in -l$LIBREADLINE... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18080,44 +15847,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char rl_resize_terminal (); int -main (void) +main () { return rl_resize_terminal (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" -else $as_nop +else eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -printf "%s\n" "#define HAVE_RL_RESIZE_TERMINAL 1" >>confdefs.h +$as_echo "#define HAVE_RL_RESIZE_TERMINAL 1" >>confdefs.h fi # check for readline 4.2 - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_completion_matches" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -l$LIBREADLINE" >&5 -printf %s "checking for rl_completion_matches in -l$LIBREADLINE... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop + as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_completion_matches" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -l$LIBREADLINE" >&5 +$as_echo_n "checking for rl_completion_matches in -l$LIBREADLINE... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18126,38 +15893,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char rl_completion_matches (); int -main (void) +main () { return rl_completion_matches (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" -else $as_nop +else eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -printf "%s\n" "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h +$as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h fi # also in readline 4.2 - ac_fn_check_decl "$LINENO" "rl_catch_signals" "ac_cv_have_decl_rl_catch_signals" " + ac_fn_c_check_decl "$LINENO" "rl_catch_signals" "ac_cv_have_decl_rl_catch_signals" " #include /* Must be first for Gnu Readline */ #ifdef WITH_EDITLINE # include @@ -18165,21 +15933,20 @@ fi # include #endif -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_rl_catch_signals" = xyes -then : +" +if test "x$ac_cv_have_decl_rl_catch_signals" = xyes; then : -printf "%s\n" "#define HAVE_RL_CATCH_SIGNAL 1" >>confdefs.h +$as_echo "#define HAVE_RL_CATCH_SIGNAL 1" >>confdefs.h fi - as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_append_history" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for append_history in -l$LIBREADLINE" >&5 -printf %s "checking for append_history in -l$LIBREADLINE... " >&6; } -if eval test \${$as_ac_Lib+y} -then : - printf %s "(cached) " >&6 -else $as_nop + + as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_append_history" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -l$LIBREADLINE" >&5 +$as_echo_n "checking for append_history in -l$LIBREADLINE... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18188,32 +15955,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char append_history (); int -main (void) +main () { return append_history (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" -else $as_nop +else eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes" -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -printf "%s\n" "#define HAVE_RL_APPEND_HISTORY 1" >>confdefs.h +$as_echo "#define HAVE_RL_APPEND_HISTORY 1" >>confdefs.h fi @@ -18222,17 +15990,15 @@ fi # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken nice()" >&5 -printf %s "checking for broken nice()... " >&6; } -if test ${ac_cv_broken_nice+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()" >&5 +$as_echo_n "checking for broken nice()... " >&6; } +if ${ac_cv_broken_nice+:} false; then : + $as_echo_n "(cached) " >&6 +else -if test "$cross_compiling" = yes -then : +if test "$cross_compiling" = yes; then : ac_cv_broken_nice=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18247,10 +16013,9 @@ int main() } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_broken_nice=yes -else $as_nop +else ac_cv_broken_nice=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18259,25 +16024,23 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_nice" >&5 -printf "%s\n" "$ac_cv_broken_nice" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_nice" >&5 +$as_echo "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then -printf "%s\n" "#define HAVE_BROKEN_NICE 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_NICE 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 -printf %s "checking for broken poll()... " >&6; } -if test ${ac_cv_broken_poll+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 +$as_echo_n "checking for broken poll()... " >&6; } +if ${ac_cv_broken_poll+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_broken_poll=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18301,10 +16064,9 @@ int main() } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_broken_poll=yes -else $as_nop +else ac_cv_broken_poll=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18313,27 +16075,25 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_poll" >&5 -printf "%s\n" "$ac_cv_broken_poll" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_poll" >&5 +$as_echo "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then -printf "%s\n" "#define HAVE_BROKEN_POLL 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_POLL 1" >>confdefs.h fi # check tzset(3) exists and works like we expect it to -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working tzset()" >&5 -printf %s "checking for working tzset()... " >&6; } -if test ${ac_cv_working_tzset+y} -then : - printf %s "(cached) " >&6 -else $as_nop - -if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()" >&5 +$as_echo_n "checking for working tzset()... " >&6; } +if ${ac_cv_working_tzset+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test "$cross_compiling" = yes; then : ac_cv_working_tzset=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18401,10 +16161,9 @@ int main() } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_working_tzset=yes -else $as_nop +else ac_cv_working_tzset=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18413,27 +16172,26 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_tzset" >&5 -printf "%s\n" "$ac_cv_working_tzset" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_tzset" >&5 +$as_echo "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then -printf "%s\n" "#define HAVE_WORKING_TZSET 1" >>confdefs.h +$as_echo "#define HAVE_WORKING_TZSET 1" >>confdefs.h fi # Look for subsecond timestamps in struct stat -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat" >&5 -printf %s "checking for tv_nsec in struct stat... " >&6; } -if test ${ac_cv_stat_tv_nsec+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat" >&5 +$as_echo_n "checking for tv_nsec in struct stat... " >&6; } +if ${ac_cv_stat_tv_nsec+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct stat st; @@ -18443,36 +16201,34 @@ st.st_mtim.tv_nsec = 1; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_stat_tv_nsec=yes -else $as_nop +else ac_cv_stat_tv_nsec=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec" >&5 -printf "%s\n" "$ac_cv_stat_tv_nsec" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec" >&5 +$as_echo "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then -printf "%s\n" "#define HAVE_STAT_TV_NSEC 1" >>confdefs.h +$as_echo "#define HAVE_STAT_TV_NSEC 1" >>confdefs.h fi # Look for BSD style subsecond timestamps in struct stat -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat" >&5 -printf %s "checking for tv_nsec2 in struct stat... " >&6; } -if test ${ac_cv_stat_tv_nsec2+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat" >&5 +$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } +if ${ac_cv_stat_tv_nsec2+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct stat st; @@ -18482,21 +16238,20 @@ st.st_mtimespec.tv_nsec = 1; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_stat_tv_nsec2=yes -else $as_nop +else ac_cv_stat_tv_nsec2=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec2" >&5 -printf "%s\n" "$ac_cv_stat_tv_nsec2" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec2" >&5 +$as_echo "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then -printf "%s\n" "#define HAVE_STAT_TV_NSEC2 1" >>confdefs.h +$as_echo "#define HAVE_STAT_TV_NSEC2 1" >>confdefs.h fi @@ -18506,46 +16261,50 @@ if test "$cross_compiling" = no; then CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" fi -ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -if test "x$ac_cv_header_curses_h" = xyes -then : - printf "%s\n" "#define HAVE_CURSES_H 1" >>confdefs.h +for ac_header in curses.h ncurses.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -ac_fn_c_check_header_compile "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_h" = xyes -then : - printf "%s\n" "#define HAVE_NCURSES_H 1" >>confdefs.h -fi +done # On Solaris, term.h requires curses.h -ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" " +for ac_header in term.h +do : + ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" " #ifdef HAVE_CURSES_H #include #endif " -if test "x$ac_cv_header_term_h" = xyes -then : - printf "%s\n" "#define HAVE_TERM_H 1" >>confdefs.h +if test "x$ac_cv_header_term_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TERM_H 1 +_ACEOF fi +done + # On HP/UX 11.0, mvwdelch is a block with a return statement -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an expression" >&5 -printf %s "checking whether mvwdelch is an expression... " >&6; } -if test ${ac_cv_mvwdelch_is_expression+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an expression" >&5 +$as_echo_n "checking whether mvwdelch is an expression... " >&6; } +if ${ac_cv_mvwdelch_is_expression+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { int rtn; @@ -18555,22 +16314,21 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_mvwdelch_is_expression=yes -else $as_nop +else ac_cv_mvwdelch_is_expression=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mvwdelch_is_expression" >&5 -printf "%s\n" "$ac_cv_mvwdelch_is_expression" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mvwdelch_is_expression" >&5 +$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then -printf "%s\n" "#define MVWDELCH_IS_EXPRESSION 1" >>confdefs.h +$as_echo "#define MVWDELCH_IS_EXPRESSION 1" >>confdefs.h fi @@ -18578,12 +16336,11 @@ fi # structs since version 5.7. If the macro is defined as zero before including # [n]curses.h, ncurses will expose fields of the structs regardless of the # configuration. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags" >&5 -printf %s "checking whether WINDOW has _flags... " >&6; } -if test ${ac_cv_window_has_flags+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags" >&5 +$as_echo_n "checking whether WINDOW has _flags... " >&6; } +if ${ac_cv_window_has_flags+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18591,7 +16348,7 @@ else $as_nop #include int -main (void) +main () { WINDOW *w; @@ -18601,33 +16358,32 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_window_has_flags=yes -else $as_nop +else ac_cv_window_has_flags=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_window_has_flags" >&5 -printf "%s\n" "$ac_cv_window_has_flags" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_window_has_flags" >&5 +$as_echo "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes then -printf "%s\n" "#define WINDOW_HAS_FLAGS 1" >>confdefs.h +$as_echo "#define WINDOW_HAS_FLAGS 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for is_pad" >&5 -printf %s "checking for is_pad... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_pad" >&5 +$as_echo_n "checking for is_pad... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef is_pad @@ -18638,108 +16394,104 @@ void *x=is_pad return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_IS_PAD 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_IS_PAD 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for is_term_resized" >&5 -printf %s "checking for is_term_resized... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_term_resized" >&5 +$as_echo_n "checking for is_term_resized... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=is_term_resized ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_IS_TERM_RESIZED 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_IS_TERM_RESIZED 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resize_term" >&5 -printf %s "checking for resize_term... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for resize_term" >&5 +$as_echo_n "checking for resize_term... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=resize_term ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_RESIZE_TERM 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_RESIZE_TERM 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resizeterm" >&5 -printf %s "checking for resizeterm... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for resizeterm" >&5 +$as_echo_n "checking for resizeterm... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *x=resizeterm ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_RESIZETERM 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_RESIZETERM 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for immedok" >&5 -printf %s "checking for immedok... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for immedok" >&5 +$as_echo_n "checking for immedok... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef immedok @@ -18750,27 +16502,26 @@ void *x=immedok return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_IMMEDOK 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_IMMEDOK 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for syncok" >&5 -printf %s "checking for syncok... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for syncok" >&5 +$as_echo_n "checking for syncok... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef syncok @@ -18781,27 +16532,26 @@ void *x=syncok return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_SYNCOK 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_SYNCOK 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchgat" >&5 -printf %s "checking for wchgat... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchgat" >&5 +$as_echo_n "checking for wchgat... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef wchgat @@ -18812,27 +16562,26 @@ void *x=wchgat return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_WCHGAT 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_WCHGAT 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for filter" >&5 -printf %s "checking for filter... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for filter" >&5 +$as_echo_n "checking for filter... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef filter @@ -18843,27 +16592,26 @@ void *x=filter return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_FILTER 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_FILTER 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for has_key" >&5 -printf %s "checking for has_key... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for has_key" >&5 +$as_echo_n "checking for has_key... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef has_key @@ -18874,27 +16622,26 @@ void *x=has_key return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_HAS_KEY 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_HAS_KEY 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for typeahead" >&5 -printf %s "checking for typeahead... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeahead" >&5 +$as_echo_n "checking for typeahead... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef typeahead @@ -18905,27 +16652,26 @@ void *x=typeahead return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_TYPEAHEAD 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_TYPEAHEAD 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for use_env" >&5 -printf %s "checking for use_env... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for use_env" >&5 +$as_echo_n "checking for use_env... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef use_env @@ -18936,48 +16682,46 @@ void *x=use_env return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -printf "%s\n" "#define HAVE_CURSES_USE_ENV 1" >>confdefs.h +$as_echo "#define HAVE_CURSES_USE_ENV 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # last curses configure check CPPFLAGS=$ac_save_cppflags -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for device files" >&5 -printf "%s\n" "$as_me: checking for device files" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for device files" >&5 +$as_echo "$as_me: checking for device files" >&6;} if test "x$cross_compiling" = xyes; then if test "${ac_cv_file__dev_ptmx+set}" != set; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 -printf %s "checking for /dev/ptmx... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -printf "%s\n" "not set" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +$as_echo "not set" >&6; } as_fn_error $? "set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5 fi if test "${ac_cv_file__dev_ptc+set}" != set; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 -printf %s "checking for /dev/ptc... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -printf "%s\n" "not set" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +$as_echo "not set" >&6; } as_fn_error $? "set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5 fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 -printf %s "checking for /dev/ptmx... " >&6; } -if test ${ac_cv_file__dev_ptmx+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } +if ${ac_cv_file__dev_ptmx+:} false; then : + $as_echo_n "(cached) " >&6 +else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/dev/ptmx"; then @@ -18986,24 +16730,22 @@ else ac_cv_file__dev_ptmx=no fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptmx" >&5 -printf "%s\n" "$ac_cv_file__dev_ptmx" >&6; } -if test "x$ac_cv_file__dev_ptmx" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptmx" >&5 +$as_echo "$ac_cv_file__dev_ptmx" >&6; } +if test "x$ac_cv_file__dev_ptmx" = xyes; then : fi if test "x$ac_cv_file__dev_ptmx" = xyes; then -printf "%s\n" "#define HAVE_DEV_PTMX 1" >>confdefs.h +$as_echo "#define HAVE_DEV_PTMX 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 -printf %s "checking for /dev/ptc... " >&6; } -if test ${ac_cv_file__dev_ptc+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } +if ${ac_cv_file__dev_ptc+:} false; then : + $as_echo_n "(cached) " >&6 +else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/dev/ptc"; then @@ -19012,16 +16754,15 @@ else ac_cv_file__dev_ptc=no fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptc" >&5 -printf "%s\n" "$ac_cv_file__dev_ptc" >&6; } -if test "x$ac_cv_file__dev_ptc" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptc" >&5 +$as_echo "$ac_cv_file__dev_ptc" >&6; } +if test "x$ac_cv_file__dev_ptc" = xyes; then : fi if test "x$ac_cv_file__dev_ptc" = xyes; then -printf "%s\n" "#define HAVE_DEV_PTC 1" >>confdefs.h +$as_echo "#define HAVE_DEV_PTC 1" >>confdefs.h fi @@ -19030,17 +16771,15 @@ then LIBS="$LIBS -framework CoreFoundation" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format support" >&5 -printf %s "checking for %zd printf() format support... " >&6; } -if test ${ac_cv_have_size_t_format+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format support" >&5 +$as_echo_n "checking for %zd printf() format support... " >&6; } +if ${ac_cv_have_size_t_format+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_have_size_t_format="cross -- assuming yes" -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19080,10 +16819,9 @@ int main() } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_have_size_t_format=yes -else $as_nop +else ac_cv_have_size_t_format=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19091,11 +16829,11 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t_format" >&5 -printf "%s\n" "$ac_cv_have_size_t_format" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t_format" >&5 +$as_echo "$ac_cv_have_size_t_format" >&6; } if test "$ac_cv_have_size_t_format" != no ; then -printf "%s\n" "#define PY_FORMAT_SIZE_T \"z\"" >>confdefs.h +$as_echo "#define PY_FORMAT_SIZE_T \"z\"" >>confdefs.h fi @@ -19108,26 +16846,23 @@ ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " #endif " -if test "x$ac_cv_type_socklen_t" = xyes -then : +if test "x$ac_cv_type_socklen_t" = xyes; then : -else $as_nop +else -printf "%s\n" "#define socklen_t int" >>confdefs.h +$as_echo "#define socklen_t int" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 -printf %s "checking for broken mbstowcs... " >&6; } -if test ${ac_cv_broken_mbstowcs+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 +$as_echo_n "checking for broken mbstowcs... " >&6; } +if ${ac_cv_broken_mbstowcs+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_broken_mbstowcs=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19141,10 +16876,9 @@ int main() { } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_broken_mbstowcs=no -else $as_nop +else ac_cv_broken_mbstowcs=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19153,60 +16887,57 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_mbstowcs" >&5 -printf "%s\n" "$ac_cv_broken_mbstowcs" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_mbstowcs" >&5 +$as_echo "$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then -printf "%s\n" "#define HAVE_BROKEN_MBSTOWCS 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_MBSTOWCS 1" >>confdefs.h fi # Check for --with-computed-gotos -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5 -printf %s "checking for --with-computed-gotos... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5 +$as_echo_n "checking for --with-computed-gotos... " >&6; } # Check whether --with-computed-gotos was given. -if test ${with_computed_gotos+y} -then : +if test "${with_computed_gotos+set}" = set; then : withval=$with_computed_gotos; if test "$withval" = yes then -printf "%s\n" "#define USE_COMPUTED_GOTOS 1" >>confdefs.h +$as_echo "#define USE_COMPUTED_GOTOS 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi if test "$withval" = no then -printf "%s\n" "#define USE_COMPUTED_GOTOS 0" >>confdefs.h +$as_echo "#define USE_COMPUTED_GOTOS 0" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 -printf "%s\n" "no value specified" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 +$as_echo "no value specified" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 -printf %s "checking whether $CC supports computed gotos... " >&6; } -if test ${ac_cv_computed_gotos+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 +$as_echo_n "checking whether $CC supports computed gotos... " >&6; } +if ${ac_cv_computed_gotos+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : if test "${with_computed_gotos+set}" = set; then ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos" else ac_cv_computed_gotos=no fi -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19222,10 +16953,9 @@ LABEL2: } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_computed_gotos=yes -else $as_nop +else ac_cv_computed_gotos=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19234,18 +16964,18 @@ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5 -printf "%s\n" "$ac_cv_computed_gotos" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5 +$as_echo "$ac_cv_computed_gotos" >&6; } case "$ac_cv_computed_gotos" in yes*) -printf "%s\n" "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h +$as_echo "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h esac case $ac_sys_system in AIX*) -printf "%s\n" "#define HAVE_BROKEN_PIPE_BUF 1" >>confdefs.h +$as_echo "#define HAVE_BROKEN_PIPE_BUF 1" >>confdefs.h ;; esac @@ -19259,26 +16989,26 @@ done SRCDIRS="Parser Objects Python Modules Modules/_io Programs" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build directories" >&5 -printf %s "checking for build directories... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build directories" >&5 +$as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 -printf "%s\n" "done" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } # Availability of -O2: -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -O2" >&5 -printf %s "checking for -O2... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -O2" >&5 +$as_echo_n "checking for -O2... " >&6; } saved_cflags="$CFLAGS" CFLAGS="-O2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { @@ -19286,30 +17016,28 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : have_O2=yes -else $as_nop +else have_O2=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_O2" >&5 -printf "%s\n" "$have_O2" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_O2" >&5 +$as_echo "$have_O2" >&6; } CFLAGS="$saved_cflags" # _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect: # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glibc _FORTIFY_SOURCE/memmove bug" >&5 -printf %s "checking for glibc _FORTIFY_SOURCE/memmove bug... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc _FORTIFY_SOURCE/memmove bug" >&5 +$as_echo_n "checking for glibc _FORTIFY_SOURCE/memmove bug... " >&6; } saved_cflags="$CFLAGS" CFLAGS="-O2 -D_FORTIFY_SOURCE=2" if test "$have_O2" = no; then CFLAGS="" fi -if test "$cross_compiling" = yes -then : +if test "$cross_compiling" = yes; then : have_glibc_memmove_bug=undefined -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19329,10 +17057,9 @@ int main() { } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : have_glibc_memmove_bug=no -else $as_nop +else have_glibc_memmove_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19340,11 +17067,11 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi CFLAGS="$saved_cflags" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_glibc_memmove_bug" >&5 -printf "%s\n" "$have_glibc_memmove_bug" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_glibc_memmove_bug" >&5 +$as_echo "$have_glibc_memmove_bug" >&6; } if test "$have_glibc_memmove_bug" = yes; then -printf "%s\n" "#define HAVE_GLIBC_MEMMOVE_BUG 1" >>confdefs.h +$as_echo "#define HAVE_GLIBC_MEMMOVE_BUG 1" >>confdefs.h fi @@ -19354,14 +17081,13 @@ if test "$have_gcc_asm_for_x87" = yes; then # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html case $CC in *gcc*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc ipa-pure-const bug" >&5 -printf %s "checking for gcc ipa-pure-const bug... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc ipa-pure-const bug" >&5 +$as_echo_n "checking for gcc ipa-pure-const bug... " >&6; } saved_cflags="$CFLAGS" CFLAGS="-O2" - if test "$cross_compiling" = yes -then : + if test "$cross_compiling" = yes; then : have_ipa_pure_const_bug=undefined -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19382,10 +17108,9 @@ else $as_nop } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : have_ipa_pure_const_bug=no -else $as_nop +else have_ipa_pure_const_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19393,11 +17118,11 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi CFLAGS="$saved_cflags" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_ipa_pure_const_bug" >&5 -printf "%s\n" "$have_ipa_pure_const_bug" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ipa_pure_const_bug" >&5 +$as_echo "$have_ipa_pure_const_bug" >&6; } if test "$have_ipa_pure_const_bug" = yes; then -printf "%s\n" "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h +$as_echo "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h fi ;; @@ -19405,8 +17130,8 @@ printf "%s\n" "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h fi # Check for stdatomic.h -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdatomic.h" >&5 -printf %s "checking for stdatomic.h... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdatomic.h" >&5 +$as_echo_n "checking for stdatomic.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19423,27 +17148,26 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_stdatomic_h=yes -else $as_nop +else have_stdatomic_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_stdatomic_h" >&5 -printf "%s\n" "$have_stdatomic_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_stdatomic_h" >&5 +$as_echo "$have_stdatomic_h" >&6; } if test "$have_stdatomic_h" = yes; then -printf "%s\n" "#define HAVE_STD_ATOMIC 1" >>confdefs.h +$as_echo "#define HAVE_STD_ATOMIC 1" >>confdefs.h fi # Check for GCC >= 4.7 and clang __atomic builtin functions -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic_load_n and __atomic_store_n functions" >&5 -printf %s "checking for builtin __atomic_load_n and __atomic_store_n functions... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic_load_n and __atomic_store_n functions" >&5 +$as_echo_n "checking for builtin __atomic_load_n and __atomic_store_n functions... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19457,33 +17181,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_builtin_atomic=yes -else $as_nop +else have_builtin_atomic=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_builtin_atomic" >&5 -printf "%s\n" "$have_builtin_atomic" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_builtin_atomic" >&5 +$as_echo "$have_builtin_atomic" >&6; } if test "$have_builtin_atomic" = yes; then -printf "%s\n" "#define HAVE_BUILTIN_ATOMIC 1" >>confdefs.h +$as_echo "#define HAVE_BUILTIN_ATOMIC 1" >>confdefs.h fi # ensurepip option -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ensurepip" >&5 -printf %s "checking for ensurepip... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ensurepip" >&5 +$as_echo_n "checking for ensurepip... " >&6; } # Check whether --with-ensurepip was given. -if test ${with_ensurepip+y} -then : +if test "${with_ensurepip+set}" = set; then : withval=$with_ensurepip; -else $as_nop +else with_ensurepip=upgrade fi @@ -19497,13 +17219,13 @@ case $with_ensurepip in #( *) : as_fn_error $? "--with-ensurepip=upgrade|install|no" "$LINENO" 5 ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ENSUREPIP" >&5 -printf "%s\n" "$ENSUREPIP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENSUREPIP" >&5 +$as_echo "$ENSUREPIP" >&6; } # check if the dirent structure of a d_type field and DT_UNKNOWN is defined -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the dirent structure of a d_type field" >&5 -printf %s "checking if the dirent structure of a d_type field... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the dirent structure of a d_type field" >&5 +$as_echo_n "checking if the dirent structure of a d_type field... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19517,26 +17239,25 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_dirent_d_type=yes -else $as_nop +else have_dirent_d_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_dirent_d_type" >&5 -printf "%s\n" "$have_dirent_d_type" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dirent_d_type" >&5 +$as_echo "$have_dirent_d_type" >&6; } if test "$have_dirent_d_type" = yes; then -printf "%s\n" "#define HAVE_DIRENT_D_TYPE 1" >>confdefs.h +$as_echo "#define HAVE_DIRENT_D_TYPE 1" >>confdefs.h fi # check if the Linux getrandom() syscall is available -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the Linux getrandom() syscall" >&5 -printf %s "checking for the Linux getrandom() syscall... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Linux getrandom() syscall" >&5 +$as_echo_n "checking for the Linux getrandom() syscall... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19556,27 +17277,26 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_getrandom_syscall=yes -else $as_nop +else have_getrandom_syscall=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_getrandom_syscall" >&5 -printf "%s\n" "$have_getrandom_syscall" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getrandom_syscall" >&5 +$as_echo "$have_getrandom_syscall" >&6; } if test "$have_getrandom_syscall" = yes; then -printf "%s\n" "#define HAVE_GETRANDOM_SYSCALL 1" >>confdefs.h +$as_echo "#define HAVE_GETRANDOM_SYSCALL 1" >>confdefs.h fi # check if the getrandom() function is available # the test was written for the Solaris function of -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the getrandom() function" >&5 -printf %s "checking for the getrandom() function... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the getrandom() function" >&5 +$as_echo_n "checking for the getrandom() function... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19594,20 +17314,19 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : have_getrandom=yes -else $as_nop +else have_getrandom=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_getrandom" >&5 -printf "%s\n" "$have_getrandom" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getrandom" >&5 +$as_echo "$have_getrandom" >&6; } if test "$have_getrandom" = yes; then -printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h +$as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h fi @@ -19615,12 +17334,11 @@ fi # shm_* may only be available if linking against librt save_LIBS="$LIBS" save_includes_default="$ac_includes_default" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5 -printf %s "checking for library containing shm_open... " >&6; } -if test ${ac_cv_search_shm_open+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5 +$as_echo_n "checking for library containing shm_open... " >&6; } +if ${ac_cv_search_shm_open+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19628,64 +17346,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shm_open (); int -main (void) +main () { return shm_open (); ; return 0; } _ACEOF -for ac_lib in '' rt -do +for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO" -then : + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_shm_open=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test ${ac_cv_search_shm_open+y} -then : + if ${ac_cv_search_shm_open+:} false; then : break fi done -if test ${ac_cv_search_shm_open+y} -then : +if ${ac_cv_search_shm_open+:} false; then : -else $as_nop +else ac_cv_search_shm_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5 -printf "%s\n" "$ac_cv_search_shm_open" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5 +$as_echo "$ac_cv_search_shm_open" >&6; } ac_res=$ac_cv_search_shm_open -if test "$ac_res" != no -then : +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "$ac_cv_search_shm_open" = "-lrt"; then -printf "%s\n" "#define SHM_NEEDS_LIBRT 1" >>confdefs.h +$as_echo "#define SHM_NEEDS_LIBRT 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h +for ac_header in sys/mman.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MMAN_H 1 +_ACEOF fi +done + # temporarily override ac_includes_default for AC_CHECK_FUNCS below ac_includes_default="\ ${ac_includes_default} @@ -19695,18 +17416,17 @@ ${ac_includes_default} # endif #endif " -ac_fn_c_check_func "$LINENO" "shm_open" "ac_cv_func_shm_open" -if test "x$ac_cv_func_shm_open" = xyes -then : - printf "%s\n" "#define HAVE_SHM_OPEN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "shm_unlink" "ac_cv_func_shm_unlink" -if test "x$ac_cv_func_shm_unlink" = xyes -then : - printf "%s\n" "#define HAVE_SHM_UNLINK 1" >>confdefs.h +for ac_func in shm_open shm_unlink +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done # we don't want to link with librt always, restore LIBS LIBS="$save_LIBS" @@ -19717,8 +17437,7 @@ ac_includes_default="$save_includes_default" found=false # Check whether --with-openssl was given. -if test ${with_openssl+y} -then : +if test "${with_openssl+set}" = set; then : withval=$with_openssl; case "$withval" in "" | y | ye | yes | n | no) @@ -19728,19 +17447,18 @@ then : ;; esac -else $as_nop +else # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. else @@ -19748,15 +17466,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19767,11 +17481,11 @@ fi fi PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19780,12 +17494,11 @@ if test -z "$ac_cv_prog_PKG_CONFIG"; then ac_ct_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_PKG_CONFIG"; then ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test. else @@ -19793,15 +17506,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19812,11 +17521,11 @@ fi fi ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG if test -n "$ac_ct_PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 -printf "%s\n" "$ac_ct_PKG_CONFIG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 +$as_echo "$ac_ct_PKG_CONFIG" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_PKG_CONFIG" = x; then @@ -19824,8 +17533,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_ct_PKG_CONFIG @@ -19859,19 +17568,19 @@ fi if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 -printf %s "checking for openssl/ssl.h in $ssldir... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 +$as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; } if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } break else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi done @@ -19882,8 +17591,8 @@ printf "%s\n" "no" >&6; } # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 -printf %s "checking whether compiling and linking against OpenSSL works... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 +$as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; } echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5 @@ -19897,28 +17606,27 @@ printf %s "checking whether compiling and linking against OpenSSL works... " >&6 /* end confdefs.h. */ #include int -main (void) +main () { SSL_new(NULL) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } have_openssl=yes -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } have_openssl=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" @@ -19930,8 +17638,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test "$have_openssl" = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X509_VERIFY_PARAM_set1_host in libssl" >&5 -printf %s "checking for X509_VERIFY_PARAM_set1_host in libssl... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X509_VERIFY_PARAM_set1_host in libssl" >&5 +$as_echo_n "checking for X509_VERIFY_PARAM_set1_host in libssl... " >&6; } save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" @@ -19946,7 +17654,7 @@ printf %s "checking for X509_VERIFY_PARAM_set1_host in libssl... " >&6; } #include int -main (void) +main () { X509_VERIFY_PARAM *p = X509_VERIFY_PARAM_new(); @@ -19959,23 +17667,22 @@ main (void) } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_has_x509_verify_param_set1_host=yes -else $as_nop +else ac_cv_has_x509_verify_param_set1_host=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_x509_verify_param_set1_host" >&5 -printf "%s\n" "$ac_cv_has_x509_verify_param_set1_host" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_x509_verify_param_set1_host" >&5 +$as_echo "$ac_cv_has_x509_verify_param_set1_host" >&6; } if test "$ac_cv_has_x509_verify_param_set1_host" = "yes"; then -printf "%s\n" "#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1" >>confdefs.h +$as_echo "#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1" >>confdefs.h fi @@ -19984,41 +17691,72 @@ printf "%s\n" "#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1" >>confdefs.h LIBS="$save_LIBS" fi +# rpath to libssl and libcrypto +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-openssl-rpath" >&5 +$as_echo_n "checking for --with-openssl-rpath... " >&6; } + +# Check whether --with-openssl-rpath was given. +if test "${with_openssl_rpath+set}" = set; then : + withval=$with_openssl_rpath; +else + with_openssl_rpath=no + +fi + +case $with_openssl_rpath in #( + auto|yes) : + OPENSSL_RPATH=auto ;; #( + no) : + OPENSSL_RPATH= ;; #( + *) : + if test -d "$with_openssl_rpath"; then : + OPENSSL_RPATH="$with_openssl_rpath" +else + as_fn_error $? "--with-openssl-rpath \"$with_openssl_rpath\" is not a directory" "$LINENO" 5 +fi + + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_RPATH" >&5 +$as_echo "$OPENSSL_RPATH" >&6; } + + # ssl module default cipher suite string -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-ssl-default-suites" >&5 -printf %s "checking for --with-ssl-default-suites... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-ssl-default-suites" >&5 +$as_echo_n "checking for --with-ssl-default-suites... " >&6; } # Check whether --with-ssl-default-suites was given. -if test ${with_ssl_default_suites+y} -then : +if test "${with_ssl_default_suites+set}" = set; then : withval=$with_ssl_default_suites; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } case "$withval" in python) - printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h + $as_echo "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h ;; openssl) - printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 2" >>confdefs.h + $as_echo "#define PY_SSL_DEFAULT_CIPHERS 2" >>confdefs.h ;; *) - printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 0" >>confdefs.h + $as_echo "#define PY_SSL_DEFAULT_CIPHERS 0" >>confdefs.h - printf "%s\n" "#define PY_SSL_DEFAULT_CIPHER_STRING \"$withval\"" >>confdefs.h + cat >>confdefs.h <<_ACEOF +#define PY_SSL_DEFAULT_CIPHER_STRING "$withval" +_ACEOF ;; esac -else $as_nop +else -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: python" >&5 -printf "%s\n" "python" >&6; } -printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: python" >&5 +$as_echo "python" >&6; } +$as_echo "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h fi @@ -20027,14 +17765,13 @@ fi # builtin hash modules default_hashlib_hashes="md5,sha1,sha256,sha512,sha3,blake2" -printf "%s\n" "#define PY_BUILTIN_HASHLIB_HASHES /**/" >>confdefs.h +$as_echo "#define PY_BUILTIN_HASHLIB_HASHES /**/" >>confdefs.h -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-builtin-hashlib-hashes" >&5 -printf %s "checking for --with-builtin-hashlib-hashes... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-builtin-hashlib-hashes" >&5 +$as_echo_n "checking for --with-builtin-hashlib-hashes... " >&6; } # Check whether --with-builtin-hashlib-hashes was given. -if test ${with_builtin_hashlib_hashes+y} -then : +if test "${with_builtin_hashlib_hashes+set}" = set; then : withval=$with_builtin_hashlib_hashes; case "$withval" in yes) @@ -20044,16 +17781,20 @@ case "$withval" in withval="" ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -printf "%s\n" "$withval" >&6; } -printf "%s\n" "#define PY_BUILTIN_HASHLIB_HASHES \"$withval\"" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } +cat >>confdefs.h <<_ACEOF +#define PY_BUILTIN_HASHLIB_HASHES "$withval" +_ACEOF -else $as_nop +else -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $default_hashlib_hashes" >&5 -printf "%s\n" "$default_hashlib_hashes" >&6; }; -printf "%s\n" "#define PY_BUILTIN_HASHLIB_HASHES \"$default_hashlib_hashes\"" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_hashlib_hashes" >&5 +$as_echo "$default_hashlib_hashes" >&6; }; +cat >>confdefs.h <<_ACEOF +#define PY_BUILTIN_HASHLIB_HASHES "$default_hashlib_hashes" +_ACEOF fi @@ -20061,50 +17802,48 @@ fi # --with-experimental-isolated-subinterpreters -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-experimental-isolated-subinterpreters" >&5 -printf %s "checking for --with-experimental-isolated-subinterpreters... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-experimental-isolated-subinterpreters" >&5 +$as_echo_n "checking for --with-experimental-isolated-subinterpreters... " >&6; } # Check whether --with-experimental-isolated-subinterpreters was given. -if test ${with_experimental_isolated_subinterpreters+y} -then : +if test "${with_experimental_isolated_subinterpreters+set}" = set; then : withval=$with_experimental_isolated_subinterpreters; if test "$withval" != no then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; }; - printf "%s\n" "#define EXPERIMENTAL_ISOLATED_SUBINTERPRETERS 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; + $as_echo "#define EXPERIMENTAL_ISOLATED_SUBINTERPRETERS 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # --with-static-libpython STATIC_LIBPYTHON=1 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-static-libpython" >&5 -printf %s "checking for --with-static-libpython... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-static-libpython" >&5 +$as_echo_n "checking for --with-static-libpython... " >&6; } # Check whether --with-static-libpython was given. -if test ${with_static_libpython+y} -then : +if test "${with_static_libpython+set}" = set; then : withval=$with_static_libpython; if test "$withval" = no then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; STATIC_LIBPYTHON=0 else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi LIBRARY_DEPS='$(PY3LIBRARY) $(EXPORTSYMS)' @@ -20121,22 +17860,21 @@ fi # Check whether to disable test modules. Once set, setup.py will not build # test extension modules and "make install" will not install test suites. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-test-modules" >&5 -printf %s "checking for --disable-test-modules... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --disable-test-modules" >&5 +$as_echo_n "checking for --disable-test-modules... " >&6; } # Check whether --enable-test-modules was given. -if test ${enable_test_modules+y} -then : +if test "${enable_test_modules+set}" = set; then : enableval=$enable_test_modules; fi if test "$enable_test_modules" = no; then TEST_MODULES=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else TEST_MODULES=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -20173,8 +17911,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -20204,15 +17942,15 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -20226,8 +17964,8 @@ printf "%s\n" "$as_me: updating cache $cache_file" >&6;} fi fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -20244,7 +17982,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -20261,8 +17999,8 @@ LTLIBOBJS=$ac_ltlibobjs ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -20285,16 +18023,14 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -20304,46 +18040,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -20352,6 +18088,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -20360,12 +18103,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -20377,10 +18116,30 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -20393,14 +18152,13 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -20427,20 +18185,18 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset - # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -20452,13 +18208,12 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -20489,7 +18244,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -20511,10 +18266,6 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -20528,12 +18279,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -20575,7 +18320,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -20584,7 +18329,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20647,7 +18392,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by python $as_me 3.10, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -20705,16 +18450,14 @@ $config_headers Report bugs to ." _ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ python config.status 3.10 -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -20753,15 +18496,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -20769,7 +18512,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -20778,7 +18521,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -20806,7 +18549,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -20820,7 +18563,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - printf "%s\n" "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF @@ -20854,8 +18597,8 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -21191,7 +18934,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -21199,17 +18942,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | + ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -21226,7 +18969,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -21250,9 +18993,9 @@ printf "%s\n" X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -21314,8 +19057,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -21359,9 +19102,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -21377,20 +19120,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - printf "%s\n" "/* $configure_input */" >&1 \ + $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - printf "%s\n" "/* $configure_input */" >&1 \ + $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -21436,8 +19179,8 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -21461,4 +19204,3 @@ if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then echo "" >&6 echo "" >&6 fi - diff --git a/configure.ac b/configure.ac index 9802c65ce179c..4c3c80f74d215 100644 --- a/configure.ac +++ b/configure.ac @@ -5808,6 +5808,30 @@ if test "$have_openssl" = yes; then LIBS="$save_LIBS" fi +# rpath to libssl and libcrypto +AC_MSG_CHECKING(for --with-openssl-rpath) +AC_ARG_WITH(openssl-rpath, + AS_HELP_STRING([--with-openssl-rpath=@<:@DIR|auto|no@:>@], + [Set runtime library directory (rpath) for OpenSSL libraries, + no (default): don't set rpath, + auto: auto-detect rpath from --with-openssl and pkg-config, + DIR: set an explicit rpath + ]), + [], + [with_openssl_rpath=no] +) +AS_CASE($with_openssl_rpath, + [auto|yes],[OPENSSL_RPATH=auto], + [no],[OPENSSL_RPATH=], + [AS_IF( + [test -d "$with_openssl_rpath"], + [OPENSSL_RPATH="$with_openssl_rpath"], + AC_MSG_ERROR([--with-openssl-rpath "$with_openssl_rpath" is not a directory])) + ] +) +AC_MSG_RESULT($OPENSSL_RPATH) +AC_SUBST([OPENSSL_RPATH]) + # ssl module default cipher suite string AH_TEMPLATE(PY_SSL_DEFAULT_CIPHERS, [Default cipher suites list for ssl module. diff --git a/setup.py b/setup.py index 3467f559e5808..80deacce8de48 100644 --- a/setup.py +++ b/setup.py @@ -549,6 +549,8 @@ def print_three_column(lst): "libssl with X509_VERIFY_PARAM_set1_host().") print("LibreSSL 2.6.4 and earlier do not provide the necessary " "APIs, https://github.com/libressl-portable/portable/issues/381") + if sysconfig.get_config_var("OPENSSL_LDFLAGS"): + print("Custom linker flags may require --with-openssl-rpath=auto") print() def build_extension(self, ext): @@ -2416,6 +2418,7 @@ def split_var(name, sep): openssl_includes = split_var('OPENSSL_INCLUDES', '-I') openssl_libdirs = split_var('OPENSSL_LDFLAGS', '-L') openssl_libs = split_var('OPENSSL_LIBS', '-l') + openssl_rpath = config_vars.get('OPENSSL_RPATH') if not openssl_libs: # libssl and libcrypto not found self.missing.extend(['_ssl', '_hashlib']) @@ -2437,12 +2440,20 @@ def split_var(name, sep): if krb5_h: ssl_incs.extend(krb5_h) + if openssl_rpath == 'auto': + runtime_library_dirs = openssl_libdirs[:] + elif not openssl_rpath: + runtime_library_dirs = [] + else: + runtime_library_dirs = [openssl_rpath] + if config_vars.get("HAVE_X509_VERIFY_PARAM_SET1_HOST"): self.add(Extension( '_ssl', ['_ssl.c'], include_dirs=openssl_includes, library_dirs=openssl_libdirs, libraries=openssl_libs, + runtime_library_dirs=runtime_library_dirs, depends=['socketmodule.h', '_ssl/debughelpers.c']) ) else: @@ -2452,6 +2463,7 @@ def split_var(name, sep): depends=['hashlib.h'], include_dirs=openssl_includes, library_dirs=openssl_libdirs, + runtime_library_dirs=runtime_library_dirs, libraries=openssl_libs)) def detect_hash_builtins(self): From webhook-mailer at python.org Fri Mar 19 07:42:10 2021 From: webhook-mailer at python.org (vstinner) Date: Fri, 19 Mar 2021 11:42:10 -0000 Subject: [Python-checkins] bpo-43244: Remove symtable.h header file (GH-24910) Message-ID: https://github.com/python/cpython/commit/28ad12f8fe889a741661eb99daacebd9243cc1ba commit: 28ad12f8fe889a741661eb99daacebd9243cc1ba branch: master author: Victor Stinner committer: vstinner date: 2021-03-19T12:41:49+01:00 summary: bpo-43244: Remove symtable.h header file (GH-24910) Rename Include/symtable.h to to Include/internal/pycore_symtable.h, don't export symbols anymore (replace PyAPI_FUNC and PyAPI_DATA with extern) and rename functions: * PyST_GetScope() to _PyST_GetScope() * PySymtable_BuildObject() to _PySymtable_Build() * PySymtable_Free() to _PySymtable_Free() Remove PySymtable_Build(), Py_SymtableString() and Py_SymtableStringObject() functions. The Py_SymtableString() function was part the stable ABI by mistake but it could not be used, since the symtable.h header file was excluded from the limited C API. The Python symtable module remains available and is unchanged. files: A Include/internal/pycore_symtable.h A Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst D Include/symtable.h M Doc/data/stable_abi.dat M Doc/whatsnew/3.10.rst M Include/cpython/pythonrun.h M Include/pythonrun.h M Makefile.pre.in M Modules/symtablemodule.c M PC/python3dll.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/compile.c M Python/pythonrun.c M Python/symtable.c M Tools/scripts/stable_abi.py diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 906b0a72d1368..67d01da325307 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -776,7 +776,6 @@ Py_SetPath Py_SetProgramName Py_SetPythonHome Py_SetRecursionLimit -Py_SymtableString Py_UTF8Mode Py_VaBuildValue Py_XNewRef diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 362ce8f12b633..02fe033f56775 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1364,3 +1364,19 @@ Removed AST object (``mod_ty`` type) with the public C API. The function was already excluded from the limited C API (:pep:`384`). (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove the ``symtable.h`` header file and the undocumented functions: + + * ``PyST_GetScope()`` + * ``PySymtable_Build()`` + * ``PySymtable_BuildObject()`` + * ``PySymtable_Free()`` + * ``Py_SymtableString()`` + * ``Py_SymtableStringObject()`` + + The ``Py_SymtableString()`` function was part the stable ABI by mistake but + it could not be used, because the ``symtable.h`` header file was excluded + from the limited C API. + + The Python :mod:`symtable` module remains available and is unchanged. + (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Include/cpython/pythonrun.h b/Include/cpython/pythonrun.h index e396a674bc468..ffca0e457d58b 100644 --- a/Include/cpython/pythonrun.h +++ b/Include/cpython/pythonrun.h @@ -77,17 +77,6 @@ PyAPI_FUNC(const char *) _Py_SourceAsString( PyCompilerFlags *cf, PyObject **cmd_copy); -PyAPI_FUNC(struct symtable *) Py_SymtableStringObject( - const char *str, - PyObject *filename, - int start); - -PyAPI_FUNC(struct symtable *) _Py_SymtableStringObjectFlags( - const char *str, - PyObject *filename, - int start, - PyCompilerFlags *flags); - /* A function flavor is also exported by libpython. It is required when libpython is accessed directly rather than using header files which defines diff --git a/Include/symtable.h b/Include/internal/pycore_symtable.h similarity index 88% rename from Include/symtable.h rename to Include/internal/pycore_symtable.h index 6f0b7cb8b1c6a..80d5fd1c41715 100644 --- a/Include/symtable.h +++ b/Include/internal/pycore_symtable.h @@ -1,15 +1,14 @@ -#ifndef Py_LIMITED_API -#ifndef Py_SYMTABLE_H -#define Py_SYMTABLE_H +#ifndef Py_INTERNAL_SYMTABLE_H +#define Py_INTERNAL_SYMTABLE_H #ifdef __cplusplus extern "C" { #endif -#include "Python-ast.h" /* mod_ty */ +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif -/* XXX(ncoghlan): This is a weird mix of public names and interpreter internal - * names. - */ +#include "Python-ast.h" /* mod_ty */ typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } _Py_block_ty; @@ -68,23 +67,19 @@ typedef struct _symtable_entry { struct symtable *ste_table; } PySTEntryObject; -PyAPI_DATA(PyTypeObject) PySTEntry_Type; +extern PyTypeObject PySTEntry_Type; #define PySTEntry_Check(op) Py_IS_TYPE(op, &PySTEntry_Type) -PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); +extern int _PyST_GetScope(PySTEntryObject *, PyObject *); -PyAPI_FUNC(struct symtable *) PySymtable_Build( - mod_ty mod, - const char *filename, /* decoded from the filesystem encoding */ - PyFutureFeatures *future); -PyAPI_FUNC(struct symtable *) PySymtable_BuildObject( +extern struct symtable* _PySymtable_Build( mod_ty mod, PyObject *filename, PyFutureFeatures *future); PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); -PyAPI_FUNC(void) PySymtable_Free(struct symtable *); +extern void _PySymtable_Free(struct symtable *); /* Flags for def-use information */ @@ -117,8 +112,14 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *); #define GENERATOR 1 #define GENERATOR_EXPRESSION 2 +// Used by symtablemodule.c +extern struct symtable* _Py_SymtableStringObjectFlags( + const char *str, + PyObject *filename, + int start, + PyCompilerFlags *flags); + #ifdef __cplusplus } #endif -#endif /* !Py_SYMTABLE_H */ -#endif /* !Py_LIMITED_API */ +#endif /* !Py_INTERNAL_SYMTABLE_H */ diff --git a/Include/pythonrun.h b/Include/pythonrun.h index cc6c745a4d33d..b87bc73890242 100644 --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -9,11 +9,6 @@ extern "C" { PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int); -PyAPI_FUNC(struct symtable *) Py_SymtableString( - const char *str, - const char *filename, /* decoded from the filesystem encoding */ - int start); - PyAPI_FUNC(void) PyErr_Print(void); PyAPI_FUNC(void) PyErr_PrintEx(int); PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); diff --git a/Makefile.pre.in b/Makefile.pre.in index 6ca47d3dc2b61..85f3308dc36ae 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1087,7 +1087,6 @@ PYTHON_HEADERS= \ $(srcdir)/Include/sliceobject.h \ $(srcdir)/Include/structmember.h \ $(srcdir)/Include/structseq.h \ - $(srcdir)/Include/symtable.h \ $(srcdir)/Include/sysmodule.h \ $(srcdir)/Include/token.h \ $(srcdir)/Include/traceback.h \ @@ -1167,6 +1166,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_pymem.h \ $(srcdir)/Include/internal/pycore_pystate.h \ $(srcdir)/Include/internal/pycore_runtime.h \ + $(srcdir)/Include/internal/pycore_symtable.h \ $(srcdir)/Include/internal/pycore_sysmodule.h \ $(srcdir)/Include/internal/pycore_traceback.h \ $(srcdir)/Include/internal/pycore_tuple.h \ diff --git a/Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst b/Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst new file mode 100644 index 0000000000000..a05fdf9e1ae94 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst @@ -0,0 +1,16 @@ +Remove the ``symtable.h`` header file and the undocumented functions: + +* ``PyST_GetScope()`` +* ``PySymtable_Build()`` +* ``PySymtable_BuildObject()`` +* ``PySymtable_Free()`` +* ``Py_SymtableString()`` +* ``Py_SymtableStringObject()`` + +The ``Py_SymtableString()`` function was part the stable ABI by mistake but it +could not be used, because the ``symtable.h`` header file was excluded from the +limited C API. + +The Python :mod:`symtable` module remains available and is unchanged. + +Patch by Victor Stinner. diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index f6c378fdaedc1..c3234920d57ef 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -1,8 +1,7 @@ #include "Python.h" -#include "code.h" #include "Python-ast.h" -#include "symtable.h" +#include "pycore_symtable.h" // struct symtable #include "clinic/symtablemodule.c.h" /*[clinic input] @@ -62,7 +61,7 @@ _symtable_symtable_impl(PyObject *module, PyObject *source, t = (PyObject *)st->st_top; Py_INCREF(t); PyMem_Free((void *)st->st_future); - PySymtable_Free(st); + _PySymtable_Free(st); return t; } diff --git a/PC/python3dll.c b/PC/python3dll.c index 027d4b1c6e386..ddbd1b1e8e422 100644 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -80,7 +80,6 @@ EXPORT_FUNC(Py_SetPath) EXPORT_FUNC(Py_SetProgramName) EXPORT_FUNC(Py_SetPythonHome) EXPORT_FUNC(Py_SetRecursionLimit) -EXPORT_FUNC(Py_SymtableString) EXPORT_FUNC(Py_VaBuildValue) EXPORT_FUNC(Py_XNewRef) EXPORT_FUNC(PyArg_Parse) diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 37c60af4f74d7..bab711e6f1b8d 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -208,6 +208,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 76894079890fd..1f51715eb754d 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -585,6 +585,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/Python/compile.c b/Python/compile.c index 6ef5d5f69896c..27274ec884dc3 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -25,8 +25,8 @@ #include "pycore_ast.h" // _PyAST_GetDocString() #include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_long.h" // _PyLong_GetZero() +#include "pycore_symtable.h" // PySTEntryObject -#include "symtable.h" // struct symtable #define NEED_OPCODE_JUMP_TABLES #include "opcode.h" // EXTENDED_ARG #include "wordcode_helpers.h" // instrsize() @@ -394,7 +394,7 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, goto finally; } - c.c_st = PySymtable_BuildObject(mod, filename, c.c_future); + c.c_st = _PySymtable_Build(mod, filename, c.c_future); if (c.c_st == NULL) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_SystemError, "no symtable"); @@ -428,7 +428,7 @@ static void compiler_free(struct compiler *c) { if (c->c_st) - PySymtable_Free(c->c_st); + _PySymtable_Free(c->c_st); if (c->c_future) PyObject_Free(c->c_future); Py_XDECREF(c->c_filename); @@ -729,7 +729,7 @@ compiler_set_qualname(struct compiler *c) mangled = _Py_Mangle(parent->u_private, u->u_name); if (!mangled) return 0; - scope = PyST_GetScope(parent->u_ste, mangled); + scope = _PyST_GetScope(parent->u_ste, mangled); Py_DECREF(mangled); assert(scope != GLOBAL_IMPLICIT); if (scope == GLOBAL_EXPLICIT) @@ -1920,10 +1920,10 @@ get_ref_type(struct compiler *c, PyObject *name) if (c->u->u_scope_type == COMPILER_SCOPE_CLASS && _PyUnicode_EqualToASCIIString(name, "__class__")) return CELL; - scope = PyST_GetScope(c->u->u_ste, name); + scope = _PyST_GetScope(c->u->u_ste, name); if (scope == 0) { PyErr_Format(PyExc_SystemError, - "PyST_GetScope(name=%R) failed: " + "_PyST_GetScope(name=%R) failed: " "unknown scope in unit %S (%R); " "symbols: %R; locals: %R; globals: %R", name, @@ -3608,7 +3608,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) op = 0; optype = OP_NAME; - scope = PyST_GetScope(c->u->u_ste, mangled); + scope = _PyST_GetScope(c->u->u_ste, mangled); switch (scope) { case FREE: dict = c->u->u_freevars; diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 338a1b96d39e1..adb43e75f9ab7 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -23,7 +23,6 @@ #include "token.h" // INDENT #include "errcode.h" // E_EOF #include "code.h" // PyCodeObject -#include "symtable.h" // PySymtable_BuildObject() #include "marshal.h" // PyMarshal_ReadLongFromFile() #ifdef MS_WINDOWS @@ -1369,48 +1368,6 @@ _Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyComp return str; } -struct symtable * -Py_SymtableStringObject(const char *str, PyObject *filename, int start) -{ - PyCompilerFlags flags = _PyCompilerFlags_INIT; - return _Py_SymtableStringObjectFlags(str, filename, start, &flags); -} - -struct symtable * -_Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, PyCompilerFlags *flags) -{ - struct symtable *st; - mod_ty mod; - PyArena *arena; - - arena = PyArena_New(); - if (arena == NULL) - return NULL; - - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); - if (mod == NULL) { - PyArena_Free(arena); - return NULL; - } - st = PySymtable_BuildObject(mod, filename, 0); - PyArena_Free(arena); - return st; -} - -struct symtable * -Py_SymtableString(const char *str, const char *filename_str, int start) -{ - PyObject *filename; - struct symtable *st; - - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - st = Py_SymtableStringObject(str, filename, start); - Py_DECREF(filename); - return st; -} - #if defined(USE_STACKCHECK) #if defined(WIN32) && defined(_MSC_VER) diff --git a/Python/symtable.c b/Python/symtable.c index 10a47d1215e66..85648f21e6889 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,6 +1,6 @@ #include "Python.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "symtable.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_symtable.h" // PySTEntryObject #undef Yield /* undefine macro conflicting with */ #include "structmember.h" // PyMemberDef @@ -243,7 +243,7 @@ symtable_new(void) st->in_pattern = 0; return st; fail: - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } @@ -260,7 +260,7 @@ symtable_new(void) #define COMPILER_STACK_FRAME_SCALE 3 struct symtable * -PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) +_PySymtable_Build(mod_ty mod, PyObject *filename, PyFutureFeatures *future) { struct symtable *st = symtable_new(); asdl_stmt_seq *seq; @@ -272,7 +272,7 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) if (st == NULL) return NULL; if (filename == NULL) { - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } Py_INCREF(filename); @@ -282,7 +282,7 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) /* Setup recursion depth check counters */ tstate = _PyThreadState_GET(); if (!tstate) { - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } /* Be careful here to prevent overflow. */ @@ -295,7 +295,7 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) /* Make the initial symbol information gathering pass */ if (!GET_IDENTIFIER(top) || !symtable_enter_block(st, top, ModuleBlock, (void *)mod, 0, 0)) { - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } @@ -325,7 +325,7 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) goto error; } if (!symtable_exit_block(st)) { - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } /* Check that the recursion depth counting balanced correctly */ @@ -333,35 +333,23 @@ PySymtable_BuildObject(mod_ty mod, PyObject *filename, PyFutureFeatures *future) PyErr_Format(PyExc_SystemError, "symtable analysis recursion depth mismatch (before=%d, after=%d)", starting_recursion_depth, st->recursion_depth); - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } /* Make the second symbol analysis pass */ if (symtable_analyze(st)) return st; - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; error: (void) symtable_exit_block(st); - PySymtable_Free(st); + _PySymtable_Free(st); return NULL; } -struct symtable * -PySymtable_Build(mod_ty mod, const char *filename_str, PyFutureFeatures *future) -{ - PyObject *filename; - struct symtable *st; - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - st = PySymtable_BuildObject(mod, filename, future); - Py_DECREF(filename); - return st; -} void -PySymtable_Free(struct symtable *st) +_PySymtable_Free(struct symtable *st) { Py_XDECREF(st->st_filename); Py_XDECREF(st->st_blocks); @@ -402,7 +390,7 @@ _PyST_GetSymbol(PySTEntryObject *ste, PyObject *name) } int -PyST_GetScope(PySTEntryObject *ste, PyObject *name) +_PyST_GetScope(PySTEntryObject *ste, PyObject *name) { long symbol = _PyST_GetSymbol(ste, name); return (symbol >> SCOPE_OFFSET) & SCOPE_MASK; @@ -1971,3 +1959,26 @@ symtable_visit_dictcomp(struct symtable *st, expr_ty e) e->v.DictComp.key, e->v.DictComp.value); } + + +struct symtable * +_Py_SymtableStringObjectFlags(const char *str, PyObject *filename, + int start, PyCompilerFlags *flags) +{ + struct symtable *st; + mod_ty mod; + PyArena *arena; + + arena = PyArena_New(); + if (arena == NULL) + return NULL; + + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + if (mod == NULL) { + PyArena_Free(arena); + return NULL; + } + st = _PySymtable_Build(mod, filename, 0); + PyArena_Free(arena); + return st; +} diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py index cc1009da1bde2..0f9e36547e765 100755 --- a/Tools/scripts/stable_abi.py +++ b/Tools/scripts/stable_abi.py @@ -24,7 +24,6 @@ "parsetok.h", "pyatomic.h", "pytime.h", - "symtable.h", "token.h", "ucnhash.h", } From webhook-mailer at python.org Fri Mar 19 13:30:41 2021 From: webhook-mailer at python.org (markshannon) Date: Fri, 19 Mar 2021 17:30:41 -0000 Subject: [Python-checkins] Mention that code.co_lnotab is deprecated in what's new for 3.10. (#24902) Message-ID: https://github.com/python/cpython/commit/148bc0584476d836b65d65e158354f15b56d27b5 commit: 148bc0584476d836b65d65e158354f15b56d27b5 branch: master author: Mark Shannon committer: markshannon date: 2021-03-19T17:30:24Z summary: Mention that code.co_lnotab is deprecated in what's new for 3.10. (#24902) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 02fe033f56775..51b3331be89e2 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -175,6 +175,8 @@ Tracing events, with the correct line number, are generated for all lines of cod The ``f_lineo`` attribute of frame objects will always contain the expected line number. +The ``co_lnotab`` attribute of code objects is deprecated and will be removed in 3.12. +Code that needs to convert from offset to line number should use the new ``co_lines()`` method instead. PEP 634: Structural Pattern Matching ------------------------------------ From webhook-mailer at python.org Fri Mar 19 19:11:05 2021 From: webhook-mailer at python.org (terryjreedy) Date: Fri, 19 Mar 2021 23:11:05 -0000 Subject: [Python-checkins] bpo-43494: Make some minor changes to lnotab notes (GH-24861) Message-ID: https://github.com/python/cpython/commit/7cb033c423b65def1632d6c3c747111543b342a2 commit: 7cb033c423b65def1632d6c3c747111543b342a2 branch: master author: Skip Montanaro committer: terryjreedy date: 2021-03-19T19:10:54-04:00 summary: bpo-43494: Make some minor changes to lnotab notes (GH-24861) This cleanup makes no substantive changes. files: M Objects/lnotab_notes.txt diff --git a/Objects/lnotab_notes.txt b/Objects/lnotab_notes.txt index 046f753ed3232..59c65257082cc 100644 --- a/Objects/lnotab_notes.txt +++ b/Objects/lnotab_notes.txt @@ -3,16 +3,16 @@ Description of the internal format of the line number table Conceptually, the line number table consists of a sequence of triples: start-offset (inclusive), end-offset (exclusive), line-number. -Note that note all byte codes have a line number so we need handle `None` for the line-number. +Note that not all byte codes have a line number so we need handle `None` for the line-number. However, storing the above sequence directly would be very inefficient as we would need 12 bytes per entry. -First of all, we can note that the end of one entry is the same as the start of the next, so we can overlap entries. -Secondly we also note that we don't really need arbitrary access to the sequence, so we can store deltas. +First, note that the end of one entry is the same as the start of the next, so we can overlap entries. +Second, we don't really need arbitrary access to the sequence, so we can store deltas. We just need to store (end - start, line delta) pairs. The start offset of the first entry is always zero. -Thirdly, most deltas are small, so we can use a single byte for each value, as long we allow several entries for the same line. +Third, most deltas are small, so we can use a single byte for each value, as long we allow several entries for the same line. Consider the following table Start End Line @@ -36,12 +36,12 @@ Stripping the redundant ends gives: Note that the end - start value is always positive. -Finally in order, to fit into a single byte we need to convert start deltas to the range 0 <= delta <= 254, +Finally, in order to fit into a single byte we need to convert start deltas to the range 0 <= delta <= 254, and line deltas to the range -127 <= delta <= 127. A line delta of -128 is used to indicate no line number. A start delta of 255 is used as a sentinel to mark the end of the table. Also note that a delta of zero indicates that there are no bytecodes in the given range, -which means can use an invalidate line number for that range. +which means we can use an invalid line number for that range. Final form: From webhook-mailer at python.org Sat Mar 20 15:07:53 2021 From: webhook-mailer at python.org (pitrou) Date: Sat, 20 Mar 2021 19:07:53 -0000 Subject: [Python-checkins] bpo-43517: Fix false positive in detection of circular imports (#24895) Message-ID: https://github.com/python/cpython/commit/2fd16ef406bba239b1334057fb499496a84b3aa2 commit: 2fd16ef406bba239b1334057fb499496a84b3aa2 branch: master author: Antoine Pitrou committer: pitrou date: 2021-03-20T20:07:44+01:00 summary: bpo-43517: Fix false positive in detection of circular imports (#24895) files: A Lib/test/test_importlib/partial/cfimport.py A Lib/test/test_importlib/partial/pool_in_threads.py A Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst M Lib/test/test_importlib/test_threaded_import.py M Python/import.c diff --git a/Lib/test/test_importlib/partial/cfimport.py b/Lib/test/test_importlib/partial/cfimport.py new file mode 100644 index 0000000000000..c92d2fe1dd16f --- /dev/null +++ b/Lib/test/test_importlib/partial/cfimport.py @@ -0,0 +1,38 @@ +import os +import sys +import threading +import traceback + + +NLOOPS = 50 +NTHREADS = 30 + + +def t1(): + try: + from concurrent.futures import ThreadPoolExecutor + except Exception: + traceback.print_exc() + os._exit(1) + +def t2(): + try: + from concurrent.futures.thread import ThreadPoolExecutor + except Exception: + traceback.print_exc() + os._exit(1) + +def main(): + for j in range(NLOOPS): + threads = [] + for i in range(NTHREADS): + threads.append(threading.Thread(target=t2 if i % 1 else t1)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() + sys.modules.pop('concurrent.futures', None) + sys.modules.pop('concurrent.futures.thread', None) + +if __name__ == "__main__": + main() diff --git a/Lib/test/test_importlib/partial/pool_in_threads.py b/Lib/test/test_importlib/partial/pool_in_threads.py new file mode 100644 index 0000000000000..faa7867b814a4 --- /dev/null +++ b/Lib/test/test_importlib/partial/pool_in_threads.py @@ -0,0 +1,27 @@ +import multiprocessing +import os +import threading +import traceback + + +def t(): + try: + with multiprocessing.Pool(1): + pass + except Exception: + traceback.print_exc() + os._exit(1) + + +def main(): + threads = [] + for i in range(20): + threads.append(threading.Thread(target=t)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() + + +if __name__ == "__main__": + main() diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index c6a6e1715abad..03bde96de6c29 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -17,7 +17,7 @@ from test.support import (verbose, run_unittest) from test.support.import_helper import forget from test.support.os_helper import (TESTFN, unlink, rmtree) -from test.support import threading_helper +from test.support import script_helper, threading_helper def task(N, done, done_tasks, errors): try: @@ -245,6 +245,18 @@ def target(): __import__(TESTFN) del sys.modules[TESTFN] + def test_concurrent_futures_circular_import(self): + # Regression test for bpo-43515 + fn = os.path.join(os.path.dirname(__file__), + 'partial', 'cfimport.py') + script_helper.assert_python_ok(fn) + + def test_multiprocessing_pool_circular_import(self): + # Regression test for bpo-41567 + fn = os.path.join(os.path.dirname(__file__), + 'partial', 'pool_in_threads.py') + script_helper.assert_python_ok(fn) + @threading_helper.reap_threads def test_main(): diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst new file mode 100644 index 0000000000000..0f9926b93f654 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst @@ -0,0 +1,2 @@ +Fix misdetection of circular imports when using ``from pkg.mod import +attr``, which caused false positives in non-trivial multi-threaded code. diff --git a/Python/import.c b/Python/import.c index 538db69af6e0f..d92e46aa670cb 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1593,7 +1593,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, } if (mod != NULL && mod != Py_None) { - if (import_ensure_initialized(tstate->interp, mod, name) < 0) { + if (import_ensure_initialized(tstate->interp, mod, abs_name) < 0) { goto error; } } From webhook-mailer at python.org Sat Mar 20 15:12:14 2021 From: webhook-mailer at python.org (pablogsal) Date: Sat, 20 Mar 2021 19:12:14 -0000 Subject: [Python-checkins] bpo-43452: Micro-optimizations to PyType_Lookup (GH-24804) Message-ID: https://github.com/python/cpython/commit/ee48c7d54147ae906776b9f6f96e8920e097d0c4 commit: ee48c7d54147ae906776b9f6f96e8920e097d0c4 branch: master author: Dino Viehland committer: pablogsal date: 2021-03-20T19:12:05Z summary: bpo-43452: Micro-optimizations to PyType_Lookup (GH-24804) The common case going through _PyType_Lookup is to have a cache hit. There are some small tweaks that can make this a little cheaper: * The name field identity is used for a cache hit and is kept alive by the cache. So there's no need to read the hash code o the name - instead, the address can be used as the hash. * There's no need to check if the name is cachable on the lookup either, it probably is, and if it is, it'll be in the cache. * If we clear the version tag when invalidating a type then we don't actually need to check for a valid version tag bit. files: A Misc/NEWS.d/next/Core and Builtins/2021-03-20-01-21-37.bpo-43452.tDVJkc.rst M Objects/typeobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-20-01-21-37.bpo-43452.tDVJkc.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-20-01-21-37.bpo-43452.tDVJkc.rst new file mode 100644 index 0000000000000..c2fe10afdee8c --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-20-01-21-37.bpo-43452.tDVJkc.rst @@ -0,0 +1 @@ +Added micro-optimizations to ``_PyType_Lookup()`` to improve cache lookup performance in the common case of cache hits. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 650e4144f1627..2b6ff59e5fd3c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -32,8 +32,7 @@ class object "PyObject *" "&PyBaseObject_Type" & ((1 << MCACHE_SIZE_EXP) - 1)) #define MCACHE_HASH_METHOD(type, name) \ - MCACHE_HASH((type)->tp_version_tag, \ - ((PyASCIIObject *)(name))->hash) + MCACHE_HASH((type)->tp_version_tag, ((Py_ssize_t)(name)) >> 3) #define MCACHE_CACHEABLE_NAME(name) \ PyUnicode_CheckExact(name) && \ PyUnicode_IS_READY(name) && \ @@ -338,6 +337,7 @@ PyType_Modified(PyTypeObject *type) } } type->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + type->tp_version_tag = 0; /* 0 is not a valid version tag */ } static void @@ -396,6 +396,7 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) { Py_XDECREF(type_mro_meth); type->tp_flags &= ~(Py_TPFLAGS_HAVE_VERSION_TAG| Py_TPFLAGS_VALID_VERSION_TAG); + type->tp_version_tag = 0; /* 0 is not a valid version tag */ } static int @@ -3351,18 +3352,15 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) PyObject *res; int error; - if (MCACHE_CACHEABLE_NAME(name) && - _PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) { - /* fast path */ - unsigned int h = MCACHE_HASH_METHOD(type, name); - struct type_cache *cache = get_type_cache(); - struct type_cache_entry *entry = &cache->hashtable[h]; - if (entry->version == type->tp_version_tag && entry->name == name) { + unsigned int h = MCACHE_HASH_METHOD(type, name); + struct type_cache *cache = get_type_cache(); + struct type_cache_entry *entry = &cache->hashtable[h]; + if (entry->version == type->tp_version_tag && + entry->name == name) { #if MCACHE_STATS - cache->hits++; + cache->hits++; #endif - return entry->value; - } + return entry->value; } /* We may end up clearing live exceptions below, so make sure it's ours. */ @@ -3385,24 +3383,21 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) return NULL; } - if (MCACHE_CACHEABLE_NAME(name)) { - struct type_cache *cache = get_type_cache(); - if (assign_version_tag(cache, type)) { - unsigned int h = MCACHE_HASH_METHOD(type, name); - struct type_cache_entry *entry = &cache->hashtable[h]; - entry->version = type->tp_version_tag; - entry->value = res; /* borrowed */ - assert(((PyASCIIObject *)(name))->hash != -1); + if (MCACHE_CACHEABLE_NAME(name) && assign_version_tag(cache, type)) { + h = MCACHE_HASH_METHOD(type, name); + struct type_cache_entry *entry = &cache->hashtable[h]; + entry->version = type->tp_version_tag; + entry->value = res; /* borrowed */ + assert(((PyASCIIObject *)(name))->hash != -1); #if MCACHE_STATS - if (entry->name != Py_None && entry->name != name) { - cache->collisions++; - } - else { - cache->misses++; - } -#endif - Py_SETREF(entry->name, Py_NewRef(name)); + if (entry->name != Py_None && entry->name != name) { + cache->collisions++; } + else { + cache->misses++; + } +#endif + Py_SETREF(entry->name, Py_NewRef(name)); } return res; } From webhook-mailer at python.org Sat Mar 20 15:40:27 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 20 Mar 2021 19:40:27 -0000 Subject: [Python-checkins] [3.9] bpo-43517: Fix false positive in detection of circular imports (GH-24895) (GH-24948) Message-ID: https://github.com/python/cpython/commit/ac17ed60f2033253248be494a8e1980fe7e3531d commit: ac17ed60f2033253248be494a8e1980fe7e3531d branch: 3.9 author: Antoine Pitrou committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-20T12:40:18-07:00 summary: [3.9] bpo-43517: Fix false positive in detection of circular imports (GH-24895) (GH-24948) (cherry picked from commit 2fd16ef406bba239b1334057fb499496a84b3aa2) Co-authored-by: Antoine Pitrou Automerge-Triggered-By: GH:pitrou files: A Lib/test/test_importlib/partial/cfimport.py A Lib/test/test_importlib/partial/pool_in_threads.py A Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst M Lib/test/test_importlib/test_threaded_import.py M Python/import.c diff --git a/Lib/test/test_importlib/partial/cfimport.py b/Lib/test/test_importlib/partial/cfimport.py new file mode 100644 index 0000000000000..c92d2fe1dd16f --- /dev/null +++ b/Lib/test/test_importlib/partial/cfimport.py @@ -0,0 +1,38 @@ +import os +import sys +import threading +import traceback + + +NLOOPS = 50 +NTHREADS = 30 + + +def t1(): + try: + from concurrent.futures import ThreadPoolExecutor + except Exception: + traceback.print_exc() + os._exit(1) + +def t2(): + try: + from concurrent.futures.thread import ThreadPoolExecutor + except Exception: + traceback.print_exc() + os._exit(1) + +def main(): + for j in range(NLOOPS): + threads = [] + for i in range(NTHREADS): + threads.append(threading.Thread(target=t2 if i % 1 else t1)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() + sys.modules.pop('concurrent.futures', None) + sys.modules.pop('concurrent.futures.thread', None) + +if __name__ == "__main__": + main() diff --git a/Lib/test/test_importlib/partial/pool_in_threads.py b/Lib/test/test_importlib/partial/pool_in_threads.py new file mode 100644 index 0000000000000..faa7867b814a4 --- /dev/null +++ b/Lib/test/test_importlib/partial/pool_in_threads.py @@ -0,0 +1,27 @@ +import multiprocessing +import os +import threading +import traceback + + +def t(): + try: + with multiprocessing.Pool(1): + pass + except Exception: + traceback.print_exc() + os._exit(1) + + +def main(): + threads = [] + for i in range(20): + threads.append(threading.Thread(target=t)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() + + +if __name__ == "__main__": + main() diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index d1f64c70fac80..d1f8db42fbe37 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -16,7 +16,7 @@ from unittest import mock from test.support import ( verbose, run_unittest, TESTFN, reap_threads, - forget, unlink, rmtree, start_threads) + forget, unlink, rmtree, start_threads, script_helper) def task(N, done, done_tasks, errors): try: @@ -244,6 +244,18 @@ def target(): __import__(TESTFN) del sys.modules[TESTFN] + def test_concurrent_futures_circular_import(self): + # Regression test for bpo-43515 + fn = os.path.join(os.path.dirname(__file__), + 'partial', 'cfimport.py') + script_helper.assert_python_ok(fn) + + def test_multiprocessing_pool_circular_import(self): + # Regression test for bpo-41567 + fn = os.path.join(os.path.dirname(__file__), + 'partial', 'pool_in_threads.py') + script_helper.assert_python_ok(fn) + @reap_threads def test_main(): diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst new file mode 100644 index 0000000000000..0f9926b93f654 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-16-17-12-54.bpo-43517.zAo6Ws.rst @@ -0,0 +1,2 @@ +Fix misdetection of circular imports when using ``from pkg.mod import +attr``, which caused false positives in non-trivial multi-threaded code. diff --git a/Python/import.c b/Python/import.c index 5e39a2fb9a02e..55fbe41bc1337 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1863,7 +1863,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, } if (mod != NULL && mod != Py_None) { - if (import_ensure_initialized(tstate, mod, name) < 0) { + if (import_ensure_initialized(tstate, mod, abs_name) < 0) { goto error; } } From webhook-mailer at python.org Sat Mar 20 16:46:07 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 20 Mar 2021 20:46:07 -0000 Subject: [Python-checkins] bpo-43517 (followup): Install additional test directory (GH-24950) Message-ID: https://github.com/python/cpython/commit/66c8adfa27aeea004657ef29b6db4e4c360ad611 commit: 66c8adfa27aeea004657ef29b6db4e4c360ad611 branch: master author: Antoine Pitrou committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-20T13:45:58-07:00 summary: bpo-43517 (followup): Install additional test directory (GH-24950) Should fix some CI failures on buildbots that test an installed version of Python. Automerge-Triggered-By: GH:pitrou files: M Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in index 85f3308dc36ae..5b47530a2a774 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1488,6 +1488,7 @@ TESTSUBDIRS= ctypes/test \ test/test_importlib/namespace_pkgs/project3 \ test/test_importlib/namespace_pkgs/project3/parent \ test/test_importlib/namespace_pkgs/project3/parent/child \ + test/test_importlib/partial \ test/test_importlib/source \ test/test_importlib/zipdata01 \ test/test_importlib/zipdata02 \ From webhook-mailer at python.org Sat Mar 20 17:52:08 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 20 Mar 2021 21:52:08 -0000 Subject: [Python-checkins] [3.9] bpo-43517 (followup): Install additional test directory (GH-24950) (GH-24951) Message-ID: https://github.com/python/cpython/commit/107cf078910db7c1cafdd486270ba8083d72aed7 commit: 107cf078910db7c1cafdd486270ba8083d72aed7 branch: 3.9 author: Antoine Pitrou committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-20T14:51:59-07:00 summary: [3.9] bpo-43517 (followup): Install additional test directory (GH-24950) (GH-24951) Should fix some CI failures on buildbots that test an installed version of Python. (cherry picked from commit 66c8adfa27aeea004657ef29b6db4e4c360ad611) Co-authored-by: Antoine Pitrou files: M Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in index f128444b98594..3137d9306c2c4 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1439,6 +1439,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_importlib/namespace_pkgs/project3 \ test/test_importlib/namespace_pkgs/project3/parent \ test/test_importlib/namespace_pkgs/project3/parent/child \ + test/test_importlib/partial \ test/test_importlib/source \ test/test_importlib/zipdata01 \ test/test_importlib/zipdata02 \ From webhook-mailer at python.org Sat Mar 20 18:05:03 2021 From: webhook-mailer at python.org (gpshead) Date: Sat, 20 Mar 2021 22:05:03 -0000 Subject: [Python-checkins] bpo-43571: Add IPPROTO_MPTCP macro (GH-24946) Message-ID: https://github.com/python/cpython/commit/b05b48dd7ab68bf0046356f2abd6d7fe3b5b3d77 commit: b05b48dd7ab68bf0046356f2abd6d7fe3b5b3d77 branch: master author: Rui Cunha committer: gpshead date: 2021-03-20T15:04:56-07:00 summary: bpo-43571: Add IPPROTO_MPTCP macro (GH-24946) Add IPPROTO_MPTCP constant when defined in the system headers. files: A Misc/NEWS.d/next/Library/2021-03-20-17-40-35.bpo-43571.acAL0W.rst M Doc/library/socket.rst M Doc/whatsnew/3.10.rst M Modules/socketmodule.c diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 2255b827aa8eb..31d804ce294a8 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -610,6 +610,9 @@ The following functions all create :ref:`socket objects `. .. versionchanged:: 3.9 The CAN_J1939 protocol was added. + .. versionchanged:: 3.10 + The IPPROTO_MPTCP protocol was added. + .. function:: socketpair([family[, type[, proto]]]) Build a pair of connected socket objects using the given address family, socket diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 51b3331be89e2..b5e425293962c 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -800,6 +800,9 @@ socket The exception :exc:`socket.timeout` is now an alias of :exc:`TimeoutError`. (Contributed by Christian Heimes in :issue:`42413`.) +Added option to create MPTCP sockets with ``IPPROTO_MPTCP`` +(Contributed by Rui Cunha in :issue:`43571`.) + sys --- diff --git a/Misc/NEWS.d/next/Library/2021-03-20-17-40-35.bpo-43571.acAL0W.rst b/Misc/NEWS.d/next/Library/2021-03-20-17-40-35.bpo-43571.acAL0W.rst new file mode 100644 index 0000000000000..56714dc86bd56 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-20-17-40-35.bpo-43571.acAL0W.rst @@ -0,0 +1 @@ +It's now possible to create MPTCP sockets with IPPROTO_MPTCP \ No newline at end of file diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 0f56d94229fba..23aab59d9749a 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -7927,6 +7927,9 @@ PyInit__socket(void) #ifdef IPPROTO_BIP PyModule_AddIntMacro(m, IPPROTO_BIP); #endif +#ifdef IPPROTO_MPTCP + PyModule_AddIntMacro(m, IPPROTO_MPTCP); +#endif /**/ #ifdef IPPROTO_RAW PyModule_AddIntMacro(m, IPPROTO_RAW); From webhook-mailer at python.org Sat Mar 20 19:06:33 2021 From: webhook-mailer at python.org (gpshead) Date: Sat, 20 Mar 2021 23:06:33 -0000 Subject: [Python-checkins] bpo-43542: Add heif/heic formats in mimetypes (GH-24917) Message-ID: https://github.com/python/cpython/commit/20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d commit: 20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d branch: master author: Ilya Stepin committer: gpshead date: 2021-03-20T16:06:27-07:00 summary: bpo-43542: Add heif/heic formats in mimetypes (GH-24917) * bpo-43542: Add heif/heic formats in mimetypes Add HEIF and HEIC format to list of media types. It has IANA registration. IANA: https://www.iana.org/assignments/media-types/image/heic HEIF Github: https://github.com/nokiatech/heif Co-authored-by: Gregory P. Smith files: A Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst M Lib/mimetypes.py diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index d2c8ac76dcc08..018793c4f01e4 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -505,6 +505,8 @@ def _default_mime_types(): '.jpg' : 'image/jpeg', '.jpe' : 'image/jpeg', '.jpeg' : 'image/jpeg', + '.heic' : 'image/heic', + '.heif' : 'image/heif', '.png' : 'image/png', '.svg' : 'image/svg+xml', '.tiff' : 'image/tiff', diff --git a/Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst b/Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst new file mode 100644 index 0000000000000..370e520ca3e06 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst @@ -0,0 +1 @@ +``image/heic`` and ``image/heif`` were added to :mod:`mimetypes`. From webhook-mailer at python.org Sun Mar 21 11:13:22 2021 From: webhook-mailer at python.org (tiran) Date: Sun, 21 Mar 2021 15:13:22 -0000 Subject: [Python-checkins] bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) Message-ID: https://github.com/python/cpython/commit/77cde5042a2f1eae489c11a67540afaf43cd5cdf commit: 77cde5042a2f1eae489c11a67540afaf43cd5cdf branch: master author: Christian Heimes committer: tiran date: 2021-03-21T16:13:09+01:00 summary: bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes files: A Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst M Lib/test/test_ssl.py M Modules/_ssl.c M Modules/_ssl/debughelpers.c diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index ade7ef529e812..bed0d413a80b3 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4764,6 +4764,28 @@ def msg_cb(conn, direction, version, content_type, msg_type, data): msg ) + def test_msg_callback_deadlock_bpo43577(self): + client_context, server_context, hostname = testing_context() + server_context2 = testing_context()[1] + + def msg_cb(conn, direction, version, content_type, msg_type, data): + pass + + def sni_cb(sock, servername, ctx): + sock.context = server_context2 + + server_context._msg_callback = msg_cb + server_context.sni_callback = sni_cb + + server = ThreadedEchoServer(context=server_context, chatty=False) + with server: + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + def test_main(verbose=False): if support.verbose: diff --git a/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst b/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst new file mode 100644 index 0000000000000..a7db48bc626fc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst @@ -0,0 +1 @@ +Fix deadlock when using :class:`ssl.SSLContext` debug callback with :meth:`ssl.SSLContext.sni_callback`. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index bea144cd9f956..f3c3b20fe1ff1 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2202,6 +2202,11 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value, Py_INCREF(value); Py_SETREF(self->ctx, (PySSLContext *)value); SSL_set_SSL_CTX(self->ssl, self->ctx->ctx); + /* Set SSL* internal msg_callback to state of new context's state */ + SSL_set_msg_callback( + self->ssl, + self->ctx->msg_cb ? _PySSL_msg_callback : NULL + ); #endif } else { PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext"); diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c index b840da2f663af..af56f9d28d164 100644 --- a/Modules/_ssl/debughelpers.c +++ b/Modules/_ssl/debughelpers.c @@ -23,6 +23,7 @@ _PySSL_msg_callback(int write_p, int version, int content_type, ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl); assert(PySSLSocket_Check(ssl_obj)); if (ssl_obj->ctx->msg_cb == NULL) { + PyGILState_Release(threadstate); return; } From webhook-mailer at python.org Sun Mar 21 11:32:27 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 21 Mar 2021 15:32:27 -0000 Subject: [Python-checkins] bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) Message-ID: https://github.com/python/cpython/commit/93b0da7527ae1b7d705052cf352ef9da81e608ec commit: 93b0da7527ae1b7d705052cf352ef9da81e608ec branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-21T08:32:19-07:00 summary: bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes (cherry picked from commit 77cde5042a2f1eae489c11a67540afaf43cd5cdf) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst M Lib/test/test_ssl.py M Modules/_ssl.c M Modules/_ssl/debughelpers.c diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 9a886c73dee87..3d995db6d1ea1 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4730,6 +4730,28 @@ def msg_cb(conn, direction, version, content_type, msg_type, data): msg ) + def test_msg_callback_deadlock_bpo43577(self): + client_context, server_context, hostname = testing_context() + server_context2 = testing_context()[1] + + def msg_cb(conn, direction, version, content_type, msg_type, data): + pass + + def sni_cb(sock, servername, ctx): + sock.context = server_context2 + + server_context._msg_callback = msg_cb + server_context.sni_callback = sni_cb + + server = ThreadedEchoServer(context=server_context, chatty=False) + with server: + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + def test_main(verbose=False): if support.verbose: diff --git a/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst b/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst new file mode 100644 index 0000000000000..a7db48bc626fc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst @@ -0,0 +1 @@ +Fix deadlock when using :class:`ssl.SSLContext` debug callback with :meth:`ssl.SSLContext.sni_callback`. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 49e8a191e5d2d..bc98375379b54 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2205,6 +2205,11 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value, Py_INCREF(value); Py_SETREF(self->ctx, (PySSLContext *)value); SSL_set_SSL_CTX(self->ssl, self->ctx->ctx); + /* Set SSL* internal msg_callback to state of new context's state */ + SSL_set_msg_callback( + self->ssl, + self->ctx->msg_cb ? _PySSL_msg_callback : NULL + ); #endif } else { PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext"); diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c index b840da2f663af..af56f9d28d164 100644 --- a/Modules/_ssl/debughelpers.c +++ b/Modules/_ssl/debughelpers.c @@ -23,6 +23,7 @@ _PySSL_msg_callback(int write_p, int version, int content_type, ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl); assert(PySSLSocket_Check(ssl_obj)); if (ssl_obj->ctx->msg_cb == NULL) { + PyGILState_Release(threadstate); return; } From webhook-mailer at python.org Sun Mar 21 11:39:25 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 21 Mar 2021 15:39:25 -0000 Subject: [Python-checkins] bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) Message-ID: https://github.com/python/cpython/commit/c145c03281af850130dd7f75abc19c6ea49626e6 commit: c145c03281af850130dd7f75abc19c6ea49626e6 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-21T08:39:15-07:00 summary: bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes (cherry picked from commit 77cde5042a2f1eae489c11a67540afaf43cd5cdf) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst M Lib/test/test_ssl.py M Modules/_ssl.c M Modules/_ssl/debughelpers.c diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index e5b4b11d37fe6..738929e3195bc 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4739,6 +4739,28 @@ def msg_cb(conn, direction, version, content_type, msg_type, data): msg ) + def test_msg_callback_deadlock_bpo43577(self): + client_context, server_context, hostname = testing_context() + server_context2 = testing_context()[1] + + def msg_cb(conn, direction, version, content_type, msg_type, data): + pass + + def sni_cb(sock, servername, ctx): + sock.context = server_context2 + + server_context._msg_callback = msg_cb + server_context.sni_callback = sni_cb + + server = ThreadedEchoServer(context=server_context, chatty=False) + with server: + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + def test_main(verbose=False): if support.verbose: diff --git a/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst b/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst new file mode 100644 index 0000000000000..a7db48bc626fc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst @@ -0,0 +1 @@ +Fix deadlock when using :class:`ssl.SSLContext` debug callback with :meth:`ssl.SSLContext.sni_callback`. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 7bdde452513fd..aab5713997580 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2203,6 +2203,11 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value, Py_INCREF(value); Py_SETREF(self->ctx, (PySSLContext *)value); SSL_set_SSL_CTX(self->ssl, self->ctx->ctx); + /* Set SSL* internal msg_callback to state of new context's state */ + SSL_set_msg_callback( + self->ssl, + self->ctx->msg_cb ? _PySSL_msg_callback : NULL + ); #endif } else { PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext"); diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c index b840da2f663af..af56f9d28d164 100644 --- a/Modules/_ssl/debughelpers.c +++ b/Modules/_ssl/debughelpers.c @@ -23,6 +23,7 @@ _PySSL_msg_callback(int write_p, int version, int content_type, ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl); assert(PySSLSocket_Check(ssl_obj)); if (ssl_obj->ctx->msg_cb == NULL) { + PyGILState_Release(threadstate); return; } From webhook-mailer at python.org Sun Mar 21 12:27:58 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 21 Mar 2021 16:27:58 -0000 Subject: [Python-checkins] bpo-43422: Revert _decimal C API addition (GH-24960) Message-ID: https://github.com/python/cpython/commit/cdddc2b742750e3f289305cf276433a8170c32c1 commit: cdddc2b742750e3f289305cf276433a8170c32c1 branch: master author: Antoine Pitrou committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-21T09:27:54-07:00 summary: bpo-43422: Revert _decimal C API addition (GH-24960) Stefan Krah requested the reversal of these (unreleased) changes, quoting him: > The capsule API does not meet my testing standards, since I've focused on the upstream mpdecimal in the last couple of months. > Additionally, I'd like to refine the API, perhaps together with the Arrow community. Automerge-Triggered-By: GH:pitrou files: A Misc/NEWS.d/next/Library/2021-03-21-17-02-52.bpo-43422.POk6cU.rst D Doc/c-api/decimal.rst D Include/pydecimal.h M Doc/c-api/concrete.rst M Lib/test/test_decimal.py M Modules/_decimal/_decimal.c M Modules/_decimal/tests/bench.py M Modules/_decimal/tests/deccheck.py M Modules/_decimal/tests/formathelper.py M Modules/_testcapimodule.c diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst index bf263d6e4c264..c1d9fa1b41a3f 100644 --- a/Doc/c-api/concrete.rst +++ b/Doc/c-api/concrete.rst @@ -115,4 +115,3 @@ Other Objects coro.rst contextvars.rst datetime.rst - decimal.rst diff --git a/Doc/c-api/decimal.rst b/Doc/c-api/decimal.rst deleted file mode 100644 index 94cc4a7b84579..0000000000000 --- a/Doc/c-api/decimal.rst +++ /dev/null @@ -1,231 +0,0 @@ -.. sectionauthor:: Stefan Krah - -.. highlight:: c - - -Decimal capsule API -=================== - -Capsule API functions can be used in the same manner as regular library -functions, provided that the API has been initialized. - - -Initialize ----------- - -Typically, a C extension module that uses the decimal API will do these -steps in its init function: - -.. code-block:: c - - #include "pydecimal.h" - - static int decimal_initialized = 0; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - -Type checking, predicates, accessors ------------------------------------- - -.. c:function:: int PyDec_TypeCheck(const PyObject *dec) - - Return 1 if ``dec`` is a Decimal, 0 otherwise. This function does not set - any exceptions. - - -.. c:function:: int PyDec_IsSpecial(const PyObject *dec) - - Return 1 if ``dec`` is ``NaN``, ``sNaN`` or ``Infinity``, 0 otherwise. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple predicate. - - -.. c:function:: int PyDec_IsNaN(const PyObject *dec) - - Return 1 if ``dec`` is ``NaN`` or ``sNaN``, 0 otherwise. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple predicate. - - -.. c:function:: int PyDec_IsInfinite(const PyObject *dec) - - Return 1 if ``dec`` is ``Infinity``, 0 otherwise. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple predicate. - - -.. c:function:: int64_t PyDec_GetDigits(const PyObject *dec) - - Return the number of digits in the coefficient. For ``Infinity``, the - number of digits is always zero. Typically, the same applies to ``NaN`` - and ``sNaN``, but both of these can have a payload that is equivalent to - a coefficient. Therefore, ``NaNs`` can have a nonzero return value. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple accessor. - - -Exact conversions between decimals and primitive C types --------------------------------------------------------- - -This API supports conversions for decimals with a coefficient up to 38 digits. - -Data structures -~~~~~~~~~~~~~~~ - -The conversion functions use the following status codes and data structures: - -.. code-block:: c - - /* status cases for getting a triple */ - enum mpd_triple_class { - MPD_TRIPLE_NORMAL, - MPD_TRIPLE_INF, - MPD_TRIPLE_QNAN, - MPD_TRIPLE_SNAN, - MPD_TRIPLE_ERROR, - }; - - typedef struct { - enum mpd_triple_class tag; - uint8_t sign; - uint64_t hi; - uint64_t lo; - int64_t exp; - } mpd_uint128_triple_t; - -The status cases are explained below. ``sign`` is 0 for positive and 1 for negative. -``((uint128_t)hi << 64) + lo`` is the coefficient, ``exp`` is the exponent. - -The data structure is called "triple" because the decimal triple (sign, coeff, exp) -is an established term and (``hi``, ``lo``) represents a single ``uint128_t`` coefficient. - - -Functions -~~~~~~~~~ - -.. c:function:: mpd_uint128_triple_t PyDec_AsUint128Triple(const PyObject *dec) - - Convert a decimal to a triple. As above, it is guaranteed that the only - Python failure mode is a TypeError, checks can be omitted if the type is - known. - - For simplicity, the usage of the function and all special cases are - explained in code form and comments: - -.. code-block:: c - - triple = PyDec_AsUint128Triple(dec); - switch (triple.tag) { - case MPD_TRIPLE_QNAN: - /* - * Success: handle a quiet NaN. - * 1) triple.sign is 0 or 1. - * 2) triple.exp is always 0. - * 3) If triple.hi or triple.lo are nonzero, the NaN has a payload. - */ - break; - - case MPD_TRIPLE_SNAN: - /* - * Success: handle a signaling NaN. - * 1) triple.sign is 0 or 1. - * 2) triple.exp is always 0. - * 3) If triple.hi or triple.lo are nonzero, the sNaN has a payload. - */ - break; - - case MPD_TRIPLE_INF: - /* - * Success: handle Infinity. - * 1) triple.sign is 0 or 1. - * 2) triple.exp is always 0. - * 3) triple.hi and triple.lo are always zero. - */ - break; - - case MPD_TRIPLE_NORMAL: - /* Success: handle a finite value. */ - break; - - case MPD_TRIPLE_ERROR: - /* TypeError check: can be omitted if the type of dec is known. */ - if (PyErr_Occurred()) { - return NULL; - } - - /* Too large for conversion. PyDec_AsUint128Triple() does not set an - exception so applications can choose themselves. Typically this - would be a ValueError. */ - PyErr_SetString(PyExc_ValueError, - "value out of bounds for a uint128 triple"); - return NULL; - } - -.. c:function:: PyObject *PyDec_FromUint128Triple(const mpd_uint128_triple_t *triple) - - Create a decimal from a triple. The following rules must be observed for - initializing the triple: - - 1) ``triple.sign`` must always be 0 (for positive) or 1 (for negative). - - 2) ``MPD_TRIPLE_QNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple.lo`` - are nonzero, create a ``NaN`` with a payload. - - 3) ``MPD_TRIPLE_SNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple.lo`` - are nonzero, create an ``sNaN`` with a payload. - - 4) ``MPD_TRIPLE_INF``: ``triple.exp``, ``triple.hi`` and ``triple.lo`` must be zero. - - 5) ``MPD_TRIPLE_NORMAL``: ``MPD_MIN_ETINY + 38 < triple.exp < MPD_MAX_EMAX - 38``. - ``triple.hi`` and ``triple.lo`` can be chosen freely. - - 6) ``MPD_TRIPLE_ERROR``: It is always an error to set this tag. - - - If one of the above conditions is not met, the function returns ``NaN`` if - the ``InvalidOperation`` trap is not set in the thread local context. Otherwise, - it sets the ``InvalidOperation`` exception and returns NULL. - - Additionally, though extremely unlikely give the small allocation sizes, - the function can set ``MemoryError`` and return ``NULL``. - - -Advanced API ------------- - -This API enables the use of ``libmpdec`` functions. Since Python is compiled with -hidden symbols, the API requires an external libmpdec and the ``mpdecimal.h`` -header. - - -Functions -~~~~~~~~~ - -.. c:function:: PyObject *PyDec_Alloc(void) - - Return a new decimal that can be used in the ``result`` position of ``libmpdec`` - functions. - -.. c:function:: mpd_t *PyDec_Get(PyObject *v) - - Get a pointer to the internal ``mpd_t`` of the decimal. Decimals are immutable, - so this function must only be used on a new Decimal that has been created by - PyDec_Alloc(). - -.. c:function:: const mpd_t *PyDec_GetConst(const PyObject *v) - - Get a pointer to the constant internal ``mpd_t`` of the decimal. diff --git a/Include/pydecimal.h b/Include/pydecimal.h deleted file mode 100644 index f82e41f0aac05..0000000000000 --- a/Include/pydecimal.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2020 Stefan Krah. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -#ifndef CPYTHON_DECIMAL_H_ -#define CPYTHON_DECIMAL_H_ - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************/ -/* Libmpdec API */ -/****************************************************************************/ - -#ifndef LIBMPDEC_MPDECIMAL_H_ -struct mpd_t; /* ABI-stable in the libmpdec-2.x series */ - -/* status cases for getting a triple */ -enum mpd_triple_class { - MPD_TRIPLE_NORMAL, - MPD_TRIPLE_INF, - MPD_TRIPLE_QNAN, - MPD_TRIPLE_SNAN, - MPD_TRIPLE_ERROR, -}; - -typedef struct { - enum mpd_triple_class tag; - uint8_t sign; - uint64_t hi; - uint64_t lo; - int64_t exp; -} mpd_uint128_triple_t; -#endif - - -/****************************************************************************/ -/* Capsule API */ -/****************************************************************************/ - -#define PyDec_CAPSULE_NAME "_decimal._API" - -/* Simple API */ -#define PyDec_TypeCheck_INDEX 0 -#define PyDec_TypeCheck_RETURN int -#define PyDec_TypeCheck_ARGS (const PyObject *) - -#define PyDec_IsSpecial_INDEX 1 -#define PyDec_IsSpecial_RETURN int -#define PyDec_IsSpecial_ARGS (const PyObject *) - -#define PyDec_IsNaN_INDEX 2 -#define PyDec_IsNaN_RETURN int -#define PyDec_IsNaN_ARGS (const PyObject *) - -#define PyDec_IsInfinite_INDEX 3 -#define PyDec_IsInfinite_RETURN int -#define PyDec_IsInfinite_ARGS (const PyObject *) - -#define PyDec_GetDigits_INDEX 4 -#define PyDec_GetDigits_RETURN int64_t -#define PyDec_GetDigits_ARGS (const PyObject *) - -#define PyDec_AsUint128Triple_INDEX 5 -#define PyDec_AsUint128Triple_RETURN mpd_uint128_triple_t -#define PyDec_AsUint128Triple_ARGS (const PyObject *) - -#define PyDec_FromUint128Triple_INDEX 6 -#define PyDec_FromUint128Triple_RETURN PyObject * -#define PyDec_FromUint128Triple_ARGS (const mpd_uint128_triple_t *triple) - -/* Advanced API */ -#define PyDec_Alloc_INDEX 7 -#define PyDec_Alloc_RETURN PyObject * -#define PyDec_Alloc_ARGS (void) - -#define PyDec_Get_INDEX 8 -#define PyDec_Get_RETURN mpd_t * -#define PyDec_Get_ARGS (PyObject *) - -#define PyDec_GetConst_INDEX 9 -#define PyDec_GetConst_RETURN const mpd_t * -#define PyDec_GetConst_ARGS (const PyObject *) - -#define CPYTHON_DECIMAL_MAX_API 10 - - -#ifdef CPYTHON_DECIMAL_MODULE -/* Simple API */ -static PyDec_TypeCheck_RETURN PyDec_TypeCheck PyDec_TypeCheck_ARGS; -static PyDec_IsSpecial_RETURN PyDec_IsSpecial PyDec_IsSpecial_ARGS; -static PyDec_IsNaN_RETURN PyDec_IsNaN PyDec_IsNaN_ARGS; -static PyDec_IsInfinite_RETURN PyDec_IsInfinite PyDec_IsInfinite_ARGS; -static PyDec_GetDigits_RETURN PyDec_GetDigits PyDec_GetDigits_ARGS; -static PyDec_AsUint128Triple_RETURN PyDec_AsUint128Triple PyDec_AsUint128Triple_ARGS; -static PyDec_FromUint128Triple_RETURN PyDec_FromUint128Triple PyDec_FromUint128Triple_ARGS; - -/* Advanced API */ -static PyDec_Alloc_RETURN PyDec_Alloc PyDec_Alloc_ARGS; -static PyDec_Get_RETURN PyDec_Get PyDec_Get_ARGS; -static PyDec_GetConst_RETURN PyDec_GetConst PyDec_GetConst_ARGS; -#else -static void **_decimal_api; - -/* Simple API */ -#define PyDec_TypeCheck \ - (*(PyDec_TypeCheck_RETURN (*)PyDec_TypeCheck_ARGS) _decimal_api[PyDec_TypeCheck_INDEX]) - -#define PyDec_IsSpecial \ - (*(PyDec_IsSpecial_RETURN (*)PyDec_IsSpecial_ARGS) _decimal_api[PyDec_IsSpecial_INDEX]) - -#define PyDec_IsNaN \ - (*(PyDec_IsNaN_RETURN (*)PyDec_IsNaN_ARGS) _decimal_api[PyDec_IsNaN_INDEX]) - -#define PyDec_IsInfinite \ - (*(PyDec_IsInfinite_RETURN (*)PyDec_IsInfinite_ARGS) _decimal_api[PyDec_IsInfinite_INDEX]) - -#define PyDec_GetDigits \ - (*(PyDec_GetDigits_RETURN (*)PyDec_GetDigits_ARGS) _decimal_api[PyDec_GetDigits_INDEX]) - -#define PyDec_AsUint128Triple \ - (*(PyDec_AsUint128Triple_RETURN (*)PyDec_AsUint128Triple_ARGS) _decimal_api[PyDec_AsUint128Triple_INDEX]) - -#define PyDec_FromUint128Triple \ - (*(PyDec_FromUint128Triple_RETURN (*)PyDec_FromUint128Triple_ARGS) _decimal_api[PyDec_FromUint128Triple_INDEX]) - -/* Advanced API */ -#define PyDec_Alloc \ - (*(PyDec_Alloc_RETURN (*)PyDec_Alloc_ARGS) _decimal_api[PyDec_Alloc_INDEX]) - -#define PyDec_Get \ - (*(PyDec_Get_RETURN (*)PyDec_Get_ARGS) _decimal_api[PyDec_Get_INDEX]) - -#define PyDec_GetConst \ - (*(PyDec_GetConst_RETURN (*)PyDec_GetConst_ARGS) _decimal_api[PyDec_GetConst_INDEX]) - - -static int -import_decimal(void) -{ - _decimal_api = (void **)PyCapsule_Import(PyDec_CAPSULE_NAME, 0); - if (_decimal_api == NULL) { - return -1; - } - - return 0; -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* CPYTHON_DECIMAL_H_ */ diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index dbd58e8a6519b..6aa4a9b31a5f2 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -43,13 +43,6 @@ import inspect import threading -from _testcapi import decimal_is_special -from _testcapi import decimal_is_nan -from _testcapi import decimal_is_infinite -from _testcapi import decimal_get_digits -from _testcapi import decimal_as_triple -from _testcapi import decimal_from_triple - C = import_fresh_module('decimal', fresh=['_decimal']) P = import_fresh_module('decimal', blocked=['_decimal']) @@ -4758,175 +4751,6 @@ def test_constants(self): self.assertEqual(C.DecTraps, C.DecErrors|C.DecOverflow|C.DecUnderflow) - def test_decimal_api_predicates(self): - # Capsule API - - d = C.Decimal("0") - self.assertFalse(decimal_is_special(d)) - self.assertFalse(decimal_is_nan(d)) - self.assertFalse(decimal_is_infinite(d)) - - d = C.Decimal("NaN") - self.assertTrue(decimal_is_special(d)) - self.assertTrue(decimal_is_nan(d)) - self.assertFalse(decimal_is_infinite(d)) - - d = C.Decimal("sNaN") - self.assertTrue(decimal_is_special(d)) - self.assertTrue(decimal_is_nan(d)) - self.assertFalse(decimal_is_infinite(d)) - - d = C.Decimal("inf") - self.assertTrue(decimal_is_special(d)) - self.assertFalse(decimal_is_nan(d)) - self.assertTrue(decimal_is_infinite(d)) - - def test_decimal_api_get_digits(self): - # Capsule API - - d = C.Decimal("0") - self.assertEqual(decimal_get_digits(d), 1) - - d = C.Decimal("1234567890") - self.assertEqual(decimal_get_digits(d), 10) - - d = C.Decimal("inf") - self.assertEqual(decimal_get_digits(d), 0) - - d = C.Decimal("NaN") - self.assertEqual(decimal_get_digits(d), 0) - - d = C.Decimal("sNaN") - self.assertEqual(decimal_get_digits(d), 0) - - d = C.Decimal("NaN1234567890") - self.assertEqual(decimal_get_digits(d), 10) - - d = C.Decimal("sNaN1234567890") - self.assertEqual(decimal_get_digits(d), 10) - - def test_decimal_api_triple(self): - # Capsule API - - def as_triple(d): - """Convert a decimal to a decimal triple with a split uint128_t - coefficient: - - (sign, hi, lo, exp) - - It is called 'triple' because (hi, lo) are regarded as a single - uint128_t that is split because not all compilers support uint128_t. - """ - sign, digits, exp = d.as_tuple() - - s = "".join(str(d) for d in digits) - coeff = int(s) if s else 0 - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple"); - - hi, lo = divmod(coeff, 2**64) - return (sign, hi, lo, exp) - - def from_triple(triple): - """Convert a decimal triple with a split uint128_t coefficient to a string. - """ - sign, hi, lo, exp = triple - coeff = hi * 2**64 + lo - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple"); - - digits = tuple(int(c) for c in str(coeff)) - - return P.Decimal((sign, digits, exp)) - - signs = ["", "-"] - - coefficients = [ - "000000000000000000000000000000000000000", - - "299999999999999999999999999999999999999", - "299999999999999999990000000000000000000", - "200000000000000000009999999999999999999", - "000000000000000000009999999999999999999", - - "299999999999999999999999999999000000000", - "299999999999999999999000000000999999999", - "299999999999000000000999999999999999999", - "299000000000999999999999999999999999999", - "000999999999999999999999999999999999999", - - "300000000000000000000000000000000000000", - "310000000000000000001000000000000000000", - "310000000000000000000000000000000000000", - "300000000000000000001000000000000000000", - - "340100000000100000000100000000100000000", - "340100000000100000000100000000000000000", - "340100000000100000000000000000100000000", - "340100000000000000000100000000100000000", - "340000000000100000000100000000100000000", - - "340282366920938463463374607431768211455", - ] - - exponents = [ - "E+0", "E+1", "E-1", - "E+%s" % str(C.MAX_EMAX-38), - "E-%s" % str(C.MIN_ETINY+38), - ] - - for sign in signs: - for coeff in coefficients: - for exp in exponents: - s = sign + coeff + exp - - ctriple = decimal_as_triple(C.Decimal(s)) - ptriple = as_triple(P.Decimal(s)) - self.assertEqual(ctriple, ptriple) - - c = decimal_from_triple(ctriple) - p = decimal_from_triple(ptriple) - self.assertEqual(str(c), str(p)) - - for s in ["NaN", "-NaN", "sNaN", "-sNaN", "NaN123", "sNaN123", "inf", "-inf"]: - ctriple = decimal_as_triple(C.Decimal(s)) - ptriple = as_triple(P.Decimal(s)) - self.assertEqual(ctriple, ptriple) - - c = decimal_from_triple(ctriple) - p = decimal_from_triple(ptriple) - self.assertEqual(str(c), str(p)) - - def test_decimal_api_errors(self): - # Capsule API - - self.assertRaises(TypeError, decimal_as_triple, "X") - self.assertRaises(ValueError, decimal_as_triple, C.Decimal(2**128)) - self.assertRaises(ValueError, decimal_as_triple, C.Decimal(-2**128)) - - self.assertRaises(TypeError, decimal_from_triple, "X") - self.assertRaises(ValueError, decimal_from_triple, ()) - self.assertRaises(ValueError, decimal_from_triple, (1, 2, 3, 4, 5)) - self.assertRaises(ValueError, decimal_from_triple, (2**8, 0, 0, 0)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 2**64, 0, 0)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 2**64, 0)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 0, 2**63)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 0, -2**63-1)) - self.assertRaises(ValueError, decimal_from_triple, (0, 0, 0, "X")) - self.assertRaises(TypeError, decimal_from_triple, (0, 0, 0, ())) - - with C.localcontext(C.Context()): - self.assertRaises(C.InvalidOperation, decimal_from_triple, (2, 0, 0, 0)) - self.assertRaises(C.InvalidOperation, decimal_from_triple, (0, 0, 0, 2**63-1)) - self.assertRaises(C.InvalidOperation, decimal_from_triple, (0, 0, 0, -2**63)) - - self.assertRaises(TypeError, decimal_is_special, "X") - self.assertRaises(TypeError, decimal_is_nan, "X") - self.assertRaises(TypeError, decimal_is_infinite, "X") - self.assertRaises(TypeError, decimal_get_digits, "X") - class CWhitebox(unittest.TestCase): """Whitebox testing for _decimal""" diff --git a/Misc/NEWS.d/next/Library/2021-03-21-17-02-52.bpo-43422.POk6cU.rst b/Misc/NEWS.d/next/Library/2021-03-21-17-02-52.bpo-43422.POk6cU.rst new file mode 100644 index 0000000000000..4de3060d26e8f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-21-17-02-52.bpo-43422.POk6cU.rst @@ -0,0 +1 @@ +Revert the _decimal C API which was added in bpo-41324. diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 664d45a90481d..83e237d02bf5a 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,6 @@ #include -#define CPYTHON_DECIMAL_MODULE -#include "pydecimal.h" #include "docstrings.h" @@ -5570,175 +5568,6 @@ static PyTypeObject PyDecContext_Type = }; -/****************************************************************************/ -/* C-API */ -/****************************************************************************/ - -/* Simple API */ -static int -PyDec_TypeCheck(const PyObject *v) -{ - return PyDec_Check(v); -} - -static int -PyDec_IsSpecial(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_IsSpecial: argument must be a Decimal"); - return -1; - } - - return mpd_isspecial(MPD(v)); -} - -static int -PyDec_IsNaN(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_IsNaN: argument must be a Decimal"); - return -1; - } - - return mpd_isnan(MPD(v)); -} - -static int -PyDec_IsInfinite(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_IsInfinite: argument must be a Decimal"); - return -1; - } - - return mpd_isinfinite(MPD(v)); -} - -static int64_t -PyDec_GetDigits(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_GetDigits: argument must be a Decimal"); - return -1; - } - - return MPD(v)->digits; -} - -static mpd_uint128_triple_t -PyDec_AsUint128Triple(const PyObject *v) -{ - if (!PyDec_Check(v)) { - mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 }; - PyErr_SetString(PyExc_TypeError, - "PyDec_AsUint128Triple: argument must be a Decimal"); - return triple; - } - - return mpd_as_uint128_triple(MPD(v)); -} - -static PyObject * -PyDec_FromUint128Triple(const mpd_uint128_triple_t *triple) -{ - PyObject *context; - PyObject *result; - uint32_t status = 0; - - CURRENT_CONTEXT(context); - - result = dec_alloc(); - if (result == NULL) { - return NULL; - } - - if (mpd_from_uint128_triple(MPD(result), triple, &status) < 0) { - if (dec_addstatus(context, status)) { - Py_DECREF(result); - return NULL; - } - } - - return result; -} - -/* Advanced API */ -static PyObject * -PyDec_Alloc(void) -{ - return dec_alloc(); -} - -static mpd_t * -PyDec_Get(PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_Get: argument must be a Decimal"); - return NULL; - } - - return MPD(v); -} - -static const mpd_t * -PyDec_GetConst(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_GetConst: argument must be a Decimal"); - return NULL; - } - - return MPD(v); -} - -static void -destroy_api(PyObject *capsule) -{ - void *capi = PyCapsule_GetPointer(capsule, PyDec_CAPSULE_NAME); - PyMem_Free(capi); -} - -static PyObject * -init_api(void) -{ - void **_decimal_api = PyMem_Calloc(CPYTHON_DECIMAL_MAX_API, sizeof(void *)); - if (_decimal_api == NULL) { - PyErr_NoMemory(); - return NULL; - } - - /* Simple API */ - _decimal_api[PyDec_TypeCheck_INDEX] = (void *)PyDec_TypeCheck; - _decimal_api[PyDec_IsSpecial_INDEX] = (void *)PyDec_IsSpecial; - _decimal_api[PyDec_IsNaN_INDEX] = (void *)PyDec_IsNaN; - _decimal_api[PyDec_IsInfinite_INDEX] = (void *)PyDec_IsInfinite; - _decimal_api[PyDec_GetDigits_INDEX] = (void *)PyDec_GetDigits; - _decimal_api[PyDec_AsUint128Triple_INDEX] = (void *)PyDec_AsUint128Triple; - _decimal_api[PyDec_FromUint128Triple_INDEX] = (void *)PyDec_FromUint128Triple; - - /* Advanced API */ - _decimal_api[PyDec_Alloc_INDEX] = (void *)PyDec_Alloc; - _decimal_api[PyDec_Get_INDEX] = (void *)PyDec_Get; - _decimal_api[PyDec_GetConst_INDEX] = (void *)PyDec_GetConst; - - PyObject *capsule = PyCapsule_New(_decimal_api, PyDec_CAPSULE_NAME, destroy_api); - if (!capsule) { - PyMem_Free(_decimal_api); - } - return capsule; -} - - -/****************************************************************************/ -/* Module */ -/****************************************************************************/ - static PyMethodDef _decimal_methods [] = { { "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext}, @@ -5849,27 +5678,17 @@ PyInit__decimal(void) DecCondMap *cm; struct ssize_constmap *ssize_cm; struct int_constmap *int_cm; - static PyObject *capsule = NULL; - static int initialized = 0; int i; /* Init libmpdec */ - if (!initialized) { - mpd_traphandler = dec_traphandler; - mpd_mallocfunc = PyMem_Malloc; - mpd_reallocfunc = PyMem_Realloc; - mpd_callocfunc = mpd_callocfunc_em; - mpd_free = PyMem_Free; - mpd_setminalloc(_Py_DEC_MINALLOC); - - capsule = init_api(); - if (capsule == NULL) { - return NULL; - } + mpd_traphandler = dec_traphandler; + mpd_mallocfunc = PyMem_Malloc; + mpd_reallocfunc = PyMem_Realloc; + mpd_callocfunc = mpd_callocfunc_em; + mpd_free = PyMem_Free; + mpd_setminalloc(_Py_DEC_MINALLOC); - initialized = 1; - } /* Init external C-API functions */ _py_long_multiply = PyLong_Type.tp_as_number->nb_multiply; @@ -6094,10 +5913,6 @@ PyInit__decimal(void) CHECK_INT(PyModule_AddStringConstant(m, "__version__", "1.70")); CHECK_INT(PyModule_AddStringConstant(m, "__libmpdec_version__", mpd_version())); - /* Add capsule API */ - if (PyModule_AddObjectRef(m, "_API", capsule) < 0) { - goto error; - } return m; @@ -6121,7 +5936,6 @@ PyInit__decimal(void) Py_CLEAR(basic_context_template); /* GCOV_NOT_REACHED */ Py_CLEAR(extended_context_template); /* GCOV_NOT_REACHED */ Py_CLEAR(m); /* GCOV_NOT_REACHED */ - Py_CLEAR(capsule); /* GCOV_NOT_REACHED */ return NULL; /* GCOV_NOT_REACHED */ } diff --git a/Modules/_decimal/tests/bench.py b/Modules/_decimal/tests/bench.py index 88fd7b5ae0be3..3726db194e032 100644 --- a/Modules/_decimal/tests/bench.py +++ b/Modules/_decimal/tests/bench.py @@ -7,10 +7,13 @@ import time +try: + from test.support import import_fresh_module +except ImportError: + from test.test_support import import_fresh_module -import _decimal as C -import _pydecimal as P - +C = import_fresh_module('decimal', fresh=['_decimal']) +P = import_fresh_module('decimal', blocked=['_decimal']) # # NOTE: This is the pi function from the decimal documentation, modified diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index 5de57d1f875a2..98ecd502c03fe 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -47,18 +47,14 @@ from queue import Queue, Empty from threading import Thread, Event, Lock +from test.support import import_fresh_module from randdec import randfloat, all_unary, all_binary, all_ternary from randdec import unary_optarg, binary_optarg, ternary_optarg from formathelper import rand_format, rand_locale from _pydecimal import _dec_from_triple -from _testcapi import decimal_as_triple -from _testcapi import decimal_from_triple - -import _decimal as C -import _pydecimal as P - - +C = import_fresh_module('decimal', fresh=['_decimal']) +P = import_fresh_module('decimal', blocked=['_decimal']) EXIT_STATUS = 0 @@ -161,45 +157,6 @@ TernaryRestricted = ['__pow__', 'context.power'] -# ====================================================================== -# Triple tests -# ====================================================================== - -def c_as_triple(dec): - sign, hi, lo, exp = decimal_as_triple(dec) - - coeff = hi * 2**64 + lo - return (sign, coeff, exp) - -def c_from_triple(triple): - sign, coeff, exp = triple - - hi = coeff // 2**64 - lo = coeff % 2**64 - return decimal_from_triple((sign, hi, lo, exp)) - -def p_as_triple(dec): - sign, digits, exp = dec.as_tuple() - - s = "".join(str(d) for d in digits) - coeff = int(s) if s else 0 - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple") - - return (sign, coeff, exp) - -def p_from_triple(triple): - sign, coeff, exp = triple - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple") - - digits = tuple(int(c) for c in str(coeff)) - - return P.Decimal((sign, digits, exp)) - - # ====================================================================== # Unified Context # ====================================================================== @@ -893,44 +850,12 @@ def verify(t, stat): t.presults.append(str(t.rp.imag)) t.presults.append(str(t.rp.real)) - ctriple = None - if str(t.rc) == str(t.rp): # see skip handler - try: - ctriple = c_as_triple(t.rc) - except ValueError: - try: - ptriple = p_as_triple(t.rp) - except ValueError: - pass - else: - raise RuntimeError("ValueError not raised") - else: - cres = c_from_triple(ctriple) - t.cresults.append(ctriple) - t.cresults.append(str(cres)) - - ptriple = p_as_triple(t.rp) - pres = p_from_triple(ptriple) - t.presults.append(ptriple) - t.presults.append(str(pres)) - if t.with_maxcontext and isinstance(t.rmax, C.Decimal): t.maxresults.append(t.rmax.to_eng_string()) t.maxresults.append(t.rmax.as_tuple()) t.maxresults.append(str(t.rmax.imag)) t.maxresults.append(str(t.rmax.real)) - if ctriple is not None: - # NaN payloads etc. depend on precision and clamp. - if all_nan(t.rc) and all_nan(t.rmax): - t.maxresults.append(ctriple) - t.maxresults.append(str(cres)) - else: - maxtriple = c_as_triple(t.rmax) - maxres = c_from_triple(maxtriple) - t.maxresults.append(maxtriple) - t.maxresults.append(str(maxres)) - nc = t.rc.number_class().lstrip('+-s') stat[nc] += 1 else: diff --git a/Modules/_decimal/tests/formathelper.py b/Modules/_decimal/tests/formathelper.py index 482e02a25c2a8..19b2aad4a503b 100644 --- a/Modules/_decimal/tests/formathelper.py +++ b/Modules/_decimal/tests/formathelper.py @@ -31,10 +31,11 @@ import os, sys, locale, random import platform, subprocess +from test.support import import_fresh_module from distutils.spawn import find_executable -import _decimal as C -import _pydecimal as P +C = import_fresh_module('decimal', fresh=['_decimal']) +P = import_fresh_module('decimal', blocked=['_decimal']) windows_lang_strings = [ diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index ed59c32e9c5e7..20107f225794a 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -19,7 +19,6 @@ #include "Python.h" #include "datetime.h" -#include "pydecimal.h" #include "marshal.h" #include "structmember.h" // PyMemberDef #include @@ -2764,252 +2763,6 @@ test_PyDateTime_DELTA_GET(PyObject *self, PyObject *obj) return Py_BuildValue("(lll)", days, seconds, microseconds); } -/* Test decimal API */ -static int decimal_initialized = 0; -static PyObject * -decimal_is_special(PyObject *module, PyObject *dec) -{ - int is_special; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - is_special = PyDec_IsSpecial(dec); - if (is_special < 0) { - return NULL; - } - - return PyBool_FromLong(is_special); -} - -static PyObject * -decimal_is_nan(PyObject *module, PyObject *dec) -{ - int is_nan; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - is_nan = PyDec_IsNaN(dec); - if (is_nan < 0) { - return NULL; - } - - return PyBool_FromLong(is_nan); -} - -static PyObject * -decimal_is_infinite(PyObject *module, PyObject *dec) -{ - int is_infinite; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - is_infinite = PyDec_IsInfinite(dec); - if (is_infinite < 0) { - return NULL; - } - - return PyBool_FromLong(is_infinite); -} - -static PyObject * -decimal_get_digits(PyObject *module, PyObject *dec) -{ - int64_t digits; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - digits = PyDec_GetDigits(dec); - if (digits < 0) { - return NULL; - } - - return PyLong_FromLongLong(digits); -} - -static PyObject * -decimal_as_triple(PyObject *module, PyObject *dec) -{ - PyObject *tuple = NULL; - PyObject *sign, *hi, *lo; - mpd_uint128_triple_t triple; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - triple = PyDec_AsUint128Triple(dec); - if (triple.tag == MPD_TRIPLE_ERROR && PyErr_Occurred()) { - return NULL; - } - - sign = PyLong_FromUnsignedLong(triple.sign); - if (sign == NULL) { - return NULL; - } - - hi = PyLong_FromUnsignedLongLong(triple.hi); - if (hi == NULL) { - Py_DECREF(sign); - return NULL; - } - - lo = PyLong_FromUnsignedLongLong(triple.lo); - if (lo == NULL) { - Py_DECREF(hi); - Py_DECREF(sign); - return NULL; - } - - switch (triple.tag) { - case MPD_TRIPLE_QNAN: - assert(triple.exp == 0); - tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "n"); - break; - - case MPD_TRIPLE_SNAN: - assert(triple.exp == 0); - tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "N"); - break; - - case MPD_TRIPLE_INF: - assert(triple.hi == 0); - assert(triple.lo == 0); - assert(triple.exp == 0); - tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "F"); - break; - - case MPD_TRIPLE_NORMAL: - tuple = Py_BuildValue("(OOOL)", sign, hi, lo, triple.exp); - break; - - case MPD_TRIPLE_ERROR: - PyErr_SetString(PyExc_ValueError, - "value out of bounds for a uint128 triple"); - break; - - default: - PyErr_SetString(PyExc_RuntimeError, - "decimal_as_triple: internal error: unexpected tag"); - break; - } - - Py_DECREF(lo); - Py_DECREF(hi); - Py_DECREF(sign); - - return tuple; -} - -static PyObject * -decimal_from_triple(PyObject *module, PyObject *tuple) -{ - mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 }; - PyObject *exp; - unsigned long sign; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - if (!PyTuple_Check(tuple)) { - PyErr_SetString(PyExc_TypeError, "argument must be a tuple"); - return NULL; - } - - if (PyTuple_GET_SIZE(tuple) != 4) { - PyErr_SetString(PyExc_ValueError, "tuple size must be 4"); - return NULL; - } - - sign = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(tuple, 0)); - if (sign == (unsigned long)-1 && PyErr_Occurred()) { - return NULL; - } - if (sign > UINT8_MAX) { - PyErr_SetString(PyExc_ValueError, "sign must be 0 or 1"); - return NULL; - } - triple.sign = (uint8_t)sign; - - triple.hi = PyLong_AsUnsignedLongLong(PyTuple_GET_ITEM(tuple, 1)); - if (triple.hi == (unsigned long long)-1 && PyErr_Occurred()) { - return NULL; - } - - triple.lo = PyLong_AsUnsignedLongLong(PyTuple_GET_ITEM(tuple, 2)); - if (triple.lo == (unsigned long long)-1 && PyErr_Occurred()) { - return NULL; - } - - exp = PyTuple_GET_ITEM(tuple, 3); - if (PyLong_Check(exp)) { - triple.tag = MPD_TRIPLE_NORMAL; - triple.exp = PyLong_AsLongLong(exp); - if (triple.exp == -1 && PyErr_Occurred()) { - return NULL; - } - } - else if (PyUnicode_Check(exp)) { - if (PyUnicode_CompareWithASCIIString(exp, "F") == 0) { - triple.tag = MPD_TRIPLE_INF; - } - else if (PyUnicode_CompareWithASCIIString(exp, "n") == 0) { - triple.tag = MPD_TRIPLE_QNAN; - } - else if (PyUnicode_CompareWithASCIIString(exp, "N") == 0) { - triple.tag = MPD_TRIPLE_SNAN; - } - else { - PyErr_SetString(PyExc_ValueError, "not a valid exponent"); - return NULL; - } - } - else { - PyErr_SetString(PyExc_TypeError, "exponent must be int or string"); - return NULL; - } - - return PyDec_FromUint128Triple(&triple); -} - /* test_thread_state spawns a thread of its own, and that thread releases * `thread_done` when it's finished. The driver code has to know when the * thread finishes, because the thread uses a PyObject (the callable) that @@ -5725,12 +5478,6 @@ static PyMethodDef TestMethods[] = { {"PyDateTime_DATE_GET", test_PyDateTime_DATE_GET, METH_O}, {"PyDateTime_TIME_GET", test_PyDateTime_TIME_GET, METH_O}, {"PyDateTime_DELTA_GET", test_PyDateTime_DELTA_GET, METH_O}, - {"decimal_is_special", decimal_is_special, METH_O}, - {"decimal_is_nan", decimal_is_nan, METH_O}, - {"decimal_is_infinite", decimal_is_infinite, METH_O}, - {"decimal_get_digits", decimal_get_digits, METH_O}, - {"decimal_as_triple", decimal_as_triple, METH_O}, - {"decimal_from_triple", decimal_from_triple, METH_O}, {"test_list_api", test_list_api, METH_NOARGS}, {"test_dict_iteration", test_dict_iteration, METH_NOARGS}, {"dict_getitem_knownhash", dict_getitem_knownhash, METH_VARARGS}, From webhook-mailer at python.org Sun Mar 21 13:26:52 2021 From: webhook-mailer at python.org (pitrou) Date: Sun, 21 Mar 2021 17:26:52 -0000 Subject: [Python-checkins] bpo-43569: Add test/test_importlib/namespacedata01 to TESTSUBDIRS (GH-24952) Message-ID: https://github.com/python/cpython/commit/9a50ef43e42ee32450a81ce13ed5a0729d3b84e8 commit: 9a50ef43e42ee32450a81ce13ed5a0729d3b84e8 branch: master author: Jason R. Coombs committer: pitrou date: 2021-03-21T18:26:45+01:00 summary: bpo-43569: Add test/test_importlib/namespacedata01 to TESTSUBDIRS (GH-24952) files: M Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in index 5b47530a2a774..4f7284d31356f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1488,6 +1488,7 @@ TESTSUBDIRS= ctypes/test \ test/test_importlib/namespace_pkgs/project3 \ test/test_importlib/namespace_pkgs/project3/parent \ test/test_importlib/namespace_pkgs/project3/parent/child \ + test/test_importlib/namespacedata01 \ test/test_importlib/partial \ test/test_importlib/source \ test/test_importlib/zipdata01 \ From webhook-mailer at python.org Sun Mar 21 22:31:24 2021 From: webhook-mailer at python.org (tim-one) Date: Mon, 22 Mar 2021 02:31:24 -0000 Subject: [Python-checkins] bpo-43420: Simple optimizations for Fraction's arithmetics (GH-24779) Message-ID: https://github.com/python/cpython/commit/690aca781152a498f5117682524d2cd9aa4d7657 commit: 690aca781152a498f5117682524d2cd9aa4d7657 branch: master author: Sergey B Kirpichev <2155800+skirpichev at users.noreply.github.com> committer: tim-one date: 2021-03-21T21:30:55-05:00 summary: bpo-43420: Simple optimizations for Fraction's arithmetics (GH-24779) bpo-43420: Implement standard transformations in + - * / that can often reduce the size of intermediate integers needed. For rationals with large components, this can yield dramatic speed improvements, but for small rationals can run 10-20% slower, due to increased fixed overheads in the longer-winded code. If those slowdowns turn out to be a problem, see the PR discussion for low-level implementation tricks that could cut other fixed overheads. Co-authored-by: Tim Peters Co-authored-by: Mark Dickinson files: A Misc/NEWS.d/next/Library/2021-03-07-08-03-31.bpo-43420.cee_X5.rst M Lib/fractions.py M Lib/test/test_fractions.py M Misc/ACKS diff --git a/Lib/fractions.py b/Lib/fractions.py index de3e23b759227..96047beb4546a 100644 --- a/Lib/fractions.py +++ b/Lib/fractions.py @@ -380,32 +380,139 @@ def reverse(b, a): return forward, reverse + # Rational arithmetic algorithms: Knuth, TAOCP, Volume 2, 4.5.1. + # + # Assume input fractions a and b are normalized. + # + # 1) Consider addition/subtraction. + # + # Let g = gcd(da, db). Then + # + # na nb na*db ? nb*da + # a ? b == -- ? -- == ------------- == + # da db da*db + # + # na*(db//g) ? nb*(da//g) t + # == ----------------------- == - + # (da*db)//g d + # + # Now, if g > 1, we're working with smaller integers. + # + # Note, that t, (da//g) and (db//g) are pairwise coprime. + # + # Indeed, (da//g) and (db//g) share no common factors (they were + # removed) and da is coprime with na (since input fractions are + # normalized), hence (da//g) and na are coprime. By symmetry, + # (db//g) and nb are coprime too. Then, + # + # gcd(t, da//g) == gcd(na*(db//g), da//g) == 1 + # gcd(t, db//g) == gcd(nb*(da//g), db//g) == 1 + # + # Above allows us optimize reduction of the result to lowest + # terms. Indeed, + # + # g2 = gcd(t, d) == gcd(t, (da//g)*(db//g)*g) == gcd(t, g) + # + # t//g2 t//g2 + # a ? b == ----------------------- == ---------------- + # (da//g)*(db//g)*(g//g2) (da//g)*(db//g2) + # + # is a normalized fraction. This is useful because the unnormalized + # denominator d could be much larger than g. + # + # We should special-case g == 1 (and g2 == 1), since 60.8% of + # randomly-chosen integers are coprime: + # https://en.wikipedia.org/wiki/Coprime_integers#Probability_of_coprimality + # Note, that g2 == 1 always for fractions, obtained from floats: here + # g is a power of 2 and the unnormalized numerator t is an odd integer. + # + # 2) Consider multiplication + # + # Let g1 = gcd(na, db) and g2 = gcd(nb, da), then + # + # na*nb na*nb (na//g1)*(nb//g2) + # a*b == ----- == ----- == ----------------- + # da*db db*da (db//g1)*(da//g2) + # + # Note, that after divisions we're multiplying smaller integers. + # + # Also, the resulting fraction is normalized, because each of + # two factors in the numerator is coprime to each of the two factors + # in the denominator. + # + # Indeed, pick (na//g1). It's coprime with (da//g2), because input + # fractions are normalized. It's also coprime with (db//g1), because + # common factors are removed by g1 == gcd(na, db). + # + # As for addition/subtraction, we should special-case g1 == 1 + # and g2 == 1 for same reason. That happens also for multiplying + # rationals, obtained from floats. + def _add(a, b): """a + b""" - da, db = a.denominator, b.denominator - return Fraction(a.numerator * db + b.numerator * da, - da * db) + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g = math.gcd(da, db) + if g == 1: + return Fraction(na * db + da * nb, da * db, _normalize=False) + s = da // g + t = na * (db // g) + nb * s + g2 = math.gcd(t, g) + if g2 == 1: + return Fraction(t, s * db, _normalize=False) + return Fraction(t // g2, s * (db // g2), _normalize=False) __add__, __radd__ = _operator_fallbacks(_add, operator.add) def _sub(a, b): """a - b""" - da, db = a.denominator, b.denominator - return Fraction(a.numerator * db - b.numerator * da, - da * db) + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g = math.gcd(da, db) + if g == 1: + return Fraction(na * db - da * nb, da * db, _normalize=False) + s = da // g + t = na * (db // g) - nb * s + g2 = math.gcd(t, g) + if g2 == 1: + return Fraction(t, s * db, _normalize=False) + return Fraction(t // g2, s * (db // g2), _normalize=False) __sub__, __rsub__ = _operator_fallbacks(_sub, operator.sub) def _mul(a, b): """a * b""" - return Fraction(a.numerator * b.numerator, a.denominator * b.denominator) + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g1 = math.gcd(na, db) + if g1 > 1: + na //= g1 + db //= g1 + g2 = math.gcd(nb, da) + if g2 > 1: + nb //= g2 + da //= g2 + return Fraction(na * nb, db * da, _normalize=False) __mul__, __rmul__ = _operator_fallbacks(_mul, operator.mul) def _div(a, b): """a / b""" - return Fraction(a.numerator * b.denominator, - a.denominator * b.numerator) + # Same as _mul(), with inversed b. + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g1 = math.gcd(na, nb) + if g1 > 1: + na //= g1 + nb //= g1 + g2 = math.gcd(db, da) + if g2 > 1: + da //= g2 + db //= g2 + n, d = na * db, nb * da + if d < 0: + n, d = -n, -d + return Fraction(n, d, _normalize=False) __truediv__, __rtruediv__ = _operator_fallbacks(_div, operator.truediv) diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py index 0845f7921c39e..b92552531d6bb 100644 --- a/Lib/test/test_fractions.py +++ b/Lib/test/test_fractions.py @@ -369,7 +369,9 @@ def testArithmetic(self): self.assertEqual(F(1, 2), F(1, 10) + F(2, 5)) self.assertEqual(F(-3, 10), F(1, 10) - F(2, 5)) self.assertEqual(F(1, 25), F(1, 10) * F(2, 5)) + self.assertEqual(F(5, 6), F(2, 3) * F(5, 4)) self.assertEqual(F(1, 4), F(1, 10) / F(2, 5)) + self.assertEqual(F(-15, 8), F(3, 4) / F(-2, 5)) self.assertTypedEquals(2, F(9, 10) // F(2, 5)) self.assertTypedEquals(10**23, F(10**23, 1) // F(1)) self.assertEqual(F(5, 6), F(7, 3) % F(3, 2)) diff --git a/Misc/ACKS b/Misc/ACKS index d1cee7d02b786..5d3f75a4165b1 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -902,6 +902,7 @@ James King W. Trevor King Jeffrey Kintscher Paul Kippes +Sergey B Kirpichev Steve Kirsch Sebastian Kirsche Kamil Kisiel diff --git a/Misc/NEWS.d/next/Library/2021-03-07-08-03-31.bpo-43420.cee_X5.rst b/Misc/NEWS.d/next/Library/2021-03-07-08-03-31.bpo-43420.cee_X5.rst new file mode 100644 index 0000000000000..f9b3228772c12 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-07-08-03-31.bpo-43420.cee_X5.rst @@ -0,0 +1,2 @@ +Improve performance of class:`fractions.Fraction` arithmetics for large +components. Contributed by Sergey B. Kirpichev. From webhook-mailer at python.org Mon Mar 22 04:32:21 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 22 Mar 2021 08:32:21 -0000 Subject: [Python-checkins] bpo-35134: Add include/cpython/compile.h (GH-24922) Message-ID: https://github.com/python/cpython/commit/56f031ec5281723b7c617edfa5748f2ae6a4c347 commit: 56f031ec5281723b7c617edfa5748f2ae6a4c347 branch: master author: Hai Shi committer: vstinner date: 2021-03-22T09:32:11+01:00 summary: bpo-35134: Add include/cpython/compile.h (GH-24922) Move C API excluded from the limited C API from Include/compile.h to a new Include/cpython/compile.h header file. files: A Include/cpython/compile.h M Include/compile.h M Lib/__future__.py M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Include/compile.h b/Include/compile.h index 4dd5435ce71a9..3c5acd7209f76 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -1,102 +1,9 @@ #ifndef Py_COMPILE_H #define Py_COMPILE_H - -#ifndef Py_LIMITED_API - #ifdef __cplusplus extern "C" { #endif -/* Public interface */ -#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ - CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ - CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ - CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) -#define PyCF_MASK_OBSOLETE (CO_NESTED) - -/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. - PyCF_ constants can use bits from 0x0100 to 0x10000. - CO_FUTURE_ constants use bits starting at 0x20000. */ -#define PyCF_SOURCE_IS_UTF8 0x0100 -#define PyCF_DONT_IMPLY_DEDENT 0x0200 -#define PyCF_ONLY_AST 0x0400 -#define PyCF_IGNORE_COOKIE 0x0800 -#define PyCF_TYPE_COMMENTS 0x1000 -#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 -#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ - PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT) - -#ifndef Py_LIMITED_API -typedef struct { - int cf_flags; /* bitmask of CO_xxx flags relevant to future */ - int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */ -} PyCompilerFlags; - -#define _PyCompilerFlags_INIT \ - (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} -#endif - -/* Future feature support */ - -typedef struct { - int ff_features; /* flags set by future statements */ - int ff_lineno; /* line number of last future statement */ -} PyFutureFeatures; - -#define FUTURE_NESTED_SCOPES "nested_scopes" -#define FUTURE_GENERATORS "generators" -#define FUTURE_DIVISION "division" -#define FUTURE_ABSOLUTE_IMPORT "absolute_import" -#define FUTURE_WITH_STATEMENT "with_statement" -#define FUTURE_PRINT_FUNCTION "print_function" -#define FUTURE_UNICODE_LITERALS "unicode_literals" -#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" -#define FUTURE_GENERATOR_STOP "generator_stop" -#define FUTURE_ANNOTATIONS "annotations" - -struct _mod; /* Declare the existence of this type */ -#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar) -PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx( - struct _mod *mod, - const char *filename, /* decoded from the filesystem encoding */ - PyCompilerFlags *flags, - int optimize, - PyArena *arena); -PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject( - struct _mod *mod, - PyObject *filename, - PyCompilerFlags *flags, - int optimize, - PyArena *arena); -PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST( - struct _mod * mod, - const char *filename /* decoded from the filesystem encoding */ - ); -PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject( - struct _mod * mod, - PyObject *filename - ); - -/* _Py_Mangle is defined in compile.c */ -PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); - -#define PY_INVALID_STACK_EFFECT INT_MAX -PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); -PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); - -typedef struct { - int optimize; - int ff_features; -} _PyASTOptimizeState; - -PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeState *state); - -#ifdef __cplusplus -} -#endif - -#endif /* !Py_LIMITED_API */ - /* These definitions must match corresponding definitions in graminit.h. */ #define Py_single_input 256 #define Py_file_input 257 @@ -106,4 +13,13 @@ PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeSta /* This doesn't need to match anything */ #define Py_fstring_input 800 +#ifndef Py_LIMITED_API +# define Py_CPYTHON_COMPILE_H +# include "cpython/compile.h" +# undef Py_CPYTHON_COMPILE_H +#endif + +#ifdef __cplusplus +} +#endif #endif /* !Py_COMPILE_H */ diff --git a/Include/cpython/compile.h b/Include/cpython/compile.h new file mode 100644 index 0000000000000..47073e49e1c0d --- /dev/null +++ b/Include/cpython/compile.h @@ -0,0 +1,85 @@ +#ifndef Py_CPYTHON_COMPILE_H +# error "this header file must not be included directly" +#endif + +/* Public interface */ +#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ + CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ + CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ + CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) +#define PyCF_MASK_OBSOLETE (CO_NESTED) + +/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. + PyCF_ constants can use bits from 0x0100 to 0x10000. + CO_FUTURE_ constants use bits starting at 0x20000. */ +#define PyCF_SOURCE_IS_UTF8 0x0100 +#define PyCF_DONT_IMPLY_DEDENT 0x0200 +#define PyCF_ONLY_AST 0x0400 +#define PyCF_IGNORE_COOKIE 0x0800 +#define PyCF_TYPE_COMMENTS 0x1000 +#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 +#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ + PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT) + +typedef struct { + int cf_flags; /* bitmask of CO_xxx flags relevant to future */ + int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */ +} PyCompilerFlags; + +#define _PyCompilerFlags_INIT \ + (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} + +/* Future feature support */ + +typedef struct { + int ff_features; /* flags set by future statements */ + int ff_lineno; /* line number of last future statement */ +} PyFutureFeatures; + +#define FUTURE_NESTED_SCOPES "nested_scopes" +#define FUTURE_GENERATORS "generators" +#define FUTURE_DIVISION "division" +#define FUTURE_ABSOLUTE_IMPORT "absolute_import" +#define FUTURE_WITH_STATEMENT "with_statement" +#define FUTURE_PRINT_FUNCTION "print_function" +#define FUTURE_UNICODE_LITERALS "unicode_literals" +#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" +#define FUTURE_GENERATOR_STOP "generator_stop" +#define FUTURE_ANNOTATIONS "annotations" + +struct _mod; /* Declare the existence of this type */ +#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar) +PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx( + struct _mod *mod, + const char *filename, /* decoded from the filesystem encoding */ + PyCompilerFlags *flags, + int optimize, + PyArena *arena); +PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject( + struct _mod *mod, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + PyArena *arena); +PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST( + struct _mod * mod, + const char *filename /* decoded from the filesystem encoding */ + ); +PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject( + struct _mod * mod, + PyObject *filename + ); + +/* _Py_Mangle is defined in compile.c */ +PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); + +#define PY_INVALID_STACK_EFFECT INT_MAX +PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); +PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); + +typedef struct { + int optimize; + int ff_features; +} _PyASTOptimizeState; + +PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeState *state); diff --git a/Lib/__future__.py b/Lib/__future__.py index 0e7b555234335..326e2b24d1d04 100644 --- a/Lib/__future__.py +++ b/Lib/__future__.py @@ -42,7 +42,7 @@ argument to the builtin function compile() to enable the feature in dynamically compiled code. This flag is stored in the .compiler_flag attribute on _Future instances. These values must match the appropriate -#defines of CO_xxx flags in Include/compile.h. +#defines of CO_xxx flags in Include/cpython/compile.h. No feature line is ever to be deleted from this file. """ diff --git a/Makefile.pre.in b/Makefile.pre.in index 4f7284d31356f..6655edafeb1ec 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1105,6 +1105,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/cpython/bytesobject.h \ $(srcdir)/Include/cpython/ceval.h \ $(srcdir)/Include/cpython/code.h \ + $(srcdir)/Include/cpython/compile.h \ $(srcdir)/Include/cpython/dictobject.h \ $(srcdir)/Include/cpython/fileobject.h \ $(srcdir)/Include/cpython/fileutils.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index bab711e6f1b8d..53b9d7264c0a8 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -131,6 +131,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 1f51715eb754d..a4f82a183086d 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -393,6 +393,9 @@ Include\cpython + + Include + Include\cpython From webhook-mailer at python.org Mon Mar 22 05:47:20 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 22 Mar 2021 09:47:20 -0000 Subject: [Python-checkins] bpo-43551: Fix PyImport_Import() for subinterpreters (GH-24929) Message-ID: https://github.com/python/cpython/commit/88d9983b561cd59e5f186d98227de0c1a022b498 commit: 88d9983b561cd59e5f186d98227de0c1a022b498 branch: master author: junyixie committer: vstinner date: 2021-03-22T10:47:10+01:00 summary: bpo-43551: Fix PyImport_Import() for subinterpreters (GH-24929) Avoid static variables. files: M Python/import.c diff --git a/Python/import.c b/Python/import.c index d92e46aa670cb..b898a2bd9260d 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1744,26 +1744,29 @@ PyImport_ReloadModule(PyObject *m) PyObject * PyImport_Import(PyObject *module_name) { + _Py_IDENTIFIER(__import__); + _Py_IDENTIFIER(__builtins__); + PyThreadState *tstate = _PyThreadState_GET(); - static PyObject *silly_list = NULL; - static PyObject *builtins_str = NULL; - static PyObject *import_str = NULL; PyObject *globals = NULL; PyObject *import = NULL; PyObject *builtins = NULL; PyObject *r = NULL; /* Initialize constant string objects */ - if (silly_list == NULL) { - import_str = PyUnicode_InternFromString("__import__"); - if (import_str == NULL) - return NULL; - builtins_str = PyUnicode_InternFromString("__builtins__"); - if (builtins_str == NULL) - return NULL; - silly_list = PyList_New(0); - if (silly_list == NULL) - return NULL; + PyObject *import_str = _PyUnicode_FromId(&PyId___import__); // borrowed ref + if (import_str == NULL) { + return NULL; + } + + PyObject *builtins_str = _PyUnicode_FromId(&PyId___builtins__); // borrowed ref + if (builtins_str == NULL) { + return NULL; + } + + PyObject *from_list = PyList_New(0); + if (from_list == NULL) { + goto err; } /* Get the builtins from current globals */ @@ -1778,8 +1781,9 @@ PyImport_Import(PyObject *module_name) /* No globals -- use standard builtins, and fake globals */ builtins = PyImport_ImportModuleLevel("builtins", NULL, NULL, NULL, 0); - if (builtins == NULL) - return NULL; + if (builtins == NULL) { + goto err; + } globals = Py_BuildValue("{OO}", builtins_str, builtins); if (globals == NULL) goto err; @@ -1801,7 +1805,7 @@ PyImport_Import(PyObject *module_name) Always use absolute import here. Calling for side-effect of import. */ r = PyObject_CallFunction(import, "OOOOi", module_name, globals, - globals, silly_list, 0, NULL); + globals, from_list, 0, NULL); if (r == NULL) goto err; Py_DECREF(r); @@ -1815,6 +1819,7 @@ PyImport_Import(PyObject *module_name) Py_XDECREF(globals); Py_XDECREF(builtins); Py_XDECREF(import); + Py_XDECREF(from_list); return r; } From webhook-mailer at python.org Mon Mar 22 06:01:28 2021 From: webhook-mailer at python.org (corona10) Date: Mon, 22 Mar 2021 10:01:28 -0000 Subject: [Python-checkins] bpo-43575: Use PEP 590 vectorcall to speed up map() (GH-24955) Message-ID: https://github.com/python/cpython/commit/86883d40e93acae980e52b90fddd7d042e439beb commit: 86883d40e93acae980e52b90fddd7d042e439beb branch: master author: Dong-hee Na committer: corona10 date: 2021-03-22T19:01:14+09:00 summary: bpo-43575: Use PEP 590 vectorcall to speed up map() (GH-24955) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-21-12-26-32.bpo-43575.pl-nSg.rst M Python/bltinmodule.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-21-12-26-32.bpo-43575.pl-nSg.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-21-12-26-32.bpo-43575.pl-nSg.rst new file mode 100644 index 0000000000000..102325830347a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-21-12-26-32.bpo-43575.pl-nSg.rst @@ -0,0 +1,2 @@ +Speed up calls to ``map()`` by using the :pep:`590` ``vectorcall`` calling +convention. Patch by Dong-hee Na. diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 4683103e09437..9f83c036d0929 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1264,8 +1264,48 @@ map_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } lz->iters = iters; func = PyTuple_GET_ITEM(args, 0); - Py_INCREF(func); - lz->func = func; + lz->func = Py_NewRef(func); + + return (PyObject *)lz; +} + +static PyObject * +map_vectorcall(PyObject *type, PyObject * const*args, + size_t nargsf, PyObject *kwnames) +{ + PyTypeObject *tp = (PyTypeObject *)type; + if (tp == &PyMap_Type && !_PyArg_NoKwnames("map", kwnames)) { + return NULL; + } + + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); + if (nargs < 2) { + PyErr_SetString(PyExc_TypeError, + "map() must have at least two arguments."); + return NULL; + } + + PyObject *iters = PyTuple_New(nargs-1); + if (iters == NULL) { + return NULL; + } + + for (int i=1; itp_alloc(tp, 0); + if (lz == NULL) { + Py_DECREF(iters); + return NULL; + } + lz->iters = iters; + lz->func = Py_NewRef(args[0]); return (PyObject *)lz; } @@ -1403,6 +1443,7 @@ PyTypeObject PyMap_Type = { PyType_GenericAlloc, /* tp_alloc */ map_new, /* tp_new */ PyObject_GC_Del, /* tp_free */ + .tp_vectorcall = (vectorcallfunc)map_vectorcall }; From webhook-mailer at python.org Mon Mar 22 06:59:06 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 22 Mar 2021 10:59:06 -0000 Subject: [Python-checkins] Revert "bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)" (GH-24964) Message-ID: https://github.com/python/cpython/commit/39f643614d03748a5fad462fe7ed26a174a522fa commit: 39f643614d03748a5fad462fe7ed26a174a522fa branch: master author: Victor Stinner committer: vstinner date: 2021-03-22T11:58:59+01:00 summary: Revert "bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)" (GH-24964) This reverts commit 5bd1059184b154d339f1bd53d23c98b5bcf14c8c. files: M Include/internal/pycore_dtoa.h M Include/internal/pycore_interp.h M Python/dtoa.c diff --git a/Include/internal/pycore_dtoa.h b/Include/internal/pycore_dtoa.h index 0f61e75140858..3faf8cf6b2eef 100644 --- a/Include/internal/pycore_dtoa.h +++ b/Include/internal/pycore_dtoa.h @@ -1,6 +1,4 @@ #ifndef PY_NO_SHORT_FLOAT_REPR -#ifndef Py_INTERNAL_DTOA_H -#define Py_INTERNAL_DTOA_H #ifdef __cplusplus extern "C" { #endif @@ -19,21 +17,7 @@ PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); PyAPI_FUNC(double) _Py_dg_stdnan(int sign); PyAPI_FUNC(double) _Py_dg_infinity(int sign); -#define _PyDtoa_Kmax 7 - -typedef uint32_t _PyDtoa_ULong; -typedef int32_t _PyDtoa_Long; -typedef uint64_t _PyDtoa_ULLong; - -struct -_PyDtoa_Bigint { - struct _PyDtoa_Bigint *next; - int k, maxwds, sign, wds; - _PyDtoa_ULong x[1]; -}; - #ifdef __cplusplus } #endif -#endif /* !Py_INTERNAL_DTOA_H */ #endif /* !PY_NO_SHORT_FLOAT_REPR */ diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 1e4b3ff71eed4..fa0e26feb0f84 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -13,7 +13,6 @@ extern "C" { #include "pycore_gil.h" // struct _gil_runtime_state #include "pycore_gc.h" // struct _gc_runtime_state #include "pycore_warnings.h" // struct _warnings_runtime_state -#include "pycore_dtoa.h" struct _pending_calls { PyThread_type_lock lock; @@ -322,9 +321,6 @@ struct _is { struct ast_state ast; struct type_cache type_cache; -#ifndef PY_NO_SHORT_FLOAT_REPR - struct _PyDtoa_Bigint *dtoa_freelist[_PyDtoa_Kmax + 1]; -#endif }; extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); diff --git a/Python/dtoa.c b/Python/dtoa.c index c7002e5d86d51..e629b296426f3 100644 --- a/Python/dtoa.c +++ b/Python/dtoa.c @@ -119,16 +119,6 @@ #include "Python.h" #include "pycore_dtoa.h" -#include "pycore_interp.h" -#include "pycore_pystate.h" - -#define ULong _PyDtoa_ULong -#define Long _PyDtoa_Long -#define ULLong _PyDtoa_ULLong -#define Kmax _PyDtoa_Kmax - -typedef struct _PyDtoa_Bigint Bigint; - /* if PY_NO_SHORT_FLOAT_REPR is defined, then don't even try to compile the following code */ @@ -164,6 +154,11 @@ typedef struct _PyDtoa_Bigint Bigint; #error "doubles and ints have incompatible endianness" #endif + +typedef uint32_t ULong; +typedef int32_t Long; +typedef uint64_t ULLong; + #undef DEBUG #ifdef Py_DEBUG #define DEBUG @@ -302,6 +297,8 @@ BCinfo { #define FFFFFFFF 0xffffffffUL +#define Kmax 7 + /* struct Bigint is used to represent arbitrary-precision integers. These integers are stored in sign-magnitude format, with the magnitude stored as an array of base 2**32 digits. Bigints are always normalized: if x is a @@ -324,6 +321,14 @@ BCinfo { significant (x[0]) to most significant (x[wds-1]). */ +struct +Bigint { + struct Bigint *next; + int k, maxwds, sign, wds; + ULong x[1]; +}; + +typedef struct Bigint Bigint; #ifndef Py_USING_MEMORY_DEBUGGER @@ -346,13 +351,7 @@ BCinfo { Bfree to PyMem_Free. Investigate whether this has any significant performance on impact. */ - -/* Get Bigint freelist from interpreter */ -static Bigint ** -get_freelist(void) { - PyInterpreterState *interp = _PyInterpreterState_GET(); - return interp->dtoa_freelist; -} +static Bigint *freelist[Kmax+1]; /* Allocate space for a Bigint with up to 1<next; else { @@ -394,7 +393,6 @@ Bfree(Bigint *v) if (v->k > Kmax) FREE((void*)v); else { - Bigint **freelist = get_freelist(); v->next = freelist[v->k]; freelist[v->k] = v; } From webhook-mailer at python.org Mon Mar 22 12:24:57 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 22 Mar 2021 16:24:57 -0000 Subject: [Python-checkins] bpo-43591: Fix error location in interactive mode for errors at the end of the line (GH-24973) Message-ID: https://github.com/python/cpython/commit/123ff266cda9ad279106f20dca06ba114f6a9b8a commit: 123ff266cda9ad279106f20dca06ba114f6a9b8a branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-22T16:24:39Z summary: bpo-43591: Fix error location in interactive mode for errors at the end of the line (GH-24973) Co-authored-by: Erlend Egeberg Aasland files: M Lib/test/test_cmd_line.py M Parser/pegen.c diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index e87eede0c2676..25d3eec40c13d 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -851,13 +851,19 @@ def test_sys_flags_not_set(self): ) class SyntaxErrorTests(unittest.TestCase): - def test_tokenizer_error_with_stdin(self): - proc = subprocess.run([sys.executable, "-"], input = b"(1+2+3", + def check_string(self, code): + proc = subprocess.run([sys.executable, "-"], input=code, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.assertNotEqual(proc.returncode, 0) self.assertNotEqual(proc.stderr, None) self.assertIn(b"\nSyntaxError", proc.stderr) + def test_tokenizer_error_with_stdin(self): + self.check_string(b"(1+2+3") + + def test_decoding_error_at_the_end_of_the_line(self): + self.check_string(b"'\u1f'") + def test_main(): support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests) support.reap_children() diff --git a/Parser/pegen.c b/Parser/pegen.c index 24aa3af336c34..953480df6ab05 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -147,7 +147,11 @@ byte_offset_to_character_offset(PyObject *line, Py_ssize_t col_offset) if (!str) { return 0; } - assert(col_offset >= 0 && (unsigned long)col_offset <= strlen(str)); + Py_ssize_t len = strlen(str); + if (col_offset > len) { + col_offset = len; + } + assert(col_offset >= 0); PyObject *text = PyUnicode_DecodeUTF8(str, col_offset, "replace"); if (!text) { return 0; @@ -392,10 +396,10 @@ _PyPegen_raise_error(Parser *p, PyObject *errtype, const char *errmsg, ...) static PyObject * get_error_line(Parser *p, Py_ssize_t lineno) { - /* If p->tok->fp == NULL, then we're parsing from a string, which means that - the whole source is stored in p->tok->str. If not, then we're parsing - from the REPL, so the source lines of the current (multi-line) statement - are stored in p->tok->stdin_content */ + /* If the file descriptor is interactive, the source lines of the current + * (multi-line) statement are stored in p->tok->interactive_src_start. + * If not, we're parsing from a string, which means that the whole source + * is stored in p->tok->str. */ assert(p->tok->fp == NULL || p->tok->fp == stdin); char *cur_line = p->tok->fp_interactive ? p->tok->interactive_src_start : p->tok->str; From webhook-mailer at python.org Mon Mar 22 13:28:23 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 22 Mar 2021 17:28:23 -0000 Subject: [Python-checkins] bpo-43555: Report the column offset for invalid line continuation character (GH-24939) Message-ID: https://github.com/python/cpython/commit/96eeff516204b7cc751103fa33dcc665e387846e commit: 96eeff516204b7cc751103fa33dcc665e387846e branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-22T17:28:11Z summary: bpo-43555: Report the column offset for invalid line continuation character (GH-24939) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst M Lib/test/test_syntax.py M Parser/pegen.c M Parser/pegen.h diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 24233b29171f8..730c297717af5 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -1162,6 +1162,11 @@ def func2(): """ self._check_error(code, "expected ':'") + def test_invalid_line_continuation_error_position(self): + self._check_error(r"a = 3 \ 4", + "unexpected character after line continuation character", + lineno=1, offset=9) + def test_invalid_line_continuation_left_recursive(self): # Check bpo-42218: SyntaxErrors following left-recursive rules # (t_primary_raw in this case) need to be tested explicitly diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst new file mode 100644 index 0000000000000..55a2fe22aa8ab --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst @@ -0,0 +1,2 @@ +Report the column offset for :exc:`SyntaxError` for invalid line +continuation characters. Patch by Pablo Galindo. diff --git a/Parser/pegen.c b/Parser/pegen.c index 953480df6ab05..d2b7ec44eb155 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -328,6 +328,7 @@ tokenizer_error(Parser *p) const char *msg = NULL; PyObject* errtype = PyExc_SyntaxError; + Py_ssize_t col_offset = -1; switch (p->tok->done) { case E_TOKEN: msg = "invalid token"; @@ -359,16 +360,14 @@ tokenizer_error(Parser *p) msg = "too many levels of indentation"; break; case E_LINECONT: + col_offset = strlen(strtok(p->tok->buf, "\n")) - 1; msg = "unexpected character after line continuation character"; break; default: msg = "unknown parsing error"; } - PyErr_Format(errtype, msg); - // There is no reliable column information for this error - PyErr_SyntaxLocationObject(p->tok->filename, p->tok->lineno, 0); - + RAISE_ERROR_KNOWN_LOCATION(p, errtype, p->tok->lineno, col_offset, msg); return -1; } diff --git a/Parser/pegen.h b/Parser/pegen.h index 3765b2425fff7..8720e601a60cc 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -136,8 +136,9 @@ void *_PyPegen_raise_error_known_location(Parser *p, PyObject *errtype, void *_PyPegen_dummy_name(Parser *p, ...); Py_LOCAL_INLINE(void *) -RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, int lineno, - int col_offset, const char *errmsg, ...) +RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, + Py_ssize_t lineno, Py_ssize_t col_offset, + const char *errmsg, ...) { va_list va; va_start(va, errmsg); From webhook-mailer at python.org Mon Mar 22 15:07:17 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 22 Mar 2021 19:07:17 -0000 Subject: [Python-checkins] bpo-43555: Report the column offset for invalid line continuation character (GH-24939) (#24975) Message-ID: https://github.com/python/cpython/commit/994a519915bff4901abaa7476e2b91682dea619a commit: 994a519915bff4901abaa7476e2b91682dea619a branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: pablogsal date: 2021-03-22T19:07:05Z summary: bpo-43555: Report the column offset for invalid line continuation character (GH-24939) (#24975) (cherry picked from commit 96eeff516204b7cc751103fa33dcc665e387846e) Co-authored-by: Pablo Galindo Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst M Lib/test/test_syntax.py M Parser/pegen/pegen.c M Parser/pegen/pegen.h diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index f0c9c988e2441..650a03173a8f3 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -973,6 +973,11 @@ def func2(): """ self._check_error(code, "invalid syntax") + def test_invalid_line_continuation_error_position(self): + self._check_error(r"a = 3 \ 4", + "unexpected character after line continuation character", + lineno=1, offset=9) + def test_invalid_line_continuation_left_recursive(self): # Check bpo-42218: SyntaxErrors following left-recursive rules # (t_primary_raw in this case) need to be tested explicitly diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst new file mode 100644 index 0000000000000..55a2fe22aa8ab --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-19-22-49-40.bpo-43555.ZmhYSA.rst @@ -0,0 +1,2 @@ +Report the column offset for :exc:`SyntaxError` for invalid line +continuation characters. Patch by Pablo Galindo. diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 4e742a5ec7175..0a26275b23e0d 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -313,6 +313,7 @@ tokenizer_error(Parser *p) const char *msg = NULL; PyObject* errtype = PyExc_SyntaxError; + Py_ssize_t col_offset = -1; switch (p->tok->done) { case E_TOKEN: msg = "invalid token"; @@ -346,16 +347,14 @@ tokenizer_error(Parser *p) msg = "too many levels of indentation"; break; case E_LINECONT: + col_offset = strlen(strtok(p->tok->buf, "\n")) - 1; msg = "unexpected character after line continuation character"; break; default: msg = "unknown parsing error"; } - PyErr_Format(errtype, msg); - // There is no reliable column information for this error - PyErr_SyntaxLocationObject(p->tok->filename, p->tok->lineno, 0); - + RAISE_ERROR_KNOWN_LOCATION(p, errtype, p->tok->lineno, col_offset, msg); return -1; } diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index a2f524a597d23..224c5cbea6349 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -138,8 +138,9 @@ void *_PyPegen_raise_error_known_location(Parser *p, PyObject *errtype, void *_PyPegen_dummy_name(Parser *p, ...); Py_LOCAL_INLINE(void *) -RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, int lineno, - int col_offset, const char *errmsg, ...) +RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, + Py_ssize_t lineno, Py_ssize_t col_offset, + const char *errmsg, ...) { va_list va; va_start(va, errmsg); From webhook-mailer at python.org Mon Mar 22 18:52:25 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 22 Mar 2021 22:52:25 -0000 Subject: [Python-checkins] bpo-41718: regrtest saved_test_environment avoids imports (GH-24934) Message-ID: https://github.com/python/cpython/commit/532e063fc2bf9e6e80550670ddc5dc5d2b1d2450 commit: 532e063fc2bf9e6e80550670ddc5dc5d2b1d2450 branch: master author: Victor Stinner committer: vstinner date: 2021-03-22T23:52:13+01:00 summary: bpo-41718: regrtest saved_test_environment avoids imports (GH-24934) Reduce the number of modules imported by libregrtest. saved_test_environment no longer imports modules at startup, but try to get them from sys.modules. If an module is missing, skip the test. It also sets directly support.environment_altered. runtest() now now two saved_test_environment instances: one before importing the test module, one after importing it. Remove imports from test.libregrtest.save_env: * asyncio * logging * multiprocessing * shutil * sysconfig * urllib.request * warnings When a test method imports a module (ex: warnings) and the test has a side effect (ex: add a warnings filter), the side effect is not detected, because the module was not imported when Python enters the saved_test_environment context manager. files: M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/save_env.py diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index e46cc31caea5a..b4ef9fbb24522 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -211,6 +211,10 @@ def _test_module(the_module): support.run_unittest(tests) +def save_env(ns, test_name): + return saved_test_environment(test_name, ns.verbose, ns.quiet, pgo=ns.pgo) + + def _runtest_inner2(ns, test_name): # Load the test function, run the test function, handle huntrleaks # and findleaks to detect leaks @@ -229,12 +233,13 @@ def _runtest_inner2(ns, test_name): test_runner = functools.partial(_test_module, the_module) try: - if ns.huntrleaks: - # Return True if the test leaked references - refleak = dash_R(ns, test_name, test_runner) - else: - test_runner() - refleak = False + with save_env(ns, test_name): + if ns.huntrleaks: + # Return True if the test leaked references + refleak = dash_R(ns, test_name, test_runner) + else: + test_runner() + refleak = False finally: cleanup_test_droppings(test_name, ns.verbose) @@ -268,7 +273,7 @@ def _runtest_inner(ns, test_name, display_failure=True): try: clear_caches() - with saved_test_environment(test_name, ns.verbose, ns.quiet, pgo=ns.pgo) as environment: + with save_env(ns, test_name): refleak = _runtest_inner2(ns, test_name) except support.ResourceDenied as msg: if not ns.quiet and not ns.pgo: @@ -298,7 +303,7 @@ def _runtest_inner(ns, test_name, display_failure=True): if refleak: return FAILED - if environment.changed: + if support.environment_altered: return ENV_CHANGED return PASSED diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index 4c9c692400b92..f0bfcf389992d 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -1,21 +1,15 @@ -import asyncio import builtins import locale -import logging import os -import shutil import sys -import sysconfig import threading -import urllib.request -import warnings from test import support from test.support import os_helper from test.libregrtest.utils import print_warning -try: - import _multiprocessing, multiprocessing.process -except ImportError: - multiprocessing = None + + +class SkipTestEnvironment(Exception): + pass # Unit tests are supposed to leave the execution environment unchanged @@ -33,15 +27,13 @@ class saved_test_environment: #stuff Unless quiet is True, a warning is printed to stderr if any of - the saved items was changed by the test. The attribute 'changed' - is initially False, but is set to True if a change is detected. + the saved items was changed by the test. The support.environment_altered + attribute is set to True if a change is detected. If verbose is more than 1, the before and after state of changed items is also printed. """ - changed = False - def __init__(self, testname, verbose=0, quiet=False, *, pgo=False): self.testname = testname self.verbose = verbose @@ -73,20 +65,36 @@ def __init__(self, testname, verbose=0, quiet=False, *, pgo=False): 'urllib.requests._url_tempfiles', 'urllib.requests._opener', ) + def get_module(self, name): + # function for restore() methods + return sys.modules[name] + + def try_get_module(self, name): + # function for get() methods + try: + return self.get_module(name) + except KeyError: + raise SkipTestEnvironment + def get_urllib_requests__url_tempfiles(self): - return list(urllib.request._url_tempfiles) + urllib_request = self.try_get_module('urllib.request') + return list(urllib_request._url_tempfiles) def restore_urllib_requests__url_tempfiles(self, tempfiles): for filename in tempfiles: os_helper.unlink(filename) def get_urllib_requests__opener(self): - return urllib.request._opener + urllib_request = self.try_get_module('urllib.request') + return urllib_request._opener def restore_urllib_requests__opener(self, opener): - urllib.request._opener = opener + urllib_request = self.get_module('urllib.request') + urllib_request._opener = opener def get_asyncio_events__event_loop_policy(self): + self.try_get_module('asyncio') return support.maybe_get_event_loop_policy() def restore_asyncio_events__event_loop_policy(self, policy): + asyncio = self.get_module('asyncio') asyncio.set_event_loop_policy(policy) def get_sys_argv(self): @@ -145,8 +153,10 @@ def restore___import__(self, import_): builtins.__import__ = import_ def get_warnings_filters(self): + warnings = self.try_get_module('warnings') return id(warnings.filters), warnings.filters, warnings.filters[:] def restore_warnings_filters(self, saved_filters): + warnings = self.get_module('warnings') warnings.filters = saved_filters[1] warnings.filters[:] = saved_filters[2] @@ -161,23 +171,28 @@ def restore_asyncore_socket_map(self, saved_map): asyncore.socket_map.update(saved_map) def get_shutil_archive_formats(self): + shutil = self.try_get_module('shutil') # we could call get_archives_formats() but that only returns the # registry keys; we want to check the values too (the functions that # are registered) return shutil._ARCHIVE_FORMATS, shutil._ARCHIVE_FORMATS.copy() def restore_shutil_archive_formats(self, saved): + shutil = self.get_module('shutil') shutil._ARCHIVE_FORMATS = saved[0] shutil._ARCHIVE_FORMATS.clear() shutil._ARCHIVE_FORMATS.update(saved[1]) def get_shutil_unpack_formats(self): + shutil = self.try_get_module('shutil') return shutil._UNPACK_FORMATS, shutil._UNPACK_FORMATS.copy() def restore_shutil_unpack_formats(self, saved): + shutil = self.get_module('shutil') shutil._UNPACK_FORMATS = saved[0] shutil._UNPACK_FORMATS.clear() shutil._UNPACK_FORMATS.update(saved[1]) def get_logging__handlers(self): + logging = self.try_get_module('logging') # _handlers is a WeakValueDictionary return id(logging._handlers), logging._handlers, logging._handlers.copy() def restore_logging__handlers(self, saved_handlers): @@ -185,6 +200,7 @@ def restore_logging__handlers(self, saved_handlers): pass def get_logging__handlerList(self): + logging = self.try_get_module('logging') # _handlerList is a list of weakrefs to handlers return id(logging._handlerList), logging._handlerList, logging._handlerList[:] def restore_logging__handlerList(self, saved_handlerList): @@ -208,32 +224,34 @@ def restore_threading__dangling(self, saved): # Same for Process objects def get_multiprocessing_process__dangling(self): - if not multiprocessing: - return None + multiprocessing_process = self.try_get_module('multiprocessing.process') # Unjoined process objects can survive after process exits - multiprocessing.process._cleanup() + multiprocessing_process._cleanup() # This copies the weakrefs without making any strong reference - return multiprocessing.process._dangling.copy() + return multiprocessing_process._dangling.copy() def restore_multiprocessing_process__dangling(self, saved): - if not multiprocessing: - return - multiprocessing.process._dangling.clear() - multiprocessing.process._dangling.update(saved) + multiprocessing_process = self.get_module('multiprocessing.process') + multiprocessing_process._dangling.clear() + multiprocessing_process._dangling.update(saved) def get_sysconfig__CONFIG_VARS(self): # make sure the dict is initialized + sysconfig = self.try_get_module('sysconfig') sysconfig.get_config_var('prefix') return (id(sysconfig._CONFIG_VARS), sysconfig._CONFIG_VARS, dict(sysconfig._CONFIG_VARS)) def restore_sysconfig__CONFIG_VARS(self, saved): + sysconfig = self.get_module('sysconfig') sysconfig._CONFIG_VARS = saved[1] sysconfig._CONFIG_VARS.clear() sysconfig._CONFIG_VARS.update(saved[2]) def get_sysconfig__INSTALL_SCHEMES(self): + sysconfig = self.try_get_module('sysconfig') return (id(sysconfig._INSTALL_SCHEMES), sysconfig._INSTALL_SCHEMES, sysconfig._INSTALL_SCHEMES.copy()) def restore_sysconfig__INSTALL_SCHEMES(self, saved): + sysconfig = self.get_module('sysconfig') sysconfig._INSTALL_SCHEMES = saved[1] sysconfig._INSTALL_SCHEMES.clear() sysconfig._INSTALL_SCHEMES.update(saved[2]) @@ -264,8 +282,10 @@ def restore_locale(self, saved): locale.setlocale(lc, setting) def get_warnings_showwarning(self): + warnings = self.try_get_module('warnings') return warnings.showwarning def restore_warnings_showwarning(self, fxn): + warnings = self.get_module('warnings') warnings.showwarning = fxn def resource_info(self): @@ -276,26 +296,28 @@ def resource_info(self): yield name, getattr(self, get_name), getattr(self, restore_name) def __enter__(self): - self.saved_values = dict((name, get()) for name, get, restore - in self.resource_info()) + self.saved_values = [] + for name, get, restore in self.resource_info(): + try: + original = get() + except SkipTestEnvironment: + continue + + self.saved_values.append((name, get, restore, original)) return self def __exit__(self, exc_type, exc_val, exc_tb): saved_values = self.saved_values - del self.saved_values + self.saved_values = None # Some resources use weak references support.gc_collect() - # Read support.environment_altered, set by support helper functions - self.changed |= support.environment_altered - - for name, get, restore in self.resource_info(): + for name, get, restore, original in saved_values: current = get() - original = saved_values.pop(name) # Check for changes to the resource's value if current != original: - self.changed = True + support.environment_altered = True restore(original) if not self.quiet and not self.pgo: print_warning(f"{name} was modified by {self.testname}") From webhook-mailer at python.org Mon Mar 22 19:17:09 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 22 Mar 2021 23:17:09 -0000 Subject: [Python-checkins] bpo-41718: Reduce libregrtest runtest imports (GH-24980) Message-ID: https://github.com/python/cpython/commit/10417dd15f135c179cf4234d1abe506915d802ff commit: 10417dd15f135c179cf4234d1abe506915d802ff branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T00:17:05+01:00 summary: bpo-41718: Reduce libregrtest runtest imports (GH-24980) Move clear_caches() from libregrtest.refleak to libregrtest.utils to avoid importing libregrtest.refleak when it's not needed. clear_caches() now only calls re.purge() if 're' is in sys.modules. files: M Lib/test/libregrtest/refleak.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/utils.py diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 77298d318898d..7c7086a806b1c 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -5,6 +5,7 @@ from inspect import isabstract from test import support from test.support import os_helper +from test.libregrtest.utils import clear_caches try: from _abc import _get_dump @@ -181,102 +182,6 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): clear_caches() -def clear_caches(): - # Clear the warnings registry, so they can be displayed again - for mod in sys.modules.values(): - if hasattr(mod, '__warningregistry__'): - del mod.__warningregistry__ - - # Flush standard output, so that buffered data is sent to the OS and - # associated Python objects are reclaimed. - for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__): - if stream is not None: - stream.flush() - - # Clear assorted module caches. - # Don't worry about resetting the cache if the module is not loaded - try: - distutils_dir_util = sys.modules['distutils.dir_util'] - except KeyError: - pass - else: - distutils_dir_util._path_created.clear() - re.purge() - - try: - _strptime = sys.modules['_strptime'] - except KeyError: - pass - else: - _strptime._regex_cache.clear() - - try: - urllib_parse = sys.modules['urllib.parse'] - except KeyError: - pass - else: - urllib_parse.clear_cache() - - try: - urllib_request = sys.modules['urllib.request'] - except KeyError: - pass - else: - urllib_request.urlcleanup() - - try: - linecache = sys.modules['linecache'] - except KeyError: - pass - else: - linecache.clearcache() - - try: - mimetypes = sys.modules['mimetypes'] - except KeyError: - pass - else: - mimetypes._default_mime_types() - - try: - filecmp = sys.modules['filecmp'] - except KeyError: - pass - else: - filecmp._cache.clear() - - try: - struct = sys.modules['struct'] - except KeyError: - pass - else: - struct._clearcache() - - try: - doctest = sys.modules['doctest'] - except KeyError: - pass - else: - doctest.master = None - - try: - ctypes = sys.modules['ctypes'] - except KeyError: - pass - else: - ctypes._reset_cache() - - try: - typing = sys.modules['typing'] - except KeyError: - pass - else: - for f in typing._cleanups: - f() - - support.gc_collect() - - def warm_caches(): # char cache s = bytes(range(256)) diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index b4ef9fbb24522..470d7dd0351e0 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -13,7 +13,7 @@ from test import support from test.support import import_helper from test.support import os_helper -from test.libregrtest.refleak import dash_R, clear_caches +from test.libregrtest.utils import clear_caches from test.libregrtest.save_env import saved_test_environment from test.libregrtest.utils import format_duration, print_warning @@ -226,6 +226,9 @@ def _runtest_inner2(ns, test_name): the_module = importlib.import_module(abstest) + if ns.huntrleaks: + from test.libregrtest.refleak import dash_R + # If the test has a test_main, that will run the appropriate # tests. If not, use normal unittest test loading. test_runner = getattr(the_module, "test_main", None) diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index 71f538f0c4533..13efdb45818b7 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -84,3 +84,105 @@ def setup_unraisable_hook(): global orig_unraisablehook orig_unraisablehook = sys.unraisablehook sys.unraisablehook = regrtest_unraisable_hook + + +def clear_caches(): + # Clear the warnings registry, so they can be displayed again + for mod in sys.modules.values(): + if hasattr(mod, '__warningregistry__'): + del mod.__warningregistry__ + + # Flush standard output, so that buffered data is sent to the OS and + # associated Python objects are reclaimed. + for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__): + if stream is not None: + stream.flush() + + # Clear assorted module caches. + # Don't worry about resetting the cache if the module is not loaded + try: + distutils_dir_util = sys.modules['distutils.dir_util'] + except KeyError: + pass + else: + distutils_dir_util._path_created.clear() + + try: + re = sys.modules['re'] + except KeyError: + pass + else: + re.purge() + + try: + _strptime = sys.modules['_strptime'] + except KeyError: + pass + else: + _strptime._regex_cache.clear() + + try: + urllib_parse = sys.modules['urllib.parse'] + except KeyError: + pass + else: + urllib_parse.clear_cache() + + try: + urllib_request = sys.modules['urllib.request'] + except KeyError: + pass + else: + urllib_request.urlcleanup() + + try: + linecache = sys.modules['linecache'] + except KeyError: + pass + else: + linecache.clearcache() + + try: + mimetypes = sys.modules['mimetypes'] + except KeyError: + pass + else: + mimetypes._default_mime_types() + + try: + filecmp = sys.modules['filecmp'] + except KeyError: + pass + else: + filecmp._cache.clear() + + try: + struct = sys.modules['struct'] + except KeyError: + pass + else: + struct._clearcache() + + try: + doctest = sys.modules['doctest'] + except KeyError: + pass + else: + doctest.master = None + + try: + ctypes = sys.modules['ctypes'] + except KeyError: + pass + else: + ctypes._reset_cache() + + try: + typing = sys.modules['typing'] + except KeyError: + pass + else: + for f in typing._cleanups: + f() + + support.gc_collect() From webhook-mailer at python.org Mon Mar 22 20:08:57 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 00:08:57 -0000 Subject: [Python-checkins] bpo-41718: libregrtest runtest avoids import_helper (GH-24983) Message-ID: https://github.com/python/cpython/commit/0473fb222956063814b6beb5fd401f9eeaa8a56a commit: 0473fb222956063814b6beb5fd401f9eeaa8a56a branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T01:08:49+01:00 summary: bpo-41718: libregrtest runtest avoids import_helper (GH-24983) Inline import_helper.unload() in libregrtest.runtest to avoid one import. files: M Lib/test/libregrtest/runtest.py diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 470d7dd0351e0..927c470662970 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -11,7 +11,6 @@ import unittest from test import support -from test.support import import_helper from test.support import os_helper from test.libregrtest.utils import clear_caches from test.libregrtest.save_env import saved_test_environment @@ -222,7 +221,10 @@ def _runtest_inner2(ns, test_name): abstest = get_abs_module(ns, test_name) # remove the module from sys.module to reload it if it was already imported - import_helper.unload(abstest) + try: + del sys.modules[abstest] + except KeyError: + pass the_module = importlib.import_module(abstest) From webhook-mailer at python.org Mon Mar 22 20:11:38 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 00:11:38 -0000 Subject: [Python-checkins] bpo-41718: Disable support.testresult XML output by default (GH-24982) Message-ID: https://github.com/python/cpython/commit/30793e81bd90f3346e962435d49073bc588f067c commit: 30793e81bd90f3346e962435d49073bc588f067c branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T01:11:31+01:00 summary: bpo-41718: Disable support.testresult XML output by default (GH-24982) RegressionTestResult.USE_XML must now be set to True to get the JUnit XML output. Reduce the number of imports when --junit-xml=FILE option is not used: 153 => 144 (-9). files: M Lib/test/libregrtest/setup.py M Lib/test/support/testresult.py diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index 7738d4f28b658..715d4b96cf91d 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -93,6 +93,10 @@ def _test_audit_hook(name, args): support.SHORT_TIMEOUT = min(support.SHORT_TIMEOUT, ns.timeout) support.LONG_TIMEOUT = min(support.LONG_TIMEOUT, ns.timeout) + if ns.xmlpath: + from test.support.testresult import RegressionTestResult + RegressionTestResult.USE_XML = True + def replace_stdout(): """Set stdout encoder error handler to backslashreplace (as stderr error diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index 67e126dcf7527..6be3e5250ae58 100644 --- a/Lib/test/support/testresult.py +++ b/Lib/test/support/testresult.py @@ -9,21 +9,22 @@ import traceback import unittest -import xml.etree.ElementTree as ET - from datetime import datetime class RegressionTestResult(unittest.TextTestResult): separator1 = '=' * 70 + '\n' separator2 = '-' * 70 + '\n' + USE_XML = False def __init__(self, stream, descriptions, verbosity): super().__init__(stream=stream, descriptions=descriptions, verbosity=0) self.buffer = True - self.__suite = ET.Element('testsuite') - self.__suite.set('start', datetime.utcnow().isoformat(' ')) - - self.__e = None + if self.USE_XML: + from xml.etree import ElementTree as ET + self.__ET = ET + self.__suite = ET.Element('testsuite') + self.__suite.set('start', datetime.utcnow().isoformat(' ')) + self.__e = None self.__start_time = None self.__results = [] self.__verbose = bool(verbosity) @@ -42,17 +43,22 @@ def __getId(cls, test): def startTest(self, test): super().startTest(test) - self.__e = e = ET.SubElement(self.__suite, 'testcase') + if self.USE_XML: + self.__e = e = self.__ET.SubElement(self.__suite, 'testcase') self.__start_time = time.perf_counter() if self.__verbose: self.stream.write(f'{self.getDescription(test)} ... ') self.stream.flush() def _add_result(self, test, capture=False, **args): + if not self.USE_XML: + return e = self.__e self.__e = None if e is None: return + ET = self.__ET + e.set('name', args.pop('name', self.__getId(test))) e.set('status', args.pop('status', 'run')) e.set('result', args.pop('result', 'completed')) @@ -147,6 +153,8 @@ def printErrorList(self, flavor, errors): self.stream.write('%s\n' % err) def get_xml_element(self): + if not self.USE_XML: + raise ValueError("USE_XML is false") e = self.__suite e.set('tests', str(self.testsRun)) e.set('errors', str(len(self.errors))) @@ -174,6 +182,9 @@ def get_test_runner(stream, verbosity, capture_output=False): return get_test_runner_class(verbosity, capture_output)(stream) if __name__ == '__main__': + import xml.etree.ElementTree as ET + RegressionTestResult.USE_XML = True + class TestTests(unittest.TestCase): def test_pass(self): pass From webhook-mailer at python.org Mon Mar 22 20:40:47 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 00:40:47 -0000 Subject: [Python-checkins] bpo-41718: libregrtest avoids importing datetime (GH-24985) Message-ID: https://github.com/python/cpython/commit/9feae41c4f04ca27fd2c865807a5caeb50bf4fc4 commit: 9feae41c4f04ca27fd2c865807a5caeb50bf4fc4 branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T01:40:31+01:00 summary: bpo-41718: libregrtest avoids importing datetime (GH-24985) * libregrtest reimplements datetime.timedelta.__str__() * support.testresult only imports datetime if USE_XML is true. files: M Lib/test/libregrtest/main.py M Lib/test/support/testresult.py diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 793c99a8f4ca3..1df927da403d6 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -1,4 +1,3 @@ -import datetime import faulthandler import locale import os @@ -150,9 +149,12 @@ def log(self, line=''): # add the timestamp prefix: "0:01:05 " test_time = time.monotonic() - self.start_time - test_time = datetime.timedelta(seconds=int(test_time)) - line = f"{test_time} {line}" + mins, secs = divmod(int(test_time), 60) + hours, mins = divmod(mins, 60) + test_time = "%d:%02d:%02d" % (hours, mins, secs) + + line = f"{test_time} {line}" if empty: line = line[:-1] diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index 6be3e5250ae58..670afbea2659d 100644 --- a/Lib/test/support/testresult.py +++ b/Lib/test/support/testresult.py @@ -9,8 +9,6 @@ import traceback import unittest -from datetime import datetime - class RegressionTestResult(unittest.TextTestResult): separator1 = '=' * 70 + '\n' separator2 = '-' * 70 + '\n' @@ -21,6 +19,7 @@ def __init__(self, stream, descriptions, verbosity): self.buffer = True if self.USE_XML: from xml.etree import ElementTree as ET + from datetime import datetime self.__ET = ET self.__suite = ET.Element('testsuite') self.__suite.set('start', datetime.utcnow().isoformat(' ')) From webhook-mailer at python.org Tue Mar 23 11:25:48 2021 From: webhook-mailer at python.org (brettcannon) Date: Tue, 23 Mar 2021 15:25:48 -0000 Subject: [Python-checkins] Clarify attribute docs on types.ModuleType (GH-24974) Message-ID: https://github.com/python/cpython/commit/76b5d714e4e2b9f3b63847325cba51d4c4dc36bc commit: 76b5d714e4e2b9f3b63847325cba51d4c4dc36bc branch: master author: Brett Cannon committer: brettcannon date: 2021-03-23T08:25:39-07:00 summary: Clarify attribute docs on types.ModuleType (GH-24974) files: M Doc/library/types.rst diff --git a/Doc/library/types.rst b/Doc/library/types.rst index 8e05f8408e545..956b9e8f959c6 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -223,7 +223,7 @@ Standard names are defined for the following types: .. class:: ModuleType(name, doc=None) - The type of :term:`modules `. Constructor takes the name of the + The type of :term:`modules `. The constructor takes the name of the module to be created and optionally its :term:`docstring`. .. note:: @@ -238,12 +238,23 @@ Standard names are defined for the following types: The :term:`loader` which loaded the module. Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__loader__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. .. attribute:: __name__ - The name of the module. + The name of the module. Expected to match + :attr:`importlib.machinery.ModuleSpec.name`. .. attribute:: __package__ @@ -252,9 +263,26 @@ Standard names are defined for the following types: to ``''``, else it should be set to the name of the package (which can be :attr:`__name__` if the module is a package itself). Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__package__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. + .. attribute:: __spec__ + + A record of the the module's import-system-related state. Expected to be + an instance of :class:`importlib.machinery.ModuleSpec`. + + .. versionadded:: 3.4 + .. data:: EllipsisType From webhook-mailer at python.org Tue Mar 23 11:34:41 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 23 Mar 2021 15:34:41 -0000 Subject: [Python-checkins] Clarify attribute docs on types.ModuleType (GH-24974) Message-ID: https://github.com/python/cpython/commit/14a5db10ff16db3f9379433c4dbb3680547d1d12 commit: 14a5db10ff16db3f9379433c4dbb3680547d1d12 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-23T08:34:30-07:00 summary: Clarify attribute docs on types.ModuleType (GH-24974) (cherry picked from commit 76b5d714e4e2b9f3b63847325cba51d4c4dc36bc) Co-authored-by: Brett Cannon files: M Doc/library/types.rst diff --git a/Doc/library/types.rst b/Doc/library/types.rst index 998816b48610a..999a1f40c3391 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -209,7 +209,7 @@ Standard names are defined for the following types: .. class:: ModuleType(name, doc=None) - The type of :term:`modules `. Constructor takes the name of the + The type of :term:`modules `. The constructor takes the name of the module to be created and optionally its :term:`docstring`. .. note:: @@ -224,12 +224,23 @@ Standard names are defined for the following types: The :term:`loader` which loaded the module. Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__loader__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. .. attribute:: __name__ - The name of the module. + The name of the module. Expected to match + :attr:`importlib.machinery.ModuleSpec.name`. .. attribute:: __package__ @@ -238,9 +249,26 @@ Standard names are defined for the following types: to ``''``, else it should be set to the name of the package (which can be :attr:`__name__` if the module is a package itself). Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__package__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. + .. attribute:: __spec__ + + A record of the the module's import-system-related state. Expected to be + an instance of :class:`importlib.machinery.ModuleSpec`. + + .. versionadded:: 3.4 + .. class:: TracebackType(tb_next, tb_frame, tb_lasti, tb_lineno) From webhook-mailer at python.org Tue Mar 23 12:01:31 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 23 Mar 2021 16:01:31 -0000 Subject: [Python-checkins] Clarify attribute docs on types.ModuleType (GH-24974) Message-ID: https://github.com/python/cpython/commit/10e17bc69332f5dd99a4dfd4cfdf2290022ebc51 commit: 10e17bc69332f5dd99a4dfd4cfdf2290022ebc51 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-23T09:01:10-07:00 summary: Clarify attribute docs on types.ModuleType (GH-24974) (cherry picked from commit 76b5d714e4e2b9f3b63847325cba51d4c4dc36bc) Co-authored-by: Brett Cannon files: M Doc/library/types.rst diff --git a/Doc/library/types.rst b/Doc/library/types.rst index d83d9667ba3a7..d1099cf2af085 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -209,7 +209,7 @@ Standard names are defined for the following types: .. class:: ModuleType(name, doc=None) - The type of :term:`modules `. Constructor takes the name of the + The type of :term:`modules `. The constructor takes the name of the module to be created and optionally its :term:`docstring`. .. note:: @@ -224,12 +224,23 @@ Standard names are defined for the following types: The :term:`loader` which loaded the module. Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__loader__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. .. attribute:: __name__ - The name of the module. + The name of the module. Expected to match + :attr:`importlib.machinery.ModuleSpec.name`. .. attribute:: __package__ @@ -238,9 +249,26 @@ Standard names are defined for the following types: to ``''``, else it should be set to the name of the package (which can be :attr:`__name__` if the module is a package itself). Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__package__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. + .. attribute:: __spec__ + + A record of the the module's import-system-related state. Expected to be + an instance of :class:`importlib.machinery.ModuleSpec`. + + .. versionadded:: 3.4 + .. class:: GenericAlias(t_origin, t_args) From webhook-mailer at python.org Tue Mar 23 12:43:01 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 16:43:01 -0000 Subject: [Python-checkins] bpo-41718: subprocess imports grp and pwd on demand (GH-24987) Message-ID: https://github.com/python/cpython/commit/d72e8d487553c103bf2742e229f8266b515fd951 commit: d72e8d487553c103bf2742e229f8266b515fd951 branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T17:42:51+01:00 summary: bpo-41718: subprocess imports grp and pwd on demand (GH-24987) The shutil and subprocess modules now only import the grp and pwd modules when they are needed, which is not the case by default in subprocess. files: M Lib/shutil.py M Lib/subprocess.py diff --git a/Lib/shutil.py b/Lib/shutil.py index 89d924dec8aa4..e29fe4d83e927 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -32,16 +32,6 @@ except ImportError: _LZMA_SUPPORTED = False -try: - from pwd import getpwnam -except ImportError: - getpwnam = None - -try: - from grp import getgrnam -except ImportError: - getgrnam = None - _WINDOWS = os.name == 'nt' posix = nt = None if os.name == 'posix': @@ -843,8 +833,14 @@ def _is_immutable(src): def _get_gid(name): """Returns a gid, given a group name.""" - if getgrnam is None or name is None: + if name is None: + return None + + try: + from grp import getgrnam + except ImportError: return None + try: result = getgrnam(name) except KeyError: @@ -855,8 +851,14 @@ def _get_gid(name): def _get_uid(name): """Returns an uid, given a user name.""" - if getpwnam is None or name is None: + if name is None: return None + + try: + from pwd import getpwnam + except ImportError: + return None + try: result = getpwnam(name) except KeyError: diff --git a/Lib/subprocess.py b/Lib/subprocess.py index d375514b2dd0a..4b011e4ce5579 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -53,14 +53,6 @@ from time import monotonic as _time import types -try: - import pwd -except ImportError: - pwd = None -try: - import grp -except ImportError: - grp = None try: import fcntl except ImportError: @@ -875,7 +867,9 @@ def __init__(self, args, bufsize=-1, executable=None, "current platform") elif isinstance(group, str): - if grp is None: + try: + import grp + except ImportError: raise ValueError("The group parameter cannot be a string " "on systems without the grp module") @@ -901,7 +895,9 @@ def __init__(self, args, bufsize=-1, executable=None, gids = [] for extra_group in extra_groups: if isinstance(extra_group, str): - if grp is None: + try: + import grp + except ImportError: raise ValueError("Items in extra_groups cannot be " "strings on systems without the " "grp module") @@ -927,10 +923,11 @@ def __init__(self, args, bufsize=-1, executable=None, "the current platform") elif isinstance(user, str): - if pwd is None: + try: + import pwd + except ImportError: raise ValueError("The user parameter cannot be a string " "on systems without the pwd module") - uid = pwd.getpwnam(user).pw_uid elif isinstance(user, int): uid = user From webhook-mailer at python.org Tue Mar 23 13:41:01 2021 From: webhook-mailer at python.org (brettcannon) Date: Tue, 23 Mar 2021 17:41:01 -0000 Subject: [Python-checkins] [3.9] Clarify attribute docs on types.ModuleType (GH-24974) (#24994) Message-ID: https://github.com/python/cpython/commit/2d1cbe4193499914ccc9d217ea63eb17ff927c91 commit: 2d1cbe4193499914ccc9d217ea63eb17ff927c91 branch: 3.9 author: Brett Cannon committer: brettcannon date: 2021-03-23T10:40:56-07:00 summary: [3.9] Clarify attribute docs on types.ModuleType (GH-24974) (#24994) (cherry picked from commit 76b5d714e4e2b9f3b63847325cba51d4c4dc36bc) Co-authored-by: Brett Cannon files: From webhook-mailer at python.org Tue Mar 23 14:23:13 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 18:23:13 -0000 Subject: [Python-checkins] bpo-41718: runpy now imports pkgutil in functions (GH-24996) Message-ID: https://github.com/python/cpython/commit/bd9154a495434464283f74b660160f89930cd791 commit: bd9154a495434464283f74b660160f89930cd791 branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T19:22:57+01:00 summary: bpo-41718: runpy now imports pkgutil in functions (GH-24996) Reduce the number of modules imported by "python3 -m module". The runpy module no longer imports at startup (in the module body), but only in functions using it: _get_code_from_file() and run_path(). files: M Lib/runpy.py diff --git a/Lib/runpy.py b/Lib/runpy.py index 7e1e1ac5dde2d..caba121426238 100644 --- a/Lib/runpy.py +++ b/Lib/runpy.py @@ -16,7 +16,6 @@ import io import types import os -from pkgutil import read_code, get_importer __all__ = [ "run_module", "run_path", @@ -233,6 +232,7 @@ def _get_main_module_details(error=ImportError): def _get_code_from_file(run_name, fname): # Check for a compiled file first + from pkgutil import read_code decoded_path = os.path.abspath(os.fsdecode(fname)) with io.open_code(decoded_path) as f: code = read_code(f) @@ -255,6 +255,7 @@ def run_path(path_name, init_globals=None, run_name=None): if run_name is None: run_name = "" pkg_name = run_name.rpartition(".")[0] + from pkgutil import get_importer importer = get_importer(path_name) # Trying to avoid importing imp so as to not consume the deprecation warning. is_NullImporter = False From webhook-mailer at python.org Tue Mar 23 15:22:45 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 19:22:45 -0000 Subject: [Python-checkins] bpo-41718: Update runpy startup time What's New (GH-24998) Message-ID: https://github.com/python/cpython/commit/cd27af70d58161c59072e27a10e0e63dcbf0bccb commit: cd27af70d58161c59072e27a10e0e63dcbf0bccb branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T20:22:40+01:00 summary: bpo-41718: Update runpy startup time What's New (GH-24998) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index b5e425293962c..e9d29b0449da6 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -922,9 +922,10 @@ Optimizations (Contributed by Serhiy Storchaka in :issue:`41334`.) * The :mod:`runpy` module now imports fewer modules. - The ``python3 -m module-name`` command startup time is 1.3x faster in - average. - (Contributed by Victor Stinner in :issue:`41006`.) + The ``python3 -m module-name`` command startup time is 1.4x faster in + average. On Linux, ``python3 -I -m module-name`` imports 69 modules on Python + 3.9, whereas it only imports 51 modules (-18) on Python 3.10. + (Contributed by Victor Stinner in :issue:`41006` and :issue:`41718`.) * The ``LOAD_ATTR`` instruction now uses new "per opcode cache" mechanism. It is about 36% faster now for regular attributes and 44% faster for slots. From webhook-mailer at python.org Tue Mar 23 15:47:50 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 19:47:50 -0000 Subject: [Python-checkins] bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) Message-ID: https://github.com/python/cpython/commit/94faa0724f8cbae6867c491c8e465e35f4fdbfbb commit: 94faa0724f8cbae6867c491c8e465e35f4fdbfbb branch: master author: Victor Stinner committer: vstinner date: 2021-03-23T20:47:40+01:00 summary: bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) These functions were undocumented and excluded from the limited C API. Most names defined by these header files were not prefixed by "Py" and so could create names conflicts. For example, Python-ast.h defined a "Yield" macro which was conflict with the "Yield" name used by the Windows header. Use the Python ast module instead. * Move Include/asdl.h to Include/internal/pycore_asdl.h. * Move Include/Python-ast.h to Include/internal/pycore_ast.h. * Remove ast.h header file. * pycore_symtable.h no longer includes Python-ast.h. files: A Include/internal/pycore_asdl.h A Misc/NEWS.d/next/C API/2021-03-19-12-56-11.bpo-43244.VuIyOD.rst D Include/Python-ast.h D Include/asdl.h D Include/ast.h M .gitattributes M Doc/whatsnew/3.10.rst M Include/cpython/compile.h M Include/internal/pycore_ast.h M Include/internal/pycore_symtable.h M Makefile.pre.in M Modules/symtablemodule.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M PCbuild/regen.vcxproj M Parser/asdl_c.py M Parser/pegen.c M Parser/pegen.h M Parser/string_parser.h M Python/Python-ast.c M Python/asdl.c M Python/ast.c M Python/ast_unparse.c M Python/bltinmodule.c M Python/import.c M Python/pylifecycle.c M Python/pythonrun.c M Python/symtable.c M configure M configure.ac diff --git a/.gitattributes b/.gitattributes index 3827d09709d4a..c66e765266382 100644 --- a/.gitattributes +++ b/.gitattributes @@ -47,7 +47,7 @@ PC/clinic/*.h linguist-generated=true Python/clinic/*.h linguist-generated=true Python/importlib.h linguist-generated=true Python/importlib_external.h linguist-generated=true -Include/Python-ast.h linguist-generated=true +Include/internal/pycore_ast.h linguist-generated=true Python/Python-ast.c linguist-generated=true Include/opcode.h linguist-generated=true Python/opcode_targets.h linguist-generated=true diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index e9d29b0449da6..c55964328556b 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1384,5 +1384,13 @@ Removed it could not be used, because the ``symtable.h`` header file was excluded from the limited C API. - The Python :mod:`symtable` module remains available and is unchanged. + Use Python :mod:`symtable` module instead. + (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. + These functions were undocumented and excluded from the limited C API. + Most names defined by these header files were not prefixed by ``Py`` and so + could create names conflicts. For example, ``Python-ast.h`` defined a + ``Yield`` macro which was conflict with the ``Yield`` name used by the + Windows ```` header. Use the Python :mod:`ast` module instead. (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Include/Python-ast.h b/Include/Python-ast.h deleted file mode 100644 index bd127ca2ab0ca..0000000000000 --- a/Include/Python-ast.h +++ /dev/null @@ -1,828 +0,0 @@ -// File automatically generated by Parser/asdl_c.py. - -#ifndef Py_PYTHON_AST_H -#define Py_PYTHON_AST_H -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef Py_LIMITED_API -#include "asdl.h" - -#undef Yield /* undefine macro conflicting with */ - -typedef struct _mod *mod_ty; - -typedef struct _stmt *stmt_ty; - -typedef struct _expr *expr_ty; - -typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; - -typedef enum _boolop { And=1, Or=2 } boolop_ty; - -typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, - LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, - FloorDiv=13 } operator_ty; - -typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; - -typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, - In=9, NotIn=10 } cmpop_ty; - -typedef struct _comprehension *comprehension_ty; - -typedef struct _excepthandler *excepthandler_ty; - -typedef struct _arguments *arguments_ty; - -typedef struct _arg *arg_ty; - -typedef struct _keyword *keyword_ty; - -typedef struct _alias *alias_ty; - -typedef struct _withitem *withitem_ty; - -typedef struct _match_case *match_case_ty; - -typedef struct _type_ignore *type_ignore_ty; - - -typedef struct { - _ASDL_SEQ_HEAD - mod_ty typed_elements[1]; -} asdl_mod_seq; - -asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - stmt_ty typed_elements[1]; -} asdl_stmt_seq; - -asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - expr_ty typed_elements[1]; -} asdl_expr_seq; - -asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - comprehension_ty typed_elements[1]; -} asdl_comprehension_seq; - -asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena - *arena); - -typedef struct { - _ASDL_SEQ_HEAD - excepthandler_ty typed_elements[1]; -} asdl_excepthandler_seq; - -asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena - *arena); - -typedef struct { - _ASDL_SEQ_HEAD - arguments_ty typed_elements[1]; -} asdl_arguments_seq; - -asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - arg_ty typed_elements[1]; -} asdl_arg_seq; - -asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - keyword_ty typed_elements[1]; -} asdl_keyword_seq; - -asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - alias_ty typed_elements[1]; -} asdl_alias_seq; - -asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - withitem_ty typed_elements[1]; -} asdl_withitem_seq; - -asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - match_case_ty typed_elements[1]; -} asdl_match_case_seq; - -asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena - *arena); - -typedef struct { - _ASDL_SEQ_HEAD - type_ignore_ty typed_elements[1]; -} asdl_type_ignore_seq; - -asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena - *arena); - - -enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, - FunctionType_kind=4}; -struct _mod { - enum _mod_kind kind; - union { - struct { - asdl_stmt_seq *body; - asdl_type_ignore_seq *type_ignores; - } Module; - - struct { - asdl_stmt_seq *body; - } Interactive; - - struct { - expr_ty body; - } Expression; - - struct { - asdl_expr_seq *argtypes; - expr_ty returns; - } FunctionType; - - } v; -}; - -enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, - Return_kind=4, Delete_kind=5, Assign_kind=6, - AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, - AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, - AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17, - Assert_kind=18, Import_kind=19, ImportFrom_kind=20, - Global_kind=21, Nonlocal_kind=22, Expr_kind=23, Pass_kind=24, - Break_kind=25, Continue_kind=26}; -struct _stmt { - enum _stmt_kind kind; - union { - struct { - identifier name; - arguments_ty args; - asdl_stmt_seq *body; - asdl_expr_seq *decorator_list; - expr_ty returns; - string type_comment; - } FunctionDef; - - struct { - identifier name; - arguments_ty args; - asdl_stmt_seq *body; - asdl_expr_seq *decorator_list; - expr_ty returns; - string type_comment; - } AsyncFunctionDef; - - struct { - identifier name; - asdl_expr_seq *bases; - asdl_keyword_seq *keywords; - asdl_stmt_seq *body; - asdl_expr_seq *decorator_list; - } ClassDef; - - struct { - expr_ty value; - } Return; - - struct { - asdl_expr_seq *targets; - } Delete; - - struct { - asdl_expr_seq *targets; - expr_ty value; - string type_comment; - } Assign; - - struct { - expr_ty target; - operator_ty op; - expr_ty value; - } AugAssign; - - struct { - expr_ty target; - expr_ty annotation; - expr_ty value; - int simple; - } AnnAssign; - - struct { - expr_ty target; - expr_ty iter; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - string type_comment; - } For; - - struct { - expr_ty target; - expr_ty iter; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - string type_comment; - } AsyncFor; - - struct { - expr_ty test; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - } While; - - struct { - expr_ty test; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - } If; - - struct { - asdl_withitem_seq *items; - asdl_stmt_seq *body; - string type_comment; - } With; - - struct { - asdl_withitem_seq *items; - asdl_stmt_seq *body; - string type_comment; - } AsyncWith; - - struct { - expr_ty subject; - asdl_match_case_seq *cases; - } Match; - - struct { - expr_ty exc; - expr_ty cause; - } Raise; - - struct { - asdl_stmt_seq *body; - asdl_excepthandler_seq *handlers; - asdl_stmt_seq *orelse; - asdl_stmt_seq *finalbody; - } Try; - - struct { - expr_ty test; - expr_ty msg; - } Assert; - - struct { - asdl_alias_seq *names; - } Import; - - struct { - identifier module; - asdl_alias_seq *names; - int level; - } ImportFrom; - - struct { - asdl_identifier_seq *names; - } Global; - - struct { - asdl_identifier_seq *names; - } Nonlocal; - - struct { - expr_ty value; - } Expr; - - } v; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, - Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, - ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, - GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, - YieldFrom_kind=15, Compare_kind=16, Call_kind=17, - FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, - Attribute_kind=21, Subscript_kind=22, Starred_kind=23, - Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27, - MatchAs_kind=28, MatchOr_kind=29}; -struct _expr { - enum _expr_kind kind; - union { - struct { - boolop_ty op; - asdl_expr_seq *values; - } BoolOp; - - struct { - expr_ty target; - expr_ty value; - } NamedExpr; - - struct { - expr_ty left; - operator_ty op; - expr_ty right; - } BinOp; - - struct { - unaryop_ty op; - expr_ty operand; - } UnaryOp; - - struct { - arguments_ty args; - expr_ty body; - } Lambda; - - struct { - expr_ty test; - expr_ty body; - expr_ty orelse; - } IfExp; - - struct { - asdl_expr_seq *keys; - asdl_expr_seq *values; - } Dict; - - struct { - asdl_expr_seq *elts; - } Set; - - struct { - expr_ty elt; - asdl_comprehension_seq *generators; - } ListComp; - - struct { - expr_ty elt; - asdl_comprehension_seq *generators; - } SetComp; - - struct { - expr_ty key; - expr_ty value; - asdl_comprehension_seq *generators; - } DictComp; - - struct { - expr_ty elt; - asdl_comprehension_seq *generators; - } GeneratorExp; - - struct { - expr_ty value; - } Await; - - struct { - expr_ty value; - } Yield; - - struct { - expr_ty value; - } YieldFrom; - - struct { - expr_ty left; - asdl_int_seq *ops; - asdl_expr_seq *comparators; - } Compare; - - struct { - expr_ty func; - asdl_expr_seq *args; - asdl_keyword_seq *keywords; - } Call; - - struct { - expr_ty value; - int conversion; - expr_ty format_spec; - } FormattedValue; - - struct { - asdl_expr_seq *values; - } JoinedStr; - - struct { - constant value; - string kind; - } Constant; - - struct { - expr_ty value; - identifier attr; - expr_context_ty ctx; - } Attribute; - - struct { - expr_ty value; - expr_ty slice; - expr_context_ty ctx; - } Subscript; - - struct { - expr_ty value; - expr_context_ty ctx; - } Starred; - - struct { - identifier id; - expr_context_ty ctx; - } Name; - - struct { - asdl_expr_seq *elts; - expr_context_ty ctx; - } List; - - struct { - asdl_expr_seq *elts; - expr_context_ty ctx; - } Tuple; - - struct { - expr_ty lower; - expr_ty upper; - expr_ty step; - } Slice; - - struct { - expr_ty pattern; - identifier name; - } MatchAs; - - struct { - asdl_expr_seq *patterns; - } MatchOr; - - } v; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _comprehension { - expr_ty target; - expr_ty iter; - asdl_expr_seq *ifs; - int is_async; -}; - -enum _excepthandler_kind {ExceptHandler_kind=1}; -struct _excepthandler { - enum _excepthandler_kind kind; - union { - struct { - expr_ty type; - identifier name; - asdl_stmt_seq *body; - } ExceptHandler; - - } v; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _arguments { - asdl_arg_seq *posonlyargs; - asdl_arg_seq *args; - arg_ty vararg; - asdl_arg_seq *kwonlyargs; - asdl_expr_seq *kw_defaults; - arg_ty kwarg; - asdl_expr_seq *defaults; -}; - -struct _arg { - identifier arg; - expr_ty annotation; - string type_comment; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _keyword { - identifier arg; - expr_ty value; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _alias { - identifier name; - identifier asname; -}; - -struct _withitem { - expr_ty context_expr; - expr_ty optional_vars; -}; - -struct _match_case { - expr_ty pattern; - expr_ty guard; - asdl_stmt_seq *body; -}; - -enum _type_ignore_kind {TypeIgnore_kind=1}; -struct _type_ignore { - enum _type_ignore_kind kind; - union { - struct { - int lineno; - string tag; - } TypeIgnore; - - } v; -}; - - -// Note: these macros affect function definitions, not only call sites. -#define Module(a0, a1, a2) _Py_Module(a0, a1, a2) -mod_ty _Py_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, - PyArena *arena); -#define Interactive(a0, a1) _Py_Interactive(a0, a1) -mod_ty _Py_Interactive(asdl_stmt_seq * body, PyArena *arena); -#define Expression(a0, a1) _Py_Expression(a0, a1) -mod_ty _Py_Expression(expr_ty body, PyArena *arena); -#define FunctionType(a0, a1, a2) _Py_FunctionType(a0, a1, a2) -mod_ty _Py_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena - *arena); -#define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * - body, asdl_expr_seq * decorator_list, expr_ty returns, - string type_comment, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_stmt_seq - * body, asdl_expr_seq * decorator_list, expr_ty - returns, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -stmt_ty _Py_ClassDef(identifier name, asdl_expr_seq * bases, asdl_keyword_seq * - keywords, asdl_stmt_seq * body, asdl_expr_seq * - decorator_list, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Return(a0, a1, a2, a3, a4, a5) _Py_Return(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Delete(a0, a1, a2, a3, a4, a5) _Py_Delete(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Assign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Assign(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_Assign(asdl_expr_seq * targets, expr_ty value, string type_comment, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) -stmt_ty _Py_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int - simple, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, - asdl_stmt_seq * orelse, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena); -#define AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -stmt_ty _Py_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, - asdl_stmt_seq * orelse, string type_comment, int lineno, - int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define While(a0, a1, a2, a3, a4, a5, a6, a7) _Py_While(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define If(a0, a1, a2, a3, a4, a5, a6, a7) _Py_If(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int - lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define With(a0, a1, a2, a3, a4, a5, a6, a7) _Py_With(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string - type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, string - type_comment, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Match(a0, a1, a2, a3, a4, a5, a6) _Py_Match(a0, a1, a2, a3, a4, a5, a6) -stmt_ty _Py_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Raise(a0, a1, a2, a3, a4, a5, a6) _Py_Raise(a0, a1, a2, a3, a4, a5, a6) -stmt_ty _Py_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) -stmt_ty _Py_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, - asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Assert(a0, a1, a2, a3, a4, a5, a6) _Py_Assert(a0, a1, a2, a3, a4, a5, a6) -stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Import(a0, a1, a2, a3, a4, a5) _Py_Import(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Import(asdl_alias_seq * names, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_ImportFrom(identifier module, asdl_alias_seq * names, int level, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Global(a0, a1, a2, a3, a4, a5) _Py_Global(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Global(asdl_identifier_seq * names, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Nonlocal(a0, a1, a2, a3, a4, a5) _Py_Nonlocal(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Nonlocal(asdl_identifier_seq * names, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define Expr(a0, a1, a2, a3, a4, a5) _Py_Expr(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Pass(a0, a1, a2, a3, a4) _Py_Pass(a0, a1, a2, a3, a4) -stmt_ty _Py_Pass(int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Break(a0, a1, a2, a3, a4) _Py_Break(a0, a1, a2, a3, a4) -stmt_ty _Py_Break(int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Continue(a0, a1, a2, a3, a4) _Py_Continue(a0, a1, a2, a3, a4) -stmt_ty _Py_Continue(int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define BoolOp(a0, a1, a2, a3, a4, a5, a6) _Py_BoolOp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define NamedExpr(a0, a1, a2, a3, a4, a5, a6) _Py_NamedExpr(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_NamedExpr(expr_ty target, expr_ty value, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define BinOp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_BinOp(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define UnaryOp(a0, a1, a2, a3, a4, a5, a6) _Py_UnaryOp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define Lambda(a0, a1, a2, a3, a4, a5, a6) _Py_Lambda(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define IfExp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_IfExp(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Dict(a0, a1, a2, a3, a4, a5, a6) _Py_Dict(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Set(a0, a1, a2, a3, a4, a5) _Py_Set(a0, a1, a2, a3, a4, a5) -expr_ty _Py_Set(asdl_expr_seq * elts, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define ListComp(a0, a1, a2, a3, a4, a5, a6) _Py_ListComp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define SetComp(a0, a1, a2, a3, a4, a5, a6) _Py_SetComp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define DictComp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_DictComp(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * - generators, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define GeneratorExp(a0, a1, a2, a3, a4, a5, a6) _Py_GeneratorExp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Await(a0, a1, a2, a3, a4, a5) _Py_Await(a0, a1, a2, a3, a4, a5) -expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Yield(a0, a1, a2, a3, a4, a5) _Py_Yield(a0, a1, a2, a3, a4, a5) -expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define YieldFrom(a0, a1, a2, a3, a4, a5) _Py_YieldFrom(a0, a1, a2, a3, a4, a5) -expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Compare(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Compare(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * - comparators, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * - keywords, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define JoinedStr(a0, a1, a2, a3, a4, a5) _Py_JoinedStr(a0, a1, a2, a3, a4, a5) -expr_ty _Py_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Constant(a0, a1, a2, a3, a4, a5, a6) _Py_Constant(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Constant(constant value, string kind, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define Attribute(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Attribute(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Subscript(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Subscript(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Starred(a0, a1, a2, a3, a4, a5, a6) _Py_Starred(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Name(a0, a1, a2, a3, a4, a5, a6) _Py_Name(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define List(a0, a1, a2, a3, a4, a5, a6) _Py_List(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Tuple(a0, a1, a2, a3, a4, a5, a6) _Py_Tuple(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Slice(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Slice(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define MatchAs(a0, a1, a2, a3, a4, a5, a6) _Py_MatchAs(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_MatchAs(expr_ty pattern, identifier name, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define MatchOr(a0, a1, a2, a3, a4, a5) _Py_MatchOr(a0, a1, a2, a3, a4, a5) -expr_ty _Py_MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define comprehension(a0, a1, a2, a3, a4) _Py_comprehension(a0, a1, a2, a3, a4) -comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_expr_seq - * ifs, int is_async, PyArena *arena); -#define ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) -excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_stmt_seq - * body, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena - *arena); -#define arguments(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arguments(a0, a1, a2, a3, a4, a5, a6, a7) -arguments_ty _Py_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, - arg_ty vararg, asdl_arg_seq * kwonlyargs, - asdl_expr_seq * kw_defaults, arg_ty kwarg, - asdl_expr_seq * defaults, PyArena *arena); -#define arg(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arg(a0, a1, a2, a3, a4, a5, a6, a7) -arg_ty _Py_arg(identifier arg, expr_ty annotation, string type_comment, int - lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define keyword(a0, a1, a2, a3, a4, a5, a6) _Py_keyword(a0, a1, a2, a3, a4, a5, a6) -keyword_ty _Py_keyword(identifier arg, expr_ty value, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define alias(a0, a1, a2) _Py_alias(a0, a1, a2) -alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); -#define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2) -withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena - *arena); -#define match_case(a0, a1, a2, a3) _Py_match_case(a0, a1, a2, a3) -match_case_ty _Py_match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * - body, PyArena *arena); -#define TypeIgnore(a0, a1, a2) _Py_TypeIgnore(a0, a1, a2) -type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena); - -PyObject* PyAST_mod2obj(mod_ty t); -mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); -int PyAST_Check(PyObject* obj); -#endif /* !Py_LIMITED_API */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_PYTHON_AST_H */ diff --git a/Include/ast.h b/Include/ast.h deleted file mode 100644 index 82bfa4800cdd5..0000000000000 --- a/Include/ast.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef Py_LIMITED_API -#ifndef Py_AST_H -#define Py_AST_H -#ifdef __cplusplus -extern "C" { -#endif - -#include "Python-ast.h" /* mod_ty */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_AST_H */ -#endif /* !Py_LIMITED_API */ diff --git a/Include/cpython/compile.h b/Include/cpython/compile.h index 47073e49e1c0d..59ba1ed19644d 100644 --- a/Include/cpython/compile.h +++ b/Include/cpython/compile.h @@ -47,7 +47,8 @@ typedef struct { #define FUTURE_GENERATOR_STOP "generator_stop" #define FUTURE_ANNOTATIONS "annotations" -struct _mod; /* Declare the existence of this type */ +struct _mod; // Type defined in pycore_ast.h + #define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar) PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx( struct _mod *mod, diff --git a/Include/asdl.h b/Include/internal/pycore_asdl.h similarity index 84% rename from Include/asdl.h rename to Include/internal/pycore_asdl.h index 8b61e16c329ea..4df0e3440a634 100644 --- a/Include/asdl.h +++ b/Include/internal/pycore_asdl.h @@ -1,6 +1,12 @@ -#ifndef Py_LIMITED_API -#ifndef Py_ASDL_H -#define Py_ASDL_H +#ifndef Py_INTERNAL_ASDL_H +#define Py_INTERNAL_ASDL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif typedef PyObject * identifier; typedef PyObject * string; @@ -73,8 +79,9 @@ asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *a #define asdl_seq_GET_UNTYPED(S, I) (S)->elements[(I)] #define asdl_seq_GET(S, I) (S)->typed_elements[(I)] #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) + #ifdef Py_DEBUG -#define asdl_seq_SET(S, I, V) \ +# define asdl_seq_SET(S, I, V) \ do { \ Py_ssize_t _asdl_i = (I); \ assert((S) != NULL); \ @@ -82,11 +89,11 @@ asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *a (S)->typed_elements[_asdl_i] = (V); \ } while (0) #else -#define asdl_seq_SET(S, I, V) (S)->typed_elements[I] = (V) +# define asdl_seq_SET(S, I, V) (S)->typed_elements[I] = (V) #endif #ifdef Py_DEBUG -#define asdl_seq_SET_UNTYPED(S, I, V) \ +# define asdl_seq_SET_UNTYPED(S, I, V) \ do { \ Py_ssize_t _asdl_i = (I); \ assert((S) != NULL); \ @@ -94,8 +101,10 @@ asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *a (S)->elements[_asdl_i] = (V); \ } while (0) #else -#define asdl_seq_SET_UNTYPED(S, I, V) (S)->elements[I] = (V) +# define asdl_seq_SET_UNTYPED(S, I, V) (S)->elements[I] = (V) #endif -#endif /* !Py_ASDL_H */ -#endif /* Py_LIMITED_API */ +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ASDL_H */ diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast.h index 6cc0b9b3b000f..ac1e387560b78 100644 --- a/Include/internal/pycore_ast.h +++ b/Include/internal/pycore_ast.h @@ -1,3 +1,5 @@ +// File automatically generated by Parser/asdl_c.py. + #ifndef Py_INTERNAL_AST_H #define Py_INTERNAL_AST_H #ifdef __cplusplus @@ -8,7 +10,820 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "Python-ast.h" // expr_ty +#include "pycore_asdl.h" + +#undef Yield /* undefine macro conflicting with */ + +typedef struct _mod *mod_ty; + +typedef struct _stmt *stmt_ty; + +typedef struct _expr *expr_ty; + +typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; + +typedef enum _boolop { And=1, Or=2 } boolop_ty; + +typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, + LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, + FloorDiv=13 } operator_ty; + +typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; + +typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, + In=9, NotIn=10 } cmpop_ty; + +typedef struct _comprehension *comprehension_ty; + +typedef struct _excepthandler *excepthandler_ty; + +typedef struct _arguments *arguments_ty; + +typedef struct _arg *arg_ty; + +typedef struct _keyword *keyword_ty; + +typedef struct _alias *alias_ty; + +typedef struct _withitem *withitem_ty; + +typedef struct _match_case *match_case_ty; + +typedef struct _type_ignore *type_ignore_ty; + + +typedef struct { + _ASDL_SEQ_HEAD + mod_ty typed_elements[1]; +} asdl_mod_seq; + +asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + stmt_ty typed_elements[1]; +} asdl_stmt_seq; + +asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + expr_ty typed_elements[1]; +} asdl_expr_seq; + +asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + comprehension_ty typed_elements[1]; +} asdl_comprehension_seq; + +asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + excepthandler_ty typed_elements[1]; +} asdl_excepthandler_seq; + +asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arguments_ty typed_elements[1]; +} asdl_arguments_seq; + +asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arg_ty typed_elements[1]; +} asdl_arg_seq; + +asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + keyword_ty typed_elements[1]; +} asdl_keyword_seq; + +asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + alias_ty typed_elements[1]; +} asdl_alias_seq; + +asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + withitem_ty typed_elements[1]; +} asdl_withitem_seq; + +asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + match_case_ty typed_elements[1]; +} asdl_match_case_seq; + +asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + type_ignore_ty typed_elements[1]; +} asdl_type_ignore_seq; + +asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena + *arena); + + +enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, + FunctionType_kind=4}; +struct _mod { + enum _mod_kind kind; + union { + struct { + asdl_stmt_seq *body; + asdl_type_ignore_seq *type_ignores; + } Module; + + struct { + asdl_stmt_seq *body; + } Interactive; + + struct { + expr_ty body; + } Expression; + + struct { + asdl_expr_seq *argtypes; + expr_ty returns; + } FunctionType; + + } v; +}; + +enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, + Return_kind=4, Delete_kind=5, Assign_kind=6, + AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, + AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, + AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17, + Assert_kind=18, Import_kind=19, ImportFrom_kind=20, + Global_kind=21, Nonlocal_kind=22, Expr_kind=23, Pass_kind=24, + Break_kind=25, Continue_kind=26}; +struct _stmt { + enum _stmt_kind kind; + union { + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + } FunctionDef; + + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + } AsyncFunctionDef; + + struct { + identifier name; + asdl_expr_seq *bases; + asdl_keyword_seq *keywords; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + } ClassDef; + + struct { + expr_ty value; + } Return; + + struct { + asdl_expr_seq *targets; + } Delete; + + struct { + asdl_expr_seq *targets; + expr_ty value; + string type_comment; + } Assign; + + struct { + expr_ty target; + operator_ty op; + expr_ty value; + } AugAssign; + + struct { + expr_ty target; + expr_ty annotation; + expr_ty value; + int simple; + } AnnAssign; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } For; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } AsyncFor; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } While; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } If; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } With; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } AsyncWith; + + struct { + expr_ty subject; + asdl_match_case_seq *cases; + } Match; + + struct { + expr_ty exc; + expr_ty cause; + } Raise; + + struct { + asdl_stmt_seq *body; + asdl_excepthandler_seq *handlers; + asdl_stmt_seq *orelse; + asdl_stmt_seq *finalbody; + } Try; + + struct { + expr_ty test; + expr_ty msg; + } Assert; + + struct { + asdl_alias_seq *names; + } Import; + + struct { + identifier module; + asdl_alias_seq *names; + int level; + } ImportFrom; + + struct { + asdl_identifier_seq *names; + } Global; + + struct { + asdl_identifier_seq *names; + } Nonlocal; + + struct { + expr_ty value; + } Expr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, + Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, + ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, + GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, + YieldFrom_kind=15, Compare_kind=16, Call_kind=17, + FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, + Attribute_kind=21, Subscript_kind=22, Starred_kind=23, + Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27, + MatchAs_kind=28, MatchOr_kind=29}; +struct _expr { + enum _expr_kind kind; + union { + struct { + boolop_ty op; + asdl_expr_seq *values; + } BoolOp; + + struct { + expr_ty target; + expr_ty value; + } NamedExpr; + + struct { + expr_ty left; + operator_ty op; + expr_ty right; + } BinOp; + + struct { + unaryop_ty op; + expr_ty operand; + } UnaryOp; + + struct { + arguments_ty args; + expr_ty body; + } Lambda; + + struct { + expr_ty test; + expr_ty body; + expr_ty orelse; + } IfExp; + + struct { + asdl_expr_seq *keys; + asdl_expr_seq *values; + } Dict; + + struct { + asdl_expr_seq *elts; + } Set; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } ListComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } SetComp; + + struct { + expr_ty key; + expr_ty value; + asdl_comprehension_seq *generators; + } DictComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } GeneratorExp; + + struct { + expr_ty value; + } Await; + + struct { + expr_ty value; + } Yield; + + struct { + expr_ty value; + } YieldFrom; + + struct { + expr_ty left; + asdl_int_seq *ops; + asdl_expr_seq *comparators; + } Compare; + + struct { + expr_ty func; + asdl_expr_seq *args; + asdl_keyword_seq *keywords; + } Call; + + struct { + expr_ty value; + int conversion; + expr_ty format_spec; + } FormattedValue; + + struct { + asdl_expr_seq *values; + } JoinedStr; + + struct { + constant value; + string kind; + } Constant; + + struct { + expr_ty value; + identifier attr; + expr_context_ty ctx; + } Attribute; + + struct { + expr_ty value; + expr_ty slice; + expr_context_ty ctx; + } Subscript; + + struct { + expr_ty value; + expr_context_ty ctx; + } Starred; + + struct { + identifier id; + expr_context_ty ctx; + } Name; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } List; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } Tuple; + + struct { + expr_ty lower; + expr_ty upper; + expr_ty step; + } Slice; + + struct { + expr_ty pattern; + identifier name; + } MatchAs; + + struct { + asdl_expr_seq *patterns; + } MatchOr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _comprehension { + expr_ty target; + expr_ty iter; + asdl_expr_seq *ifs; + int is_async; +}; + +enum _excepthandler_kind {ExceptHandler_kind=1}; +struct _excepthandler { + enum _excepthandler_kind kind; + union { + struct { + expr_ty type; + identifier name; + asdl_stmt_seq *body; + } ExceptHandler; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _arguments { + asdl_arg_seq *posonlyargs; + asdl_arg_seq *args; + arg_ty vararg; + asdl_arg_seq *kwonlyargs; + asdl_expr_seq *kw_defaults; + arg_ty kwarg; + asdl_expr_seq *defaults; +}; + +struct _arg { + identifier arg; + expr_ty annotation; + string type_comment; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _keyword { + identifier arg; + expr_ty value; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _alias { + identifier name; + identifier asname; +}; + +struct _withitem { + expr_ty context_expr; + expr_ty optional_vars; +}; + +struct _match_case { + expr_ty pattern; + expr_ty guard; + asdl_stmt_seq *body; +}; + +enum _type_ignore_kind {TypeIgnore_kind=1}; +struct _type_ignore { + enum _type_ignore_kind kind; + union { + struct { + int lineno; + string tag; + } TypeIgnore; + + } v; +}; + + +// Note: these macros affect function definitions, not only call sites. +#define Module(a0, a1, a2) _Py_Module(a0, a1, a2) +mod_ty _Py_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, + PyArena *arena); +#define Interactive(a0, a1) _Py_Interactive(a0, a1) +mod_ty _Py_Interactive(asdl_stmt_seq * body, PyArena *arena); +#define Expression(a0, a1) _Py_Expression(a0, a1) +mod_ty _Py_Expression(expr_ty body, PyArena *arena); +#define FunctionType(a0, a1, a2) _Py_FunctionType(a0, a1, a2) +mod_ty _Py_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena + *arena); +#define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) +stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * + body, asdl_expr_seq * decorator_list, expr_ty returns, + string type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) +stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_stmt_seq + * body, asdl_expr_seq * decorator_list, expr_ty + returns, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) +stmt_ty _Py_ClassDef(identifier name, asdl_expr_seq * bases, asdl_keyword_seq * + keywords, asdl_stmt_seq * body, asdl_expr_seq * + decorator_list, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Return(a0, a1, a2, a3, a4, a5) _Py_Return(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +#define Delete(a0, a1, a2, a3, a4, a5) _Py_Delete(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Assign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Assign(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_Assign(asdl_expr_seq * targets, expr_ty value, string type_comment, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) +stmt_ty _Py_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int + simple, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) +stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena); +#define AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) +stmt_ty _Py_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +#define While(a0, a1, a2, a3, a4, a5, a6, a7) _Py_While(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define If(a0, a1, a2, a3, a4, a5, a6, a7) _Py_If(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +#define With(a0, a1, a2, a3, a4, a5, a6, a7) _Py_With(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +#define Match(a0, a1, a2, a3, a4, a5, a6) _Py_Match(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Raise(a0, a1, a2, a3, a4, a5, a6) _Py_Raise(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) +stmt_ty _Py_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Assert(a0, a1, a2, a3, a4, a5, a6) _Py_Assert(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Import(a0, a1, a2, a3, a4, a5) _Py_Import(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Import(asdl_alias_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) +stmt_ty _Py_ImportFrom(identifier module, asdl_alias_seq * names, int level, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Global(a0, a1, a2, a3, a4, a5) _Py_Global(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Global(asdl_identifier_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Nonlocal(a0, a1, a2, a3, a4, a5) _Py_Nonlocal(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Nonlocal(asdl_identifier_seq * names, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +#define Expr(a0, a1, a2, a3, a4, a5) _Py_Expr(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Pass(a0, a1, a2, a3, a4) _Py_Pass(a0, a1, a2, a3, a4) +stmt_ty _Py_Pass(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Break(a0, a1, a2, a3, a4) _Py_Break(a0, a1, a2, a3, a4) +stmt_ty _Py_Break(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Continue(a0, a1, a2, a3, a4) _Py_Continue(a0, a1, a2, a3, a4) +stmt_ty _Py_Continue(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define BoolOp(a0, a1, a2, a3, a4, a5, a6) _Py_BoolOp(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define NamedExpr(a0, a1, a2, a3, a4, a5, a6) _Py_NamedExpr(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_NamedExpr(expr_ty target, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define BinOp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_BinOp(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define UnaryOp(a0, a1, a2, a3, a4, a5, a6) _Py_UnaryOp(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +#define Lambda(a0, a1, a2, a3, a4, a5, a6) _Py_Lambda(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +#define IfExp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_IfExp(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Dict(a0, a1, a2, a3, a4, a5, a6) _Py_Dict(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Set(a0, a1, a2, a3, a4, a5) _Py_Set(a0, a1, a2, a3, a4, a5) +expr_ty _Py_Set(asdl_expr_seq * elts, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define ListComp(a0, a1, a2, a3, a4, a5, a6) _Py_ListComp(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define SetComp(a0, a1, a2, a3, a4, a5, a6) _Py_SetComp(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +#define DictComp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_DictComp(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * + generators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +#define GeneratorExp(a0, a1, a2, a3, a4, a5, a6) _Py_GeneratorExp(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Await(a0, a1, a2, a3, a4, a5) _Py_Await(a0, a1, a2, a3, a4, a5) +expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +#define Yield(a0, a1, a2, a3, a4, a5) _Py_Yield(a0, a1, a2, a3, a4, a5) +expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +#define YieldFrom(a0, a1, a2, a3, a4, a5) _Py_YieldFrom(a0, a1, a2, a3, a4, a5) +expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Compare(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Compare(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * + comparators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +#define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * + keywords, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define JoinedStr(a0, a1, a2, a3, a4, a5) _Py_JoinedStr(a0, a1, a2, a3, a4, a5) +expr_ty _Py_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define Constant(a0, a1, a2, a3, a4, a5, a6) _Py_Constant(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_Constant(constant value, string kind, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +#define Attribute(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Attribute(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Subscript(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Subscript(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +#define Starred(a0, a1, a2, a3, a4, a5, a6) _Py_Starred(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Name(a0, a1, a2, a3, a4, a5, a6) _Py_Name(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define List(a0, a1, a2, a3, a4, a5, a6) _Py_List(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Tuple(a0, a1, a2, a3, a4, a5, a6) _Py_Tuple(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define Slice(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Slice(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define MatchAs(a0, a1, a2, a3, a4, a5, a6) _Py_MatchAs(a0, a1, a2, a3, a4, a5, a6) +expr_ty _Py_MatchAs(expr_ty pattern, identifier name, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define MatchOr(a0, a1, a2, a3, a4, a5) _Py_MatchOr(a0, a1, a2, a3, a4, a5) +expr_ty _Py_MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +#define comprehension(a0, a1, a2, a3, a4) _Py_comprehension(a0, a1, a2, a3, a4) +comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_expr_seq + * ifs, int is_async, PyArena *arena); +#define ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) +excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_stmt_seq + * body, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena + *arena); +#define arguments(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arguments(a0, a1, a2, a3, a4, a5, a6, a7) +arguments_ty _Py_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, + arg_ty vararg, asdl_arg_seq * kwonlyargs, + asdl_expr_seq * kw_defaults, arg_ty kwarg, + asdl_expr_seq * defaults, PyArena *arena); +#define arg(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arg(a0, a1, a2, a3, a4, a5, a6, a7) +arg_ty _Py_arg(identifier arg, expr_ty annotation, string type_comment, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +#define keyword(a0, a1, a2, a3, a4, a5, a6) _Py_keyword(a0, a1, a2, a3, a4, a5, a6) +keyword_ty _Py_keyword(identifier arg, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +#define alias(a0, a1, a2) _Py_alias(a0, a1, a2) +alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); +#define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2) +withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena + *arena); +#define match_case(a0, a1, a2, a3) _Py_match_case(a0, a1, a2, a3) +match_case_ty _Py_match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * + body, PyArena *arena); +#define TypeIgnore(a0, a1, a2) _Py_TypeIgnore(a0, a1, a2) +type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena); + + +PyObject* PyAST_mod2obj(mod_ty t); +mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); +int PyAST_Check(PyObject* obj); extern int _PyAST_Validate(mod_ty); @@ -24,4 +839,3 @@ extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); } #endif #endif /* !Py_INTERNAL_AST_H */ - diff --git a/Include/internal/pycore_symtable.h b/Include/internal/pycore_symtable.h index 80d5fd1c41715..5d34a6c951cab 100644 --- a/Include/internal/pycore_symtable.h +++ b/Include/internal/pycore_symtable.h @@ -8,7 +8,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "Python-ast.h" /* mod_ty */ +struct _mod; // Type defined in pycore_ast.h typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } _Py_block_ty; @@ -74,7 +74,7 @@ extern PyTypeObject PySTEntry_Type; extern int _PyST_GetScope(PySTEntryObject *, PyObject *); extern struct symtable* _PySymtable_Build( - mod_ty mod, + struct _mod *mod, PyObject *filename, PyFutureFeatures *future); PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); diff --git a/Makefile.pre.in b/Makefile.pre.in index 6655edafeb1ec..552ee959912a4 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -849,16 +849,19 @@ regen-pegen: .PHONY=regen-ast regen-ast: - # Regenerate Include/Python-ast.h and Python/Python-ast.c using Parser/asdl_c.py + # Regenerate 3 files using using Parser/asdl_c.py: + # - Include/internal/pycore_ast.h + # - Include/internal/pycore_ast_state.h + # - Python/Python-ast.c $(MKDIR_P) $(srcdir)/Include $(MKDIR_P) $(srcdir)/Python $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \ $(srcdir)/Parser/Python.asdl \ - -H $(srcdir)/Include/Python-ast.h.new \ + -H $(srcdir)/Include/internal/pycore_ast.h.new \ -I $(srcdir)/Include/internal/pycore_ast_state.h.new \ -C $(srcdir)/Python/Python-ast.c.new - $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new + $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new @@ -922,7 +925,7 @@ regen-stdlib-module-names: build_all Programs/_testembed > $(srcdir)/Python/stdlib_module_names.h.new $(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new -Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/Python-ast.h +Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h Python/getplatform.o: $(srcdir)/Python/getplatform.c $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c @@ -1020,8 +1023,6 @@ regen-typeslots: PYTHON_HEADERS= \ $(srcdir)/Include/Python.h \ $(srcdir)/Include/abstract.h \ - $(srcdir)/Include/asdl.h \ - $(srcdir)/Include/ast.h \ $(srcdir)/Include/bltinmodule.h \ $(srcdir)/Include/boolobject.h \ $(srcdir)/Include/bytearrayobject.h \ @@ -1098,7 +1099,6 @@ PYTHON_HEADERS= \ \ pyconfig.h \ $(PARSER_HEADERS) \ - $(srcdir)/Include/Python-ast.h \ \ $(srcdir)/Include/cpython/abstract.h \ $(srcdir)/Include/cpython/bytearrayobject.h \ @@ -1136,6 +1136,7 @@ PYTHON_HEADERS= \ \ $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ + $(srcdir)/Include/internal/pycore_asdl.h \ $(srcdir)/Include/internal/pycore_ast.h \ $(srcdir)/Include/internal/pycore_ast_state.h \ $(srcdir)/Include/internal/pycore_atomic.h \ diff --git a/Misc/NEWS.d/next/C API/2021-03-19-12-56-11.bpo-43244.VuIyOD.rst b/Misc/NEWS.d/next/C API/2021-03-19-12-56-11.bpo-43244.VuIyOD.rst new file mode 100644 index 0000000000000..1afe11e192161 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-03-19-12-56-11.bpo-43244.VuIyOD.rst @@ -0,0 +1,8 @@ +Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. +These functions were undocumented and excluded from the limited C API. +Most names defined by these header files were not prefixed by ``Py`` and so +could create names conflicts. For example, ``Python-ast.h`` defined a ``Yield`` +macro which was conflict with the ``Yield`` name used by the Windows +```` header. +Use the Python :mod:`ast` module instead. +Patch by Victor Stinner. diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index c3234920d57ef..cf10b4deaf452 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -1,6 +1,4 @@ #include "Python.h" - -#include "Python-ast.h" #include "pycore_symtable.h" // struct symtable #include "clinic/symtablemodule.c.h" diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 53b9d7264c0a8..7802428185e5a 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -110,11 +110,8 @@ - - - @@ -176,6 +173,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index a4f82a183086d..c91686da27ddf 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -42,12 +42,6 @@ Include - - Include - - - Include - Include @@ -210,9 +204,6 @@ Include - - Include - Include @@ -489,6 +480,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 166468a93bfc3..ef355a21820a4 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -139,7 +139,7 @@ - + @@ -163,9 +163,9 @@ - - - + + + @@ -208,7 +208,7 @@ - + diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index aefea12c64857..73cb774c17edd 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1445,13 +1445,12 @@ def generate_module_def(mod, f, internal_h): } """) - # f-string for {mod.name} - f.write(f""" -// Include {mod.name}-ast.h after pycore_interp.h to avoid conflicts -// with the Yield macro redefined by -#include "{mod.name}-ast.h" -#include "structmember.h" -""") + print(textwrap.dedent(""" + // Include pycore_ast.h after pycore_interp.h to avoid conflicts + // with the Yield macro redefined by + #include "pycore_ast.h" + #include "structmember.h" + """).rstrip(), file=f) generate_ast_fini(module_state, f) @@ -1465,33 +1464,49 @@ def generate_module_def(mod, f, internal_h): f.write('};\n\n') def write_header(mod, f): - f.write('#ifndef Py_PYTHON_AST_H\n') - f.write('#define Py_PYTHON_AST_H\n') - f.write('#ifdef __cplusplus\n') - f.write('extern "C" {\n') - f.write('#endif\n') - f.write('\n') - f.write('#ifndef Py_LIMITED_API\n') - f.write('#include "asdl.h"\n') - f.write('\n') - f.write('#undef Yield /* undefine macro conflicting with */\n') - f.write('\n') + f.write(textwrap.dedent(""" + #ifndef Py_INTERNAL_AST_H + #define Py_INTERNAL_AST_H + #ifdef __cplusplus + extern "C" { + #endif + + #ifndef Py_BUILD_CORE + # error "this header requires Py_BUILD_CORE define" + #endif + + #include "pycore_asdl.h" + + #undef Yield /* undefine macro conflicting with */ + + """).lstrip()) c = ChainOfVisitors(TypeDefVisitor(f), SequenceDefVisitor(f), StructVisitor(f)) c.visit(mod) f.write("// Note: these macros affect function definitions, not only call sites.\n") PrototypeVisitor(f).visit(mod) - f.write("\n") - f.write("PyObject* PyAST_mod2obj(mod_ty t);\n") - f.write("mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);\n") - f.write("int PyAST_Check(PyObject* obj);\n") - f.write("#endif /* !Py_LIMITED_API */\n") - f.write('\n') - f.write('#ifdef __cplusplus\n') - f.write('}\n') - f.write('#endif\n') - f.write('#endif /* !Py_PYTHON_AST_H */\n') + f.write(textwrap.dedent(""" + + PyObject* PyAST_mod2obj(mod_ty t); + mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); + int PyAST_Check(PyObject* obj); + + extern int _PyAST_Validate(mod_ty); + + /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ + extern PyObject* _PyAST_ExprAsUnicode(expr_ty); + + /* Return the borrowed reference to the first literal string in the + sequence of statements or NULL if it doesn't start from a literal string. + Doesn't set exception. */ + extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); + + #ifdef __cplusplus + } + #endif + #endif /* !Py_INTERNAL_AST_H */ + """)) def write_internal_h_header(mod, f): diff --git a/Parser/pegen.c b/Parser/pegen.c index d2b7ec44eb155..f5c7994061e57 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -5,7 +5,6 @@ #include "pegen.h" #include "string_parser.h" -#include "ast.h" PyObject * _PyPegen_new_type_comment(Parser *p, char *s) diff --git a/Parser/pegen.h b/Parser/pegen.h index 8720e601a60cc..66de75c133ebc 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -4,7 +4,7 @@ #define PY_SSIZE_T_CLEAN #include #include -#include +#include #if 0 #define PyPARSE_YIELD_IS_KEYWORD 0x0001 @@ -101,7 +101,7 @@ typedef struct { arg_ty kwarg; } StarEtc; -typedef struct { operator_ty kind; } AugOperator; +typedef struct { operator_ty kind; } AugOperator; typedef struct { void *element; int is_keyword; diff --git a/Parser/string_parser.h b/Parser/string_parser.h index cd85bd57d0a38..4a22f3d3086f4 100644 --- a/Parser/string_parser.h +++ b/Parser/string_parser.h @@ -2,7 +2,7 @@ #define STRINGS_H #include -#include +#include #include "pegen.h" #define EXPRLIST_N_CACHED 64 diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 4524877dd4278..63c214dba172b 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -24,9 +24,9 @@ get_ast_state(void) return state; } -// Include Python-ast.h after pycore_interp.h to avoid conflicts +// Include pycore_ast.h after pycore_interp.h to avoid conflicts // with the Yield macro redefined by -#include "Python-ast.h" +#include "pycore_ast.h" #include "structmember.h" void _PyAST_Fini(PyInterpreterState *interp) diff --git a/Python/asdl.c b/Python/asdl.c index 4ff07e4377b18..a7f2180c88ed3 100644 --- a/Python/asdl.c +++ b/Python/asdl.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "asdl.h" +#include "pycore_asdl.h" GENERATE_ASDL_SEQ_CONSTRUCTOR(generic, void*); GENERATE_ASDL_SEQ_CONSTRUCTOR(identifier, PyObject*); diff --git a/Python/ast.c b/Python/ast.c index 8ac2e60c92fde..c87795305e507 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3,8 +3,7 @@ * of the given abstract syntax tree (potentially constructed manually). */ #include "Python.h" -#include "Python-ast.h" -#include "ast.h" +#include "pycore_ast.h" // asdl_stmt_seq #include diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index a04ff93e9d9d9..5276b2fcd6698 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -1,7 +1,7 @@ -#include /* DBL_MAX_10_EXP */ -#include #include "Python.h" -#include "Python-ast.h" +#include "pycore_ast.h" // expr_ty +#include // DBL_MAX_10_EXP +#include static PyObject *_str_open_br; static PyObject *_str_dbl_open_br; diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 9f83c036d0929..c3f7e39eb63a5 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2,9 +2,8 @@ #include "Python.h" #include -#include "ast.h" -#undef Yield /* undefine macro conflicting with */ #include "pycore_ast.h" // _PyAST_Validate() +#undef Yield /* undefine macro conflicting with */ #include "pycore_object.h" // _Py_AddToAllObjects() #include "pycore_pyerrors.h" // _PyErr_NoMemory() #include "pycore_pystate.h" // _PyThreadState_GET() diff --git a/Python/import.c b/Python/import.c index b898a2bd9260d..6fba057baddeb 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2,7 +2,6 @@ #include "Python.h" -#include "Python-ast.h" #undef Yield /* undefine macro conflicting with */ #include "pycore_import.h" // _PyImport_BootstrapImp() #include "pycore_initconfig.h" diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 1b8c4357362d2..8309477806f7a 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2,9 +2,6 @@ #include "Python.h" -#include "Python-ast.h" -#undef Yield /* undefine macro conflicting with */ - #include "pycore_ceval.h" // _PyEval_FiniGIL() #include "pycore_context.h" // _PyContext_Init() #include "pycore_fileutils.h" // _Py_ResetForceASCII() diff --git a/Python/pythonrun.c b/Python/pythonrun.c index adb43e75f9ab7..02fd8b0b8ba5c 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -10,7 +10,7 @@ #include "Python.h" -#include "Python-ast.h" +#include "pycore_ast.h" // PyAST_mod2obj #undef Yield /* undefine macro conflicting with */ #include "pycore_interp.h" // PyInterpreterState.importlib diff --git a/Python/symtable.c b/Python/symtable.c index 85648f21e6889..78874404ade3d 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_ast.h" // identifier, stmt_ty #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_symtable.h" // PySTEntryObject #undef Yield /* undefine macro conflicting with */ diff --git a/configure b/configure index 2ddca07986062..f9b2aff3b8310 100755 --- a/configure +++ b/configure @@ -2765,7 +2765,7 @@ if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. # Objects/ -> typeslots.inc - # Include/ -> Python-ast.h + # Include/ -> Python.h # Python/ -> importlib.h # (A side effect of this is that these resources will automatically be # regenerated when building out-of-tree, regardless of whether or not diff --git a/configure.ac b/configure.ac index 4c3c80f74d215..e43b7733aed31 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. # Objects/ -> typeslots.inc - # Include/ -> Python-ast.h + # Include/ -> Python.h # Python/ -> importlib.h # (A side effect of this is that these resources will automatically be # regenerated when building out-of-tree, regardless of whether or not From webhook-mailer at python.org Tue Mar 23 18:47:44 2021 From: webhook-mailer at python.org (gvanrossum) Date: Tue, 23 Mar 2021 22:47:44 -0000 Subject: [Python-checkins] bpo-31861: Add aiter and anext to builtins (#23847) Message-ID: https://github.com/python/cpython/commit/f0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57 commit: f0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57 branch: master author: Joshua Bronson committer: gvanrossum date: 2021-03-23T15:47:21-07:00 summary: bpo-31861: Add aiter and anext to builtins (#23847) Co-authored-by: jab Co-authored-by: Daniel Pope Co-authored-by: Justin Wang files: A Misc/NEWS.d/next/Library/2018-08-24-01-08-09.bpo-31861.-q9RKJ.rst M Doc/library/functions.rst M Doc/whatsnew/3.10.rst M Include/abstract.h M Lib/test/test_asyncgen.py M Lib/test/test_inspect.py M Objects/abstract.c M Objects/iterobject.c M Python/bltinmodule.c M Python/clinic/bltinmodule.c.h diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 2a6af95cdf9ef..4e2e58ee9dd8b 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -12,31 +12,31 @@ are always available. They are listed here in alphabetical order. +=========================+=======================+=======================+=========================+ | | **A** | | **E** | | **L** | | **R** | | | :func:`abs` | | :func:`enumerate` | | :func:`len` | | |func-range|_ | -| | :func:`all` | | :func:`eval` | | |func-list|_ | | :func:`repr` | -| | :func:`any` | | :func:`exec` | | :func:`locals` | | :func:`reversed` | -| | :func:`ascii` | | | | | | :func:`round` | -| | | | **F** | | **M** | | | -| | **B** | | :func:`filter` | | :func:`map` | | **S** | -| | :func:`bin` | | :func:`float` | | :func:`max` | | |func-set|_ | -| | :func:`bool` | | :func:`format` | | |func-memoryview|_ | | :func:`setattr` | -| | :func:`breakpoint` | | |func-frozenset|_ | | :func:`min` | | :func:`slice` | -| | |func-bytearray|_ | | | | | | :func:`sorted` | -| | |func-bytes|_ | | **G** | | **N** | | :func:`staticmethod` | -| | | | :func:`getattr` | | :func:`next` | | |func-str|_ | -| | **C** | | :func:`globals` | | | | :func:`sum` | -| | :func:`callable` | | | | **O** | | :func:`super` | -| | :func:`chr` | | **H** | | :func:`object` | | | -| | :func:`classmethod` | | :func:`hasattr` | | :func:`oct` | | **T** | -| | :func:`compile` | | :func:`hash` | | :func:`open` | | |func-tuple|_ | -| | :func:`complex` | | :func:`help` | | :func:`ord` | | :func:`type` | -| | | | :func:`hex` | | | | | -| | **D** | | | | **P** | | **V** | -| | :func:`delattr` | | **I** | | :func:`pow` | | :func:`vars` | -| | |func-dict|_ | | :func:`id` | | :func:`print` | | | -| | :func:`dir` | | :func:`input` | | :func:`property` | | **Z** | -| | :func:`divmod` | | :func:`int` | | | | :func:`zip` | -| | | | :func:`isinstance` | | | | | -| | | | :func:`issubclass` | | | | **_** | +| | :func:`aiter` | | :func:`eval` | | |func-list|_ | | :func:`repr` | +| | :func:`all` | | :func:`exec` | | :func:`locals` | | :func:`reversed` | +| | :func:`any` | | | | | | :func:`round` | +| | :func:`anext` | | **F** | | **M** | | | +| | :func:`ascii` | | :func:`filter` | | :func:`map` | | **S** | +| | | | :func:`float` | | :func:`max` | | |func-set|_ | +| | **B** | | :func:`format` | | |func-memoryview|_ | | :func:`setattr` | +| | :func:`bin` | | |func-frozenset|_ | | :func:`min` | | :func:`slice` | +| | :func:`bool` | | | | | | :func:`sorted` | +| | :func:`breakpoint` | | **G** | | **N** | | :func:`staticmethod` | +| | |func-bytearray|_ | | :func:`getattr` | | :func:`next` | | |func-str|_ | +| | |func-bytes|_ | | :func:`globals` | | | | :func:`sum` | +| | | | | | **O** | | :func:`super` | +| | **C** | | **H** | | :func:`object` | | | +| | :func:`callable` | | :func:`hasattr` | | :func:`oct` | | **T** | +| | :func:`chr` | | :func:`hash` | | :func:`open` | | |func-tuple|_ | +| | :func:`classmethod` | | :func:`help` | | :func:`ord` | | :func:`type` | +| | :func:`compile` | | :func:`hex` | | | | | +| | :func:`complex` | | | | **P** | | **V** | +| | | | **I** | | :func:`pow` | | :func:`vars` | +| | **D** | | :func:`id` | | :func:`print` | | | +| | :func:`delattr` | | :func:`input` | | :func:`property` | | **Z** | +| | |func-dict|_ | | :func:`int` | | | | :func:`zip` | +| | :func:`dir` | | :func:`isinstance` | | | | | +| | :func:`divmod` | | :func:`issubclass` | | | | **_** | | | | | :func:`iter` | | | | :func:`__import__` | +-------------------------+-----------------------+-----------------------+-------------------------+ @@ -61,6 +61,17 @@ are always available. They are listed here in alphabetical order. If the argument is a complex number, its magnitude is returned. +.. function:: aiter(async_iterable) + + Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`. + Equivalent to calling ``x.__aiter__()``. + + ``aiter(x)`` itself has an ``__aiter__()`` method that returns ``x``, + so ``aiter(aiter(x))`` is the same as ``aiter(x)``. + + Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant. + + .. function:: all(iterable) Return ``True`` if all elements of the *iterable* are true (or if the iterable @@ -73,6 +84,20 @@ are always available. They are listed here in alphabetical order. return True +.. awaitablefunction:: anext(async_iterator[, default]) + + When awaited, return the next item from the given :term:`asynchronous + iterator`, or *default* if given and the iterator is exhausted. + + This is the async variant of the :func:`next` builtin, and behaves + similarly. + + This calls the :meth:`~object.__anext__` method of *async_iterator*, + returning an :term:`awaitable`. Awaiting this returns the next value of the + iterator. If *default* is given, it is returned if the iterator is exhausted, + otherwise :exc:`StopAsyncIteration` is raised. + + .. function:: any(iterable) Return ``True`` if any element of the *iterable* is true. If the iterable diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index c55964328556b..126f56e0823a0 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -588,6 +588,11 @@ Other Language Changes ``__globals__["__builtins__"]`` if it exists, else from the current builtins. (Contributed by Mark Shannon in :issue:`42990`.) +* Two new builtin functions -- :func:`aiter` and :func:`anext` have been added + to provide asynchronous counterparts to :func:`iter` and :func:`next`, + respectively. + (Contributed by Joshua Bronson, Daniel Pope, and Justin Wang in :issue:`31861`.) + New Modules =========== diff --git a/Include/abstract.h b/Include/abstract.h index a47c944060d3d..1af1487deec91 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -324,11 +324,21 @@ PyAPI_FUNC(PyObject *) PyObject_Format(PyObject *obj, returns itself. */ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); +/* Takes an AsyncIterable object and returns an AsyncIterator for it. + This is typically a new iterator but if the argument is an AsyncIterator, + this returns itself. */ +PyAPI_FUNC(PyObject *) PyObject_GetAiter(PyObject *); + /* Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise. This function always succeeds. */ PyAPI_FUNC(int) PyIter_Check(PyObject *); +/* Returns non-zero if the object 'obj' provides AsyncIterator protocols, and 0 otherwise. + + This function always succeeds. */ +PyAPI_FUNC(int) PyAiter_Check(PyObject *); + /* Takes an iterator object and calls its tp_iternext slot, returning the next value. diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py index 1f7e05b42be99..99464e3d0929f 100644 --- a/Lib/test/test_asyncgen.py +++ b/Lib/test/test_asyncgen.py @@ -372,6 +372,88 @@ def tearDown(self): self.loop = None asyncio.set_event_loop_policy(None) + def test_async_gen_anext(self): + async def gen(): + yield 1 + yield 2 + g = gen() + async def consume(): + results = [] + results.append(await anext(g)) + results.append(await anext(g)) + results.append(await anext(g, 'buckle my shoe')) + return results + res = self.loop.run_until_complete(consume()) + self.assertEqual(res, [1, 2, 'buckle my shoe']) + with self.assertRaises(StopAsyncIteration): + self.loop.run_until_complete(consume()) + + def test_async_gen_aiter(self): + async def gen(): + yield 1 + yield 2 + g = gen() + async def consume(): + return [i async for i in aiter(g)] + res = self.loop.run_until_complete(consume()) + self.assertEqual(res, [1, 2]) + + def test_async_gen_aiter_class(self): + results = [] + class Gen: + async def __aiter__(self): + yield 1 + yield 2 + g = Gen() + async def consume(): + ait = aiter(g) + while True: + try: + results.append(await anext(ait)) + except StopAsyncIteration: + break + self.loop.run_until_complete(consume()) + self.assertEqual(results, [1, 2]) + + def test_aiter_idempotent(self): + async def gen(): + yield 1 + applied_once = aiter(gen()) + applied_twice = aiter(applied_once) + self.assertIs(applied_once, applied_twice) + + def test_anext_bad_args(self): + async def gen(): + yield 1 + async def call_with_too_few_args(): + await anext() + async def call_with_too_many_args(): + await anext(gen(), 1, 3) + async def call_with_wrong_type_args(): + await anext(1, gen()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_few_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_many_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_wrong_type_args()) + + def test_aiter_bad_args(self): + async def gen(): + yield 1 + async def call_with_too_few_args(): + await aiter() + async def call_with_too_many_args(): + await aiter(gen(), 1) + async def call_with_wrong_type_arg(): + await aiter(1) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_few_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_many_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_wrong_type_arg()) + async def to_list(self, gen): res = [] async for i in gen: diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 706fcbe3439b4..72feaedbe7513 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -3860,6 +3860,9 @@ def test_builtins_have_signatures(self): needs_groups = {"range", "slice", "dir", "getattr", "next", "iter", "vars"} no_signature |= needs_groups + # These have unrepresentable parameter default values of NULL + needs_null = {"anext"} + no_signature |= needs_null # These need PEP 457 groups or a signature change to accept None needs_semantic_update = {"round"} no_signature |= needs_semantic_update diff --git a/Misc/NEWS.d/next/Library/2018-08-24-01-08-09.bpo-31861.-q9RKJ.rst b/Misc/NEWS.d/next/Library/2018-08-24-01-08-09.bpo-31861.-q9RKJ.rst new file mode 100644 index 0000000000000..1526deb995c3d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-08-24-01-08-09.bpo-31861.-q9RKJ.rst @@ -0,0 +1,2 @@ +Add builtins.aiter and builtins.anext. +Patch by Joshua Bronson (@jab), Daniel Pope (@lordmauve), and Justin Wang (@justin39). diff --git a/Objects/abstract.c b/Objects/abstract.c index 4cd59100ddc56..fcfe2dbe483f4 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2738,6 +2738,26 @@ PyObject_GetIter(PyObject *o) } } +PyObject * +PyObject_GetAiter(PyObject *o) { + PyTypeObject *t = Py_TYPE(o); + unaryfunc f; + + if (t->tp_as_async == NULL || t->tp_as_async->am_aiter == NULL) { + return type_error("'%.200s' object is not an AsyncIterable", o); + } + f = t->tp_as_async->am_aiter; + PyObject *it = (*f)(o); + if (it != NULL && !PyAiter_Check(it)) { + PyErr_Format(PyExc_TypeError, + "aiter() returned non-AsyncIterator of type '%.100s'", + Py_TYPE(it)->tp_name); + Py_DECREF(it); + it = NULL; + } + return it; +} + int PyIter_Check(PyObject *obj) { @@ -2746,6 +2766,17 @@ PyIter_Check(PyObject *obj) tp->tp_iternext != &_PyObject_NextNotImplemented); } +int +PyAiter_Check(PyObject *obj) +{ + PyTypeObject *tp = Py_TYPE(obj); + return (tp->tp_as_async != NULL && + tp->tp_as_async->am_aiter != NULL && + tp->tp_as_async->am_aiter != &_PyObject_NextNotImplemented && + tp->tp_as_async->am_anext != NULL && + tp->tp_as_async->am_anext != &_PyObject_NextNotImplemented); +} + /* Return next item. * If an error occurs, return NULL. PyErr_Occurred() will be true. * If the iteration terminates normally, return NULL and clear the diff --git a/Objects/iterobject.c b/Objects/iterobject.c index 6cac41ad539db..06a6da5695f8a 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -157,7 +157,7 @@ PyTypeObject PySeqIter_Type = { PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)iter_traverse, /* tp_traverse */ 0, /* tp_clear */ @@ -276,7 +276,7 @@ PyTypeObject PyCallIter_Type = { PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)calliter_traverse, /* tp_traverse */ 0, /* tp_clear */ @@ -288,3 +288,91 @@ PyTypeObject PyCallIter_Type = { }; +/* -------------------------------------- */ + +typedef struct { + PyObject_HEAD + PyObject *wrapped; + PyObject *default_value; +} anextawaitableobject; + +static void +anextawaitable_dealloc(anextawaitableobject *obj) +{ + _PyObject_GC_UNTRACK(obj); + Py_XDECREF(obj->wrapped); + Py_XDECREF(obj->default_value); + PyObject_GC_Del(obj); +} + +static int +anextawaitable_traverse(anextawaitableobject *obj, visitproc visit, void *arg) +{ + Py_VISIT(obj->wrapped); + Py_VISIT(obj->default_value); + return 0; +} + +static PyObject * +anextawaitable_iternext(anextawaitableobject *obj) +{ + PyObject *result = PyIter_Next(obj->wrapped); + if (result != NULL) { + return result; + } + if (PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) { + _PyGen_SetStopIterationValue(obj->default_value); + } + return NULL; +} + +static PyAsyncMethods anextawaitable_as_async = { + PyObject_SelfIter, /* am_await */ + 0, /* am_aiter */ + 0, /* am_anext */ + 0, /* am_send */ +}; + +PyTypeObject PyAnextAwaitable_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "anext_awaitable", /* tp_name */ + sizeof(anextawaitableobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)anextawaitable_dealloc, /* tp_dealloc */ + 0, /* tp_vectorcall_offset */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + &anextawaitable_as_async, /* tp_as_async */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + 0, /* tp_doc */ + (traverseproc)anextawaitable_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (unaryfunc)anextawaitable_iternext, /* tp_iternext */ + 0, /* tp_methods */ +}; + +PyObject * +PyAnextAwaitable_New(PyObject *awaitable, PyObject *default_value) +{ + anextawaitableobject *anext = PyObject_GC_New(anextawaitableobject, &PyAnextAwaitable_Type); + Py_INCREF(awaitable); + anext->wrapped = awaitable; + Py_INCREF(default_value); + anext->default_value = default_value; + _PyObject_GC_TRACK(anext); + return (PyObject *)anext; +} diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index c3f7e39eb63a5..fd9b97f8e90d4 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1610,6 +1610,59 @@ supply its own iterator, or be a sequence.\n\ In the second form, the callable is called until it returns the sentinel."); +/*[clinic input] +aiter as builtin_aiter + + async_iterable: object + / + +Return an AsyncIterator for an AsyncIterable object. +[clinic start generated code]*/ + +static PyObject * +builtin_aiter(PyObject *module, PyObject *async_iterable) +/*[clinic end generated code: output=1bae108d86f7960e input=473993d0cacc7d23]*/ +{ + return PyObject_GetAiter(async_iterable); +} + +PyObject *PyAnextAwaitable_New(PyObject *, PyObject *); + +/*[clinic input] +anext as builtin_anext + + aiterator: object + default: object = NULL + / + +Return the next item from the async iterator. +[clinic start generated code]*/ + +static PyObject * +builtin_anext_impl(PyObject *module, PyObject *aiterator, + PyObject *default_value) +/*[clinic end generated code: output=f02c060c163a81fa input=699d11f4e38eca24]*/ +{ + PyTypeObject *t; + PyObject *awaitable; + + t = Py_TYPE(aiterator); + if (t->tp_as_async == NULL || t->tp_as_async->am_anext == NULL) { + PyErr_Format(PyExc_TypeError, + "'%.200s' object is not an async iterator", + t->tp_name); + return NULL; + } + + awaitable = (*t->tp_as_async->am_anext)(aiterator); + if (default_value == NULL) { + return awaitable; + } + + return PyAnextAwaitable_New(awaitable, default_value); +} + + /*[clinic input] len as builtin_len @@ -2890,11 +2943,13 @@ static PyMethodDef builtin_methods[] = { BUILTIN_ISINSTANCE_METHODDEF BUILTIN_ISSUBCLASS_METHODDEF {"iter", (PyCFunction)(void(*)(void))builtin_iter, METH_FASTCALL, iter_doc}, + BUILTIN_AITER_METHODDEF BUILTIN_LEN_METHODDEF BUILTIN_LOCALS_METHODDEF {"max", (PyCFunction)(void(*)(void))builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, {"min", (PyCFunction)(void(*)(void))builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, {"next", (PyCFunction)(void(*)(void))builtin_next, METH_FASTCALL, next_doc}, + BUILTIN_ANEXT_METHODDEF BUILTIN_OCT_METHODDEF BUILTIN_ORD_METHODDEF BUILTIN_POW_METHODDEF diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index bc3b518792811..545f5b53f6e54 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -530,6 +530,50 @@ PyDoc_STRVAR(builtin_hex__doc__, #define BUILTIN_HEX_METHODDEF \ {"hex", (PyCFunction)builtin_hex, METH_O, builtin_hex__doc__}, +PyDoc_STRVAR(builtin_aiter__doc__, +"aiter($module, async_iterable, /)\n" +"--\n" +"\n" +"Return an AsyncIterator for an AsyncIterable object."); + +#define BUILTIN_AITER_METHODDEF \ + {"aiter", (PyCFunction)builtin_aiter, METH_O, builtin_aiter__doc__}, + +PyDoc_STRVAR(builtin_anext__doc__, +"anext($module, aiterator, default=, /)\n" +"--\n" +"\n" +"Return the next item from the async iterator."); + +#define BUILTIN_ANEXT_METHODDEF \ + {"anext", (PyCFunction)(void(*)(void))builtin_anext, METH_FASTCALL, builtin_anext__doc__}, + +static PyObject * +builtin_anext_impl(PyObject *module, PyObject *aiterator, + PyObject *default_value); + +static PyObject * +builtin_anext(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *aiterator; + PyObject *default_value = NULL; + + if (!_PyArg_CheckPositional("anext", nargs, 1, 2)) { + goto exit; + } + aiterator = args[0]; + if (nargs < 2) { + goto skip_optional; + } + default_value = args[1]; +skip_optional: + return_value = builtin_anext_impl(module, aiterator, default_value); + +exit: + return return_value; +} + PyDoc_STRVAR(builtin_len__doc__, "len($module, obj, /)\n" "--\n" @@ -830,4 +874,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=e2fcf0201790367c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=da9ae459e9233259 input=a9049054013a1b77]*/ From webhook-mailer at python.org Tue Mar 23 19:51:58 2021 From: webhook-mailer at python.org (vstinner) Date: Tue, 23 Mar 2021 23:51:58 -0000 Subject: [Python-checkins] bpo-43244: Add pycore_compile.h header file (GH-25000) Message-ID: https://github.com/python/cpython/commit/a81fca6ec8e0f748f8eafa12fb12cf9e12df465c commit: a81fca6ec8e0f748f8eafa12fb12cf9e12df465c branch: master author: Victor Stinner committer: vstinner date: 2021-03-24T00:51:50+01:00 summary: bpo-43244: Add pycore_compile.h header file (GH-25000) Remove the compiler functions using "struct _mod" type, because the public AST C API was removed: * PyAST_Compile() * PyAST_CompileEx() * PyAST_CompileObject() * PyFuture_FromAST() * PyFuture_FromASTObject() These functions were undocumented and excluded from the limited C API. Rename functions: * PyAST_CompileObject() => _PyAST_Compile() * PyFuture_FromASTObject() => _PyFuture_FromAST() Moreover, _PyFuture_FromAST() is no longer exported (replace PyAPI_FUNC() with extern). _PyAST_Compile() remains exported for test_peg_generator. Remove also compatibility functions: * PyAST_Compile() * PyAST_CompileEx() * PyFuture_FromAST() files: A Include/internal/pycore_compile.h A Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst M Doc/whatsnew/3.10.rst M Include/cpython/compile.h M Makefile.pre.in M Objects/typeobject.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/ast_opt.c M Python/bltinmodule.c M Python/compile.c M Python/future.c M Python/pythonrun.c M Python/symtable.c M Tools/peg_generator/peg_extension/peg_extension.c diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 126f56e0823a0..7ed43ad819104 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1399,3 +1399,15 @@ Removed ``Yield`` macro which was conflict with the ``Yield`` name used by the Windows ```` header. Use the Python :mod:`ast` module instead. (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove the compiler functions using ``struct _mod`` type, because the public + AST C API was removed: + + * ``PyAST_Compile()`` + * ``PyAST_CompileEx()`` + * ``PyAST_CompileObject()`` + * ``PyFuture_FromAST()`` + * ``PyFuture_FromASTObject()`` + + These functions were undocumented and excluded from the limited C API. + (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Include/cpython/compile.h b/Include/cpython/compile.h index 59ba1ed19644d..a202c0b0e6550 100644 --- a/Include/cpython/compile.h +++ b/Include/cpython/compile.h @@ -47,40 +47,6 @@ typedef struct { #define FUTURE_GENERATOR_STOP "generator_stop" #define FUTURE_ANNOTATIONS "annotations" -struct _mod; // Type defined in pycore_ast.h - -#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar) -PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx( - struct _mod *mod, - const char *filename, /* decoded from the filesystem encoding */ - PyCompilerFlags *flags, - int optimize, - PyArena *arena); -PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject( - struct _mod *mod, - PyObject *filename, - PyCompilerFlags *flags, - int optimize, - PyArena *arena); -PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST( - struct _mod * mod, - const char *filename /* decoded from the filesystem encoding */ - ); -PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject( - struct _mod * mod, - PyObject *filename - ); - -/* _Py_Mangle is defined in compile.c */ -PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); - #define PY_INVALID_STACK_EFFECT INT_MAX PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); - -typedef struct { - int optimize; - int ff_features; -} _PyASTOptimizeState; - -PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeState *state); diff --git a/Include/internal/pycore_compile.h b/Include/internal/pycore_compile.h new file mode 100644 index 0000000000000..f6caec3fa1d28 --- /dev/null +++ b/Include/internal/pycore_compile.h @@ -0,0 +1,40 @@ +#ifndef Py_INTERNAL_COMPILE_H +#define Py_INTERNAL_COMPILE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct _mod; // Type defined in pycore_ast.h + +// Export the symbol for test_peg_generator (built as a library) +PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( + struct _mod *mod, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + PyArena *arena); +extern PyFutureFeatures* _PyFuture_FromAST( + struct _mod * mod, + PyObject *filename + ); + +extern PyObject* _Py_Mangle(PyObject *p, PyObject *name); + +typedef struct { + int optimize; + int ff_features; +} _PyASTOptimizeState; + +extern int _PyAST_Optimize( + struct _mod *, + PyArena *arena, + _PyASTOptimizeState *state); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_COMPILE_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 552ee959912a4..5cfa0582b1b74 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1146,6 +1146,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_call.h \ $(srcdir)/Include/internal/pycore_ceval.h \ $(srcdir)/Include/internal/pycore_code.h \ + $(srcdir)/Include/internal/pycore_compile.h \ $(srcdir)/Include/internal/pycore_condvar.h \ $(srcdir)/Include/internal/pycore_context.h \ $(srcdir)/Include/internal/pycore_dtoa.h \ diff --git a/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst b/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst new file mode 100644 index 0000000000000..6cfe642d42958 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst @@ -0,0 +1,11 @@ +Remove the compiler functions using ``struct _mod`` type, because the public +AST C API was removed: + +* ``PyAST_Compile()`` +* ``PyAST_CompileEx()`` +* ``PyAST_CompileObject()`` +* ``PyFuture_FromAST()`` +* ``PyFuture_FromASTObject()`` + +These functions were undocumented and excluded from the limited C API. +Patch by Victor Stinner. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 2b6ff59e5fd3c..d1bbbe77ee1b9 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2,6 +2,7 @@ #include "Python.h" #include "pycore_call.h" +#include "pycore_compile.h" // _Py_Mangle() #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 7802428185e5a..baa2254e01981 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -183,6 +183,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index c91686da27ddf..d9f1ea632209f 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -510,6 +510,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/Python/ast_opt.c b/Python/ast_opt.c index c76b428f97298..64fa0672ad397 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -1,6 +1,7 @@ /* AST Optimizer */ #include "Python.h" #include "pycore_ast.h" // _PyAST_GetDocString() +#include "pycore_compile.h" // _PyASTOptimizeState static int diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index fd9b97f8e90d4..afe0f820cf347 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -4,6 +4,7 @@ #include #include "pycore_ast.h" // _PyAST_Validate() #undef Yield /* undefine macro conflicting with */ +#include "pycore_compile.h" // _PyAST_Compile() #include "pycore_object.h" // _Py_AddToAllObjects() #include "pycore_pyerrors.h" // _PyErr_NoMemory() #include "pycore_pystate.h" // _PyThreadState_GET() @@ -839,8 +840,8 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, PyArena_Free(arena); goto error; } - result = (PyObject*)PyAST_CompileObject(mod, filename, - &cf, optimize, arena); + result = (PyObject*)_PyAST_Compile(mod, filename, + &cf, optimize, arena); PyArena_Free(arena); } goto finally; diff --git a/Python/compile.c b/Python/compile.c index 27274ec884dc3..bed2a1c944d96 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1,7 +1,7 @@ /* * This file compiles an abstract syntax tree (AST) into Python bytecode. * - * The primary entry point is PyAST_Compile(), which returns a + * The primary entry point is _PyAST_Compile(), which returns a * PyCodeObject. The compiler makes several passes to build the code * object: * 1. Checks for future statements. See future.c @@ -23,6 +23,7 @@ #include "Python.h" #include "pycore_ast.h" // _PyAST_GetDocString() +#include "pycore_compile.h" // _PyFuture_FromAST() #include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_long.h" // _PyLong_GetZero() #include "pycore_symtable.h" // PySTEntryObject @@ -350,8 +351,8 @@ compiler_init(struct compiler *c) } PyCodeObject * -PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, - int optimize, PyArena *arena) +_PyAST_Compile(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, + int optimize, PyArena *arena) { struct compiler c; PyCodeObject *co = NULL; @@ -373,7 +374,7 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, Py_INCREF(filename); c.c_filename = filename; c.c_arena = arena; - c.c_future = PyFuture_FromASTObject(mod, filename); + c.c_future = _PyFuture_FromAST(mod, filename); if (c.c_future == NULL) goto finally; if (!flags) { @@ -409,21 +410,6 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, return co; } -PyCodeObject * -PyAST_CompileEx(mod_ty mod, const char *filename_str, PyCompilerFlags *flags, - int optimize, PyArena *arena) -{ - PyObject *filename; - PyCodeObject *co; - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - co = PyAST_CompileObject(mod, filename, flags, optimize, arena); - Py_DECREF(filename); - return co; - -} - static void compiler_free(struct compiler *c) { @@ -6758,15 +6744,6 @@ assemble(struct compiler *c, int addNone) return co; } -#undef PyAST_Compile -PyCodeObject * -PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags, - PyArena *arena) -{ - return PyAST_CompileEx(mod, filename, flags, -1, arena); -} - - /* Replace LOAD_CONST c1, LOAD_CONST c2 ... LOAD_CONST cn, BUILD_TUPLE n with LOAD_CONST (c1, c2, ... cn). The consts table must still be in list form so that the diff --git a/Python/future.c b/Python/future.c index 37e7a22f81c2b..05ade8e250ab3 100644 --- a/Python/future.c +++ b/Python/future.c @@ -116,7 +116,7 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename) PyFutureFeatures * -PyFuture_FromASTObject(mod_ty mod, PyObject *filename) +_PyFuture_FromAST(mod_ty mod, PyObject *filename) { PyFutureFeatures *ff; @@ -134,18 +134,3 @@ PyFuture_FromASTObject(mod_ty mod, PyObject *filename) } return ff; } - - -PyFutureFeatures * -PyFuture_FromAST(mod_ty mod, const char *filename_str) -{ - PyFutureFeatures *ff; - PyObject *filename; - - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - ff = PyFuture_FromASTObject(mod, filename); - Py_DECREF(filename); - return ff; -} diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 02fd8b0b8ba5c..e16835b13e817 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -13,6 +13,7 @@ #include "pycore_ast.h" // PyAST_mod2obj #undef Yield /* undefine macro conflicting with */ +#include "pycore_compile.h" // _PyAST_Compile() #include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" // _PyDebug_PrintTotalRefs() #include "pycore_pyerrors.h" // _PyErr_Fetch @@ -1224,7 +1225,7 @@ run_mod(mod_ty mod, PyObject *filename, PyObject *globals, PyObject *locals, PyCompilerFlags *flags, PyArena *arena) { PyThreadState *tstate = _PyThreadState_GET(); - PyCodeObject *co = PyAST_CompileObject(mod, filename, flags, -1, arena); + PyCodeObject *co = _PyAST_Compile(mod, filename, flags, -1, arena); if (co == NULL) return NULL; @@ -1301,7 +1302,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, PyArena_Free(arena); return result; } - co = PyAST_CompileObject(mod, filename, flags, optimize, arena); + co = _PyAST_Compile(mod, filename, flags, optimize, arena); PyArena_Free(arena); return (PyObject *)co; } diff --git a/Python/symtable.c b/Python/symtable.c index 78874404ade3d..a149e28dcb3c4 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,8 +1,9 @@ #include "Python.h" #include "pycore_ast.h" // identifier, stmt_ty +#undef Yield /* undefine macro conflicting with */ +#include "pycore_compile.h" // _Py_Mangle() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_symtable.h" // PySTEntryObject -#undef Yield /* undefine macro conflicting with */ #include "structmember.h" // PyMemberDef /* error strings used for warnings */ diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index 96d3a52b88088..f2a870ee8b552 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -1,4 +1,6 @@ #include "pegen.h" +#include "pycore_compile.h" // _PyAST_Compile() + PyObject * _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *arena) @@ -6,7 +8,7 @@ _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *ar PyObject *result = NULL; if (mode == 2) { - result = (PyObject *)PyAST_CompileObject(module, filename_ob, NULL, -1, arena); + result = (PyObject *)_PyAST_Compile(module, filename_ob, NULL, -1, arena); } else if (mode == 1) { result = PyAST_mod2obj(module); } else { From webhook-mailer at python.org Tue Mar 23 19:57:14 2021 From: webhook-mailer at python.org (pablogsal) Date: Tue, 23 Mar 2021 23:57:14 -0000 Subject: [Python-checkins] bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check (GH-25004) Message-ID: https://github.com/python/cpython/commit/d9692027f41ee7600fe401c066617ebfc8bac930 commit: d9692027f41ee7600fe401c066617ebfc8bac930 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-23T23:57:03Z summary: bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check (GH-25004) files: M Doc/c-api/iter.rst M Doc/c-api/object.rst M Doc/data/refcounts.dat M Doc/data/stable_abi.dat M Doc/library/functions.rst diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst index 5706777c41db4..63290e0a7f0bf 100644 --- a/Doc/c-api/iter.rst +++ b/Doc/c-api/iter.rst @@ -12,6 +12,12 @@ There are two functions specifically for working with iterators. Return non-zero if the object *o* supports the iterator protocol, and ``0`` otherwise. This function always succeeds. +.. c:function:: int PyAiter_Check(PyObject *o) + + Returns non-zero if the object 'obj' provides :class:`AsyncIterator` + protocols, and ``0`` otherwise. This function always succeeds. + + .. versionadded:: 3.10 .. c:function:: PyObject* PyIter_Next(PyObject *o) diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index 1100af1df2928..42e3340acb79a 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -356,3 +356,14 @@ Object Protocol iterator for the object argument, or the object itself if the object is already an iterator. Raises :exc:`TypeError` and returns ``NULL`` if the object cannot be iterated. + + +.. c:function:: PyObject* PyObject_GetAiter(PyObject *o) + + This is the equivalent to the Python expression ``aiter(o)``. Takes an + :class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. + This is typically a new iterator but if the argument is an + :class:`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and + returns ``NULL`` if the object cannot be iterated. + + .. versionadded:: 3.10 diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 8a6ee718a012d..505f1203dd1bd 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -1073,6 +1073,9 @@ PyInterpreterState_New:PyInterpreterState*::: PyIter_Check:int::: PyIter_Check:PyObject*:o:0: +PyAiter_Check:int::: +PyAiter_Check:PyObject*:o:0: + PyIter_Next:PyObject*::+1: PyIter_Next:PyObject*:o:0: @@ -1679,6 +1682,9 @@ PyObject_GetItem:PyObject*:key:0: PyObject_GetIter:PyObject*::+1: PyObject_GetIter:PyObject*:o:0: +PyObject_GetAiter:PyObject*::+1: +PyObject_GetAiter:PyObject*:o:0: + PyObject_HasAttr:int::: PyObject_HasAttr:PyObject*:o:0: PyObject_HasAttr:PyObject*:attr_name:0: diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 67d01da325307..3adee103bce2d 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -1,5 +1,6 @@ # File generated by 'make regen-limited-abi' # This is NOT an authoritative list of stable ABI symbols +PyAiter_Check PyArg_Parse PyArg_ParseTuple PyArg_ParseTupleAndKeywords @@ -465,6 +466,7 @@ PyObject_GenericGetAttr PyObject_GenericGetDict PyObject_GenericSetAttr PyObject_GenericSetDict +PyObject_GetAiter PyObject_GetAttr PyObject_GetAttrString PyObject_GetItem diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 4e2e58ee9dd8b..5cb1df93702d6 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -71,6 +71,7 @@ are always available. They are listed here in alphabetical order. Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant. + .. versionadded:: 3.10 .. function:: all(iterable) @@ -97,6 +98,7 @@ are always available. They are listed here in alphabetical order. iterator. If *default* is given, it is returned if the iterator is exhausted, otherwise :exc:`StopAsyncIteration` is raised. + .. versionadded:: 3.10 .. function:: any(iterable) From webhook-mailer at python.org Tue Mar 23 20:05:00 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 24 Mar 2021 00:05:00 -0000 Subject: [Python-checkins] bpo-43452: Document the PyType_Lookup optimizations in the What's New for 3.10 (GH-24949) Message-ID: https://github.com/python/cpython/commit/a054f6b2b1d9f75edfb5ec2247bbf60f07491977 commit: a054f6b2b1d9f75edfb5ec2247bbf60f07491977 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-24T00:04:52Z summary: bpo-43452: Document the PyType_Lookup optimizations in the What's New for 3.10 (GH-24949) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 7ed43ad819104..97442aa6b3dc6 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -946,7 +946,6 @@ Optimizations for more details. (Contributed by Victor Stinner and Pablo Galindo in :issue:`38980`.) - * Function parameters and their annotations are no longer computed at runtime, but rather at compilation time. They are stored as a tuple of strings at the bytecode level. It is now around 2 times faster to create a function with @@ -958,6 +957,10 @@ Optimizations algorithm to avoid quadratic behavior on long strings. (Contributed by Dennis Sweeney in :issue:`41972`) +* Added micro-optimizations to ``_PyType_Lookup()`` to improve type attribute cache lookup + performance in the common case of cache hits. This makes the interpreter 1.04 times faster + in average (Contributed by Dino Viehland in :issue:`43452`) + Deprecated ========== From webhook-mailer at python.org Tue Mar 23 20:29:18 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 24 Mar 2021 00:29:18 -0000 Subject: [Python-checkins] bpo-43244: Remove parser_interface.h header file (GH-25001) Message-ID: https://github.com/python/cpython/commit/57364ce34e0492fbc8b0a6b8c882f384bb489457 commit: 57364ce34e0492fbc8b0a6b8c882f384bb489457 branch: master author: Victor Stinner committer: vstinner date: 2021-03-24T01:29:09+01:00 summary: bpo-43244: Remove parser_interface.h header file (GH-25001) Remove parser functions using the "struct _mod" type, because the AST C API was removed: * PyParser_ASTFromFile() * PyParser_ASTFromFileObject() * PyParser_ASTFromFilename() * PyParser_ASTFromString() * PyParser_ASTFromStringObject() These functions were undocumented and excluded from the limited C API. Add pycore_parser.h internal header file. Rename functions: * PyParser_ASTFromFileObject() => _PyParser_ASTFromFile() * PyParser_ASTFromStringObject() => _PyParser_ASTFromString() These functions are no longer exported (replace PyAPI_FUNC() with extern). Remove also _PyPegen_run_parser_from_file() function. Update test_peg_generator to use _PyPegen_run_parser_from_file_pointer() instead. files: A Include/internal/pycore_parser.h D Include/cpython/parser_interface.h M Doc/whatsnew/3.10.rst M Include/Python.h M Makefile.pre.in M Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst M Parser/peg_api.c M Parser/pegen.c M Parser/pegen.h M Python/pythonrun.c M Python/symtable.c M Tools/peg_generator/peg_extension/peg_extension.c diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 97442aa6b3dc6..bb3da4f565ff4 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1403,14 +1403,19 @@ Removed Windows ```` header. Use the Python :mod:`ast` module instead. (Contributed by Victor Stinner in :issue:`43244`.) -* Remove the compiler functions using ``struct _mod`` type, because the public - AST C API was removed: +* Remove the compiler and parser functions using ``struct _mod`` type, because + the public AST C API was removed: * ``PyAST_Compile()`` * ``PyAST_CompileEx()`` * ``PyAST_CompileObject()`` * ``PyFuture_FromAST()`` * ``PyFuture_FromASTObject()`` + * ``PyParser_ASTFromFile()`` + * ``PyParser_ASTFromFileObject()`` + * ``PyParser_ASTFromFilename()`` + * ``PyParser_ASTFromString()`` + * ``PyParser_ASTFromStringObject()`` These functions were undocumented and excluded from the limited C API. (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Include/Python.h b/Include/Python.h index 86dbbcf6bd85d..c87a7dd3ac1ce 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -141,7 +141,6 @@ #include "modsupport.h" #include "compile.h" #include "pythonrun.h" -#include "cpython/parser_interface.h" #include "pylifecycle.h" #include "ceval.h" #include "sysmodule.h" diff --git a/Include/cpython/parser_interface.h b/Include/cpython/parser_interface.h deleted file mode 100644 index 1c6576d926d8d..0000000000000 --- a/Include/cpython/parser_interface.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef Py_PEGENINTERFACE -#define Py_PEGENINTERFACE -#ifdef __cplusplus -extern "C" { -#endif - -#include "Python.h" - -#ifndef Py_LIMITED_API -PyAPI_FUNC(struct _mod *) PyParser_ASTFromString( - const char *str, - const char *filename, - int mode, - PyCompilerFlags *flags, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject( - const char *str, - PyObject* filename, - int mode, - PyCompilerFlags *flags, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile( - FILE *fp, - const char *filename, - const char* enc, - int mode, - const char *ps1, - const char *ps2, - PyCompilerFlags *flags, - int *errcode, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject( - FILE *fp, - PyObject *filename_ob, - const char *enc, - int mode, - const char *ps1, - const char *ps2, - PyCompilerFlags *flags, - int *errcode, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromFilename( - const char *filename, - int mode, - PyCompilerFlags *flags, - PyArena *arena); -#endif /* !Py_LIMITED_API */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_PEGENINTERFACE */ diff --git a/Include/internal/pycore_parser.h b/Include/internal/pycore_parser.h new file mode 100644 index 0000000000000..e2de24e2ca973 --- /dev/null +++ b/Include/internal/pycore_parser.h @@ -0,0 +1,31 @@ +#ifndef Py_INTERNAL_PARSER_H +#define Py_INTERNAL_PARSER_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern struct _mod* _PyParser_ASTFromString( + const char *str, + PyObject* filename, + int mode, + PyCompilerFlags *flags, + PyArena *arena); +extern struct _mod* _PyParser_ASTFromFile( + FILE *fp, + PyObject *filename_ob, + const char *enc, + int mode, + const char *ps1, + const char *ps2, + PyCompilerFlags *flags, + int *errcode, + PyArena *arena); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PARSER_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 5cfa0582b1b74..ed168d8872012 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -317,7 +317,7 @@ PEGEN_OBJS= \ PEGEN_HEADERS= \ - $(srcdir)/Include/cpython/parser_interface.h \ + $(srcdir)/Include/internal/pycore_parser.h \ $(srcdir)/Parser/pegen.h \ $(srcdir)/Parser/string_parser.h diff --git a/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst b/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst index 6cfe642d42958..fcc8076dea63e 100644 --- a/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst +++ b/Misc/NEWS.d/next/C API/2021-03-23-20-53-41.bpo-43244.VK3sLH.rst @@ -1,11 +1,16 @@ -Remove the compiler functions using ``struct _mod`` type, because the public -AST C API was removed: +Remove the compiler and parser functions using ``struct _mod`` type, because +the public AST C API was removed: * ``PyAST_Compile()`` * ``PyAST_CompileEx()`` * ``PyAST_CompileObject()`` * ``PyFuture_FromAST()`` * ``PyFuture_FromASTObject()`` +* ``PyParser_ASTFromFile()`` +* ``PyParser_ASTFromFileObject()`` +* ``PyParser_ASTFromFilename()`` +* ``PyParser_ASTFromString()`` +* ``PyParser_ASTFromStringObject()`` These functions were undocumented and excluded from the limited C API. Patch by Victor Stinner. diff --git a/Parser/peg_api.c b/Parser/peg_api.c index 1555dea51c2d9..1487ac4ff856c 100644 --- a/Parser/peg_api.c +++ b/Parser/peg_api.c @@ -4,21 +4,8 @@ #include "pegen.h" mod_ty -PyParser_ASTFromString(const char *str, const char *filename, int mode, - PyCompilerFlags *flags, PyArena *arena) -{ - PyObject *filename_ob = PyUnicode_FromString(filename); - if (filename_ob == NULL) { - return NULL; - } - mod_ty result = PyParser_ASTFromStringObject(str, filename_ob, mode, flags, arena); - Py_XDECREF(filename_ob); - return result; -} - -mod_ty -PyParser_ASTFromStringObject(const char *str, PyObject* filename, int mode, - PyCompilerFlags *flags, PyArena *arena) +_PyParser_ASTFromString(const char *str, PyObject* filename, int mode, + PyCompilerFlags *flags, PyArena *arena) { if (PySys_Audit("compile", "yO", str, filename) < 0) { return NULL; @@ -29,37 +16,9 @@ PyParser_ASTFromStringObject(const char *str, PyObject* filename, int mode, } mod_ty -PyParser_ASTFromFilename(const char *filename, int mode, PyCompilerFlags *flags, PyArena *arena) -{ - PyObject *filename_ob = PyUnicode_FromString(filename); - if (filename_ob == NULL) { - return NULL; - } - - mod_ty result = _PyPegen_run_parser_from_file(filename, mode, filename_ob, flags, arena); - Py_XDECREF(filename_ob); - return result; -} - -mod_ty -PyParser_ASTFromFile(FILE *fp, const char *filename, const char *enc, - int mode, const char *ps1, const char* ps2, - PyCompilerFlags *flags, int *errcode, PyArena *arena) -{ - PyObject *filename_ob = PyUnicode_FromString(filename); - if (filename_ob == NULL) { - return NULL; - } - mod_ty result = PyParser_ASTFromFileObject(fp, filename_ob, enc, mode, - ps1, ps2, flags, errcode, arena); - Py_XDECREF(filename_ob); - return result; -} - -mod_ty -PyParser_ASTFromFileObject(FILE *fp, PyObject *filename_ob, const char *enc, - int mode, const char *ps1, const char* ps2, - PyCompilerFlags *flags, int *errcode, PyArena *arena) +_PyParser_ASTFromFile(FILE *fp, PyObject *filename_ob, const char *enc, + int mode, const char *ps1, const char* ps2, + PyCompilerFlags *flags, int *errcode, PyArena *arena) { if (PySys_Audit("compile", "OO", Py_None, filename_ob) < 0) { return NULL; diff --git a/Parser/pegen.c b/Parser/pegen.c index f5c7994061e57..ce2135c7b70a8 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -1321,23 +1321,6 @@ _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filena return result; } -mod_ty -_PyPegen_run_parser_from_file(const char *filename, int start_rule, - PyObject *filename_ob, PyCompilerFlags *flags, PyArena *arena) -{ - FILE *fp = fopen(filename, "rb"); - if (fp == NULL) { - PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename); - return NULL; - } - - mod_ty result = _PyPegen_run_parser_from_file_pointer(fp, start_rule, filename_ob, - NULL, NULL, NULL, flags, NULL, arena); - - fclose(fp); - return result; -} - mod_ty _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filename_ob, PyCompilerFlags *flags, PyArena *arena) diff --git a/Parser/pegen.h b/Parser/pegen.h index 66de75c133ebc..af160d6a43d6b 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -227,7 +227,6 @@ void _PyPegen_Parser_Free(Parser *); mod_ty _PyPegen_run_parser_from_file_pointer(FILE *, int, PyObject *, const char *, const char *, const char *, PyCompilerFlags *, int *, PyArena *); void *_PyPegen_run_parser(Parser *); -mod_ty _PyPegen_run_parser_from_file(const char *, int, PyObject *, PyCompilerFlags *, PyArena *); mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, PyCompilerFlags *, PyArena *); asdl_stmt_seq *_PyPegen_interactive_exit(Parser *); asdl_seq *_PyPegen_singleton_seq(Parser *, void *); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e16835b13e817..79ff42ba95a49 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -16,6 +16,7 @@ #include "pycore_compile.h" // _PyAST_Compile() #include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" // _PyDebug_PrintTotalRefs() +#include "pycore_parser.h" // _PyParser_ASTFromString() #include "pycore_pyerrors.h" // _PyErr_Fetch #include "pycore_pylifecycle.h" // _Py_UnhandledKeyboardInterrupt #include "pycore_pystate.h" // _PyInterpreterState_GET() @@ -254,8 +255,8 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, return -1; } - mod = PyParser_ASTFromFileObject(fp, filename, enc, Py_single_input, - ps1, ps2, flags, &errcode, arena); + mod = _PyParser_ASTFromFile(fp, filename, enc, Py_single_input, + ps1, ps2, flags, &errcode, arena); Py_XDECREF(v); Py_XDECREF(w); @@ -1102,7 +1103,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); @@ -1121,8 +1122,8 @@ pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, } mod_ty mod; - mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, NULL, NULL, - flags, NULL, arena); + mod = _PyParser_ASTFromFile(fp, filename, NULL, start, NULL, NULL, + flags, NULL, arena); if (closeit) { fclose(fp); @@ -1292,7 +1293,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { PyArena_Free(arena); return NULL; diff --git a/Python/symtable.c b/Python/symtable.c index a149e28dcb3c4..efe6d50f3505b 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -2,6 +2,7 @@ #include "pycore_ast.h" // identifier, stmt_ty #undef Yield /* undefine macro conflicting with */ #include "pycore_compile.h" // _Py_Mangle() +#include "pycore_parser.h" // _PyParser_ASTFromString() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_symtable.h" // PySTEntryObject #include "structmember.h" // PyMemberDef @@ -1975,7 +1976,7 @@ _Py_SymtableStringObjectFlags(const char *str, PyObject *filename, if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { PyArena_Free(arena); return NULL; diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index f2a870ee8b552..209a34c1138d1 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -44,8 +44,17 @@ parse_file(PyObject *self, PyObject *args, PyObject *kwds) goto error; } + FILE *fp = fopen(filename, "rb"); + if (fp == NULL) { + PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename); + goto error; + } + PyCompilerFlags flags = _PyCompilerFlags_INIT; - mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, &flags, arena); + mod_ty res = _PyPegen_run_parser_from_file_pointer( + fp, Py_file_input, filename_ob, + NULL, NULL, NULL, &flags, NULL, arena); + fclose(fp); if (res == NULL) { goto error; } From webhook-mailer at python.org Tue Mar 23 20:30:12 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 24 Mar 2021 00:30:12 -0000 Subject: [Python-checkins] bpo-31861: Fix possible crash in PyAnextAwaitable_New (GH-25005) Message-ID: https://github.com/python/cpython/commit/919d42d477093154a30b55d9d79f023dbbe5614a commit: 919d42d477093154a30b55d9d79f023dbbe5614a branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-24T00:30:02Z summary: bpo-31861: Fix possible crash in PyAnextAwaitable_New (GH-25005) files: M Objects/iterobject.c diff --git a/Objects/iterobject.c b/Objects/iterobject.c index 06a6da5695f8a..f0c6b79917680 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -368,7 +368,11 @@ PyTypeObject PyAnextAwaitable_Type = { PyObject * PyAnextAwaitable_New(PyObject *awaitable, PyObject *default_value) { - anextawaitableobject *anext = PyObject_GC_New(anextawaitableobject, &PyAnextAwaitable_Type); + anextawaitableobject *anext = PyObject_GC_New( + anextawaitableobject, &PyAnextAwaitable_Type); + if (anext == NULL) { + return NULL; + } Py_INCREF(awaitable); anext->wrapped = awaitable; Py_INCREF(default_value); From webhook-mailer at python.org Tue Mar 23 21:23:09 2021 From: webhook-mailer at python.org (vstinner) Date: Wed, 24 Mar 2021 01:23:09 -0000 Subject: [Python-checkins] bpo-43244: Remove the pyarena.h header (GH-25007) Message-ID: https://github.com/python/cpython/commit/8370e07e1e5b626e78ddc7aadbfaf248976c4454 commit: 8370e07e1e5b626e78ddc7aadbfaf248976c4454 branch: master author: Victor Stinner committer: vstinner date: 2021-03-24T02:23:01+01:00 summary: bpo-43244: Remove the pyarena.h header (GH-25007) Remove the pyarena.h header file with functions: * PyArena_New() * PyArena_Free() * PyArena_Malloc() * PyArena_AddPyObject() These functions were undocumented, excluded from the limited C API, and were only used internally by the compiler. Add pycore_pyarena.h header. Rename functions: * PyArena_New() => _PyArena_New() * PyArena_Free() => _PyArena_Free() * PyArena_Malloc() => _PyArena_Malloc() * PyArena_AddPyObject() => _PyArena_AddPyObject() files: A Include/internal/pycore_pyarena.h A Misc/NEWS.d/next/C API/2021-03-24-01-22-14.bpo-43244.31-97x.rst D Include/cpython/pyarena.h M Doc/whatsnew/3.10.rst M Include/Python.h M Include/internal/pycore_asdl.h M Include/internal/pycore_compile.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Parser/asdl_c.py M Parser/pegen.c M Parser/string_parser.c M Python/Python-ast.c M Python/ast_opt.c M Python/bltinmodule.c M Python/pyarena.c M Python/pythonrun.c M Python/symtable.c M Tools/peg_generator/peg_extension/peg_extension.c diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index bb3da4f565ff4..d4335eb11e345 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1419,3 +1419,14 @@ Removed These functions were undocumented and excluded from the limited C API. (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove the ``pyarena.h`` header file with functions: + + * ``PyArena_New()`` + * ``PyArena_Free()`` + * ``PyArena_Malloc()`` + * ``PyArena_AddPyObject()`` + + These functions were undocumented, excluded from the limited C API, and were + only used internally by the compiler. + (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Include/Python.h b/Include/Python.h index c87a7dd3ac1ce..1df2fd5343b23 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -137,7 +137,6 @@ #include "pystate.h" #include "context.h" -#include "cpython/pyarena.h" #include "modsupport.h" #include "compile.h" #include "pythonrun.h" diff --git a/Include/cpython/pyarena.h b/Include/cpython/pyarena.h deleted file mode 100644 index db3ad0188fe1c..0000000000000 --- a/Include/cpython/pyarena.h +++ /dev/null @@ -1,64 +0,0 @@ -/* An arena-like memory interface for the compiler. - */ - -#ifndef Py_LIMITED_API -#ifndef Py_PYARENA_H -#define Py_PYARENA_H - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct _arena PyArena; - - /* PyArena_New() and PyArena_Free() create a new arena and free it, - respectively. Once an arena has been created, it can be used - to allocate memory via PyArena_Malloc(). Pointers to PyObject can - also be registered with the arena via PyArena_AddPyObject(), and the - arena will ensure that the PyObjects stay alive at least until - PyArena_Free() is called. When an arena is freed, all the memory it - allocated is freed, the arena releases internal references to registered - PyObject*, and none of its pointers are valid. - XXX (tim) What does "none of its pointers are valid" mean? Does it - XXX mean that pointers previously obtained via PyArena_Malloc() are - XXX no longer valid? (That's clearly true, but not sure that's what - XXX the text is trying to say.) - - PyArena_New() returns an arena pointer. On error, it - returns a negative number and sets an exception. - XXX (tim): Not true. On error, PyArena_New() actually returns NULL, - XXX and looks like it may or may not set an exception (e.g., if the - XXX internal PyList_New(0) returns NULL, PyArena_New() passes that on - XXX and an exception is set; OTOH, if the internal - XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but - XXX an exception is not set in that case). - */ - PyAPI_FUNC(PyArena *) PyArena_New(void); - PyAPI_FUNC(void) PyArena_Free(PyArena *); - - /* Mostly like malloc(), return the address of a block of memory spanning - * `size` bytes, or return NULL (without setting an exception) if enough - * new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with - * size=0 does not guarantee to return a unique pointer (the pointer - * returned may equal one or more other pointers obtained from - * PyArena_Malloc()). - * Note that pointers obtained via PyArena_Malloc() must never be passed to - * the system free() or realloc(), or to any of Python's similar memory- - * management functions. PyArena_Malloc()-obtained pointers remain valid - * until PyArena_Free(ar) is called, at which point all pointers obtained - * from the arena `ar` become invalid simultaneously. - */ - PyAPI_FUNC(void *) PyArena_Malloc(PyArena *, size_t size); - - /* This routine isn't a proper arena allocation routine. It takes - * a PyObject* and records it so that it can be DECREFed when the - * arena is freed. - */ - PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *); - -#ifdef __cplusplus -} -#endif - -#endif /* !Py_PYARENA_H */ -#endif /* Py_LIMITED_API */ diff --git a/Include/internal/pycore_asdl.h b/Include/internal/pycore_asdl.h index 4df0e3440a634..c0b07c31810b9 100644 --- a/Include/internal/pycore_asdl.h +++ b/Include/internal/pycore_asdl.h @@ -8,6 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif +#include "pycore_pyarena.h" // _PyArena_Malloc() + typedef PyObject * identifier; typedef PyObject * string; typedef PyObject * object; @@ -65,7 +67,7 @@ asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *a return NULL; \ } \ n += sizeof(asdl_ ## NAME ## _seq); \ - seq = (asdl_ ## NAME ## _seq *)PyArena_Malloc(arena, n); \ + seq = (asdl_ ## NAME ## _seq *)_PyArena_Malloc(arena, n); \ if (!seq) { \ PyErr_NoMemory(); \ return NULL; \ diff --git a/Include/internal/pycore_compile.h b/Include/internal/pycore_compile.h index f6caec3fa1d28..e8859bbec6daa 100644 --- a/Include/internal/pycore_compile.h +++ b/Include/internal/pycore_compile.h @@ -8,7 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -struct _mod; // Type defined in pycore_ast.h +struct _arena; // Type defined in pycore_pyarena.h +struct _mod; // Type defined in pycore_ast.h // Export the symbol for test_peg_generator (built as a library) PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( @@ -16,7 +17,7 @@ PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( PyObject *filename, PyCompilerFlags *flags, int optimize, - PyArena *arena); + struct _arena *arena); extern PyFutureFeatures* _PyFuture_FromAST( struct _mod * mod, PyObject *filename @@ -31,7 +32,7 @@ typedef struct { extern int _PyAST_Optimize( struct _mod *, - PyArena *arena, + struct _arena *arena, _PyASTOptimizeState *state); #ifdef __cplusplus diff --git a/Include/internal/pycore_pyarena.h b/Include/internal/pycore_pyarena.h new file mode 100644 index 0000000000000..d78972a88ca23 --- /dev/null +++ b/Include/internal/pycore_pyarena.h @@ -0,0 +1,64 @@ +/* An arena-like memory interface for the compiler. + */ + +#ifndef Py_INTERNAL_PYARENA_H +#define Py_INTERNAL_PYARENA_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +typedef struct _arena PyArena; + +/* _PyArena_New() and _PyArena_Free() create a new arena and free it, + respectively. Once an arena has been created, it can be used + to allocate memory via _PyArena_Malloc(). Pointers to PyObject can + also be registered with the arena via _PyArena_AddPyObject(), and the + arena will ensure that the PyObjects stay alive at least until + _PyArena_Free() is called. When an arena is freed, all the memory it + allocated is freed, the arena releases internal references to registered + PyObject*, and none of its pointers are valid. + XXX (tim) What does "none of its pointers are valid" mean? Does it + XXX mean that pointers previously obtained via _PyArena_Malloc() are + XXX no longer valid? (That's clearly true, but not sure that's what + XXX the text is trying to say.) + + _PyArena_New() returns an arena pointer. On error, it + returns a negative number and sets an exception. + XXX (tim): Not true. On error, _PyArena_New() actually returns NULL, + XXX and looks like it may or may not set an exception (e.g., if the + XXX internal PyList_New(0) returns NULL, _PyArena_New() passes that on + XXX and an exception is set; OTOH, if the internal + XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but + XXX an exception is not set in that case). +*/ +PyAPI_FUNC(PyArena*) _PyArena_New(void); +PyAPI_FUNC(void) _PyArena_Free(PyArena *); + +/* Mostly like malloc(), return the address of a block of memory spanning + * `size` bytes, or return NULL (without setting an exception) if enough + * new memory can't be obtained. Unlike malloc(0), _PyArena_Malloc() with + * size=0 does not guarantee to return a unique pointer (the pointer + * returned may equal one or more other pointers obtained from + * _PyArena_Malloc()). + * Note that pointers obtained via _PyArena_Malloc() must never be passed to + * the system free() or realloc(), or to any of Python's similar memory- + * management functions. _PyArena_Malloc()-obtained pointers remain valid + * until _PyArena_Free(ar) is called, at which point all pointers obtained + * from the arena `ar` become invalid simultaneously. + */ +PyAPI_FUNC(void*) _PyArena_Malloc(PyArena *, size_t size); + +/* This routine isn't a proper arena allocation routine. It takes + * a PyObject* and records it so that it can be DECREFed when the + * arena is freed. + */ +PyAPI_FUNC(int) _PyArena_AddPyObject(PyArena *, PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYARENA_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index ed168d8872012..365449d644583 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1119,7 +1119,6 @@ PYTHON_HEADERS= \ $(srcdir)/Include/cpython/objimpl.h \ $(srcdir)/Include/cpython/odictobject.h \ $(srcdir)/Include/cpython/picklebufobject.h \ - $(srcdir)/Include/cpython/pyarena.h \ $(srcdir)/Include/cpython/pyctype.h \ $(srcdir)/Include/cpython/pydebug.h \ $(srcdir)/Include/cpython/pyerrors.h \ @@ -1163,6 +1162,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_long.h \ $(srcdir)/Include/internal/pycore_object.h \ $(srcdir)/Include/internal/pycore_pathconfig.h \ + $(srcdir)/Include/internal/pycore_pyarena.h \ $(srcdir)/Include/internal/pycore_pyerrors.h \ $(srcdir)/Include/internal/pycore_pyhash.h \ $(srcdir)/Include/internal/pycore_pylifecycle.h \ diff --git a/Misc/NEWS.d/next/C API/2021-03-24-01-22-14.bpo-43244.31-97x.rst b/Misc/NEWS.d/next/C API/2021-03-24-01-22-14.bpo-43244.31-97x.rst new file mode 100644 index 0000000000000..389ee3e133948 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-03-24-01-22-14.bpo-43244.31-97x.rst @@ -0,0 +1,10 @@ +Remove the ``pyarena.h`` header file with functions: + +* ``PyArena_New()`` +* ``PyArena_Free()`` +* ``PyArena_Malloc()`` +* ``PyArena_AddPyObject()`` + +These functions were undocumented, excluded from the limited C API, and were +only used internally by the compiler. +Patch by Victor Stinner. diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index baa2254e01981..81ac2360cb878 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -201,6 +201,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index d9f1ea632209f..8c104bf7b3103 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -564,6 +564,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 73cb774c17edd..3bdeedb394d61 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -362,7 +362,7 @@ def emit(s, depth=0, reflow=True): emit('return NULL;', 2) emit('}', 1) - emit("p = (%s)PyArena_Malloc(arena, sizeof(*p));" % ctype, 1); + emit("p = (%s)_PyArena_Malloc(arena, sizeof(*p));" % ctype, 1); emit("if (!p)", 1) emit("return NULL;", 2) if union: @@ -946,7 +946,7 @@ def visitModule(self, mod): if (obj == Py_None) obj = NULL; if (obj) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -958,7 +958,7 @@ def visitModule(self, mod): static int obj2ast_constant(struct ast_state *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } diff --git a/Parser/pegen.c b/Parser/pegen.c index ce2135c7b70a8..1d23b99dd980c 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -13,7 +13,7 @@ _PyPegen_new_type_comment(Parser *p, char *s) if (res == NULL) { return NULL; } - if (PyArena_AddPyObject(p->arena, res) < 0) { + if (_PyArena_AddPyObject(p->arena, res) < 0) { Py_DECREF(res); return NULL; } @@ -121,7 +121,7 @@ _PyPegen_new_identifier(Parser *p, char *n) id = id2; } PyUnicode_InternInPlace(&id); - if (PyArena_AddPyObject(p->arena, id) < 0) + if (_PyArena_AddPyObject(p->arena, id) < 0) { Py_DECREF(id); goto error; @@ -526,7 +526,7 @@ int _PyPegen_insert_memo(Parser *p, int mark, int type, void *node) { // Insert in front - Memo *m = PyArena_Malloc(p->arena, sizeof(Memo)); + Memo *m = _PyArena_Malloc(p->arena, sizeof(Memo)); if (m == NULL) { return -1; } @@ -690,7 +690,7 @@ _PyPegen_fill_token(Parser *p) if (t->bytes == NULL) { return -1; } - PyArena_AddPyObject(p->arena, t->bytes); + _PyArena_AddPyObject(p->arena, t->bytes); int lineno = type == STRING ? p->tok->first_lineno : p->tok->lineno; const char *line_start = type == STRING ? p->tok->multi_line_start : p->tok->line_start; @@ -1029,7 +1029,7 @@ _PyPegen_number_token(Parser *p) return NULL; } - if (PyArena_AddPyObject(p->arena, c) < 0) { + if (_PyArena_AddPyObject(p->arena, c) < 0) { Py_DECREF(c); p->error_indicator = 1; return NULL; @@ -1509,7 +1509,7 @@ _PyPegen_join_names_with_dot(Parser *p, expr_ty first_name, expr_ty second_name) return NULL; } PyUnicode_InternInPlace(&uni); - if (PyArena_AddPyObject(p->arena, uni) < 0) { + if (_PyArena_AddPyObject(p->arena, uni) < 0) { Py_DECREF(uni); return NULL; } @@ -1547,7 +1547,7 @@ _PyPegen_alias_for_star(Parser *p) if (!str) { return NULL; } - if (PyArena_AddPyObject(p->arena, str) < 0) { + if (_PyArena_AddPyObject(p->arena, str) < 0) { Py_DECREF(str); return NULL; } @@ -1577,7 +1577,7 @@ CmpopExprPair * _PyPegen_cmpop_expr_pair(Parser *p, cmpop_ty cmpop, expr_ty expr) { assert(expr != NULL); - CmpopExprPair *a = PyArena_Malloc(p->arena, sizeof(CmpopExprPair)); + CmpopExprPair *a = _PyArena_Malloc(p->arena, sizeof(CmpopExprPair)); if (!a) { return NULL; } @@ -1718,7 +1718,7 @@ _PyPegen_set_expr_context(Parser *p, expr_ty expr, expr_context_ty ctx) KeyValuePair * _PyPegen_key_value_pair(Parser *p, expr_ty key, expr_ty value) { - KeyValuePair *a = PyArena_Malloc(p->arena, sizeof(KeyValuePair)); + KeyValuePair *a = _PyArena_Malloc(p->arena, sizeof(KeyValuePair)); if (!a) { return NULL; } @@ -1763,7 +1763,7 @@ _PyPegen_get_values(Parser *p, asdl_seq *seq) NameDefaultPair * _PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value, Token *tc) { - NameDefaultPair *a = PyArena_Malloc(p->arena, sizeof(NameDefaultPair)); + NameDefaultPair *a = _PyArena_Malloc(p->arena, sizeof(NameDefaultPair)); if (!a) { return NULL; } @@ -1776,7 +1776,7 @@ _PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value, Token *tc) SlashWithDefault * _PyPegen_slash_with_default(Parser *p, asdl_arg_seq *plain_names, asdl_seq *names_with_defaults) { - SlashWithDefault *a = PyArena_Malloc(p->arena, sizeof(SlashWithDefault)); + SlashWithDefault *a = _PyArena_Malloc(p->arena, sizeof(SlashWithDefault)); if (!a) { return NULL; } @@ -1789,7 +1789,7 @@ _PyPegen_slash_with_default(Parser *p, asdl_arg_seq *plain_names, asdl_seq *name StarEtc * _PyPegen_star_etc(Parser *p, arg_ty vararg, asdl_seq *kwonlyargs, arg_ty kwarg) { - StarEtc *a = PyArena_Malloc(p->arena, sizeof(StarEtc)); + StarEtc *a = _PyArena_Malloc(p->arena, sizeof(StarEtc)); if (!a) { return NULL; } @@ -2025,7 +2025,7 @@ _PyPegen_empty_arguments(Parser *p) AugOperator * _PyPegen_augoperator(Parser *p, operator_ty kind) { - AugOperator *a = PyArena_Malloc(p->arena, sizeof(AugOperator)); + AugOperator *a = _PyArena_Malloc(p->arena, sizeof(AugOperator)); if (!a) { return NULL; } @@ -2070,7 +2070,7 @@ _PyPegen_class_def_decorators(Parser *p, asdl_expr_seq *decorators, stmt_ty clas KeywordOrStarred * _PyPegen_keyword_or_starred(Parser *p, void *element, int is_keyword) { - KeywordOrStarred *a = PyArena_Malloc(p->arena, sizeof(KeywordOrStarred)); + KeywordOrStarred *a = _PyArena_Malloc(p->arena, sizeof(KeywordOrStarred)); if (!a) { return NULL; } @@ -2211,7 +2211,7 @@ _PyPegen_concatenate_strings(Parser *p, asdl_seq *strings) } if (bytesmode) { - if (PyArena_AddPyObject(p->arena, bytes_str) < 0) { + if (_PyArena_AddPyObject(p->arena, bytes_str) < 0) { goto error; } return Constant(bytes_str, NULL, first->lineno, first->col_offset, last->end_lineno, diff --git a/Parser/string_parser.c b/Parser/string_parser.c index 0f3665c3453e2..6a1a3952e72f7 100644 --- a/Parser/string_parser.c +++ b/Parser/string_parser.c @@ -1031,7 +1031,7 @@ make_str_node_and_del(Parser *p, PyObject **str, Token* first_token, Token *last PyObject *kind = NULL; *str = NULL; assert(PyUnicode_CheckExact(s)); - if (PyArena_AddPyObject(p->arena, s) < 0) { + if (_PyArena_AddPyObject(p->arena, s) < 0) { Py_DECREF(s); return NULL; } diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 63c214dba172b..3c4b0ba8b83c5 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -961,7 +961,7 @@ static int obj2ast_object(struct ast_state *Py_UNUSED(state), PyObject* obj, PyO if (obj == Py_None) obj = NULL; if (obj) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -973,7 +973,7 @@ static int obj2ast_object(struct ast_state *Py_UNUSED(state), PyObject* obj, PyO static int obj2ast_constant(struct ast_state *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -1787,7 +1787,7 @@ Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, PyArena *arena) { mod_ty p; - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Module_kind; @@ -1800,7 +1800,7 @@ mod_ty Interactive(asdl_stmt_seq * body, PyArena *arena) { mod_ty p; - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Interactive_kind; @@ -1817,7 +1817,7 @@ Expression(expr_ty body, PyArena *arena) "field 'body' is required for Expression"); return NULL; } - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Expression_kind; @@ -1834,7 +1834,7 @@ FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena *arena) "field 'returns' is required for FunctionType"); return NULL; } - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = FunctionType_kind; @@ -1860,7 +1860,7 @@ FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * body, "field 'args' is required for FunctionDef"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = FunctionDef_kind; @@ -1894,7 +1894,7 @@ AsyncFunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * body, "field 'args' is required for AsyncFunctionDef"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AsyncFunctionDef_kind; @@ -1922,7 +1922,7 @@ ClassDef(identifier name, asdl_expr_seq * bases, asdl_keyword_seq * keywords, "field 'name' is required for ClassDef"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ClassDef_kind; @@ -1943,7 +1943,7 @@ Return(expr_ty value, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Return_kind; @@ -1960,7 +1960,7 @@ Delete(asdl_expr_seq * targets, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Delete_kind; @@ -1982,7 +1982,7 @@ Assign(asdl_expr_seq * targets, expr_ty value, string type_comment, int lineno, "field 'value' is required for Assign"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Assign_kind; @@ -2016,7 +2016,7 @@ AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno, int "field 'value' is required for AugAssign"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AugAssign_kind; @@ -2046,7 +2046,7 @@ AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int simple, int "field 'annotation' is required for AnnAssign"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AnnAssign_kind; @@ -2077,7 +2077,7 @@ For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, asdl_stmt_seq * orelse, "field 'iter' is required for For"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = For_kind; @@ -2109,7 +2109,7 @@ AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, asdl_stmt_seq * "field 'iter' is required for AsyncFor"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AsyncFor_kind; @@ -2135,7 +2135,7 @@ While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int lineno, "field 'test' is required for While"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = While_kind; @@ -2159,7 +2159,7 @@ If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int lineno, int "field 'test' is required for If"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = If_kind; @@ -2178,7 +2178,7 @@ With(asdl_withitem_seq * items, asdl_stmt_seq * body, string type_comment, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = With_kind; @@ -2198,7 +2198,7 @@ AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, string type_comment, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AsyncWith_kind; @@ -2222,7 +2222,7 @@ Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, int col_offset, "field 'subject' is required for Match"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Match_kind; @@ -2240,7 +2240,7 @@ Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Raise_kind; @@ -2259,7 +2259,7 @@ Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, asdl_stmt_seq * end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Try_kind; @@ -2284,7 +2284,7 @@ Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int end_lineno, "field 'test' is required for Assert"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Assert_kind; @@ -2302,7 +2302,7 @@ Import(asdl_alias_seq * names, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Import_kind; @@ -2319,7 +2319,7 @@ ImportFrom(identifier module, asdl_alias_seq * names, int level, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ImportFrom_kind; @@ -2338,7 +2338,7 @@ Global(asdl_identifier_seq * names, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Global_kind; @@ -2355,7 +2355,7 @@ Nonlocal(asdl_identifier_seq * names, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Nonlocal_kind; @@ -2377,7 +2377,7 @@ Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int "field 'value' is required for Expr"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Expr_kind; @@ -2394,7 +2394,7 @@ Pass(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Pass_kind; @@ -2410,7 +2410,7 @@ Break(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Break_kind; @@ -2426,7 +2426,7 @@ Continue(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Continue_kind; @@ -2447,7 +2447,7 @@ BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int col_offset, int "field 'op' is required for BoolOp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = BoolOp_kind; @@ -2475,7 +2475,7 @@ NamedExpr(expr_ty target, expr_ty value, int lineno, int col_offset, int "field 'value' is required for NamedExpr"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = NamedExpr_kind; @@ -2508,7 +2508,7 @@ BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int col_offset, "field 'right' is required for BinOp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = BinOp_kind; @@ -2537,7 +2537,7 @@ UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, int "field 'operand' is required for UnaryOp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = UnaryOp_kind; @@ -2565,7 +2565,7 @@ Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, int "field 'body' is required for Lambda"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Lambda_kind; @@ -2598,7 +2598,7 @@ IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, "field 'orelse' is required for IfExp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = IfExp_kind; @@ -2617,7 +2617,7 @@ Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Dict_kind; @@ -2635,7 +2635,7 @@ Set(asdl_expr_seq * elts, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Set_kind; @@ -2657,7 +2657,7 @@ ListComp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, int "field 'elt' is required for ListComp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ListComp_kind; @@ -2680,7 +2680,7 @@ SetComp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, int "field 'elt' is required for SetComp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = SetComp_kind; @@ -2709,7 +2709,7 @@ DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * generators, int "field 'value' is required for DictComp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = DictComp_kind; @@ -2733,7 +2733,7 @@ GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, int "field 'elt' is required for GeneratorExp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = GeneratorExp_kind; @@ -2756,7 +2756,7 @@ Await(expr_ty value, int lineno, int col_offset, int end_lineno, int "field 'value' is required for Await"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Await_kind; @@ -2773,7 +2773,7 @@ Yield(expr_ty value, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Yield_kind; @@ -2795,7 +2795,7 @@ YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int "field 'value' is required for YieldFrom"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = YieldFrom_kind; @@ -2818,7 +2818,7 @@ Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * comparators, int "field 'left' is required for Compare"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Compare_kind; @@ -2842,7 +2842,7 @@ Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * keywords, int "field 'func' is required for Call"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Call_kind; @@ -2867,7 +2867,7 @@ FormattedValue(expr_ty value, int conversion, expr_ty format_spec, int lineno, "field 'value' is required for FormattedValue"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = FormattedValue_kind; @@ -2886,7 +2886,7 @@ JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = JoinedStr_kind; @@ -2908,7 +2908,7 @@ Constant(constant value, string kind, int lineno, int col_offset, int "field 'value' is required for Constant"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Constant_kind; @@ -2941,7 +2941,7 @@ Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int lineno, int "field 'ctx' is required for Attribute"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Attribute_kind; @@ -2975,7 +2975,7 @@ Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int lineno, int "field 'ctx' is required for Subscript"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Subscript_kind; @@ -3004,7 +3004,7 @@ Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, int "field 'ctx' is required for Starred"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Starred_kind; @@ -3032,7 +3032,7 @@ Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, int "field 'ctx' is required for Name"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Name_kind; @@ -3055,7 +3055,7 @@ List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int "field 'ctx' is required for List"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = List_kind; @@ -3078,7 +3078,7 @@ Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int col_offset, "field 'ctx' is required for Tuple"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Tuple_kind; @@ -3096,7 +3096,7 @@ Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Slice_kind; @@ -3125,7 +3125,7 @@ MatchAs(expr_ty pattern, identifier name, int lineno, int col_offset, int "field 'name' is required for MatchAs"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = MatchAs_kind; @@ -3143,7 +3143,7 @@ MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = MatchOr_kind; @@ -3170,7 +3170,7 @@ comprehension(expr_ty target, expr_ty iter, asdl_expr_seq * ifs, int is_async, "field 'iter' is required for comprehension"); return NULL; } - p = (comprehension_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (comprehension_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->target = target; @@ -3186,7 +3186,7 @@ ExceptHandler(expr_ty type, identifier name, asdl_stmt_seq * body, int lineno, *arena) { excepthandler_ty p; - p = (excepthandler_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (excepthandler_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ExceptHandler_kind; @@ -3206,7 +3206,7 @@ arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, arg_ty vararg, asdl_expr_seq * defaults, PyArena *arena) { arguments_ty p; - p = (arguments_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (arguments_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->posonlyargs = posonlyargs; @@ -3229,7 +3229,7 @@ arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int "field 'arg' is required for arg"); return NULL; } - p = (arg_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (arg_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->arg = arg; @@ -3252,7 +3252,7 @@ keyword(identifier arg, expr_ty value, int lineno, int col_offset, int "field 'value' is required for keyword"); return NULL; } - p = (keyword_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (keyword_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->arg = arg; @@ -3273,7 +3273,7 @@ alias(identifier name, identifier asname, PyArena *arena) "field 'name' is required for alias"); return NULL; } - p = (alias_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (alias_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->name = name; @@ -3290,7 +3290,7 @@ withitem(expr_ty context_expr, expr_ty optional_vars, PyArena *arena) "field 'context_expr' is required for withitem"); return NULL; } - p = (withitem_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (withitem_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->context_expr = context_expr; @@ -3307,7 +3307,7 @@ match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * body, PyArena *arena) "field 'pattern' is required for match_case"); return NULL; } - p = (match_case_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (match_case_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->pattern = pattern; @@ -3325,7 +3325,7 @@ TypeIgnore(int lineno, string tag, PyArena *arena) "field 'tag' is required for TypeIgnore"); return NULL; } - p = (type_ignore_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (type_ignore_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = TypeIgnore_kind; diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 64fa0672ad397..0310466b34f3f 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -16,7 +16,7 @@ make_const(expr_ty node, PyObject *val, PyArena *arena) PyErr_Clear(); return 1; } - if (PyArena_AddPyObject(arena, val) < 0) { + if (_PyArena_AddPyObject(arena, val) < 0) { Py_DECREF(val); return 0; } diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index afe0f820cf347..d08e9a332670a 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -828,21 +828,21 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, PyArena *arena; mod_ty mod; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) goto error; mod = PyAST_obj2mod(source, arena, compile_mode); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); goto error; } if (!_PyAST_Validate(mod)) { - PyArena_Free(arena); + _PyArena_Free(arena); goto error; } result = (PyObject*)_PyAST_Compile(mod, filename, &cf, optimize, arena); - PyArena_Free(arena); + _PyArena_Free(arena); } goto finally; } diff --git a/Python/pyarena.c b/Python/pyarena.c index aefb787e554f9..ead03370d153c 100644 --- a/Python/pyarena.c +++ b/Python/pyarena.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_pyarena.h" // PyArena /* A simple arena block structure. @@ -125,7 +126,7 @@ block_alloc(block *b, size_t size) } PyArena * -PyArena_New() +_PyArena_New(void) { PyArena* arena = (PyArena *)PyMem_Malloc(sizeof(PyArena)); if (!arena) @@ -154,7 +155,7 @@ PyArena_New() } void -PyArena_Free(PyArena *arena) +_PyArena_Free(PyArena *arena) { assert(arena); #if defined(Py_DEBUG) @@ -177,7 +178,7 @@ PyArena_Free(PyArena *arena) } void * -PyArena_Malloc(PyArena *arena, size_t size) +_PyArena_Malloc(PyArena *arena, size_t size) { void *p = block_alloc(arena->a_cur, size); if (!p) @@ -200,7 +201,7 @@ PyArena_Malloc(PyArena *arena, size_t size) } int -PyArena_AddPyObject(PyArena *arena, PyObject *obj) +_PyArena_AddPyObject(PyArena *arena, PyObject *obj) { int r = PyList_Append(arena->a_objects, obj); if (r >= 0) { diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 79ff42ba95a49..b562875f8a4fb 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -247,7 +247,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, } } } - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) { Py_XDECREF(v); Py_XDECREF(w); @@ -262,7 +262,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, Py_XDECREF(w); Py_XDECREF(oenc); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); if (errcode == E_EOF) { PyErr_Clear(); return E_EOF; @@ -271,12 +271,12 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, } m = PyImport_AddModuleObject(mod_name); if (m == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return -1; } d = PyModule_GetDict(m); v = run_mod(mod, filename, d, d, flags, arena); - PyArena_Free(arena); + _PyArena_Free(arena); if (v == NULL) { return -1; } @@ -1099,7 +1099,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (filename == NULL) return NULL; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) return NULL; @@ -1107,7 +1107,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); - PyArena_Free(arena); + _PyArena_Free(arena); return ret; } @@ -1116,7 +1116,7 @@ static PyObject * pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags) { - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } @@ -1136,7 +1136,7 @@ pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, else { ret = NULL; } - PyArena_Free(arena); + _PyArena_Free(arena); return ret; } @@ -1289,22 +1289,22 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, { PyCodeObject *co; mod_ty mod; - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) return NULL; mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return NULL; } if (flags && (flags->cf_flags & PyCF_ONLY_AST)) { PyObject *result = PyAST_mod2obj(mod); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } co = _PyAST_Compile(mod, filename, flags, optimize, arena); - PyArena_Free(arena); + _PyArena_Free(arena); return (PyObject *)co; } diff --git a/Python/symtable.c b/Python/symtable.c index efe6d50f3505b..68f2c71f18ea8 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1972,16 +1972,16 @@ _Py_SymtableStringObjectFlags(const char *str, PyObject *filename, mod_ty mod; PyArena *arena; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) return NULL; mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return NULL; } st = _PySymtable_Build(mod, filename, 0); - PyArena_Free(arena); + _PyArena_Free(arena); return st; } diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index 209a34c1138d1..94e729e56d9b9 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -32,7 +32,7 @@ parse_file(PyObject *self, PyObject *args, PyObject *kwds) return PyErr_Format(PyExc_ValueError, "Bad mode, must be 0 <= mode <= 2"); } - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } @@ -63,7 +63,7 @@ parse_file(PyObject *self, PyObject *args, PyObject *kwds) error: Py_XDECREF(filename_ob); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } @@ -80,7 +80,7 @@ parse_string(PyObject *self, PyObject *args, PyObject *kwds) return PyErr_Format(PyExc_ValueError, "Bad mode, must be 0 <= mode <= 2"); } - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } @@ -102,7 +102,7 @@ parse_string(PyObject *self, PyObject *args, PyObject *kwds) error: Py_XDECREF(filename_ob); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } From webhook-mailer at python.org Tue Mar 23 21:42:30 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 24 Mar 2021 01:42:30 -0000 Subject: [Python-checkins] bpo-31861: Fix reference leak in builtin_anext_impl() (GH-25008) Message-ID: https://github.com/python/cpython/commit/a02683ac38183fa3a45c32319dfd329c5e622f0e commit: a02683ac38183fa3a45c32319dfd329c5e622f0e branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-24T01:42:13Z summary: bpo-31861: Fix reference leak in builtin_anext_impl() (GH-25008) files: M Python/bltinmodule.c diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d08e9a332670a..a076006d65231 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1660,7 +1660,10 @@ builtin_anext_impl(PyObject *module, PyObject *aiterator, return awaitable; } - return PyAnextAwaitable_New(awaitable, default_value); + PyObject* new_awaitable = PyAnextAwaitable_New( + awaitable, default_value); + Py_DECREF(awaitable); + return new_awaitable; } From webhook-mailer at python.org Wed Mar 24 04:23:35 2021 From: webhook-mailer at python.org (gpshead) Date: Wed, 24 Mar 2021 08:23:35 -0000 Subject: [Python-checkins] bpo-42914: add a pprint underscore_numbers option (GH-24864) Message-ID: https://github.com/python/cpython/commit/3ba3d513b1e3c63d09cb798b982a9e6c369cea4c commit: 3ba3d513b1e3c63d09cb798b982a9e6c369cea4c branch: master author: sblondon committer: gpshead date: 2021-03-24T01:23:20-07:00 summary: bpo-42914: add a pprint underscore_numbers option (GH-24864) pprint() gains a new boolean underscore_numbers kwarg to emit integers with thousands separated by an underscore character for improved readability (for example 1_000_000 instead of 1000000). files: A Misc/NEWS.d/next/Library/2021-03-14-21-47-28.bpo-42914.9U1o33.rst M Doc/library/pprint.rst M Lib/pprint.py M Lib/test/test_pprint.py diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index 16256c549208f..b3b6ed56a5e17 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -36,7 +36,7 @@ The :mod:`pprint` module defines one class: .. index:: single: ...; placeholder .. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \ - compact=False, sort_dicts=True) + compact=False, sort_dicts=True, underscore_numbers=False) Construct a :class:`PrettyPrinter` instance. This constructor understands several keyword parameters. An output stream may be set using the *stream* @@ -55,7 +55,10 @@ The :mod:`pprint` module defines one class: will be formatted on a separate line. If *compact* is true, as many items as will fit within the *width* will be formatted on each output line. If *sort_dicts* is true (the default), dictionaries will be formatted with their - keys sorted, otherwise they will display in insertion order. + keys sorted, otherwise they will display in insertion order. If + *underscore_numbers* is true, integers will be formatted with + ```_``` character for a thousands separator, otherwise underscores are not + displayed (the default). .. versionchanged:: 3.4 Added the *compact* parameter. @@ -63,6 +66,8 @@ The :mod:`pprint` module defines one class: .. versionchanged:: 3.8 Added the *sort_dicts* parameter. + .. versionchanged:: 3.10 + Added the *underscore_numbers* parameter. >>> import pprint >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni'] @@ -91,10 +96,10 @@ The :mod:`pprint` module defines one class: The :mod:`pprint` module also provides several shortcut functions: .. function:: pformat(object, indent=1, width=80, depth=None, *, \ - compact=False, sort_dicts=True) + compact=False, sort_dicts=True, underscore_numbers=False) Return the formatted representation of *object* as a string. *indent*, - *width*, *depth*, *compact* and *sort_dicts* will be passed to the + *width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* will be passed to the :class:`PrettyPrinter` constructor as formatting parameters. .. versionchanged:: 3.4 @@ -103,6 +108,9 @@ The :mod:`pprint` module also provides several shortcut functions: .. versionchanged:: 3.8 Added the *sort_dicts* parameter. + .. versionchanged:: 3.10 + Added the *underscore_numbers* parameter. + .. function:: pp(object, *args, sort_dicts=False, **kwargs) @@ -116,13 +124,13 @@ The :mod:`pprint` module also provides several shortcut functions: .. function:: pprint(object, stream=None, indent=1, width=80, depth=None, *, \ - compact=False, sort_dicts=True) + compact=False, sort_dicts=True, underscore_numbers=False) Prints the formatted representation of *object* on *stream*, followed by a newline. If *stream* is ``None``, ``sys.stdout`` is used. This may be used in the interactive interpreter instead of the :func:`print` function for inspecting values (you can even reassign ``print = pprint.pprint`` for use - within a scope). *indent*, *width*, *depth*, *compact* and *sort_dicts* will + within a scope). *indent*, *width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* will be passed to the :class:`PrettyPrinter` constructor as formatting parameters. .. versionchanged:: 3.4 @@ -131,6 +139,9 @@ The :mod:`pprint` module also provides several shortcut functions: .. versionchanged:: 3.8 Added the *sort_dicts* parameter. + .. versionchanged:: 3.10 + Added the *underscore_numbers* parameter. + >>> import pprint >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni'] >>> stuff.insert(0, stuff) diff --git a/Lib/pprint.py b/Lib/pprint.py index a8af50e5a6861..b45cfdd99a8e1 100644 --- a/Lib/pprint.py +++ b/Lib/pprint.py @@ -45,18 +45,19 @@ def pprint(object, stream=None, indent=1, width=80, depth=None, *, - compact=False, sort_dicts=True): + compact=False, sort_dicts=True, underscore_numbers=False): """Pretty-print a Python object to a stream [default is sys.stdout].""" printer = PrettyPrinter( stream=stream, indent=indent, width=width, depth=depth, - compact=compact, sort_dicts=sort_dicts) + compact=compact, sort_dicts=sort_dicts, underscore_numbers=False) printer.pprint(object) def pformat(object, indent=1, width=80, depth=None, *, - compact=False, sort_dicts=True): + compact=False, sort_dicts=True, underscore_numbers=False): """Format a Python object into a pretty-printed representation.""" return PrettyPrinter(indent=indent, width=width, depth=depth, - compact=compact, sort_dicts=sort_dicts).pformat(object) + compact=compact, sort_dicts=sort_dicts, + underscore_numbers=underscore_numbers).pformat(object) def pp(object, *args, sort_dicts=False, **kwargs): """Pretty-print a Python object""" @@ -102,7 +103,7 @@ def _safe_tuple(t): class PrettyPrinter: def __init__(self, indent=1, width=80, depth=None, stream=None, *, - compact=False, sort_dicts=True): + compact=False, sort_dicts=True, underscore_numbers=False): """Handle pretty printing operations onto a stream using a set of configured parameters. @@ -143,6 +144,7 @@ def __init__(self, indent=1, width=80, depth=None, stream=None, *, self._stream = _sys.stdout self._compact = bool(compact) self._sort_dicts = sort_dicts + self._underscore_numbers = underscore_numbers def pprint(self, object): self._format(object, self._stream, 0, 0, {}, 0) @@ -525,6 +527,13 @@ def _safe_repr(self, object, context, maxlevels, level): return repr(object), True, False r = getattr(typ, "__repr__", None) + + if issubclass(typ, int) and r is int.__repr__: + if self._underscore_numbers: + return f"{object:_d}", True, False + else: + return repr(object), True, False + if issubclass(typ, dict) and r is dict.__repr__: if not object: return "{}", True, False @@ -592,7 +601,7 @@ def _safe_repr(self, object, context, maxlevels, level): rep = repr(object) return rep, (rep and not rep.startswith('<')), False -_builtin_scalars = frozenset({str, bytes, bytearray, int, float, complex, +_builtin_scalars = frozenset({str, bytes, bytearray, float, complex, bool, type(None)}) def _recursion(object): diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index c4a8578a9fc8f..e5d2ac52d1283 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -206,6 +206,7 @@ def test_same_as_repr(self): self.assertEqual(pprint.pformat(simple), native) self.assertEqual(pprint.pformat(simple, width=1, indent=0) .replace('\n', ' '), native) + self.assertEqual(pprint.pformat(simple, underscore_numbers=True), native) self.assertEqual(pprint.saferepr(simple), native) def test_container_repr_override_called(self): @@ -323,6 +324,18 @@ def test_width(self): '1 ' '2']]]]]""") + def test_integer(self): + self.assertEqual(pprint.pformat(1234567), '1234567') + self.assertEqual(pprint.pformat(1234567, underscore_numbers=True), '1_234_567') + + class Temperature(int): + def __new__(cls, celsius_degrees): + return super().__new__(Temperature, celsius_degrees) + def __repr__(self): + kelvin_degrees = self + 273.15 + return f"{kelvin_degrees}?K" + self.assertEqual(pprint.pformat(Temperature(1000)), '1273.15?K') + def test_sorted_dict(self): # Starting in Python 2.5, pprint sorts dict displays by key regardless # of how small the dictionary may be. diff --git a/Misc/NEWS.d/next/Library/2021-03-14-21-47-28.bpo-42914.9U1o33.rst b/Misc/NEWS.d/next/Library/2021-03-14-21-47-28.bpo-42914.9U1o33.rst new file mode 100644 index 0000000000000..ae6ef2f0bfa42 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-14-21-47-28.bpo-42914.9U1o33.rst @@ -0,0 +1,3 @@ +:func:`pprint.pprint` gains a new boolean ``underscore_numbers`` optional +argument to emit integers with thousands separated by an underscore character +for improved readability (for example ``1_000_000`` instead of ``1000000``). From webhook-mailer at python.org Wed Mar 24 11:27:05 2021 From: webhook-mailer at python.org (brettcannon) Date: Wed, 24 Mar 2021 15:27:05 -0000 Subject: [Python-checkins] bpo-42137: have ModuleType.__repr__ prefer __spec__ over module_repr() (GH-24953) Message-ID: https://github.com/python/cpython/commit/9cb31d671646a5ff0901f79d2d61022621447190 commit: 9cb31d671646a5ff0901f79d2d61022621447190 branch: master author: Brett Cannon committer: brettcannon date: 2021-03-24T08:26:56-07:00 summary: bpo-42137: have ModuleType.__repr__ prefer __spec__ over module_repr() (GH-24953) This is to work towards the removal of the use of module_repr() in Python 3.12 (documented as deprecated since 3.4). files: A Misc/NEWS.d/next/Core and Builtins/2021-03-20-19-54-47.bpo-42137.A8aQvj.rst M Doc/library/importlib.rst M Doc/whatsnew/3.10.rst M Lib/importlib/_bootstrap.py M Lib/test/test_importlib/frozen/test_loader.py M Lib/test/test_importlib/test_namespace_pkgs.py M Python/importlib.h diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index fee5df84dffcb..d9b790e4e777d 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -208,7 +208,7 @@ Functions .. versionadded:: 3.4 .. versionchanged:: 3.7 :exc:`ModuleNotFoundError` is raised when the module being reloaded lacks - a :class:`ModuleSpec`. + a :class:`~importlib.machinery.ModuleSpec`. :mod:`importlib.abc` -- Abstract base classes related to import @@ -1591,9 +1591,9 @@ an :term:`importer`. .. function:: spec_from_loader(name, loader, *, origin=None, is_package=None) - A factory function for creating a :class:`ModuleSpec` instance based - on a loader. The parameters have the same meaning as they do for - ModuleSpec. The function uses available :term:`loader` APIs, such as + A factory function for creating a :class:`~importlib.machinery.ModuleSpec` + instance based on a loader. The parameters have the same meaning as they do + for ModuleSpec. The function uses available :term:`loader` APIs, such as :meth:`InspectLoader.is_package`, to fill in any missing information on the spec. @@ -1601,9 +1601,9 @@ an :term:`importer`. .. function:: spec_from_file_location(name, location, *, loader=None, submodule_search_locations=None) - A factory function for creating a :class:`ModuleSpec` instance based - on the path to a file. Missing information will be filled in on the - spec by making use of loader APIs and by the implication that the + A factory function for creating a :class:`~importlib.machinery.ModuleSpec` + instance based on the path to a file. Missing information will be filled in + on the spec by making use of loader APIs and by the implication that the module will be file-based. .. versionadded:: 3.4 diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index d4335eb11e345..b6791800fb6c8 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1004,6 +1004,12 @@ Deprecated :meth:`~importlib.abc.Loader.exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.) +* The import system now uses the ``__spec__`` attribute on modules before + falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's + ``__repr__()`` method. Removal of the use of ``module_repr()`` is scheduled + for Python 3.12. + (Contributed by Brett Cannon in :issue:`42137`.) + * ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python 3.3, when it was made an alias to :class:`str`. It is now deprecated, scheduled for removal in Python 3.12. diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index e4f893c38c1aa..5038b46a018bb 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -275,7 +275,7 @@ def _requires_frozen_wrapper(self, fullname): def _load_module_shim(self, fullname): """Load the specified module into sys.modules and return it. - This method is deprecated. Use loader.exec_module instead. + This method is deprecated. Use loader.exec_module() instead. """ msg = ("the load_module() method is deprecated and slated for removal in " @@ -292,24 +292,16 @@ def _load_module_shim(self, fullname): # Module specifications ####################################################### def _module_repr(module): - # The implementation of ModuleType.__repr__(). + """The implementation of ModuleType.__repr__().""" loader = getattr(module, '__loader__', None) - if hasattr(loader, 'module_repr'): - # As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader - # drop their implementations for module_repr. we can add a - # deprecation warning here. + if spec := getattr(module, "__spec__", None): + return _module_repr_from_spec(spec) + elif hasattr(loader, 'module_repr'): try: return loader.module_repr(module) except Exception: pass - try: - spec = module.__spec__ - except AttributeError: - pass - else: - if spec is not None: - return _module_repr_from_spec(spec) - + # Fall through to a catch-all which always succeeds. # We could use module.__class__.__name__ instead of 'module' in the # various repr permutations. try: diff --git a/Lib/test/test_importlib/frozen/test_loader.py b/Lib/test/test_importlib/frozen/test_loader.py index 8eaffa798a5b7..632246ade0826 100644 --- a/Lib/test/test_importlib/frozen/test_loader.py +++ b/Lib/test/test_importlib/frozen/test_loader.py @@ -160,14 +160,6 @@ def test_module_repr(self): self.assertEqual(repr_str, "") - def test_module_repr_indirect(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - with util.uncache('__hello__'), captured_stdout(): - module = self.machinery.FrozenImporter.load_module('__hello__') - self.assertEqual(repr(module), - "") - # No way to trigger an error in a frozen module. test_state_after_failure = None diff --git a/Lib/test/test_importlib/test_namespace_pkgs.py b/Lib/test/test_importlib/test_namespace_pkgs.py index a8f95a035e245..ab5847c555312 100644 --- a/Lib/test/test_importlib/test_namespace_pkgs.py +++ b/Lib/test/test_importlib/test_namespace_pkgs.py @@ -82,7 +82,8 @@ def test_cant_import_other(self): def test_module_repr(self): import foo.one - self.assertEqual(repr(foo), "") + self.assertEqual(foo.__spec__.loader.module_repr(foo), + "") class DynamicPathNamespacePackage(NamespacePackageTest): diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-20-19-54-47.bpo-42137.A8aQvj.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-20-19-54-47.bpo-42137.A8aQvj.rst new file mode 100644 index 0000000000000..e13ce49b954b1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-20-19-54-47.bpo-42137.A8aQvj.rst @@ -0,0 +1,2 @@ +The import system now prefers using ``__spec__`` for ``ModuleType.__repr__`` +over ``module_repr()``. diff --git a/Python/importlib.h b/Python/importlib.h index 90cfa4cc2daed..633c642a1401f 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -492,67 +492,68 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 124,1,116,4,106,5,118,0,114,66,116,4,106,5,124,1, 25,0,125,4,116,6,124,3,124,4,131,2,1,0,116,4, 106,5,124,1,25,0,83,0,116,7,124,3,131,1,83,0, - 41,3,122,128,76,111,97,100,32,116,104,101,32,115,112,101, + 41,3,122,130,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,122,103,116,104,101,32,108,111,97,100,95,109, - 111,100,117,108,101,40,41,32,109,101,116,104,111,100,32,105, - 115,32,100,101,112,114,101,99,97,116,101,100,32,97,110,100, - 32,115,108,97,116,101,100,32,102,111,114,32,114,101,109,111, - 118,97,108,32,105,110,32,80,121,116,104,111,110,32,51,46, - 49,50,59,32,117,115,101,32,101,120,101,99,95,109,111,100, - 117,108,101,40,41,32,105,110,115,116,101,97,100,78,41,8, - 218,9,95,119,97,114,110,105,110,103,115,218,4,119,97,114, - 110,218,18,68,101,112,114,101,99,97,116,105,111,110,87,97, - 114,110,105,110,103,218,16,115,112,101,99,95,102,114,111,109, - 95,108,111,97,100,101,114,114,18,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,5,114,33,0,0,0,114,89,0,0,0,218, - 3,109,115,103,218,4,115,112,101,99,218,6,109,111,100,117, - 108,101,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,218,17,95,108,111,97,100,95,109,111,100,117,108,101,95, - 115,104,105,109,19,1,0,0,115,18,0,0,0,4,6,12, - 2,10,1,10,1,10,1,10,1,10,1,8,2,255,128,114, - 111,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, - 0,5,0,0,0,8,0,0,0,67,0,0,0,115,206,0, - 0,0,116,0,124,0,100,1,100,0,131,3,125,1,116,1, - 124,1,100,2,131,2,114,50,122,12,124,1,160,2,124,0, - 161,1,87,0,83,0,4,0,116,3,121,204,1,0,1,0, - 1,0,89,0,122,10,124,0,106,4,125,2,87,0,110,16, - 4,0,116,5,121,202,1,0,1,0,1,0,89,0,110,16, - 124,2,100,0,117,1,114,94,116,6,124,2,131,1,83,0, - 122,10,124,0,106,7,125,3,87,0,110,18,4,0,116,5, - 121,200,1,0,1,0,1,0,100,3,125,3,89,0,122,10, - 124,0,106,8,125,4,87,0,110,50,4,0,116,5,121,198, - 1,0,1,0,1,0,124,1,100,0,117,0,114,170,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,100,6,160,9, - 124,3,124,4,161,2,83,0,119,0,119,0,119,0,119,0, - 41,7,78,218,10,95,95,108,111,97,100,101,114,95,95,218, - 11,109,111,100,117,108,101,95,114,101,112,114,250,1,63,250, - 13,60,109,111,100,117,108,101,32,123,33,114,125,62,250,20, - 60,109,111,100,117,108,101,32,123,33,114,125,32,40,123,33, - 114,125,41,62,250,23,60,109,111,100,117,108,101,32,123,33, - 114,125,32,102,114,111,109,32,123,33,114,125,62,41,10,114, - 13,0,0,0,114,11,0,0,0,114,113,0,0,0,218,9, - 69,120,99,101,112,116,105,111,110,218,8,95,95,115,112,101, - 99,95,95,114,2,0,0,0,218,22,95,109,111,100,117,108, + 111,100,117,108,101,40,41,32,105,110,115,116,101,97,100,46, + 10,10,32,32,32,32,122,103,116,104,101,32,108,111,97,100, + 95,109,111,100,117,108,101,40,41,32,109,101,116,104,111,100, + 32,105,115,32,100,101,112,114,101,99,97,116,101,100,32,97, + 110,100,32,115,108,97,116,101,100,32,102,111,114,32,114,101, + 109,111,118,97,108,32,105,110,32,80,121,116,104,111,110,32, + 51,46,49,50,59,32,117,115,101,32,101,120,101,99,95,109, + 111,100,117,108,101,40,41,32,105,110,115,116,101,97,100,78, + 41,8,218,9,95,119,97,114,110,105,110,103,115,218,4,119, + 97,114,110,218,18,68,101,112,114,101,99,97,116,105,111,110, + 87,97,114,110,105,110,103,218,16,115,112,101,99,95,102,114, + 111,109,95,108,111,97,100,101,114,114,18,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,5,114,33,0,0,0,114,89,0,0, + 0,218,3,109,115,103,218,4,115,112,101,99,218,6,109,111, + 100,117,108,101,114,5,0,0,0,114,5,0,0,0,114,6, + 0,0,0,218,17,95,108,111,97,100,95,109,111,100,117,108, + 101,95,115,104,105,109,19,1,0,0,115,18,0,0,0,4, + 6,12,2,10,1,10,1,10,1,10,1,10,1,8,2,255, + 128,114,111,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,5,0,0,0,8,0,0,0,67,0,0,0,115, + 184,0,0,0,116,0,124,0,100,1,100,2,131,3,125,1, + 116,0,124,0,100,3,100,2,131,3,4,0,125,2,114,36, + 116,1,124,2,131,1,83,0,116,2,124,1,100,4,131,2, + 114,74,122,12,124,1,160,3,124,0,161,1,87,0,83,0, + 4,0,116,4,121,182,1,0,1,0,1,0,89,0,122,10, + 124,0,106,5,125,3,87,0,110,18,4,0,116,6,121,180, + 1,0,1,0,1,0,100,5,125,3,89,0,122,10,124,0, + 106,7,125,4,87,0,110,50,4,0,116,6,121,178,1,0, + 1,0,1,0,124,1,100,2,117,0,114,150,100,6,160,8, + 124,3,161,1,6,0,89,0,83,0,100,7,160,8,124,3, + 124,1,161,2,6,0,89,0,83,0,100,8,160,8,124,3, + 124,4,161,2,83,0,119,0,119,0,119,0,41,9,122,44, + 84,104,101,32,105,109,112,108,101,109,101,110,116,97,116,105, + 111,110,32,111,102,32,77,111,100,117,108,101,84,121,112,101, + 46,95,95,114,101,112,114,95,95,40,41,46,218,10,95,95, + 108,111,97,100,101,114,95,95,78,218,8,95,95,115,112,101, + 99,95,95,218,11,109,111,100,117,108,101,95,114,101,112,114, + 250,1,63,250,13,60,109,111,100,117,108,101,32,123,33,114, + 125,62,250,20,60,109,111,100,117,108,101,32,123,33,114,125, + 32,40,123,33,114,125,41,62,250,23,60,109,111,100,117,108, + 101,32,123,33,114,125,32,102,114,111,109,32,123,33,114,125, + 62,41,9,114,13,0,0,0,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,9,0,0,0,218,8,95,95,102,105,108,101,95,95,114, - 50,0,0,0,41,5,114,110,0,0,0,218,6,108,111,97, - 100,101,114,114,109,0,0,0,114,20,0,0,0,218,8,102, - 105,108,101,110,97,109,101,114,5,0,0,0,114,5,0,0, - 0,114,6,0,0,0,218,12,95,109,111,100,117,108,101,95, - 114,101,112,114,38,1,0,0,115,56,0,0,0,12,2,10, - 1,2,4,12,1,12,1,2,1,2,1,10,1,12,1,4, - 1,8,2,8,1,2,4,10,1,12,1,6,1,2,1,10, - 1,12,1,8,1,14,1,16,2,12,2,2,250,2,252,2, - 246,2,252,255,128,114,124,0,0,0,99,0,0,0,0,0, + 114,11,0,0,0,114,114,0,0,0,218,9,69,120,99,101, + 112,116,105,111,110,114,9,0,0,0,114,2,0,0,0,218, + 8,95,95,102,105,108,101,95,95,114,50,0,0,0,41,5, + 114,110,0,0,0,218,6,108,111,97,100,101,114,114,109,0, + 0,0,114,20,0,0,0,218,8,102,105,108,101,110,97,109, + 101,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, + 218,12,95,109,111,100,117,108,101,95,114,101,112,114,38,1, + 0,0,115,46,0,0,0,12,2,16,1,8,1,10,1,2, + 1,12,1,12,1,2,1,2,4,10,1,12,1,6,1,2, + 1,10,1,12,1,8,1,14,1,16,2,12,2,2,250,2, + 252,2,249,255,128,114,124,0,0,0,99,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, 0,0,0,115,114,0,0,0,101,0,90,1,100,0,90,2, 100,1,90,3,100,2,100,2,100,2,100,3,156,3,100,4, @@ -671,7 +672,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 99,104,101,100,41,6,114,33,0,0,0,114,20,0,0,0, 114,122,0,0,0,114,126,0,0,0,114,127,0,0,0,114, 128,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,34,0,0,0,111,1,0,0,115,16,0,0, + 0,0,0,114,34,0,0,0,103,1,0,0,115,16,0,0, 0,6,2,6,1,6,1,6,1,14,1,6,3,10,1,255, 128,122,19,77,111,100,117,108,101,83,112,101,99,46,95,95, 105,110,105,116,95,95,99,1,0,0,0,0,0,0,0,0, @@ -693,7 +694,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 218,9,95,95,99,108,97,115,115,95,95,114,9,0,0,0, 218,4,106,111,105,110,41,2,114,33,0,0,0,114,62,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,53,0,0,0,123,1,0,0,115,22,0,0,0,10, + 0,114,53,0,0,0,115,1,0,0,115,22,0,0,0,10, 1,10,1,4,255,10,2,18,1,10,1,6,1,8,1,4, 255,22,2,255,128,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, @@ -711,7 +712,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 2,0,0,0,218,14,78,111,116,73,109,112,108,101,109,101, 110,116,101,100,41,3,114,33,0,0,0,90,5,111,116,104, 101,114,90,4,115,109,115,108,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,218,6,95,95,101,113,95,95,133, + 0,0,114,6,0,0,0,218,6,95,95,101,113,95,95,125, 1,0,0,115,34,0,0,0,6,1,2,1,12,1,10,1, 2,255,10,2,2,254,8,3,2,253,10,4,2,252,10,5, 4,251,12,6,8,1,2,255,255,128,122,17,77,111,100,117, @@ -727,7 +728,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,114,52,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,6,0,0,0,114,135,0,0,0,145,1,0,0,115, + 0,114,6,0,0,0,114,135,0,0,0,137,1,0,0,115, 14,0,0,0,10,2,16,1,8,1,4,1,14,1,6,1, 255,128,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,0,0, @@ -735,7 +736,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,124,1,124,0,95,0,100,0,83,0,114,0,0, 0,0,41,1,114,131,0,0,0,41,2,114,33,0,0,0, 114,135,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 6,0,0,0,114,135,0,0,0,154,1,0,0,115,4,0, + 6,0,0,0,114,135,0,0,0,146,1,0,0,115,4,0, 0,0,10,2,255,128,99,1,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, 32,0,0,0,124,0,106,0,100,1,117,0,114,26,124,0, @@ -746,14 +747,14 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,41,3,114,129,0,0,0,114,20,0,0,0,218,10,114, 112,97,114,116,105,116,105,111,110,114,52,0,0,0,114,5, 0,0,0,114,5,0,0,0,114,6,0,0,0,218,6,112, - 97,114,101,110,116,158,1,0,0,115,8,0,0,0,10,3, + 97,114,101,110,116,150,1,0,0,115,8,0,0,0,10,3, 16,1,6,2,255,128,122,17,77,111,100,117,108,101,83,112, 101,99,46,112,97,114,101,110,116,99,1,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,1,0,0,0,67,0, 0,0,115,6,0,0,0,124,0,106,0,83,0,114,0,0, 0,0,41,1,114,130,0,0,0,114,52,0,0,0,114,5, 0,0,0,114,5,0,0,0,114,6,0,0,0,114,136,0, - 0,0,166,1,0,0,115,4,0,0,0,6,2,255,128,122, + 0,0,158,1,0,0,115,4,0,0,0,6,2,255,128,122, 23,77,111,100,117,108,101,83,112,101,99,46,104,97,115,95, 108,111,99,97,116,105,111,110,99,2,0,0,0,0,0,0, 0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0, @@ -761,14 +762,14 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 100,0,83,0,114,0,0,0,0,41,2,218,4,98,111,111, 108,114,130,0,0,0,41,2,114,33,0,0,0,218,5,118, 97,108,117,101,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,136,0,0,0,170,1,0,0,115,4,0,0, + 0,0,0,114,136,0,0,0,162,1,0,0,115,4,0,0, 0,14,2,255,128,41,12,114,9,0,0,0,114,8,0,0, 0,114,1,0,0,0,114,10,0,0,0,114,34,0,0,0, 114,53,0,0,0,114,138,0,0,0,218,8,112,114,111,112, 101,114,116,121,114,135,0,0,0,218,6,115,101,116,116,101, 114,114,143,0,0,0,114,136,0,0,0,114,5,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,114, - 125,0,0,0,74,1,0,0,115,36,0,0,0,8,0,4, + 125,0,0,0,66,1,0,0,115,36,0,0,0,8,0,4, 1,4,36,2,1,12,255,8,12,8,10,2,12,10,1,4, 8,10,1,2,3,10,1,2,7,10,1,4,3,14,1,255, 128,114,125,0,0,0,169,2,114,126,0,0,0,114,128,0, @@ -796,7 +797,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 114,125,0,0,0,41,6,114,20,0,0,0,114,122,0,0, 0,114,126,0,0,0,114,128,0,0,0,114,149,0,0,0, 90,6,115,101,97,114,99,104,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,114,104,0,0,0,175,1,0,0, + 0,0,114,6,0,0,0,114,104,0,0,0,167,1,0,0, 115,40,0,0,0,10,2,8,1,4,1,6,1,8,2,12, 1,12,1,6,1,2,1,6,255,8,3,10,1,2,1,14, 1,12,1,8,1,4,3,16,2,2,250,255,128,114,104,0, @@ -821,7 +822,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 117,0,144,1,114,10,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, 119,0,119,0,119,0,119,0,119,0,119,0,41,4,78,169, - 1,114,126,0,0,0,70,84,41,13,114,119,0,0,0,114, + 1,114,126,0,0,0,70,84,41,13,114,113,0,0,0,114, 2,0,0,0,114,9,0,0,0,114,112,0,0,0,114,121, 0,0,0,218,7,95,79,82,73,71,73,78,218,10,95,95, 99,97,99,104,101,100,95,95,218,4,108,105,115,116,218,8, @@ -831,7 +832,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,20,0,0,0,90,8,108,111,99,97,116,105,111, 110,114,135,0,0,0,114,129,0,0,0,114,5,0,0,0, 114,5,0,0,0,114,6,0,0,0,218,17,95,115,112,101, - 99,95,102,114,111,109,95,109,111,100,117,108,101,201,1,0, + 99,95,102,114,111,109,95,109,111,100,117,108,101,193,1,0, 0,115,86,0,0,0,2,2,10,1,14,1,4,1,8,2, 4,1,6,2,8,1,2,1,10,1,14,1,2,2,2,1, 10,1,14,1,6,1,8,1,8,1,2,1,10,1,14,1, @@ -878,13 +879,13 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,121,0,0,0,114,112,0,0,0,114,143,0, - 0,0,114,158,0,0,0,114,119,0,0,0,114,154,0,0, + 0,0,114,158,0,0,0,114,113,0,0,0,114,154,0,0, 0,114,136,0,0,0,114,126,0,0,0,114,135,0,0,0, 114,152,0,0,0,41,5,114,109,0,0,0,114,110,0,0, 0,114,157,0,0,0,114,122,0,0,0,114,159,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218, 18,95,105,110,105,116,95,109,111,100,117,108,101,95,97,116, - 116,114,115,246,1,0,0,115,114,0,0,0,20,4,2,1, + 116,114,115,238,1,0,0,115,114,0,0,0,20,4,2,1, 12,1,14,1,2,1,20,2,6,1,8,1,10,2,8,1, 4,1,6,1,10,2,8,1,6,1,6,11,2,1,10,1, 14,1,2,1,20,2,2,1,12,1,14,1,2,1,2,2, @@ -913,7 +914,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,114,161,0,0,0,169,2,114,109,0,0,0,114, 110,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, 0,0,0,218,16,109,111,100,117,108,101,95,102,114,111,109, - 95,115,112,101,99,62,2,0,0,115,20,0,0,0,4,3, + 95,115,112,101,99,54,2,0,0,115,20,0,0,0,4,3, 12,1,14,3,12,1,8,1,8,2,10,1,10,1,4,1, 255,128,114,165,0,0,0,99,1,0,0,0,0,0,0,0, 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, @@ -926,15 +927,15 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,124,0,106,1,161,2,83,0,41,7,122,38,82,101,116, 117,114,110,32,116,104,101,32,114,101,112,114,32,116,111,32, 117,115,101,32,102,111,114,32,116,104,101,32,109,111,100,117, - 108,101,46,78,114,114,0,0,0,114,115,0,0,0,114,116, - 0,0,0,114,117,0,0,0,250,18,60,109,111,100,117,108, + 108,101,46,78,114,115,0,0,0,114,116,0,0,0,114,117, + 0,0,0,114,118,0,0,0,250,18,60,109,111,100,117,108, 101,32,123,33,114,125,32,40,123,125,41,62,41,5,114,20, 0,0,0,114,126,0,0,0,114,122,0,0,0,114,50,0, 0,0,114,136,0,0,0,41,2,114,109,0,0,0,114,20, 0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,0, - 0,0,114,120,0,0,0,79,2,0,0,115,18,0,0,0, + 0,0,114,119,0,0,0,71,2,0,0,115,18,0,0,0, 20,3,10,1,10,1,10,1,14,2,6,2,14,1,16,2, - 255,128,114,120,0,0,0,99,2,0,0,0,0,0,0,0, + 255,128,114,119,0,0,0,99,2,0,0,0,0,0,0,0, 0,0,0,0,4,0,0,0,10,0,0,0,67,0,0,0, 115,26,1,0,0,124,0,106,0,125,2,116,1,124,2,131, 1,143,246,1,0,116,2,106,3,160,4,124,2,161,1,124, @@ -975,7 +976,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 95,109,111,100,117,108,101,114,163,0,0,0,218,3,112,111, 112,41,4,114,109,0,0,0,114,110,0,0,0,114,20,0, 0,0,114,108,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,6,0,0,0,114,106,0,0,0,96,2,0,0,115, + 0,114,6,0,0,0,114,106,0,0,0,88,2,0,0,115, 50,0,0,0,6,2,10,1,16,1,10,1,12,1,2,1, 10,1,10,1,14,1,16,2,14,2,12,1,16,1,12,2, 14,1,12,2,2,128,14,4,14,1,14,255,26,1,4,1, @@ -1000,15 +1001,15 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 8,144,1,121,12,1,0,1,0,1,0,89,0,124,1,83, 0,124,1,83,0,119,0,119,0,119,0,41,7,78,114,112, 0,0,0,114,158,0,0,0,114,154,0,0,0,114,141,0, - 0,0,114,25,0,0,0,114,119,0,0,0,41,14,114,122, + 0,0,114,25,0,0,0,114,113,0,0,0,41,14,114,122, 0,0,0,114,170,0,0,0,114,20,0,0,0,114,18,0, 0,0,114,105,0,0,0,114,171,0,0,0,114,13,0,0, 0,114,112,0,0,0,114,2,0,0,0,114,9,0,0,0, 114,158,0,0,0,114,11,0,0,0,114,142,0,0,0,114, - 119,0,0,0,114,164,0,0,0,114,5,0,0,0,114,5, + 113,0,0,0,114,164,0,0,0,114,5,0,0,0,114,5, 0,0,0,114,6,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,126,2,0,0,115,66,0,0,0,2,3,18,1, + 98,108,101,118,2,0,0,115,66,0,0,0,2,3,18,1, 6,1,12,1,14,1,12,1,2,1,14,3,12,1,16,1, 2,1,12,1,14,1,2,1,16,1,2,1,8,4,10,1, 18,1,4,128,14,1,2,1,18,1,2,1,8,1,4,3, @@ -1042,7 +1043,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,114,83,0,0,0,41,3,114,109,0,0,0,114,108,0, 0,0,114,110,0,0,0,114,5,0,0,0,114,5,0,0, 0,114,6,0,0,0,218,14,95,108,111,97,100,95,117,110, - 108,111,99,107,101,100,162,2,0,0,115,62,0,0,0,10, + 108,111,99,107,101,100,154,2,0,0,115,62,0,0,0,10, 2,12,2,16,1,12,2,8,1,8,2,6,5,2,1,12, 1,2,1,10,1,10,1,14,1,2,255,12,4,4,128,6, 1,2,1,12,1,2,3,12,254,2,1,2,1,14,5,12, @@ -1067,7 +1068,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 101,100,46,10,10,32,32,32,32,78,41,3,114,57,0,0, 0,114,20,0,0,0,114,173,0,0,0,169,1,114,109,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,107,0,0,0,207,2,0,0,115,8,0,0,0,12, + 0,114,107,0,0,0,199,2,0,0,115,8,0,0,0,12, 9,22,1,20,128,255,128,114,107,0,0,0,99,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, 0,64,0,0,0,115,140,0,0,0,101,0,90,1,100,0, @@ -1104,7 +1105,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 122,8,60,109,111,100,117,108,101,32,122,2,32,40,122,2, 41,62,78,41,3,114,9,0,0,0,114,175,0,0,0,114, 151,0,0,0,169,1,114,110,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,6,0,0,0,114,113,0,0,0,233, + 114,5,0,0,0,114,6,0,0,0,114,114,0,0,0,225, 2,0,0,115,4,0,0,0,22,7,255,128,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, @@ -1117,7 +1118,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,151,0,0,0,169,4,218,3,99,108,115,114,89, 0,0,0,218,4,112,97,116,104,218,6,116,97,114,103,101, 116,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 218,9,102,105,110,100,95,115,112,101,99,242,2,0,0,115, + 218,9,102,105,110,100,95,115,112,101,99,234,2,0,0,115, 12,0,0,0,8,2,4,1,10,1,16,1,4,2,255,128, 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, @@ -1139,7 +1140,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,122,0,0,0,41,4,114,180,0,0,0,114,89, 0,0,0,114,181,0,0,0,114,109,0,0,0,114,5,0, 0,0,114,5,0,0,0,114,6,0,0,0,218,11,102,105, - 110,100,95,109,111,100,117,108,101,251,2,0,0,115,6,0, + 110,100,95,109,111,100,117,108,101,243,2,0,0,115,6,0, 0,0,12,9,18,1,255,128,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,1,0,0,0,0,0,0,0,0,0, @@ -1154,7 +1155,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,114,74,0,0,0,114,64,0,0,0,90,14,99, 114,101,97,116,101,95,98,117,105,108,116,105,110,114,174,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,162,0,0,0,7,3,0,0,115,12,0,0,0,12, + 0,114,162,0,0,0,255,2,0,0,115,12,0,0,0,12, 3,12,1,4,1,6,255,12,2,255,128,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,1,0,0,0,0, @@ -1165,7 +1166,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 108,101,78,41,3,114,74,0,0,0,114,64,0,0,0,90, 12,101,120,101,99,95,98,117,105,108,116,105,110,114,177,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,163,0,0,0,15,3,0,0,115,4,0,0,0,16, + 0,114,163,0,0,0,7,3,0,0,115,4,0,0,0,16, 3,255,128,122,27,66,117,105,108,116,105,110,73,109,112,111, 114,116,101,114,46,101,120,101,99,95,109,111,100,117,108,101, 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, @@ -1176,7 +1177,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 101,32,99,111,100,101,32,111,98,106,101,99,116,115,46,78, 114,5,0,0,0,169,2,114,180,0,0,0,114,89,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 218,8,103,101,116,95,99,111,100,101,20,3,0,0,243,4, + 218,8,103,101,116,95,99,111,100,101,12,3,0,0,243,4, 0,0,0,4,4,255,128,122,24,66,117,105,108,116,105,110, 73,109,112,111,114,116,101,114,46,103,101,116,95,99,111,100, 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, @@ -1187,7 +1188,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 111,117,114,99,101,32,99,111,100,101,46,78,114,5,0,0, 0,114,186,0,0,0,114,5,0,0,0,114,5,0,0,0, 114,6,0,0,0,218,10,103,101,116,95,115,111,117,114,99, - 101,26,3,0,0,114,188,0,0,0,122,26,66,117,105,108, + 101,18,3,0,0,114,188,0,0,0,122,26,66,117,105,108, 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, 115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,0, 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,114, @@ -1196,18 +1197,18 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,78,114,5, 0,0,0,114,186,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,114,128,0,0,0,32,3,0,0, + 0,0,114,6,0,0,0,114,128,0,0,0,24,3,0,0, 114,188,0,0,0,122,26,66,117,105,108,116,105,110,73,109, 112,111,114,116,101,114,46,105,115,95,112,97,99,107,97,103, 101,41,2,78,78,41,1,78,41,18,114,9,0,0,0,114, 8,0,0,0,114,1,0,0,0,114,10,0,0,0,114,151, 0,0,0,218,12,115,116,97,116,105,99,109,101,116,104,111, - 100,114,113,0,0,0,218,11,99,108,97,115,115,109,101,116, + 100,114,114,0,0,0,218,11,99,108,97,115,115,109,101,116, 104,111,100,114,183,0,0,0,114,184,0,0,0,114,162,0, 0,0,114,163,0,0,0,114,95,0,0,0,114,187,0,0, 0,114,189,0,0,0,114,128,0,0,0,114,111,0,0,0, 114,170,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,114,175,0,0,0,222,2, + 5,0,0,0,114,6,0,0,0,114,175,0,0,0,214,2, 0,0,115,48,0,0,0,8,0,4,2,4,7,2,2,10, 1,2,8,12,1,2,8,12,1,2,11,10,1,2,7,10, 1,2,4,2,1,12,1,2,4,2,1,12,1,2,4,2, @@ -1239,7 +1240,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 83,0,41,3,114,176,0,0,0,114,166,0,0,0,78,41, 4,114,50,0,0,0,114,9,0,0,0,114,192,0,0,0, 114,151,0,0,0,41,1,218,1,109,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,114,113,0,0,0,52,3, + 5,0,0,0,114,6,0,0,0,114,114,0,0,0,44,3, 0,0,115,4,0,0,0,16,7,255,128,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, @@ -1249,7 +1250,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 100,0,83,0,114,178,0,0,0,41,4,114,64,0,0,0, 114,98,0,0,0,114,104,0,0,0,114,151,0,0,0,114, 179,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,183,0,0,0,61,3,0,0,115,8,0,0, + 0,0,0,114,183,0,0,0,53,3,0,0,115,8,0,0, 0,10,2,16,1,4,2,255,128,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,0,0,0,0, @@ -1264,7 +1265,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 32,32,32,32,78,41,2,114,64,0,0,0,114,98,0,0, 0,41,3,114,180,0,0,0,114,89,0,0,0,114,181,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,184,0,0,0,68,3,0,0,115,4,0,0,0,18, + 0,114,184,0,0,0,60,3,0,0,115,4,0,0,0,18, 7,255,128,122,26,70,114,111,122,101,110,73,109,112,111,114, 116,101,114,46,102,105,110,100,95,109,111,100,117,108,101,99, 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, @@ -1273,7 +1274,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 97,110,116,105,99,115,32,102,111,114,32,109,111,100,117,108, 101,32,99,114,101,97,116,105,111,110,46,78,114,5,0,0, 0,114,174,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,114,162,0,0,0,77,3,0,0,115,4, + 114,6,0,0,0,114,162,0,0,0,69,3,0,0,115,4, 0,0,0,4,0,255,128,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,0,0, @@ -1282,14 +1283,14 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,114,97,0,0,0,41,10,114,119,0,0,0,114, + 0,83,0,114,97,0,0,0,41,10,114,113,0,0,0,114, 20,0,0,0,114,64,0,0,0,114,98,0,0,0,114,87, 0,0,0,114,50,0,0,0,114,74,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,14,0,0,0,41,3,114,110,0, 0,0,114,20,0,0,0,218,4,99,111,100,101,114,5,0, 0,0,114,5,0,0,0,114,6,0,0,0,114,163,0,0, - 0,81,3,0,0,115,16,0,0,0,8,2,10,1,10,1, + 0,73,3,0,0,115,16,0,0,0,8,2,10,1,10,1, 2,1,6,255,12,2,16,1,255,128,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,0, @@ -1303,7 +1304,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 110,115,116,101,97,100,46,10,10,32,32,32,32,32,32,32, 32,78,41,1,114,111,0,0,0,114,186,0,0,0,114,5, 0,0,0,114,5,0,0,0,114,6,0,0,0,114,170,0, - 0,0,90,3,0,0,115,4,0,0,0,10,8,255,128,122, + 0,0,82,3,0,0,115,4,0,0,0,10,8,255,128,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,0,0,0,0,2,0,0,0,3,0,0,0, @@ -1313,7 +1314,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 114,32,116,104,101,32,102,114,111,122,101,110,32,109,111,100, 117,108,101,46,78,41,2,114,64,0,0,0,114,194,0,0, 0,114,186,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,114,187,0,0,0,100,3,0,0,243,4, + 114,6,0,0,0,114,187,0,0,0,92,3,0,0,243,4, 0,0,0,10,4,255,128,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,0,0,0,0,2,0,0, @@ -1323,7 +1324,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,5,0,0,0,114,186, 0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,0, - 0,0,114,189,0,0,0,106,3,0,0,114,188,0,0,0, + 0,0,114,189,0,0,0,98,3,0,0,114,188,0,0,0, 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,0,0,0,0,2,0,0,0,3,0,0,0, @@ -1333,17 +1334,17 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 32,97,32,112,97,99,107,97,103,101,46,78,41,2,114,64, 0,0,0,90,17,105,115,95,102,114,111,122,101,110,95,112, 97,99,107,97,103,101,114,186,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,6,0,0,0,114,128,0,0,0,112, + 114,5,0,0,0,114,6,0,0,0,114,128,0,0,0,104, 3,0,0,114,198,0,0,0,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,17,114,9,0,0, 0,114,8,0,0,0,114,1,0,0,0,114,10,0,0,0, - 114,151,0,0,0,114,190,0,0,0,114,113,0,0,0,114, + 114,151,0,0,0,114,190,0,0,0,114,114,0,0,0,114, 191,0,0,0,114,183,0,0,0,114,184,0,0,0,114,162, 0,0,0,114,163,0,0,0,114,170,0,0,0,114,100,0, 0,0,114,187,0,0,0,114,189,0,0,0,114,128,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,114,192,0,0,0,41,3,0,0,115,50, + 114,6,0,0,0,114,192,0,0,0,33,3,0,0,115,50, 0,0,0,8,0,4,2,4,7,2,2,10,1,2,8,12, 1,2,6,12,1,2,8,10,1,2,3,10,1,2,8,10, 1,2,9,2,1,12,1,2,4,2,1,12,1,2,4,2, @@ -1362,7 +1363,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 112,111,114,116,32,108,111,99,107,46,78,41,2,114,64,0, 0,0,114,65,0,0,0,114,52,0,0,0,114,5,0,0, 0,114,5,0,0,0,114,6,0,0,0,114,61,0,0,0, - 125,3,0,0,243,4,0,0,0,12,2,255,128,122,28,95, + 117,3,0,0,243,4,0,0,0,12,2,255,128,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,0,0,0,0,4,0,0,0,2,0,0,0, @@ -1375,13 +1376,13 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 120,99,95,116,121,112,101,218,9,101,120,99,95,118,97,108, 117,101,218,13,101,120,99,95,116,114,97,99,101,98,97,99, 107,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 114,63,0,0,0,129,3,0,0,114,201,0,0,0,122,27, + 114,63,0,0,0,121,3,0,0,114,201,0,0,0,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,9, 0,0,0,114,8,0,0,0,114,1,0,0,0,114,10,0, 0,0,114,61,0,0,0,114,63,0,0,0,114,5,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 114,199,0,0,0,121,3,0,0,115,10,0,0,0,8,0, + 114,199,0,0,0,113,3,0,0,115,10,0,0,0,8,0, 4,2,8,2,12,4,255,128,114,199,0,0,0,99,3,0, 0,0,0,0,0,0,0,0,0,0,5,0,0,0,5,0, 0,0,67,0,0,0,115,64,0,0,0,124,1,160,0,100, @@ -1402,7 +1403,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,5,0,0,0,114,5,0, 0,0,114,6,0,0,0,218,13,95,114,101,115,111,108,118, - 101,95,110,97,109,101,134,3,0,0,115,12,0,0,0,16, + 101,95,110,97,109,101,126,3,0,0,115,12,0,0,0,16, 2,12,1,8,1,8,1,20,1,255,128,114,210,0,0,0, 99,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0, 0,4,0,0,0,67,0,0,0,115,34,0,0,0,124,0, @@ -1412,7 +1413,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,41,4,218,6,102,105,110,100,101,114,114,20,0,0,0, 114,181,0,0,0,114,122,0,0,0,114,5,0,0,0,114, 5,0,0,0,114,6,0,0,0,218,17,95,102,105,110,100, - 95,115,112,101,99,95,108,101,103,97,99,121,143,3,0,0, + 95,115,112,101,99,95,108,101,103,97,99,121,135,3,0,0, 115,10,0,0,0,12,3,8,1,4,1,10,1,255,128,114, 212,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, 0,10,0,0,0,10,0,0,0,67,0,0,0,115,36,1, @@ -1444,13 +1445,13 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 12,114,18,0,0,0,218,9,109,101,116,97,95,112,97,116, 104,114,87,0,0,0,114,101,0,0,0,114,102,0,0,0, 114,169,0,0,0,114,105,0,0,0,114,199,0,0,0,114, - 183,0,0,0,114,2,0,0,0,114,212,0,0,0,114,119, + 183,0,0,0,114,2,0,0,0,114,212,0,0,0,114,113, 0,0,0,41,10,114,20,0,0,0,114,181,0,0,0,114, 182,0,0,0,114,213,0,0,0,90,9,105,115,95,114,101, 108,111,97,100,114,211,0,0,0,114,183,0,0,0,114,109, - 0,0,0,114,110,0,0,0,114,119,0,0,0,114,5,0, + 0,0,0,114,110,0,0,0,114,113,0,0,0,114,5,0, 0,0,114,5,0,0,0,114,6,0,0,0,218,10,95,102, - 105,110,100,95,115,112,101,99,152,3,0,0,115,66,0,0, + 105,110,100,95,115,112,101,99,144,3,0,0,115,66,0,0, 0,6,2,8,1,8,2,4,3,12,1,10,5,8,1,8, 1,2,1,10,1,14,1,12,1,8,1,16,1,4,255,12, 3,30,128,10,1,18,2,10,1,2,1,10,1,14,1,12, @@ -1483,7 +1484,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 87,0,0,0,169,3,114,20,0,0,0,114,208,0,0,0, 114,209,0,0,0,114,5,0,0,0,114,5,0,0,0,114, 6,0,0,0,218,13,95,115,97,110,105,116,121,95,99,104, - 101,99,107,199,3,0,0,115,26,0,0,0,10,2,18,1, + 101,99,107,191,3,0,0,115,26,0,0,0,10,2,18,1, 8,1,8,1,8,1,10,1,8,1,4,1,8,1,12,2, 8,1,8,255,255,128,114,220,0,0,0,122,16,78,111,32, 109,111,100,117,108,101,32,110,97,109,101,100,32,122,4,123, @@ -1525,7 +1526,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,90,5,99,104,105,108,100,114,5,0,0,0,114,5, 0,0,0,114,6,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,218,3,0,0,115,60,0,0,0,4,1,14,1,4,1, + 100,210,3,0,0,115,60,0,0,0,4,1,14,1,4,1, 10,1,10,1,10,2,10,1,10,1,2,1,10,1,14,1, 16,1,14,1,10,1,8,1,18,1,8,2,6,1,10,2, 14,1,2,1,14,1,4,4,14,253,16,1,14,1,8,1, @@ -1551,7 +1552,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 41,4,114,20,0,0,0,114,224,0,0,0,114,110,0,0, 0,114,82,0,0,0,114,5,0,0,0,114,5,0,0,0, 114,6,0,0,0,218,14,95,102,105,110,100,95,97,110,100, - 95,108,111,97,100,253,3,0,0,115,28,0,0,0,10,2, + 95,108,111,97,100,245,3,0,0,115,28,0,0,0,10,2, 14,1,8,1,24,1,14,255,16,128,8,3,2,1,6,1, 2,255,12,2,8,2,4,1,255,128,114,227,0,0,0,114, 25,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, @@ -1582,7 +1583,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,210,0,0,0,114,227,0,0,0,218,11,95,103, 99,100,95,105,109,112,111,114,116,114,219,0,0,0,114,5, 0,0,0,114,5,0,0,0,114,6,0,0,0,114,228,0, - 0,0,13,4,0,0,115,10,0,0,0,12,9,8,1,12, + 0,0,5,4,0,0,115,10,0,0,0,12,9,8,1,12, 1,10,1,255,128,114,228,0,0,0,169,1,218,9,114,101, 99,117,114,115,105,118,101,99,3,0,0,0,0,0,0,0, 1,0,0,0,8,0,0,0,11,0,0,0,67,0,0,0, @@ -1630,7 +1631,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 114,224,0,0,0,114,230,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,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,233,0,0,0,28,4,0,0,115,58,0,0, + 0,0,0,114,233,0,0,0,20,4,0,0,115,58,0,0, 0,8,10,10,1,4,1,12,1,4,2,10,1,8,1,8, 255,8,2,14,1,10,1,2,1,6,255,2,128,10,2,14, 1,2,1,14,1,14,1,10,4,16,1,2,255,12,2,2, @@ -1657,7 +1658,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,158,0,0,0, - 114,119,0,0,0,78,122,32,95,95,112,97,99,107,97,103, + 114,113,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, @@ -1673,7 +1674,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,41,3,218,7,103,108,111,98,97,108,115,114,208, 0,0,0,114,109,0,0,0,114,5,0,0,0,114,5,0, 0,0,114,6,0,0,0,218,17,95,99,97,108,99,95,95, - 95,112,97,99,107,97,103,101,95,95,65,4,0,0,115,44, + 95,112,97,99,107,97,103,101,95,95,57,4,0,0,115,44, 0,0,0,10,7,10,1,8,1,18,1,6,1,2,1,4, 255,4,1,6,255,4,2,6,254,4,3,8,1,6,1,6, 2,4,2,6,254,8,3,8,1,14,1,4,1,255,128,114, @@ -1729,7 +1730,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,114,209,0,0,0,114,110,0,0,0,90,8,103,108,111, 98,97,108,115,95,114,208,0,0,0,90,7,99,117,116,95, 111,102,102,114,5,0,0,0,114,5,0,0,0,114,6,0, - 0,0,218,10,95,95,105,109,112,111,114,116,95,95,92,4, + 0,0,218,10,95,95,105,109,112,111,114,116,95,95,84,4, 0,0,115,32,0,0,0,8,11,10,1,16,2,8,1,12, 1,4,1,8,3,18,1,4,1,4,1,26,4,30,3,10, 1,12,1,4,2,255,128,114,242,0,0,0,99,1,0,0, @@ -1743,7 +1744,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 173,0,0,0,41,2,114,20,0,0,0,114,109,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218, 18,95,98,117,105,108,116,105,110,95,102,114,111,109,95,110, - 97,109,101,129,4,0,0,115,10,0,0,0,10,1,8,1, + 97,109,101,121,4,0,0,115,10,0,0,0,10,1,8,1, 12,1,8,1,255,128,114,243,0,0,0,99,2,0,0,0, 0,0,0,0,0,0,0,0,10,0,0,0,5,0,0,0, 67,0,0,0,115,166,0,0,0,124,1,97,0,124,0,97, @@ -1786,7 +1787,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,5,0,0,0,114,5,0,0,0,114, - 6,0,0,0,218,6,95,115,101,116,117,112,136,4,0,0, + 6,0,0,0,218,6,95,115,101,116,117,112,128,4,0,0, 115,42,0,0,0,4,9,4,1,8,3,18,1,10,1,10, 1,6,1,10,1,6,1,2,2,10,1,10,1,2,128,10, 3,8,1,10,1,10,1,10,2,14,1,4,251,255,128,114, @@ -1802,7 +1803,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,114,175,0,0,0,114,192,0,0,0,41,2,114, 245,0,0,0,114,246,0,0,0,114,5,0,0,0,114,5, 0,0,0,114,6,0,0,0,218,8,95,105,110,115,116,97, - 108,108,171,4,0,0,115,8,0,0,0,10,2,12,2,16, + 108,108,163,4,0,0,115,8,0,0,0,10,2,12,2,16, 1,255,128,114,248,0,0,0,99,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, 0,115,32,0,0,0,100,1,100,2,108,0,125,0,124,0, @@ -1818,7 +1819,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 41,1,114,249,0,0,0,114,5,0,0,0,114,5,0,0, 0,114,6,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,179,4,0,0,115,8,0,0,0,8,3,4,1, + 101,114,115,171,4,0,0,115,8,0,0,0,8,3,4,1, 20,1,255,128,114,250,0,0,0,41,2,78,78,41,1,78, 41,2,78,114,25,0,0,0,41,4,78,78,114,5,0,0, 0,114,25,0,0,0,41,54,114,10,0,0,0,114,7,0, @@ -1830,7 +1831,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,83,0,0,0,114,95,0,0,0,114,100,0,0, 0,114,111,0,0,0,114,124,0,0,0,114,125,0,0,0, 114,104,0,0,0,114,155,0,0,0,114,161,0,0,0,114, - 165,0,0,0,114,120,0,0,0,114,106,0,0,0,114,172, + 165,0,0,0,114,119,0,0,0,114,106,0,0,0,114,172, 0,0,0,114,173,0,0,0,114,107,0,0,0,114,175,0, 0,0,114,192,0,0,0,114,199,0,0,0,114,210,0,0, 0,114,212,0,0,0,114,214,0,0,0,114,220,0,0,0, @@ -1844,7 +1845,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 108,101,62,1,0,0,0,115,106,0,0,0,4,0,8,22, 4,9,4,1,4,1,4,3,8,3,8,8,4,8,4,2, 16,3,14,4,14,77,14,21,8,16,8,37,8,17,14,11, - 8,8,8,11,8,12,8,19,14,36,16,101,10,26,14,45, + 8,8,8,11,8,12,8,19,14,28,16,101,10,26,14,45, 8,72,8,17,8,17,8,30,8,36,8,45,14,15,14,75, 14,80,8,13,8,9,10,9,8,47,4,16,8,1,8,2, 6,32,8,3,10,16,14,15,8,37,10,27,8,37,8,7, From webhook-mailer at python.org Wed Mar 24 11:47:45 2021 From: webhook-mailer at python.org (corona10) Date: Wed, 24 Mar 2021 15:47:45 -0000 Subject: [Python-checkins] Fix typo in fuzzer.c (GH-25013) Message-ID: https://github.com/python/cpython/commit/232f4cb6671f1ec5591faabbbbcc599da22781c4 commit: 232f4cb6671f1ec5591faabbbbcc599da22781c4 branch: master author: Ikko Ashimine committer: corona10 date: 2021-03-25T00:47:21+09:00 summary: Fix typo in fuzzer.c (GH-25013) files: M Modules/_xxtestfuzz/fuzzer.c diff --git a/Modules/_xxtestfuzz/fuzzer.c b/Modules/_xxtestfuzz/fuzzer.c index 699f906a6aec1..acbf068637b4e 100644 --- a/Modules/_xxtestfuzz/fuzzer.c +++ b/Modules/_xxtestfuzz/fuzzer.c @@ -354,7 +354,7 @@ static int fuzz_csv_reader(const char* data, size_t size) { return 0; } /* Ignore non null-terminated strings since _csv can't handle - embeded nulls */ + embedded nulls */ if (memchr(data, '\0', size) == NULL) { return 0; } @@ -383,7 +383,7 @@ static int fuzz_csv_reader(const char* data, size_t size) { } /* Ignore csv.Error because we're probably going to generate - some bad files (embeded new-lines, unterminated quotes etc) */ + some bad files (embedded new-lines, unterminated quotes etc) */ if (PyErr_ExceptionMatches(csv_error)) { PyErr_Clear(); } From webhook-mailer at python.org Wed Mar 24 13:56:34 2021 From: webhook-mailer at python.org (markshannon) Date: Wed, 24 Mar 2021 17:56:34 -0000 Subject: [Python-checkins] Only check evalbreaker after calls and on backwards egdes. Makes sure that __exit__ or __aexit__ is called in with statments in case of interrupt. (GH-18334) Message-ID: https://github.com/python/cpython/commit/4958f5d69dd2bf86866c43491caf72f774ddec97 commit: 4958f5d69dd2bf86866c43491caf72f774ddec97 branch: master author: Mark Shannon committer: markshannon date: 2021-03-24T17:56:12Z summary: Only check evalbreaker after calls and on backwards egdes. Makes sure that __exit__ or __aexit__ is called in with statments in case of interrupt. (GH-18334) files: A Misc/NEWS.d/next/Core and Builtins/2020-02-03-13-23-10.bpo-29988.8_UB5w.rst M Python/ceval.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-02-03-13-23-10.bpo-29988.8_UB5w.rst b/Misc/NEWS.d/next/Core and Builtins/2020-02-03-13-23-10.bpo-29988.8_UB5w.rst new file mode 100644 index 0000000000000..9a19c615a88f6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-02-03-13-23-10.bpo-29988.8_UB5w.rst @@ -0,0 +1,3 @@ +Only handle asynchronous exceptions and requests to drop the GIL when +returning from a call or on the back edges of loops. Makes sure that +:meth:`__exit__` is always called in with statements, even for interrupts. diff --git a/Python/ceval.c b/Python/ceval.c index 3a37017c000d4..aef79e1a9db31 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1331,7 +1331,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) TARGET_##op #ifdef LLTRACE -#define FAST_DISPATCH() \ +#define DISPATCH() \ { \ if (!lltrace && !_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ f->f_lasti = INSTR_OFFSET(); \ @@ -1341,7 +1341,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) goto fast_next_opcode; \ } #else -#define FAST_DISPATCH() \ +#define DISPATCH() \ { \ if (!_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ f->f_lasti = INSTR_OFFSET(); \ @@ -1352,20 +1352,17 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } #endif -#define DISPATCH() \ - { \ - if (!_Py_atomic_load_relaxed(eval_breaker)) { \ - FAST_DISPATCH(); \ - } \ - continue; \ - } - #else #define TARGET(op) op -#define FAST_DISPATCH() goto fast_next_opcode -#define DISPATCH() continue +#define DISPATCH() goto fast_next_opcode + #endif +#define CHECK_EVAL_BREAKER() \ + if (_Py_atomic_load_relaxed(eval_breaker)) { \ + continue; \ + } + /* Tuple access macros */ @@ -1857,7 +1854,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) and that all operation that succeed call [FAST_]DISPATCH() ! */ case TARGET(NOP): { - FAST_DISPATCH(); + DISPATCH(); } case TARGET(LOAD_FAST): { @@ -1870,7 +1867,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } Py_INCREF(value); PUSH(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(LOAD_CONST): { @@ -1878,20 +1875,20 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PyObject *value = GETITEM(consts, oparg); Py_INCREF(value); PUSH(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(STORE_FAST): { PREDICTED(STORE_FAST); PyObject *value = POP(); SETLOCAL(oparg, value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(POP_TOP): { PyObject *value = POP(); Py_DECREF(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(ROT_TWO): { @@ -1899,7 +1896,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PyObject *second = SECOND(); SET_TOP(second); SET_SECOND(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(ROT_THREE): { @@ -1909,7 +1906,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) SET_TOP(second); SET_SECOND(third); SET_THIRD(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(ROT_FOUR): { @@ -1921,14 +1918,14 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) SET_SECOND(third); SET_THIRD(fourth); SET_FOURTH(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(DUP_TOP): { PyObject *top = TOP(); Py_INCREF(top); PUSH(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(DUP_TOP_TWO): { @@ -1939,7 +1936,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) STACK_GROW(2); SET_TOP(top); SET_SECOND(second); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(UNARY_POSITIVE): { @@ -2704,7 +2701,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) UNWIND_EXCEPT_HANDLER(b); Py_DECREF(POP()); JUMPBY(oparg); - FAST_DISPATCH(); + DISPATCH(); } else { PyObject *val = POP(); @@ -2718,7 +2715,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PyObject *value = PyExc_AssertionError; Py_INCREF(value); PUSH(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(LOAD_BUILD_CLASS): { @@ -3620,7 +3617,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) Py_DECREF(right); PREDICT(POP_JUMP_IF_FALSE); PREDICT(POP_JUMP_IF_TRUE); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(CONTAINS_OP): { @@ -3637,7 +3634,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PUSH(b); PREDICT(POP_JUMP_IF_FALSE); PREDICT(POP_JUMP_IF_TRUE); - FAST_DISPATCH(); + DISPATCH(); } #define CANNOT_CATCH_MSG "catching classes that do not inherit from "\ @@ -3734,7 +3731,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) case TARGET(JUMP_FORWARD): { JUMPBY(oparg); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(POP_JUMP_IF_FALSE): { @@ -3743,12 +3740,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) int err; if (cond == Py_True) { Py_DECREF(cond); - FAST_DISPATCH(); + DISPATCH(); } if (cond == Py_False) { Py_DECREF(cond); JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -3767,12 +3764,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) int err; if (cond == Py_False) { Py_DECREF(cond); - FAST_DISPATCH(); + DISPATCH(); } if (cond == Py_True) { Py_DECREF(cond); JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -3792,11 +3789,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (cond == Py_True) { STACK_SHRINK(1); Py_DECREF(cond); - FAST_DISPATCH(); + DISPATCH(); } if (cond == Py_False) { JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); if (err > 0) { @@ -3816,11 +3813,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (cond == Py_False) { STACK_SHRINK(1); Py_DECREF(cond); - FAST_DISPATCH(); + DISPATCH(); } if (cond == Py_True) { JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); if (err > 0) { @@ -3838,18 +3835,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) case TARGET(JUMP_ABSOLUTE): { PREDICTED(JUMP_ABSOLUTE); JUMPTO(oparg); -#if FAST_LOOPS - /* Enabling this path speeds-up all while and for-loops by bypassing - the per-loop checks for signals. By default, this should be turned-off - because it prevents detection of a control-break in tight loops like - "while 1: pass". Compile with this option turned-on when you need - the speed-up and do not need break checking inside tight loops (ones - that contain only instructions ending with FAST_DISPATCH). - */ - FAST_DISPATCH(); -#else + CHECK_EVAL_BREAKER(); DISPATCH(); -#endif } case TARGET(GET_LEN): { @@ -4260,6 +4247,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) PUSH(res); if (res == NULL) goto error; + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4273,6 +4261,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (res == NULL) { goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4292,6 +4281,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (res == NULL) { goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4338,6 +4328,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) if (result == NULL) { goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } From webhook-mailer at python.org Wed Mar 24 15:34:43 2021 From: webhook-mailer at python.org (pablogsal) Date: Wed, 24 Mar 2021 19:34:43 -0000 Subject: [Python-checkins] bpo-41064: Improve syntax error for invalid usage of '**' in f-strings (GH-25006) Message-ID: https://github.com/python/cpython/commit/8efad61963809d239cac986e3f3bc4cb505ab8fe commit: 8efad61963809d239cac986e3f3bc4cb505ab8fe branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-24T19:34:17Z summary: bpo-41064: Improve syntax error for invalid usage of '**' in f-strings (GH-25006) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-24-00-32-20.bpo-41064._H0K_g.rst M Grammar/python.gram M Lib/test/test_fstring.py M Parser/parser.c diff --git a/Grammar/python.gram b/Grammar/python.gram index 7247962d3b971..4f3b649f9d57e 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -842,6 +842,8 @@ invalid_for_target: invalid_group: | '(' a=starred_expression ')' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use starred expression here") } + | '(' a='**' expression ')' { + RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use double starred expression here") } invalid_import_from_targets: | import_from_as_names ',' { RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") } diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index d7143d154a1bc..79e123f4b8cec 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -1275,5 +1275,14 @@ def test_with_an_underscore_and_a_comma_in_format_specifier(self): with self.assertRaisesRegex(ValueError, error_msg): f'{1:_,}' + def test_syntax_error_for_starred_expressions(self): + error_msg = re.escape("can't use starred expression here") + with self.assertRaisesRegex(SyntaxError, error_msg): + compile("f'{*a}'", "?", "exec") + + error_msg = re.escape("can't use double starred expression here") + with self.assertRaisesRegex(SyntaxError, error_msg): + compile("f'{**a}'", "?", "exec") + if __name__ == '__main__': unittest.main() diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-24-00-32-20.bpo-41064._H0K_g.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-24-00-32-20.bpo-41064._H0K_g.rst new file mode 100644 index 0000000000000..f6ea4d0bda6a0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-24-00-32-20.bpo-41064._H0K_g.rst @@ -0,0 +1,2 @@ +Improve the syntax error for invalid usage of double starred elements ('**') +in f-strings. Patch by Pablo Galindo. diff --git a/Parser/parser.c b/Parser/parser.c index 6efaebe179b9c..de90c87db38e6 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -18285,7 +18285,7 @@ invalid_for_target_rule(Parser *p) return _res; } -// invalid_group: '(' starred_expression ')' +// invalid_group: '(' starred_expression ')' | '(' '**' expression ')' static void * invalid_group_rule(Parser *p) { @@ -18326,6 +18326,39 @@ invalid_group_rule(Parser *p) D(fprintf(stderr, "%*c%s invalid_group[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' starred_expression ')'")); } + { // '(' '**' expression ')' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_group[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' '**' expression ')'")); + Token * _literal; + Token * _literal_1; + Token * a; + expr_ty expression_var; + if ( + (_literal = _PyPegen_expect_token(p, 7)) // token='(' + && + (a = _PyPegen_expect_token(p, 35)) // token='**' + && + (expression_var = expression_rule(p)) // expression + && + (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' + ) + { + D(fprintf(stderr, "%*c+ invalid_group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' '**' expression ')'")); + _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "can't use double starred expression here" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_group[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' '**' expression ')'")); + } _res = NULL; done: D(p->level--); From webhook-mailer at python.org Wed Mar 24 18:33:37 2021 From: webhook-mailer at python.org (rhettinger) Date: Wed, 24 Mar 2021 22:33:37 -0000 Subject: [Python-checkins] bpo-43198: Revert 3dd2157 that removed freeslot tracking. (#25010) Message-ID: https://github.com/python/cpython/commit/72789592a3491bab49f144bb292679b1484885d9 commit: 72789592a3491bab49f144bb292679b1484885d9 branch: master author: Raymond Hettinger committer: rhettinger date: 2021-03-24T15:33:27-07:00 summary: bpo-43198: Revert 3dd2157 that removed freeslot tracking. (#25010) files: M Objects/setobject.c diff --git a/Objects/setobject.c b/Objects/setobject.c index e8912ff1a29d7..caff85c9e3893 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -103,6 +103,7 @@ static int set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) { setentry *table; + setentry *freeslot; setentry *entry; size_t perturb; size_t mask; @@ -118,6 +119,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) mask = so->mask; i = (size_t)hash & mask; + freeslot = NULL; perturb = hash; while (1) { @@ -125,7 +127,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) probes = (i + LINEAR_PROBES <= mask) ? LINEAR_PROBES: 0; do { if (entry->hash == 0 && entry->key == NULL) - goto found_unused; + goto found_unused_or_dummy; if (entry->hash == hash) { PyObject *startkey = entry->key; assert(startkey != dummy); @@ -147,12 +149,24 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) goto restart; mask = so->mask; } + else if (entry->hash == -1) { + assert (entry->key == dummy); + freeslot = entry; + } entry++; } while (probes--); perturb >>= PERTURB_SHIFT; i = (i * 5 + 1 + perturb) & mask; } + found_unused_or_dummy: + if (freeslot == NULL) + goto found_unused; + so->used++; + freeslot->key = key; + freeslot->hash = hash; + return 0; + found_unused: so->fill++; so->used++; From webhook-mailer at python.org Wed Mar 24 20:19:46 2021 From: webhook-mailer at python.org (corona10) Date: Thu, 25 Mar 2021 00:19:46 -0000 Subject: [Python-checkins] AC: Update unsupported_special_methods (GH-24956) Message-ID: https://github.com/python/cpython/commit/df9ade9beb86935963f8ae47d9377578399ab6d2 commit: df9ade9beb86935963f8ae47d9377578399ab6d2 branch: master author: Dong-hee Na committer: corona10 date: 2021-03-25T09:19:23+09:00 summary: AC: Update unsupported_special_methods (GH-24956) files: M Tools/clinic/clinic.py diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index d4d7795246854..959742677d2f6 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2159,7 +2159,6 @@ def __repr__(self): __mod__ __mul__ __neg__ -__new__ __next__ __or__ __pos__ @@ -4227,6 +4226,9 @@ def state_modulename_name(self, line): module, cls = self.clinic._module_and_class(fields) fields = full_name.split('.') + if fields[-1] in unsupported_special_methods: + fail(f"{fields[-1]} is a special method and cannot be converted to Argument Clinic! (Yet.)") + if fields[-1] == '__new__': if (self.kind != CLASS_METHOD) or (not cls): fail("__new__ must be a class method!") @@ -4237,8 +4239,6 @@ def state_modulename_name(self, line): self.kind = METHOD_INIT if not return_converter: return_converter = init_return_converter() - elif fields[-1] in unsupported_special_methods: - fail(fields[-1] + " is a special method and cannot be converted to Argument Clinic! (Yet.)") if not return_converter: return_converter = CReturnConverter() From webhook-mailer at python.org Thu Mar 25 03:24:04 2021 From: webhook-mailer at python.org (methane) Date: Thu, 25 Mar 2021 07:24:04 -0000 Subject: [Python-checkins] Doc: io: Remove "In-memory streams" section (GH-24927) Message-ID: https://github.com/python/cpython/commit/b045cdaf341f80b7d1e4804b932b6e415600c2e1 commit: b045cdaf341f80b7d1e4804b932b6e415600c2e1 branch: master author: Inada Naoki committer: methane date: 2021-03-25T16:23:50+09:00 summary: Doc: io: Remove "In-memory streams" section (GH-24927) files: M Doc/library/io.rst diff --git a/Doc/library/io.rst b/Doc/library/io.rst index aecbec56866d7..96e02e839ae65 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -155,16 +155,6 @@ High-level Module Interface when an unsupported operation is called on a stream. -In-memory streams -^^^^^^^^^^^^^^^^^ - -It is also possible to use a :class:`str` or :term:`bytes-like object` as a -file for both reading and writing. For strings :class:`StringIO` can be used -like a file opened in text mode. :class:`BytesIO` can be used like a file -opened in binary mode. Both provide full read-write capabilities with random -access. - - .. seealso:: :mod:`sys` From webhook-mailer at python.org Thu Mar 25 08:00:58 2021 From: webhook-mailer at python.org (markshannon) Date: Thu, 25 Mar 2021 12:00:58 -0000 Subject: [Python-checkins] Move big block of macros out of function to improve readability. (GH-25020) Message-ID: https://github.com/python/cpython/commit/d41bdddbede45890e4effb1bbea6a346ff706695 commit: d41bdddbede45890e4effb1bbea6a346ff706695 branch: master author: Mark Shannon committer: markshannon date: 2021-03-25T12:00:30Z summary: Move big block of macros out of function to improve readability. (GH-25020) files: M Python/ceval.c diff --git a/Python/ceval.c b/Python/ceval.c index aef79e1a9db31..fde08a64e24a5 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1231,40 +1231,6 @@ eval_frame_handle_pending(PyThreadState *tstate) return 0; } -PyObject* _Py_HOT_FUNCTION -_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) -{ - _Py_EnsureTstateNotNULL(tstate); - -#ifdef DXPAIRS - int lastopcode = 0; -#endif - PyObject **stack_pointer; /* Next free slot in value stack */ - const _Py_CODEUNIT *next_instr; - int opcode; /* Current opcode */ - int oparg; /* Current opcode argument, if any */ - PyObject **fastlocals, **freevars; - PyObject *retval = NULL; /* Return value */ - struct _ceval_state * const ceval2 = &tstate->interp->ceval; - _Py_atomic_int * const eval_breaker = &ceval2->eval_breaker; - PyCodeObject *co; - - /* when tracing we set things up so that - - not (instr_lb <= current_bytecode_offset < instr_ub) - - is true when the line being executed has changed. The - initial values are such as to make this false the first - time it is tested. */ - - const _Py_CODEUNIT *first_instr; - PyObject *names; - PyObject *consts; - _PyOpcache *co_opcache; - -#ifdef LLTRACE - _Py_IDENTIFIER(__ltrace__); -#endif /* Computed GOTOs, or the-optimization-commonly-but-improperly-known-as-"threaded code" @@ -1323,9 +1289,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) #endif #if USE_COMPUTED_GOTOS -/* Import the static jump table */ -#include "opcode_targets.h" - #define TARGET(op) \ op: \ TARGET_##op @@ -1619,7 +1582,46 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) #endif -/* Start of code */ + +PyObject* _Py_HOT_FUNCTION +_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) +{ + _Py_EnsureTstateNotNULL(tstate); + +#if USE_COMPUTED_GOTOS +/* Import the static jump table */ +#include "opcode_targets.h" +#endif + +#ifdef DXPAIRS + int lastopcode = 0; +#endif + PyObject **stack_pointer; /* Next free slot in value stack */ + const _Py_CODEUNIT *next_instr; + int opcode; /* Current opcode */ + int oparg; /* Current opcode argument, if any */ + PyObject **fastlocals, **freevars; + PyObject *retval = NULL; /* Return value */ + struct _ceval_state * const ceval2 = &tstate->interp->ceval; + _Py_atomic_int * const eval_breaker = &ceval2->eval_breaker; + PyCodeObject *co; + + /* when tracing we set things up so that + + not (instr_lb <= current_bytecode_offset < instr_ub) + + is true when the line being executed has changed. The + initial values are such as to make this false the first + time it is tested. */ + + const _Py_CODEUNIT *first_instr; + PyObject *names; + PyObject *consts; + _PyOpcache *co_opcache; + +#ifdef LLTRACE + _Py_IDENTIFIER(__ltrace__); +#endif if (_Py_EnterRecursiveCall(tstate, "")) { return NULL; From webhook-mailer at python.org Thu Mar 25 12:14:30 2021 From: webhook-mailer at python.org (brandtbucher) Date: Thu, 25 Mar 2021 16:14:30 -0000 Subject: [Python-checkins] "exists" -> "exist" in What's New 3.10 (GH-25019) Message-ID: https://github.com/python/cpython/commit/56816bb845bec7714227735765e1a47c1b8f44e7 commit: 56816bb845bec7714227735765e1a47c1b8f44e7 branch: master author: blopblopy committer: brandtbucher date: 2021-03-25T09:14:22-07:00 summary: "exists" -> "exist" in What's New 3.10 (GH-25019) files: M Doc/whatsnew/3.10.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index b6791800fb6c8..30bc35d31cd14 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -215,7 +215,7 @@ operates by: match 5. If an exact match is not confirmed, the last case, a wildcard ``_``, if provided, will be used as the matching case. If an exact match is - not confirmed and a wildcard case does not exists, the entire match + not confirmed and a wildcard case does not exist, the entire match block is a no-op. Declarative approach From webhook-mailer at python.org Thu Mar 25 12:16:40 2021 From: webhook-mailer at python.org (vstinner) Date: Thu, 25 Mar 2021 16:16:40 -0000 Subject: [Python-checkins] bpo-43416: Add Include/README.rst (GH-24884) Message-ID: https://github.com/python/cpython/commit/929c9039fe0468cb37e0811ddfb7b67c98353ea8 commit: 929c9039fe0468cb37e0811ddfb7b67c98353ea8 branch: master author: Erlend Egeberg Aasland committer: vstinner date: 2021-03-25T17:16:31+01:00 summary: bpo-43416: Add Include/README.rst (GH-24884) files: A Include/README.rst diff --git a/Include/README.rst b/Include/README.rst new file mode 100644 index 0000000000000..d2467ca22fa03 --- /dev/null +++ b/Include/README.rst @@ -0,0 +1,68 @@ +The Python C API +================ + +The C API is divided into three sections: + +1. ``Include/`` +2. ``Include/cpython/`` +3. ``Include/internal/`` + + +Include: Limited API +==================== + +``Include/``, excluding the ``cpython`` and ``internal`` subdirectories, +contains the public Limited API (Application Programming Interface). +The Limited API is a subset of the C API, designed to guarantee ABI +stability across Python 3 versions, and is defined in :pep:`384`. + +Guidelines for expanding the Limited API: + +- Functions *must not* steal references +- Functions *must not* return borrowed references +- Functions returning references *must* return a strong reference +- Macros should not expose implementation details +- Please start a public discussion before expanding the API +- Functions or macros with a ``_Py`` prefix do not belong in ``Include/``. + +It is possible to add a function or macro to the Limited API from a +given Python version. For example, to add a function to the Limited API +from Python 3.10 and onwards, wrap it with +``#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000``. + + +Include/cpython: CPython implementation details +=============================================== + +``Include/cpython/`` contains the public API that is excluded from the +Limited API and the Stable ABI. + +Guidelines for expanding the public API: + +- Functions *must not* steal references +- Functions *must not* return borrowed references +- Functions returning references *must* return a strong reference + + +Include/internal: The internal API +================================== + + +With PyAPI_FUNC or PyAPI_DATA +----------------------------- + +Functions or structures in ``Include/internal/`` defined with +``PyAPI_FUNC`` or ``PyAPI_DATA`` are internal functions which are +exposed only for specific use cases like debuggers and profilers. + + +With the extern keyword +----------------------- + +Functions in ``Include/internal/`` defined with the ``extern`` keyword +*must not and can not* be used outside the CPython code base. Only +built-in stdlib extensions (built with the ``Py_BUILD_CORE_BUILTIN`` +macro defined) can use such functions. + +When in doubt, new internal C functions should be defined in +``Include/internal`` using the ``extern`` keyword. From webhook-mailer at python.org Thu Mar 25 16:32:34 2021 From: webhook-mailer at python.org (rhettinger) Date: Thu, 25 Mar 2021 20:32:34 -0000 Subject: [Python-checkins] Revert "bpo-40521: Remove freelist from collections.deque() (GH-21073)" (GH-24944) Message-ID: https://github.com/python/cpython/commit/3bb19873abd572879cc9a8810b1db9db1f704070 commit: 3bb19873abd572879cc9a8810b1db9db1f704070 branch: master author: Raymond Hettinger committer: rhettinger date: 2021-03-25T13:32:23-07:00 summary: Revert "bpo-40521: Remove freelist from collections.deque() (GH-21073)" (GH-24944) This reverts commit 32f2eda85957365d208f499b730d30b7eb419741. It can be re-applied if the subinterpreter PEP is approved. Otherwise, the commit degraded performance with no offsetting benefit. files: M Modules/_collectionsmodule.c diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index ca63f710cd864..8b01a7fad01a2 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -118,9 +118,23 @@ static PyTypeObject deque_type; #define CHECK_NOT_END(link) #endif +/* A simple freelisting scheme is used to minimize calls to the memory + allocator. It accommodates common use cases where new blocks are being + added at about the same rate as old blocks are being freed. + */ + +#define MAXFREEBLOCKS 16 +static Py_ssize_t numfreeblocks = 0; +static block *freeblocks[MAXFREEBLOCKS]; + static block * newblock(void) { - block *b = PyMem_Malloc(sizeof(block)); + block *b; + if (numfreeblocks) { + numfreeblocks--; + return freeblocks[numfreeblocks]; + } + b = PyMem_Malloc(sizeof(block)); if (b != NULL) { return b; } @@ -131,7 +145,12 @@ newblock(void) { static void freeblock(block *b) { - PyMem_Free(b); + if (numfreeblocks < MAXFREEBLOCKS) { + freeblocks[numfreeblocks] = b; + numfreeblocks++; + } else { + PyMem_Free(b); + } } static PyObject * From webhook-mailer at python.org Fri Mar 26 12:02:44 2021 From: webhook-mailer at python.org (freddrake) Date: Fri, 26 Mar 2021 16:02:44 -0000 Subject: [Python-checkins] bpo-43620: Remove reference to os.sep from os.path.join() doc (#25025) Message-ID: https://github.com/python/cpython/commit/21a2cabb3795f5170c746ab8f29e9d25c7442550 commit: 21a2cabb3795f5170c746ab8f29e9d25c7442550 branch: master author: Jared Sutton committer: freddrake date: 2021-03-26T12:02:32-04:00 summary: bpo-43620: Remove reference to os.sep from os.path.join() doc (#25025) - removed ambiguous reference to os.sep from os.path.join() doc files: M Doc/library/os.path.rst diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index a5abacf02144a..251df4d516eb5 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -306,11 +306,10 @@ the :mod:`glob` module.) Join one or more path components intelligently. The return value is the concatenation of *path* and any members of *\*paths* with exactly one - directory separator (``os.sep``) following each non-empty part except the - last, meaning that the result will only end in a separator if the last - part is empty. If a component is an absolute path, all previous - components are thrown away and joining continues from the absolute path - component. + directory separator following each non-empty part except the last, meaning + that the result will only end in a separator if the last part is empty. If + a component is an absolute path, all previous components are thrown away + and joining continues from the absolute path component. On Windows, the drive letter is not reset when an absolute path component (e.g., ``r'\foo'``) is encountered. If a component contains a drive From webhook-mailer at python.org Fri Mar 26 13:24:42 2021 From: webhook-mailer at python.org (freddrake) Date: Fri, 26 Mar 2021 17:24:42 -0000 Subject: [Python-checkins] bpo-43620: Remove reference to os.sep from os.path.join() doc (GH-25025) (#25027) Message-ID: https://github.com/python/cpython/commit/f311290f091957653bba5ebfda28ad981bb78363 commit: f311290f091957653bba5ebfda28ad981bb78363 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: freddrake date: 2021-03-26T13:24:19-04:00 summary: bpo-43620: Remove reference to os.sep from os.path.join() doc (GH-25025) (#25027) - removed ambiguous reference to os.sep from os.path.join() doc (cherry picked from commit 21a2cabb3795f5170c746ab8f29e9d25c7442550) Co-authored-by: Jared Sutton files: M Doc/library/os.path.rst diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index a5abacf02144a..251df4d516eb5 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -306,11 +306,10 @@ the :mod:`glob` module.) Join one or more path components intelligently. The return value is the concatenation of *path* and any members of *\*paths* with exactly one - directory separator (``os.sep``) following each non-empty part except the - last, meaning that the result will only end in a separator if the last - part is empty. If a component is an absolute path, all previous - components are thrown away and joining continues from the absolute path - component. + directory separator following each non-empty part except the last, meaning + that the result will only end in a separator if the last part is empty. If + a component is an absolute path, all previous components are thrown away + and joining continues from the absolute path component. On Windows, the drive letter is not reset when an absolute path component (e.g., ``r'\foo'``) is encountered. If a component contains a drive From webhook-mailer at python.org Fri Mar 26 14:55:22 2021 From: webhook-mailer at python.org (brettcannon) Date: Fri, 26 Mar 2021 18:55:22 -0000 Subject: [Python-checkins] bpo-42136: Deprecate module_repr() as found in importlib (GH-25022) Message-ID: https://github.com/python/cpython/commit/1899087b21119c5c64cd41619b542c0bf0ab5751 commit: 1899087b21119c5c64cd41619b542c0bf0ab5751 branch: master author: Brett Cannon committer: brettcannon date: 2021-03-26T11:55:07-07:00 summary: bpo-42136: Deprecate module_repr() as found in importlib (GH-25022) files: A Misc/NEWS.d/next/Library/2021-03-25-08-44-26.bpo-42136.rRY9e1.rst M Doc/reference/import.rst M Doc/whatsnew/3.10.rst M Lib/importlib/_abc.py M Lib/importlib/_bootstrap.py M Lib/importlib/_bootstrap_external.py M Lib/test/test_importlib/test_abc.py M Lib/test/test_importlib/test_namespace_pkgs.py M Lib/test/test_importlib/test_windows.py M Python/importlib.h M Python/importlib_external.h diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index c5952426fdcf8..b5ac21d481927 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -675,6 +675,13 @@ Here are the exact rules used: :meth:`~importlib.abc.Loader.module_repr` method, if defined, before trying either approach described above. However, the method is deprecated. +.. versionchanged:: 3.10 + + Calling :meth:`~importlib.abc.Loader.module_repr` now occurs after trying to + use a module's ``__spec__`` attribute but before falling back on + ``__file__``. Use of :meth:`~importlib.abc.Loader.module_repr` is slated to + stop in Python 3.12. + .. _pyc-invalidation: Cached bytecode invalidation diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 30bc35d31cd14..1c4e5c47fc681 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1010,6 +1010,12 @@ Deprecated for Python 3.12. (Contributed by Brett Cannon in :issue:`42137`.) +* :meth:`importlib.abc.Loader.module_repr`, + :meth:`importlib.machinery.FrozenLoader.module_repr`, and + :meth:`importlib.machinery.BuiltinLoader.module_repr` are deprecated and + slated for removal in Python 3.12. + (Contributed by Brett Cannon in :issue:`42136`.) + * ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python 3.3, when it was made an alias to :class:`str`. It is now deprecated, scheduled for removal in Python 3.12. diff --git a/Lib/importlib/_abc.py b/Lib/importlib/_abc.py index 7591946a4e76d..f80348fc7ffd1 100644 --- a/Lib/importlib/_abc.py +++ b/Lib/importlib/_abc.py @@ -1,6 +1,7 @@ """Subset of importlib.abc used to reduce importlib.util imports.""" from . import _bootstrap import abc +import warnings class Loader(metaclass=abc.ABCMeta): @@ -47,5 +48,7 @@ def module_repr(self, module): This method is deprecated. """ + warnings.warn("importlib.abc.Loader.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) # The exception will cause ModuleType.__repr__ to ignore this method. raise NotImplementedError diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 5038b46a018bb..d5acb6545f8fa 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -302,8 +302,6 @@ def _module_repr(module): except Exception: pass # Fall through to a catch-all which always succeeds. - # We could use module.__class__.__name__ instead of 'module' in the - # various repr permutations. try: name = module.__name__ except AttributeError: @@ -741,6 +739,8 @@ def module_repr(module): The method is deprecated. The import machinery does the job itself. """ + _warnings.warn("BuiltinImporter.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) return f'' @classmethod @@ -816,6 +816,8 @@ def module_repr(m): The method is deprecated. The import machinery does the job itself. """ + _warnings.warn("FrozenImporter.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) return ''.format(m.__name__, FrozenImporter._ORIGIN) @classmethod diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 2dab45d480a11..dac881fa42f3e 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1230,6 +1230,8 @@ def module_repr(module): The method is deprecated. The import machinery does the job itself. """ + _warnings.warn("_NamespaceLoader.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) return ''.format(module.__name__) def is_package(self, fullname): diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index d1c89c183b79f..6333ce8c48b0b 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -220,8 +220,10 @@ def test_load_module(self): def test_module_repr(self): mod = types.ModuleType('blah') - with self.assertRaises(NotImplementedError): - self.ins.module_repr(mod) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + with self.assertRaises(NotImplementedError): + self.ins.module_repr(mod) original_repr = repr(mod) mod.__loader__ = self.ins # Should still return a proper repr. diff --git a/Lib/test/test_importlib/test_namespace_pkgs.py b/Lib/test/test_importlib/test_namespace_pkgs.py index ab5847c555312..3fe3ddc589844 100644 --- a/Lib/test/test_importlib/test_namespace_pkgs.py +++ b/Lib/test/test_importlib/test_namespace_pkgs.py @@ -3,6 +3,7 @@ import os import sys import unittest +import warnings from test.test_importlib import util @@ -82,8 +83,10 @@ def test_cant_import_other(self): def test_module_repr(self): import foo.one - self.assertEqual(foo.__spec__.loader.module_repr(foo), - "") + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + self.assertEqual(foo.__spec__.loader.module_repr(foo), + "") class DynamicPathNamespacePackage(NamespacePackageTest): diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py index 8b3f2009a850d..64ffe100330ef 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -7,7 +7,6 @@ import unittest from test import support from test.support import import_helper -from distutils.util import get_platform from contextlib import contextmanager from .util import temp_module @@ -18,6 +17,25 @@ EnumKey, CloseKey, DeleteKey, OpenKey ) +def get_platform(): + # Port of distutils.util.get_platform(). + TARGET_TO_PLAT = { + 'x86' : 'win32', + 'x64' : 'win-amd64', + 'arm' : 'win-arm32', + } + if ('VSCMD_ARG_TGT_ARCH' in os.environ and + os.environ['VSCMD_ARG_TGT_ARCH'] in TARGET_TO_PLAT): + return TARGET_TO_PLAT[os.environ['VSCMD_ARG_TGT_ARCH']] + elif 'amd64' in sys.version.lower(): + return 'win-amd64' + elif '(arm)' in sys.version.lower(): + return 'win-arm32' + elif '(arm64)' in sys.version.lower(): + return 'win-arm64' + else: + return sys.platform + def delete_registry_tree(root, subkey): try: hkey = OpenKey(root, subkey, access=KEY_ALL_ACCESS) @@ -101,7 +119,7 @@ def test_tagged_suffix(self): self.assertIn(expected_tag, suffixes) - # Ensure the tags are in the correct order + # Ensure the tags are in the correct order. tagged_i = suffixes.index(expected_tag) self.assertLess(tagged_i, untagged_i) diff --git a/Misc/NEWS.d/next/Library/2021-03-25-08-44-26.bpo-42136.rRY9e1.rst b/Misc/NEWS.d/next/Library/2021-03-25-08-44-26.bpo-42136.rRY9e1.rst new file mode 100644 index 0000000000000..f66e34b18e27a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-25-08-44-26.bpo-42136.rRY9e1.rst @@ -0,0 +1,2 @@ +Deprecate all module_repr() methods found in importlib as their use is being +phased out by Python 3.12. diff --git a/Python/importlib.h b/Python/importlib.h index 633c642a1401f..f14126257e546 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -551,9 +551,9 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 101,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, 218,12,95,109,111,100,117,108,101,95,114,101,112,114,38,1, 0,0,115,46,0,0,0,12,2,16,1,8,1,10,1,2, - 1,12,1,12,1,2,1,2,4,10,1,12,1,6,1,2, + 1,12,1,12,1,2,1,2,2,10,1,12,1,6,1,2, 1,10,1,12,1,8,1,14,1,16,2,12,2,2,250,2, - 252,2,249,255,128,114,124,0,0,0,99,0,0,0,0,0, + 252,2,251,255,128,114,124,0,0,0,99,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, 0,0,0,115,114,0,0,0,101,0,90,1,100,0,90,2, 100,1,90,3,100,2,100,2,100,2,100,3,156,3,100,4, @@ -672,7 +672,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 99,104,101,100,41,6,114,33,0,0,0,114,20,0,0,0, 114,122,0,0,0,114,126,0,0,0,114,127,0,0,0,114, 128,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,34,0,0,0,103,1,0,0,115,16,0,0, + 0,0,0,114,34,0,0,0,101,1,0,0,115,16,0,0, 0,6,2,6,1,6,1,6,1,14,1,6,3,10,1,255, 128,122,19,77,111,100,117,108,101,83,112,101,99,46,95,95, 105,110,105,116,95,95,99,1,0,0,0,0,0,0,0,0, @@ -694,7 +694,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 218,9,95,95,99,108,97,115,115,95,95,114,9,0,0,0, 218,4,106,111,105,110,41,2,114,33,0,0,0,114,62,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,53,0,0,0,115,1,0,0,115,22,0,0,0,10, + 0,114,53,0,0,0,113,1,0,0,115,22,0,0,0,10, 1,10,1,4,255,10,2,18,1,10,1,6,1,8,1,4, 255,22,2,255,128,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, @@ -712,7 +712,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 2,0,0,0,218,14,78,111,116,73,109,112,108,101,109,101, 110,116,101,100,41,3,114,33,0,0,0,90,5,111,116,104, 101,114,90,4,115,109,115,108,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,218,6,95,95,101,113,95,95,125, + 0,0,114,6,0,0,0,218,6,95,95,101,113,95,95,123, 1,0,0,115,34,0,0,0,6,1,2,1,12,1,10,1, 2,255,10,2,2,254,8,3,2,253,10,4,2,252,10,5, 4,251,12,6,8,1,2,255,255,128,122,17,77,111,100,117, @@ -728,7 +728,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,114,52,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,6,0,0,0,114,135,0,0,0,137,1,0,0,115, + 0,114,6,0,0,0,114,135,0,0,0,135,1,0,0,115, 14,0,0,0,10,2,16,1,8,1,4,1,14,1,6,1, 255,128,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,0,0, @@ -736,7 +736,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,124,1,124,0,95,0,100,0,83,0,114,0,0, 0,0,41,1,114,131,0,0,0,41,2,114,33,0,0,0, 114,135,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 6,0,0,0,114,135,0,0,0,146,1,0,0,115,4,0, + 6,0,0,0,114,135,0,0,0,144,1,0,0,115,4,0, 0,0,10,2,255,128,99,1,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, 32,0,0,0,124,0,106,0,100,1,117,0,114,26,124,0, @@ -747,14 +747,14 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,41,3,114,129,0,0,0,114,20,0,0,0,218,10,114, 112,97,114,116,105,116,105,111,110,114,52,0,0,0,114,5, 0,0,0,114,5,0,0,0,114,6,0,0,0,218,6,112, - 97,114,101,110,116,150,1,0,0,115,8,0,0,0,10,3, + 97,114,101,110,116,148,1,0,0,115,8,0,0,0,10,3, 16,1,6,2,255,128,122,17,77,111,100,117,108,101,83,112, 101,99,46,112,97,114,101,110,116,99,1,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,1,0,0,0,67,0, 0,0,115,6,0,0,0,124,0,106,0,83,0,114,0,0, 0,0,41,1,114,130,0,0,0,114,52,0,0,0,114,5, 0,0,0,114,5,0,0,0,114,6,0,0,0,114,136,0, - 0,0,158,1,0,0,115,4,0,0,0,6,2,255,128,122, + 0,0,156,1,0,0,115,4,0,0,0,6,2,255,128,122, 23,77,111,100,117,108,101,83,112,101,99,46,104,97,115,95, 108,111,99,97,116,105,111,110,99,2,0,0,0,0,0,0, 0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0, @@ -762,14 +762,14 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 100,0,83,0,114,0,0,0,0,41,2,218,4,98,111,111, 108,114,130,0,0,0,41,2,114,33,0,0,0,218,5,118, 97,108,117,101,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,136,0,0,0,162,1,0,0,115,4,0,0, + 0,0,0,114,136,0,0,0,160,1,0,0,115,4,0,0, 0,14,2,255,128,41,12,114,9,0,0,0,114,8,0,0, 0,114,1,0,0,0,114,10,0,0,0,114,34,0,0,0, 114,53,0,0,0,114,138,0,0,0,218,8,112,114,111,112, 101,114,116,121,114,135,0,0,0,218,6,115,101,116,116,101, 114,114,143,0,0,0,114,136,0,0,0,114,5,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,114, - 125,0,0,0,66,1,0,0,115,36,0,0,0,8,0,4, + 125,0,0,0,64,1,0,0,115,36,0,0,0,8,0,4, 1,4,36,2,1,12,255,8,12,8,10,2,12,10,1,4, 8,10,1,2,3,10,1,2,7,10,1,4,3,14,1,255, 128,114,125,0,0,0,169,2,114,126,0,0,0,114,128,0, @@ -797,7 +797,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 114,125,0,0,0,41,6,114,20,0,0,0,114,122,0,0, 0,114,126,0,0,0,114,128,0,0,0,114,149,0,0,0, 90,6,115,101,97,114,99,104,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,114,104,0,0,0,167,1,0,0, + 0,0,114,6,0,0,0,114,104,0,0,0,165,1,0,0, 115,40,0,0,0,10,2,8,1,4,1,6,1,8,2,12, 1,12,1,6,1,2,1,6,255,8,3,10,1,2,1,14, 1,12,1,8,1,4,3,16,2,2,250,255,128,114,104,0, @@ -832,7 +832,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,20,0,0,0,90,8,108,111,99,97,116,105,111, 110,114,135,0,0,0,114,129,0,0,0,114,5,0,0,0, 114,5,0,0,0,114,6,0,0,0,218,17,95,115,112,101, - 99,95,102,114,111,109,95,109,111,100,117,108,101,193,1,0, + 99,95,102,114,111,109,95,109,111,100,117,108,101,191,1,0, 0,115,86,0,0,0,2,2,10,1,14,1,4,1,8,2, 4,1,6,2,8,1,2,1,10,1,14,1,2,2,2,1, 10,1,14,1,6,1,8,1,8,1,2,1,10,1,14,1, @@ -885,7 +885,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,114,157,0,0,0,114,122,0,0,0,114,159,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218, 18,95,105,110,105,116,95,109,111,100,117,108,101,95,97,116, - 116,114,115,238,1,0,0,115,114,0,0,0,20,4,2,1, + 116,114,115,236,1,0,0,115,114,0,0,0,20,4,2,1, 12,1,14,1,2,1,20,2,6,1,8,1,10,2,8,1, 4,1,6,1,10,2,8,1,6,1,6,11,2,1,10,1, 14,1,2,1,20,2,2,1,12,1,14,1,2,1,2,2, @@ -914,7 +914,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,114,161,0,0,0,169,2,114,109,0,0,0,114, 110,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, 0,0,0,218,16,109,111,100,117,108,101,95,102,114,111,109, - 95,115,112,101,99,54,2,0,0,115,20,0,0,0,4,3, + 95,115,112,101,99,52,2,0,0,115,20,0,0,0,4,3, 12,1,14,3,12,1,8,1,8,2,10,1,10,1,4,1, 255,128,114,165,0,0,0,99,1,0,0,0,0,0,0,0, 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, @@ -933,7 +933,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,0,114,126,0,0,0,114,122,0,0,0,114,50,0, 0,0,114,136,0,0,0,41,2,114,109,0,0,0,114,20, 0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,0, - 0,0,114,119,0,0,0,71,2,0,0,115,18,0,0,0, + 0,0,114,119,0,0,0,69,2,0,0,115,18,0,0,0, 20,3,10,1,10,1,10,1,14,2,6,2,14,1,16,2, 255,128,114,119,0,0,0,99,2,0,0,0,0,0,0,0, 0,0,0,0,4,0,0,0,10,0,0,0,67,0,0,0, @@ -976,7 +976,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 95,109,111,100,117,108,101,114,163,0,0,0,218,3,112,111, 112,41,4,114,109,0,0,0,114,110,0,0,0,114,20,0, 0,0,114,108,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,6,0,0,0,114,106,0,0,0,88,2,0,0,115, + 0,114,6,0,0,0,114,106,0,0,0,86,2,0,0,115, 50,0,0,0,6,2,10,1,16,1,10,1,12,1,2,1, 10,1,10,1,14,1,16,2,14,2,12,1,16,1,12,2, 14,1,12,2,2,128,14,4,14,1,14,255,26,1,4,1, @@ -1009,7 +1009,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 113,0,0,0,114,164,0,0,0,114,5,0,0,0,114,5, 0,0,0,114,6,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,118,2,0,0,115,66,0,0,0,2,3,18,1, + 98,108,101,116,2,0,0,115,66,0,0,0,2,3,18,1, 6,1,12,1,14,1,12,1,2,1,14,3,12,1,16,1, 2,1,12,1,14,1,2,1,16,1,2,1,8,4,10,1, 18,1,4,128,14,1,2,1,18,1,2,1,8,1,4,3, @@ -1043,7 +1043,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,114,83,0,0,0,41,3,114,109,0,0,0,114,108,0, 0,0,114,110,0,0,0,114,5,0,0,0,114,5,0,0, 0,114,6,0,0,0,218,14,95,108,111,97,100,95,117,110, - 108,111,99,107,101,100,154,2,0,0,115,62,0,0,0,10, + 108,111,99,107,101,100,152,2,0,0,115,62,0,0,0,10, 2,12,2,16,1,12,2,8,1,8,2,6,5,2,1,12, 1,2,1,10,1,10,1,14,1,2,255,12,4,4,128,6, 1,2,1,12,1,2,3,12,254,2,1,2,1,14,5,12, @@ -1068,7 +1068,7 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 101,100,46,10,10,32,32,32,32,78,41,3,114,57,0,0, 0,114,20,0,0,0,114,173,0,0,0,169,1,114,109,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,107,0,0,0,199,2,0,0,115,8,0,0,0,12, + 0,114,107,0,0,0,197,2,0,0,115,8,0,0,0,12, 9,22,1,20,128,255,128,114,107,0,0,0,99,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, 0,64,0,0,0,115,140,0,0,0,101,0,90,1,100,0, @@ -1092,762 +1092,776 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 110,115,116,97,110,116,105,97,116,101,32,116,104,101,32,99, 108,97,115,115,46,10,10,32,32,32,32,122,8,98,117,105, 108,116,45,105,110,99,1,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,5,0,0,0,67,0,0,0,115,22, - 0,0,0,100,1,124,0,106,0,155,2,100,2,116,1,106, - 2,155,0,100,3,157,5,83,0,41,5,250,115,82,101,116, - 117,114,110,32,114,101,112,114,32,102,111,114,32,116,104,101, - 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32, - 32,32,84,104,101,32,109,101,116,104,111,100,32,105,115,32, - 100,101,112,114,101,99,97,116,101,100,46,32,32,84,104,101, - 32,105,109,112,111,114,116,32,109,97,99,104,105,110,101,114, - 121,32,100,111,101,115,32,116,104,101,32,106,111,98,32,105, - 116,115,101,108,102,46,10,10,32,32,32,32,32,32,32,32, - 122,8,60,109,111,100,117,108,101,32,122,2,32,40,122,2, - 41,62,78,41,3,114,9,0,0,0,114,175,0,0,0,114, - 151,0,0,0,169,1,114,110,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,6,0,0,0,114,114,0,0,0,225, - 2,0,0,115,4,0,0,0,22,7,255,128,122,27,66,117, + 0,0,1,0,0,0,5,0,0,0,67,0,0,0,115,34, + 0,0,0,116,0,160,1,100,1,116,2,161,2,1,0,100, + 2,124,0,106,3,155,2,100,3,116,4,106,5,155,0,100, + 4,157,5,83,0,41,6,250,115,82,101,116,117,114,110,32, + 114,101,112,114,32,102,111,114,32,116,104,101,32,109,111,100, + 117,108,101,46,10,10,32,32,32,32,32,32,32,32,84,104, + 101,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, + 101,99,97,116,101,100,46,32,32,84,104,101,32,105,109,112, + 111,114,116,32,109,97,99,104,105,110,101,114,121,32,100,111, + 101,115,32,116,104,101,32,106,111,98,32,105,116,115,101,108, + 102,46,10,10,32,32,32,32,32,32,32,32,122,81,66,117, 105,108,116,105,110,73,109,112,111,114,116,101,114,46,109,111, - 100,117,108,101,95,114,101,112,114,78,99,4,0,0,0,0, - 0,0,0,0,0,0,0,4,0,0,0,5,0,0,0,67, - 0,0,0,115,42,0,0,0,124,2,100,0,117,1,114,12, - 100,0,83,0,116,0,160,1,124,1,161,1,114,38,116,2, - 124,1,124,0,124,0,106,3,100,1,141,3,83,0,100,0, - 83,0,169,2,78,114,150,0,0,0,41,4,114,64,0,0, - 0,90,10,105,115,95,98,117,105,108,116,105,110,114,104,0, - 0,0,114,151,0,0,0,169,4,218,3,99,108,115,114,89, - 0,0,0,218,4,112,97,116,104,218,6,116,97,114,103,101, - 116,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 218,9,102,105,110,100,95,115,112,101,99,234,2,0,0,115, - 12,0,0,0,8,2,4,1,10,1,16,1,4,2,255,128, - 122,25,66,117,105,108,116,105,110,73,109,112,111,114,116,101, - 114,46,102,105,110,100,95,115,112,101,99,99,3,0,0,0, - 0,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0, - 67,0,0,0,115,30,0,0,0,124,0,160,0,124,1,124, - 2,161,2,125,3,124,3,100,1,117,1,114,26,124,3,106, - 1,83,0,100,1,83,0,41,2,122,175,70,105,110,100,32, - 116,104,101,32,98,117,105,108,116,45,105,110,32,109,111,100, - 117,108,101,46,10,10,32,32,32,32,32,32,32,32,73,102, - 32,39,112,97,116,104,39,32,105,115,32,101,118,101,114,32, - 115,112,101,99,105,102,105,101,100,32,116,104,101,110,32,116, - 104,101,32,115,101,97,114,99,104,32,105,115,32,99,111,110, - 115,105,100,101,114,101,100,32,97,32,102,97,105,108,117,114, - 101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,115, - 32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,101, - 99,97,116,101,100,46,32,32,85,115,101,32,102,105,110,100, - 95,115,112,101,99,40,41,32,105,110,115,116,101,97,100,46, - 10,10,32,32,32,32,32,32,32,32,78,41,2,114,183,0, - 0,0,114,122,0,0,0,41,4,114,180,0,0,0,114,89, - 0,0,0,114,181,0,0,0,114,109,0,0,0,114,5,0, - 0,0,114,5,0,0,0,114,6,0,0,0,218,11,102,105, - 110,100,95,109,111,100,117,108,101,243,2,0,0,115,6,0, - 0,0,12,9,18,1,255,128,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,1,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,46, - 0,0,0,124,0,106,0,116,1,106,2,118,1,114,34,116, - 3,100,1,160,4,124,0,106,0,161,1,124,0,106,0,100, - 2,141,2,130,1,116,5,116,6,106,7,124,0,131,2,83, - 0,41,4,122,24,67,114,101,97,116,101,32,97,32,98,117, - 105,108,116,45,105,110,32,109,111,100,117,108,101,114,85,0, - 0,0,114,19,0,0,0,78,41,8,114,20,0,0,0,114, - 18,0,0,0,114,86,0,0,0,114,87,0,0,0,114,50, - 0,0,0,114,74,0,0,0,114,64,0,0,0,90,14,99, - 114,101,97,116,101,95,98,117,105,108,116,105,110,114,174,0, - 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,162,0,0,0,255,2,0,0,115,12,0,0,0,12, - 3,12,1,4,1,6,255,12,2,255,128,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,1,0,0,0,0, - 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67, - 0,0,0,115,16,0,0,0,116,0,116,1,106,2,124,0, - 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,74,0,0,0,114,64,0,0,0,90, - 12,101,120,101,99,95,98,117,105,108,116,105,110,114,177,0, - 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,163,0,0,0,7,3,0,0,115,4,0,0,0,16, - 3,255,128,122,27,66,117,105,108,116,105,110,73,109,112,111, - 114,116,101,114,46,101,120,101,99,95,109,111,100,117,108,101, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,243,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,5,0,0,0,169,2,114,180,0,0,0,114,89,0,0, + 100,117,108,101,95,114,101,112,114,40,41,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,32,97,110,100,32,115,108, + 97,116,101,100,32,102,111,114,32,114,101,109,111,118,97,108, + 32,105,110,32,80,121,116,104,111,110,32,51,46,49,50,122, + 8,60,109,111,100,117,108,101,32,122,2,32,40,122,2,41, + 62,78,41,6,114,101,0,0,0,114,102,0,0,0,114,103, + 0,0,0,114,9,0,0,0,114,175,0,0,0,114,151,0, + 0,0,169,1,114,110,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,6,0,0,0,114,114,0,0,0,223,2,0, + 0,115,10,0,0,0,6,7,2,1,4,255,22,2,255,128, + 122,27,66,117,105,108,116,105,110,73,109,112,111,114,116,101, + 114,46,109,111,100,117,108,101,95,114,101,112,114,78,99,4, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,5, + 0,0,0,67,0,0,0,115,42,0,0,0,124,2,100,0, + 117,1,114,12,100,0,83,0,116,0,160,1,124,1,161,1, + 114,38,116,2,124,1,124,0,124,0,106,3,100,1,141,3, + 83,0,100,0,83,0,169,2,78,114,150,0,0,0,41,4, + 114,64,0,0,0,90,10,105,115,95,98,117,105,108,116,105, + 110,114,104,0,0,0,114,151,0,0,0,169,4,218,3,99, + 108,115,114,89,0,0,0,218,4,112,97,116,104,218,6,116, + 97,114,103,101,116,114,5,0,0,0,114,5,0,0,0,114, + 6,0,0,0,218,9,102,105,110,100,95,115,112,101,99,234, + 2,0,0,115,12,0,0,0,8,2,4,1,10,1,16,1, + 4,2,255,128,122,25,66,117,105,108,116,105,110,73,109,112, + 111,114,116,101,114,46,102,105,110,100,95,115,112,101,99,99, + 3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 4,0,0,0,67,0,0,0,115,30,0,0,0,124,0,160, + 0,124,1,124,2,161,2,125,3,124,3,100,1,117,1,114, + 26,124,3,106,1,83,0,100,1,83,0,41,2,122,175,70, + 105,110,100,32,116,104,101,32,98,117,105,108,116,45,105,110, + 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32, + 32,32,73,102,32,39,112,97,116,104,39,32,105,115,32,101, + 118,101,114,32,115,112,101,99,105,102,105,101,100,32,116,104, + 101,110,32,116,104,101,32,115,101,97,114,99,104,32,105,115, + 32,99,111,110,115,105,100,101,114,101,100,32,97,32,102,97, + 105,108,117,114,101,46,10,10,32,32,32,32,32,32,32,32, + 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,32,85,115,101,32, + 102,105,110,100,95,115,112,101,99,40,41,32,105,110,115,116, + 101,97,100,46,10,10,32,32,32,32,32,32,32,32,78,41, + 2,114,183,0,0,0,114,122,0,0,0,41,4,114,180,0, + 0,0,114,89,0,0,0,114,181,0,0,0,114,109,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 218,8,103,101,116,95,99,111,100,101,12,3,0,0,243,4, - 0,0,0,4,4,255,128,122,24,66,117,105,108,116,105,110, - 73,109,112,111,114,116,101,114,46,103,101,116,95,99,111,100, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,114,185,0,0,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,5,0,0, - 0,114,186,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,218,10,103,101,116,95,115,111,117,114,99, - 101,18,3,0,0,114,188,0,0,0,122,26,66,117,105,108, - 116,105,110,73,109,112,111,114,116,101,114,46,103,101,116,95, - 115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,114, - 185,0,0,0,41,3,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,78,114,5, - 0,0,0,114,186,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,114,128,0,0,0,24,3,0,0, - 114,188,0,0,0,122,26,66,117,105,108,116,105,110,73,109, - 112,111,114,116,101,114,46,105,115,95,112,97,99,107,97,103, - 101,41,2,78,78,41,1,78,41,18,114,9,0,0,0,114, - 8,0,0,0,114,1,0,0,0,114,10,0,0,0,114,151, - 0,0,0,218,12,115,116,97,116,105,99,109,101,116,104,111, - 100,114,114,0,0,0,218,11,99,108,97,115,115,109,101,116, - 104,111,100,114,183,0,0,0,114,184,0,0,0,114,162,0, - 0,0,114,163,0,0,0,114,95,0,0,0,114,187,0,0, - 0,114,189,0,0,0,114,128,0,0,0,114,111,0,0,0, - 114,170,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,114,175,0,0,0,214,2, - 0,0,115,48,0,0,0,8,0,4,2,4,7,2,2,10, - 1,2,8,12,1,2,8,12,1,2,11,10,1,2,7,10, - 1,2,4,2,1,12,1,2,4,2,1,12,1,2,4,2, - 1,12,1,12,4,255,128,114,175,0,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, - 0,64,0,0,0,115,144,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,100,2,90,4,101,5,100,3,100,4, - 132,0,131,1,90,6,101,7,100,22,100,6,100,7,132,1, - 131,1,90,8,101,7,100,23,100,8,100,9,132,1,131,1, - 90,9,101,5,100,10,100,11,132,0,131,1,90,10,101,5, - 100,12,100,13,132,0,131,1,90,11,101,7,100,14,100,15, - 132,0,131,1,90,12,101,7,101,13,100,16,100,17,132,0, - 131,1,131,1,90,14,101,7,101,13,100,18,100,19,132,0, - 131,1,131,1,90,15,101,7,101,13,100,20,100,21,132,0, - 131,1,131,1,90,16,100,5,83,0,41,24,218,14,70,114, - 111,122,101,110,73,109,112,111,114,116,101,114,122,142,77,101, - 116,97,32,112,97,116,104,32,105,109,112,111,114,116,32,102, - 111,114,32,102,114,111,122,101,110,32,109,111,100,117,108,101, - 115,46,10,10,32,32,32,32,65,108,108,32,109,101,116,104, - 111,100,115,32,97,114,101,32,101,105,116,104,101,114,32,99, - 108,97,115,115,32,111,114,32,115,116,97,116,105,99,32,109, - 101,116,104,111,100,115,32,116,111,32,97,118,111,105,100,32, - 116,104,101,32,110,101,101,100,32,116,111,10,32,32,32,32, - 105,110,115,116,97,110,116,105,97,116,101,32,116,104,101,32, - 99,108,97,115,115,46,10,10,32,32,32,32,90,6,102,114, - 111,122,101,110,99,1,0,0,0,0,0,0,0,0,0,0, - 0,1,0,0,0,4,0,0,0,67,0,0,0,115,16,0, - 0,0,100,1,160,0,124,0,106,1,116,2,106,3,161,2, - 83,0,41,3,114,176,0,0,0,114,166,0,0,0,78,41, - 4,114,50,0,0,0,114,9,0,0,0,114,192,0,0,0, - 114,151,0,0,0,41,1,218,1,109,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,114,114,0,0,0,44,3, - 0,0,115,4,0,0,0,16,7,255,128,122,26,70,114,111, - 122,101,110,73,109,112,111,114,116,101,114,46,109,111,100,117, - 108,101,95,114,101,112,114,78,99,4,0,0,0,0,0,0, - 0,0,0,0,0,4,0,0,0,5,0,0,0,67,0,0, - 0,115,30,0,0,0,116,0,160,1,124,1,161,1,114,26, - 116,2,124,1,124,0,124,0,106,3,100,1,141,3,83,0, - 100,0,83,0,114,178,0,0,0,41,4,114,64,0,0,0, - 114,98,0,0,0,114,104,0,0,0,114,151,0,0,0,114, - 179,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,183,0,0,0,53,3,0,0,115,8,0,0, - 0,10,2,16,1,4,2,255,128,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,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,64,0,0,0,114,98,0,0, - 0,41,3,114,180,0,0,0,114,89,0,0,0,114,181,0, + 218,11,102,105,110,100,95,109,111,100,117,108,101,243,2,0, + 0,115,6,0,0,0,12,9,18,1,255,128,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,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,4,0,0,0,67,0, + 0,0,115,46,0,0,0,124,0,106,0,116,1,106,2,118, + 1,114,34,116,3,100,1,160,4,124,0,106,0,161,1,124, + 0,106,0,100,2,141,2,130,1,116,5,116,6,106,7,124, + 0,131,2,83,0,41,4,122,24,67,114,101,97,116,101,32, + 97,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108, + 101,114,85,0,0,0,114,19,0,0,0,78,41,8,114,20, + 0,0,0,114,18,0,0,0,114,86,0,0,0,114,87,0, + 0,0,114,50,0,0,0,114,74,0,0,0,114,64,0,0, + 0,90,14,99,114,101,97,116,101,95,98,117,105,108,116,105, + 110,114,174,0,0,0,114,5,0,0,0,114,5,0,0,0, + 114,6,0,0,0,114,162,0,0,0,255,2,0,0,115,12, + 0,0,0,12,3,12,1,4,1,6,255,12,2,255,128,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,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,16,0,0,0,116,0,116,1, + 106,2,124,0,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,74,0,0,0,114,64, + 0,0,0,90,12,101,120,101,99,95,98,117,105,108,116,105, + 110,114,177,0,0,0,114,5,0,0,0,114,5,0,0,0, + 114,6,0,0,0,114,163,0,0,0,7,3,0,0,115,4, + 0,0,0,16,3,255,128,122,27,66,117,105,108,116,105,110, + 73,109,112,111,114,116,101,114,46,101,120,101,99,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,1,0,0,0,67,0,0,0,243,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,5,0,0,0,169,2,114,180,0,0,0, + 114,89,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 6,0,0,0,218,8,103,101,116,95,99,111,100,101,12,3, + 0,0,243,4,0,0,0,4,4,255,128,122,24,66,117,105, + 108,116,105,110,73,109,112,111,114,116,101,114,46,103,101,116, + 95,99,111,100,101,99,2,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,114,185, + 0,0,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,5,0,0,0,114,186,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,6,0,0,0,218,10,103,101,116,95,115, + 111,117,114,99,101,18,3,0,0,114,188,0,0,0,122,26, + 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,46, + 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,114,185,0,0,0,41,3,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,78,114,5,0,0,0,114,186,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,6,0,0,0,114,128,0,0,0, + 24,3,0,0,114,188,0,0,0,122,26,66,117,105,108,116, + 105,110,73,109,112,111,114,116,101,114,46,105,115,95,112,97, + 99,107,97,103,101,41,2,78,78,41,1,78,41,18,114,9, + 0,0,0,114,8,0,0,0,114,1,0,0,0,114,10,0, + 0,0,114,151,0,0,0,218,12,115,116,97,116,105,99,109, + 101,116,104,111,100,114,114,0,0,0,218,11,99,108,97,115, + 115,109,101,116,104,111,100,114,183,0,0,0,114,184,0,0, + 0,114,162,0,0,0,114,163,0,0,0,114,95,0,0,0, + 114,187,0,0,0,114,189,0,0,0,114,128,0,0,0,114, + 111,0,0,0,114,170,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,6,0,0,0,114,175,0, + 0,0,212,2,0,0,115,48,0,0,0,8,0,4,2,4, + 7,2,2,10,1,2,10,12,1,2,8,12,1,2,11,10, + 1,2,7,10,1,2,4,2,1,12,1,2,4,2,1,12, + 1,2,4,2,1,12,1,12,4,255,128,114,175,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,4,0,0,0,64,0,0,0,115,144,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,100,2,90,4,101,5, + 100,3,100,4,132,0,131,1,90,6,101,7,100,22,100,6, + 100,7,132,1,131,1,90,8,101,7,100,23,100,8,100,9, + 132,1,131,1,90,9,101,5,100,10,100,11,132,0,131,1, + 90,10,101,5,100,12,100,13,132,0,131,1,90,11,101,7, + 100,14,100,15,132,0,131,1,90,12,101,7,101,13,100,16, + 100,17,132,0,131,1,131,1,90,14,101,7,101,13,100,18, + 100,19,132,0,131,1,131,1,90,15,101,7,101,13,100,20, + 100,21,132,0,131,1,131,1,90,16,100,5,83,0,41,24, + 218,14,70,114,111,122,101,110,73,109,112,111,114,116,101,114, + 122,142,77,101,116,97,32,112,97,116,104,32,105,109,112,111, + 114,116,32,102,111,114,32,102,114,111,122,101,110,32,109,111, + 100,117,108,101,115,46,10,10,32,32,32,32,65,108,108,32, + 109,101,116,104,111,100,115,32,97,114,101,32,101,105,116,104, + 101,114,32,99,108,97,115,115,32,111,114,32,115,116,97,116, + 105,99,32,109,101,116,104,111,100,115,32,116,111,32,97,118, + 111,105,100,32,116,104,101,32,110,101,101,100,32,116,111,10, + 32,32,32,32,105,110,115,116,97,110,116,105,97,116,101,32, + 116,104,101,32,99,108,97,115,115,46,10,10,32,32,32,32, + 90,6,102,114,111,122,101,110,99,1,0,0,0,0,0,0, + 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, + 0,115,28,0,0,0,116,0,160,1,100,1,116,2,161,2, + 1,0,100,2,160,3,124,0,106,4,116,5,106,6,161,2, + 83,0,41,4,114,176,0,0,0,122,80,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,40,41,32,105,115,32,100,101,112,114,101, + 99,97,116,101,100,32,97,110,100,32,115,108,97,116,101,100, + 32,102,111,114,32,114,101,109,111,118,97,108,32,105,110,32, + 80,121,116,104,111,110,32,51,46,49,50,114,166,0,0,0, + 78,41,7,114,101,0,0,0,114,102,0,0,0,114,103,0, + 0,0,114,50,0,0,0,114,9,0,0,0,114,192,0,0, + 0,114,151,0,0,0,41,1,218,1,109,114,5,0,0,0, + 114,5,0,0,0,114,6,0,0,0,114,114,0,0,0,44, + 3,0,0,115,10,0,0,0,6,7,2,1,4,255,16,2, + 255,128,122,26,70,114,111,122,101,110,73,109,112,111,114,116, + 101,114,46,109,111,100,117,108,101,95,114,101,112,114,78,99, + 4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 5,0,0,0,67,0,0,0,115,30,0,0,0,116,0,160, + 1,124,1,161,1,114,26,116,2,124,1,124,0,124,0,106, + 3,100,1,141,3,83,0,100,0,83,0,114,178,0,0,0, + 41,4,114,64,0,0,0,114,98,0,0,0,114,104,0,0, + 0,114,151,0,0,0,114,179,0,0,0,114,5,0,0,0, + 114,5,0,0,0,114,6,0,0,0,114,183,0,0,0,55, + 3,0,0,115,8,0,0,0,10,2,16,1,4,2,255,128, + 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,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,64, + 0,0,0,114,98,0,0,0,41,3,114,180,0,0,0,114, + 89,0,0,0,114,181,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,6,0,0,0,114,184,0,0,0,62,3,0, + 0,115,4,0,0,0,18,7,255,128,122,26,70,114,111,122, + 101,110,73,109,112,111,114,116,101,114,46,102,105,110,100,95, + 109,111,100,117,108,101,99,1,0,0,0,0,0,0,0,0, + 0,0,0,1,0,0,0,1,0,0,0,67,0,0,0,114, + 185,0,0,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,5,0,0,0,114,174,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,6,0,0,0,114,162,0,0, + 0,71,3,0,0,115,4,0,0,0,4,0,255,128,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,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,114,97,0,0,0,41, + 10,114,113,0,0,0,114,20,0,0,0,114,64,0,0,0, + 114,98,0,0,0,114,87,0,0,0,114,50,0,0,0,114, + 74,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,14,0, + 0,0,41,3,114,110,0,0,0,114,20,0,0,0,218,4, + 99,111,100,101,114,5,0,0,0,114,5,0,0,0,114,6, + 0,0,0,114,163,0,0,0,75,3,0,0,115,16,0,0, + 0,8,2,10,1,10,1,2,1,6,255,12,2,16,1,255, + 128,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,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,2,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,78,41,1,114,111,0,0,0, + 114,186,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 6,0,0,0,114,170,0,0,0,84,3,0,0,115,4,0, + 0,0,10,8,255,128,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,0,0,0,0,2, + 0,0,0,3,0,0,0,67,0,0,0,243,10,0,0,0, + 116,0,160,1,124,1,161,1,83,0,41,2,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,78,41,2,114,64, + 0,0,0,114,194,0,0,0,114,186,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,6,0,0,0,114,187,0,0, + 0,94,3,0,0,243,4,0,0,0,10,4,255,128,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, + 0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0, + 114,185,0,0,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,5,0,0,0,114,186,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,6,0,0,0,114,189,0,0,0,100,3, + 0,0,114,188,0,0,0,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,0,0,0,0,2, + 0,0,0,3,0,0,0,67,0,0,0,114,197,0,0,0, + 41,2,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,78,41,2,114,64,0,0,0,90,17,105,115,95,102, + 114,111,122,101,110,95,112,97,99,107,97,103,101,114,186,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,0, - 0,114,184,0,0,0,60,3,0,0,115,4,0,0,0,18, - 7,255,128,122,26,70,114,111,122,101,110,73,109,112,111,114, - 116,101,114,46,102,105,110,100,95,109,111,100,117,108,101,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 1,0,0,0,67,0,0,0,114,185,0,0,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,5,0,0, - 0,114,174,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,114,162,0,0,0,69,3,0,0,115,4, - 0,0,0,4,0,255,128,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,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,114,97,0,0,0,41,10,114,113,0,0,0,114, - 20,0,0,0,114,64,0,0,0,114,98,0,0,0,114,87, - 0,0,0,114,50,0,0,0,114,74,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,14,0,0,0,41,3,114,110,0, - 0,0,114,20,0,0,0,218,4,99,111,100,101,114,5,0, - 0,0,114,5,0,0,0,114,6,0,0,0,114,163,0,0, - 0,73,3,0,0,115,16,0,0,0,8,2,10,1,10,1, - 2,1,6,255,12,2,16,1,255,128,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,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,2, - 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,78,41,1,114,111,0,0,0,114,186,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,6,0,0,0,114,170,0, - 0,0,82,3,0,0,115,4,0,0,0,10,8,255,128,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,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,243,10,0,0,0,116,0,160,1,124,1,161, - 1,83,0,41,2,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,78,41,2,114,64,0,0,0,114,194,0,0, - 0,114,186,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,114,187,0,0,0,92,3,0,0,243,4, - 0,0,0,10,4,255,128,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,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,114,185,0,0,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,5,0,0,0,114,186, + 0,114,128,0,0,0,106,3,0,0,114,198,0,0,0,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,17,114,9,0,0,0,114,8,0,0,0,114,1,0, + 0,0,114,10,0,0,0,114,151,0,0,0,114,190,0,0, + 0,114,114,0,0,0,114,191,0,0,0,114,183,0,0,0, + 114,184,0,0,0,114,162,0,0,0,114,163,0,0,0,114, + 170,0,0,0,114,100,0,0,0,114,187,0,0,0,114,189, + 0,0,0,114,128,0,0,0,114,5,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,6,0,0,0,114,192,0,0, + 0,33,3,0,0,115,50,0,0,0,8,0,4,2,4,7, + 2,2,10,1,2,10,12,1,2,6,12,1,2,8,10,1, + 2,3,10,1,2,8,10,1,2,9,2,1,12,1,2,4, + 2,1,12,1,2,4,2,1,16,1,255,128,114,192,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,64,0,0,0,115,32,0,0,0,101, + 0,90,1,100,0,90,2,100,1,90,3,100,2,100,3,132, + 0,90,4,100,4,100,5,132,0,90,5,100,6,83,0,41, + 7,218,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,0,0,0,0,1,0,0,0,2,0,0,0, + 67,0,0,0,243,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,64,0,0,0,114,65,0,0,0,114,52, 0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,0, - 0,0,114,189,0,0,0,98,3,0,0,114,188,0,0,0, - 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,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,114,197,0,0,0,41,2,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,78,41,2,114,64, - 0,0,0,90,17,105,115,95,102,114,111,122,101,110,95,112, - 97,99,107,97,103,101,114,186,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,6,0,0,0,114,128,0,0,0,104, - 3,0,0,114,198,0,0,0,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,17,114,9,0,0, - 0,114,8,0,0,0,114,1,0,0,0,114,10,0,0,0, - 114,151,0,0,0,114,190,0,0,0,114,114,0,0,0,114, - 191,0,0,0,114,183,0,0,0,114,184,0,0,0,114,162, - 0,0,0,114,163,0,0,0,114,170,0,0,0,114,100,0, - 0,0,114,187,0,0,0,114,189,0,0,0,114,128,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,114,192,0,0,0,33,3,0,0,115,50, - 0,0,0,8,0,4,2,4,7,2,2,10,1,2,8,12, - 1,2,6,12,1,2,8,10,1,2,3,10,1,2,8,10, - 1,2,9,2,1,12,1,2,4,2,1,12,1,2,4,2, - 1,16,1,255,128,114,192,0,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,64, - 0,0,0,115,32,0,0,0,101,0,90,1,100,0,90,2, - 100,1,90,3,100,2,100,3,132,0,90,4,100,4,100,5, - 132,0,90,5,100,6,83,0,41,7,218,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,0,0,0, - 0,1,0,0,0,2,0,0,0,67,0,0,0,243,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,64,0, - 0,0,114,65,0,0,0,114,52,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,6,0,0,0,114,61,0,0,0, - 117,3,0,0,243,4,0,0,0,12,2,255,128,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,0,0,0,0,4,0,0,0,2,0,0,0, - 67,0,0,0,114,200,0,0,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,64,0,0, - 0,114,67,0,0,0,41,4,114,33,0,0,0,218,8,101, - 120,99,95,116,121,112,101,218,9,101,120,99,95,118,97,108, - 117,101,218,13,101,120,99,95,116,114,97,99,101,98,97,99, - 107,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 114,63,0,0,0,121,3,0,0,114,201,0,0,0,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,9, - 0,0,0,114,8,0,0,0,114,1,0,0,0,114,10,0, - 0,0,114,61,0,0,0,114,63,0,0,0,114,5,0,0, + 0,0,114,61,0,0,0,119,3,0,0,243,4,0,0,0, + 12,2,255,128,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,0,0,0,0,4, + 0,0,0,2,0,0,0,67,0,0,0,114,200,0,0,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,64,0,0,0,114,67,0,0,0,41,4,114, + 33,0,0,0,218,8,101,120,99,95,116,121,112,101,218,9, + 101,120,99,95,118,97,108,117,101,218,13,101,120,99,95,116, + 114,97,99,101,98,97,99,107,114,5,0,0,0,114,5,0, + 0,0,114,6,0,0,0,114,63,0,0,0,123,3,0,0, + 114,201,0,0,0,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,9,0,0,0,114,8,0,0,0,114, + 1,0,0,0,114,10,0,0,0,114,61,0,0,0,114,63, + 0,0,0,114,5,0,0,0,114,5,0,0,0,114,5,0, + 0,0,114,6,0,0,0,114,199,0,0,0,115,3,0,0, + 115,10,0,0,0,8,0,4,2,8,2,12,4,255,128,114, + 199,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, + 0,5,0,0,0,5,0,0,0,67,0,0,0,115,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,7,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,141,0,0,0,114,42,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,25,0,0,0,250,5,123,125,46, + 123,125,78,41,4,218,6,114,115,112,108,105,116,218,3,108, + 101,110,114,87,0,0,0,114,50,0,0,0,41,5,114,20, + 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, + 5,0,0,0,114,5,0,0,0,114,6,0,0,0,218,13, + 95,114,101,115,111,108,118,101,95,110,97,109,101,128,3,0, + 0,115,12,0,0,0,16,2,12,1,8,1,8,1,20,1, + 255,128,114,210,0,0,0,99,3,0,0,0,0,0,0,0, + 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, + 115,34,0,0,0,124,0,160,0,124,1,124,2,161,2,125, + 3,124,3,100,0,117,0,114,24,100,0,83,0,116,1,124, + 1,124,3,131,2,83,0,114,0,0,0,0,41,2,114,184, + 0,0,0,114,104,0,0,0,41,4,218,6,102,105,110,100, + 101,114,114,20,0,0,0,114,181,0,0,0,114,122,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 114,199,0,0,0,113,3,0,0,115,10,0,0,0,8,0, - 4,2,8,2,12,4,255,128,114,199,0,0,0,99,3,0, - 0,0,0,0,0,0,0,0,0,0,5,0,0,0,5,0, - 0,0,67,0,0,0,115,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,7,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,141,0,0,0,114,42,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, - 25,0,0,0,250,5,123,125,46,123,125,78,41,4,218,6, - 114,115,112,108,105,116,218,3,108,101,110,114,87,0,0,0, - 114,50,0,0,0,41,5,114,20,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,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,218,13,95,114,101,115,111,108,118, - 101,95,110,97,109,101,126,3,0,0,115,12,0,0,0,16, - 2,12,1,8,1,8,1,20,1,255,128,114,210,0,0,0, - 99,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0, - 0,4,0,0,0,67,0,0,0,115,34,0,0,0,124,0, - 160,0,124,1,124,2,161,2,125,3,124,3,100,0,117,0, - 114,24,100,0,83,0,116,1,124,1,124,3,131,2,83,0, - 114,0,0,0,0,41,2,114,184,0,0,0,114,104,0,0, - 0,41,4,218,6,102,105,110,100,101,114,114,20,0,0,0, - 114,181,0,0,0,114,122,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,218,17,95,102,105,110,100, - 95,115,112,101,99,95,108,101,103,97,99,121,135,3,0,0, - 115,10,0,0,0,12,3,8,1,4,1,10,1,255,128,114, - 212,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, - 0,10,0,0,0,10,0,0,0,67,0,0,0,115,36,1, - 0,0,116,0,106,1,125,3,124,3,100,1,117,0,114,22, - 116,2,100,2,131,1,130,1,124,3,115,38,116,3,160,4, - 100,3,116,5,161,2,1,0,124,0,116,0,106,6,118,0, - 125,4,124,3,68,0,93,230,125,5,116,7,131,0,143,94, - 1,0,122,10,124,5,106,8,125,6,87,0,110,54,4,0, - 116,9,144,1,121,34,1,0,1,0,1,0,116,10,124,5, - 124,0,124,1,131,3,125,7,124,7,100,1,117,0,114,126, - 89,0,87,0,100,1,4,0,4,0,131,3,1,0,113,52, - 89,0,110,12,124,6,124,0,124,1,124,2,131,3,125,7, - 87,0,100,1,4,0,4,0,131,3,1,0,110,16,49,0, - 115,162,119,1,1,0,1,0,1,0,89,0,1,0,124,7, - 100,1,117,1,144,1,114,26,124,4,144,1,115,18,124,0, - 116,0,106,6,118,0,144,1,114,18,116,0,106,6,124,0, - 25,0,125,8,122,10,124,8,106,11,125,9,87,0,110,26, - 4,0,116,9,144,1,121,32,1,0,1,0,1,0,124,7, - 6,0,89,0,2,0,1,0,83,0,124,9,100,1,117,0, - 144,1,114,10,124,7,2,0,1,0,83,0,124,9,2,0, - 1,0,83,0,124,7,2,0,1,0,83,0,113,52,100,1, - 83,0,119,0,119,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,18,0,0,0,218,9,109,101,116,97,95,112,97,116, - 104,114,87,0,0,0,114,101,0,0,0,114,102,0,0,0, - 114,169,0,0,0,114,105,0,0,0,114,199,0,0,0,114, - 183,0,0,0,114,2,0,0,0,114,212,0,0,0,114,113, - 0,0,0,41,10,114,20,0,0,0,114,181,0,0,0,114, - 182,0,0,0,114,213,0,0,0,90,9,105,115,95,114,101, - 108,111,97,100,114,211,0,0,0,114,183,0,0,0,114,109, - 0,0,0,114,110,0,0,0,114,113,0,0,0,114,5,0, - 0,0,114,5,0,0,0,114,6,0,0,0,218,10,95,102, - 105,110,100,95,115,112,101,99,144,3,0,0,115,66,0,0, - 0,6,2,8,1,8,2,4,3,12,1,10,5,8,1,8, - 1,2,1,10,1,14,1,12,1,8,1,16,1,4,255,12, - 3,30,128,10,1,18,2,10,1,2,1,10,1,14,1,12, - 4,10,2,8,1,8,2,8,2,2,239,4,19,2,243,2, - 244,255,128,114,214,0,0,0,99,3,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,5,0,0,0,67,0,0, - 0,115,110,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,82,116,0,124,1,116,1, - 131,2,115,70,116,2,100,4,131,1,130,1,124,1,115,82, - 116,6,100,5,131,1,130,1,124,0,115,106,124,2,100,2, - 107,2,114,102,116,5,100,6,131,1,130,1,100,7,83,0, - 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,25,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,50,0,0,0,114,3, - 0,0,0,218,10,86,97,108,117,101,69,114,114,111,114,114, - 87,0,0,0,169,3,114,20,0,0,0,114,208,0,0,0, - 114,209,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 6,0,0,0,218,13,95,115,97,110,105,116,121,95,99,104, - 101,99,107,191,3,0,0,115,26,0,0,0,10,2,18,1, - 8,1,8,1,8,1,10,1,8,1,4,1,8,1,12,2, - 8,1,8,255,255,128,114,220,0,0,0,122,16,78,111,32, - 109,111,100,117,108,101,32,110,97,109,101,100,32,122,4,123, - 33,114,125,99,2,0,0,0,0,0,0,0,0,0,0,0, - 9,0,0,0,8,0,0,0,67,0,0,0,115,22,1,0, - 0,100,0,125,2,124,0,160,0,100,1,161,1,100,2,25, - 0,125,3,124,3,114,128,124,3,116,1,106,2,118,1,114, - 42,116,3,124,1,124,3,131,2,1,0,124,0,116,1,106, - 2,118,0,114,62,116,1,106,2,124,0,25,0,83,0,116, - 1,106,2,124,3,25,0,125,4,122,10,124,4,106,4,125, - 2,87,0,110,44,4,0,116,5,144,1,121,20,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,116,9,124,0,124,2,131,2,125,6,124,6,100,0,117, - 0,114,164,116,8,116,6,160,7,124,0,161,1,124,0,100, - 4,141,2,130,1,116,10,124,6,131,1,125,7,124,3,144, - 1,114,14,116,1,106,2,124,3,25,0,125,4,124,0,160, - 0,100,1,161,1,100,5,25,0,125,8,122,18,116,11,124, - 4,124,8,124,7,131,3,1,0,87,0,124,7,83,0,4, - 0,116,5,144,1,121,18,1,0,1,0,1,0,100,6,124, - 3,155,2,100,7,124,8,155,2,157,4,125,5,116,12,160, - 13,124,5,116,14,161,2,1,0,89,0,124,7,83,0,124, - 7,83,0,119,0,119,0,41,8,78,114,141,0,0,0,114, - 25,0,0,0,122,23,59,32,123,33,114,125,32,105,115,32, - 110,111,116,32,97,32,112,97,99,107,97,103,101,114,19,0, - 0,0,233,2,0,0,0,122,27,67,97,110,110,111,116,32, - 115,101,116,32,97,110,32,97,116,116,114,105,98,117,116,101, - 32,111,110,32,122,18,32,102,111,114,32,99,104,105,108,100, - 32,109,111,100,117,108,101,32,41,15,114,142,0,0,0,114, - 18,0,0,0,114,105,0,0,0,114,74,0,0,0,114,154, - 0,0,0,114,2,0,0,0,218,8,95,69,82,82,95,77, - 83,71,114,50,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,214,0,0, - 0,114,173,0,0,0,114,12,0,0,0,114,101,0,0,0, - 114,102,0,0,0,114,169,0,0,0,41,9,114,20,0,0, - 0,218,7,105,109,112,111,114,116,95,114,181,0,0,0,114, - 143,0,0,0,90,13,112,97,114,101,110,116,95,109,111,100, - 117,108,101,114,108,0,0,0,114,109,0,0,0,114,110,0, - 0,0,90,5,99,104,105,108,100,114,5,0,0,0,114,5, - 0,0,0,114,6,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,210,3,0,0,115,60,0,0,0,4,1,14,1,4,1, - 10,1,10,1,10,2,10,1,10,1,2,1,10,1,14,1, - 16,1,14,1,10,1,8,1,18,1,8,2,6,1,10,2, - 14,1,2,1,14,1,4,4,14,253,16,1,14,1,8,1, - 2,253,2,242,255,128,114,225,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,4,0,0,0,8,0,0,0, - 67,0,0,0,115,128,0,0,0,116,0,124,0,131,1,143, - 62,1,0,116,1,106,2,160,3,124,0,116,4,161,2,125, - 2,124,2,116,4,117,0,114,56,116,5,124,0,124,1,131, - 2,87,0,2,0,100,1,4,0,4,0,131,3,1,0,83, - 0,87,0,100,1,4,0,4,0,131,3,1,0,110,16,49, - 0,115,76,119,1,1,0,1,0,1,0,89,0,1,0,124, - 2,100,1,117,0,114,116,100,2,160,6,124,0,161,1,125, - 3,116,7,124,3,124,0,100,3,141,2,130,1,116,8,124, - 0,131,1,1,0,124,2,83,0,41,4,122,25,70,105,110, - 100,32,97,110,100,32,108,111,97,100,32,116,104,101,32,109, - 111,100,117,108,101,46,78,122,40,105,109,112,111,114,116,32, - 111,102,32,123,125,32,104,97,108,116,101,100,59,32,78,111, - 110,101,32,105,110,32,115,121,115,46,109,111,100,117,108,101, - 115,114,19,0,0,0,41,9,114,57,0,0,0,114,18,0, - 0,0,114,105,0,0,0,114,38,0,0,0,218,14,95,78, - 69,69,68,83,95,76,79,65,68,73,78,71,114,225,0,0, - 0,114,50,0,0,0,114,223,0,0,0,114,72,0,0,0, - 41,4,114,20,0,0,0,114,224,0,0,0,114,110,0,0, - 0,114,82,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,6,0,0,0,218,14,95,102,105,110,100,95,97,110,100, - 95,108,111,97,100,245,3,0,0,115,28,0,0,0,10,2, - 14,1,8,1,24,1,14,255,16,128,8,3,2,1,6,1, - 2,255,12,2,8,2,4,1,255,128,114,227,0,0,0,114, - 25,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,4,0,0,0,67,0,0,0,115,42,0, - 0,0,116,0,124,0,124,1,124,2,131,3,1,0,124,2, - 100,1,107,4,114,32,116,1,124,0,124,1,124,2,131,3, - 125,0,116,2,124,0,116,3,131,2,83,0,41,3,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,25,0,0,0,78,41,4,114,220,0, - 0,0,114,210,0,0,0,114,227,0,0,0,218,11,95,103, - 99,100,95,105,109,112,111,114,116,114,219,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,6,0,0,0,114,228,0, - 0,0,5,4,0,0,115,10,0,0,0,12,9,8,1,12, - 1,10,1,255,128,114,228,0,0,0,169,1,218,9,114,101, - 99,117,114,115,105,118,101,99,3,0,0,0,0,0,0,0, - 1,0,0,0,8,0,0,0,11,0,0,0,67,0,0,0, - 115,218,0,0,0,124,1,68,0,93,206,125,4,116,0,124, - 4,116,1,131,2,115,64,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,124,4,100,5,107,2,114,106,124,3,115, - 104,116,5,124,0,100,6,131,2,114,104,116,6,124,0,124, - 0,106,7,124,2,100,7,100,8,141,4,1,0,113,4,116, - 5,124,0,124,4,131,2,115,210,100,9,160,8,124,0,106, - 2,124,4,161,2,125,6,122,14,116,9,124,2,124,6,131, - 2,1,0,87,0,113,4,4,0,116,10,121,216,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,117,1,114, - 200,87,0,89,0,100,10,125,7,126,7,113,4,130,0,100, - 10,125,7,126,7,119,1,113,4,124,0,83,0,119,0,41, - 11,122,238,70,105,103,117,114,101,32,111,117,116,32,119,104, - 97,116,32,95,95,105,109,112,111,114,116,95,95,32,115,104, - 111,117,108,100,32,114,101,116,117,114,110,46,10,10,32,32, - 32,32,84,104,101,32,105,109,112,111,114,116,95,32,112,97, - 114,97,109,101,116,101,114,32,105,115,32,97,32,99,97,108, - 108,97,98,108,101,32,119,104,105,99,104,32,116,97,107,101, - 115,32,116,104,101,32,110,97,109,101,32,111,102,32,109,111, - 100,117,108,101,32,116,111,10,32,32,32,32,105,109,112,111, - 114,116,46,32,73,116,32,105,115,32,114,101,113,117,105,114, - 101,100,32,116,111,32,100,101,99,111,117,112,108,101,32,116, - 104,101,32,102,117,110,99,116,105,111,110,32,102,114,111,109, - 32,97,115,115,117,109,105,110,103,32,105,109,112,111,114,116, - 108,105,98,39,115,10,32,32,32,32,105,109,112,111,114,116, - 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, - 105,115,32,100,101,115,105,114,101,100,46,10,10,32,32,32, - 32,122,8,46,95,95,97,108,108,95,95,122,13,96,96,102, - 114,111,109,32,108,105,115,116,39,39,122,8,73,116,101,109, - 32,105,110,32,122,18,32,109,117,115,116,32,98,101,32,115, - 116,114,44,32,110,111,116,32,250,1,42,218,7,95,95,97, - 108,108,95,95,84,114,229,0,0,0,114,205,0,0,0,78, - 41,16,114,215,0,0,0,114,216,0,0,0,114,9,0,0, - 0,114,217,0,0,0,114,3,0,0,0,114,11,0,0,0, - 218,16,95,104,97,110,100,108,101,95,102,114,111,109,108,105, - 115,116,114,232,0,0,0,114,50,0,0,0,114,74,0,0, - 0,114,223,0,0,0,114,20,0,0,0,114,18,0,0,0, - 114,105,0,0,0,114,38,0,0,0,114,226,0,0,0,41, - 8,114,110,0,0,0,218,8,102,114,111,109,108,105,115,116, - 114,224,0,0,0,114,230,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,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,114,233,0,0,0,20,4,0,0,115,58,0,0, - 0,8,10,10,1,4,1,12,1,4,2,10,1,8,1,8, - 255,8,2,14,1,10,1,2,1,6,255,2,128,10,2,14, - 1,2,1,14,1,14,1,10,4,16,1,2,255,12,2,2, - 1,8,128,2,245,4,12,2,248,255,128,114,233,0,0,0, - 99,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,6,0,0,0,67,0,0,0,115,146,0,0,0,124,0, - 160,0,100,1,161,1,125,1,124,0,160,0,100,2,161,1, - 125,2,124,1,100,3,117,1,114,82,124,2,100,3,117,1, - 114,78,124,1,124,2,106,1,107,3,114,78,116,2,106,3, - 100,4,124,1,155,2,100,5,124,2,106,1,155,2,100,6, - 157,5,116,4,100,7,100,8,141,3,1,0,124,1,83,0, - 124,2,100,3,117,1,114,96,124,2,106,1,83,0,116,2, - 106,3,100,9,116,4,100,7,100,8,141,3,1,0,124,0, - 100,10,25,0,125,1,100,11,124,0,118,1,114,142,124,1, - 160,5,100,12,161,1,100,13,25,0,125,1,124,1,83,0, - 41,14,122,167,67,97,108,99,117,108,97,116,101,32,119,104, - 97,116,32,95,95,112,97,99,107,97,103,101,95,95,32,115, - 104,111,117,108,100,32,98,101,46,10,10,32,32,32,32,95, - 95,112,97,99,107,97,103,101,95,95,32,105,115,32,110,111, - 116,32,103,117,97,114,97,110,116,101,101,100,32,116,111,32, - 98,101,32,100,101,102,105,110,101,100,32,111,114,32,99,111, - 117,108,100,32,98,101,32,115,101,116,32,116,111,32,78,111, - 110,101,10,32,32,32,32,116,111,32,114,101,112,114,101,115, - 101,110,116,32,116,104,97,116,32,105,116,115,32,112,114,111, - 112,101,114,32,118,97,108,117,101,32,105,115,32,117,110,107, - 110,111,119,110,46,10,10,32,32,32,32,114,158,0,0,0, - 114,113,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, - 9,0,0,0,114,154,0,0,0,114,141,0,0,0,114,25, - 0,0,0,41,6,114,38,0,0,0,114,143,0,0,0,114, - 101,0,0,0,114,102,0,0,0,114,169,0,0,0,114,142, - 0,0,0,41,3,218,7,103,108,111,98,97,108,115,114,208, - 0,0,0,114,109,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,6,0,0,0,218,17,95,99,97,108,99,95,95, - 95,112,97,99,107,97,103,101,95,95,57,4,0,0,115,44, - 0,0,0,10,7,10,1,8,1,18,1,6,1,2,1,4, - 255,4,1,6,255,4,2,6,254,4,3,8,1,6,1,6, - 2,4,2,6,254,8,3,8,1,14,1,4,1,255,128,114, - 239,0,0,0,114,5,0,0,0,99,5,0,0,0,0,0, - 0,0,0,0,0,0,9,0,0,0,5,0,0,0,67,0, - 0,0,115,174,0,0,0,124,4,100,1,107,2,114,18,116, - 0,124,0,131,1,125,5,110,36,124,1,100,2,117,1,114, - 30,124,1,110,2,105,0,125,6,116,1,124,6,131,1,125, - 7,116,0,124,0,124,7,124,4,131,3,125,5,124,3,115, - 148,124,4,100,1,107,2,114,84,116,0,124,0,160,2,100, - 3,161,1,100,1,25,0,131,1,83,0,124,0,115,92,124, - 5,83,0,116,3,124,0,131,1,116,3,124,0,160,2,100, - 3,161,1,100,1,25,0,131,1,24,0,125,8,116,4,106, - 5,124,5,106,6,100,2,116,3,124,5,106,6,131,1,124, - 8,24,0,133,2,25,0,25,0,83,0,116,7,124,5,100, - 4,131,2,114,170,116,8,124,5,124,3,116,0,131,3,83, - 0,124,5,83,0,41,5,97,215,1,0,0,73,109,112,111, - 114,116,32,97,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,84,104,101,32,39,103,108,111,98,97,108,115,39,32, - 97,114,103,117,109,101,110,116,32,105,115,32,117,115,101,100, - 32,116,111,32,105,110,102,101,114,32,119,104,101,114,101,32, - 116,104,101,32,105,109,112,111,114,116,32,105,115,32,111,99, - 99,117,114,114,105,110,103,32,102,114,111,109,10,32,32,32, - 32,116,111,32,104,97,110,100,108,101,32,114,101,108,97,116, - 105,118,101,32,105,109,112,111,114,116,115,46,32,84,104,101, - 32,39,108,111,99,97,108,115,39,32,97,114,103,117,109,101, - 110,116,32,105,115,32,105,103,110,111,114,101,100,46,32,84, - 104,101,10,32,32,32,32,39,102,114,111,109,108,105,115,116, - 39,32,97,114,103,117,109,101,110,116,32,115,112,101,99,105, - 102,105,101,115,32,119,104,97,116,32,115,104,111,117,108,100, - 32,101,120,105,115,116,32,97,115,32,97,116,116,114,105,98, - 117,116,101,115,32,111,110,32,116,104,101,32,109,111,100,117, - 108,101,10,32,32,32,32,98,101,105,110,103,32,105,109,112, - 111,114,116,101,100,32,40,101,46,103,46,32,96,96,102,114, - 111,109,32,109,111,100,117,108,101,32,105,109,112,111,114,116, - 32,60,102,114,111,109,108,105,115,116,62,96,96,41,46,32, - 32,84,104,101,32,39,108,101,118,101,108,39,10,32,32,32, - 32,97,114,103,117,109,101,110,116,32,114,101,112,114,101,115, - 101,110,116,115,32,116,104,101,32,112,97,99,107,97,103,101, - 32,108,111,99,97,116,105,111,110,32,116,111,32,105,109,112, - 111,114,116,32,102,114,111,109,32,105,110,32,97,32,114,101, - 108,97,116,105,118,101,10,32,32,32,32,105,109,112,111,114, - 116,32,40,101,46,103,46,32,96,96,102,114,111,109,32,46, - 46,112,107,103,32,105,109,112,111,114,116,32,109,111,100,96, - 96,32,119,111,117,108,100,32,104,97,118,101,32,97,32,39, - 108,101,118,101,108,39,32,111,102,32,50,41,46,10,10,32, - 32,32,32,114,25,0,0,0,78,114,141,0,0,0,114,154, - 0,0,0,41,9,114,228,0,0,0,114,239,0,0,0,218, - 9,112,97,114,116,105,116,105,111,110,114,207,0,0,0,114, - 18,0,0,0,114,105,0,0,0,114,9,0,0,0,114,11, - 0,0,0,114,233,0,0,0,41,9,114,20,0,0,0,114, - 238,0,0,0,218,6,108,111,99,97,108,115,114,234,0,0, - 0,114,209,0,0,0,114,110,0,0,0,90,8,103,108,111, - 98,97,108,115,95,114,208,0,0,0,90,7,99,117,116,95, - 111,102,102,114,5,0,0,0,114,5,0,0,0,114,6,0, - 0,0,218,10,95,95,105,109,112,111,114,116,95,95,84,4, - 0,0,115,32,0,0,0,8,11,10,1,16,2,8,1,12, - 1,4,1,8,3,18,1,4,1,4,1,26,4,30,3,10, - 1,12,1,4,2,255,128,114,242,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0, - 0,67,0,0,0,115,38,0,0,0,116,0,160,1,124,0, - 161,1,125,1,124,1,100,0,117,0,114,30,116,2,100,1, - 124,0,23,0,131,1,130,1,116,3,124,1,131,1,83,0, - 41,2,78,122,25,110,111,32,98,117,105,108,116,45,105,110, - 32,109,111,100,117,108,101,32,110,97,109,101,100,32,41,4, - 114,175,0,0,0,114,183,0,0,0,114,87,0,0,0,114, - 173,0,0,0,41,2,114,20,0,0,0,114,109,0,0,0, + 218,17,95,102,105,110,100,95,115,112,101,99,95,108,101,103, + 97,99,121,137,3,0,0,115,10,0,0,0,12,3,8,1, + 4,1,10,1,255,128,114,212,0,0,0,99,3,0,0,0, + 0,0,0,0,0,0,0,0,10,0,0,0,10,0,0,0, + 67,0,0,0,115,36,1,0,0,116,0,106,1,125,3,124, + 3,100,1,117,0,114,22,116,2,100,2,131,1,130,1,124, + 3,115,38,116,3,160,4,100,3,116,5,161,2,1,0,124, + 0,116,0,106,6,118,0,125,4,124,3,68,0,93,230,125, + 5,116,7,131,0,143,94,1,0,122,10,124,5,106,8,125, + 6,87,0,110,54,4,0,116,9,144,1,121,34,1,0,1, + 0,1,0,116,10,124,5,124,0,124,1,131,3,125,7,124, + 7,100,1,117,0,114,126,89,0,87,0,100,1,4,0,4, + 0,131,3,1,0,113,52,89,0,110,12,124,6,124,0,124, + 1,124,2,131,3,125,7,87,0,100,1,4,0,4,0,131, + 3,1,0,110,16,49,0,115,162,119,1,1,0,1,0,1, + 0,89,0,1,0,124,7,100,1,117,1,144,1,114,26,124, + 4,144,1,115,18,124,0,116,0,106,6,118,0,144,1,114, + 18,116,0,106,6,124,0,25,0,125,8,122,10,124,8,106, + 11,125,9,87,0,110,26,4,0,116,9,144,1,121,32,1, + 0,1,0,1,0,124,7,6,0,89,0,2,0,1,0,83, + 0,124,9,100,1,117,0,144,1,114,10,124,7,2,0,1, + 0,83,0,124,9,2,0,1,0,83,0,124,7,2,0,1, + 0,83,0,113,52,100,1,83,0,119,0,119,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,18,0,0,0,218,9,109, + 101,116,97,95,112,97,116,104,114,87,0,0,0,114,101,0, + 0,0,114,102,0,0,0,114,169,0,0,0,114,105,0,0, + 0,114,199,0,0,0,114,183,0,0,0,114,2,0,0,0, + 114,212,0,0,0,114,113,0,0,0,41,10,114,20,0,0, + 0,114,181,0,0,0,114,182,0,0,0,114,213,0,0,0, + 90,9,105,115,95,114,101,108,111,97,100,114,211,0,0,0, + 114,183,0,0,0,114,109,0,0,0,114,110,0,0,0,114, + 113,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, + 0,0,0,218,10,95,102,105,110,100,95,115,112,101,99,146, + 3,0,0,115,66,0,0,0,6,2,8,1,8,2,4,3, + 12,1,10,5,8,1,8,1,2,1,10,1,14,1,12,1, + 8,1,16,1,4,255,12,3,30,128,10,1,18,2,10,1, + 2,1,10,1,14,1,12,4,10,2,8,1,8,2,8,2, + 2,239,4,19,2,243,2,244,255,128,114,214,0,0,0,99, + 3,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, + 5,0,0,0,67,0,0,0,115,110,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, + 82,116,0,124,1,116,1,131,2,115,70,116,2,100,4,131, + 1,130,1,124,1,115,82,116,6,100,5,131,1,130,1,124, + 0,115,106,124,2,100,2,107,2,114,102,116,5,100,6,131, + 1,130,1,100,7,83,0,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,25,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,50,0,0,0,114,3,0,0,0,218,10,86,97,108,117, + 101,69,114,114,111,114,114,87,0,0,0,169,3,114,20,0, + 0,0,114,208,0,0,0,114,209,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,6,0,0,0,218,13,95,115,97, + 110,105,116,121,95,99,104,101,99,107,193,3,0,0,115,26, + 0,0,0,10,2,18,1,8,1,8,1,8,1,10,1,8, + 1,4,1,8,1,12,2,8,1,8,255,255,128,114,220,0, + 0,0,122,16,78,111,32,109,111,100,117,108,101,32,110,97, + 109,101,100,32,122,4,123,33,114,125,99,2,0,0,0,0, + 0,0,0,0,0,0,0,9,0,0,0,8,0,0,0,67, + 0,0,0,115,22,1,0,0,100,0,125,2,124,0,160,0, + 100,1,161,1,100,2,25,0,125,3,124,3,114,128,124,3, + 116,1,106,2,118,1,114,42,116,3,124,1,124,3,131,2, + 1,0,124,0,116,1,106,2,118,0,114,62,116,1,106,2, + 124,0,25,0,83,0,116,1,106,2,124,3,25,0,125,4, + 122,10,124,4,106,4,125,2,87,0,110,44,4,0,116,5, + 144,1,121,20,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,116,9,124,0,124,2,131,2, + 125,6,124,6,100,0,117,0,114,164,116,8,116,6,160,7, + 124,0,161,1,124,0,100,4,141,2,130,1,116,10,124,6, + 131,1,125,7,124,3,144,1,114,14,116,1,106,2,124,3, + 25,0,125,4,124,0,160,0,100,1,161,1,100,5,25,0, + 125,8,122,18,116,11,124,4,124,8,124,7,131,3,1,0, + 87,0,124,7,83,0,4,0,116,5,144,1,121,18,1,0, + 1,0,1,0,100,6,124,3,155,2,100,7,124,8,155,2, + 157,4,125,5,116,12,160,13,124,5,116,14,161,2,1,0, + 89,0,124,7,83,0,124,7,83,0,119,0,119,0,41,8, + 78,114,141,0,0,0,114,25,0,0,0,122,23,59,32,123, + 33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,99, + 107,97,103,101,114,19,0,0,0,233,2,0,0,0,122,27, + 67,97,110,110,111,116,32,115,101,116,32,97,110,32,97,116, + 116,114,105,98,117,116,101,32,111,110,32,122,18,32,102,111, + 114,32,99,104,105,108,100,32,109,111,100,117,108,101,32,41, + 15,114,142,0,0,0,114,18,0,0,0,114,105,0,0,0, + 114,74,0,0,0,114,154,0,0,0,114,2,0,0,0,218, + 8,95,69,82,82,95,77,83,71,114,50,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,214,0,0,0,114,173,0,0,0,114,12,0, + 0,0,114,101,0,0,0,114,102,0,0,0,114,169,0,0, + 0,41,9,114,20,0,0,0,218,7,105,109,112,111,114,116, + 95,114,181,0,0,0,114,143,0,0,0,90,13,112,97,114, + 101,110,116,95,109,111,100,117,108,101,114,108,0,0,0,114, + 109,0,0,0,114,110,0,0,0,90,5,99,104,105,108,100, 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218, - 18,95,98,117,105,108,116,105,110,95,102,114,111,109,95,110, - 97,109,101,121,4,0,0,115,10,0,0,0,10,1,8,1, - 12,1,8,1,255,128,114,243,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,10,0,0,0,5,0,0,0, - 67,0,0,0,115,166,0,0,0,124,1,97,0,124,0,97, - 1,116,2,116,1,131,1,125,2,116,1,106,3,160,4,161, - 0,68,0,93,72,92,2,125,3,125,4,116,5,124,4,124, - 2,131,2,114,98,124,3,116,1,106,6,118,0,114,60,116, - 7,125,5,110,18,116,0,160,8,124,3,161,1,114,76,116, - 9,125,5,110,2,113,26,116,10,124,4,124,5,131,2,125, - 6,116,11,124,6,124,4,131,2,1,0,113,26,116,1,106, - 3,116,12,25,0,125,7,100,1,68,0,93,46,125,8,124, - 8,116,1,106,3,118,1,114,138,116,13,124,8,131,1,125, - 9,110,10,116,1,106,3,124,8,25,0,125,9,116,14,124, - 7,124,8,124,9,131,3,1,0,113,114,100,2,83,0,41, - 3,122,250,83,101,116,117,112,32,105,109,112,111,114,116,108, - 105,98,32,98,121,32,105,109,112,111,114,116,105,110,103,32, - 110,101,101,100,101,100,32,98,117,105,108,116,45,105,110,32, - 109,111,100,117,108,101,115,32,97,110,100,32,105,110,106,101, - 99,116,105,110,103,32,116,104,101,109,10,32,32,32,32,105, - 110,116,111,32,116,104,101,32,103,108,111,98,97,108,32,110, - 97,109,101,115,112,97,99,101,46,10,10,32,32,32,32,65, - 115,32,115,121,115,32,105,115,32,110,101,101,100,101,100,32, - 102,111,114,32,115,121,115,46,109,111,100,117,108,101,115,32, - 97,99,99,101,115,115,32,97,110,100,32,95,105,109,112,32, - 105,115,32,110,101,101,100,101,100,32,116,111,32,108,111,97, - 100,32,98,117,105,108,116,45,105,110,10,32,32,32,32,109, - 111,100,117,108,101,115,44,32,116,104,111,115,101,32,116,119, - 111,32,109,111,100,117,108,101,115,32,109,117,115,116,32,98, - 101,32,101,120,112,108,105,99,105,116,108,121,32,112,97,115, - 115,101,100,32,105,110,46,10,10,32,32,32,32,41,3,114, - 26,0,0,0,114,101,0,0,0,114,71,0,0,0,78,41, - 15,114,64,0,0,0,114,18,0,0,0,114,3,0,0,0, - 114,105,0,0,0,218,5,105,116,101,109,115,114,215,0,0, - 0,114,86,0,0,0,114,175,0,0,0,114,98,0,0,0, - 114,192,0,0,0,114,155,0,0,0,114,161,0,0,0,114, - 9,0,0,0,114,243,0,0,0,114,12,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,20,0,0,0,114,110,0,0,0, - 114,122,0,0,0,114,109,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,5,0,0,0,114,5,0,0,0,114, - 6,0,0,0,218,6,95,115,101,116,117,112,128,4,0,0, - 115,42,0,0,0,4,9,4,1,8,3,18,1,10,1,10, - 1,6,1,10,1,6,1,2,2,10,1,10,1,2,128,10, - 3,8,1,10,1,10,1,10,2,14,1,4,251,255,128,114, - 247,0,0,0,99,2,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,3,0,0,0,67,0,0,0,115,38,0, - 0,0,116,0,124,0,124,1,131,2,1,0,116,1,106,2, - 160,3,116,4,161,1,1,0,116,1,106,2,160,3,116,5, - 161,1,1,0,100,1,83,0,41,2,122,48,73,110,115,116, - 97,108,108,32,105,109,112,111,114,116,101,114,115,32,102,111, - 114,32,98,117,105,108,116,105,110,32,97,110,100,32,102,114, - 111,122,101,110,32,109,111,100,117,108,101,115,78,41,6,114, - 247,0,0,0,114,18,0,0,0,114,213,0,0,0,114,132, - 0,0,0,114,175,0,0,0,114,192,0,0,0,41,2,114, - 245,0,0,0,114,246,0,0,0,114,5,0,0,0,114,5, - 0,0,0,114,6,0,0,0,218,8,95,105,110,115,116,97, - 108,108,163,4,0,0,115,8,0,0,0,10,2,12,2,16, - 1,255,128,114,248,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, - 0,115,32,0,0,0,100,1,100,2,108,0,125,0,124,0, - 97,1,124,0,160,2,116,3,106,4,116,5,25,0,161,1, - 1,0,100,2,83,0,41,3,122,57,73,110,115,116,97,108, - 108,32,105,109,112,111,114,116,101,114,115,32,116,104,97,116, - 32,114,101,113,117,105,114,101,32,101,120,116,101,114,110,97, - 108,32,102,105,108,101,115,121,115,116,101,109,32,97,99,99, - 101,115,115,114,25,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,139,0,0,0,114,248,0,0, - 0,114,18,0,0,0,114,105,0,0,0,114,9,0,0,0, - 41,1,114,249,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,6,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,171,4,0,0,115,8,0,0,0,8,3,4,1, - 20,1,255,128,114,250,0,0,0,41,2,78,78,41,1,78, - 41,2,78,114,25,0,0,0,41,4,78,78,114,5,0,0, - 0,114,25,0,0,0,41,54,114,10,0,0,0,114,7,0, - 0,0,114,26,0,0,0,114,101,0,0,0,114,71,0,0, - 0,114,139,0,0,0,114,17,0,0,0,114,21,0,0,0, - 114,66,0,0,0,114,37,0,0,0,114,47,0,0,0,114, - 22,0,0,0,114,23,0,0,0,114,55,0,0,0,114,57, - 0,0,0,114,60,0,0,0,114,72,0,0,0,114,74,0, - 0,0,114,83,0,0,0,114,95,0,0,0,114,100,0,0, - 0,114,111,0,0,0,114,124,0,0,0,114,125,0,0,0, - 114,104,0,0,0,114,155,0,0,0,114,161,0,0,0,114, - 165,0,0,0,114,119,0,0,0,114,106,0,0,0,114,172, - 0,0,0,114,173,0,0,0,114,107,0,0,0,114,175,0, - 0,0,114,192,0,0,0,114,199,0,0,0,114,210,0,0, - 0,114,212,0,0,0,114,214,0,0,0,114,220,0,0,0, - 90,15,95,69,82,82,95,77,83,71,95,80,82,69,70,73, - 88,114,222,0,0,0,114,225,0,0,0,218,6,111,98,106, - 101,99,116,114,226,0,0,0,114,227,0,0,0,114,228,0, - 0,0,114,233,0,0,0,114,239,0,0,0,114,242,0,0, - 0,114,243,0,0,0,114,247,0,0,0,114,248,0,0,0, - 114,250,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,218,8,60,109,111,100,117, - 108,101,62,1,0,0,0,115,106,0,0,0,4,0,8,22, - 4,9,4,1,4,1,4,3,8,3,8,8,4,8,4,2, - 16,3,14,4,14,77,14,21,8,16,8,37,8,17,14,11, - 8,8,8,11,8,12,8,19,14,28,16,101,10,26,14,45, - 8,72,8,17,8,17,8,30,8,36,8,45,14,15,14,75, - 14,80,8,13,8,9,10,9,8,47,4,16,8,1,8,2, - 6,32,8,3,10,16,14,15,8,37,10,27,8,37,8,7, - 8,35,12,8,255,128, + 23,95,102,105,110,100,95,97,110,100,95,108,111,97,100,95, + 117,110,108,111,99,107,101,100,212,3,0,0,115,60,0,0, + 0,4,1,14,1,4,1,10,1,10,1,10,2,10,1,10, + 1,2,1,10,1,14,1,16,1,14,1,10,1,8,1,18, + 1,8,2,6,1,10,2,14,1,2,1,14,1,4,4,14, + 253,16,1,14,1,8,1,2,253,2,242,255,128,114,225,0, + 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,4, + 0,0,0,8,0,0,0,67,0,0,0,115,128,0,0,0, + 116,0,124,0,131,1,143,62,1,0,116,1,106,2,160,3, + 124,0,116,4,161,2,125,2,124,2,116,4,117,0,114,56, + 116,5,124,0,124,1,131,2,87,0,2,0,100,1,4,0, + 4,0,131,3,1,0,83,0,87,0,100,1,4,0,4,0, + 131,3,1,0,110,16,49,0,115,76,119,1,1,0,1,0, + 1,0,89,0,1,0,124,2,100,1,117,0,114,116,100,2, + 160,6,124,0,161,1,125,3,116,7,124,3,124,0,100,3, + 141,2,130,1,116,8,124,0,131,1,1,0,124,2,83,0, + 41,4,122,25,70,105,110,100,32,97,110,100,32,108,111,97, + 100,32,116,104,101,32,109,111,100,117,108,101,46,78,122,40, + 105,109,112,111,114,116,32,111,102,32,123,125,32,104,97,108, + 116,101,100,59,32,78,111,110,101,32,105,110,32,115,121,115, + 46,109,111,100,117,108,101,115,114,19,0,0,0,41,9,114, + 57,0,0,0,114,18,0,0,0,114,105,0,0,0,114,38, + 0,0,0,218,14,95,78,69,69,68,83,95,76,79,65,68, + 73,78,71,114,225,0,0,0,114,50,0,0,0,114,223,0, + 0,0,114,72,0,0,0,41,4,114,20,0,0,0,114,224, + 0,0,0,114,110,0,0,0,114,82,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,6,0,0,0,218,14,95,102, + 105,110,100,95,97,110,100,95,108,111,97,100,247,3,0,0, + 115,28,0,0,0,10,2,14,1,8,1,24,1,14,255,16, + 128,8,3,2,1,6,1,2,255,12,2,8,2,4,1,255, + 128,114,227,0,0,0,114,25,0,0,0,99,3,0,0,0, + 0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0, + 67,0,0,0,115,42,0,0,0,116,0,124,0,124,1,124, + 2,131,3,1,0,124,2,100,1,107,4,114,32,116,1,124, + 0,124,1,124,2,131,3,125,0,116,2,124,0,116,3,131, + 2,83,0,41,3,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,25,0,0, + 0,78,41,4,114,220,0,0,0,114,210,0,0,0,114,227, + 0,0,0,218,11,95,103,99,100,95,105,109,112,111,114,116, + 114,219,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 6,0,0,0,114,228,0,0,0,7,4,0,0,115,10,0, + 0,0,12,9,8,1,12,1,10,1,255,128,114,228,0,0, + 0,169,1,218,9,114,101,99,117,114,115,105,118,101,99,3, + 0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,11, + 0,0,0,67,0,0,0,115,218,0,0,0,124,1,68,0, + 93,206,125,4,116,0,124,4,116,1,131,2,115,64,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,124,4,100,5, + 107,2,114,106,124,3,115,104,116,5,124,0,100,6,131,2, + 114,104,116,6,124,0,124,0,106,7,124,2,100,7,100,8, + 141,4,1,0,113,4,116,5,124,0,124,4,131,2,115,210, + 100,9,160,8,124,0,106,2,124,4,161,2,125,6,122,14, + 116,9,124,2,124,6,131,2,1,0,87,0,113,4,4,0, + 116,10,121,216,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,117,1,114,200,87,0,89,0,100,10,125,7, + 126,7,113,4,130,0,100,10,125,7,126,7,119,1,113,4, + 124,0,83,0,119,0,41,11,122,238,70,105,103,117,114,101, + 32,111,117,116,32,119,104,97,116,32,95,95,105,109,112,111, + 114,116,95,95,32,115,104,111,117,108,100,32,114,101,116,117, + 114,110,46,10,10,32,32,32,32,84,104,101,32,105,109,112, + 111,114,116,95,32,112,97,114,97,109,101,116,101,114,32,105, + 115,32,97,32,99,97,108,108,97,98,108,101,32,119,104,105, + 99,104,32,116,97,107,101,115,32,116,104,101,32,110,97,109, + 101,32,111,102,32,109,111,100,117,108,101,32,116,111,10,32, + 32,32,32,105,109,112,111,114,116,46,32,73,116,32,105,115, + 32,114,101,113,117,105,114,101,100,32,116,111,32,100,101,99, + 111,117,112,108,101,32,116,104,101,32,102,117,110,99,116,105, + 111,110,32,102,114,111,109,32,97,115,115,117,109,105,110,103, + 32,105,109,112,111,114,116,108,105,98,39,115,10,32,32,32, + 32,105,109,112,111,114,116,32,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,32,105,115,32,100,101,115,105,114,101, + 100,46,10,10,32,32,32,32,122,8,46,95,95,97,108,108, + 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39, + 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117, + 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250, + 1,42,218,7,95,95,97,108,108,95,95,84,114,229,0,0, + 0,114,205,0,0,0,78,41,16,114,215,0,0,0,114,216, + 0,0,0,114,9,0,0,0,114,217,0,0,0,114,3,0, + 0,0,114,11,0,0,0,218,16,95,104,97,110,100,108,101, + 95,102,114,111,109,108,105,115,116,114,232,0,0,0,114,50, + 0,0,0,114,74,0,0,0,114,223,0,0,0,114,20,0, + 0,0,114,18,0,0,0,114,105,0,0,0,114,38,0,0, + 0,114,226,0,0,0,41,8,114,110,0,0,0,218,8,102, + 114,111,109,108,105,115,116,114,224,0,0,0,114,230,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,5,0,0,0, + 114,5,0,0,0,114,6,0,0,0,114,233,0,0,0,22, + 4,0,0,115,58,0,0,0,8,10,10,1,4,1,12,1, + 4,2,10,1,8,1,8,255,8,2,14,1,10,1,2,1, + 6,255,2,128,10,2,14,1,2,1,14,1,14,1,10,4, + 16,1,2,255,12,2,2,1,8,128,2,245,4,12,2,248, + 255,128,114,233,0,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,6,0,0,0,67,0,0,0, + 115,146,0,0,0,124,0,160,0,100,1,161,1,125,1,124, + 0,160,0,100,2,161,1,125,2,124,1,100,3,117,1,114, + 82,124,2,100,3,117,1,114,78,124,1,124,2,106,1,107, + 3,114,78,116,2,106,3,100,4,124,1,155,2,100,5,124, + 2,106,1,155,2,100,6,157,5,116,4,100,7,100,8,141, + 3,1,0,124,1,83,0,124,2,100,3,117,1,114,96,124, + 2,106,1,83,0,116,2,106,3,100,9,116,4,100,7,100, + 8,141,3,1,0,124,0,100,10,25,0,125,1,100,11,124, + 0,118,1,114,142,124,1,160,5,100,12,161,1,100,13,25, + 0,125,1,124,1,83,0,41,14,122,167,67,97,108,99,117, + 108,97,116,101,32,119,104,97,116,32,95,95,112,97,99,107, + 97,103,101,95,95,32,115,104,111,117,108,100,32,98,101,46, + 10,10,32,32,32,32,95,95,112,97,99,107,97,103,101,95, + 95,32,105,115,32,110,111,116,32,103,117,97,114,97,110,116, + 101,101,100,32,116,111,32,98,101,32,100,101,102,105,110,101, + 100,32,111,114,32,99,111,117,108,100,32,98,101,32,115,101, + 116,32,116,111,32,78,111,110,101,10,32,32,32,32,116,111, + 32,114,101,112,114,101,115,101,110,116,32,116,104,97,116,32, + 105,116,115,32,112,114,111,112,101,114,32,118,97,108,117,101, + 32,105,115,32,117,110,107,110,111,119,110,46,10,10,32,32, + 32,32,114,158,0,0,0,114,113,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,9,0,0,0,114,154,0,0,0, + 114,141,0,0,0,114,25,0,0,0,41,6,114,38,0,0, + 0,114,143,0,0,0,114,101,0,0,0,114,102,0,0,0, + 114,169,0,0,0,114,142,0,0,0,41,3,218,7,103,108, + 111,98,97,108,115,114,208,0,0,0,114,109,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,6,0,0,0,218,17, + 95,99,97,108,99,95,95,95,112,97,99,107,97,103,101,95, + 95,59,4,0,0,115,44,0,0,0,10,7,10,1,8,1, + 18,1,6,1,2,1,4,255,4,1,6,255,4,2,6,254, + 4,3,8,1,6,1,6,2,4,2,6,254,8,3,8,1, + 14,1,4,1,255,128,114,239,0,0,0,114,5,0,0,0, + 99,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0, + 0,5,0,0,0,67,0,0,0,115,174,0,0,0,124,4, + 100,1,107,2,114,18,116,0,124,0,131,1,125,5,110,36, + 124,1,100,2,117,1,114,30,124,1,110,2,105,0,125,6, + 116,1,124,6,131,1,125,7,116,0,124,0,124,7,124,4, + 131,3,125,5,124,3,115,148,124,4,100,1,107,2,114,84, + 116,0,124,0,160,2,100,3,161,1,100,1,25,0,131,1, + 83,0,124,0,115,92,124,5,83,0,116,3,124,0,131,1, + 116,3,124,0,160,2,100,3,161,1,100,1,25,0,131,1, + 24,0,125,8,116,4,106,5,124,5,106,6,100,2,116,3, + 124,5,106,6,131,1,124,8,24,0,133,2,25,0,25,0, + 83,0,116,7,124,5,100,4,131,2,114,170,116,8,124,5, + 124,3,116,0,131,3,83,0,124,5,83,0,41,5,97,215, + 1,0,0,73,109,112,111,114,116,32,97,32,109,111,100,117, + 108,101,46,10,10,32,32,32,32,84,104,101,32,39,103,108, + 111,98,97,108,115,39,32,97,114,103,117,109,101,110,116,32, + 105,115,32,117,115,101,100,32,116,111,32,105,110,102,101,114, + 32,119,104,101,114,101,32,116,104,101,32,105,109,112,111,114, + 116,32,105,115,32,111,99,99,117,114,114,105,110,103,32,102, + 114,111,109,10,32,32,32,32,116,111,32,104,97,110,100,108, + 101,32,114,101,108,97,116,105,118,101,32,105,109,112,111,114, + 116,115,46,32,84,104,101,32,39,108,111,99,97,108,115,39, + 32,97,114,103,117,109,101,110,116,32,105,115,32,105,103,110, + 111,114,101,100,46,32,84,104,101,10,32,32,32,32,39,102, + 114,111,109,108,105,115,116,39,32,97,114,103,117,109,101,110, + 116,32,115,112,101,99,105,102,105,101,115,32,119,104,97,116, + 32,115,104,111,117,108,100,32,101,120,105,115,116,32,97,115, + 32,97,116,116,114,105,98,117,116,101,115,32,111,110,32,116, + 104,101,32,109,111,100,117,108,101,10,32,32,32,32,98,101, + 105,110,103,32,105,109,112,111,114,116,101,100,32,40,101,46, + 103,46,32,96,96,102,114,111,109,32,109,111,100,117,108,101, + 32,105,109,112,111,114,116,32,60,102,114,111,109,108,105,115, + 116,62,96,96,41,46,32,32,84,104,101,32,39,108,101,118, + 101,108,39,10,32,32,32,32,97,114,103,117,109,101,110,116, + 32,114,101,112,114,101,115,101,110,116,115,32,116,104,101,32, + 112,97,99,107,97,103,101,32,108,111,99,97,116,105,111,110, + 32,116,111,32,105,109,112,111,114,116,32,102,114,111,109,32, + 105,110,32,97,32,114,101,108,97,116,105,118,101,10,32,32, + 32,32,105,109,112,111,114,116,32,40,101,46,103,46,32,96, + 96,102,114,111,109,32,46,46,112,107,103,32,105,109,112,111, + 114,116,32,109,111,100,96,96,32,119,111,117,108,100,32,104, + 97,118,101,32,97,32,39,108,101,118,101,108,39,32,111,102, + 32,50,41,46,10,10,32,32,32,32,114,25,0,0,0,78, + 114,141,0,0,0,114,154,0,0,0,41,9,114,228,0,0, + 0,114,239,0,0,0,218,9,112,97,114,116,105,116,105,111, + 110,114,207,0,0,0,114,18,0,0,0,114,105,0,0,0, + 114,9,0,0,0,114,11,0,0,0,114,233,0,0,0,41, + 9,114,20,0,0,0,114,238,0,0,0,218,6,108,111,99, + 97,108,115,114,234,0,0,0,114,209,0,0,0,114,110,0, + 0,0,90,8,103,108,111,98,97,108,115,95,114,208,0,0, + 0,90,7,99,117,116,95,111,102,102,114,5,0,0,0,114, + 5,0,0,0,114,6,0,0,0,218,10,95,95,105,109,112, + 111,114,116,95,95,86,4,0,0,115,32,0,0,0,8,11, + 10,1,16,2,8,1,12,1,4,1,8,3,18,1,4,1, + 4,1,26,4,30,3,10,1,12,1,4,2,255,128,114,242, + 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0, + 0,116,0,160,1,124,0,161,1,125,1,124,1,100,0,117, + 0,114,30,116,2,100,1,124,0,23,0,131,1,130,1,116, + 3,124,1,131,1,83,0,41,2,78,122,25,110,111,32,98, + 117,105,108,116,45,105,110,32,109,111,100,117,108,101,32,110, + 97,109,101,100,32,41,4,114,175,0,0,0,114,183,0,0, + 0,114,87,0,0,0,114,173,0,0,0,41,2,114,20,0, + 0,0,114,109,0,0,0,114,5,0,0,0,114,5,0,0, + 0,114,6,0,0,0,218,18,95,98,117,105,108,116,105,110, + 95,102,114,111,109,95,110,97,109,101,123,4,0,0,115,10, + 0,0,0,10,1,8,1,12,1,8,1,255,128,114,243,0, + 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,10, + 0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,0, + 124,1,97,0,124,0,97,1,116,2,116,1,131,1,125,2, + 116,1,106,3,160,4,161,0,68,0,93,72,92,2,125,3, + 125,4,116,5,124,4,124,2,131,2,114,98,124,3,116,1, + 106,6,118,0,114,60,116,7,125,5,110,18,116,0,160,8, + 124,3,161,1,114,76,116,9,125,5,110,2,113,26,116,10, + 124,4,124,5,131,2,125,6,116,11,124,6,124,4,131,2, + 1,0,113,26,116,1,106,3,116,12,25,0,125,7,100,1, + 68,0,93,46,125,8,124,8,116,1,106,3,118,1,114,138, + 116,13,124,8,131,1,125,9,110,10,116,1,106,3,124,8, + 25,0,125,9,116,14,124,7,124,8,124,9,131,3,1,0, + 113,114,100,2,83,0,41,3,122,250,83,101,116,117,112,32, + 105,109,112,111,114,116,108,105,98,32,98,121,32,105,109,112, + 111,114,116,105,110,103,32,110,101,101,100,101,100,32,98,117, + 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97, + 110,100,32,105,110,106,101,99,116,105,110,103,32,116,104,101, + 109,10,32,32,32,32,105,110,116,111,32,116,104,101,32,103, + 108,111,98,97,108,32,110,97,109,101,115,112,97,99,101,46, + 10,10,32,32,32,32,65,115,32,115,121,115,32,105,115,32, + 110,101,101,100,101,100,32,102,111,114,32,115,121,115,46,109, + 111,100,117,108,101,115,32,97,99,99,101,115,115,32,97,110, + 100,32,95,105,109,112,32,105,115,32,110,101,101,100,101,100, + 32,116,111,32,108,111,97,100,32,98,117,105,108,116,45,105, + 110,10,32,32,32,32,109,111,100,117,108,101,115,44,32,116, + 104,111,115,101,32,116,119,111,32,109,111,100,117,108,101,115, + 32,109,117,115,116,32,98,101,32,101,120,112,108,105,99,105, + 116,108,121,32,112,97,115,115,101,100,32,105,110,46,10,10, + 32,32,32,32,41,3,114,26,0,0,0,114,101,0,0,0, + 114,71,0,0,0,78,41,15,114,64,0,0,0,114,18,0, + 0,0,114,3,0,0,0,114,105,0,0,0,218,5,105,116, + 101,109,115,114,215,0,0,0,114,86,0,0,0,114,175,0, + 0,0,114,98,0,0,0,114,192,0,0,0,114,155,0,0, + 0,114,161,0,0,0,114,9,0,0,0,114,243,0,0,0, + 114,12,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,20,0, + 0,0,114,110,0,0,0,114,122,0,0,0,114,109,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,5,0,0, + 0,114,5,0,0,0,114,6,0,0,0,218,6,95,115,101, + 116,117,112,130,4,0,0,115,42,0,0,0,4,9,4,1, + 8,3,18,1,10,1,10,1,6,1,10,1,6,1,2,2, + 10,1,10,1,2,128,10,3,8,1,10,1,10,1,10,2, + 14,1,4,251,255,128,114,247,0,0,0,99,2,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, + 67,0,0,0,115,38,0,0,0,116,0,124,0,124,1,131, + 2,1,0,116,1,106,2,160,3,116,4,161,1,1,0,116, + 1,106,2,160,3,116,5,161,1,1,0,100,1,83,0,41, + 2,122,48,73,110,115,116,97,108,108,32,105,109,112,111,114, + 116,101,114,115,32,102,111,114,32,98,117,105,108,116,105,110, + 32,97,110,100,32,102,114,111,122,101,110,32,109,111,100,117, + 108,101,115,78,41,6,114,247,0,0,0,114,18,0,0,0, + 114,213,0,0,0,114,132,0,0,0,114,175,0,0,0,114, + 192,0,0,0,41,2,114,245,0,0,0,114,246,0,0,0, + 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218, + 8,95,105,110,115,116,97,108,108,165,4,0,0,115,8,0, + 0,0,10,2,12,2,16,1,255,128,114,248,0,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, + 4,0,0,0,67,0,0,0,115,32,0,0,0,100,1,100, + 2,108,0,125,0,124,0,97,1,124,0,160,2,116,3,106, + 4,116,5,25,0,161,1,1,0,100,2,83,0,41,3,122, + 57,73,110,115,116,97,108,108,32,105,109,112,111,114,116,101, + 114,115,32,116,104,97,116,32,114,101,113,117,105,114,101,32, + 101,120,116,101,114,110,97,108,32,102,105,108,101,115,121,115, + 116,101,109,32,97,99,99,101,115,115,114,25,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,139, + 0,0,0,114,248,0,0,0,114,18,0,0,0,114,105,0, + 0,0,114,9,0,0,0,41,1,114,249,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,6,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,173,4,0,0,115,8, + 0,0,0,8,3,4,1,20,1,255,128,114,250,0,0,0, + 41,2,78,78,41,1,78,41,2,78,114,25,0,0,0,41, + 4,78,78,114,5,0,0,0,114,25,0,0,0,41,54,114, + 10,0,0,0,114,7,0,0,0,114,26,0,0,0,114,101, + 0,0,0,114,71,0,0,0,114,139,0,0,0,114,17,0, + 0,0,114,21,0,0,0,114,66,0,0,0,114,37,0,0, + 0,114,47,0,0,0,114,22,0,0,0,114,23,0,0,0, + 114,55,0,0,0,114,57,0,0,0,114,60,0,0,0,114, + 72,0,0,0,114,74,0,0,0,114,83,0,0,0,114,95, + 0,0,0,114,100,0,0,0,114,111,0,0,0,114,124,0, + 0,0,114,125,0,0,0,114,104,0,0,0,114,155,0,0, + 0,114,161,0,0,0,114,165,0,0,0,114,119,0,0,0, + 114,106,0,0,0,114,172,0,0,0,114,173,0,0,0,114, + 107,0,0,0,114,175,0,0,0,114,192,0,0,0,114,199, + 0,0,0,114,210,0,0,0,114,212,0,0,0,114,214,0, + 0,0,114,220,0,0,0,90,15,95,69,82,82,95,77,83, + 71,95,80,82,69,70,73,88,114,222,0,0,0,114,225,0, + 0,0,218,6,111,98,106,101,99,116,114,226,0,0,0,114, + 227,0,0,0,114,228,0,0,0,114,233,0,0,0,114,239, + 0,0,0,114,242,0,0,0,114,243,0,0,0,114,247,0, + 0,0,114,248,0,0,0,114,250,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, + 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,106, + 0,0,0,4,0,8,22,4,9,4,1,4,1,4,3,8, + 3,8,8,4,8,4,2,16,3,14,4,14,77,14,21,8, + 16,8,37,8,17,14,11,8,8,8,11,8,12,8,19,14, + 26,16,101,10,26,14,45,8,72,8,17,8,17,8,30,8, + 36,8,45,14,15,14,77,14,82,8,13,8,9,10,9,8, + 47,4,16,8,1,8,2,6,32,8,3,10,16,14,15,8, + 37,10,27,8,37,8,7,8,35,12,8,255,128, }; diff --git a/Python/importlib_external.h b/Python/importlib_external.h index f9045892885f2..934eebaf3a66e 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1968,704 +1968,712 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,223,0,0,0,199,4,0,0,115,4,0,0,0,18, 1,255,128,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,1, - 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,114,53,1,0,0,41,3,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,78,41, - 2,114,77,0,0,0,114,137,0,0,0,41,1,114,231,0, - 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,218,11,109,111,100,117,108,101,95,114,101,112,114,202,4, - 0,0,115,4,0,0,0,12,7,255,128,122,28,95,78,97, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4, + 0,0,0,67,0,0,0,115,24,0,0,0,116,0,160,1, + 100,1,116,2,161,2,1,0,100,2,160,3,124,0,106,4, + 161,1,83,0,41,4,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,82,95,78,97, 109,101,115,112,97,99,101,76,111,97,100,101,114,46,109,111, - 100,117,108,101,95,114,101,112,114,99,2,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, - 0,0,114,24,0,0,0,41,2,78,84,114,7,0,0,0, - 114,234,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,114,193,0,0,0,211,4,0,0,243,4,0, - 0,0,4,1,255,128,122,27,95,78,97,109,101,115,112,97, - 99,101,76,111,97,100,101,114,46,105,115,95,112,97,99,107, - 97,103,101,99,2,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,114,24,0,0, - 0,41,2,78,114,10,0,0,0,114,7,0,0,0,114,234, - 0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,244,0,0,0,214,4,0,0,114,61,1,0,0, - 122,27,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,46,103,101,116,95,115,111,117,114,99,101,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,6,0, - 0,0,67,0,0,0,115,16,0,0,0,116,0,100,1,100, - 2,100,3,100,4,100,5,141,4,83,0,41,6,78,114,10, - 0,0,0,122,8,60,115,116,114,105,110,103,62,114,230,0, - 0,0,84,41,1,114,246,0,0,0,41,1,114,247,0,0, - 0,114,234,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,228,0,0,0,217,4,0,0,114,58, - 1,0,0,122,25,95,78,97,109,101,115,112,97,99,101,76, - 111,97,100,101,114,46,103,101,116,95,99,111,100,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,114,24,0,0,0,114,224,0,0, - 0,114,7,0,0,0,114,225,0,0,0,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,114,226,0,0,0,220, - 4,0,0,114,227,0,0,0,122,30,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,46,99,114,101,97,116, - 101,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, - 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, - 0,115,4,0,0,0,100,0,83,0,114,121,0,0,0,114, - 7,0,0,0,114,28,1,0,0,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,232,0,0,0,223,4,0, - 0,114,61,1,0,0,122,28,95,78,97,109,101,115,112,97, - 99,101,76,111,97,100,101,114,46,101,120,101,99,95,109,111, - 100,117,108,101,99,2,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,4,0,0,0,67,0,0,0,115,26,0, - 0,0,116,0,160,1,100,1,124,0,106,2,161,2,1,0, - 116,0,160,3,124,0,124,1,161,2,83,0,41,3,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,78,41,4,114,146,0, - 0,0,114,160,0,0,0,114,35,1,0,0,114,233,0,0, + 100,117,108,101,95,114,101,112,114,40,41,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,32,97,110,100,32,115,108, + 97,116,101,100,32,102,111,114,32,114,101,109,111,118,97,108, + 32,105,110,32,80,121,116,104,111,110,32,51,46,49,50,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,78,41,5,114,88,0, + 0,0,114,89,0,0,0,114,90,0,0,0,114,77,0,0, + 0,114,137,0,0,0,41,1,114,231,0,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,218,11,109,111, + 100,117,108,101,95,114,101,112,114,202,4,0,0,115,10,0, + 0,0,6,7,2,1,4,255,12,2,255,128,122,28,95,78, + 97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,109, + 111,100,117,108,101,95,114,101,112,114,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,114,24,0,0,0,41,2,78,84,114,7,0,0, 0,114,234,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,235,0,0,0,226,4,0,0,115,10, - 0,0,0,6,7,4,1,4,255,12,3,255,128,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,99,2,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0, - 67,0,0,0,115,22,0,0,0,100,1,100,2,108,0,109, - 1,125,2,1,0,124,2,124,0,106,2,131,1,83,0,41, - 3,78,114,0,0,0,0,41,1,218,15,78,97,109,101,115, - 112,97,99,101,82,101,97,100,101,114,41,3,114,19,1,0, - 0,114,62,1,0,0,114,35,1,0,0,41,3,114,130,0, - 0,0,114,231,0,0,0,114,62,1,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,114,20,1,0,0, - 238,4,0,0,115,6,0,0,0,12,1,10,1,255,128,122, - 36,95,78,97,109,101,115,112,97,99,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,78,41,13,114,137,0,0,0,114,136,0, - 0,0,114,138,0,0,0,114,223,0,0,0,114,220,0,0, - 0,114,60,1,0,0,114,193,0,0,0,114,244,0,0,0, - 114,228,0,0,0,114,226,0,0,0,114,232,0,0,0,114, - 235,0,0,0,114,20,1,0,0,114,7,0,0,0,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,59,1, - 0,0,198,4,0,0,115,24,0,0,0,8,0,8,1,2, - 3,10,1,8,8,8,3,8,3,8,3,8,3,8,3,12, - 12,255,128,114,59,1,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, - 0,115,118,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,101,4,100,2,100,3,132,0,131,1,90,5,101,4, - 100,4,100,5,132,0,131,1,90,6,101,7,100,6,100,7, - 132,0,131,1,90,8,101,7,100,8,100,9,132,0,131,1, - 90,9,101,7,100,19,100,11,100,12,132,1,131,1,90,10, - 101,7,100,20,100,13,100,14,132,1,131,1,90,11,101,7, - 100,21,100,15,100,16,132,1,131,1,90,12,101,4,100,17, - 100,18,132,0,131,1,90,13,100,10,83,0,41,22,218,10, - 80,97,116,104,70,105,110,100,101,114,122,62,77,101,116,97, - 32,112,97,116,104,32,102,105,110,100,101,114,32,102,111,114, - 32,115,121,115,46,112,97,116,104,32,97,110,100,32,112,97, - 99,107,97,103,101,32,95,95,112,97,116,104,95,95,32,97, - 116,116,114,105,98,117,116,101,115,46,99,0,0,0,0,0, - 0,0,0,0,0,0,0,2,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,0,125,1,124,1, - 100,1,117,0,114,40,116,1,106,2,124,0,61,0,113,14, - 116,4,124,1,100,2,131,2,114,58,124,1,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,16,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,140,0,0,0,114,64,1,0,0, - 41,2,114,128,0,0,0,218,6,102,105,110,100,101,114,114, - 7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,64, - 1,0,0,249,4,0,0,115,16,0,0,0,22,4,8,1, - 10,1,10,1,8,1,2,128,4,252,255,128,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,1,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,9,0,0,0,67, - 0,0,0,115,76,0,0,0,116,0,106,1,100,1,117,1, - 114,28,116,0,106,1,115,28,116,2,160,3,100,2,116,4, - 161,2,1,0,116,0,106,1,68,0,93,34,125,1,122,14, - 124,1,124,0,131,1,87,0,2,0,1,0,83,0,4,0, - 116,5,121,74,1,0,1,0,1,0,89,0,113,34,100,1, - 83,0,119,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,16,0,0,0,218,10,112,97,116,104,95,104,111, - 111,107,115,114,88,0,0,0,114,89,0,0,0,114,149,0, - 0,0,114,129,0,0,0,41,2,114,58,0,0,0,90,4, - 104,111,111,107,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,218,11,95,112,97,116,104,95,104,111,111,107,115, - 3,5,0,0,115,20,0,0,0,16,3,12,1,10,1,2, - 1,14,1,12,1,4,1,4,2,2,253,255,128,122,22,80, - 97,116,104,70,105,110,100,101,114,46,95,112,97,116,104,95, - 104,111,111,107,115,99,2,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,8,0,0,0,67,0,0,0,115,100, - 0,0,0,124,1,100,1,107,2,114,40,122,12,116,0,160, - 1,161,0,125,1,87,0,110,18,4,0,116,2,121,98,1, - 0,1,0,1,0,89,0,100,2,83,0,122,16,116,3,106, - 4,124,1,25,0,125,2,87,0,124,2,83,0,4,0,116, - 5,121,96,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,124, - 2,83,0,119,0,119,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,10,0, - 0,0,78,41,7,114,19,0,0,0,114,70,0,0,0,218, - 17,70,105,108,101,78,111,116,70,111,117,110,100,69,114,114, - 111,114,114,16,0,0,0,114,66,1,0,0,218,8,75,101, - 121,69,114,114,111,114,114,70,1,0,0,41,3,114,209,0, - 0,0,114,58,0,0,0,114,68,1,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,218,20,95,112,97, - 116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104, - 101,16,5,0,0,115,30,0,0,0,8,8,2,1,12,1, - 12,1,6,3,2,1,12,1,4,4,12,253,10,1,12,1, - 4,1,2,253,2,250,255,128,122,31,80,97,116,104,70,105, - 110,100,101,114,46,95,112,97,116,104,95,105,109,112,111,114, - 116,101,114,95,99,97,99,104,101,99,3,0,0,0,0,0, - 0,0,0,0,0,0,6,0,0,0,4,0,0,0,67,0, - 0,0,115,82,0,0,0,116,0,124,2,100,1,131,2,114, - 26,124,2,160,1,124,1,161,1,92,2,125,3,125,4,110, - 14,124,2,160,2,124,1,161,1,125,3,103,0,125,4,124, - 3,100,0,117,1,114,60,116,3,160,4,124,1,124,3,161, - 2,83,0,116,3,160,5,124,1,100,0,161,2,125,5,124, - 4,124,5,95,6,124,5,83,0,41,2,78,114,148,0,0, - 0,41,7,114,140,0,0,0,114,148,0,0,0,114,217,0, - 0,0,114,146,0,0,0,114,212,0,0,0,114,194,0,0, - 0,114,189,0,0,0,41,6,114,209,0,0,0,114,150,0, - 0,0,114,68,1,0,0,114,151,0,0,0,114,152,0,0, - 0,114,198,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,218,16,95,108,101,103,97,99,121,95,103, - 101,116,95,115,112,101,99,38,5,0,0,115,20,0,0,0, - 10,4,16,1,10,2,4,1,8,1,12,1,12,1,6,1, - 4,1,255,128,122,27,80,97,116,104,70,105,110,100,101,114, - 46,95,108,101,103,97,99,121,95,103,101,116,95,115,112,101, - 99,78,99,4,0,0,0,0,0,0,0,0,0,0,0,9, - 0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,0, - 103,0,125,4,124,2,68,0,93,134,125,5,116,0,124,5, - 116,1,116,2,102,2,131,2,115,28,113,8,124,0,160,3, - 124,5,161,1,125,6,124,6,100,1,117,1,114,142,116,4, - 124,6,100,2,131,2,114,70,124,6,160,5,124,1,124,3, - 161,2,125,7,110,12,124,0,160,6,124,1,124,6,161,2, - 125,7,124,7,100,1,117,0,114,92,113,8,124,7,106,7, - 100,1,117,1,114,110,124,7,2,0,1,0,83,0,124,7, - 106,8,125,8,124,8,100,1,117,0,114,132,116,9,100,3, - 131,1,130,1,124,4,160,10,124,8,161,1,1,0,113,8, - 116,11,160,12,124,1,100,1,161,2,125,7,124,4,124,7, - 95,8,124,7,83,0,41,4,122,63,70,105,110,100,32,116, - 104,101,32,108,111,97,100,101,114,32,111,114,32,110,97,109, - 101,115,112,97,99,101,95,112,97,116,104,32,102,111,114,32, - 116,104,105,115,32,109,111,100,117,108,101,47,112,97,99,107, - 97,103,101,32,110,97,109,101,46,78,114,214,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,172,0,0,0,114,97,0,0,0, - 218,5,98,121,116,101,115,114,73,1,0,0,114,140,0,0, - 0,114,214,0,0,0,114,74,1,0,0,114,151,0,0,0, - 114,189,0,0,0,114,129,0,0,0,114,178,0,0,0,114, - 146,0,0,0,114,194,0,0,0,41,9,114,209,0,0,0, - 114,150,0,0,0,114,58,0,0,0,114,213,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,68,1,0,0,114,198,0,0,0, - 114,152,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,218,9,95,103,101,116,95,115,112,101,99,53, - 5,0,0,115,44,0,0,0,4,5,8,1,14,1,2,1, - 10,1,8,1,10,1,14,1,12,2,8,1,2,1,10,1, - 8,1,6,1,8,1,8,1,10,5,2,128,12,2,6,1, - 4,1,255,128,122,20,80,97,116,104,70,105,110,100,101,114, - 46,95,103,101,116,95,115,112,101,99,99,4,0,0,0,0, - 0,0,0,0,0,0,0,6,0,0,0,5,0,0,0,67, - 0,0,0,115,94,0,0,0,124,2,100,1,117,0,114,14, - 116,0,106,1,125,2,124,0,160,2,124,1,124,2,124,3, - 161,3,125,4,124,4,100,1,117,0,114,40,100,1,83,0, - 124,4,106,3,100,1,117,0,114,90,124,4,106,4,125,5, - 124,5,114,86,100,1,124,4,95,5,116,6,124,1,124,5, - 124,0,106,2,131,3,124,4,95,4,124,4,83,0,100,1, - 83,0,124,4,83,0,41,2,122,141,84,114,121,32,116,111, - 32,102,105,110,100,32,97,32,115,112,101,99,32,102,111,114, - 32,39,102,117,108,108,110,97,109,101,39,32,111,110,32,115, - 121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,104, - 39,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, - 115,101,97,114,99,104,32,105,115,32,98,97,115,101,100,32, - 111,110,32,115,121,115,46,112,97,116,104,95,104,111,111,107, - 115,32,97,110,100,32,115,121,115,46,112,97,116,104,95,105, - 109,112,111,114,116,101,114,95,99,97,99,104,101,46,10,32, - 32,32,32,32,32,32,32,78,41,7,114,16,0,0,0,114, - 58,0,0,0,114,77,1,0,0,114,151,0,0,0,114,189, - 0,0,0,114,192,0,0,0,114,33,1,0,0,41,6,114, - 209,0,0,0,114,150,0,0,0,114,58,0,0,0,114,213, - 0,0,0,114,198,0,0,0,114,76,1,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,214,0,0, - 0,85,5,0,0,115,28,0,0,0,8,6,6,1,14,1, - 8,1,4,1,10,1,6,1,4,1,6,3,16,1,4,1, - 4,2,4,2,255,128,122,20,80,97,116,104,70,105,110,100, - 101,114,46,102,105,110,100,95,115,112,101,99,99,3,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0, - 0,67,0,0,0,115,30,0,0,0,124,0,160,0,124,1, - 124,2,161,2,125,3,124,3,100,1,117,0,114,24,100,1, - 83,0,124,3,106,1,83,0,41,2,122,170,102,105,110,100, - 32,116,104,101,32,109,111,100,117,108,101,32,111,110,32,115, - 121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,104, - 39,32,98,97,115,101,100,32,111,110,32,115,121,115,46,112, - 97,116,104,95,104,111,111,107,115,32,97,110,100,10,32,32, - 32,32,32,32,32,32,115,121,115,46,112,97,116,104,95,105, - 109,112,111,114,116,101,114,95,99,97,99,104,101,46,10,10, - 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, - 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, - 100,46,32,32,85,115,101,32,102,105,110,100,95,115,112,101, - 99,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, - 32,32,32,32,32,32,78,114,215,0,0,0,114,216,0,0, - 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 114,217,0,0,0,109,5,0,0,115,10,0,0,0,12,8, - 8,1,4,1,6,1,255,128,122,22,80,97,116,104,70,105, - 110,100,101,114,46,102,105,110,100,95,109,111,100,117,108,101, - 99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,4,0,0,0,79,0,0,0,115,28,0,0,0,100,1, - 100,2,108,0,109,1,125,2,1,0,124,2,106,2,124,0, - 105,0,124,1,164,1,142,1,83,0,41,4,97,32,1,0, - 0,10,32,32,32,32,32,32,32,32,70,105,110,100,32,100, - 105,115,116,114,105,98,117,116,105,111,110,115,46,10,10,32, - 32,32,32,32,32,32,32,82,101,116,117,114,110,32,97,110, - 32,105,116,101,114,97,98,108,101,32,111,102,32,97,108,108, - 32,68,105,115,116,114,105,98,117,116,105,111,110,32,105,110, - 115,116,97,110,99,101,115,32,99,97,112,97,98,108,101,32, - 111,102,10,32,32,32,32,32,32,32,32,108,111,97,100,105, - 110,103,32,116,104,101,32,109,101,116,97,100,97,116,97,32, - 102,111,114,32,112,97,99,107,97,103,101,115,32,109,97,116, - 99,104,105,110,103,32,96,96,99,111,110,116,101,120,116,46, - 110,97,109,101,96,96,10,32,32,32,32,32,32,32,32,40, - 111,114,32,97,108,108,32,110,97,109,101,115,32,105,102,32, - 96,96,78,111,110,101,96,96,32,105,110,100,105,99,97,116, - 101,100,41,32,97,108,111,110,103,32,116,104,101,32,112,97, - 116,104,115,32,105,110,32,116,104,101,32,108,105,115,116,10, - 32,32,32,32,32,32,32,32,111,102,32,100,105,114,101,99, - 116,111,114,105,101,115,32,96,96,99,111,110,116,101,120,116, - 46,112,97,116,104,96,96,46,10,32,32,32,32,32,32,32, - 32,114,0,0,0,0,41,1,218,18,77,101,116,97,100,97, - 116,97,80,97,116,104,70,105,110,100,101,114,78,41,3,90, - 18,105,109,112,111,114,116,108,105,98,46,109,101,116,97,100, - 97,116,97,114,78,1,0,0,218,18,102,105,110,100,95,100, - 105,115,116,114,105,98,117,116,105,111,110,115,41,3,114,131, - 0,0,0,114,132,0,0,0,114,78,1,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,79,1,0, - 0,122,5,0,0,115,6,0,0,0,12,10,16,1,255,128, - 122,29,80,97,116,104,70,105,110,100,101,114,46,102,105,110, - 100,95,100,105,115,116,114,105,98,117,116,105,111,110,115,41, - 1,78,41,2,78,78,41,1,78,41,14,114,137,0,0,0, - 114,136,0,0,0,114,138,0,0,0,114,139,0,0,0,114, - 220,0,0,0,114,64,1,0,0,114,70,1,0,0,114,221, - 0,0,0,114,73,1,0,0,114,74,1,0,0,114,77,1, - 0,0,114,214,0,0,0,114,217,0,0,0,114,79,1,0, - 0,114,7,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,63,1,0,0,245,4,0,0,115,38, - 0,0,0,8,0,4,2,2,2,10,1,2,9,10,1,2, - 12,10,1,2,21,10,1,2,14,12,1,2,31,12,1,2, - 23,12,1,2,12,14,1,255,128,114,63,1,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,64,0,0,0,115,90,0,0,0,101,0,90,1, - 100,0,90,2,100,1,90,3,100,2,100,3,132,0,90,4, - 100,4,100,5,132,0,90,5,101,6,90,7,100,6,100,7, - 132,0,90,8,100,8,100,9,132,0,90,9,100,19,100,11, - 100,12,132,1,90,10,100,13,100,14,132,0,90,11,101,12, - 100,15,100,16,132,0,131,1,90,13,100,17,100,18,132,0, - 90,14,100,10,83,0,41,20,218,10,70,105,108,101,70,105, - 110,100,101,114,122,172,70,105,108,101,45,98,97,115,101,100, - 32,102,105,110,100,101,114,46,10,10,32,32,32,32,73,110, - 116,101,114,97,99,116,105,111,110,115,32,119,105,116,104,32, - 116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,32, - 97,114,101,32,99,97,99,104,101,100,32,102,111,114,32,112, - 101,114,102,111,114,109,97,110,99,101,44,32,98,101,105,110, - 103,10,32,32,32,32,114,101,102,114,101,115,104,101,100,32, - 119,104,101,110,32,116,104,101,32,100,105,114,101,99,116,111, - 114,121,32,116,104,101,32,102,105,110,100,101,114,32,105,115, - 32,104,97,110,100,108,105,110,103,32,104,97,115,32,98,101, - 101,110,32,109,111,100,105,102,105,101,100,46,10,10,32,32, - 32,32,99,2,0,0,0,0,0,0,0,0,0,0,0,5, - 0,0,0,6,0,0,0,7,0,0,0,115,84,0,0,0, - 103,0,125,3,124,2,68,0,93,32,92,2,137,0,125,4, - 124,3,160,0,135,0,102,1,100,1,100,2,132,8,124,4, - 68,0,131,1,161,1,1,0,113,8,124,3,124,0,95,1, - 124,1,112,54,100,3,124,0,95,2,100,4,124,0,95,3, - 116,4,131,0,124,0,95,5,116,4,131,0,124,0,95,6, - 100,5,83,0,41,6,122,154,73,110,105,116,105,97,108,105, - 122,101,32,119,105,116,104,32,116,104,101,32,112,97,116,104, - 32,116,111,32,115,101,97,114,99,104,32,111,110,32,97,110, - 100,32,97,32,118,97,114,105,97,98,108,101,32,110,117,109, - 98,101,114,32,111,102,10,32,32,32,32,32,32,32,32,50, - 45,116,117,112,108,101,115,32,99,111,110,116,97,105,110,105, - 110,103,32,116,104,101,32,108,111,97,100,101,114,32,97,110, - 100,32,116,104,101,32,102,105,108,101,32,115,117,102,102,105, - 120,101,115,32,116,104,101,32,108,111,97,100,101,114,10,32, - 32,32,32,32,32,32,32,114,101,99,111,103,110,105,122,101, - 115,46,99,1,0,0,0,0,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,51,0,0,0,115,22,0,0,0, - 124,0,93,14,125,1,124,1,136,0,102,2,86,0,1,0, - 113,2,100,0,83,0,114,121,0,0,0,114,7,0,0,0, - 114,29,1,0,0,169,1,114,151,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,9,0,0,0,151,5,0,0,114, - 14,0,0,0,122,38,70,105,108,101,70,105,110,100,101,114, - 46,95,95,105,110,105,116,95,95,46,60,108,111,99,97,108, - 115,62,46,60,103,101,110,101,120,112,114,62,114,86,0,0, - 0,114,116,0,0,0,78,41,7,114,178,0,0,0,218,8, - 95,108,111,97,100,101,114,115,114,58,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,130,0,0,0,114,58,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,200,0,0,0,114,7,0,0,0, - 114,81,1,0,0,114,8,0,0,0,114,223,0,0,0,145, - 5,0,0,115,18,0,0,0,4,4,12,1,26,1,6,1, - 10,2,6,1,8,1,12,1,255,128,122,19,70,105,108,101, - 70,105,110,100,101,114,46,95,95,105,110,105,116,95,95,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 2,0,0,0,67,0,0,0,115,10,0,0,0,100,1,124, - 0,95,0,100,2,83,0,41,3,122,31,73,110,118,97,108, - 105,100,97,116,101,32,116,104,101,32,100,105,114,101,99,116, - 111,114,121,32,109,116,105,109,101,46,114,116,0,0,0,78, - 41,1,114,83,1,0,0,114,8,1,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,114,64,1,0,0, - 159,5,0,0,114,69,0,0,0,122,28,70,105,108,101,70, - 105,110,100,101,114,46,105,110,118,97,108,105,100,97,116,101, - 95,99,97,99,104,101,115,99,2,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, - 115,42,0,0,0,124,0,160,0,124,1,161,1,125,2,124, - 2,100,1,117,0,114,26,100,1,103,0,102,2,83,0,124, - 2,106,1,124,2,106,2,112,38,103,0,102,2,83,0,41, - 2,122,197,84,114,121,32,116,111,32,102,105,110,100,32,97, - 32,108,111,97,100,101,114,32,102,111,114,32,116,104,101,32, - 115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,101, - 44,32,111,114,32,116,104,101,32,110,97,109,101,115,112,97, - 99,101,10,32,32,32,32,32,32,32,32,112,97,99,107,97, - 103,101,32,112,111,114,116,105,111,110,115,46,32,82,101,116, - 117,114,110,115,32,40,108,111,97,100,101,114,44,32,108,105, - 115,116,45,111,102,45,112,111,114,116,105,111,110,115,41,46, - 10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,109, - 101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,97, - 116,101,100,46,32,32,85,115,101,32,102,105,110,100,95,115, - 112,101,99,40,41,32,105,110,115,116,101,97,100,46,10,10, - 32,32,32,32,32,32,32,32,78,41,3,114,214,0,0,0, - 114,151,0,0,0,114,189,0,0,0,41,3,114,130,0,0, - 0,114,150,0,0,0,114,198,0,0,0,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,114,148,0,0,0,165, - 5,0,0,115,10,0,0,0,10,7,8,1,8,1,16,1, - 255,128,122,22,70,105,108,101,70,105,110,100,101,114,46,102, - 105,110,100,95,108,111,97,100,101,114,99,6,0,0,0,0, - 0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,67, - 0,0,0,115,26,0,0,0,124,1,124,2,124,3,131,2, - 125,6,116,0,124,2,124,3,124,6,124,4,100,1,141,4, - 83,0,41,2,78,114,188,0,0,0,41,1,114,201,0,0, - 0,41,7,114,130,0,0,0,114,199,0,0,0,114,150,0, - 0,0,114,58,0,0,0,90,4,115,109,115,108,114,213,0, - 0,0,114,151,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,77,1,0,0,177,5,0,0,115, - 10,0,0,0,10,1,8,1,2,1,6,255,255,128,122,20, - 70,105,108,101,70,105,110,100,101,114,46,95,103,101,116,95, - 115,112,101,99,78,99,3,0,0,0,0,0,0,0,0,0, - 0,0,14,0,0,0,8,0,0,0,67,0,0,0,115,100, - 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,20,4, - 0,116,6,144,1,121,98,1,0,1,0,1,0,100,4,125, - 5,89,0,124,5,124,0,106,7,107,3,114,88,124,0,160, - 8,161,0,1,0,124,5,124,0,95,7,116,9,131,0,114, - 110,124,0,106,10,125,6,124,4,160,11,161,0,125,7,110, - 10,124,0,106,12,125,6,124,4,125,7,124,7,124,6,118, - 0,114,214,116,13,124,0,106,2,124,4,131,2,125,8,124, - 0,106,14,68,0,93,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,204,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, - 146,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,118, - 0,144,1,114,50,116,15,124,12,131,1,144,1,114,50,124, - 0,160,16,124,10,124,1,124,12,100,8,124,2,161,5,2, - 0,1,0,83,0,113,220,124,3,144,1,114,94,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,119,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,86,0,0,0, - 114,45,0,0,0,114,116,0,0,0,114,223,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,55,0,0,0,114,63,0,0,0,114, - 58,0,0,0,114,19,0,0,0,114,70,0,0,0,114,22, - 1,0,0,114,64,0,0,0,114,83,1,0,0,218,11,95, - 102,105,108,108,95,99,97,99,104,101,114,22,0,0,0,114, - 86,1,0,0,114,117,0,0,0,114,85,1,0,0,114,54, - 0,0,0,114,82,1,0,0,114,68,0,0,0,114,77,1, - 0,0,114,71,0,0,0,114,146,0,0,0,114,160,0,0, - 0,114,194,0,0,0,114,189,0,0,0,41,14,114,130,0, - 0,0,114,150,0,0,0,114,213,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,180,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,30,1,0, - 0,114,199,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,198,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,114,214,0,0,0,182,5,0,0,115,80,0, - 0,0,4,5,14,1,2,1,24,1,14,1,6,1,10,1, - 8,1,6,1,6,2,6,1,10,1,6,2,4,1,8,2, - 12,1,14,1,8,1,10,1,8,1,24,1,2,255,8,5, - 14,2,16,1,16,1,14,1,10,1,10,1,4,1,8,255, - 2,128,6,2,12,1,12,1,8,1,4,1,4,1,2,219, - 255,128,122,20,70,105,108,101,70,105,110,100,101,114,46,102, - 105,110,100,95,115,112,101,99,99,1,0,0,0,0,0,0, - 0,0,0,0,0,9,0,0,0,10,0,0,0,67,0,0, - 0,115,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,24,4,0,116,4,116,5,116,6,102,3,121,188, - 1,0,1,0,1,0,103,0,125,2,89,0,116,7,106,8, - 160,9,100,1,161,1,115,78,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,130,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,88,124,3,124,0,95,11,116,7, - 106,8,160,9,116,16,161,1,114,184,100,4,100,5,132,0, - 124,2,68,0,131,1,124,0,95,17,100,6,83,0,100,6, - 83,0,119,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,15,0,0, - 0,114,86,0,0,0,114,76,0,0,0,99,1,0,0,0, + 114,8,0,0,0,114,193,0,0,0,213,4,0,0,243,4, + 0,0,0,4,1,255,128,122,27,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,46,105,115,95,112,97,99, + 107,97,103,101,99,2,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,1,0,0,0,67,0,0,0,114,24,0, + 0,0,41,2,78,114,10,0,0,0,114,7,0,0,0,114, + 234,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, + 0,0,0,114,244,0,0,0,216,4,0,0,114,61,1,0, + 0,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97, + 100,101,114,46,103,101,116,95,115,111,117,114,99,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,6, + 0,0,0,67,0,0,0,115,16,0,0,0,116,0,100,1, + 100,2,100,3,100,4,100,5,141,4,83,0,41,6,78,114, + 10,0,0,0,122,8,60,115,116,114,105,110,103,62,114,230, + 0,0,0,84,41,1,114,246,0,0,0,41,1,114,247,0, + 0,0,114,234,0,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,228,0,0,0,219,4,0,0,114, + 58,1,0,0,122,25,95,78,97,109,101,115,112,97,99,101, + 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,99, + 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,114,24,0,0,0,114,224,0, + 0,0,114,7,0,0,0,114,225,0,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,114,226,0,0,0, + 222,4,0,0,114,227,0,0,0,122,30,95,78,97,109,101, + 115,112,97,99,101,76,111,97,100,101,114,46,99,114,101,97, + 116,101,95,109,111,100,117,108,101,99,2,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,115,4,0,0,0,100,0,83,0,114,121,0,0,0, + 114,7,0,0,0,114,28,1,0,0,114,7,0,0,0,114, + 7,0,0,0,114,8,0,0,0,114,232,0,0,0,225,4, + 0,0,114,61,1,0,0,122,28,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,46,101,120,101,99,95,109, + 111,100,117,108,101,99,2,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,26, + 0,0,0,116,0,160,1,100,1,124,0,106,2,161,2,1, + 0,116,0,160,3,124,0,124,1,161,2,83,0,41,3,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,78,41,4,114,146, + 0,0,0,114,160,0,0,0,114,35,1,0,0,114,233,0, + 0,0,114,234,0,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,235,0,0,0,228,4,0,0,115, + 10,0,0,0,6,7,4,1,4,255,12,3,255,128,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,99,2,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0, + 0,67,0,0,0,115,22,0,0,0,100,1,100,2,108,0, + 109,1,125,2,1,0,124,2,124,0,106,2,131,1,83,0, + 41,3,78,114,0,0,0,0,41,1,218,15,78,97,109,101, + 115,112,97,99,101,82,101,97,100,101,114,41,3,114,19,1, + 0,0,114,62,1,0,0,114,35,1,0,0,41,3,114,130, + 0,0,0,114,231,0,0,0,114,62,1,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,20,1,0, + 0,240,4,0,0,115,6,0,0,0,12,1,10,1,255,128, + 122,36,95,78,97,109,101,115,112,97,99,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,78,41,13,114,137,0,0,0,114,136, + 0,0,0,114,138,0,0,0,114,223,0,0,0,114,220,0, + 0,0,114,60,1,0,0,114,193,0,0,0,114,244,0,0, + 0,114,228,0,0,0,114,226,0,0,0,114,232,0,0,0, + 114,235,0,0,0,114,20,1,0,0,114,7,0,0,0,114, + 7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,59, + 1,0,0,198,4,0,0,115,24,0,0,0,8,0,8,1, + 2,3,10,1,8,10,8,3,8,3,8,3,8,3,8,3, + 12,12,255,128,114,59,1,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,4,0,0,0,64,0, + 0,0,115,118,0,0,0,101,0,90,1,100,0,90,2,100, + 1,90,3,101,4,100,2,100,3,132,0,131,1,90,5,101, + 4,100,4,100,5,132,0,131,1,90,6,101,7,100,6,100, + 7,132,0,131,1,90,8,101,7,100,8,100,9,132,0,131, + 1,90,9,101,7,100,19,100,11,100,12,132,1,131,1,90, + 10,101,7,100,20,100,13,100,14,132,1,131,1,90,11,101, + 7,100,21,100,15,100,16,132,1,131,1,90,12,101,4,100, + 17,100,18,132,0,131,1,90,13,100,10,83,0,41,22,218, + 10,80,97,116,104,70,105,110,100,101,114,122,62,77,101,116, + 97,32,112,97,116,104,32,102,105,110,100,101,114,32,102,111, + 114,32,115,121,115,46,112,97,116,104,32,97,110,100,32,112, + 97,99,107,97,103,101,32,95,95,112,97,116,104,95,95,32, + 97,116,116,114,105,98,117,116,101,115,46,99,0,0,0,0, 0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,125, - 1,124,1,160,0,161,0,146,2,113,4,83,0,114,7,0, - 0,0,41,1,114,117,0,0,0,41,2,114,5,0,0,0, - 90,2,102,110,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,13,0,0,0,3,6,0,0,115,4,0,0, - 0,20,0,255,128,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,58,0,0,0,114,19,0,0,0,90,7,108, - 105,115,116,100,105,114,114,70,0,0,0,114,71,1,0,0, - 218,15,80,101,114,109,105,115,115,105,111,110,69,114,114,111, - 114,218,18,78,111,116,65,68,105,114,101,99,116,111,114,121, - 69,114,114,111,114,114,16,0,0,0,114,26,0,0,0,114, - 27,0,0,0,114,84,1,0,0,114,85,1,0,0,114,112, - 0,0,0,114,77,0,0,0,114,117,0,0,0,218,3,97, - 100,100,114,28,0,0,0,114,86,1,0,0,41,9,114,130, - 0,0,0,114,58,0,0,0,90,8,99,111,110,116,101,110, - 116,115,90,21,108,111,119,101,114,95,115,117,102,102,105,120, - 95,99,111,110,116,101,110,116,115,114,56,1,0,0,114,128, - 0,0,0,114,40,1,0,0,114,30,1,0,0,90,8,110, - 101,119,95,110,97,109,101,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,88,1,0,0,230,5,0,0,115, - 40,0,0,0,6,2,2,1,22,1,18,1,6,3,12,3, - 12,1,6,7,8,1,16,1,4,1,18,1,4,2,12,1, - 6,1,12,1,20,1,4,255,2,233,255,128,122,22,70,105, - 108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,99, - 97,99,104,101,99,1,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,7,0,0,0,115,18,0, - 0,0,135,0,135,1,102,2,100,1,100,2,132,8,125,2, - 124,2,83,0,41,4,97,20,1,0,0,65,32,99,108,97, - 115,115,32,109,101,116,104,111,100,32,119,104,105,99,104,32, - 114,101,116,117,114,110,115,32,97,32,99,108,111,115,117,114, - 101,32,116,111,32,117,115,101,32,111,110,32,115,121,115,46, - 112,97,116,104,95,104,111,111,107,10,32,32,32,32,32,32, - 32,32,119,104,105,99,104,32,119,105,108,108,32,114,101,116, - 117,114,110,32,97,110,32,105,110,115,116,97,110,99,101,32, - 117,115,105,110,103,32,116,104,101,32,115,112,101,99,105,102, - 105,101,100,32,108,111,97,100,101,114,115,32,97,110,100,32, - 116,104,101,32,112,97,116,104,10,32,32,32,32,32,32,32, - 32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,99, - 108,111,115,117,114,101,46,10,10,32,32,32,32,32,32,32, - 32,73,102,32,116,104,101,32,112,97,116,104,32,99,97,108, - 108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,117, - 114,101,32,105,115,32,110,111,116,32,97,32,100,105,114,101, - 99,116,111,114,121,44,32,73,109,112,111,114,116,69,114,114, - 111,114,32,105,115,10,32,32,32,32,32,32,32,32,114,97, - 105,115,101,100,46,10,10,32,32,32,32,32,32,32,32,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 4,0,0,0,19,0,0,0,115,36,0,0,0,116,0,124, - 0,131,1,115,20,116,1,100,1,124,0,100,2,141,2,130, - 1,136,0,124,0,103,1,136,1,162,1,82,0,142,0,83, - 0,41,4,122,45,80,97,116,104,32,104,111,111,107,32,102, - 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, - 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, - 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, - 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, - 101,100,114,62,0,0,0,78,41,2,114,71,0,0,0,114, - 129,0,0,0,114,62,0,0,0,169,2,114,209,0,0,0, - 114,87,1,0,0,114,7,0,0,0,114,8,0,0,0,218, - 24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, - 105,108,101,70,105,110,100,101,114,15,6,0,0,115,8,0, - 0,0,8,2,12,1,16,1,255,128,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,78,114,7,0,0,0,41,3,114,209,0,0,0,114, - 87,1,0,0,114,93,1,0,0,114,7,0,0,0,114,92, - 1,0,0,114,8,0,0,0,218,9,112,97,116,104,95,104, - 111,111,107,5,6,0,0,115,6,0,0,0,14,10,4,6, - 255,128,122,20,70,105,108,101,70,105,110,100,101,114,46,112, - 97,116,104,95,104,111,111,107,99,1,0,0,0,0,0,0, - 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, - 0,114,53,1,0,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,77,0, - 0,0,114,58,0,0,0,114,8,1,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,114,54,1,0,0, - 23,6,0,0,114,47,1,0,0,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,137,0,0,0,114,136,0,0,0,114,138,0, - 0,0,114,139,0,0,0,114,223,0,0,0,114,64,1,0, - 0,114,154,0,0,0,114,217,0,0,0,114,148,0,0,0, - 114,77,1,0,0,114,214,0,0,0,114,88,1,0,0,114, - 221,0,0,0,114,94,1,0,0,114,54,1,0,0,114,7, - 0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,80,1,0,0,136,5,0,0,115,26,0,0,0, - 8,0,4,2,8,7,8,14,4,4,8,2,8,12,10,5, - 8,48,2,31,10,1,12,17,255,128,114,80,1,0,0,99, - 4,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, - 8,0,0,0,67,0,0,0,115,144,0,0,0,124,0,160, - 0,100,1,161,1,125,4,124,0,160,0,100,2,161,1,125, - 5,124,4,115,66,124,5,114,36,124,5,106,1,125,4,110, - 30,124,2,124,3,107,2,114,56,116,2,124,1,124,2,131, - 2,125,4,110,10,116,3,124,1,124,2,131,2,125,4,124, - 5,115,84,116,4,124,1,124,2,124,4,100,3,141,3,125, - 5,122,38,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,100,0,83,0,4,0,116,5,121,142,1, - 0,1,0,1,0,89,0,100,0,83,0,119,0,41,6,78, - 218,10,95,95,108,111,97,100,101,114,95,95,218,8,95,95, - 115,112,101,99,95,95,114,81,1,0,0,90,8,95,95,102, - 105,108,101,95,95,90,10,95,95,99,97,99,104,101,100,95, - 95,41,6,218,3,103,101,116,114,151,0,0,0,114,27,1, - 0,0,114,21,1,0,0,114,201,0,0,0,218,9,69,120, - 99,101,112,116,105,111,110,41,6,90,2,110,115,114,128,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,151,0,0,0,114,198,0,0, - 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 218,14,95,102,105,120,95,117,112,95,109,111,100,117,108,101, - 29,6,0,0,115,38,0,0,0,10,2,10,1,4,1,4, - 1,8,1,8,1,12,1,10,2,4,1,14,1,2,1,8, - 1,8,1,8,1,14,1,12,1,6,2,2,254,255,128,114, - 99,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0, - 0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,3, - 116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,0, - 124,1,124,2,103,3,83,0,41,2,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,78,41,7,114,17, - 1,0,0,114,174,0,0,0,218,18,101,120,116,101,110,115, - 105,111,110,95,115,117,102,102,105,120,101,115,114,21,1,0, - 0,114,113,0,0,0,114,27,1,0,0,114,101,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, + 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,0,125,1,124, + 1,100,1,117,0,114,40,116,1,106,2,124,0,61,0,113, + 14,116,4,124,1,100,2,131,2,114,58,124,1,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,16,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,140,0,0,0,114,64,1,0, + 0,41,2,114,128,0,0,0,218,6,102,105,110,100,101,114, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 195,0,0,0,52,6,0,0,115,10,0,0,0,12,5,8, - 1,8,1,10,1,255,128,114,195,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0, - 0,67,0,0,0,115,8,0,0,0,124,0,97,0,100,0, - 83,0,114,121,0,0,0,41,1,114,146,0,0,0,41,1, - 218,17,95,98,111,111,116,115,116,114,97,112,95,109,111,100, - 117,108,101,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,218,21,95,115,101,116,95,98,111,111,116,115,116,114, - 97,112,95,109,111,100,117,108,101,63,6,0,0,115,4,0, - 0,0,8,2,255,128,114,102,1,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 67,0,0,0,115,50,0,0,0,116,0,124,0,131,1,1, - 0,116,1,131,0,125,1,116,2,106,3,160,4,116,5,106, - 6,124,1,142,0,103,1,161,1,1,0,116,2,106,7,160, - 8,116,9,161,1,1,0,100,1,83,0,41,2,122,41,73, - 110,115,116,97,108,108,32,116,104,101,32,112,97,116,104,45, - 98,97,115,101,100,32,105,109,112,111,114,116,32,99,111,109, - 112,111,110,101,110,116,115,46,78,41,10,114,102,1,0,0, - 114,195,0,0,0,114,16,0,0,0,114,69,1,0,0,114, - 178,0,0,0,114,80,1,0,0,114,94,1,0,0,218,9, - 109,101,116,97,95,112,97,116,104,114,197,0,0,0,114,63, - 1,0,0,41,2,114,101,1,0,0,90,17,115,117,112,112, - 111,114,116,101,100,95,108,111,97,100,101,114,115,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,218,8,95,105, - 110,115,116,97,108,108,68,6,0,0,115,10,0,0,0,8, - 2,6,1,20,1,16,1,255,128,114,104,1,0,0,41,1, - 114,75,0,0,0,41,1,78,41,3,78,78,78,41,2,114, - 0,0,0,0,114,0,0,0,0,41,1,84,41,1,78,41, - 1,78,41,83,114,139,0,0,0,114,146,0,0,0,114,174, - 0,0,0,114,79,0,0,0,114,16,0,0,0,114,88,0, - 0,0,114,171,0,0,0,114,26,0,0,0,114,218,0,0, - 0,90,2,110,116,114,19,0,0,0,114,203,0,0,0,90, - 5,112,111,115,105,120,114,48,0,0,0,218,3,97,108,108, - 114,51,0,0,0,114,52,0,0,0,114,73,0,0,0,114, - 29,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,28,0,0,0, - 114,30,0,0,0,114,22,0,0,0,114,37,0,0,0,114, - 43,0,0,0,114,46,0,0,0,114,54,0,0,0,114,61, - 0,0,0,114,63,0,0,0,114,67,0,0,0,114,68,0, - 0,0,114,71,0,0,0,114,74,0,0,0,114,84,0,0, - 0,218,4,116,121,112,101,218,8,95,95,99,111,100,101,95, - 95,114,173,0,0,0,114,35,0,0,0,114,159,0,0,0, - 114,34,0,0,0,114,40,0,0,0,114,251,0,0,0,114, - 104,0,0,0,114,100,0,0,0,114,113,0,0,0,114,197, - 0,0,0,114,100,1,0,0,114,219,0,0,0,114,101,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,109,0,0,0,114,114,0, - 0,0,114,120,0,0,0,114,124,0,0,0,114,126,0,0, - 0,114,147,0,0,0,114,154,0,0,0,114,163,0,0,0, - 114,167,0,0,0,114,169,0,0,0,114,176,0,0,0,114, - 181,0,0,0,114,182,0,0,0,114,187,0,0,0,218,6, - 111,98,106,101,99,116,114,196,0,0,0,114,201,0,0,0, - 114,202,0,0,0,114,222,0,0,0,114,236,0,0,0,114, - 254,0,0,0,114,21,1,0,0,114,27,1,0,0,114,17, - 1,0,0,114,33,1,0,0,114,59,1,0,0,114,63,1, - 0,0,114,80,1,0,0,114,99,1,0,0,114,195,0,0, - 0,114,102,1,0,0,114,104,1,0,0,114,7,0,0,0, - 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,218, - 8,60,109,111,100,117,108,101,62,1,0,0,0,115,172,0, - 0,0,4,0,4,22,8,3,8,1,8,1,8,1,8,1, - 10,3,4,1,8,1,10,1,8,2,4,3,10,1,6,2, - 22,2,8,1,10,1,14,1,4,4,4,1,2,1,2,1, - 4,255,8,4,6,16,8,3,8,5,8,5,8,6,8,6, - 8,12,8,10,8,9,8,5,8,7,10,9,10,22,0,127, - 16,25,12,1,4,2,4,1,6,2,6,1,10,1,8,2, - 6,2,8,2,16,2,8,71,8,40,8,19,8,12,8,12, - 8,31,8,17,8,33,8,28,10,24,10,13,10,10,8,11, - 6,14,4,3,2,1,12,255,14,68,14,64,16,30,0,127, - 14,17,18,50,18,45,18,25,14,53,14,63,14,47,0,127, - 14,20,0,127,10,22,8,23,8,11,12,5,255,128, + 64,1,0,0,251,4,0,0,115,16,0,0,0,22,4,8, + 1,10,1,10,1,8,1,2,128,4,252,255,128,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,1,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,9,0,0,0, + 67,0,0,0,115,76,0,0,0,116,0,106,1,100,1,117, + 1,114,28,116,0,106,1,115,28,116,2,160,3,100,2,116, + 4,161,2,1,0,116,0,106,1,68,0,93,34,125,1,122, + 14,124,1,124,0,131,1,87,0,2,0,1,0,83,0,4, + 0,116,5,121,74,1,0,1,0,1,0,89,0,113,34,100, + 1,83,0,119,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,16,0,0,0,218,10,112,97,116,104,95,104, + 111,111,107,115,114,88,0,0,0,114,89,0,0,0,114,149, + 0,0,0,114,129,0,0,0,41,2,114,58,0,0,0,90, + 4,104,111,111,107,114,7,0,0,0,114,7,0,0,0,114, + 8,0,0,0,218,11,95,112,97,116,104,95,104,111,111,107, + 115,5,5,0,0,115,20,0,0,0,16,3,12,1,10,1, + 2,1,14,1,12,1,4,1,4,2,2,253,255,128,122,22, + 80,97,116,104,70,105,110,100,101,114,46,95,112,97,116,104, + 95,104,111,111,107,115,99,2,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,8,0,0,0,67,0,0,0,115, + 100,0,0,0,124,1,100,1,107,2,114,40,122,12,116,0, + 160,1,161,0,125,1,87,0,110,18,4,0,116,2,121,98, + 1,0,1,0,1,0,89,0,100,2,83,0,122,16,116,3, + 106,4,124,1,25,0,125,2,87,0,124,2,83,0,4,0, + 116,5,121,96,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, + 124,2,83,0,119,0,119,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,10, + 0,0,0,78,41,7,114,19,0,0,0,114,70,0,0,0, + 218,17,70,105,108,101,78,111,116,70,111,117,110,100,69,114, + 114,111,114,114,16,0,0,0,114,66,1,0,0,218,8,75, + 101,121,69,114,114,111,114,114,70,1,0,0,41,3,114,209, + 0,0,0,114,58,0,0,0,114,68,1,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,218,20,95,112, + 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, + 104,101,18,5,0,0,115,30,0,0,0,8,8,2,1,12, + 1,12,1,6,3,2,1,12,1,4,4,12,253,10,1,12, + 1,4,1,2,253,2,250,255,128,122,31,80,97,116,104,70, + 105,110,100,101,114,46,95,112,97,116,104,95,105,109,112,111, + 114,116,101,114,95,99,97,99,104,101,99,3,0,0,0,0, + 0,0,0,0,0,0,0,6,0,0,0,4,0,0,0,67, + 0,0,0,115,82,0,0,0,116,0,124,2,100,1,131,2, + 114,26,124,2,160,1,124,1,161,1,92,2,125,3,125,4, + 110,14,124,2,160,2,124,1,161,1,125,3,103,0,125,4, + 124,3,100,0,117,1,114,60,116,3,160,4,124,1,124,3, + 161,2,83,0,116,3,160,5,124,1,100,0,161,2,125,5, + 124,4,124,5,95,6,124,5,83,0,41,2,78,114,148,0, + 0,0,41,7,114,140,0,0,0,114,148,0,0,0,114,217, + 0,0,0,114,146,0,0,0,114,212,0,0,0,114,194,0, + 0,0,114,189,0,0,0,41,6,114,209,0,0,0,114,150, + 0,0,0,114,68,1,0,0,114,151,0,0,0,114,152,0, + 0,0,114,198,0,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,218,16,95,108,101,103,97,99,121,95, + 103,101,116,95,115,112,101,99,40,5,0,0,115,20,0,0, + 0,10,4,16,1,10,2,4,1,8,1,12,1,12,1,6, + 1,4,1,255,128,122,27,80,97,116,104,70,105,110,100,101, + 114,46,95,108,101,103,97,99,121,95,103,101,116,95,115,112, + 101,99,78,99,4,0,0,0,0,0,0,0,0,0,0,0, + 9,0,0,0,5,0,0,0,67,0,0,0,115,166,0,0, + 0,103,0,125,4,124,2,68,0,93,134,125,5,116,0,124, + 5,116,1,116,2,102,2,131,2,115,28,113,8,124,0,160, + 3,124,5,161,1,125,6,124,6,100,1,117,1,114,142,116, + 4,124,6,100,2,131,2,114,70,124,6,160,5,124,1,124, + 3,161,2,125,7,110,12,124,0,160,6,124,1,124,6,161, + 2,125,7,124,7,100,1,117,0,114,92,113,8,124,7,106, + 7,100,1,117,1,114,110,124,7,2,0,1,0,83,0,124, + 7,106,8,125,8,124,8,100,1,117,0,114,132,116,9,100, + 3,131,1,130,1,124,4,160,10,124,8,161,1,1,0,113, + 8,116,11,160,12,124,1,100,1,161,2,125,7,124,4,124, + 7,95,8,124,7,83,0,41,4,122,63,70,105,110,100,32, + 116,104,101,32,108,111,97,100,101,114,32,111,114,32,110,97, + 109,101,115,112,97,99,101,95,112,97,116,104,32,102,111,114, + 32,116,104,105,115,32,109,111,100,117,108,101,47,112,97,99, + 107,97,103,101,32,110,97,109,101,46,78,114,214,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,172,0,0,0,114,97,0,0, + 0,218,5,98,121,116,101,115,114,73,1,0,0,114,140,0, + 0,0,114,214,0,0,0,114,74,1,0,0,114,151,0,0, + 0,114,189,0,0,0,114,129,0,0,0,114,178,0,0,0, + 114,146,0,0,0,114,194,0,0,0,41,9,114,209,0,0, + 0,114,150,0,0,0,114,58,0,0,0,114,213,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,68,1,0,0,114,198,0,0, + 0,114,152,0,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,218,9,95,103,101,116,95,115,112,101,99, + 55,5,0,0,115,44,0,0,0,4,5,8,1,14,1,2, + 1,10,1,8,1,10,1,14,1,12,2,8,1,2,1,10, + 1,8,1,6,1,8,1,8,1,10,5,2,128,12,2,6, + 1,4,1,255,128,122,20,80,97,116,104,70,105,110,100,101, + 114,46,95,103,101,116,95,115,112,101,99,99,4,0,0,0, + 0,0,0,0,0,0,0,0,6,0,0,0,5,0,0,0, + 67,0,0,0,115,94,0,0,0,124,2,100,1,117,0,114, + 14,116,0,106,1,125,2,124,0,160,2,124,1,124,2,124, + 3,161,3,125,4,124,4,100,1,117,0,114,40,100,1,83, + 0,124,4,106,3,100,1,117,0,114,90,124,4,106,4,125, + 5,124,5,114,86,100,1,124,4,95,5,116,6,124,1,124, + 5,124,0,106,2,131,3,124,4,95,4,124,4,83,0,100, + 1,83,0,124,4,83,0,41,2,122,141,84,114,121,32,116, + 111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,111, + 114,32,39,102,117,108,108,110,97,109,101,39,32,111,110,32, + 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, + 104,39,46,10,10,32,32,32,32,32,32,32,32,84,104,101, + 32,115,101,97,114,99,104,32,105,115,32,98,97,115,101,100, + 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111, + 107,115,32,97,110,100,32,115,121,115,46,112,97,116,104,95, + 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, + 32,32,32,32,32,32,32,32,78,41,7,114,16,0,0,0, + 114,58,0,0,0,114,77,1,0,0,114,151,0,0,0,114, + 189,0,0,0,114,192,0,0,0,114,33,1,0,0,41,6, + 114,209,0,0,0,114,150,0,0,0,114,58,0,0,0,114, + 213,0,0,0,114,198,0,0,0,114,76,1,0,0,114,7, + 0,0,0,114,7,0,0,0,114,8,0,0,0,114,214,0, + 0,0,87,5,0,0,115,28,0,0,0,8,6,6,1,14, + 1,8,1,4,1,10,1,6,1,4,1,6,3,16,1,4, + 1,4,2,4,2,255,128,122,20,80,97,116,104,70,105,110, + 100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, + 0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0, + 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, + 1,124,2,161,2,125,3,124,3,100,1,117,0,114,24,100, + 1,83,0,124,3,106,1,83,0,41,2,122,170,102,105,110, + 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32, + 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, + 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46, + 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32, + 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95, + 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, + 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, + 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, + 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, + 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, + 32,32,32,32,32,32,32,78,114,215,0,0,0,114,216,0, + 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, + 0,114,217,0,0,0,111,5,0,0,115,10,0,0,0,12, + 8,8,1,4,1,6,1,255,128,122,22,80,97,116,104,70, + 105,110,100,101,114,46,102,105,110,100,95,109,111,100,117,108, + 101,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,4,0,0,0,79,0,0,0,115,28,0,0,0,100, + 1,100,2,108,0,109,1,125,2,1,0,124,2,106,2,124, + 0,105,0,124,1,164,1,142,1,83,0,41,4,97,32,1, + 0,0,10,32,32,32,32,32,32,32,32,70,105,110,100,32, + 100,105,115,116,114,105,98,117,116,105,111,110,115,46,10,10, + 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,97, + 110,32,105,116,101,114,97,98,108,101,32,111,102,32,97,108, + 108,32,68,105,115,116,114,105,98,117,116,105,111,110,32,105, + 110,115,116,97,110,99,101,115,32,99,97,112,97,98,108,101, + 32,111,102,10,32,32,32,32,32,32,32,32,108,111,97,100, + 105,110,103,32,116,104,101,32,109,101,116,97,100,97,116,97, + 32,102,111,114,32,112,97,99,107,97,103,101,115,32,109,97, + 116,99,104,105,110,103,32,96,96,99,111,110,116,101,120,116, + 46,110,97,109,101,96,96,10,32,32,32,32,32,32,32,32, + 40,111,114,32,97,108,108,32,110,97,109,101,115,32,105,102, + 32,96,96,78,111,110,101,96,96,32,105,110,100,105,99,97, + 116,101,100,41,32,97,108,111,110,103,32,116,104,101,32,112, + 97,116,104,115,32,105,110,32,116,104,101,32,108,105,115,116, + 10,32,32,32,32,32,32,32,32,111,102,32,100,105,114,101, + 99,116,111,114,105,101,115,32,96,96,99,111,110,116,101,120, + 116,46,112,97,116,104,96,96,46,10,32,32,32,32,32,32, + 32,32,114,0,0,0,0,41,1,218,18,77,101,116,97,100, + 97,116,97,80,97,116,104,70,105,110,100,101,114,78,41,3, + 90,18,105,109,112,111,114,116,108,105,98,46,109,101,116,97, + 100,97,116,97,114,78,1,0,0,218,18,102,105,110,100,95, + 100,105,115,116,114,105,98,117,116,105,111,110,115,41,3,114, + 131,0,0,0,114,132,0,0,0,114,78,1,0,0,114,7, + 0,0,0,114,7,0,0,0,114,8,0,0,0,114,79,1, + 0,0,124,5,0,0,115,6,0,0,0,12,10,16,1,255, + 128,122,29,80,97,116,104,70,105,110,100,101,114,46,102,105, + 110,100,95,100,105,115,116,114,105,98,117,116,105,111,110,115, + 41,1,78,41,2,78,78,41,1,78,41,14,114,137,0,0, + 0,114,136,0,0,0,114,138,0,0,0,114,139,0,0,0, + 114,220,0,0,0,114,64,1,0,0,114,70,1,0,0,114, + 221,0,0,0,114,73,1,0,0,114,74,1,0,0,114,77, + 1,0,0,114,214,0,0,0,114,217,0,0,0,114,79,1, + 0,0,114,7,0,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,63,1,0,0,247,4,0,0,115, + 38,0,0,0,8,0,4,2,2,2,10,1,2,9,10,1, + 2,12,10,1,2,21,10,1,2,14,12,1,2,31,12,1, + 2,23,12,1,2,12,14,1,255,128,114,63,1,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,64,0,0,0,115,90,0,0,0,101,0,90, + 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, + 4,100,4,100,5,132,0,90,5,101,6,90,7,100,6,100, + 7,132,0,90,8,100,8,100,9,132,0,90,9,100,19,100, + 11,100,12,132,1,90,10,100,13,100,14,132,0,90,11,101, + 12,100,15,100,16,132,0,131,1,90,13,100,17,100,18,132, + 0,90,14,100,10,83,0,41,20,218,10,70,105,108,101,70, + 105,110,100,101,114,122,172,70,105,108,101,45,98,97,115,101, + 100,32,102,105,110,100,101,114,46,10,10,32,32,32,32,73, + 110,116,101,114,97,99,116,105,111,110,115,32,119,105,116,104, + 32,116,104,101,32,102,105,108,101,32,115,121,115,116,101,109, + 32,97,114,101,32,99,97,99,104,101,100,32,102,111,114,32, + 112,101,114,102,111,114,109,97,110,99,101,44,32,98,101,105, + 110,103,10,32,32,32,32,114,101,102,114,101,115,104,101,100, + 32,119,104,101,110,32,116,104,101,32,100,105,114,101,99,116, + 111,114,121,32,116,104,101,32,102,105,110,100,101,114,32,105, + 115,32,104,97,110,100,108,105,110,103,32,104,97,115,32,98, + 101,101,110,32,109,111,100,105,102,105,101,100,46,10,10,32, + 32,32,32,99,2,0,0,0,0,0,0,0,0,0,0,0, + 5,0,0,0,6,0,0,0,7,0,0,0,115,84,0,0, + 0,103,0,125,3,124,2,68,0,93,32,92,2,137,0,125, + 4,124,3,160,0,135,0,102,1,100,1,100,2,132,8,124, + 4,68,0,131,1,161,1,1,0,113,8,124,3,124,0,95, + 1,124,1,112,54,100,3,124,0,95,2,100,4,124,0,95, + 3,116,4,131,0,124,0,95,5,116,4,131,0,124,0,95, + 6,100,5,83,0,41,6,122,154,73,110,105,116,105,97,108, + 105,122,101,32,119,105,116,104,32,116,104,101,32,112,97,116, + 104,32,116,111,32,115,101,97,114,99,104,32,111,110,32,97, + 110,100,32,97,32,118,97,114,105,97,98,108,101,32,110,117, + 109,98,101,114,32,111,102,10,32,32,32,32,32,32,32,32, + 50,45,116,117,112,108,101,115,32,99,111,110,116,97,105,110, + 105,110,103,32,116,104,101,32,108,111,97,100,101,114,32,97, + 110,100,32,116,104,101,32,102,105,108,101,32,115,117,102,102, + 105,120,101,115,32,116,104,101,32,108,111,97,100,101,114,10, + 32,32,32,32,32,32,32,32,114,101,99,111,103,110,105,122, + 101,115,46,99,1,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,51,0,0,0,115,22,0,0, + 0,124,0,93,14,125,1,124,1,136,0,102,2,86,0,1, + 0,113,2,100,0,83,0,114,121,0,0,0,114,7,0,0, + 0,114,29,1,0,0,169,1,114,151,0,0,0,114,7,0, + 0,0,114,8,0,0,0,114,9,0,0,0,153,5,0,0, + 114,14,0,0,0,122,38,70,105,108,101,70,105,110,100,101, + 114,46,95,95,105,110,105,116,95,95,46,60,108,111,99,97, + 108,115,62,46,60,103,101,110,101,120,112,114,62,114,86,0, + 0,0,114,116,0,0,0,78,41,7,114,178,0,0,0,218, + 8,95,108,111,97,100,101,114,115,114,58,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,130,0,0,0,114,58,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,200,0,0,0,114,7,0,0, + 0,114,81,1,0,0,114,8,0,0,0,114,223,0,0,0, + 147,5,0,0,115,18,0,0,0,4,4,12,1,26,1,6, + 1,10,2,6,1,8,1,12,1,255,128,122,19,70,105,108, + 101,70,105,110,100,101,114,46,95,95,105,110,105,116,95,95, + 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, + 0,2,0,0,0,67,0,0,0,115,10,0,0,0,100,1, + 124,0,95,0,100,2,83,0,41,3,122,31,73,110,118,97, + 108,105,100,97,116,101,32,116,104,101,32,100,105,114,101,99, + 116,111,114,121,32,109,116,105,109,101,46,114,116,0,0,0, + 78,41,1,114,83,1,0,0,114,8,1,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,64,1,0, + 0,161,5,0,0,114,69,0,0,0,122,28,70,105,108,101, + 70,105,110,100,101,114,46,105,110,118,97,108,105,100,97,116, + 101,95,99,97,99,104,101,115,99,2,0,0,0,0,0,0, + 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, + 0,115,42,0,0,0,124,0,160,0,124,1,161,1,125,2, + 124,2,100,1,117,0,114,26,100,1,103,0,102,2,83,0, + 124,2,106,1,124,2,106,2,112,38,103,0,102,2,83,0, + 41,2,122,197,84,114,121,32,116,111,32,102,105,110,100,32, + 97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,101, + 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108, + 101,44,32,111,114,32,116,104,101,32,110,97,109,101,115,112, + 97,99,101,10,32,32,32,32,32,32,32,32,112,97,99,107, + 97,103,101,32,112,111,114,116,105,111,110,115,46,32,82,101, + 116,117,114,110,115,32,40,108,111,97,100,101,114,44,32,108, + 105,115,116,45,111,102,45,112,111,114,116,105,111,110,115,41, + 46,10,10,32,32,32,32,32,32,32,32,84,104,105,115,32, + 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, + 97,116,101,100,46,32,32,85,115,101,32,102,105,110,100,95, + 115,112,101,99,40,41,32,105,110,115,116,101,97,100,46,10, + 10,32,32,32,32,32,32,32,32,78,41,3,114,214,0,0, + 0,114,151,0,0,0,114,189,0,0,0,41,3,114,130,0, + 0,0,114,150,0,0,0,114,198,0,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,114,148,0,0,0, + 167,5,0,0,115,10,0,0,0,10,7,8,1,8,1,16, + 1,255,128,122,22,70,105,108,101,70,105,110,100,101,114,46, + 102,105,110,100,95,108,111,97,100,101,114,99,6,0,0,0, + 0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0, + 67,0,0,0,115,26,0,0,0,124,1,124,2,124,3,131, + 2,125,6,116,0,124,2,124,3,124,6,124,4,100,1,141, + 4,83,0,41,2,78,114,188,0,0,0,41,1,114,201,0, + 0,0,41,7,114,130,0,0,0,114,199,0,0,0,114,150, + 0,0,0,114,58,0,0,0,90,4,115,109,115,108,114,213, + 0,0,0,114,151,0,0,0,114,7,0,0,0,114,7,0, + 0,0,114,8,0,0,0,114,77,1,0,0,179,5,0,0, + 115,10,0,0,0,10,1,8,1,2,1,6,255,255,128,122, + 20,70,105,108,101,70,105,110,100,101,114,46,95,103,101,116, + 95,115,112,101,99,78,99,3,0,0,0,0,0,0,0,0, + 0,0,0,14,0,0,0,8,0,0,0,67,0,0,0,115, + 100,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,20, + 4,0,116,6,144,1,121,98,1,0,1,0,1,0,100,4, + 125,5,89,0,124,5,124,0,106,7,107,3,114,88,124,0, + 160,8,161,0,1,0,124,5,124,0,95,7,116,9,131,0, + 114,110,124,0,106,10,125,6,124,4,160,11,161,0,125,7, + 110,10,124,0,106,12,125,6,124,4,125,7,124,7,124,6, + 118,0,114,214,116,13,124,0,106,2,124,4,131,2,125,8, + 124,0,106,14,68,0,93,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,204,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,146,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, + 118,0,144,1,114,50,116,15,124,12,131,1,144,1,114,50, + 124,0,160,16,124,10,124,1,124,12,100,8,124,2,161,5, + 2,0,1,0,83,0,113,220,124,3,144,1,114,94,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,119,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,86,0,0, + 0,114,45,0,0,0,114,116,0,0,0,114,223,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,55,0,0,0,114,63,0,0,0, + 114,58,0,0,0,114,19,0,0,0,114,70,0,0,0,114, + 22,1,0,0,114,64,0,0,0,114,83,1,0,0,218,11, + 95,102,105,108,108,95,99,97,99,104,101,114,22,0,0,0, + 114,86,1,0,0,114,117,0,0,0,114,85,1,0,0,114, + 54,0,0,0,114,82,1,0,0,114,68,0,0,0,114,77, + 1,0,0,114,71,0,0,0,114,146,0,0,0,114,160,0, + 0,0,114,194,0,0,0,114,189,0,0,0,41,14,114,130, + 0,0,0,114,150,0,0,0,114,213,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,180,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,30,1, + 0,0,114,199,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,198,0,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,214,0,0,0,184,5,0,0,115,80, + 0,0,0,4,5,14,1,2,1,24,1,14,1,6,1,10, + 1,8,1,6,1,6,2,6,1,10,1,6,2,4,1,8, + 2,12,1,14,1,8,1,10,1,8,1,24,1,2,255,8, + 5,14,2,16,1,16,1,14,1,10,1,10,1,4,1,8, + 255,2,128,6,2,12,1,12,1,8,1,4,1,4,1,2, + 219,255,128,122,20,70,105,108,101,70,105,110,100,101,114,46, + 102,105,110,100,95,115,112,101,99,99,1,0,0,0,0,0, + 0,0,0,0,0,0,9,0,0,0,10,0,0,0,67,0, + 0,0,115,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,24,4,0,116,4,116,5,116,6,102,3,121, + 188,1,0,1,0,1,0,103,0,125,2,89,0,116,7,106, + 8,160,9,100,1,161,1,115,78,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,130,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,88,124,3,124,0,95,11,116, + 7,106,8,160,9,116,16,161,1,114,184,100,4,100,5,132, + 0,124,2,68,0,131,1,124,0,95,17,100,6,83,0,100, + 6,83,0,119,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,15,0, + 0,0,114,86,0,0,0,114,76,0,0,0,99,1,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0, + 0,83,0,0,0,115,20,0,0,0,104,0,124,0,93,12, + 125,1,124,1,160,0,161,0,146,2,113,4,83,0,114,7, + 0,0,0,41,1,114,117,0,0,0,41,2,114,5,0,0, + 0,90,2,102,110,114,7,0,0,0,114,7,0,0,0,114, + 8,0,0,0,114,13,0,0,0,5,6,0,0,115,4,0, + 0,0,20,0,255,128,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,58,0,0,0,114,19,0,0,0,90,7, + 108,105,115,116,100,105,114,114,70,0,0,0,114,71,1,0, + 0,218,15,80,101,114,109,105,115,115,105,111,110,69,114,114, + 111,114,218,18,78,111,116,65,68,105,114,101,99,116,111,114, + 121,69,114,114,111,114,114,16,0,0,0,114,26,0,0,0, + 114,27,0,0,0,114,84,1,0,0,114,85,1,0,0,114, + 112,0,0,0,114,77,0,0,0,114,117,0,0,0,218,3, + 97,100,100,114,28,0,0,0,114,86,1,0,0,41,9,114, + 130,0,0,0,114,58,0,0,0,90,8,99,111,110,116,101, + 110,116,115,90,21,108,111,119,101,114,95,115,117,102,102,105, + 120,95,99,111,110,116,101,110,116,115,114,56,1,0,0,114, + 128,0,0,0,114,40,1,0,0,114,30,1,0,0,90,8, + 110,101,119,95,110,97,109,101,114,7,0,0,0,114,7,0, + 0,0,114,8,0,0,0,114,88,1,0,0,232,5,0,0, + 115,40,0,0,0,6,2,2,1,22,1,18,1,6,3,12, + 3,12,1,6,7,8,1,16,1,4,1,18,1,4,2,12, + 1,6,1,12,1,20,1,4,255,2,233,255,128,122,22,70, + 105,108,101,70,105,110,100,101,114,46,95,102,105,108,108,95, + 99,97,99,104,101,99,1,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,7,0,0,0,115,18, + 0,0,0,135,0,135,1,102,2,100,1,100,2,132,8,125, + 2,124,2,83,0,41,4,97,20,1,0,0,65,32,99,108, + 97,115,115,32,109,101,116,104,111,100,32,119,104,105,99,104, + 32,114,101,116,117,114,110,115,32,97,32,99,108,111,115,117, + 114,101,32,116,111,32,117,115,101,32,111,110,32,115,121,115, + 46,112,97,116,104,95,104,111,111,107,10,32,32,32,32,32, + 32,32,32,119,104,105,99,104,32,119,105,108,108,32,114,101, + 116,117,114,110,32,97,110,32,105,110,115,116,97,110,99,101, + 32,117,115,105,110,103,32,116,104,101,32,115,112,101,99,105, + 102,105,101,100,32,108,111,97,100,101,114,115,32,97,110,100, + 32,116,104,101,32,112,97,116,104,10,32,32,32,32,32,32, + 32,32,99,97,108,108,101,100,32,111,110,32,116,104,101,32, + 99,108,111,115,117,114,101,46,10,10,32,32,32,32,32,32, + 32,32,73,102,32,116,104,101,32,112,97,116,104,32,99,97, + 108,108,101,100,32,111,110,32,116,104,101,32,99,108,111,115, + 117,114,101,32,105,115,32,110,111,116,32,97,32,100,105,114, + 101,99,116,111,114,121,44,32,73,109,112,111,114,116,69,114, + 114,111,114,32,105,115,10,32,32,32,32,32,32,32,32,114, + 97,105,115,101,100,46,10,10,32,32,32,32,32,32,32,32, + 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, + 0,4,0,0,0,19,0,0,0,115,36,0,0,0,116,0, + 124,0,131,1,115,20,116,1,100,1,124,0,100,2,141,2, + 130,1,136,0,124,0,103,1,136,1,162,1,82,0,142,0, + 83,0,41,4,122,45,80,97,116,104,32,104,111,111,107,32, + 102,111,114,32,105,109,112,111,114,116,108,105,98,46,109,97, + 99,104,105,110,101,114,121,46,70,105,108,101,70,105,110,100, + 101,114,46,122,30,111,110,108,121,32,100,105,114,101,99,116, + 111,114,105,101,115,32,97,114,101,32,115,117,112,112,111,114, + 116,101,100,114,62,0,0,0,78,41,2,114,71,0,0,0, + 114,129,0,0,0,114,62,0,0,0,169,2,114,209,0,0, + 0,114,87,1,0,0,114,7,0,0,0,114,8,0,0,0, + 218,24,112,97,116,104,95,104,111,111,107,95,102,111,114,95, + 70,105,108,101,70,105,110,100,101,114,17,6,0,0,115,8, + 0,0,0,8,2,12,1,16,1,255,128,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,78,114,7,0,0,0,41,3,114,209,0,0,0, + 114,87,1,0,0,114,93,1,0,0,114,7,0,0,0,114, + 92,1,0,0,114,8,0,0,0,218,9,112,97,116,104,95, + 104,111,111,107,7,6,0,0,115,6,0,0,0,14,10,4, + 6,255,128,122,20,70,105,108,101,70,105,110,100,101,114,46, + 112,97,116,104,95,104,111,111,107,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, + 0,0,114,53,1,0,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,77, + 0,0,0,114,58,0,0,0,114,8,1,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,54,1,0, + 0,25,6,0,0,114,47,1,0,0,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,137,0,0,0,114,136,0,0,0,114,138, + 0,0,0,114,139,0,0,0,114,223,0,0,0,114,64,1, + 0,0,114,154,0,0,0,114,217,0,0,0,114,148,0,0, + 0,114,77,1,0,0,114,214,0,0,0,114,88,1,0,0, + 114,221,0,0,0,114,94,1,0,0,114,54,1,0,0,114, + 7,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, + 0,0,0,114,80,1,0,0,138,5,0,0,115,26,0,0, + 0,8,0,4,2,8,7,8,14,4,4,8,2,8,12,10, + 5,8,48,2,31,10,1,12,17,255,128,114,80,1,0,0, + 99,4,0,0,0,0,0,0,0,0,0,0,0,6,0,0, + 0,8,0,0,0,67,0,0,0,115,144,0,0,0,124,0, + 160,0,100,1,161,1,125,4,124,0,160,0,100,2,161,1, + 125,5,124,4,115,66,124,5,114,36,124,5,106,1,125,4, + 110,30,124,2,124,3,107,2,114,56,116,2,124,1,124,2, + 131,2,125,4,110,10,116,3,124,1,124,2,131,2,125,4, + 124,5,115,84,116,4,124,1,124,2,124,4,100,3,141,3, + 125,5,122,38,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,100,0,83,0,4,0,116,5,121,142, + 1,0,1,0,1,0,89,0,100,0,83,0,119,0,41,6, + 78,218,10,95,95,108,111,97,100,101,114,95,95,218,8,95, + 95,115,112,101,99,95,95,114,81,1,0,0,90,8,95,95, + 102,105,108,101,95,95,90,10,95,95,99,97,99,104,101,100, + 95,95,41,6,218,3,103,101,116,114,151,0,0,0,114,27, + 1,0,0,114,21,1,0,0,114,201,0,0,0,218,9,69, + 120,99,101,112,116,105,111,110,41,6,90,2,110,115,114,128, + 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,151,0,0,0,114,198,0, + 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, + 0,218,14,95,102,105,120,95,117,112,95,109,111,100,117,108, + 101,31,6,0,0,115,38,0,0,0,10,2,10,1,4,1, + 4,1,8,1,8,1,12,1,10,2,4,1,14,1,2,1, + 8,1,8,1,8,1,14,1,12,1,6,2,2,254,255,128, + 114,99,1,0,0,99,0,0,0,0,0,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38, + 0,0,0,116,0,116,1,160,2,161,0,102,2,125,0,116, + 3,116,4,102,2,125,1,116,5,116,6,102,2,125,2,124, + 0,124,1,124,2,103,3,83,0,41,2,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,78,41,7,114, + 17,1,0,0,114,174,0,0,0,218,18,101,120,116,101,110, + 115,105,111,110,95,115,117,102,102,105,120,101,115,114,21,1, + 0,0,114,113,0,0,0,114,27,1,0,0,114,101,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,7,0,0,0,114,7,0,0,0,114,8,0,0,0, + 114,195,0,0,0,54,6,0,0,115,10,0,0,0,12,5, + 8,1,8,1,10,1,255,128,114,195,0,0,0,99,1,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0, + 0,0,67,0,0,0,115,8,0,0,0,124,0,97,0,100, + 0,83,0,114,121,0,0,0,41,1,114,146,0,0,0,41, + 1,218,17,95,98,111,111,116,115,116,114,97,112,95,109,111, + 100,117,108,101,114,7,0,0,0,114,7,0,0,0,114,8, + 0,0,0,218,21,95,115,101,116,95,98,111,111,116,115,116, + 114,97,112,95,109,111,100,117,108,101,65,6,0,0,115,4, + 0,0,0,8,2,255,128,114,102,1,0,0,99,1,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0, + 0,67,0,0,0,115,50,0,0,0,116,0,124,0,131,1, + 1,0,116,1,131,0,125,1,116,2,106,3,160,4,116,5, + 106,6,124,1,142,0,103,1,161,1,1,0,116,2,106,7, + 160,8,116,9,161,1,1,0,100,1,83,0,41,2,122,41, + 73,110,115,116,97,108,108,32,116,104,101,32,112,97,116,104, + 45,98,97,115,101,100,32,105,109,112,111,114,116,32,99,111, + 109,112,111,110,101,110,116,115,46,78,41,10,114,102,1,0, + 0,114,195,0,0,0,114,16,0,0,0,114,69,1,0,0, + 114,178,0,0,0,114,80,1,0,0,114,94,1,0,0,218, + 9,109,101,116,97,95,112,97,116,104,114,197,0,0,0,114, + 63,1,0,0,41,2,114,101,1,0,0,90,17,115,117,112, + 112,111,114,116,101,100,95,108,111,97,100,101,114,115,114,7, + 0,0,0,114,7,0,0,0,114,8,0,0,0,218,8,95, + 105,110,115,116,97,108,108,70,6,0,0,115,10,0,0,0, + 8,2,6,1,20,1,16,1,255,128,114,104,1,0,0,41, + 1,114,75,0,0,0,41,1,78,41,3,78,78,78,41,2, + 114,0,0,0,0,114,0,0,0,0,41,1,84,41,1,78, + 41,1,78,41,83,114,139,0,0,0,114,146,0,0,0,114, + 174,0,0,0,114,79,0,0,0,114,16,0,0,0,114,88, + 0,0,0,114,171,0,0,0,114,26,0,0,0,114,218,0, + 0,0,90,2,110,116,114,19,0,0,0,114,203,0,0,0, + 90,5,112,111,115,105,120,114,48,0,0,0,218,3,97,108, + 108,114,51,0,0,0,114,52,0,0,0,114,73,0,0,0, + 114,29,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,28,0,0, + 0,114,30,0,0,0,114,22,0,0,0,114,37,0,0,0, + 114,43,0,0,0,114,46,0,0,0,114,54,0,0,0,114, + 61,0,0,0,114,63,0,0,0,114,67,0,0,0,114,68, + 0,0,0,114,71,0,0,0,114,74,0,0,0,114,84,0, + 0,0,218,4,116,121,112,101,218,8,95,95,99,111,100,101, + 95,95,114,173,0,0,0,114,35,0,0,0,114,159,0,0, + 0,114,34,0,0,0,114,40,0,0,0,114,251,0,0,0, + 114,104,0,0,0,114,100,0,0,0,114,113,0,0,0,114, + 197,0,0,0,114,100,1,0,0,114,219,0,0,0,114,101, + 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,109,0,0,0,114,114, + 0,0,0,114,120,0,0,0,114,124,0,0,0,114,126,0, + 0,0,114,147,0,0,0,114,154,0,0,0,114,163,0,0, + 0,114,167,0,0,0,114,169,0,0,0,114,176,0,0,0, + 114,181,0,0,0,114,182,0,0,0,114,187,0,0,0,218, + 6,111,98,106,101,99,116,114,196,0,0,0,114,201,0,0, + 0,114,202,0,0,0,114,222,0,0,0,114,236,0,0,0, + 114,254,0,0,0,114,21,1,0,0,114,27,1,0,0,114, + 17,1,0,0,114,33,1,0,0,114,59,1,0,0,114,63, + 1,0,0,114,80,1,0,0,114,99,1,0,0,114,195,0, + 0,0,114,102,1,0,0,114,104,1,0,0,114,7,0,0, + 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, + 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,172, + 0,0,0,4,0,4,22,8,3,8,1,8,1,8,1,8, + 1,10,3,4,1,8,1,10,1,8,2,4,3,10,1,6, + 2,22,2,8,1,10,1,14,1,4,4,4,1,2,1,2, + 1,4,255,8,4,6,16,8,3,8,5,8,5,8,6,8, + 6,8,12,8,10,8,9,8,5,8,7,10,9,10,22,0, + 127,16,25,12,1,4,2,4,1,6,2,6,1,10,1,8, + 2,6,2,8,2,16,2,8,71,8,40,8,19,8,12,8, + 12,8,31,8,17,8,33,8,28,10,24,10,13,10,10,8, + 11,6,14,4,3,2,1,12,255,14,68,14,64,16,30,0, + 127,14,17,18,50,18,45,18,25,14,53,14,63,14,49,0, + 127,14,20,0,127,10,22,8,23,8,11,12,5,255,128, }; From webhook-mailer at python.org Fri Mar 26 16:07:08 2021 From: webhook-mailer at python.org (freddrake) Date: Fri, 26 Mar 2021 20:07:08 -0000 Subject: [Python-checkins] bpo-43620: Remove reference to os.sep from os.path.join() doc (GH-25025, GH-5030) Message-ID: https://github.com/python/cpython/commit/455583b54aaec9a4266ff37dd438cbbd8ec6068a commit: 455583b54aaec9a4266ff37dd438cbbd8ec6068a branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: freddrake date: 2021-03-26T16:06:59-04:00 summary: bpo-43620: Remove reference to os.sep from os.path.join() doc (GH-25025, GH-5030) - removed ambiguous reference to os.sep from os.path.join() doc (cherry picked from commit 21a2cabb3795f5170c746ab8f29e9d25c7442550) Co-authored-by: Jared Sutton files: M Doc/library/os.path.rst diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index a5abacf02144a..251df4d516eb5 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -306,11 +306,10 @@ the :mod:`glob` module.) Join one or more path components intelligently. The return value is the concatenation of *path* and any members of *\*paths* with exactly one - directory separator (``os.sep``) following each non-empty part except the - last, meaning that the result will only end in a separator if the last - part is empty. If a component is an absolute path, all previous - components are thrown away and joining continues from the absolute path - component. + directory separator following each non-empty part except the last, meaning + that the result will only end in a separator if the last part is empty. If + a component is an absolute path, all previous components are thrown away + and joining continues from the absolute path component. On Windows, the drive letter is not reset when an absolute path component (e.g., ``r'\foo'``) is encountered. If a component contains a drive From webhook-mailer at python.org Fri Mar 26 17:09:18 2021 From: webhook-mailer at python.org (miss-islington) Date: Fri, 26 Mar 2021 21:09:18 -0000 Subject: [Python-checkins] bpo-43354: xmlrpc: Fix type documentation for Fault.faultCode (GH-24707) Message-ID: https://github.com/python/cpython/commit/027b6699276ed8d9f68425697ac89bf61e54e6b9 commit: 027b6699276ed8d9f68425697ac89bf61e54e6b9 branch: master author: J?rgen Gmach committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-26T14:09:09-07:00 summary: bpo-43354: xmlrpc: Fix type documentation for Fault.faultCode (GH-24707) The type of `faultCode` has to be an `int` instead of a `str`. cf http://xmlrpc.com/spec.md Pinging @pganssle files: A Misc/NEWS.d/next/Documentation/2021-03-02-12-55-34.bpo-43354.ezZYkx.rst M Doc/library/xmlrpc.client.rst diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst index 32403819531aa..51279b35fd71b 100644 --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -378,7 +378,7 @@ Fault Objects .. attribute:: faultCode - A string indicating the fault type. + An int indicating the fault type. .. attribute:: faultString diff --git a/Misc/NEWS.d/next/Documentation/2021-03-02-12-55-34.bpo-43354.ezZYkx.rst b/Misc/NEWS.d/next/Documentation/2021-03-02-12-55-34.bpo-43354.ezZYkx.rst new file mode 100644 index 0000000000000..1a8743cbde615 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-03-02-12-55-34.bpo-43354.ezZYkx.rst @@ -0,0 +1 @@ +Fix type documentation for ``Fault.faultCode``; the type has to be ``int`` instead of ``str``. \ No newline at end of file From webhook-mailer at python.org Fri Mar 26 23:51:54 2021 From: webhook-mailer at python.org (pablogsal) Date: Sat, 27 Mar 2021 03:51:54 -0000 Subject: [Python-checkins] bpo-43636: Validate the version tag in _PyType_Lookup (GH-25032) Message-ID: https://github.com/python/cpython/commit/11b85abbae8aaa8410b19f358abd7b401881bb1c commit: 11b85abbae8aaa8410b19f358abd7b401881bb1c branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-27T03:51:46Z summary: bpo-43636: Validate the version tag in _PyType_Lookup (GH-25032) files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index d1bbbe77ee1b9..8dafbbf297733 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -424,7 +424,7 @@ assign_version_tag(struct type_cache *cache, PyTypeObject *type) if (type->tp_version_tag == 0) { // Wrap-around or just starting Python - clear the whole cache type_cache_clear(cache, 1); - return 1; + return 0; } bases = type->tp_bases; @@ -3361,6 +3361,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) #if MCACHE_STATS cache->hits++; #endif + assert(_PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)); return entry->value; } @@ -3398,6 +3399,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) cache->misses++; } #endif + assert(_PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)); Py_SETREF(entry->name, Py_NewRef(name)); } return res; From webhook-mailer at python.org Sat Mar 27 09:44:15 2021 From: webhook-mailer at python.org (tiran) Date: Sat, 27 Mar 2021 13:44:15 -0000 Subject: [Python-checkins] bpo-43617: Check autoconf-archive package in configure.ac (GH-25016) Message-ID: https://github.com/python/cpython/commit/5d6e8c1c1a5f667cdce99cb3c563ac922198678d commit: 5d6e8c1c1a5f667cdce99cb3c563ac922198678d branch: master author: Christian Heimes committer: tiran date: 2021-03-27T14:44:04+01:00 summary: bpo-43617: Check autoconf-archive package in configure.ac (GH-25016) Signed-off-by: Christian Heimes files: A Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst D m4/ax_c_float_words_bigendian.m4 D m4/ax_check_openssl.m4 M aclocal.m4 M configure M configure.ac diff --git a/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst b/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst new file mode 100644 index 0000000000000..26783963c8679 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst @@ -0,0 +1,2 @@ +Improve configure.ac: Check for presence of autoconf-archive package and +remove our copies of M4 macros. diff --git a/aclocal.m4 b/aclocal.m4 index 99913e7f3b85c..f497f28768506 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,6 +12,90 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +# =============================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html +# =============================================================================== +# +# SYNOPSIS +# +# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) +# +# DESCRIPTION +# +# Checks the ordering of words within a multi-word float. This check is +# necessary because on some systems (e.g. certain ARM systems), the float +# word ordering can be different from the byte ordering. In a multi-word +# float context, "big-endian" implies that the word containing the sign +# bit is found in the memory location with the lowest address. This +# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. +# +# The endianness is detected by first compiling C code that contains a +# special double float value, then grepping the resulting object file for +# certain strings of ASCII values. The double is specially crafted to have +# a binary representation that corresponds with a simple string. In this +# implementation, the string "noonsees" was selected because the +# individual word values ("noon" and "sees") are palindromes, thus making +# this test byte-order agnostic. If grep finds the string "noonsees" in +# the object file, the target platform stores float words in big-endian +# order. If grep finds "seesnoon", float words are in little-endian order. +# If neither value is found, the user is instructed to specify the +# ordering. +# +# LICENSE +# +# Copyright (c) 2008 Daniel Amelang +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], + [AC_CACHE_CHECK(whether float word ordering is bigendian, + ax_cv_c_float_words_bigendian, [ + +ax_cv_c_float_words_bigendian=unknown +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; + +]])], [ + +if grep noonsees conftest.$ac_objext >/dev/null ; then + ax_cv_c_float_words_bigendian=yes +fi +if grep seesnoon conftest.$ac_objext >/dev/null ; then + if test "$ax_cv_c_float_words_bigendian" = unknown; then + ax_cv_c_float_words_bigendian=no + else + ax_cv_c_float_words_bigendian=unknown + fi +fi + +])]) + +case $ax_cv_c_float_words_bigendian in + yes) + m4_default([$1], + [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, + [Define to 1 if your system stores words within floats + with the most significant word first])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_ERROR([ + +Unknown float word ordering. You need to manually preset +ax_cv_c_float_words_bigendian=no (or yes) according to your system. + + ])]) ;; +esac + +])# AX_C_FLOAT_WORDS_BIGENDIAN + # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== @@ -66,6 +150,131 @@ AS_VAR_IF(CACHEVAR,yes, AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) +# +# DESCRIPTION +# +# Look for OpenSSL in a number of default spots, or in a user-selected +# spot (via --with-openssl). Sets +# +# OPENSSL_INCLUDES to the include directives required +# OPENSSL_LIBS to the -l directives required +# OPENSSL_LDFLAGS to the -L or -R flags required +# +# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately +# +# This macro sets OPENSSL_INCLUDES such that source files should use the +# openssl/ directory in include directives: +# +# #include +# +# LICENSE +# +# Copyright (c) 2009,2010 Zmanda Inc. +# Copyright (c) 2009,2010 Dustin J. Mitchell +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 10 + +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) +AC_DEFUN([AX_CHECK_OPENSSL], [ + found=false + AC_ARG_WITH([openssl], + [AS_HELP_STRING([--with-openssl=DIR], + [root of the OpenSSL directory])], + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([Invalid --with-openssl value]) + ;; + *) ssldirs="$withval" + ;; + esac + ], [ + # if pkg-config is installed and openssl has installed a .pc file, + # then use that information and don't search ssldirs + AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) + if test x"$PKG_CONFIG" != x""; then + OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` + if test $? = 0; then + OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` + OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` + found=true + fi + fi + + # no such luck; use some default ssldirs + if ! $found; then + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" + fi + ] + ) + + + # note that we #include , so the OpenSSL headers have to be in + # an 'openssl' subdirectory + + if ! $found; then + OPENSSL_INCLUDES= + for ssldir in $ssldirs; do + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) + if test -f "$ssldir/include/openssl/ssl.h"; then + OPENSSL_INCLUDES="-I$ssldir/include" + OPENSSL_LDFLAGS="-L$ssldir/lib" + OPENSSL_LIBS="-lssl -lcrypto" + found=true + AC_MSG_RESULT([yes]) + break + else + AC_MSG_RESULT([no]) + fi + done + + # if the file wasn't found, well, go ahead and try the link anyway -- maybe + # it will just work! + fi + + # try the preprocessor and linker with our new flags, + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS + + AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) + echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ + "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD + + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" + LIBS="$OPENSSL_LIBS $LIBS" + CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], + [ + AC_MSG_RESULT([yes]) + $1 + ], [ + AC_MSG_RESULT([no]) + $2 + ]) + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + + AC_SUBST([OPENSSL_INCLUDES]) + AC_SUBST([OPENSSL_LIBS]) + AC_SUBST([OPENSSL_LDFLAGS]) +]) + # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) @@ -410,5 +619,3 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES -m4_include([m4/ax_c_float_words_bigendian.m4]) -m4_include([m4/ax_check_openssl.m4]) diff --git a/configure b/configure index f9b2aff3b8310..6ba109b3754c7 100755 --- a/configure +++ b/configure @@ -1594,7 +1594,7 @@ Optional Packages: --with-ensurepip[=install|upgrade|no] "install" or "upgrade" using bundled pip (default is upgrade) - --with-openssl=DIR override root of the OpenSSL directory to DIR + --with-openssl=DIR root of the OpenSSL directory --with-openssl-rpath=[DIR|auto|no] Set runtime library directory (rpath) for OpenSSL libraries, no (default): don't set rpath, auto: @@ -14571,10 +14571,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : -if $GREP noonsees conftest.$ac_objext >/dev/null ; then +if grep noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then +if grep seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else diff --git a/configure.ac b/configure.ac index e43b7733aed31..0db7e60f31747 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,9 @@ -dnl *********************************************** -dnl * Please run autoreconf to test your changes! * -dnl *********************************************** +dnl *************************************************** +dnl * Please run autoreconf -if to test your changes! * +dnl *************************************************** +dnl +dnl Python's configure script requires autoconf 2.69 and autoconf-archive. +dnl # Set VERSION so we only need to edit in one place (i.e., here) m4_define(PYTHON_VERSION, 3.10) @@ -9,7 +12,11 @@ AC_PREREQ([2.69]) AC_INIT([python],[PYTHON_VERSION],[https://bugs.python.org/]) -AC_CONFIG_MACRO_DIR(m4) +m4_ifdef( + [AX_C_FLOAT_WORDS_BIGENDIAN], + [], + [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])] +) AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4 deleted file mode 100644 index 746228c2c98df..0000000000000 --- a/m4/ax_c_float_words_bigendian.m4 +++ /dev/null @@ -1,83 +0,0 @@ -# =============================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html -# =============================================================================== -# -# SYNOPSIS -# -# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# -# DESCRIPTION -# -# Checks the ordering of words within a multi-word float. This check is -# necessary because on some systems (e.g. certain ARM systems), the float -# word ordering can be different from the byte ordering. In a multi-word -# float context, "big-endian" implies that the word containing the sign -# bit is found in the memory location with the lowest address. This -# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. -# -# The endianness is detected by first compiling C code that contains a -# special double float value, then grepping the resulting object file for -# certain strings of ASCII values. The double is specially crafted to have -# a binary representation that corresponds with a simple string. In this -# implementation, the string "noonsees" was selected because the -# individual word values ("noon" and "sees") are palindromes, thus making -# this test byte-order agnostic. If grep finds the string "noonsees" in -# the object file, the target platform stores float words in big-endian -# order. If grep finds "seesnoon", float words are in little-endian order. -# If neither value is found, the user is instructed to specify the -# ordering. -# -# LICENSE -# -# Copyright (c) 2008 Daniel Amelang -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], - [AC_CACHE_CHECK(whether float word ordering is bigendian, - ax_cv_c_float_words_bigendian, [ - -ax_cv_c_float_words_bigendian=unknown -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - -double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; - -]])], [ - -if $GREP noonsees conftest.$ac_objext >/dev/null ; then - ax_cv_c_float_words_bigendian=yes -fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then - if test "$ax_cv_c_float_words_bigendian" = unknown; then - ax_cv_c_float_words_bigendian=no - else - ax_cv_c_float_words_bigendian=unknown - fi -fi - -])]) - -case $ax_cv_c_float_words_bigendian in - yes) - m4_default([$1], - [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, - [Define to 1 if your system stores words within floats - with the most significant word first])]) ;; - no) - $2 ;; - *) - m4_default([$3], - [AC_MSG_ERROR([ - -Unknown float word ordering. You need to manually preset -ax_cv_c_float_words_bigendian=no (or yes) according to your system. - - ])]) ;; -esac - -])# AX_C_FLOAT_WORDS_BIGENDIAN diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 deleted file mode 100644 index 2846fd14c49de..0000000000000 --- a/m4/ax_check_openssl.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) -# -# DESCRIPTION -# -# Look for OpenSSL in a number of default spots, or in a user-selected -# spot (via --with-openssl). Sets -# -# OPENSSL_INCLUDES to the include directives required -# OPENSSL_LIBS to the -l directives required -# OPENSSL_LDFLAGS to the -L or -R flags required -# -# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately -# -# This macro sets OPENSSL_INCLUDES such that source files should use the -# openssl/ directory in include directives: -# -# #include -# -# LICENSE -# -# Copyright (c) 2009,2010 Zmanda Inc. -# Copyright (c) 2009,2010 Dustin J. Mitchell -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 10 - -AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) -AC_DEFUN([AX_CHECK_OPENSSL], [ - found=false - AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl=DIR], - [override root of the OpenSSL directory to DIR])], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([Invalid --with-openssl value]) - ;; - *) ssldirs="$withval" - ;; - esac - ], [ - # if pkg-config is installed and openssl has installed a .pc file, - # then use that information and don't search ssldirs - AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) - if test x"$PKG_CONFIG" != x""; then - OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` - if test $? = 0; then - OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` - OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` - found=true - fi - fi - - # no such luck; use some default ssldirs - if ! $found; then - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" - fi - ] - ) - - - # note that we #include , so the OpenSSL headers have to be in - # an 'openssl' subdirectory - - if ! $found; then - OPENSSL_INCLUDES= - for ssldir in $ssldirs; do - AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) - if test -f "$ssldir/include/openssl/ssl.h"; then - OPENSSL_INCLUDES="-I$ssldir/include" - OPENSSL_LDFLAGS="-L$ssldir/lib" - OPENSSL_LIBS="-lssl -lcrypto" - found=true - AC_MSG_RESULT([yes]) - break - else - AC_MSG_RESULT([no]) - fi - done - - # if the file wasn't found, well, go ahead and try the link anyway -- maybe - # it will just work! - fi - - # try the preprocessor and linker with our new flags, - # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - - AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) - echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ - "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD - - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" - LIBS="$OPENSSL_LIBS $LIBS" - CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], - [ - AC_MSG_RESULT([yes]) - $1 - ], [ - AC_MSG_RESULT([no]) - $2 - ]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - - AC_SUBST([OPENSSL_INCLUDES]) - AC_SUBST([OPENSSL_LIBS]) - AC_SUBST([OPENSSL_LDFLAGS]) -]) From webhook-mailer at python.org Sat Mar 27 09:55:11 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 13:55:11 -0000 Subject: [Python-checkins] bpo-40645: use C implementation of HMAC (GH-24920) Message-ID: https://github.com/python/cpython/commit/933dfd7504e521a27fd8b94d02b79f9ed08f4631 commit: 933dfd7504e521a27fd8b94d02b79f9ed08f4631 branch: master author: Christian Heimes committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T06:55:03-07:00 summary: bpo-40645: use C implementation of HMAC (GH-24920) - [x] fix tests - [ ] add test scenarios for old/new code. Signed-off-by: Christian Heimes files: A Misc/NEWS.d/next/Library/2021-03-19-10-22-17.bpo-40645.5pXhb-.rst M Lib/hashlib.py M Lib/hmac.py M Lib/test/test_hmac.py M Modules/_hashopenssl.c M Modules/clinic/_hashopenssl.c.h diff --git a/Lib/hashlib.py b/Lib/hashlib.py index 58c340d56e3ba..ffa3be049a4f3 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -173,6 +173,7 @@ def __hash_new(name, data=b'', **kwargs): algorithms_available = algorithms_available.union( _hashlib.openssl_md_meth_names) except ImportError: + _hashlib = None new = __py_new __get_hash = __get_builtin_constructor diff --git a/Lib/hmac.py b/Lib/hmac.py index 180bc378b52d6..8b4f920db954c 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -8,11 +8,12 @@ import _hashlib as _hashopenssl except ImportError: _hashopenssl = None - _openssl_md_meths = None + _functype = None from _operator import _compare_digest as compare_digest else: - _openssl_md_meths = frozenset(_hashopenssl.openssl_md_meth_names) compare_digest = _hashopenssl.compare_digest + _functype = type(_hashopenssl.openssl_sha256) # builtin type + import hashlib as _hashlib trans_5C = bytes((x ^ 0x5C) for x in range(256)) @@ -23,7 +24,6 @@ digest_size = None - class HMAC: """RFC 2104 HMAC class. Also complies with RFC 4231. @@ -32,7 +32,7 @@ class HMAC: blocksize = 64 # 512-bit HMAC; can be changed in subclasses. __slots__ = ( - "_digest_cons", "_inner", "_outer", "block_size", "digest_size" + "_hmac", "_inner", "_outer", "block_size", "digest_size" ) def __init__(self, key, msg=None, digestmod=''): @@ -55,15 +55,30 @@ def __init__(self, key, msg=None, digestmod=''): if not digestmod: raise TypeError("Missing required parameter 'digestmod'.") + if _hashopenssl and isinstance(digestmod, (str, _functype)): + try: + self._init_hmac(key, msg, digestmod) + except _hashopenssl.UnsupportedDigestmodError: + self._init_old(key, msg, digestmod) + else: + self._init_old(key, msg, digestmod) + + def _init_hmac(self, key, msg, digestmod): + self._hmac = _hashopenssl.hmac_new(key, msg, digestmod=digestmod) + self.digest_size = self._hmac.digest_size + self.block_size = self._hmac.block_size + + def _init_old(self, key, msg, digestmod): if callable(digestmod): - self._digest_cons = digestmod + digest_cons = digestmod elif isinstance(digestmod, str): - self._digest_cons = lambda d=b'': _hashlib.new(digestmod, d) + digest_cons = lambda d=b'': _hashlib.new(digestmod, d) else: - self._digest_cons = lambda d=b'': digestmod.new(d) + digest_cons = lambda d=b'': digestmod.new(d) - self._outer = self._digest_cons() - self._inner = self._digest_cons() + self._hmac = None + self._outer = digest_cons() + self._inner = digest_cons() self.digest_size = self._inner.digest_size if hasattr(self._inner, 'block_size'): @@ -79,13 +94,13 @@ def __init__(self, key, msg=None, digestmod=''): RuntimeWarning, 2) blocksize = self.blocksize + if len(key) > blocksize: + key = digest_cons(key).digest() + # self.blocksize is the default blocksize. self.block_size is # effective block size as well as the public API attribute. self.block_size = blocksize - if len(key) > blocksize: - key = self._digest_cons(key).digest() - key = key.ljust(blocksize, b'\0') self._outer.update(key.translate(trans_5C)) self._inner.update(key.translate(trans_36)) @@ -94,23 +109,15 @@ def __init__(self, key, msg=None, digestmod=''): @property def name(self): - return "hmac-" + self._inner.name - - @property - def digest_cons(self): - return self._digest_cons - - @property - def inner(self): - return self._inner - - @property - def outer(self): - return self._outer + if self._hmac: + return self._hmac.name + else: + return f"hmac-{self._inner.name}" def update(self, msg): """Feed data from msg into this hashing object.""" - self._inner.update(msg) + inst = self._hmac or self._inner + inst.update(msg) def copy(self): """Return a separate copy of this hashing object. @@ -119,10 +126,14 @@ def copy(self): """ # Call __new__ directly to avoid the expensive __init__. other = self.__class__.__new__(self.__class__) - other._digest_cons = self._digest_cons other.digest_size = self.digest_size - other._inner = self._inner.copy() - other._outer = self._outer.copy() + if self._hmac: + other._hmac = self._hmac.copy() + other._inner = other._outer = None + else: + other._hmac = None + other._inner = self._inner.copy() + other._outer = self._outer.copy() return other def _current(self): @@ -130,9 +141,12 @@ def _current(self): To be used only internally with digest() and hexdigest(). """ - h = self._outer.copy() - h.update(self._inner.digest()) - return h + if self._hmac: + return self._hmac + else: + h = self._outer.copy() + h.update(self._inner.digest()) + return h def digest(self): """Return the hash value of this hashing object. @@ -179,9 +193,11 @@ def digest(key, msg, digest): A hashlib constructor returning a new hash object. *OR* A module supporting PEP 247. """ - if (_hashopenssl is not None and - isinstance(digest, str) and digest in _openssl_md_meths): - return _hashopenssl.hmac_digest(key, msg, digest) + if _hashopenssl is not None and isinstance(digest, (str, _functype)): + try: + return _hashopenssl.hmac_digest(key, msg, digest) + except _hashopenssl.UnsupportedDigestmodError: + pass if callable(digest): digest_cons = digest diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index 6daf22ca06fb8..adf52adbf22af 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -11,14 +11,21 @@ from _operator import _compare_digest as operator_compare_digest try: + import _hashlib as _hashopenssl from _hashlib import HMAC as C_HMAC from _hashlib import hmac_new as c_hmac_new from _hashlib import compare_digest as openssl_compare_digest except ImportError: + _hashopenssl = None C_HMAC = None c_hmac_new = None openssl_compare_digest = None +try: + import _sha256 as sha256_module +except ImportError: + sha256_module = None + def ignore_warning(func): @functools.wraps(func) @@ -32,22 +39,27 @@ def wrapper(*args, **kwargs): class TestVectorsTestCase(unittest.TestCase): - def asssert_hmac( - self, key, data, digest, hashfunc, hashname, digest_size, block_size + def assert_hmac_internals( + self, h, digest, hashname, digest_size, block_size ): - h = hmac.HMAC(key, data, digestmod=hashfunc) self.assertEqual(h.hexdigest().upper(), digest.upper()) self.assertEqual(h.digest(), binascii.unhexlify(digest)) self.assertEqual(h.name, f"hmac-{hashname}") self.assertEqual(h.digest_size, digest_size) self.assertEqual(h.block_size, block_size) + def assert_hmac( + self, key, data, digest, hashfunc, hashname, digest_size, block_size + ): + h = hmac.HMAC(key, data, digestmod=hashfunc) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) + h = hmac.HMAC(key, data, digestmod=hashname) - self.assertEqual(h.hexdigest().upper(), digest.upper()) - self.assertEqual(h.digest(), binascii.unhexlify(digest)) - self.assertEqual(h.name, f"hmac-{hashname}") - self.assertEqual(h.digest_size, digest_size) - self.assertEqual(h.block_size, block_size) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) h = hmac.HMAC(key, digestmod=hashname) h2 = h.copy() @@ -56,11 +68,9 @@ def asssert_hmac( self.assertEqual(h.hexdigest().upper(), digest.upper()) h = hmac.new(key, data, digestmod=hashname) - self.assertEqual(h.hexdigest().upper(), digest.upper()) - self.assertEqual(h.digest(), binascii.unhexlify(digest)) - self.assertEqual(h.name, f"hmac-{hashname}") - self.assertEqual(h.digest_size, digest_size) - self.assertEqual(h.block_size, block_size) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) h = hmac.new(key, None, digestmod=hashname) h.update(data) @@ -81,23 +91,18 @@ def asssert_hmac( hmac.digest(key, data, digest=hashfunc), binascii.unhexlify(digest) ) - with unittest.mock.patch('hmac._openssl_md_meths', {}): - self.assertEqual( - hmac.digest(key, data, digest=hashname), - binascii.unhexlify(digest) - ) - self.assertEqual( - hmac.digest(key, data, digest=hashfunc), - binascii.unhexlify(digest) - ) + + h = hmac.HMAC.__new__(hmac.HMAC) + h._init_old(key, data, digestmod=hashname) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) if c_hmac_new is not None: h = c_hmac_new(key, data, digestmod=hashname) - self.assertEqual(h.hexdigest().upper(), digest.upper()) - self.assertEqual(h.digest(), binascii.unhexlify(digest)) - self.assertEqual(h.name, f"hmac-{hashname}") - self.assertEqual(h.digest_size, digest_size) - self.assertEqual(h.block_size, block_size) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) h = c_hmac_new(key, digestmod=hashname) h2 = h.copy() @@ -105,12 +110,24 @@ def asssert_hmac( h.update(data) self.assertEqual(h.hexdigest().upper(), digest.upper()) + func = getattr(_hashopenssl, f"openssl_{hashname}") + h = c_hmac_new(key, data, digestmod=func) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) + + h = hmac.HMAC.__new__(hmac.HMAC) + h._init_hmac(key, data, digestmod=hashname) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) + @hashlib_helper.requires_hashdigest('md5', openssl=True) def test_md5_vectors(self): # Test the HMAC module against test vectors from the RFC. def md5test(key, data, digest): - self.asssert_hmac( + self.assert_hmac( key, data, digest, hashfunc=hashlib.md5, hashname="md5", @@ -150,7 +167,7 @@ def md5test(key, data, digest): @hashlib_helper.requires_hashdigest('sha1', openssl=True) def test_sha_vectors(self): def shatest(key, data, digest): - self.asssert_hmac( + self.assert_hmac( key, data, digest, hashfunc=hashlib.sha1, hashname="sha1", @@ -191,7 +208,7 @@ def _rfc4231_test_cases(self, hashfunc, hash_name, digest_size, block_size): def hmactest(key, data, hexdigests): digest = hexdigests[hashfunc] - self.asssert_hmac( + self.assert_hmac( key, data, digest, hashfunc=hashfunc, hashname=hash_name, @@ -427,6 +444,15 @@ def test_internal_types(self): ): C_HMAC() + @unittest.skipUnless(sha256_module is not None, 'need _sha256') + def test_with_sha256_module(self): + h = hmac.HMAC(b"key", b"hash this!", digestmod=sha256_module.sha256) + self.assertEqual(h.hexdigest(), self.expected) + self.assertEqual(h.name, "hmac-sha256") + + digest = hmac.digest(b"key", b"hash this!", sha256_module.sha256) + self.assertEqual(digest, binascii.unhexlify(self.expected)) + class SanityTestCase(unittest.TestCase): @@ -447,21 +473,21 @@ def test_exercise_all_methods(self): class CopyTestCase(unittest.TestCase): @hashlib_helper.requires_hashdigest('sha256') - def test_attributes(self): + def test_attributes_old(self): # Testing if attributes are of same type. - h1 = hmac.HMAC(b"key", digestmod="sha256") + h1 = hmac.HMAC.__new__(hmac.HMAC) + h1._init_old(b"key", b"msg", digestmod="sha256") h2 = h1.copy() - self.assertTrue(h1._digest_cons == h2._digest_cons, - "digest constructors don't match.") self.assertEqual(type(h1._inner), type(h2._inner), "Types of inner don't match.") self.assertEqual(type(h1._outer), type(h2._outer), "Types of outer don't match.") @hashlib_helper.requires_hashdigest('sha256') - def test_realcopy(self): + def test_realcopy_old(self): # Testing if the copy method created a real copy. - h1 = hmac.HMAC(b"key", digestmod="sha256") + h1 = hmac.HMAC.__new__(hmac.HMAC) + h1._init_old(b"key", b"msg", digestmod="sha256") h2 = h1.copy() # Using id() in case somebody has overridden __eq__/__ne__. self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.") @@ -469,17 +495,15 @@ def test_realcopy(self): "No real copy of the attribute 'inner'.") self.assertTrue(id(h1._outer) != id(h2._outer), "No real copy of the attribute 'outer'.") - self.assertEqual(h1._inner, h1.inner) - self.assertEqual(h1._outer, h1.outer) - self.assertEqual(h1._digest_cons, h1.digest_cons) + self.assertIs(h1._hmac, None) + @unittest.skipIf(_hashopenssl is None, "test requires _hashopenssl") @hashlib_helper.requires_hashdigest('sha256') - def test_properties(self): - # deprecated properties - h1 = hmac.HMAC(b"key", digestmod="sha256") - self.assertEqual(h1._inner, h1.inner) - self.assertEqual(h1._outer, h1.outer) - self.assertEqual(h1._digest_cons, h1.digest_cons) + def test_realcopy_hmac(self): + h1 = hmac.HMAC.__new__(hmac.HMAC) + h1._init_hmac(b"key", b"msg", digestmod="sha256") + h2 = h1.copy() + self.assertTrue(id(h1._hmac) != id(h2._hmac)) @hashlib_helper.requires_hashdigest('sha256') def test_equality(self): diff --git a/Misc/NEWS.d/next/Library/2021-03-19-10-22-17.bpo-40645.5pXhb-.rst b/Misc/NEWS.d/next/Library/2021-03-19-10-22-17.bpo-40645.5pXhb-.rst new file mode 100644 index 0000000000000..a9ab1c09150bb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-19-10-22-17.bpo-40645.5pXhb-.rst @@ -0,0 +1,2 @@ +The :mod:`hmac` module now uses OpenSSL's HMAC implementation when digestmod +argument is a hash name or builtin hash function. diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index d4295d7c3638d..6c83b9e4a41fa 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -86,6 +86,8 @@ typedef struct { #ifdef PY_OPENSSL_HAS_SHAKE PyTypeObject *EVPXOFtype; #endif + PyObject *constructs; + PyObject *unsupported_digestmod_error; } _hashlibstate; static inline _hashlibstate* @@ -289,9 +291,56 @@ py_digest_by_name(const char *name) #endif } + if (digest == NULL) { + PyErr_Format(PyExc_ValueError, "unsupported hash type %s", name); + return NULL; + } + return digest; } +/* Get digest EVP from object + * + * * string + * * _hashopenssl builtin function + * + * on error returns NULL with exception set. + */ +static const EVP_MD* +py_digest_by_digestmod(PyObject *module, PyObject *digestmod) { + const EVP_MD* evp; + PyObject *name_obj = NULL; + const char *name; + + if (PyUnicode_Check(digestmod)) { + name_obj = digestmod; + } else { + _hashlibstate *state = get_hashlib_state(module); + // borrowed ref + name_obj = PyDict_GetItem(state->constructs, digestmod); + } + if (name_obj == NULL) { + _hashlibstate *state = get_hashlib_state(module); + PyErr_Clear(); + PyErr_Format( + state->unsupported_digestmod_error, + "Unsupported digestmod %R", digestmod); + return NULL; + } + + name = PyUnicode_AsUTF8(name_obj); + if (name == NULL) { + return NULL; + } + + evp = py_digest_by_name(name); + if (evp == NULL) { + return NULL; + } + + return evp; +} + static EVPobject * newEVPobject(PyTypeObject *type) { @@ -829,6 +878,9 @@ EVP_new_impl(PyObject *module, PyObject *name_obj, PyObject *data_obj, GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); digest = py_digest_by_name(name); + if (digest == NULL) { + return NULL; + } ret_obj = EVPnew(module, digest, (unsigned char*)view.buf, view.len, @@ -1124,7 +1176,6 @@ pbkdf2_hmac_impl(PyObject *module, const char *hash_name, digest = py_digest_by_name(hash_name); if (digest == NULL) { - PyErr_SetString(PyExc_ValueError, "unsupported hash type"); goto end; } @@ -1328,26 +1379,26 @@ _hashlib.hmac_digest as _hashlib_hmac_singleshot key: Py_buffer msg: Py_buffer - digest: str + digest: object Single-shot HMAC. [clinic start generated code]*/ static PyObject * _hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key, - Py_buffer *msg, const char *digest) -/*[clinic end generated code: output=15658ede5ab98185 input=019dffc571909a46]*/ + Py_buffer *msg, PyObject *digest) +/*[clinic end generated code: output=82f19965d12706ac input=0a0790cc3db45c2e]*/ { unsigned char md[EVP_MAX_MD_SIZE] = {0}; unsigned int md_len = 0; unsigned char *result; const EVP_MD *evp; - evp = py_digest_by_name(digest); + evp = py_digest_by_digestmod(module, digest); if (evp == NULL) { - PyErr_SetString(PyExc_ValueError, "unsupported hash type"); return NULL; } + if (key->len > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "key is too long."); @@ -1385,15 +1436,15 @@ _hashlib.hmac_new key: Py_buffer msg as msg_obj: object(c_default="NULL") = b'' - digestmod: str(c_default="NULL") = None + digestmod: object(c_default="NULL") = None Return a new hmac object. [clinic start generated code]*/ static PyObject * _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj, - const char *digestmod) -/*[clinic end generated code: output=9a35673be0cbea1b input=a0878868eb190134]*/ + PyObject *digestmod) +/*[clinic end generated code: output=c20d9e4d9ed6d219 input=5f4071dcc7f34362]*/ { PyTypeObject *type = get_hashlib_state(module)->HMACtype; const EVP_MD *digest; @@ -1407,15 +1458,14 @@ _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj, return NULL; } - if ((digestmod == NULL) || !strlen(digestmod)) { + if (digestmod == NULL) { PyErr_SetString( PyExc_TypeError, "Missing required parameter 'digestmod'."); return NULL; } - digest = py_digest_by_name(digestmod); - if (!digest) { - PyErr_SetString(PyExc_ValueError, "unknown hash function"); + digest = py_digest_by_digestmod(module, digestmod); + if (digest == NULL) { return NULL; } @@ -1985,6 +2035,8 @@ hashlib_traverse(PyObject *m, visitproc visit, void *arg) #ifdef PY_OPENSSL_HAS_SHAKE Py_VISIT(state->EVPXOFtype); #endif + Py_VISIT(state->constructs); + Py_VISIT(state->unsupported_digestmod_error); return 0; } @@ -1997,6 +2049,8 @@ hashlib_clear(PyObject *m) #ifdef PY_OPENSSL_HAS_SHAKE Py_CLEAR(state->EVPXOFtype); #endif + Py_CLEAR(state->constructs); + Py_CLEAR(state->unsupported_digestmod_error); return 0; } @@ -2071,6 +2125,74 @@ hashlib_init_hmactype(PyObject *module) return 0; } +static int +hashlib_init_constructors(PyObject *module) +{ + /* Create dict from builtin openssl_hash functions to name + * {_hashlib.openssl_sha256: "sha256", ...} + */ + PyModuleDef *mdef; + PyMethodDef *fdef; + PyObject *proxy; + PyObject *func, *name_obj; + _hashlibstate *state = get_hashlib_state(module); + + mdef = PyModule_GetDef(module); + if (mdef == NULL) { + return -1; + } + + state->constructs = PyDict_New(); + if (state->constructs == NULL) { + return -1; + } + + for (fdef = mdef->m_methods; fdef->ml_name != NULL; fdef++) { + if (strncmp(fdef->ml_name, "openssl_", 8)) { + continue; + } + name_obj = PyUnicode_FromString(fdef->ml_name + 8); + if (name_obj == NULL) { + return -1; + } + func = PyObject_GetAttrString(module, fdef->ml_name); + if (func == NULL) { + return -1; + } + if (PyDict_SetItem(state->constructs, func, name_obj) < 0) { + return -1; + } + Py_DECREF(func); + Py_DECREF(name_obj); + } + + proxy = PyDictProxy_New(state->constructs); + if (proxy == NULL) { + return -1; + } + if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) { + return -1; + } + return 0; +} + +static int +hashlib_exception(PyObject *module) +{ + _hashlibstate *state = get_hashlib_state(module); + state->unsupported_digestmod_error = PyErr_NewException( + "_hashlib.UnsupportedDigestmodError", PyExc_ValueError, NULL); + if (state->unsupported_digestmod_error == NULL) { + return -1; + } + if (PyModule_AddObjectRef(module, "UnsupportedDigestmodError", + state->unsupported_digestmod_error) < 0) { + return -1; + } + return 0; +} + + static PyModuleDef_Slot hashlib_slots[] = { /* OpenSSL 1.0.2 and LibreSSL */ {Py_mod_exec, hashlib_openssl_legacy_init}, @@ -2078,6 +2200,8 @@ static PyModuleDef_Slot hashlib_slots[] = { {Py_mod_exec, hashlib_init_evpxoftype}, {Py_mod_exec, hashlib_init_hmactype}, {Py_mod_exec, hashlib_md_meth_names}, + {Py_mod_exec, hashlib_init_constructors}, + {Py_mod_exec, hashlib_exception}, {0, NULL} }; diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index e72b55885fe1c..fbdff26026f6c 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -1081,7 +1081,7 @@ PyDoc_STRVAR(_hashlib_hmac_singleshot__doc__, static PyObject * _hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key, - Py_buffer *msg, const char *digest); + Py_buffer *msg, PyObject *digest); static PyObject * _hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -1092,7 +1092,7 @@ _hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nar PyObject *argsbuf[3]; Py_buffer key = {NULL, NULL}; Py_buffer msg = {NULL, NULL}; - const char *digest; + PyObject *digest; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf); if (!args) { @@ -1112,19 +1112,7 @@ _hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nar _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]); goto exit; } - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_digest", "argument 'digest'", "str", args[2]); - goto exit; - } - Py_ssize_t digest_length; - digest = PyUnicode_AsUTF8AndSize(args[2], &digest_length); - if (digest == NULL) { - goto exit; - } - if (strlen(digest) != (size_t)digest_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } + digest = args[2]; return_value = _hashlib_hmac_singleshot_impl(module, &key, &msg, digest); exit: @@ -1151,7 +1139,7 @@ PyDoc_STRVAR(_hashlib_hmac_new__doc__, static PyObject * _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj, - const char *digestmod); + PyObject *digestmod); static PyObject * _hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -1163,7 +1151,7 @@ _hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; Py_buffer key = {NULL, NULL}; PyObject *msg_obj = NULL; - const char *digestmod = NULL; + PyObject *digestmod = NULL; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf); if (!args) { @@ -1185,19 +1173,7 @@ _hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO goto skip_optional_pos; } } - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_new", "argument 'digestmod'", "str", args[2]); - goto exit; - } - Py_ssize_t digestmod_length; - digestmod = PyUnicode_AsUTF8AndSize(args[2], &digestmod_length); - if (digestmod == NULL) { - goto exit; - } - if (strlen(digestmod) != (size_t)digestmod_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } + digestmod = args[2]; skip_optional_pos: return_value = _hashlib_hmac_new_impl(module, &key, msg_obj, digestmod); @@ -1417,4 +1393,4 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef _HASHLIB_GET_FIPS_MODE_METHODDEF #define _HASHLIB_GET_FIPS_MODE_METHODDEF #endif /* !defined(_HASHLIB_GET_FIPS_MODE_METHODDEF) */ -/*[clinic end generated code: output=2bbd6159493f44ea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=980087de1b03ad42 input=a9049054013a1b77]*/ From webhook-mailer at python.org Sat Mar 27 10:20:18 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 14:20:18 -0000 Subject: [Python-checkins] bpo-39616: clarify SSLContext.check_hostname effect (GH-18484) Message-ID: https://github.com/python/cpython/commit/9798cef92b882cd82a338d3368eaf3c4a32f5c2d commit: 9798cef92b882cd82a338d3368eaf3c4a32f5c2d branch: master author: Ville Skytt? committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T07:20:11-07:00 summary: bpo-39616: clarify SSLContext.check_hostname effect (GH-18484) It doesn't actually affect whether match_hostname() is called (it never is in this context any longer), but whether hostname verification occurs in the first place. files: M Doc/library/ssl.rst diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 1adac843f4eec..c0789ee5cfc0e 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1885,7 +1885,7 @@ to speed up repeated connections from the same clients. .. attribute:: SSLContext.check_hostname - Whether to match the peer cert's hostname with :func:`match_hostname` in + Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. The context's :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass *server_hostname* to From webhook-mailer at python.org Sat Mar 27 10:30:06 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 14:30:06 -0000 Subject: [Python-checkins] bpo-39616: clarify SSLContext.check_hostname effect (GH-18484) Message-ID: https://github.com/python/cpython/commit/9de6451558c38537b2335d6e04e3bf8743c30576 commit: 9de6451558c38537b2335d6e04e3bf8743c30576 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T07:29:50-07:00 summary: bpo-39616: clarify SSLContext.check_hostname effect (GH-18484) It doesn't actually affect whether match_hostname() is called (it never is in this context any longer), but whether hostname verification occurs in the first place. (cherry picked from commit 9798cef92b882cd82a338d3368eaf3c4a32f5c2d) Co-authored-by: Ville Skytt? files: M Doc/library/ssl.rst diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 04523e914072e..24b46ca1c7dc1 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1878,7 +1878,7 @@ to speed up repeated connections from the same clients. .. attribute:: SSLContext.check_hostname - Whether to match the peer cert's hostname with :func:`match_hostname` in + Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. The context's :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass *server_hostname* to From webhook-mailer at python.org Sat Mar 27 10:42:55 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 14:42:55 -0000 Subject: [Python-checkins] bpo-39616: clarify SSLContext.check_hostname effect (GH-18484) Message-ID: https://github.com/python/cpython/commit/c84e769c2b4108e1218e09652cb3bce34c541f8a commit: c84e769c2b4108e1218e09652cb3bce34c541f8a branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T07:42:45-07:00 summary: bpo-39616: clarify SSLContext.check_hostname effect (GH-18484) It doesn't actually affect whether match_hostname() is called (it never is in this context any longer), but whether hostname verification occurs in the first place. (cherry picked from commit 9798cef92b882cd82a338d3368eaf3c4a32f5c2d) Co-authored-by: Ville Skytt? files: M Doc/library/ssl.rst diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 852091c02ec9a..0bf0554d94a50 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1878,7 +1878,7 @@ to speed up repeated connections from the same clients. .. attribute:: SSLContext.check_hostname - Whether to match the peer cert's hostname with :func:`match_hostname` in + Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. The context's :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass *server_hostname* to From webhook-mailer at python.org Sat Mar 27 13:04:06 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 17:04:06 -0000 Subject: [Python-checkins] bpo-43466: Unsupported static build hack (GH-25002) Message-ID: https://github.com/python/cpython/commit/bacefbf41461ab703b8d561f0e3d766427eab367 commit: bacefbf41461ab703b8d561f0e3d766427eab367 branch: master author: Christian Heimes committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T10:03:54-07:00 summary: bpo-43466: Unsupported static build hack (GH-25002) Add undocumented hack to statically link ssl and hashlib modules with OpenSSL. Signed-off-by: Christian Heimes files: M setup.py diff --git a/setup.py b/setup.py index 80deacce8de48..a7d00841d0559 100644 --- a/setup.py +++ b/setup.py @@ -2447,24 +2447,48 @@ def split_var(name, sep): else: runtime_library_dirs = [openssl_rpath] + openssl_extension_kwargs = dict( + include_dirs=openssl_includes, + library_dirs=openssl_libdirs, + libraries=openssl_libs, + runtime_library_dirs=runtime_library_dirs, + ) + + # This static linking is NOT OFFICIALLY SUPPORTED. + # Requires static OpenSSL build with position-independent code. Some + # features like DSO engines or external OSSL providers don't work. + # Only tested on GCC and clang on X86_64. + if os.environ.get("PY_UNSUPPORTED_OPENSSL_BUILD") == "static": + extra_linker_args = [] + for lib in openssl_extension_kwargs["libraries"]: + # link statically + extra_linker_args.append(f"-l:lib{lib}.a") + # don't export symbols + extra_linker_args.append(f"-Wl,--exclude-libs,lib{lib}.a") + openssl_extension_kwargs["extra_link_args"] = extra_linker_args + # don't link OpenSSL shared libraries. + openssl_extension_kwargs["libraries"] = [] + if config_vars.get("HAVE_X509_VERIFY_PARAM_SET1_HOST"): - self.add(Extension( - '_ssl', ['_ssl.c'], - include_dirs=openssl_includes, - library_dirs=openssl_libdirs, - libraries=openssl_libs, - runtime_library_dirs=runtime_library_dirs, - depends=['socketmodule.h', '_ssl/debughelpers.c']) + self.add( + Extension( + '_ssl', + ['_ssl.c'], + depends=['socketmodule.h', '_ssl/debughelpers.c'], + **openssl_extension_kwargs + ) ) else: self.missing.append('_ssl') - self.add(Extension('_hashlib', ['_hashopenssl.c'], - depends=['hashlib.h'], - include_dirs=openssl_includes, - library_dirs=openssl_libdirs, - runtime_library_dirs=runtime_library_dirs, - libraries=openssl_libs)) + self.add( + Extension( + '_hashlib', + ['_hashopenssl.c'], + depends=['hashlib.h'], + **openssl_extension_kwargs, + ) + ) def detect_hash_builtins(self): # By default we always compile these even when OpenSSL is available From webhook-mailer at python.org Sat Mar 27 13:21:13 2021 From: webhook-mailer at python.org (terryjreedy) Date: Sat, 27 Mar 2021 17:21:13 -0000 Subject: [Python-checkins] bpo-39231: correct tutorial annotations section (GH-25029) Message-ID: https://github.com/python/cpython/commit/a53e9a7cf5912a44c5143e353912e44cfcfca7dc commit: a53e9a7cf5912a44c5143e353912e44cfcfca7dc branch: master author: Irit Katriel committer: terryjreedy date: 2021-03-27T13:20:58-04:00 summary: bpo-39231: correct tutorial annotations section (GH-25029) files: M Doc/tutorial/controlflow.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 277e5c18562d4..0b09c18170dd8 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -1038,7 +1038,7 @@ function. Parameter annotations are defined by a colon after the parameter name by an expression evaluating to the value of the annotation. Return annotations are defined by a literal ``->``, followed by an expression, between the parameter list and the colon denoting the end of the :keyword:`def` statement. The -following example has a positional argument, a keyword argument, and the return +following example has a required argument, an optional argument, and the return value annotated:: >>> def f(ham: str, eggs: str = 'eggs') -> str: From webhook-mailer at python.org Sat Mar 27 13:31:03 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 17:31:03 -0000 Subject: [Python-checkins] bpo-39231: correct tutorial annotations section (GH-25029) Message-ID: https://github.com/python/cpython/commit/6fcebbb5a8cea25717804f5be9b6878104748ea5 commit: 6fcebbb5a8cea25717804f5be9b6878104748ea5 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T10:30:55-07:00 summary: bpo-39231: correct tutorial annotations section (GH-25029) (cherry picked from commit a53e9a7cf5912a44c5143e353912e44cfcfca7dc) Co-authored-by: Irit Katriel files: M Doc/tutorial/controlflow.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 97b4c6363a239..284b68c0010aa 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -866,7 +866,7 @@ function. Parameter annotations are defined by a colon after the parameter name by an expression evaluating to the value of the annotation. Return annotations are defined by a literal ``->``, followed by an expression, between the parameter list and the colon denoting the end of the :keyword:`def` statement. The -following example has a positional argument, a keyword argument, and the return +following example has a required argument, an optional argument, and the return value annotated:: >>> def f(ham: str, eggs: str = 'eggs') -> str: From webhook-mailer at python.org Sat Mar 27 13:43:15 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 17:43:15 -0000 Subject: [Python-checkins] bpo-39231: correct tutorial annotations section (GH-25029) Message-ID: https://github.com/python/cpython/commit/7990072999b7e9b4ef6b1f6bb376d441a5a41d74 commit: 7990072999b7e9b4ef6b1f6bb376d441a5a41d74 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T10:43:08-07:00 summary: bpo-39231: correct tutorial annotations section (GH-25029) (cherry picked from commit a53e9a7cf5912a44c5143e353912e44cfcfca7dc) Co-authored-by: Irit Katriel files: M Doc/tutorial/controlflow.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 97b4c6363a239..284b68c0010aa 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -866,7 +866,7 @@ function. Parameter annotations are defined by a colon after the parameter name by an expression evaluating to the value of the annotation. Return annotations are defined by a literal ``->``, followed by an expression, between the parameter list and the colon denoting the end of the :keyword:`def` statement. The -following example has a positional argument, a keyword argument, and the return +following example has a required argument, an optional argument, and the return value annotated:: >>> def f(ham: str, eggs: str = 'eggs') -> str: From webhook-mailer at python.org Sat Mar 27 17:47:10 2021 From: webhook-mailer at python.org (tiran) Date: Sat, 27 Mar 2021 21:47:10 -0000 Subject: [Python-checkins] [3.9] bpo-43617: Check autoconf-archive package in configure.ac (GH-25016) (GH-25034) Message-ID: https://github.com/python/cpython/commit/064bc07f241dceec2fc577cbf5c31fa6d63fe320 commit: 064bc07f241dceec2fc577cbf5c31fa6d63fe320 branch: 3.9 author: Christian Heimes committer: tiran date: 2021-03-27T22:47:00+01:00 summary: [3.9] bpo-43617: Check autoconf-archive package in configure.ac (GH-25016) (GH-25034) Signed-off-by: Christian Heimes . (cherry picked from commit 5d6e8c1c1a5f667cdce99cb3c563ac922198678d) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst D m4/ax_c_float_words_bigendian.m4 D m4/ax_check_openssl.m4 M aclocal.m4 M configure M configure.ac M pyconfig.h.in diff --git a/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst b/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst new file mode 100644 index 0000000000000..26783963c8679 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst @@ -0,0 +1,2 @@ +Improve configure.ac: Check for presence of autoconf-archive package and +remove our copies of M4 macros. diff --git a/aclocal.m4 b/aclocal.m4 index b5f9cb0e8da44..04342a4982e2d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,6 +12,215 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +# =============================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html +# =============================================================================== +# +# SYNOPSIS +# +# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) +# +# DESCRIPTION +# +# Checks the ordering of words within a multi-word float. This check is +# necessary because on some systems (e.g. certain ARM systems), the float +# word ordering can be different from the byte ordering. In a multi-word +# float context, "big-endian" implies that the word containing the sign +# bit is found in the memory location with the lowest address. This +# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. +# +# The endianness is detected by first compiling C code that contains a +# special double float value, then grepping the resulting object file for +# certain strings of ASCII values. The double is specially crafted to have +# a binary representation that corresponds with a simple string. In this +# implementation, the string "noonsees" was selected because the +# individual word values ("noon" and "sees") are palindromes, thus making +# this test byte-order agnostic. If grep finds the string "noonsees" in +# the object file, the target platform stores float words in big-endian +# order. If grep finds "seesnoon", float words are in little-endian order. +# If neither value is found, the user is instructed to specify the +# ordering. +# +# LICENSE +# +# Copyright (c) 2008 Daniel Amelang +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], + [AC_CACHE_CHECK(whether float word ordering is bigendian, + ax_cv_c_float_words_bigendian, [ + +ax_cv_c_float_words_bigendian=unknown +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; + +]])], [ + +if grep noonsees conftest.$ac_objext >/dev/null ; then + ax_cv_c_float_words_bigendian=yes +fi +if grep seesnoon conftest.$ac_objext >/dev/null ; then + if test "$ax_cv_c_float_words_bigendian" = unknown; then + ax_cv_c_float_words_bigendian=no + else + ax_cv_c_float_words_bigendian=unknown + fi +fi + +])]) + +case $ax_cv_c_float_words_bigendian in + yes) + m4_default([$1], + [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, + [Define to 1 if your system stores words within floats + with the most significant word first])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_ERROR([ + +Unknown float word ordering. You need to manually preset +ax_cv_c_float_words_bigendian=no (or yes) according to your system. + + ])]) ;; +esac + +])# AX_C_FLOAT_WORDS_BIGENDIAN + +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) +# +# DESCRIPTION +# +# Look for OpenSSL in a number of default spots, or in a user-selected +# spot (via --with-openssl). Sets +# +# OPENSSL_INCLUDES to the include directives required +# OPENSSL_LIBS to the -l directives required +# OPENSSL_LDFLAGS to the -L or -R flags required +# +# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately +# +# This macro sets OPENSSL_INCLUDES such that source files should use the +# openssl/ directory in include directives: +# +# #include +# +# LICENSE +# +# Copyright (c) 2009,2010 Zmanda Inc. +# Copyright (c) 2009,2010 Dustin J. Mitchell +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 10 + +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) +AC_DEFUN([AX_CHECK_OPENSSL], [ + found=false + AC_ARG_WITH([openssl], + [AS_HELP_STRING([--with-openssl=DIR], + [root of the OpenSSL directory])], + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([Invalid --with-openssl value]) + ;; + *) ssldirs="$withval" + ;; + esac + ], [ + # if pkg-config is installed and openssl has installed a .pc file, + # then use that information and don't search ssldirs + AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) + if test x"$PKG_CONFIG" != x""; then + OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` + if test $? = 0; then + OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` + OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` + found=true + fi + fi + + # no such luck; use some default ssldirs + if ! $found; then + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" + fi + ] + ) + + + # note that we #include , so the OpenSSL headers have to be in + # an 'openssl' subdirectory + + if ! $found; then + OPENSSL_INCLUDES= + for ssldir in $ssldirs; do + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) + if test -f "$ssldir/include/openssl/ssl.h"; then + OPENSSL_INCLUDES="-I$ssldir/include" + OPENSSL_LDFLAGS="-L$ssldir/lib" + OPENSSL_LIBS="-lssl -lcrypto" + found=true + AC_MSG_RESULT([yes]) + break + else + AC_MSG_RESULT([no]) + fi + done + + # if the file wasn't found, well, go ahead and try the link anyway -- maybe + # it will just work! + fi + + # try the preprocessor and linker with our new flags, + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS + + AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) + echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ + "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD + + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" + LIBS="$OPENSSL_LIBS $LIBS" + CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], + [ + AC_MSG_RESULT([yes]) + $1 + ], [ + AC_MSG_RESULT([no]) + $2 + ]) + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + + AC_SUBST([OPENSSL_INCLUDES]) + AC_SUBST([OPENSSL_LIBS]) + AC_SUBST([OPENSSL_LDFLAGS]) +]) + # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) @@ -356,5 +565,3 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES -m4_include([m4/ax_c_float_words_bigendian.m4]) -m4_include([m4/ax_check_openssl.m4]) diff --git a/configure b/configure index 1252335472f56..c7a7291feab9a 100755 --- a/configure +++ b/configure @@ -1577,7 +1577,7 @@ Optional Packages: --with-ensurepip[=install|upgrade|no] "install" or "upgrade" using bundled pip (default is upgrade) - --with-openssl=DIR override root of the OpenSSL directory to DIR + --with-openssl=DIR root of the OpenSSL directory --with-ssl-default-suites=[python|openssl|STRING] override default cipher suites string, python: use Python's preferred selection (default), openssl: @@ -14495,10 +14495,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : -if $GREP noonsees conftest.$ac_objext >/dev/null ; then +if grep noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then +if grep seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else @@ -15382,6 +15382,7 @@ _ACEOF fi + EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} { $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 diff --git a/configure.ac b/configure.ac index 972287a9c4766..45e0af4493f05 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,9 @@ -dnl *********************************************** -dnl * Please run autoreconf to test your changes! * -dnl *********************************************** +dnl *************************************************** +dnl * Please run autoreconf -if to test your changes! * +dnl *************************************************** +dnl +dnl Python's configure script requires autoconf 2.69 and autoconf-archive. +dnl # Set VERSION so we only need to edit in one place (i.e., here) m4_define(PYTHON_VERSION, 3.9) @@ -9,7 +12,11 @@ AC_PREREQ([2.69]) AC_INIT([python],[PYTHON_VERSION],[https://bugs.python.org/]) -AC_CONFIG_MACRO_DIR(m4) +m4_ifdef( + [AX_C_FLOAT_WORDS_BIGENDIAN], + [], + [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])] +) AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4 deleted file mode 100644 index 746228c2c98df..0000000000000 --- a/m4/ax_c_float_words_bigendian.m4 +++ /dev/null @@ -1,83 +0,0 @@ -# =============================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html -# =============================================================================== -# -# SYNOPSIS -# -# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# -# DESCRIPTION -# -# Checks the ordering of words within a multi-word float. This check is -# necessary because on some systems (e.g. certain ARM systems), the float -# word ordering can be different from the byte ordering. In a multi-word -# float context, "big-endian" implies that the word containing the sign -# bit is found in the memory location with the lowest address. This -# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. -# -# The endianness is detected by first compiling C code that contains a -# special double float value, then grepping the resulting object file for -# certain strings of ASCII values. The double is specially crafted to have -# a binary representation that corresponds with a simple string. In this -# implementation, the string "noonsees" was selected because the -# individual word values ("noon" and "sees") are palindromes, thus making -# this test byte-order agnostic. If grep finds the string "noonsees" in -# the object file, the target platform stores float words in big-endian -# order. If grep finds "seesnoon", float words are in little-endian order. -# If neither value is found, the user is instructed to specify the -# ordering. -# -# LICENSE -# -# Copyright (c) 2008 Daniel Amelang -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], - [AC_CACHE_CHECK(whether float word ordering is bigendian, - ax_cv_c_float_words_bigendian, [ - -ax_cv_c_float_words_bigendian=unknown -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - -double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; - -]])], [ - -if $GREP noonsees conftest.$ac_objext >/dev/null ; then - ax_cv_c_float_words_bigendian=yes -fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then - if test "$ax_cv_c_float_words_bigendian" = unknown; then - ax_cv_c_float_words_bigendian=no - else - ax_cv_c_float_words_bigendian=unknown - fi -fi - -])]) - -case $ax_cv_c_float_words_bigendian in - yes) - m4_default([$1], - [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, - [Define to 1 if your system stores words within floats - with the most significant word first])]) ;; - no) - $2 ;; - *) - m4_default([$3], - [AC_MSG_ERROR([ - -Unknown float word ordering. You need to manually preset -ax_cv_c_float_words_bigendian=no (or yes) according to your system. - - ])]) ;; -esac - -])# AX_C_FLOAT_WORDS_BIGENDIAN diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 deleted file mode 100644 index 2846fd14c49de..0000000000000 --- a/m4/ax_check_openssl.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) -# -# DESCRIPTION -# -# Look for OpenSSL in a number of default spots, or in a user-selected -# spot (via --with-openssl). Sets -# -# OPENSSL_INCLUDES to the include directives required -# OPENSSL_LIBS to the -l directives required -# OPENSSL_LDFLAGS to the -L or -R flags required -# -# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately -# -# This macro sets OPENSSL_INCLUDES such that source files should use the -# openssl/ directory in include directives: -# -# #include -# -# LICENSE -# -# Copyright (c) 2009,2010 Zmanda Inc. -# Copyright (c) 2009,2010 Dustin J. Mitchell -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 10 - -AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) -AC_DEFUN([AX_CHECK_OPENSSL], [ - found=false - AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl=DIR], - [override root of the OpenSSL directory to DIR])], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([Invalid --with-openssl value]) - ;; - *) ssldirs="$withval" - ;; - esac - ], [ - # if pkg-config is installed and openssl has installed a .pc file, - # then use that information and don't search ssldirs - AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) - if test x"$PKG_CONFIG" != x""; then - OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` - if test $? = 0; then - OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` - OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` - found=true - fi - fi - - # no such luck; use some default ssldirs - if ! $found; then - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" - fi - ] - ) - - - # note that we #include , so the OpenSSL headers have to be in - # an 'openssl' subdirectory - - if ! $found; then - OPENSSL_INCLUDES= - for ssldir in $ssldirs; do - AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) - if test -f "$ssldir/include/openssl/ssl.h"; then - OPENSSL_INCLUDES="-I$ssldir/include" - OPENSSL_LDFLAGS="-L$ssldir/lib" - OPENSSL_LIBS="-lssl -lcrypto" - found=true - AC_MSG_RESULT([yes]) - break - else - AC_MSG_RESULT([no]) - fi - done - - # if the file wasn't found, well, go ahead and try the link anyway -- maybe - # it will just work! - fi - - # try the preprocessor and linker with our new flags, - # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - - AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) - echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ - "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD - - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" - LIBS="$OPENSSL_LIBS $LIBS" - CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], - [ - AC_MSG_RESULT([yes]) - $1 - ], [ - AC_MSG_RESULT([no]) - $2 - ]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - - AC_SUBST([OPENSSL_INCLUDES]) - AC_SUBST([OPENSSL_LIBS]) - AC_SUBST([OPENSSL_LDFLAGS]) -]) diff --git a/pyconfig.h.in b/pyconfig.h.in index f39858d10c457..8510c8778b569 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -281,6 +281,9 @@ /* Define to 1 if you have the `dup3' function. */ #undef HAVE_DUP3 +/* Define if you have the '_dyld_shared_cache_contains_path' function. */ +#undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH + /* Defined when any dynamic module loading is enabled. */ #undef HAVE_DYNAMIC_LOADING @@ -778,9 +781,6 @@ /* Define if you have the 'prlimit' functions. */ #undef HAVE_PRLIMIT -/* Define if you have the '_dyld_shared_cache_contains_path' function. */ -#undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH - /* Define to 1 if you have the header file. */ #undef HAVE_PROCESS_H From webhook-mailer at python.org Sat Mar 27 17:47:19 2021 From: webhook-mailer at python.org (tiran) Date: Sat, 27 Mar 2021 21:47:19 -0000 Subject: [Python-checkins] [3.8] bpo-43617: Check autoconf-archive package in configure.ac (GH-25016) (GH-25035) Message-ID: https://github.com/python/cpython/commit/e516290976626cf8535b88a14b1b34e37f88a78a commit: e516290976626cf8535b88a14b1b34e37f88a78a branch: 3.8 author: Christian Heimes committer: tiran date: 2021-03-27T22:47:11+01:00 summary: [3.8] bpo-43617: Check autoconf-archive package in configure.ac (GH-25016) (GH-25035) Signed-off-by: Christian Heimes . (cherry picked from commit 5d6e8c1c1a5f667cdce99cb3c563ac922198678d) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst D m4/ax_c_float_words_bigendian.m4 D m4/ax_check_openssl.m4 M aclocal.m4 M configure M configure.ac diff --git a/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst b/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst new file mode 100644 index 0000000000000..26783963c8679 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-24-16-55-55.bpo-43617.d69KAv.rst @@ -0,0 +1,2 @@ +Improve configure.ac: Check for presence of autoconf-archive package and +remove our copies of M4 macros. diff --git a/aclocal.m4 b/aclocal.m4 index f98db73656d30..04342a4982e2d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -12,9 +12,218 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) -dnl +# =============================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html +# =============================================================================== +# +# SYNOPSIS +# +# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) +# +# DESCRIPTION +# +# Checks the ordering of words within a multi-word float. This check is +# necessary because on some systems (e.g. certain ARM systems), the float +# word ordering can be different from the byte ordering. In a multi-word +# float context, "big-endian" implies that the word containing the sign +# bit is found in the memory location with the lowest address. This +# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. +# +# The endianness is detected by first compiling C code that contains a +# special double float value, then grepping the resulting object file for +# certain strings of ASCII values. The double is specially crafted to have +# a binary representation that corresponds with a simple string. In this +# implementation, the string "noonsees" was selected because the +# individual word values ("noon" and "sees") are palindromes, thus making +# this test byte-order agnostic. If grep finds the string "noonsees" in +# the object file, the target platform stores float words in big-endian +# order. If grep finds "seesnoon", float words are in little-endian order. +# If neither value is found, the user is instructed to specify the +# ordering. +# +# LICENSE +# +# Copyright (c) 2008 Daniel Amelang +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], + [AC_CACHE_CHECK(whether float word ordering is bigendian, + ax_cv_c_float_words_bigendian, [ + +ax_cv_c_float_words_bigendian=unknown +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; + +]])], [ + +if grep noonsees conftest.$ac_objext >/dev/null ; then + ax_cv_c_float_words_bigendian=yes +fi +if grep seesnoon conftest.$ac_objext >/dev/null ; then + if test "$ax_cv_c_float_words_bigendian" = unknown; then + ax_cv_c_float_words_bigendian=no + else + ax_cv_c_float_words_bigendian=unknown + fi +fi + +])]) + +case $ax_cv_c_float_words_bigendian in + yes) + m4_default([$1], + [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, + [Define to 1 if your system stores words within floats + with the most significant word first])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_ERROR([ + +Unknown float word ordering. You need to manually preset +ax_cv_c_float_words_bigendian=no (or yes) according to your system. + + ])]) ;; +esac + +])# AX_C_FLOAT_WORDS_BIGENDIAN + +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) +# +# DESCRIPTION +# +# Look for OpenSSL in a number of default spots, or in a user-selected +# spot (via --with-openssl). Sets +# +# OPENSSL_INCLUDES to the include directives required +# OPENSSL_LIBS to the -l directives required +# OPENSSL_LDFLAGS to the -L or -R flags required +# +# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately +# +# This macro sets OPENSSL_INCLUDES such that source files should use the +# openssl/ directory in include directives: +# +# #include +# +# LICENSE +# +# Copyright (c) 2009,2010 Zmanda Inc. +# Copyright (c) 2009,2010 Dustin J. Mitchell +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 10 + +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) +AC_DEFUN([AX_CHECK_OPENSSL], [ + found=false + AC_ARG_WITH([openssl], + [AS_HELP_STRING([--with-openssl=DIR], + [root of the OpenSSL directory])], + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([Invalid --with-openssl value]) + ;; + *) ssldirs="$withval" + ;; + esac + ], [ + # if pkg-config is installed and openssl has installed a .pc file, + # then use that information and don't search ssldirs + AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) + if test x"$PKG_CONFIG" != x""; then + OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` + if test $? = 0; then + OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` + OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` + found=true + fi + fi + + # no such luck; use some default ssldirs + if ! $found; then + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" + fi + ] + ) + + + # note that we #include , so the OpenSSL headers have to be in + # an 'openssl' subdirectory + + if ! $found; then + OPENSSL_INCLUDES= + for ssldir in $ssldirs; do + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) + if test -f "$ssldir/include/openssl/ssl.h"; then + OPENSSL_INCLUDES="-I$ssldir/include" + OPENSSL_LDFLAGS="-L$ssldir/lib" + OPENSSL_LIBS="-lssl -lcrypto" + found=true + AC_MSG_RESULT([yes]) + break + else + AC_MSG_RESULT([no]) + fi + done + + # if the file wasn't found, well, go ahead and try the link anyway -- maybe + # it will just work! + fi + + # try the preprocessor and linker with our new flags, + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS + + AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) + echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ + "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD + + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" + LIBS="$OPENSSL_LIBS $LIBS" + CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], + [ + AC_MSG_RESULT([yes]) + $1 + ], [ + AC_MSG_RESULT([no]) + $2 + ]) + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + + AC_SUBST([OPENSSL_INCLUDES]) + AC_SUBST([OPENSSL_LIBS]) + AC_SUBST([OPENSSL_LDFLAGS]) +]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + dnl Copyright ? 2004 Scott James Remnant . dnl Copyright ? 2012-2015 Dan Nicholson dnl @@ -288,5 +497,71 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -m4_include([m4/ax_c_float_words_bigendian.m4]) -m4_include([m4/ax_check_openssl.m4]) +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + diff --git a/configure b/configure index c164d68c4e502..c737256c15278 100755 --- a/configure +++ b/configure @@ -782,7 +782,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -897,7 +896,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1150,15 +1148,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1296,7 +1285,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1449,7 +1438,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -14328,10 +14316,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : -if $GREP noonsees conftest.$ac_objext >/dev/null ; then +if grep noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then +if grep seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else @@ -15215,6 +15203,7 @@ _ACEOF fi + EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} { $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 diff --git a/configure.ac b/configure.ac index fc082a3cd2831..040ddfc791edb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,9 @@ -dnl *********************************************** -dnl * Please run autoreconf to test your changes! * -dnl *********************************************** +dnl *************************************************** +dnl * Please run autoreconf -if to test your changes! * +dnl *************************************************** +dnl +dnl Python's configure script requires autoconf 2.69 and autoconf-archive. +dnl # Set VERSION so we only need to edit in one place (i.e., here) m4_define(PYTHON_VERSION, 3.8) @@ -9,7 +12,11 @@ AC_PREREQ([2.69]) AC_INIT([python],[PYTHON_VERSION],[https://bugs.python.org/]) -AC_CONFIG_MACRO_DIR(m4) +m4_ifdef( + [AX_C_FLOAT_WORDS_BIGENDIAN], + [], + [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])] +) AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4 deleted file mode 100644 index 746228c2c98df..0000000000000 --- a/m4/ax_c_float_words_bigendian.m4 +++ /dev/null @@ -1,83 +0,0 @@ -# =============================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html -# =============================================================================== -# -# SYNOPSIS -# -# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# -# DESCRIPTION -# -# Checks the ordering of words within a multi-word float. This check is -# necessary because on some systems (e.g. certain ARM systems), the float -# word ordering can be different from the byte ordering. In a multi-word -# float context, "big-endian" implies that the word containing the sign -# bit is found in the memory location with the lowest address. This -# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. -# -# The endianness is detected by first compiling C code that contains a -# special double float value, then grepping the resulting object file for -# certain strings of ASCII values. The double is specially crafted to have -# a binary representation that corresponds with a simple string. In this -# implementation, the string "noonsees" was selected because the -# individual word values ("noon" and "sees") are palindromes, thus making -# this test byte-order agnostic. If grep finds the string "noonsees" in -# the object file, the target platform stores float words in big-endian -# order. If grep finds "seesnoon", float words are in little-endian order. -# If neither value is found, the user is instructed to specify the -# ordering. -# -# LICENSE -# -# Copyright (c) 2008 Daniel Amelang -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], - [AC_CACHE_CHECK(whether float word ordering is bigendian, - ax_cv_c_float_words_bigendian, [ - -ax_cv_c_float_words_bigendian=unknown -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - -double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; - -]])], [ - -if $GREP noonsees conftest.$ac_objext >/dev/null ; then - ax_cv_c_float_words_bigendian=yes -fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then - if test "$ax_cv_c_float_words_bigendian" = unknown; then - ax_cv_c_float_words_bigendian=no - else - ax_cv_c_float_words_bigendian=unknown - fi -fi - -])]) - -case $ax_cv_c_float_words_bigendian in - yes) - m4_default([$1], - [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, - [Define to 1 if your system stores words within floats - with the most significant word first])]) ;; - no) - $2 ;; - *) - m4_default([$3], - [AC_MSG_ERROR([ - -Unknown float word ordering. You need to manually preset -ax_cv_c_float_words_bigendian=no (or yes) according to your system. - - ])]) ;; -esac - -])# AX_C_FLOAT_WORDS_BIGENDIAN diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 deleted file mode 100644 index 28e48cbefb68a..0000000000000 --- a/m4/ax_check_openssl.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) -# -# DESCRIPTION -# -# Look for OpenSSL in a number of default spots, or in a user-selected -# spot (via --with-openssl). Sets -# -# OPENSSL_INCLUDES to the include directives required -# OPENSSL_LIBS to the -l directives required -# OPENSSL_LDFLAGS to the -L or -R flags required -# -# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately -# -# This macro sets OPENSSL_INCLUDES such that source files should use the -# openssl/ directory in include directives: -# -# #include -# -# LICENSE -# -# Copyright (c) 2009,2010 Zmanda Inc. -# Copyright (c) 2009,2010 Dustin J. Mitchell -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 10 - -AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) -AC_DEFUN([AX_CHECK_OPENSSL], [ - found=false - AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl=DIR], - [root of the OpenSSL directory])], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([Invalid --with-openssl value]) - ;; - *) ssldirs="$withval" - ;; - esac - ], [ - # if pkg-config is installed and openssl has installed a .pc file, - # then use that information and don't search ssldirs - AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) - if test x"$PKG_CONFIG" != x""; then - OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` - if test $? = 0; then - OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` - OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` - found=true - fi - fi - - # no such luck; use some default ssldirs - if ! $found; then - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" - fi - ] - ) - - - # note that we #include , so the OpenSSL headers have to be in - # an 'openssl' subdirectory - - if ! $found; then - OPENSSL_INCLUDES= - for ssldir in $ssldirs; do - AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) - if test -f "$ssldir/include/openssl/ssl.h"; then - OPENSSL_INCLUDES="-I$ssldir/include" - OPENSSL_LDFLAGS="-L$ssldir/lib" - OPENSSL_LIBS="-lssl -lcrypto" - found=true - AC_MSG_RESULT([yes]) - break - else - AC_MSG_RESULT([no]) - fi - done - - # if the file wasn't found, well, go ahead and try the link anyway -- maybe - # it will just work! - fi - - # try the preprocessor and linker with our new flags, - # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - - AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) - echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ - "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD - - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" - LIBS="$OPENSSL_LIBS $LIBS" - CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], - [ - AC_MSG_RESULT([yes]) - $1 - ], [ - AC_MSG_RESULT([no]) - $2 - ]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - - AC_SUBST([OPENSSL_INCLUDES]) - AC_SUBST([OPENSSL_LIBS]) - AC_SUBST([OPENSSL_LDFLAGS]) -]) From webhook-mailer at python.org Sat Mar 27 17:52:37 2021 From: webhook-mailer at python.org (miss-islington) Date: Sat, 27 Mar 2021 21:52:37 -0000 Subject: [Python-checkins] bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) Message-ID: https://github.com/python/cpython/commit/29c451c6989c3c94fa0a9facf187c24f3cbf2420 commit: 29c451c6989c3c94fa0a9facf187c24f3cbf2420 branch: master author: Carl Meyer committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T14:52:28-07:00 summary: bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) This test checks result code of the connection directly, so it never raises an exception that can be suppressed by `support.transient_internet`. Directly support skipping the test in case of unreachable network. files: M Lib/test/test_ssl.py diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index bed0d413a80b3..fa77406bca82a 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2301,6 +2301,8 @@ def test_timeout_connect_ex(self): rc = s.connect_ex((REMOTE_HOST, 443)) if rc == 0: self.skipTest("REMOTE_HOST responded too quickly") + elif rc == errno.ENETUNREACH: + self.skipTest("Network unreachable.") self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK)) @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6') From webhook-mailer at python.org Sat Mar 27 20:26:00 2021 From: webhook-mailer at python.org (jaraco) Date: Sun, 28 Mar 2021 00:26:00 -0000 Subject: [Python-checkins] bpo-43644: Add docs for importlib.resources.as_file. (#25048) Message-ID: https://github.com/python/cpython/commit/af50c84643ce21cfbdfdabbdfae6bd5e1368c542 commit: af50c84643ce21cfbdfdabbdfae6bd5e1368c542 branch: master author: Jason R. Coombs committer: jaraco date: 2021-03-27T20:25:53-04:00 summary: bpo-43644: Add docs for importlib.resources.as_file. (#25048) files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index d9b790e4e777d..6515cdbc8d329 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -891,6 +891,22 @@ The following functions are available. .. versionadded:: 3.9 +.. function:: as_file(traversable) + + Given a :class:`importlib.resources.abc.Traversable` object representing + a file, typically from :func:`importlib.resources.files`, return + a context manager for use in a :keyword:`with` statement. + The context manager provides a :class:`pathlib.Path` object. + + Exiting the context manager cleans up any temporary file created when the + resource was extracted from e.g. a zip file. + + Use ``as_file`` when the Traversable methods + (``read_text``, etc) are insufficient and an actual file on + the file system is required. + + .. versionadded:: 3.9 + .. function:: open_binary(package, resource) Open for binary reading the *resource* within *package*. From webhook-mailer at python.org Sat Mar 27 20:49:00 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 28 Mar 2021 00:49:00 -0000 Subject: [Python-checkins] bpo-43644: Add docs for importlib.resources.as_file. (GH-25048) Message-ID: https://github.com/python/cpython/commit/138e039ff9e5330709643b1bfe623eeac8fdc681 commit: 138e039ff9e5330709643b1bfe623eeac8fdc681 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-27T17:48:53-07:00 summary: bpo-43644: Add docs for importlib.resources.as_file. (GH-25048) (cherry picked from commit af50c84643ce21cfbdfdabbdfae6bd5e1368c542) Co-authored-by: Jason R. Coombs files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index cb2a5686a95a5..61a81e02ff88f 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -888,6 +888,22 @@ The following functions are available. .. versionadded:: 3.9 +.. function:: as_file(traversable) + + Given a :class:`importlib.resources.abc.Traversable` object representing + a file, typically from :func:`importlib.resources.files`, return + a context manager for use in a :keyword:`with` statement. + The context manager provides a :class:`pathlib.Path` object. + + Exiting the context manager cleans up any temporary file created when the + resource was extracted from e.g. a zip file. + + Use ``as_file`` when the Traversable methods + (``read_text``, etc) are insufficient and an actual file on + the file system is required. + + .. versionadded:: 3.9 + .. function:: open_binary(package, resource) Open for binary reading the *resource* within *package*. From webhook-mailer at python.org Sun Mar 28 16:47:40 2021 From: webhook-mailer at python.org (ericvsmith) Date: Sun, 28 Mar 2021 20:47:40 -0000 Subject: [Python-checkins] bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (#25053) Message-ID: https://github.com/python/cpython/commit/fb1d01b9630b5069fe975f16e07a027d90b89434 commit: fb1d01b9630b5069fe975f16e07a027d90b89434 branch: master author: Irit Katriel committer: ericvsmith date: 2021-03-28T16:47:20-04:00 summary: bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (#25053) files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 1bfd518349b38..d935419f7b75e 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -188,8 +188,8 @@ Format String Syntax The :meth:`str.format` method and the :class:`Formatter` class share the same syntax for format strings (although in the case of :class:`Formatter`, subclasses can define their own format string syntax). The syntax is -related to that of :ref:`formatted string literals `, but -there are differences. +related to that of :ref:`formatted string literals `, but it is +less sophisticated and, in particular, does not support arbitrary expressions. .. index:: single: {} (curly brackets); in string formatting From webhook-mailer at python.org Sun Mar 28 16:57:22 2021 From: webhook-mailer at python.org (miss-islington) Date: Sun, 28 Mar 2021 20:57:22 -0000 Subject: [Python-checkins] [3.8] bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25056) Message-ID: https://github.com/python/cpython/commit/24ba0ea9e0160cc85e0fa24f32b1651c8b3a24b0 commit: 24ba0ea9e0160cc85e0fa24f32b1651c8b3a24b0 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-28T13:57:13-07:00 summary: [3.8] bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25056) (cherry picked from commit fb1d01b9630b5069fe975f16e07a027d90b89434) Co-authored-by: Irit Katriel Automerge-Triggered-By: GH:ericvsmith files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 54786d0c2ab0d..e55884d28d633 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -188,8 +188,8 @@ Format String Syntax The :meth:`str.format` method and the :class:`Formatter` class share the same syntax for format strings (although in the case of :class:`Formatter`, subclasses can define their own format string syntax). The syntax is -related to that of :ref:`formatted string literals `, but -there are differences. +related to that of :ref:`formatted string literals `, but it is +less sophisticated and, in particular, does not support arbitrary expressions. .. index:: single: {} (curly brackets); in string formatting From webhook-mailer at python.org Sun Mar 28 17:05:17 2021 From: webhook-mailer at python.org (ericvsmith) Date: Sun, 28 Mar 2021 21:05:17 -0000 Subject: [Python-checkins] bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25055) Message-ID: https://github.com/python/cpython/commit/9a8e0780247acb256dd8b04c15b3dd0f59ef2fe1 commit: 9a8e0780247acb256dd8b04c15b3dd0f59ef2fe1 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ericvsmith date: 2021-03-28T17:05:07-04:00 summary: bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (GH-25053) (GH-25055) (cherry picked from commit fb1d01b9630b5069fe975f16e07a027d90b89434) Co-authored-by: Irit Katriel Co-authored-by: Irit Katriel files: M Doc/library/string.rst diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 54786d0c2ab0d..e55884d28d633 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -188,8 +188,8 @@ Format String Syntax The :meth:`str.format` method and the :class:`Formatter` class share the same syntax for format strings (although in the case of :class:`Formatter`, subclasses can define their own format string syntax). The syntax is -related to that of :ref:`formatted string literals `, but -there are differences. +related to that of :ref:`formatted string literals `, but it is +less sophisticated and, in particular, does not support arbitrary expressions. .. index:: single: {} (curly brackets); in string formatting From webhook-mailer at python.org Sun Mar 28 18:48:14 2021 From: webhook-mailer at python.org (pablogsal) Date: Sun, 28 Mar 2021 22:48:14 -0000 Subject: [Python-checkins] bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050) Message-ID: https://github.com/python/cpython/commit/261a452a1300eeeae1428ffd6e6623329c085e2c commit: 261a452a1300eeeae1428ffd6e6623329c085e2c branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-28T23:48:05+01:00 summary: bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050) files: M Lib/test/test_eof.py M Lib/test/test_source_encoding.py M Parser/tokenizer.c M Parser/tokenizer.h diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index b370e27161cee..2d3b4ae4e591e 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -55,13 +55,13 @@ def test_line_continuation_EOF_from_file_bpo2180(self): file_name = script_helper.make_script(temp_dir, 'foo', '\\') rc, out, err = script_helper.assert_python_failure(file_name) self.assertIn(b'unexpected EOF while parsing', err) - self.assertIn(b'line 2', err) + self.assertIn(b'line 1', err) self.assertIn(b'\\', err) file_name = script_helper.make_script(temp_dir, 'foo', 'y = 6\\') rc, out, err = script_helper.assert_python_failure(file_name) self.assertIn(b'unexpected EOF while parsing', err) - self.assertIn(b'line 2', err) + self.assertIn(b'line 1', err) self.assertIn(b'y = 6\\', err) if __name__ == "__main__": diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py index b410c03221bf3..a0cb605c1651c 100644 --- a/Lib/test/test_source_encoding.py +++ b/Lib/test/test_source_encoding.py @@ -205,6 +205,23 @@ def test_utf8_bom_and_utf8_coding_line(self): b'print(ascii("\xc3\xa4"))\n') self.check_script_output(src, br"'\xe4'") + def test_crlf(self): + src = (b'print(ascii("""\r\n"""))\n') + out = self.check_script_output(src, br"'\n'") + + def test_crcrlf(self): + src = (b'print(ascii("""\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n'") + + def test_crcrcrlf(self): + src = (b'print(ascii("""\r\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n\n'") + + def test_crcrcrlf2(self): + src = (b'#coding:iso-8859-1\n' + b'print(ascii("""\r\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n\n'") + class BytesSourceEncodingTest(AbstractSourceEncodingTest, unittest.TestCase): diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 09d8b88cadf35..d18fffaf3dbda 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -13,7 +13,6 @@ #include "unicodeobject.h" #include "bytesobject.h" #include "fileobject.h" -#include "codecs.h" #include "abstract.h" /* Alternate tab spacing */ @@ -75,7 +74,6 @@ tok_new(void) tok->altindstack[0] = 0; tok->decoding_state = STATE_INIT; tok->decoding_erred = 0; - tok->read_coding_spec = 0; tok->enc = NULL; tok->encoding = NULL; tok->cont_line = 0; @@ -164,14 +162,14 @@ get_coding_spec(const char *s, char **spec, Py_ssize_t size, struct tok_state *t } for (; i < size - 6; i++) { /* XXX inefficient search */ const char* t = s + i; - if (strncmp(t, "coding", 6) == 0) { + if (memcmp(t, "coding", 6) == 0) { const char* begin = NULL; t += 6; if (t[0] != ':' && t[0] != '=') continue; do { t++; - } while (t[0] == '\x20' || t[0] == '\t'); + } while (t[0] == ' ' || t[0] == '\t'); begin = t; while (Py_ISALNUM(t[0]) || @@ -208,15 +206,14 @@ check_coding_spec(const char* line, Py_ssize_t size, struct tok_state *tok, int set_readline(struct tok_state *, const char *)) { char *cs; - int r = 1; - if (tok->cont_line) { /* It's a continuation line, so it can't be a coding spec. */ - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; return 1; } - if (!get_coding_spec(line, &cs, size, tok)) + if (!get_coding_spec(line, &cs, size, tok)) { return 0; + } if (!cs) { Py_ssize_t i; for (i = 0; i < size; i++) { @@ -225,37 +222,33 @@ check_coding_spec(const char* line, Py_ssize_t size, struct tok_state *tok, if (line[i] != ' ' && line[i] != '\t' && line[i] != '\014') { /* Stop checking coding spec after a line containing * anything except a comment. */ - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; break; } } return 1; } - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; if (tok->encoding == NULL) { - assert(tok->decoding_state == STATE_RAW); - if (strcmp(cs, "utf-8") == 0) { - tok->encoding = cs; - } else { - r = set_readline(tok, cs); - if (r) { - tok->encoding = cs; - tok->decoding_state = STATE_NORMAL; - } - else { - PyErr_Format(PyExc_SyntaxError, - "encoding problem: %s", cs); - PyMem_Free(cs); - } + assert(tok->decoding_readline == NULL); + if (strcmp(cs, "utf-8") != 0 && !set_readline(tok, cs)) { + error_ret(tok); + PyErr_Format(PyExc_SyntaxError, "encoding problem: %s", cs); + PyMem_Free(cs); + return 0; } + tok->encoding = cs; } else { /* then, compare cs with BOM */ - r = (strcmp(tok->encoding, cs) == 0); - if (!r) + if (strcmp(tok->encoding, cs) != 0) { + error_ret(tok); PyErr_Format(PyExc_SyntaxError, "encoding problem: %s with BOM", cs); + PyMem_Free(cs); + return 0; + } PyMem_Free(cs); } - return r; + return 1; } /* See whether the file starts with a BOM. If it does, @@ -270,7 +263,7 @@ check_bom(int get_char(struct tok_state *), { int ch1, ch2, ch3; ch1 = get_char(tok); - tok->decoding_state = STATE_RAW; + tok->decoding_state = STATE_SEEK_CODING; if (ch1 == EOF) { return 1; } else if (ch1 == 0xEF) { @@ -324,7 +317,8 @@ check_bom(int get_char(struct tok_state *), return 1; } -static int tok_concatenate_interactive_new_line(struct tok_state* tok, char* line) { +static int +tok_concatenate_interactive_new_line(struct tok_state *tok, const char *line) { assert(tok->fp_interactive); if (!line) { @@ -360,73 +354,73 @@ static int tok_concatenate_interactive_new_line(struct tok_state* tok, char* lin 1) NULL: need to call tok->decoding_readline to get a new line 2) PyUnicodeObject *: decoding_feof has called tok->decoding_readline and stored the result in tok->decoding_buffer - 3) PyByteArrayObject *: previous call to fp_readl did not have enough room + 3) PyByteArrayObject *: previous call to tok_readline_recode did not have enough room (in the s buffer) to copy entire contents of the line read by tok->decoding_readline. tok->decoding_buffer has the overflow. - In this case, fp_readl is called in a loop (with an expanded buffer) + In this case, tok_readline_recode is called in a loop (with an expanded buffer) until the buffer ends with a '\n' (or until the end of the file is - reached): see tok_nextc and its calls to decoding_fgets. + reached): see tok_nextc and its calls to tok_reserve_buf. */ -static char * -fp_readl(char *s, int size, struct tok_state *tok) +static int +tok_reserve_buf(struct tok_state *tok, Py_ssize_t size) { - PyObject* bufobj; - const char *buf; - Py_ssize_t buflen; - - /* Ask for one less byte so we can terminate it */ - assert(size > 0); - size--; - - if (tok->decoding_buffer) { - bufobj = tok->decoding_buffer; - Py_INCREF(bufobj); - } - else - { - bufobj = _PyObject_CallNoArg(tok->decoding_readline); - if (bufobj == NULL) - goto error; - } - if (PyUnicode_CheckExact(bufobj)) - { - buf = PyUnicode_AsUTF8AndSize(bufobj, &buflen); - if (buf == NULL) { - goto error; - } - } - else - { - buf = PyByteArray_AsString(bufobj); - if (buf == NULL) { - goto error; + Py_ssize_t cur = tok->cur - tok->buf; + Py_ssize_t oldsize = tok->inp - tok->buf; + Py_ssize_t newsize = oldsize + Py_MAX(size, oldsize >> 1); + if (newsize > tok->end - tok->buf) { + char *newbuf = tok->buf; + Py_ssize_t start = tok->start == NULL ? -1 : tok->start - tok->buf; + newbuf = (char *)PyMem_Realloc(newbuf, newsize); + if (newbuf == NULL) { + tok->done = E_NOMEM; + return 0; } - buflen = PyByteArray_GET_SIZE(bufobj); + tok->buf = newbuf; + tok->cur = tok->buf + cur; + tok->inp = tok->buf + oldsize; + tok->end = tok->buf + newsize; + tok->start = start < 0 ? NULL : tok->buf + start; } + return 1; +} - Py_XDECREF(tok->decoding_buffer); - if (buflen > size) { - /* Too many chars, the rest goes into tok->decoding_buffer */ - tok->decoding_buffer = PyByteArray_FromStringAndSize(buf+size, - buflen-size); - if (tok->decoding_buffer == NULL) +static int +tok_readline_recode(struct tok_state *tok) { + PyObject *line; + const char *buf; + Py_ssize_t buflen; + line = tok->decoding_buffer; + if (line == NULL) { + line = PyObject_CallNoArgs(tok->decoding_readline); + if (line == NULL) { + error_ret(tok); goto error; - buflen = size; + } } - else + else { tok->decoding_buffer = NULL; - - memcpy(s, buf, buflen); - s[buflen] = '\0'; - if (buflen == 0) /* EOF */ - s = NULL; - Py_DECREF(bufobj); - return s; - + } + buf = PyUnicode_AsUTF8AndSize(line, &buflen); + if (buf == NULL) { + error_ret(tok); + goto error; + } + if (!tok_reserve_buf(tok, buflen + 1)) { + goto error; + } + memcpy(tok->inp, buf, buflen); + tok->inp += buflen; + *tok->inp = '\0'; + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, buf) == -1) { + goto error; + } + Py_DECREF(line); + return 1; error: - Py_XDECREF(bufobj); - return error_ret(tok); + Py_XDECREF(line); + return 0; } /* Set the readline function for TOK to a StreamReader's @@ -527,88 +521,30 @@ static int valid_utf8(const unsigned char* s) return length; } -/* Read a line of input from TOK. Determine encoding - if necessary. */ - -static char * -decoding_fgets(char *s, int size, struct tok_state *tok) +static int +ensure_utf8(char *line, struct tok_state *tok) { - char *line = NULL; int badchar = 0; - for (;;) { - if (tok->decoding_state == STATE_NORMAL) { - /* We already have a codec associated with - this input. */ - line = fp_readl(s, size, tok); - break; - } else if (tok->decoding_state == STATE_RAW) { - /* We want a 'raw' read. */ - line = Py_UniversalNewlineFgets(s, size, - tok->fp, NULL); + unsigned char *c; + int length; + for (c = (unsigned char *)line; *c; c += length) { + if (!(length = valid_utf8(c))) { + badchar = *c; break; - } else { - /* We have not yet determined the encoding. - If an encoding is found, use the file-pointer - reader functions from now on. */ - if (!check_bom(fp_getc, fp_ungetc, fp_setreadl, tok)) - return error_ret(tok); - assert(tok->decoding_state != STATE_INIT); - } - } - if (line != NULL && tok->lineno < 2 && !tok->read_coding_spec) { - if (!check_coding_spec(line, strlen(line), tok, fp_setreadl)) { - return error_ret(tok); } } - /* The default encoding is UTF-8, so make sure we don't have any - non-UTF-8 sequences in it. */ - if (line && !tok->encoding) { - unsigned char *c; - int length; - for (c = (unsigned char *)line; *c; c += length) - if (!(length = valid_utf8(c))) { - badchar = *c; - break; - } - } if (badchar) { /* Need to add 1 to the line number, since this line - has not been counted, yet. */ + has not been counted, yet. */ PyErr_Format(PyExc_SyntaxError, - "Non-UTF-8 code starting with '\\x%.2x' " - "in file %U on line %i, " - "but no encoding declared; " - "see http://python.org/dev/peps/pep-0263/ for details", - badchar, tok->filename, tok->lineno + 1); - return error_ret(tok); - } - - if (tok->fp_interactive && - tok_concatenate_interactive_new_line(tok, line) == -1) { - return NULL; - } - - return line; -} - -static int -decoding_feof(struct tok_state *tok) -{ - if (tok->decoding_state != STATE_NORMAL) { - return feof(tok->fp); - } else { - PyObject* buf = tok->decoding_buffer; - if (buf == NULL) { - buf = _PyObject_CallNoArg(tok->decoding_readline); - if (buf == NULL) { - error_ret(tok); - return 1; - } else { - tok->decoding_buffer = buf; - } - } - return PyObject_Length(buf) == 0; + "Non-UTF-8 code starting with '\\x%.2x' " + "in file %U on line %i, " + "but no encoding declared; " + "see http://python.org/dev/peps/pep-0263/ for details", + badchar, tok->filename, tok->lineno + 1); + return 0; } + return 1; } /* Fetch a byte from TOK, using the string buffer. */ @@ -736,12 +672,13 @@ decode_str(const char *input, int single, struct tok_state *tok) /* need to check line 1 and 2 separately since check_coding_spec assumes a single line as input */ if (newl[0]) { - if (!check_coding_spec(str, newl[0] - str, tok, buf_setreadl)) - return error_ret(tok); - if (tok->enc == NULL && !tok->read_coding_spec && newl[1]) { + if (!check_coding_spec(str, newl[0] - str, tok, buf_setreadl)) { + return NULL; + } + if (tok->enc == NULL && tok->decoding_state != STATE_NORMAL && newl[1]) { if (!check_coding_spec(newl[0]+1, newl[1] - newl[0], tok, buf_setreadl)) - return error_ret(tok); + return NULL; } } if (tok->enc != NULL) { @@ -777,6 +714,8 @@ PyTokenizer_FromString(const char *str, int exec_input) return tok; } +/* Set up tokenizer for UTF-8 string */ + struct tok_state * PyTokenizer_FromUTF8(const char *str, int exec_input) { @@ -789,16 +728,14 @@ PyTokenizer_FromUTF8(const char *str, int exec_input) PyTokenizer_Free(tok); return NULL; } - tok->decoding_state = STATE_RAW; - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; tok->enc = NULL; tok->str = translated; - tok->encoding = (char *)PyMem_Malloc(6); + tok->encoding = new_string("utf-8", 5, tok); if (!tok->encoding) { PyTokenizer_Free(tok); return NULL; } - strcpy(tok->encoding, "utf-8"); tok->buf = tok->cur = tok->inp = translated; tok->end = translated; @@ -826,18 +763,16 @@ PyTokenizer_FromFile(FILE *fp, const char* enc, if (enc != NULL) { /* Must copy encoding declaration since it gets copied into the parse tree. */ - tok->encoding = PyMem_Malloc(strlen(enc)+1); + tok->encoding = new_string(enc, strlen(enc), tok); if (!tok->encoding) { PyTokenizer_Free(tok); return NULL; } - strcpy(tok->encoding, enc); tok->decoding_state = STATE_NORMAL; } return tok; } - /* Free a tok_state structure */ void @@ -861,11 +796,225 @@ PyTokenizer_Free(struct tok_state *tok) PyMem_Free(tok); } +static int +tok_readline_raw(struct tok_state *tok) +{ + do { + if (!tok_reserve_buf(tok, BUFSIZ)) { + return 0; + } + char *line = Py_UniversalNewlineFgets(tok->inp, + (int)(tok->end - tok->inp), + tok->fp, NULL); + if (line == NULL) { + return 1; + } + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, line) == -1) { + return 0; + } + tok->inp = strchr(tok->inp, '\0'); + } while (tok->inp[-1] != '\n'); + return 1; +} + +static int +tok_underflow_string(struct tok_state *tok) { + char *end = strchr(tok->inp, '\n'); + if (end != NULL) { + end++; + } + else { + end = strchr(tok->inp, '\0'); + if (end == tok->inp) { + tok->done = E_EOF; + return 0; + } + } + if (tok->start == NULL) { + tok->buf = tok->cur; + } + tok->line_start = tok->cur; + tok->lineno++; + tok->inp = end; + return 1; +} + +static int +tok_underflow_interactive(struct tok_state *tok) { + char *newtok = PyOS_Readline(stdin, stdout, tok->prompt); + if (newtok != NULL) { + char *translated = translate_newlines(newtok, 0, tok); + PyMem_Free(newtok); + if (translated == NULL) { + return 0; + } + newtok = translated; + } + if (tok->encoding && newtok && *newtok) { + /* Recode to UTF-8 */ + Py_ssize_t buflen; + const char* buf; + PyObject *u = translate_into_utf8(newtok, tok->encoding); + PyMem_Free(newtok); + if (u == NULL) { + tok->done = E_DECODE; + return 0; + } + buflen = PyBytes_GET_SIZE(u); + buf = PyBytes_AS_STRING(u); + newtok = PyMem_Malloc(buflen+1); + if (newtok == NULL) { + Py_DECREF(u); + tok->done = E_NOMEM; + return 0; + } + strcpy(newtok, buf); + Py_DECREF(u); + } + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, newtok) == -1) { + PyMem_Free(newtok); + return 0; + } + if (tok->nextprompt != NULL) { + tok->prompt = tok->nextprompt; + } + if (newtok == NULL) { + tok->done = E_INTR; + } + else if (*newtok == '\0') { + PyMem_Free(newtok); + tok->done = E_EOF; + } + else if (tok->start != NULL) { + Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf; + size_t size = strlen(newtok); + tok->lineno++; + if (!tok_reserve_buf(tok, size + 1)) { + PyMem_Free(tok->buf); + tok->buf = NULL; + PyMem_Free(newtok); + return 0; + } + memcpy(tok->cur, newtok, size + 1); + PyMem_Free(newtok); + tok->inp += size; + tok->multi_line_start = tok->buf + cur_multi_line_start; + } + else { + tok->lineno++; + PyMem_Free(tok->buf); + tok->buf = newtok; + tok->cur = tok->buf; + tok->line_start = tok->buf; + tok->inp = strchr(tok->buf, '\0'); + tok->end = tok->inp + 1; + } + if (tok->done != E_OK) { + if (tok->prompt != NULL) { + PySys_WriteStderr("\n"); + } + return 0; + } + return 1; +} + +static int +tok_underflow_file(struct tok_state *tok) { + if (tok->start == NULL) { + tok->cur = tok->inp = tok->buf; + } + if (tok->decoding_state == STATE_INIT) { + /* We have not yet determined the encoding. + If an encoding is found, use the file-pointer + reader functions from now on. */ + if (!check_bom(fp_getc, fp_ungetc, fp_setreadl, tok)) { + error_ret(tok); + return 0; + } + assert(tok->decoding_state != STATE_INIT); + } + /* Read until '\n' or EOF */ + if (tok->decoding_readline != NULL) { + /* We already have a codec associated with this input. */ + if (!tok_readline_recode(tok)) { + return 0; + } + } + else { + /* We want a 'raw' read. */ + if (!tok_readline_raw(tok)) { + return 0; + } + } + if (tok->inp == tok->cur) { + tok->done = E_EOF; + return 0; + } + if (tok->inp[-1] != '\n') { + /* Last line does not end in \n, fake one */ + *tok->inp++ = '\n'; + *tok->inp = '\0'; + } + + tok->lineno++; + if (tok->decoding_state != STATE_NORMAL) { + if (tok->lineno > 2) { + tok->decoding_state = STATE_NORMAL; + } + else if (!check_coding_spec(tok->cur, tok->end - tok->cur, + tok, fp_setreadl)) + { + return 0; + } + } + /* The default encoding is UTF-8, so make sure we don't have any + non-UTF-8 sequences in it. */ + if (!tok->encoding + && (tok->decoding_state != STATE_NORMAL || tok->lineno >= 2)) { + if (!ensure_utf8(tok->cur, tok)) { + error_ret(tok); + return 0; + } + } + assert(tok->done == E_OK); + return tok->done == E_OK; +} + +static void +print_escape(FILE *f, const char *s, Py_ssize_t size) +{ + if (s == NULL) { + fputs("NULL", f); + return; + } + putc('"', f); + while (size-- > 0) { + unsigned char c = *s++; + switch (c) { + case '\n': fputs("\\n", f); break; + case '\r': fputs("\\r", f); break; + case '\t': fputs("\\t", f); break; + case '\f': fputs("\\f", f); break; + case '\'': fputs("\\'", f); break; + case '"': fputs("\\\"", f); break; + default: + if (0x20 <= c && c <= 0x7f) + putc(c, f); + else + fprintf(f, "\\x%02x", c); + } + } + putc('"', f); +} + /* Get next char, updating state; error code goes into tok->done */ static int tok_nextc(struct tok_state *tok) { + int rc; for (;;) { if (tok->cur != tok->inp) { return Py_CHARMASK(*tok->cur++); /* Fast path */ @@ -873,200 +1022,28 @@ tok_nextc(struct tok_state *tok) if (tok->done != E_OK) return EOF; if (tok->fp == NULL) { - char *end = strchr(tok->inp, '\n'); - if (end != NULL) - end++; - else { - end = strchr(tok->inp, '\0'); - if (end == tok->inp) { - tok->done = E_EOF; - return EOF; - } - } - if (tok->start == NULL) - tok->buf = tok->cur; - tok->line_start = tok->cur; - tok->lineno++; - tok->inp = end; - return Py_CHARMASK(*tok->cur++); + rc = tok_underflow_string(tok); } - if (tok->prompt != NULL) { - char *newtok = PyOS_Readline(stdin, stdout, tok->prompt); - if (newtok != NULL) { - char *translated = translate_newlines(newtok, 0, tok); - PyMem_Free(newtok); - if (translated == NULL) - return EOF; - newtok = translated; - } - if (tok->encoding && newtok && *newtok) { - /* Recode to UTF-8 */ - Py_ssize_t buflen; - const char* buf; - PyObject *u = translate_into_utf8(newtok, tok->encoding); - PyMem_Free(newtok); - if (!u) { - tok->done = E_DECODE; - return EOF; - } - buflen = PyBytes_GET_SIZE(u); - buf = PyBytes_AS_STRING(u); - newtok = PyMem_Malloc(buflen+1); - if (newtok == NULL) { - Py_DECREF(u); - tok->done = E_NOMEM; - return EOF; - } - strcpy(newtok, buf); - Py_DECREF(u); - } - if (tok->fp_interactive && - tok_concatenate_interactive_new_line(tok, newtok) == -1) { - return EOF; - } - if (tok->nextprompt != NULL) - tok->prompt = tok->nextprompt; - if (newtok == NULL) - tok->done = E_INTR; - else if (*newtok == '\0') { - PyMem_Free(newtok); - tok->done = E_EOF; - } - else if (tok->start != NULL) { - size_t start = tok->start - tok->buf; - size_t oldlen = tok->cur - tok->buf; - size_t newlen = oldlen + strlen(newtok); - Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf; - char *buf = tok->buf; - buf = (char *)PyMem_Realloc(buf, newlen+1); - tok->lineno++; - if (buf == NULL) { - PyMem_Free(tok->buf); - tok->buf = NULL; - PyMem_Free(newtok); - tok->done = E_NOMEM; - return EOF; - } - tok->buf = buf; - tok->cur = tok->buf + oldlen; - tok->multi_line_start = tok->buf + cur_multi_line_start; - tok->line_start = tok->cur; - strcpy(tok->buf + oldlen, newtok); - PyMem_Free(newtok); - tok->inp = tok->buf + newlen; - tok->end = tok->inp + 1; - tok->start = tok->buf + start; - } - else { - tok->lineno++; - if (tok->buf != NULL) - PyMem_Free(tok->buf); - tok->buf = newtok; - tok->cur = tok->buf; - tok->line_start = tok->buf; - tok->inp = strchr(tok->buf, '\0'); - tok->end = tok->inp + 1; - } + else if (tok->prompt != NULL) { + rc = tok_underflow_interactive(tok); } else { - int done = 0; - Py_ssize_t cur = 0; - char *pt; - if (tok->start == NULL) { - if (tok->buf == NULL) { - tok->buf = (char *) - PyMem_Malloc(BUFSIZ); - if (tok->buf == NULL) { - tok->done = E_NOMEM; - return EOF; - } - tok->end = tok->buf + BUFSIZ; - } - if (decoding_fgets(tok->buf, (int)(tok->end - tok->buf), - tok) == NULL) { - if (!tok->decoding_erred && !(tok->done == E_NOMEM)) - tok->done = E_EOF; - done = 1; - } - else { - tok->done = E_OK; - tok->inp = strchr(tok->buf, '\0'); - done = tok->inp == tok->buf || tok->inp[-1] == '\n'; - } - } - else { - cur = tok->cur - tok->buf; - if (decoding_feof(tok)) { - tok->done = E_EOF; - done = 1; - } - else - tok->done = E_OK; - } - tok->lineno++; - /* Read until '\n' or EOF */ - while (!done) { - Py_ssize_t curstart = tok->start == NULL ? -1 : - tok->start - tok->buf; - Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf; - Py_ssize_t curvalid = tok->inp - tok->buf; - Py_ssize_t newsize = curvalid + BUFSIZ; - char *newbuf = tok->buf; - newbuf = (char *)PyMem_Realloc(newbuf, - newsize); - if (newbuf == NULL) { - tok->done = E_NOMEM; - tok->cur = tok->inp; - return EOF; - } - tok->buf = newbuf; - tok->cur = tok->buf + cur; - tok->multi_line_start = tok->buf + cur_multi_line_start; - tok->line_start = tok->cur; - tok->inp = tok->buf + curvalid; - tok->end = tok->buf + newsize; - tok->start = curstart < 0 ? NULL : - tok->buf + curstart; - if (decoding_fgets(tok->inp, - (int)(tok->end - tok->inp), - tok) == NULL) { - /* Break out early on decoding - errors, as tok->buf will be NULL - */ - if (tok->decoding_erred) - return EOF; - /* Last line does not end in \n, - fake one */ - if (tok->inp[-1] != '\n') - strcpy(tok->inp, "\n"); - } - tok->inp = strchr(tok->inp, '\0'); - done = tok->inp[-1] == '\n'; - } - if (tok->buf != NULL) { - tok->cur = tok->buf + cur; - tok->line_start = tok->cur; - /* replace "\r\n" with "\n" */ - /* For Mac leave the \r, giving a syntax error */ - pt = tok->inp - 2; - if (pt >= tok->buf && *pt == '\r') { - *pt++ = '\n'; - *pt = '\0'; - tok->inp = pt; - } - } + rc = tok_underflow_file(tok); } - if (tok->done != E_OK) { - if (tok->prompt != NULL) - PySys_WriteStderr("\n"); + if (Py_DebugFlag) { + printf("line[%d] = ", tok->lineno); + print_escape(stdout, tok->cur, tok->inp - tok->cur); + printf(" tok->done = %d\n", tok->done); + } + if (!rc) { tok->cur = tok->inp; return EOF; } + tok->line_start = tok->cur; } - /*NOTREACHED*/ + Py_UNREACHABLE(); } - /* Back-up one character */ static void @@ -1076,8 +1053,8 @@ tok_backup(struct tok_state *tok, int c) if (--tok->cur < tok->buf) { Py_FatalError("tokenizer beginning of buffer"); } - if (*tok->cur != c) { - *tok->cur = c; + if ((int)(unsigned char)*tok->cur != c) { + Py_FatalError("tok_backup: wrong character"); } } } @@ -1951,8 +1928,9 @@ PyTokenizer_FindEncodingFilename(int fd, PyObject *filename) fclose(fp); if (tok->encoding) { encoding = (char *)PyMem_Malloc(strlen(tok->encoding) + 1); - if (encoding) + if (encoding) { strcpy(encoding, tok->encoding); + } } PyTokenizer_Free(tok); return encoding; diff --git a/Parser/tokenizer.h b/Parser/tokenizer.h index 111126c67f2d5..aaa31f3796207 100644 --- a/Parser/tokenizer.h +++ b/Parser/tokenizer.h @@ -15,8 +15,8 @@ extern "C" { enum decoding_state { STATE_INIT, - STATE_RAW, - STATE_NORMAL /* have a codec associated with input */ + STATE_SEEK_CODING, + STATE_NORMAL }; /* Tokenizer state */ @@ -54,7 +54,6 @@ struct tok_state { /* Stuff for PEP 0263 */ enum decoding_state decoding_state; int decoding_erred; /* whether erred in decoding */ - int read_coding_spec; /* whether 'coding:...' has been read */ char *encoding; /* Source encoding. */ int cont_line; /* whether we are in a continuation line. */ const char* line_start; /* pointer to start of current line */ From webhook-mailer at python.org Sun Mar 28 23:28:23 2021 From: webhook-mailer at python.org (methane) Date: Mon, 29 Mar 2021 03:28:23 -0000 Subject: [Python-checkins] bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481) Message-ID: https://github.com/python/cpython/commit/4827483f47906fecee6b5d9097df2a69a293a85c commit: 4827483f47906fecee6b5d9097df2a69a293a85c branch: master author: Inada Naoki committer: methane date: 2021-03-29T12:28:14+09:00 summary: bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481) See [PEP 597](https://www.python.org/dev/peps/pep-0597/). * Add `-X warn_default_encoding` and `PYTHONWARNDEFAULTENCODING`. * Add EncodingWarning * Add io.text_encoding() * open(), TextIOWrapper() emits EncodingWarning when encoding is omitted and warn_default_encoding is enabled. * _pyio.TextIOWrapper() uses UTF-8 as fallback default encoding used when failed to import locale module. (used during building Python) * bz2, configparser, gzip, lzma, pathlib, tempfile modules use io.text_encoding(). * What's new entry files: A Misc/NEWS.d/next/Library/2021-03-16-17-20-33.bpo-43510.-BeQH_.rst M Doc/c-api/init_config.rst M Doc/library/exceptions.rst M Doc/library/io.rst M Doc/using/cmdline.rst M Doc/whatsnew/3.10.rst M Include/cpython/initconfig.h M Include/internal/pycore_initconfig.h M Include/pyerrors.h M Lib/_pyio.py M Lib/bz2.py M Lib/configparser.py M Lib/gzip.py M Lib/io.py M Lib/lzma.py M Lib/pathlib.py M Lib/site.py M Lib/subprocess.py M Lib/tempfile.py M Lib/test/exception_hierarchy.txt M Lib/test/test_embed.py M Lib/test/test_io.py M Lib/test/test_pickle.py M Lib/test/test_sys.py M Modules/_io/_iomodule.c M Modules/_io/clinic/_iomodule.c.h M Modules/_io/textio.c M Objects/exceptions.c M PC/python3dll.c M Python/initconfig.c M Python/preconfig.c M Python/sysmodule.c diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index db7c1f4376578..29fbb68195b34 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -583,6 +583,15 @@ PyConfig Default: ``0``. + .. c:member:: int warn_default_encoding + + If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper` + uses its default encoding. See :ref:`io-encoding-warning` for details. + + Default: ``0``. + + .. versionadded:: 3.10 + .. c:member:: wchar_t* check_hash_pycs_mode Control the validation behavior of hash-based ``.pyc`` files: diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 1028213699d63..40ccde72d07cc 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -741,6 +741,15 @@ The following exceptions are used as warning categories; see the Base class for warnings related to Unicode. +.. exception:: EncodingWarning + + Base class for warnings related to encodings. + + See :ref:`io-encoding-warning` for details. + + .. versionadded:: 3.10 + + .. exception:: BytesWarning Base class for warnings related to :class:`bytes` and :class:`bytearray`. diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 96e02e839ae65..f9ffc19fac489 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -106,6 +106,56 @@ stream by opening a file in binary mode with buffering disabled:: The raw stream API is described in detail in the docs of :class:`RawIOBase`. +.. _io-text-encoding: + +Text Encoding +------------- + +The default encoding of :class:`TextIOWrapper` and :func:`open` is +locale-specific (:func:`locale.getpreferredencoding(False) `). + +However, many developers forget to specify the encoding when opening text files +encoded in UTF-8 (e.g. JSON, TOML, Markdown, etc...) since most Unix +platforms use UTF-8 locale by default. This causes bugs because the locale +encoding is not UTF-8 for most Windows users. For example:: + + # May not work on Windows when non-ASCII characters in the file. + with open("README.md") as f: + long_description = f.read() + +Additionally, while there is no concrete plan as of yet, Python may change +the default text file encoding to UTF-8 in the future. + +Accordingly, it is highly recommended that you specify the encoding +explicitly when opening text files. If you want to use UTF-8, pass +``encoding="utf-8"``. To use the current locale encoding, +``encoding="locale"`` is supported in Python 3.10. + +When you need to run existing code on Windows that attempts to opens +UTF-8 files using the default locale encoding, you can enable the UTF-8 +mode. See :ref:`UTF-8 mode on Windows `. + +.. _io-encoding-warning: + +Opt-in EncodingWarning +^^^^^^^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.10 + See :pep:`597` for more details. + +To find where the default locale encoding is used, you can enable +the ``-X warn_default_encoding`` command line option or set the +:envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will +emit an :exc:`EncodingWarning` when the default encoding is used. + +If you are providing an API that uses :func:`open` or +:class:`TextIOWrapper` and passes ``encoding=None`` as a parameter, you +can use :func:`text_encoding` so that callers of the API will emit an +:exc:`EncodingWarning` if they don't pass an ``encoding``. However, +please consider using UTF-8 by default (i.e. ``encoding="utf-8"``) for +new APIs. + + High-level Module Interface --------------------------- @@ -143,6 +193,32 @@ High-level Module Interface .. versionadded:: 3.8 +.. function:: text_encoding(encoding, stacklevel=2) + + This is a helper function for callables that use :func:`open` or + :class:`TextIOWrapper` and have an ``encoding=None`` parameter. + + This function returns *encoding* if it is not ``None`` and ``"locale"`` if + *encoding* is ``None``. + + This function emits an :class:`EncodingWarning` if + :data:`sys.flags.warn_default_encoding ` is true and *encoding* + is None. *stacklevel* specifies where the warning is emitted. + For example:: + + def read_text(path, encoding=None): + encoding = io.text_encoding(encoding) # stacklevel=2 + with open(path, encoding) as f: + return f.read() + + In this example, an :class:`EncodingWarning` is emitted for the caller of + ``read_text()``. + + See :ref:`io-text-encoding` for more information. + + .. versionadded:: 3.10 + + .. exception:: BlockingIOError This is a compatibility alias for the builtin :exc:`BlockingIOError` @@ -869,6 +945,8 @@ Text I/O *encoding* gives the name of the encoding that the stream will be decoded or encoded with. It defaults to :func:`locale.getpreferredencoding(False) `. + ``encoding="locale"`` can be used to specify the current locale's encoding + explicitly. See :ref:`io-text-encoding` for more information. *errors* is an optional string that specifies how encoding and decoding errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` @@ -920,6 +998,9 @@ Text I/O locale encoding using :func:`locale.setlocale`, use the current locale encoding instead of the user preferred encoding. + .. versionchanged:: 3.10 + The *encoding* argument now supports the ``"locale"`` dummy encoding name. + :class:`TextIOWrapper` provides these data attributes and methods in addition to those from :class:`TextIOBase` and :class:`IOBase`: diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 04e0f3267dbe7..1493c7c901754 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -453,6 +453,9 @@ Miscellaneous options * ``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree rooted at the given directory instead of to the code tree. See also :envvar:`PYTHONPYCACHEPREFIX`. + * ``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the + locale-specific default encoding is used for opening files. + See also :envvar:`PYTHONWARNDEFAULTENCODING`. It also allows passing arbitrary values and retrieving them through the :data:`sys._xoptions` dictionary. @@ -482,6 +485,9 @@ Miscellaneous options The ``-X showalloccount`` option has been removed. + .. versionadded:: 3.10 + The ``-X warn_default_encoding`` option. + .. deprecated-removed:: 3.9 3.10 The ``-X oldparser`` option. @@ -907,6 +913,15 @@ conflict. .. versionadded:: 3.7 +.. envvar:: PYTHONWARNDEFAULTENCODING + + If this environment variable is set to a non-empty string, issue a + :class:`EncodingWarning` when the locale-specific default encoding is used. + + See :ref:`io-encoding-warning` for details. + + .. versionadded:: 3.10 + Debug-mode variables ~~~~~~~~~~~~~~~~~~~~ diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 1c4e5c47fc681..3a563c10282c8 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -454,6 +454,30 @@ For the full specification see :pep:`634`. Motivation and rationale are in :pep:`635`, and a longer tutorial is in :pep:`636`. +.. _whatsnew310-pep597: + +Optional ``EncodingWarning`` and ``encoding="locale"`` option +------------------------------------------------------------- + +The default encoding of :class:`TextIOWrapper` and :func:`open` is +platform and locale dependent. Since UTF-8 is used on most Unix +platforms, omitting ``encoding`` option when opening UTF-8 files +(e.g. JSON, YAML, TOML, Markdown) is very common bug. For example:: + + # BUG: "rb" mode or encoding="utf-8" should be used. + with open("data.json") as f: + data = json.laod(f) + +To find this type of bugs, optional ``EncodingWarning`` is added. +It is emitted when :data:`sys.flags.warn_default_encoding ` +is true and locale-specific default encoding is used. + +``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` +are added to enable the warning. + +See :ref:`io-text-encoding` for more information. + + New Features Related to Type Annotations ======================================== diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h index 666c1e419ca24..09f9a2947efef 100644 --- a/Include/cpython/initconfig.h +++ b/Include/cpython/initconfig.h @@ -153,6 +153,7 @@ typedef struct PyConfig { PyWideStringList warnoptions; int site_import; int bytes_warning; + int warn_default_encoding; int inspect; int interactive; int optimization_level; diff --git a/Include/internal/pycore_initconfig.h b/Include/internal/pycore_initconfig.h index 28cd57030e218..4b009e816b492 100644 --- a/Include/internal/pycore_initconfig.h +++ b/Include/internal/pycore_initconfig.h @@ -102,6 +102,7 @@ typedef struct { int isolated; /* -I option */ int use_environment; /* -E option */ int dev_mode; /* -X dev and PYTHONDEVMODE */ + int warn_default_encoding; /* -X warn_default_encoding and PYTHONWARNDEFAULTENCODING */ } _PyPreCmdline; #define _PyPreCmdline_INIT \ diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 14129d3533cbe..f5d1c71157718 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -146,6 +146,7 @@ PyAPI_DATA(PyObject *) PyExc_FutureWarning; PyAPI_DATA(PyObject *) PyExc_ImportWarning; PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; PyAPI_DATA(PyObject *) PyExc_BytesWarning; +PyAPI_DATA(PyObject *) PyExc_EncodingWarning; PyAPI_DATA(PyObject *) PyExc_ResourceWarning; diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 4804ed27cd14d..0f182d4240206 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -40,6 +40,29 @@ _CHECK_ERRORS = _IOBASE_EMITS_UNRAISABLE +def text_encoding(encoding, stacklevel=2): + """ + A helper function to choose the text encoding. + + When encoding is not None, just return it. + Otherwise, return the default text encoding (i.e. "locale"). + + This function emits an EncodingWarning if *encoding* is None and + sys.flags.warn_default_encoding is true. + + This can be used in APIs with an encoding=None parameter + that pass it to TextIOWrapper or open. + However, please consider using encoding="utf-8" for new APIs. + """ + if encoding is None: + encoding = "locale" + if sys.flags.warn_default_encoding: + import warnings + warnings.warn("'encoding' argument not specified.", + EncodingWarning, stacklevel + 1) + return encoding + + def open(file, mode="r", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None): @@ -248,6 +271,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None, result = buffer if binary: return result + encoding = text_encoding(encoding) text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) result = text text.mode = mode @@ -2004,19 +2028,22 @@ class TextIOWrapper(TextIOBase): def __init__(self, buffer, encoding=None, errors=None, newline=None, line_buffering=False, write_through=False): self._check_newline(newline) - if encoding is None: + encoding = text_encoding(encoding) + + if encoding == "locale": try: - encoding = os.device_encoding(buffer.fileno()) + encoding = os.device_encoding(buffer.fileno()) or "locale" except (AttributeError, UnsupportedOperation): pass - if encoding is None: - try: - import locale - except ImportError: - # Importing locale may fail if Python is being built - encoding = "ascii" - else: - encoding = locale.getpreferredencoding(False) + + if encoding == "locale": + try: + import locale + except ImportError: + # Importing locale may fail if Python is being built + encoding = "utf-8" + else: + encoding = locale.getpreferredencoding(False) if not isinstance(encoding, str): raise ValueError("invalid encoding: %r" % encoding) diff --git a/Lib/bz2.py b/Lib/bz2.py index ce07ebeb142d9..1da3ce65c81b7 100644 --- a/Lib/bz2.py +++ b/Lib/bz2.py @@ -311,6 +311,7 @@ def open(filename, mode="rb", compresslevel=9, binary_file = BZ2File(filename, bz_mode, compresslevel=compresslevel) if "t" in mode: + encoding = io.text_encoding(encoding) return io.TextIOWrapper(binary_file, encoding, errors, newline) else: return binary_file diff --git a/Lib/configparser.py b/Lib/configparser.py index 924cc56a3f150..3b4cb5e6b2407 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -690,6 +690,7 @@ def read(self, filenames, encoding=None): """ if isinstance(filenames, (str, bytes, os.PathLike)): filenames = [filenames] + encoding = io.text_encoding(encoding) read_ok = [] for filename in filenames: try: diff --git a/Lib/gzip.py b/Lib/gzip.py index 136915725ab4f..0a8993ba35471 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -62,6 +62,7 @@ def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST, raise TypeError("filename must be a str or bytes object, or a file") if "t" in mode: + encoding = io.text_encoding(encoding) return io.TextIOWrapper(binary_file, encoding, errors, newline) else: return binary_file diff --git a/Lib/io.py b/Lib/io.py index fbce6efc010c0..01f1df80ded29 100644 --- a/Lib/io.py +++ b/Lib/io.py @@ -54,7 +54,7 @@ from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation, open, open_code, FileIO, BytesIO, StringIO, BufferedReader, BufferedWriter, BufferedRWPair, BufferedRandom, - IncrementalNewlineDecoder, TextIOWrapper) + IncrementalNewlineDecoder, text_encoding, TextIOWrapper) OpenWrapper = _io.open # for compatibility with _pyio diff --git a/Lib/lzma.py b/Lib/lzma.py index 0817b872d2019..c8b197055cddc 100644 --- a/Lib/lzma.py +++ b/Lib/lzma.py @@ -302,6 +302,7 @@ def open(filename, mode="rb", *, preset=preset, filters=filters) if "t" in mode: + encoding = io.text_encoding(encoding) return io.TextIOWrapper(binary_file, encoding, errors, newline) else: return binary_file diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 531a699a40df4..5c9284b331a32 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1241,6 +1241,8 @@ def open(self, mode='r', buffering=-1, encoding=None, Open the file pointed by this path and return a file object, as the built-in open() function does. """ + if "b" not in mode: + encoding = io.text_encoding(encoding) return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) @@ -1255,6 +1257,7 @@ def read_text(self, encoding=None, errors=None): """ Open the file in text mode, read it, and close the file. """ + encoding = io.text_encoding(encoding) with self.open(mode='r', encoding=encoding, errors=errors) as f: return f.read() @@ -1274,6 +1277,7 @@ def write_text(self, data, encoding=None, errors=None, newline=None): if not isinstance(data, str): raise TypeError('data must be str, not %s' % data.__class__.__name__) + encoding = io.text_encoding(encoding) with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f: return f.write(data) diff --git a/Lib/site.py b/Lib/site.py index 5f1b31e73d90a..939893eb5ee93 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -170,7 +170,9 @@ def addpackage(sitedir, name, known_paths): fullname = os.path.join(sitedir, name) _trace(f"Processing .pth file: {fullname!r}") try: - f = io.TextIOWrapper(io.open_code(fullname)) + # locale encoding is not ideal especially on Windows. But we have used + # it for a long time. setuptools uses the locale encoding too. + f = io.TextIOWrapper(io.open_code(fullname), encoding="locale") except OSError: return with f: diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 4b011e4ce5579..2b785496e4f5f 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -693,7 +693,7 @@ def _use_posix_spawn(): _USE_POSIX_SPAWN = _use_posix_spawn() -class Popen(object): +class Popen: """ Execute a child program in a new process. For a complete description of the arguments see the Python documentation. @@ -844,6 +844,13 @@ def __init__(self, args, bufsize=-1, executable=None, self.text_mode = encoding or errors or text or universal_newlines + # PEP 597: We suppress the EncodingWarning in subprocess module + # for now (at Python 3.10), because we focus on files for now. + # This will be changed to encoding = io.text_encoding(encoding) + # in the future. + if self.text_mode and encoding is None: + self.encoding = encoding = "locale" + # How long to resume waiting on a child after the first ^C. # There is no right value for this. The purpose is to be polite # yet remain good for interactive users trying to exit a tool. diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 4b2547c98f1c7..efcf7a7fb3bbc 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -543,6 +543,9 @@ def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None, if _os.name == 'nt' and delete: flags |= _os.O_TEMPORARY + if "b" not in mode: + encoding = _io.text_encoding(encoding) + (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) try: file = _io.open(fd, mode, buffering=buffering, @@ -583,6 +586,9 @@ def TemporaryFile(mode='w+b', buffering=-1, encoding=None, """ global _O_TMPFILE_WORKS + if "b" not in mode: + encoding = _io.text_encoding(encoding) + prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) flags = _bin_openflags @@ -638,6 +644,7 @@ def __init__(self, max_size=0, mode='w+b', buffering=-1, if 'b' in mode: self._file = _io.BytesIO() else: + encoding = _io.text_encoding(encoding) self._file = _io.TextIOWrapper(_io.BytesIO(), encoding=encoding, errors=errors, newline=newline) diff --git a/Lib/test/exception_hierarchy.txt b/Lib/test/exception_hierarchy.txt index 763a6c899b48e..6c5e82139105b 100644 --- a/Lib/test/exception_hierarchy.txt +++ b/Lib/test/exception_hierarchy.txt @@ -61,4 +61,5 @@ BaseException +-- ImportWarning +-- UnicodeWarning +-- BytesWarning + +-- EncodingWarning +-- ResourceWarning diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 6833b2540d67d..646cd0632edd8 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -389,6 +389,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'site_import': 1, 'bytes_warning': 0, + 'warn_default_encoding': 0, 'inspect': 0, 'interactive': 0, 'optimization_level': 0, diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 3768b625516f4..c731302a9f22f 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -4249,6 +4249,29 @@ def test_check_encoding_errors(self): proc = assert_python_failure('-X', 'dev', '-c', code) self.assertEqual(proc.rc, 10, proc) + def test_check_encoding_warning(self): + # PEP 597: Raise warning when encoding is not specified + # and sys.flags.warn_default_encoding is set. + mod = self.io.__name__ + filename = __file__ + code = textwrap.dedent(f'''\ + import sys + from {mod} import open, TextIOWrapper + import pathlib + + with open({filename!r}) as f: # line 5 + pass + + pathlib.Path({filename!r}).read_text() # line 8 + ''') + proc = assert_python_ok('-X', 'warn_default_encoding', '-c', code) + warnings = proc.err.splitlines() + self.assertEqual(len(warnings), 2) + self.assertTrue( + warnings[0].startswith(b":5: EncodingWarning: ")) + self.assertTrue( + warnings[1].startswith(b":8: EncodingWarning: ")) + class CMiscIOTest(MiscIOTest): io = io diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index 1f5cb103933e0..23c7bd261e85c 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -483,7 +483,8 @@ def test_exceptions(self): if exc in (BlockingIOError, ResourceWarning, StopAsyncIteration, - RecursionError): + RecursionError, + EncodingWarning): continue if exc is not OSError and issubclass(exc, OSError): self.assertEqual(reverse_mapping('builtins', name), diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index fca05e6f88f30..5b004c2b52da8 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -591,7 +591,8 @@ def test_sys_flags(self): "inspect", "interactive", "optimize", "dont_write_bytecode", "no_user_site", "no_site", "ignore_environment", "verbose", "bytes_warning", "quiet", - "hash_randomization", "isolated", "dev_mode", "utf8_mode") + "hash_randomization", "isolated", "dev_mode", "utf8_mode", + "warn_default_encoding") for attr in attrs: self.assertTrue(hasattr(sys.flags, attr), attr) attr_type = bool if attr == "dev_mode" else int diff --git a/Misc/NEWS.d/next/Library/2021-03-16-17-20-33.bpo-43510.-BeQH_.rst b/Misc/NEWS.d/next/Library/2021-03-16-17-20-33.bpo-43510.-BeQH_.rst new file mode 100644 index 0000000000000..b79a49c881bcc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-16-17-20-33.bpo-43510.-BeQH_.rst @@ -0,0 +1,3 @@ +Implement :pep:`597`: Add ``EncodingWarning`` warning, ``-X +warn_default_encoding`` option, :envvar:`PYTHONWARNDEFAULTENCODING` +environment variable and ``encoding="locale"`` argument value. diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 9147648b243be..652c2ce5b0d61 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -10,6 +10,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "_iomodule.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #ifdef HAVE_SYS_TYPES_H #include @@ -33,6 +34,7 @@ PyObject *_PyIO_str_fileno = NULL; PyObject *_PyIO_str_flush = NULL; PyObject *_PyIO_str_getstate = NULL; PyObject *_PyIO_str_isatty = NULL; +PyObject *_PyIO_str_locale = NULL; PyObject *_PyIO_str_newlines = NULL; PyObject *_PyIO_str_nl = NULL; PyObject *_PyIO_str_peek = NULL; @@ -504,6 +506,43 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, return NULL; } + +/*[clinic input] +_io.text_encoding + encoding: object + stacklevel: int = 2 + / + +A helper function to choose the text encoding. + +When encoding is not None, just return it. +Otherwise, return the default text encoding (i.e. "locale"). + +This function emits an EncodingWarning if encoding is None and +sys.flags.warn_default_encoding is true. + +This can be used in APIs with an encoding=None parameter. +However, please consider using encoding="utf-8" for new APIs. +[clinic start generated code]*/ + +static PyObject * +_io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel) +/*[clinic end generated code: output=91b2cfea6934cc0c input=bf70231213e2a7b4]*/ +{ + if (encoding == NULL || encoding == Py_None) { + PyInterpreterState *interp = _PyInterpreterState_GET(); + if (_PyInterpreterState_GetConfig(interp)->warn_default_encoding) { + PyErr_WarnEx(PyExc_EncodingWarning, + "'encoding' argument not specified", stacklevel); + } + Py_INCREF(_PyIO_str_locale); + return _PyIO_str_locale; + } + Py_INCREF(encoding); + return encoding; +} + + /*[clinic input] _io.open_code @@ -629,6 +668,7 @@ iomodule_free(PyObject *mod) { static PyMethodDef module_methods[] = { _IO_OPEN_METHODDEF + _IO_TEXT_ENCODING_METHODDEF _IO_OPEN_CODE_METHODDEF {NULL, NULL} }; @@ -747,6 +787,7 @@ PyInit__io(void) ADD_INTERNED(flush) ADD_INTERNED(getstate) ADD_INTERNED(isatty) + ADD_INTERNED(locale) ADD_INTERNED(newlines) ADD_INTERNED(peek) ADD_INTERNED(read) diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index dc7b5ff243a78..91c55b1816cd8 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -272,6 +272,52 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw return return_value; } +PyDoc_STRVAR(_io_text_encoding__doc__, +"text_encoding($module, encoding, stacklevel=2, /)\n" +"--\n" +"\n" +"A helper function to choose the text encoding.\n" +"\n" +"When encoding is not None, just return it.\n" +"Otherwise, return the default text encoding (i.e. \"locale\").\n" +"\n" +"This function emits an EncodingWarning if encoding is None and\n" +"sys.flags.warn_default_encoding is true.\n" +"\n" +"This can be used in APIs with an encoding=None parameter.\n" +"However, please consider using encoding=\"utf-8\" for new APIs."); + +#define _IO_TEXT_ENCODING_METHODDEF \ + {"text_encoding", (PyCFunction)(void(*)(void))_io_text_encoding, METH_FASTCALL, _io_text_encoding__doc__}, + +static PyObject * +_io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel); + +static PyObject * +_io_text_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *encoding; + int stacklevel = 2; + + if (!_PyArg_CheckPositional("text_encoding", nargs, 1, 2)) { + goto exit; + } + encoding = args[0]; + if (nargs < 2) { + goto skip_optional; + } + stacklevel = _PyLong_AsInt(args[1]); + if (stacklevel == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional: + return_value = _io_text_encoding_impl(module, encoding, stacklevel); + +exit: + return return_value; +} + PyDoc_STRVAR(_io_open_code__doc__, "open_code($module, /, path)\n" "--\n" @@ -313,4 +359,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=5c0dd7a262c30ebc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06e055d1d80b835d input=a9049054013a1b77]*/ diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 03001ecb0a5b3..6f89a879c9c2b 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -1123,6 +1123,17 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer, self->encodefunc = NULL; self->b2cratio = 0.0; + if (encoding == NULL) { + PyInterpreterState *interp = _PyInterpreterState_GET(); + if (_PyInterpreterState_GetConfig(interp)->warn_default_encoding) { + PyErr_WarnEx(PyExc_EncodingWarning, + "'encoding' argument not specified", 1); + } + } + else if (strcmp(encoding, "locale") == 0) { + encoding = NULL; + } + if (encoding == NULL) { /* Try os.device_encoding(fileno) */ PyObject *fileno; diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 88e2287b14354..dfa069e01d960 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2464,6 +2464,13 @@ SimpleExtendsException(PyExc_Warning, BytesWarning, "related to conversion from str or comparing to str."); +/* + * EncodingWarning extends Warning + */ +SimpleExtendsException(PyExc_Warning, EncodingWarning, + "Base class for warnings about encodings."); + + /* * ResourceWarning extends Warning */ @@ -2592,6 +2599,7 @@ _PyExc_Init(PyInterpreterState *interp) PRE_INIT(BufferError); PRE_INIT(Warning); PRE_INIT(UserWarning); + PRE_INIT(EncodingWarning); PRE_INIT(DeprecationWarning); PRE_INIT(PendingDeprecationWarning); PRE_INIT(SyntaxWarning); @@ -2731,6 +2739,7 @@ _PyBuiltins_AddExceptions(PyObject *bltinmod) POST_INIT(BufferError); POST_INIT(Warning); POST_INIT(UserWarning); + POST_INIT(EncodingWarning); POST_INIT(DeprecationWarning); POST_INIT(PendingDeprecationWarning); POST_INIT(SyntaxWarning); diff --git a/PC/python3dll.c b/PC/python3dll.c index ddbd1b1e8e422..1567ac159168a 100644 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -724,6 +724,7 @@ EXPORT_DATA(PyExc_BlockingIOError) EXPORT_DATA(PyExc_BrokenPipeError) EXPORT_DATA(PyExc_BufferError) EXPORT_DATA(PyExc_BytesWarning) +EXPORT_DATA(PyExc_EncodingWarning) EXPORT_DATA(PyExc_ChildProcessError) EXPORT_DATA(PyExc_ConnectionAbortedError) EXPORT_DATA(PyExc_ConnectionError) diff --git a/Python/initconfig.c b/Python/initconfig.c index 7886d09f7a027..27ae48dd3c97c 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -94,6 +94,7 @@ static const char usage_3[] = "\ otherwise activate automatically)\n\ -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the\n\ given directory instead of to the code tree\n\ + -X warn_default_encoding: enable opt-in EncodingWarning for 'encoding=None'\n\ \n\ --check-hash-based-pycs always|default|never:\n\ control how Python invalidates hash-based .pyc files\n\ @@ -129,7 +130,8 @@ static const char usage_6[] = "PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n" " debugger. It can be set to the callable of your debugger of choice.\n" "PYTHONDEVMODE: enable the development mode.\n" -"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"; +"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n" +"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"; #if defined(MS_WINDOWS) # define PYTHONHOMEHELP "\\python{major}{minor}" @@ -600,6 +602,7 @@ config_check_consistency(const PyConfig *config) assert(config->malloc_stats >= 0); assert(config->site_import >= 0); assert(config->bytes_warning >= 0); + assert(config->warn_default_encoding >= 0); assert(config->inspect >= 0); assert(config->interactive >= 0); assert(config->optimization_level >= 0); @@ -698,6 +701,7 @@ _PyConfig_InitCompatConfig(PyConfig *config) config->parse_argv = 0; config->site_import = -1; config->bytes_warning = -1; + config->warn_default_encoding = 0; config->inspect = -1; config->interactive = -1; config->optimization_level = -1; @@ -906,6 +910,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2) COPY_ATTR(site_import); COPY_ATTR(bytes_warning); + COPY_ATTR(warn_default_encoding); COPY_ATTR(inspect); COPY_ATTR(interactive); COPY_ATTR(optimization_level); @@ -1007,6 +1012,7 @@ _PyConfig_AsDict(const PyConfig *config) SET_ITEM_WSTR(platlibdir); SET_ITEM_INT(site_import); SET_ITEM_INT(bytes_warning); + SET_ITEM_INT(warn_default_encoding); SET_ITEM_INT(inspect); SET_ITEM_INT(interactive); SET_ITEM_INT(optimization_level); @@ -1271,6 +1277,7 @@ _PyConfig_FromDict(PyConfig *config, PyObject *dict) GET_WSTRLIST(warnoptions); GET_UINT(site_import); GET_UINT(bytes_warning); + GET_UINT(warn_default_encoding); GET_UINT(inspect); GET_UINT(interactive); GET_UINT(optimization_level); diff --git a/Python/preconfig.c b/Python/preconfig.c index b8b0c3a0775ca..ae1cc3f90fca7 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -169,6 +169,7 @@ _PyPreCmdline_SetConfig(const _PyPreCmdline *cmdline, PyConfig *config) COPY_ATTR(isolated); COPY_ATTR(use_environment); COPY_ATTR(dev_mode); + COPY_ATTR(warn_default_encoding); return _PyStatus_OK(); #undef COPY_ATTR @@ -257,9 +258,17 @@ _PyPreCmdline_Read(_PyPreCmdline *cmdline, const PyPreConfig *preconfig) cmdline->dev_mode = 0; } + // warn_default_encoding + if (_Py_get_xoption(&cmdline->xoptions, L"warn_default_encoding") + || _Py_GetEnv(cmdline->use_environment, "PYTHONWARNDEFAULTENCODING")) + { + cmdline->warn_default_encoding = 1; + } + assert(cmdline->use_environment >= 0); assert(cmdline->isolated >= 0); assert(cmdline->dev_mode >= 0); + assert(cmdline->warn_default_encoding >= 0); return _PyStatus_OK(); } diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 686b6cae3b294..54d70ef056975 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2514,6 +2514,7 @@ static PyStructSequence_Field flags_fields[] = { {"isolated", "-I"}, {"dev_mode", "-X dev"}, {"utf8_mode", "-X utf8"}, + {"warn_default_encoding", "-X warn_default_encoding"}, {0} }; @@ -2521,7 +2522,7 @@ static PyStructSequence_Desc flags_desc = { "sys.flags", /* name */ flags__doc__, /* doc */ flags_fields, /* fields */ - 15 + 16 }; static int @@ -2560,6 +2561,7 @@ set_flags_from_config(PyInterpreterState *interp, PyObject *flags) SetFlag(config->isolated); SetFlagObj(PyBool_FromLong(config->dev_mode)); SetFlag(preconfig->utf8_mode); + SetFlag(config->warn_default_encoding); #undef SetFlagObj #undef SetFlag return 0; From webhook-mailer at python.org Mon Mar 29 08:41:01 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 29 Mar 2021 12:41:01 -0000 Subject: [Python-checkins] bpo-42988: Remove the pydoc getfile feature (GH-25015) Message-ID: https://github.com/python/cpython/commit/9b999479c0022edfc9835a8a1f06e046f3881048 commit: 9b999479c0022edfc9835a8a1f06e046f3881048 branch: master author: Victor Stinner committer: vstinner date: 2021-03-29T14:40:40+02:00 summary: bpo-42988: Remove the pydoc getfile feature (GH-25015) CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schw?rer. files: A Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 282a917998340..753ea97ba0c2a 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2456,9 +2456,6 @@ def page(self, title, contents): %s%s
%s
''' % (title, css_link, html_navbar(), contents) - def filelink(self, url, path): - return '%s' % (url, path) - html = _HTMLDoc() @@ -2544,19 +2541,6 @@ def bltinlink(name): 'key = %s' % key, '#ffffff', '#ee77aa', '
'.join(results)) return 'Search Results', contents - def html_getfile(path): - """Get and display a source file listing safely.""" - path = urllib.parse.unquote(path) - with tokenize.open(path) as fp: - lines = html.escape(fp.read()) - body = '
%s
' % lines - heading = html.heading( - 'File Listing', - '#ffffff', '#7799ee') - contents = heading + html.bigsection( - 'File: %s' % path, '#ffffff', '#ee77aa', body) - return 'getfile %s' % path, contents - def html_topics(): """Index of topic texts available.""" @@ -2648,8 +2632,6 @@ def get_html_page(url): op, _, url = url.partition('=') if op == "search?key": title, content = html_search(url) - elif op == "getfile?key": - title, content = html_getfile(url) elif op == "topic?key": # try topics first, then objects. try: diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 2f502627f4d0a..3bc0e9e6b53b1 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1374,18 +1374,12 @@ def test_url_requests(self): ("topic?key=def", "Pydoc: KEYWORD def"), ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"), ("foobar", "Pydoc: Error - foobar"), - ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"), ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) - path = string.__file__ - title = "Pydoc: getfile " + path - url = "getfile?key=" + path - self.call_url_handler(url, title) - class TestHelper(unittest.TestCase): def test_keywords(self): diff --git a/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst new file mode 100644 index 0000000000000..4b42dd05305a8 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst @@ -0,0 +1,4 @@ +CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module which +could be abused to read arbitrary files on the disk (directory traversal +vulnerability). Moreover, even source code of Python modules can contain +sensitive data like passwords. Vulnerability reported by David Schw?rer. From webhook-mailer at python.org Mon Mar 29 09:02:57 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 13:02:57 -0000 Subject: [Python-checkins] bpo-42988: Remove the pydoc getfile feature (GH-25015) Message-ID: https://github.com/python/cpython/commit/7e38d3309e0a5a7b9e23ef933aef0079c6e317f7 commit: 7e38d3309e0a5a7b9e23ef933aef0079c6e317f7 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T06:02:40-07:00 summary: bpo-42988: Remove the pydoc getfile feature (GH-25015) CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schw?rer. (cherry picked from commit 9b999479c0022edfc9835a8a1f06e046f3881048) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index dc3377d68f8ca..afec613dd85a0 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2364,9 +2364,6 @@ def page(self, title, contents): %s%s
%s
''' % (title, css_link, html_navbar(), contents) - def filelink(self, url, path): - return '%s' % (url, path) - html = _HTMLDoc() @@ -2452,19 +2449,6 @@ def bltinlink(name): 'key = %s' % key, '#ffffff', '#ee77aa', '
'.join(results)) return 'Search Results', contents - def html_getfile(path): - """Get and display a source file listing safely.""" - path = urllib.parse.unquote(path) - with tokenize.open(path) as fp: - lines = html.escape(fp.read()) - body = '
%s
' % lines - heading = html.heading( - 'File Listing', - '#ffffff', '#7799ee') - contents = heading + html.bigsection( - 'File: %s' % path, '#ffffff', '#ee77aa', body) - return 'getfile %s' % path, contents - def html_topics(): """Index of topic texts available.""" @@ -2556,8 +2540,6 @@ def get_html_page(url): op, _, url = url.partition('=') if op == "search?key": title, content = html_search(url) - elif op == "getfile?key": - title, content = html_getfile(url) elif op == "topic?key": # try topics first, then objects. try: diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index c80477c50f098..72ed8a93b712b 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1360,18 +1360,12 @@ def test_url_requests(self): ("topic?key=def", "Pydoc: KEYWORD def"), ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"), ("foobar", "Pydoc: Error - foobar"), - ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"), ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) - path = string.__file__ - title = "Pydoc: getfile " + path - url = "getfile?key=" + path - self.call_url_handler(url, title) - class TestHelper(unittest.TestCase): def test_keywords(self): diff --git a/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst new file mode 100644 index 0000000000000..4b42dd05305a8 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst @@ -0,0 +1,4 @@ +CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module which +could be abused to read arbitrary files on the disk (directory traversal +vulnerability). Moreover, even source code of Python modules can contain +sensitive data like passwords. Vulnerability reported by David Schw?rer. From webhook-mailer at python.org Mon Mar 29 09:08:10 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 13:08:10 -0000 Subject: [Python-checkins] bpo-42988: Remove the pydoc getfile feature (GH-25015) Message-ID: https://github.com/python/cpython/commit/ed753d94856213ae9fc028195f670e66a24e2334 commit: ed753d94856213ae9fc028195f670e66a24e2334 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T06:08:00-07:00 summary: bpo-42988: Remove the pydoc getfile feature (GH-25015) CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schw?rer. (cherry picked from commit 9b999479c0022edfc9835a8a1f06e046f3881048) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 35ef3ebdc688e..ffa4b62c1f17b 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2457,9 +2457,6 @@ def page(self, title, contents): %s%s
%s
''' % (title, css_link, html_navbar(), contents) - def filelink(self, url, path): - return '%s' % (url, path) - html = _HTMLDoc() @@ -2545,19 +2542,6 @@ def bltinlink(name): 'key = %s' % key, '#ffffff', '#ee77aa', '
'.join(results)) return 'Search Results', contents - def html_getfile(path): - """Get and display a source file listing safely.""" - path = urllib.parse.unquote(path) - with tokenize.open(path) as fp: - lines = html.escape(fp.read()) - body = '
%s
' % lines - heading = html.heading( - 'File Listing', - '#ffffff', '#7799ee') - contents = heading + html.bigsection( - 'File: %s' % path, '#ffffff', '#ee77aa', body) - return 'getfile %s' % path, contents - def html_topics(): """Index of topic texts available.""" @@ -2649,8 +2633,6 @@ def get_html_page(url): op, _, url = url.partition('=') if op == "search?key": title, content = html_search(url) - elif op == "getfile?key": - title, content = html_getfile(url) elif op == "topic?key": # try topics first, then objects. try: diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index ffabb7f1b9407..0bbdc42c635be 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1374,18 +1374,12 @@ def test_url_requests(self): ("topic?key=def", "Pydoc: KEYWORD def"), ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"), ("foobar", "Pydoc: Error - foobar"), - ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"), ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) - path = string.__file__ - title = "Pydoc: getfile " + path - url = "getfile?key=" + path - self.call_url_handler(url, title) - class TestHelper(unittest.TestCase): def test_keywords(self): diff --git a/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst new file mode 100644 index 0000000000000..4b42dd05305a8 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst @@ -0,0 +1,4 @@ +CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module which +could be abused to read arbitrary files on the disk (directory traversal +vulnerability). Moreover, even source code of Python modules can contain +sensitive data like passwords. Vulnerability reported by David Schw?rer. From webhook-mailer at python.org Mon Mar 29 09:17:45 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 13:17:45 -0000 Subject: [Python-checkins] bpo-40645: Fix reference leak in the _hashopenssl extension (GH-25063) Message-ID: https://github.com/python/cpython/commit/70cdf1812cf479c6b1cd7435a6fc0679ec1fb0da commit: 70cdf1812cf479c6b1cd7435a6fc0679ec1fb0da branch: master author: Pablo Galindo committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T06:17:40-07:00 summary: bpo-40645: Fix reference leak in the _hashopenssl extension (GH-25063) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-29-11-55-06.bpo-40645.PhaT-B.rst M Modules/_hashopenssl.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-29-11-55-06.bpo-40645.PhaT-B.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-11-55-06.bpo-40645.PhaT-B.rst new file mode 100644 index 0000000000000..9ca9843947547 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-11-55-06.bpo-40645.PhaT-B.rst @@ -0,0 +1,2 @@ +Fix reference leak in the :mod:`_hashopenssl` extension. Patch by Pablo +Galindo. diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 6c83b9e4a41fa..ef927abf4859f 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -865,7 +865,7 @@ EVP_new_impl(PyObject *module, PyObject *name_obj, PyObject *data_obj, /*[clinic end generated code: output=ddd5053f92dffe90 input=c24554d0337be1b0]*/ { Py_buffer view = { 0 }; - PyObject *ret_obj; + PyObject *ret_obj = NULL; char *name; const EVP_MD *digest = NULL; @@ -879,13 +879,14 @@ EVP_new_impl(PyObject *module, PyObject *name_obj, PyObject *data_obj, digest = py_digest_by_name(name); if (digest == NULL) { - return NULL; + goto exit; } ret_obj = EVPnew(module, digest, (unsigned char*)view.buf, view.len, usedforsecurity); +exit: if (data_obj) PyBuffer_Release(&view); return ret_obj; From webhook-mailer at python.org Mon Mar 29 09:39:36 2021 From: webhook-mailer at python.org (corona10) Date: Mon, 29 Mar 2021 13:39:36 -0000 Subject: [Python-checkins] bpo-43433: Preserve query and fragment in the URL of the server in ServerProxy. (GH-25057) Message-ID: https://github.com/python/cpython/commit/c1b073a630bb731de18bb17afb2b8b1388b92a72 commit: c1b073a630bb731de18bb17afb2b8b1388b92a72 branch: master author: Serhiy Storchaka committer: corona10 date: 2021-03-29T22:39:31+09:00 summary: bpo-43433: Preserve query and fragment in the URL of the server in ServerProxy. (GH-25057) files: A Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst M Lib/test/test_xmlrpc.py M Lib/xmlrpc/client.py diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index c54aeb109450d..a9f67466071bc 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -698,11 +698,16 @@ def _marshaled_dispatch(self, data, dispatch_method=None, path=None): #on AF_INET only. URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() - paths = ["/foo", "/foo/bar"] + paths = [ + "/foo", "/foo/bar", + "/foo?k=v", "/foo#frag", "/foo?k=v#frag", + "", "/", "/RPC2", "?k=v", "#frag", + ] for path in paths: d = serv.add_dispatcher(path, xmlrpc.server.SimpleXMLRPCDispatcher()) d.register_introspection_functions() d.register_multicall_functions() + d.register_function(lambda p=path: p, 'test') serv.get_dispatcher(paths[0]).register_function(pow) serv.get_dispatcher(paths[1]).register_function(lambda x,y: x+y, 'add') serv.add_dispatcher("/is/broken", BrokenDispatcher()) @@ -1018,6 +1023,39 @@ def test_path3(self): p = xmlrpclib.ServerProxy(URL+"/is/broken") self.assertRaises(xmlrpclib.Fault, p.add, 6, 8) + def test_invalid_path(self): + p = xmlrpclib.ServerProxy(URL+"/invalid") + self.assertRaises(xmlrpclib.Fault, p.add, 6, 8) + + def test_path_query_fragment(self): + p = xmlrpclib.ServerProxy(URL+"/foo?k=v#frag") + self.assertEqual(p.test(), "/foo?k=v#frag") + + def test_path_fragment(self): + p = xmlrpclib.ServerProxy(URL+"/foo#frag") + self.assertEqual(p.test(), "/foo#frag") + + def test_path_query(self): + p = xmlrpclib.ServerProxy(URL+"/foo?k=v") + self.assertEqual(p.test(), "/foo?k=v") + + def test_empty_path(self): + p = xmlrpclib.ServerProxy(URL) + self.assertEqual(p.test(), "/RPC2") + + def test_root_path(self): + p = xmlrpclib.ServerProxy(URL + "/") + self.assertEqual(p.test(), "/") + + def test_empty_path_query(self): + p = xmlrpclib.ServerProxy(URL + "?k=v") + self.assertEqual(p.test(), "?k=v") + + def test_empty_path_fragment(self): + p = xmlrpclib.ServerProxy(URL + "#frag") + self.assertEqual(p.test(), "#frag") + + #A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism #does indeed serve subsequent requests on the same connection class BaseKeepaliveServerTestCase(BaseServerTestCase): diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index d15d60d2937a8..9e7449c88dfc0 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1421,11 +1421,13 @@ def __init__(self, uri, transport=None, encoding=None, verbose=False, # establish a "logical" server connection # get the url - p = urllib.parse.urlparse(uri) + p = urllib.parse.urlsplit(uri) if p.scheme not in ("http", "https"): raise OSError("unsupported XML-RPC protocol") self.__host = p.netloc - self.__handler = p.path or "/RPC2" + self.__handler = urllib.parse.urlunsplit(["", "", *p[2:]]) + if not self.__handler: + self.__handler = "/RPC2" if transport is None: if p.scheme == "https": diff --git a/Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst b/Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst new file mode 100644 index 0000000000000..2f67e316a5efc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst @@ -0,0 +1,2 @@ +:class:`xmlrpc.client.ServerProxy` no longer ignores query and fragment in +the URL of the server. From webhook-mailer at python.org Mon Mar 29 10:16:31 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 14:16:31 -0000 Subject: [Python-checkins] bpo-43648: Remove redundant datefmt option in logging file config (GH-25051) Message-ID: https://github.com/python/cpython/commit/7bfd65eba73d013eee8789f2009c09c61c31b800 commit: 7bfd65eba73d013eee8789f2009c09c61c31b800 branch: master author: Harry committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T07:16:19-07:00 summary: bpo-43648: Remove redundant datefmt option in logging file config (GH-25051) [bpo-43648](): Remove redundant datefmt option in logging file config Automerge-Triggered-By: GH:vsajip files: M Doc/howto/logging.rst diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index b4dd9206c9d52..fcc6bec768800 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -684,7 +684,6 @@ Here is the logging.conf file: [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s - datefmt= The output is nearly identical to that of the non-config-file-based example: From webhook-mailer at python.org Mon Mar 29 10:43:11 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 14:43:11 -0000 Subject: [Python-checkins] bpo-43433: Preserve query and fragment in the URL of the server in ServerProxy. (GH-25057) Message-ID: https://github.com/python/cpython/commit/5334605035d38139a04189ecb3899f36702517b2 commit: 5334605035d38139a04189ecb3899f36702517b2 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T07:43:02-07:00 summary: bpo-43433: Preserve query and fragment in the URL of the server in ServerProxy. (GH-25057) (cherry picked from commit c1b073a630bb731de18bb17afb2b8b1388b92a72) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst M Lib/test/test_xmlrpc.py M Lib/xmlrpc/client.py diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index f68af527eae85..75544035381a9 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -696,11 +696,16 @@ def _marshaled_dispatch(self, data, dispatch_method=None, path=None): #on AF_INET only. URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() - paths = ["/foo", "/foo/bar"] + paths = [ + "/foo", "/foo/bar", + "/foo?k=v", "/foo#frag", "/foo?k=v#frag", + "", "/", "/RPC2", "?k=v", "#frag", + ] for path in paths: d = serv.add_dispatcher(path, xmlrpc.server.SimpleXMLRPCDispatcher()) d.register_introspection_functions() d.register_multicall_functions() + d.register_function(lambda p=path: p, 'test') serv.get_dispatcher(paths[0]).register_function(pow) serv.get_dispatcher(paths[1]).register_function(lambda x,y: x+y, 'add') serv.add_dispatcher("/is/broken", BrokenDispatcher()) @@ -1016,6 +1021,39 @@ def test_path3(self): p = xmlrpclib.ServerProxy(URL+"/is/broken") self.assertRaises(xmlrpclib.Fault, p.add, 6, 8) + def test_invalid_path(self): + p = xmlrpclib.ServerProxy(URL+"/invalid") + self.assertRaises(xmlrpclib.Fault, p.add, 6, 8) + + def test_path_query_fragment(self): + p = xmlrpclib.ServerProxy(URL+"/foo?k=v#frag") + self.assertEqual(p.test(), "/foo?k=v#frag") + + def test_path_fragment(self): + p = xmlrpclib.ServerProxy(URL+"/foo#frag") + self.assertEqual(p.test(), "/foo#frag") + + def test_path_query(self): + p = xmlrpclib.ServerProxy(URL+"/foo?k=v") + self.assertEqual(p.test(), "/foo?k=v") + + def test_empty_path(self): + p = xmlrpclib.ServerProxy(URL) + self.assertEqual(p.test(), "/RPC2") + + def test_root_path(self): + p = xmlrpclib.ServerProxy(URL + "/") + self.assertEqual(p.test(), "/") + + def test_empty_path_query(self): + p = xmlrpclib.ServerProxy(URL + "?k=v") + self.assertEqual(p.test(), "?k=v") + + def test_empty_path_fragment(self): + p = xmlrpclib.ServerProxy(URL + "#frag") + self.assertEqual(p.test(), "#frag") + + #A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism #does indeed serve subsequent requests on the same connection class BaseKeepaliveServerTestCase(BaseServerTestCase): diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index d15d60d2937a8..9e7449c88dfc0 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1421,11 +1421,13 @@ def __init__(self, uri, transport=None, encoding=None, verbose=False, # establish a "logical" server connection # get the url - p = urllib.parse.urlparse(uri) + p = urllib.parse.urlsplit(uri) if p.scheme not in ("http", "https"): raise OSError("unsupported XML-RPC protocol") self.__host = p.netloc - self.__handler = p.path or "/RPC2" + self.__handler = urllib.parse.urlunsplit(["", "", *p[2:]]) + if not self.__handler: + self.__handler = "/RPC2" if transport is None: if p.scheme == "https": diff --git a/Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst b/Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst new file mode 100644 index 0000000000000..2f67e316a5efc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-28-23-50-20.bpo-43433.so9j5G.rst @@ -0,0 +1,2 @@ +:class:`xmlrpc.client.ServerProxy` no longer ignores query and fragment in +the URL of the server. From webhook-mailer at python.org Mon Mar 29 11:39:16 2021 From: webhook-mailer at python.org (ned-deily) Date: Mon, 29 Mar 2021 15:39:16 -0000 Subject: [Python-checkins] bpo-42988: Remove the pydoc getfile feature (GH-25015) (#25066) Message-ID: https://github.com/python/cpython/commit/7c2284f97d140c4e4a85382bfb3a42440be2464d commit: 7c2284f97d140c4e4a85382bfb3a42440be2464d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ned-deily date: 2021-03-29T11:39:05-04:00 summary: bpo-42988: Remove the pydoc getfile feature (GH-25015) (#25066) CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schw?rer. (cherry picked from commit 9b999479c0022edfc9835a8a1f06e046f3881048) Co-authored-by: Victor Stinner Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 978e4cd0baa5b..9677c0d0468db 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2348,9 +2348,6 @@ def page(self, title, contents): %s%s
%s
''' % (title, css_link, html_navbar(), contents) - def filelink(self, url, path): - return '%s' % (url, path) - html = _HTMLDoc() @@ -2436,19 +2433,6 @@ def bltinlink(name): 'key = %s' % key, '#ffffff', '#ee77aa', '
'.join(results)) return 'Search Results', contents - def html_getfile(path): - """Get and display a source file listing safely.""" - path = urllib.parse.unquote(path) - with tokenize.open(path) as fp: - lines = html.escape(fp.read()) - body = '
%s
' % lines - heading = html.heading( - 'File Listing', - '#ffffff', '#7799ee') - contents = heading + html.bigsection( - 'File: %s' % path, '#ffffff', '#ee77aa', body) - return 'getfile %s' % path, contents - def html_topics(): """Index of topic texts available.""" @@ -2540,8 +2524,6 @@ def get_html_page(url): op, _, url = url.partition('=') if op == "search?key": title, content = html_search(url) - elif op == "getfile?key": - title, content = html_getfile(url) elif op == "topic?key": # try topics first, then objects. try: diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 198cea93eb52d..baad8212c573d 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1049,18 +1049,12 @@ def test_url_requests(self): ("topic?key=def", "Pydoc: KEYWORD def"), ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"), ("foobar", "Pydoc: Error - foobar"), - ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"), ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) - path = string.__file__ - title = "Pydoc: getfile " + path - url = "getfile?key=" + path - self.call_url_handler(url, title) - class TestHelper(unittest.TestCase): def test_keywords(self): diff --git a/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst new file mode 100644 index 0000000000000..4b42dd05305a8 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst @@ -0,0 +1,4 @@ +CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module which +could be abused to read arbitrary files on the disk (directory traversal +vulnerability). Moreover, even source code of Python modules can contain +sensitive data like passwords. Vulnerability reported by David Schw?rer. From webhook-mailer at python.org Mon Mar 29 11:41:03 2021 From: webhook-mailer at python.org (ned-deily) Date: Mon, 29 Mar 2021 15:41:03 -0000 Subject: [Python-checkins] bpo-42988: Remove the pydoc getfile feature (GH-25015) (GH-25067) Message-ID: https://github.com/python/cpython/commit/5b1e50256b6532667b6d31debc350f6c7d3f30aa commit: 5b1e50256b6532667b6d31debc350f6c7d3f30aa branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ned-deily date: 2021-03-29T11:40:53-04:00 summary: bpo-42988: Remove the pydoc getfile feature (GH-25015) (GH-25067) CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schw?rer. (cherry picked from commit 9b999479c0022edfc9835a8a1f06e046f3881048) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst M Lib/pydoc.py M Lib/test/test_pydoc.py diff --git a/Lib/pydoc.py b/Lib/pydoc.py index b521a5504728c..5247ef9ea27aa 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2312,9 +2312,6 @@ def page(self, title, contents): %s%s
%s
''' % (title, css_link, html_navbar(), contents) - def filelink(self, url, path): - return '%s' % (url, path) - html = _HTMLDoc() @@ -2400,19 +2397,6 @@ def bltinlink(name): 'key = %s' % key, '#ffffff', '#ee77aa', '
'.join(results)) return 'Search Results', contents - def html_getfile(path): - """Get and display a source file listing safely.""" - path = urllib.parse.unquote(path) - with tokenize.open(path) as fp: - lines = html.escape(fp.read()) - body = '
%s
' % lines - heading = html.heading( - 'File Listing', - '#ffffff', '#7799ee') - contents = heading + html.bigsection( - 'File: %s' % path, '#ffffff', '#ee77aa', body) - return 'getfile %s' % path, contents - def html_topics(): """Index of topic texts available.""" @@ -2504,8 +2488,6 @@ def get_html_page(url): op, _, url = url.partition('=') if op == "search?key": title, content = html_search(url) - elif op == "getfile?key": - title, content = html_getfile(url) elif op == "topic?key": # try topics first, then objects. try: diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 00803d3305cb5..49bc3eb164b19 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1052,18 +1052,12 @@ def test_url_requests(self): ("topic?key=def", "Pydoc: KEYWORD def"), ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"), ("foobar", "Pydoc: Error - foobar"), - ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"), ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) - path = string.__file__ - title = "Pydoc: getfile " + path - url = "getfile?key=" + path - self.call_url_handler(url, title) - class TestHelper(unittest.TestCase): def test_keywords(self): diff --git a/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst new file mode 100644 index 0000000000000..4b42dd05305a8 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-03-24-14-16-56.bpo-42988.P2aNco.rst @@ -0,0 +1,4 @@ +CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module which +could be abused to read arbitrary files on the disk (directory traversal +vulnerability). Moreover, even source code of Python modules can contain +sensitive data like passwords. Vulnerability reported by David Schw?rer. From webhook-mailer at python.org Mon Mar 29 13:22:43 2021 From: webhook-mailer at python.org (jcea) Date: Mon, 29 Mar 2021 17:22:43 -0000 Subject: [Python-checkins] bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (#24995) Message-ID: https://github.com/python/cpython/commit/32430aadadf6e012e39167d3c18a24e49fb84874 commit: 32430aadadf6e012e39167d3c18a24e49fb84874 branch: master author: Jes?s Cea committer: jcea date: 2021-03-29T19:22:13+02:00 summary: bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (#24995) Before: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0002.png After: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0003.png files: A Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst M Lib/concurrent/futures/_base.py diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index 00eb54881f295..6095026cb278b 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -386,7 +386,11 @@ def done(self): def __get_result(self): if self._exception: - raise self._exception + try: + raise self._exception + finally: + # Break a reference cycle with the exception in self._exception + self = None else: return self._result @@ -426,20 +430,24 @@ def result(self, timeout=None): timeout. Exception: If the call raised then that exception will be raised. """ - with self._condition: - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - - self._condition.wait(timeout) - - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - else: - raise TimeoutError() + try: + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + else: + raise TimeoutError() + finally: + # Break a reference cycle with the exception in self._exception + self = None def exception(self, timeout=None): """Return the exception raised by the call that the future represents. diff --git a/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst b/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst new file mode 100644 index 0000000000000..71c6012f52b8f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst @@ -0,0 +1,2 @@ +Raising an exception raised in a "future" instance will create reference +cycles. From webhook-mailer at python.org Mon Mar 29 13:53:22 2021 From: webhook-mailer at python.org (jcea) Date: Mon, 29 Mar 2021 17:53:22 -0000 Subject: [Python-checkins] bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (GH-24995) (#25071) Message-ID: https://github.com/python/cpython/commit/dae1963cf38f730291126b7dadfda89ffb21cefd commit: dae1963cf38f730291126b7dadfda89ffb21cefd branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: jcea date: 2021-03-29T19:53:14+02:00 summary: bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (GH-24995) (#25071) Before: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0002.png After: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0003.png (cherry picked from commit 32430aadadf6e012e39167d3c18a24e49fb84874) Co-authored-by: Jes?s Cea Co-authored-by: Jes?s Cea files: A Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst M Lib/concurrent/futures/_base.py diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index 6001e3bdb81bb..fd2b244a04469 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -385,7 +385,11 @@ def done(self): def __get_result(self): if self._exception: - raise self._exception + try: + raise self._exception + finally: + # Break a reference cycle with the exception in self._exception + self = None else: return self._result @@ -425,20 +429,24 @@ def result(self, timeout=None): timeout. Exception: If the call raised then that exception will be raised. """ - with self._condition: - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - - self._condition.wait(timeout) - - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - else: - raise TimeoutError() + try: + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + else: + raise TimeoutError() + finally: + # Break a reference cycle with the exception in self._exception + self = None def exception(self, timeout=None): """Return the exception raised by the call that the future represents. diff --git a/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst b/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst new file mode 100644 index 0000000000000..71c6012f52b8f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst @@ -0,0 +1,2 @@ +Raising an exception raised in a "future" instance will create reference +cycles. From webhook-mailer at python.org Mon Mar 29 13:53:59 2021 From: webhook-mailer at python.org (jcea) Date: Mon, 29 Mar 2021 17:53:59 -0000 Subject: [Python-checkins] bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (GH-24995) (#25070) Message-ID: https://github.com/python/cpython/commit/d914813a7a9cee3b42e9c91f91ac491f3bbfe118 commit: d914813a7a9cee3b42e9c91f91ac491f3bbfe118 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: jcea date: 2021-03-29T19:53:54+02:00 summary: bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (GH-24995) (#25070) Before: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0002.png After: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0003.png (cherry picked from commit 32430aadadf6e012e39167d3c18a24e49fb84874) Co-authored-by: Jes?s Cea Co-authored-by: Jes?s Cea files: A Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst M Lib/concurrent/futures/_base.py diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index 00eb54881f295..6095026cb278b 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -386,7 +386,11 @@ def done(self): def __get_result(self): if self._exception: - raise self._exception + try: + raise self._exception + finally: + # Break a reference cycle with the exception in self._exception + self = None else: return self._result @@ -426,20 +430,24 @@ def result(self, timeout=None): timeout. Exception: If the call raised then that exception will be raised. """ - with self._condition: - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - - self._condition.wait(timeout) - - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - else: - raise TimeoutError() + try: + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + else: + raise TimeoutError() + finally: + # Break a reference cycle with the exception in self._exception + self = None def exception(self, timeout=None): """Return the exception raised by the call that the future represents. diff --git a/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst b/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst new file mode 100644 index 0000000000000..71c6012f52b8f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-23-17-18-56.bpo-35930.RZ51pM.rst @@ -0,0 +1,2 @@ +Raising an exception raised in a "future" instance will create reference +cycles. From webhook-mailer at python.org Mon Mar 29 15:06:42 2021 From: webhook-mailer at python.org (serhiy-storchaka) Date: Mon, 29 Mar 2021 19:06:42 -0000 Subject: [Python-checkins] bpo-43659: Fix test_curses on AIX (GH-25074) Message-ID: https://github.com/python/cpython/commit/c8b5738810516df5722caf049003e9b319427bec commit: c8b5738810516df5722caf049003e9b319427bec branch: master author: Michael Felt committer: serhiy-storchaka date: 2021-03-29T22:06:24+03:00 summary: bpo-43659: Fix test_curses on AIX (GH-25074) curses.update_lines_cols() is only defined when the curses library provides either resizeterm() or resize_term() functions which are optional and are not provided on AIX. files: M Lib/test/test_curses.py diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 0833c86115ebd..7ce0461ab54f2 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -1174,6 +1174,7 @@ def test_issue13051(self): class MiscTests(unittest.TestCase): + @requires_curses_func('update_lines_cols') def test_update_lines_cols(self): curses.update_lines_cols() lines, cols = curses.LINES, curses.COLS From webhook-mailer at python.org Mon Mar 29 15:26:47 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 19:26:47 -0000 Subject: [Python-checkins] bpo-43659: Fix test_curses on AIX (GH-25074) Message-ID: https://github.com/python/cpython/commit/e9092b221d4951609827e437178a557fd07353af commit: e9092b221d4951609827e437178a557fd07353af branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T12:26:37-07:00 summary: bpo-43659: Fix test_curses on AIX (GH-25074) curses.update_lines_cols() is only defined when the curses library provides either resizeterm() or resize_term() functions which are optional and are not provided on AIX. (cherry picked from commit c8b5738810516df5722caf049003e9b319427bec) Co-authored-by: Michael Felt files: M Lib/test/test_curses.py diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 7dd0695aa7277..c5914698f129f 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -1151,6 +1151,7 @@ def test_issue13051(self): class MiscTests(unittest.TestCase): + @requires_curses_func('update_lines_cols') def test_update_lines_cols(self): curses.update_lines_cols() lines, cols = curses.LINES, curses.COLS From webhook-mailer at python.org Mon Mar 29 15:31:11 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 19:31:11 -0000 Subject: [Python-checkins] bpo-43659: Fix test_curses on AIX (GH-25074) Message-ID: https://github.com/python/cpython/commit/f1d53bcd536036c0a0c39962fbc0f465b5865492 commit: f1d53bcd536036c0a0c39962fbc0f465b5865492 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T12:31:01-07:00 summary: bpo-43659: Fix test_curses on AIX (GH-25074) curses.update_lines_cols() is only defined when the curses library provides either resizeterm() or resize_term() functions which are optional and are not provided on AIX. (cherry picked from commit c8b5738810516df5722caf049003e9b319427bec) Co-authored-by: Michael Felt files: M Lib/test/test_curses.py diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index c1ad23b456e20..4bdc2379fd1ed 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -1167,6 +1167,7 @@ def test_issue13051(self): class MiscTests(unittest.TestCase): + @requires_curses_func('update_lines_cols') def test_update_lines_cols(self): curses.update_lines_cols() lines, cols = curses.LINES, curses.COLS From webhook-mailer at python.org Mon Mar 29 15:36:56 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 29 Mar 2021 19:36:56 -0000 Subject: [Python-checkins] bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) (GH-24906) Message-ID: https://github.com/python/cpython/commit/3b6e61ee0812359029cac176042d9c835c60f185 commit: 3b6e61ee0812359029cac176042d9c835c60f185 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vstinner date: 2021-03-29T21:36:47+02:00 summary: bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) (GH-24906) Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range. Use MAX_UNICODE constant in unicodeobject.c. (cherry picked from commit 9976834f807ea63ca51bc4f89be457d734148682) Co-authored-by: Victor Stinner Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst M Lib/test/test_cmd_line.py M Objects/unicodeobject.c M Python/fileutils.c diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index a5ece9bd611f4..871a9c7a25529 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -190,38 +190,72 @@ def test_undecodable_code(self): if not stdout.startswith(pattern): raise AssertionError("%a doesn't start with %a" % (stdout, pattern)) + @unittest.skipIf(sys.platform == 'win32', + 'Windows has a native unicode API') + def test_invalid_utf8_arg(self): + # bpo-35883: Py_DecodeLocale() must escape b'\xfd\xbf\xbf\xbb\xba\xba' + # byte sequence with surrogateescape rather than decoding it as the + # U+7fffbeba character which is outside the [U+0000; U+10ffff] range of + # Python Unicode characters. + # + # Test with default config, in the C locale, in the Python UTF-8 Mode. + code = 'import sys, os; s=os.fsencode(sys.argv[1]); print(ascii(s))' + base_cmd = [sys.executable, '-c', code] + + def run_default(arg): + cmd = [sys.executable, '-c', code, arg] + return subprocess.run(cmd, stdout=subprocess.PIPE, text=True) + + def run_c_locale(arg): + cmd = [sys.executable, '-c', code, arg] + env = dict(os.environ) + env['LC_ALL'] = 'C' + return subprocess.run(cmd, stdout=subprocess.PIPE, + text=True, env=env) + + def run_utf8_mode(arg): + cmd = [sys.executable, '-X', 'utf8', '-c', code, arg] + return subprocess.run(cmd, stdout=subprocess.PIPE, text=True) + + valid_utf8 = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') + # invalid UTF-8 byte sequences with a valid UTF-8 sequence + # in the middle. + invalid_utf8 = ( + b'\xff' # invalid byte + b'\xc3\xff' # invalid byte sequence + b'\xc3\xa9' # valid utf-8: U+00E9 character + b'\xed\xa0\x80' # lone surrogate character (invalid) + b'\xfd\xbf\xbf\xbb\xba\xba' # character outside [U+0000; U+10ffff] + ) + test_args = [valid_utf8, invalid_utf8] + + for run_cmd in (run_default, run_c_locale, run_utf8_mode): + with self.subTest(run_cmd=run_cmd): + for arg in test_args: + proc = run_cmd(arg) + self.assertEqual(proc.stdout.rstrip(), ascii(arg)) + @unittest.skipUnless((sys.platform == 'darwin' or support.is_android), 'test specific to Mac OS X and Android') def test_osx_android_utf8(self): - def check_output(text): - decoded = text.decode('utf-8', 'surrogateescape') - expected = ascii(decoded).encode('ascii') + b'\n' + text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') + code = "import sys; print(ascii(sys.argv[1]))" - env = os.environ.copy() - # C locale gives ASCII locale encoding, but Python uses UTF-8 - # to parse the command line arguments on Mac OS X and Android. - env['LC_ALL'] = 'C' + decoded = text.decode('utf-8', 'surrogateescape') + expected = ascii(decoded).encode('ascii') + b'\n' - p = subprocess.Popen( - (sys.executable, "-c", "import sys; print(ascii(sys.argv[1]))", text), - stdout=subprocess.PIPE, - env=env) - stdout, stderr = p.communicate() - self.assertEqual(stdout, expected) - self.assertEqual(p.returncode, 0) + env = os.environ.copy() + # C locale gives ASCII locale encoding, but Python uses UTF-8 + # to parse the command line arguments on Mac OS X and Android. + env['LC_ALL'] = 'C' - # test valid utf-8 - text = 'e:\xe9, euro:\u20ac, non-bmp:\U0010ffff'.encode('utf-8') - check_output(text) - - # test invalid utf-8 - text = ( - b'\xff' # invalid byte - b'\xc3\xa9' # valid utf-8 character - b'\xc3\xff' # invalid byte sequence - b'\xed\xa0\x80' # lone surrogate character (invalid) - ) - check_output(text) + p = subprocess.Popen( + (sys.executable, "-c", code, text), + stdout=subprocess.PIPE, + env=env) + stdout, stderr = p.communicate() + self.assertEqual(stdout, expected) + self.assertEqual(p.returncode, 0) def test_unbuffered_output(self): # Test expected operation of the '-u' switch diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst new file mode 100644 index 0000000000000..46742429db64b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst @@ -0,0 +1,4 @@ +Python no longer fails at startup with a fatal error if a command line +argument contains an invalid Unicode character. The +:c:func:`Py_DecodeLocale` function now escapes byte sequences which would be +decoded as Unicode characters outside the [U+0000; U+10ffff] range. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a038e0d4c06e7..28f9c9bb0634b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -90,7 +90,8 @@ NOTE: In the interpreter's initialization phase, some globals are currently extern "C" { #endif -/* Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) */ +// Maximum code point of Unicode 6.0: 0x10ffff (1,114,111). +// The value must be the same in fileutils.c. #define MAX_UNICODE 0x10ffff #ifdef Py_DEBUG @@ -1707,8 +1708,8 @@ find_maxchar_surrogates(const wchar_t *begin, const wchar_t *end, *maxchar = ch; if (*maxchar > MAX_UNICODE) { PyErr_Format(PyExc_ValueError, - "character U+%x is not in range [U+0000; U+10ffff]", - ch); + "character U+%x is not in range [U+0000; U+%x]", + ch, MAX_UNICODE); return -1; } } @@ -13610,7 +13611,7 @@ _PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, { case PyUnicode_1BYTE_KIND: maxchar = 0xff; break; case PyUnicode_2BYTE_KIND: maxchar = 0xffff; break; - case PyUnicode_4BYTE_KIND: maxchar = 0x10ffff; break; + case PyUnicode_4BYTE_KIND: maxchar = MAX_UNICODE; break; default: Py_UNREACHABLE(); } diff --git a/Python/fileutils.c b/Python/fileutils.c index fd2d5faa0fdf7..3e1311c978686 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -33,6 +33,13 @@ extern int winerror_to_errno(int); int _Py_open_cloexec_works = -1; #endif +// The value must be the same in unicodeobject.c. +#define MAX_UNICODE 0x10ffff + +// mbstowcs() and mbrtowc() errors +static const size_t DECODE_ERROR = ((size_t)-1); +static const size_t INCOMPLETE_CHARACTER = (size_t)-2; + static int get_surrogateescape(_Py_error_handler errors, int *surrogateescape) @@ -85,6 +92,57 @@ _Py_device_encoding(int fd) Py_RETURN_NONE; } + +static size_t +is_valid_wide_char(wchar_t ch) +{ + if (Py_UNICODE_IS_SURROGATE(ch)) { + // Reject lone surrogate characters + return 0; + } + if (ch > MAX_UNICODE) { + // bpo-35883: Reject characters outside [U+0000; U+10ffff] range. + // The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629, + // it creates characters outside the [U+0000; U+10ffff] range: + // https://sourceware.org/bugzilla/show_bug.cgi?id=2373 + return 0; + } + return 1; +} + + +static size_t +_Py_mbstowcs(wchar_t *dest, const char *src, size_t n) +{ + size_t count = mbstowcs(dest, src, n); + if (dest != NULL && count != DECODE_ERROR) { + for (size_t i=0; i < count; i++) { + wchar_t ch = dest[i]; + if (!is_valid_wide_char(ch)) { + return DECODE_ERROR; + } + } + } + return count; +} + + +#ifdef HAVE_MBRTOWC +static size_t +_Py_mbrtowc(wchar_t *pwc, const char *str, size_t len, mbstate_t *pmbs) +{ + assert(pwc != NULL); + size_t count = mbrtowc(pwc, str, len, pmbs); + if (count != 0 && count != DECODE_ERROR && count != INCOMPLETE_CHARACTER) { + if (!is_valid_wide_char(*pwc)) { + return DECODE_ERROR; + } + } + return count; +} +#endif + + #if !defined(_Py_FORCE_UTF8_FS_ENCODING) && !defined(MS_WINDOWS) #define USE_FORCE_ASCII @@ -151,8 +209,8 @@ check_force_ascii(void) size_t res; ch = (unsigned char)0xA7; - res = mbstowcs(&wch, (char*)&ch, 1); - if (res != (size_t)-1 && wch == L'\xA7') { + res = _Py_mbstowcs(&wch, (char*)&ch, 1); + if (res != DECODE_ERROR && wch == L'\xA7') { /* On HP-UX withe C locale or the POSIX locale, nl_langinfo(CODESET) announces "roman8", whereas mbstowcs() uses Latin1 encoding in practice. Force ASCII in this case. @@ -199,8 +257,8 @@ check_force_ascii(void) unsigned uch = (unsigned char)i; ch[0] = (char)uch; - res = mbstowcs(wch, ch, 1); - if (res != (size_t)-1) { + res = _Py_mbstowcs(wch, ch, 1); + if (res != DECODE_ERROR) { /* decoding a non-ASCII character from the locale encoding succeed: the locale encoding is not ASCII, force ASCII */ return 1; @@ -390,9 +448,9 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, */ argsize = strlen(arg); #else - argsize = mbstowcs(NULL, arg, 0); + argsize = _Py_mbstowcs(NULL, arg, 0); #endif - if (argsize != (size_t)-1) { + if (argsize != DECODE_ERROR) { if (argsize > PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { return -1; } @@ -401,21 +459,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, return -1; } - count = mbstowcs(res, arg, argsize + 1); - if (count != (size_t)-1) { - wchar_t *tmp; - /* Only use the result if it contains no - surrogate characters. */ - for (tmp = res; *tmp != 0 && - !Py_UNICODE_IS_SURROGATE(*tmp); tmp++) - ; - if (*tmp == 0) { - if (wlen != NULL) { - *wlen = count; - } - *wstr = res; - return 0; + count = _Py_mbstowcs(res, arg, argsize + 1); + if (count != DECODE_ERROR) { + *wstr = res; + if (wlen != NULL) { + *wlen = count; } + return 0; } PyMem_RawFree(res); } @@ -439,13 +489,13 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, out = res; memset(&mbs, 0, sizeof mbs); while (argsize) { - size_t converted = mbrtowc(out, (char*)in, argsize, &mbs); + size_t converted = _Py_mbrtowc(out, (char*)in, argsize, &mbs); if (converted == 0) { /* Reached end of string; null char stored. */ break; } - if (converted == (size_t)-2) { + if (converted == INCOMPLETE_CHARACTER) { /* Incomplete character. This should never happen, since we provide everything that we have - unless there is a bug in the C library, or I @@ -453,32 +503,22 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen, goto decode_error; } - if (converted == (size_t)-1) { + if (converted == DECODE_ERROR) { if (!surrogateescape) { goto decode_error; } - /* Conversion error. Escape as UTF-8b, and start over - in the initial shift state. */ + /* Decoding error. Escape as UTF-8b, and start over in the initial + shift state. */ *out++ = 0xdc00 + *in++; argsize--; memset(&mbs, 0, sizeof mbs); continue; } - if (Py_UNICODE_IS_SURROGATE(*out)) { - if (!surrogateescape) { - goto decode_error; - } + // _Py_mbrtowc() reject lone surrogate characters + assert(!Py_UNICODE_IS_SURROGATE(*out)); - /* Surrogate character. Escape the original - byte sequence with surrogateescape. */ - argsize -= converted; - while (converted--) { - *out++ = 0xdc00 + *in++; - } - continue; - } /* successfully converted some bytes */ in += converted; argsize -= converted; @@ -655,7 +695,7 @@ encode_current_locale(const wchar_t *text, char **str, else { converted = wcstombs(NULL, buf, 0); } - if (converted == (size_t)-1) { + if (converted == DECODE_ERROR) { goto encode_error; } if (bytes != NULL) { @@ -1371,7 +1411,7 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode) char cmode[10]; size_t r; r = wcstombs(cmode, mode, 10); - if (r == (size_t)-1 || r >= 10) { + if (r == DECODE_ERROR || r >= 10) { errno = EINVAL; return NULL; } From webhook-mailer at python.org Mon Mar 29 15:37:41 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 29 Mar 2021 19:37:41 -0000 Subject: [Python-checkins] bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) (GH-25046) Message-ID: https://github.com/python/cpython/commit/acb584958e215aff8fc8f5e2eb3fef481b662f69 commit: acb584958e215aff8fc8f5e2eb3fef481b662f69 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vstinner date: 2021-03-29T21:37:32+02:00 summary: bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) (GH-25046) This test checks result code of the connection directly, so it never raises an exception that can be suppressed by `support.transient_internet`. Directly support skipping the test in case of unreachable network. (cherry picked from commit 29c451c6989c3c94fa0a9facf187c24f3cbf2420) Co-authored-by: Carl Meyer Co-authored-by: Carl Meyer files: M Lib/test/test_ssl.py diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 738929e3195bc..ae9a0b2efc985 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2276,6 +2276,8 @@ def test_timeout_connect_ex(self): rc = s.connect_ex((REMOTE_HOST, 443)) if rc == 0: self.skipTest("REMOTE_HOST responded too quickly") + elif rc == errno.ENETUNREACH: + self.skipTest("Network unreachable.") self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK)) @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6') From webhook-mailer at python.org Mon Mar 29 15:37:43 2021 From: webhook-mailer at python.org (vstinner) Date: Mon, 29 Mar 2021 19:37:43 -0000 Subject: [Python-checkins] bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) (GH-25047) Message-ID: https://github.com/python/cpython/commit/20b2f2bfc2e72c6d9ed983d1f0aa7a141e9b3fc3 commit: 20b2f2bfc2e72c6d9ed983d1f0aa7a141e9b3fc3 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: vstinner date: 2021-03-29T21:37:38+02:00 summary: bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) (GH-25047) This test checks result code of the connection directly, so it never raises an exception that can be suppressed by `support.transient_internet`. Directly support skipping the test in case of unreachable network. (cherry picked from commit 29c451c6989c3c94fa0a9facf187c24f3cbf2420) Co-authored-by: Carl Meyer Co-authored-by: Carl Meyer files: M Lib/test/test_ssl.py diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 3d995db6d1ea1..ec7bb74d28ce6 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2271,6 +2271,8 @@ def test_timeout_connect_ex(self): rc = s.connect_ex((REMOTE_HOST, 443)) if rc == 0: self.skipTest("REMOTE_HOST responded too quickly") + elif rc == errno.ENETUNREACH: + self.skipTest("Network unreachable.") self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK)) @unittest.skipUnless(support.IPV6_ENABLED, 'Needs IPv6') From webhook-mailer at python.org Mon Mar 29 18:39:00 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 29 Mar 2021 22:39:00 -0000 Subject: [Python-checkins] bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) Message-ID: https://github.com/python/cpython/commit/09b90a037d18f5d4acdf1b14082e57bda78e85d3 commit: 09b90a037d18f5d4acdf1b14082e57bda78e85d3 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-29T23:38:51+01:00 summary: bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst M Lib/test/test_sys.py M Python/pythonrun.c diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 5b004c2b52da8..ee39375af3160 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1512,6 +1512,21 @@ def test_asyncgen_hooks(self): self.assertIsNone(cur.firstiter) self.assertIsNone(cur.finalizer) + def test_changing_sys_stderr_and_removing_reference(self): + # If the default displayhook doesn't take a strong reference + # to sys.stderr the following code can crash. See bpo-43660 + # for more details. + code = textwrap.dedent(''' + import sys + class MyStderr: + def write(self, s): + sys.stderr = None + sys.stderr = MyStderr() + 1/0 + ''') + rc, out, err = assert_python_failure('-c', code) + self.assertEqual(out, b"") + self.assertEqual(err, b"") if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst new file mode 100644 index 0000000000000..98419501d9e7b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst @@ -0,0 +1,3 @@ +Fix crash that happens when replacing ``sys.stderr`` with a callable that +can remove the object while an exception is being printed. Patch by Pablo +Galindo. diff --git a/Python/pythonrun.c b/Python/pythonrun.c index b562875f8a4fb..1715cde49dd68 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1082,8 +1082,9 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) if (file == Py_None) { return; } - + Py_INCREF(file); _PyErr_Display(file, exception, value, tb); + Py_DECREF(file); } PyObject * From webhook-mailer at python.org Mon Mar 29 19:03:25 2021 From: webhook-mailer at python.org (miss-islington) Date: Mon, 29 Mar 2021 23:03:25 -0000 Subject: [Python-checkins] bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) Message-ID: https://github.com/python/cpython/commit/ba7f8638f93b5d999b25d8556ca19bdc2e12f359 commit: ba7f8638f93b5d999b25d8556ca19bdc2e12f359 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T16:03:16-07:00 summary: bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) (cherry picked from commit 09b90a037d18f5d4acdf1b14082e57bda78e85d3) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst M Lib/test/test_sys.py M Python/pythonrun.c diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index af0e54bd0e238..140c65aa3bfa2 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1441,6 +1441,21 @@ def test_asyncgen_hooks(self): self.assertIsNone(cur.firstiter) self.assertIsNone(cur.finalizer) + def test_changing_sys_stderr_and_removing_reference(self): + # If the default displayhook doesn't take a strong reference + # to sys.stderr the following code can crash. See bpo-43660 + # for more details. + code = textwrap.dedent(''' + import sys + class MyStderr: + def write(self, s): + sys.stderr = None + sys.stderr = MyStderr() + 1/0 + ''') + rc, out, err = assert_python_failure('-c', code) + self.assertEqual(out, b"") + self.assertEqual(err, b"") if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst new file mode 100644 index 0000000000000..98419501d9e7b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst @@ -0,0 +1,3 @@ +Fix crash that happens when replacing ``sys.stderr`` with a callable that +can remove the object while an exception is being printed. Patch by Pablo +Galindo. diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 3831e81ee9b89..c55e7674a665c 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1034,8 +1034,9 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) if (file == Py_None) { return; } - + Py_INCREF(file); _PyErr_Display(file, exception, value, tb); + Py_DECREF(file); } PyObject * From webhook-mailer at python.org Mon Mar 29 19:24:24 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 29 Mar 2021 23:24:24 -0000 Subject: [Python-checkins] [3.7] bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075). (GH-25085) Message-ID: https://github.com/python/cpython/commit/2f01c562be913004e1d46fc02705c51b81638d67 commit: 2f01c562be913004e1d46fc02705c51b81638d67 branch: 3.7 author: Pablo Galindo committer: pablogsal date: 2021-03-30T00:24:17+01:00 summary: [3.7] bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075). (GH-25085) (cherry picked from commit 09b90a037d18f5d4acdf1b14082e57bda78e85d3) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst M Lib/test/test_sys.py M Python/pythonrun.c diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 84927a393f175..0478f20cd33b4 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1292,6 +1292,21 @@ def test_asyncgen_hooks(self): self.assertIsNone(cur.firstiter) self.assertIsNone(cur.finalizer) + def test_changing_sys_stderr_and_removing_reference(self): + # If the default displayhook doesn't take a strong reference + # to sys.stderr the following code can crash. See bpo-43660 + # for more details. + code = textwrap.dedent(''' + import sys + class MyStderr: + def write(self, s): + sys.stderr = None + sys.stderr = MyStderr() + 1/0 + ''') + rc, out, err = assert_python_failure('-c', code) + self.assertEqual(out, b"") + self.assertEqual(err, b"") def test_main(): test.support.run_unittest(SysModuleTest, SizeofTest) diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst new file mode 100644 index 0000000000000..98419501d9e7b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst @@ -0,0 +1,3 @@ +Fix crash that happens when replacing ``sys.stderr`` with a callable that +can remove the object while an exception is being printed. Patch by Pablo +Galindo. diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 4c974cef39c78..b7b77d1f9ee3f 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -932,7 +932,9 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) seen = PySet_New(NULL); if (seen == NULL) PyErr_Clear(); + Py_INCREF(f); print_exception_recursive(f, value, seen); + Py_DECREF(f); Py_XDECREF(seen); } } From webhook-mailer at python.org Mon Mar 29 19:24:37 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 29 Mar 2021 23:24:37 -0000 Subject: [Python-checkins] bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) (GH-25083) Message-ID: https://github.com/python/cpython/commit/ff4715a7332123713de9920e724bb6c412d8ccef commit: ff4715a7332123713de9920e724bb6c412d8ccef branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: pablogsal date: 2021-03-30T00:24:33+01:00 summary: bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) (GH-25083) (cherry picked from commit 09b90a037d18f5d4acdf1b14082e57bda78e85d3) Co-authored-by: Pablo Galindo Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst M Lib/test/test_sys.py M Python/pythonrun.c diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index fc6c1ef1acd7c..fce6b98299f78 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1417,6 +1417,21 @@ def test_asyncgen_hooks(self): self.assertIsNone(cur.firstiter) self.assertIsNone(cur.finalizer) + def test_changing_sys_stderr_and_removing_reference(self): + # If the default displayhook doesn't take a strong reference + # to sys.stderr the following code can crash. See bpo-43660 + # for more details. + code = textwrap.dedent(''' + import sys + class MyStderr: + def write(self, s): + sys.stderr = None + sys.stderr = MyStderr() + 1/0 + ''') + rc, out, err = assert_python_failure('-c', code) + self.assertEqual(out, b"") + self.assertEqual(err, b"") if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst new file mode 100644 index 0000000000000..98419501d9e7b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-29-19-50-34.bpo-43660.scTgag.rst @@ -0,0 +1,3 @@ +Fix crash that happens when replacing ``sys.stderr`` with a callable that +can remove the object while an exception is being printed. Patch by Pablo +Galindo. diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 04540989f3043..34cfb7f4b4fd7 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1072,8 +1072,9 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) if (file == Py_None) { return; } - + Py_INCREF(file); _PyErr_Display(file, exception, value, tb); + Py_DECREF(file); } PyObject * From webhook-mailer at python.org Mon Mar 29 19:24:53 2021 From: webhook-mailer at python.org (pablogsal) Date: Mon, 29 Mar 2021 23:24:53 -0000 Subject: [Python-checkins] Fix tokenizer error when raw decoding null bytes (GH-25080) Message-ID: https://github.com/python/cpython/commit/92a02c1f7e2dcdc62913a4236589e7e5d96172b9 commit: 92a02c1f7e2dcdc62913a4236589e7e5d96172b9 branch: master author: Pablo Galindo committer: pablogsal date: 2021-03-30T00:24:49+01:00 summary: Fix tokenizer error when raw decoding null bytes (GH-25080) files: M Parser/tokenizer.c diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index d18fffaf3dbda..ad32293d70b78 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -813,6 +813,9 @@ tok_readline_raw(struct tok_state *tok) tok_concatenate_interactive_new_line(tok, line) == -1) { return 0; } + if (*tok->inp == '\0') { + return 0; + } tok->inp = strchr(tok->inp, '\0'); } while (tok->inp[-1] != '\n'); return 1; @@ -963,7 +966,7 @@ tok_underflow_file(struct tok_state *tok) { if (tok->lineno > 2) { tok->decoding_state = STATE_NORMAL; } - else if (!check_coding_spec(tok->cur, tok->end - tok->cur, + else if (!check_coding_spec(tok->cur, strlen(tok->cur), tok, fp_setreadl)) { return 0; From webhook-mailer at python.org Mon Mar 29 20:00:41 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 00:00:41 -0000 Subject: [Python-checkins] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) Message-ID: https://github.com/python/cpython/commit/a54fc683f237d8f0b6e999a63aa9b8c0a45b7fef commit: a54fc683f237d8f0b6e999a63aa9b8c0a45b7fef branch: master author: Christian Heimes committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T17:00:34-07:00 summary: bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) - [x] Build OpenSSL 1.1.1k for macOS - [x] Build OpenSSL 1.1.1k for Windows I have also updated multissl tester and various CI configurations to use latest OpenSSL. The versions were all over the place. Signed-off-by: Christian Heimes Automerge-Triggered-By: GH:tiran files: A Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml M .github/workflows/build.yml M .github/workflows/coverage.yml M .travis.yml M Mac/BuildScript/build-installer.py M PCbuild/get_externals.bat M PCbuild/python.props M PCbuild/readme.txt M Tools/ssl/multissltests.py diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 3feb85ae6561d..0fe754bb071ea 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -57,7 +57,7 @@ jobs: variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 2e94af35600cf..2d32e6d49bcc0 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -57,7 +57,7 @@ jobs: variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6be2b6864266..39c349bf6e910 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -131,7 +131,7 @@ jobs: needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout at v2 - name: Register gcc problem matcher diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 788d6ce047b4a..d8d932a7652d1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout at v2 - name: Install Dependencies diff --git a/.travis.yml b/.travis.yml index 6a22d20455b42..7050d2557a7fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: env: global: - - OPENSSL=1.1.1f + - OPENSSL=1.1.1k - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" - CFLAGS="-I${OPENSSL_DIR}/include" diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 864661ec9e1b6..25a6a24f56494 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -242,9 +242,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1j", - url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", - checksum='cccaa064ed860a2b4d1303811bf5c682', + name="OpenSSL 1.1.1k", + url="https://www.openssl.org/source/openssl-1.1.1k.tar.gz", + checksum='c4e7d95f782b08116afa27b30393dd27', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst new file mode 100644 index 0000000000000..4de4905a6bb08 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst @@ -0,0 +1 @@ +Update macOS, Windows, and CI to OpenSSL 1.1.1k. diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 213fa66908c49..42afe2c841f9c 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ echo.Fetching external libraries... set libraries= set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1i +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1k set libraries=%libraries% sqlite-3.34.0.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.10.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.10.0 @@ -77,7 +77,7 @@ echo.Fetching external binaries... set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1i +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1k if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.10.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index 3fa774816a753..5822ba13950f4 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -62,8 +62,8 @@ $(ExternalsDir)libffi\ $(ExternalsDir)libffi\$(ArchName)\ $(libffiOutDir)include - $(ExternalsDir)openssl-1.1.1i\ - $(ExternalsDir)openssl-bin-1.1.1i\$(ArchName)\ + $(ExternalsDir)openssl-1.1.1k\ + $(ExternalsDir)openssl-bin-1.1.1k\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.2.11\ diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index af2f1bfe0d41b..7518b8389f55c 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -169,7 +169,7 @@ _lzma Homepage: http://tukaani.org/xz/ _ssl - Python wrapper for version 1.1.1i of the OpenSSL secure sockets + Python wrapper for version 1.1.1k of the OpenSSL secure sockets library, which is downloaded from our binaries repository at https://github.com/python/cpython-bin-deps. diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index 7afa1eea2efb2..598503f72dd7c 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -48,7 +48,7 @@ ] OPENSSL_RECENT_VERSIONS = [ - "1.1.1j", + "1.1.1k", # "3.0.0-alpha12" ] From webhook-mailer at python.org Mon Mar 29 22:51:40 2021 From: webhook-mailer at python.org (nascheme) Date: Tue, 30 Mar 2021 02:51:40 -0000 Subject: [Python-checkins] bpo-37448: Use radix tree for pymalloc address_in_range(). (GH-14474) Message-ID: https://github.com/python/cpython/commit/85b6b70589c187639aeebc560d67e9cc04abb4d8 commit: 85b6b70589c187639aeebc560d67e9cc04abb4d8 branch: master author: Neil Schemenauer committer: nascheme date: 2021-03-29T19:51:15-07:00 summary: bpo-37448: Use radix tree for pymalloc address_in_range(). (GH-14474) The radix tree approach is a relatively simple and memory sanitary alternative to the old (slightly) unsanitary address_in_range(). To disable the radix tree map, set a preprocessor flag as follows: -DWITH_PYMALLOC_RADIX_TREE=0. Co-authored-by: Tim Peters files: A Misc/NEWS.d/next/Core and Builtins/2021-02-21-14-19-35.bpo-37448.btl7vO.rst M Objects/obmalloc.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-21-14-19-35.bpo-37448.btl7vO.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-21-14-19-35.bpo-37448.btl7vO.rst new file mode 100644 index 0000000000000..fe771a50122f6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-02-21-14-19-35.bpo-37448.btl7vO.rst @@ -0,0 +1,15 @@ +Add a radix tree based memory map to track in-use obmalloc arenas. Use to +replace the old implementation of address_in_range(). The radix tree +approach makes it easy to increase pool sizes beyond the OS page size. +Boosting the pool and arena size allows obmalloc to handle a significantly +higher percentage of requests from its ultra-fast paths. + +It also has the advantage of eliminating the memory unsanitary behavior of +the previous address_in_range(). The old address_in_range() was marked with +the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and +_Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed. + +To disable the radix tree map, set a preprocessor flag as follows: +`-DWITH_PYMALLOC_RADIX_TREE=0`. + +Co-authored-by: Tim Peters diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 03d0e8e51264c..76ff6f9c99bc9 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -894,6 +894,22 @@ static int running_on_valgrind = -1; #endif #endif +#if !defined(WITH_PYMALLOC_RADIX_TREE) +/* Use radix-tree to track arena memory regions, for address_in_range(). + * Enable by default since it allows larger pool sizes. Can be disabled + * using -DWITH_PYMALLOC_RADIX_TREE=0 */ +#define WITH_PYMALLOC_RADIX_TREE 1 +#endif + +#if SIZEOF_VOID_P > 4 +/* on 64-bit platforms use larger pools and arenas if we can */ +#define USE_LARGE_ARENAS +#if WITH_PYMALLOC_RADIX_TREE +/* large pools only supported if radix-tree is enabled */ +#define USE_LARGE_POOLS +#endif +#endif + /* * The allocator sub-allocates blocks of memory (called arenas) aligned * on a page boundary. This is a reserved virtual address space for the @@ -907,18 +923,34 @@ static int running_on_valgrind = -1; * Arenas are allocated with mmap() on systems supporting anonymous memory * mappings to reduce heap fragmentation. */ -#define ARENA_SIZE (256 << 10) /* 256KB */ +#ifdef USE_LARGE_ARENAS +#define ARENA_BITS 20 /* 1 MiB */ +#else +#define ARENA_BITS 18 /* 256 KiB */ +#endif +#define ARENA_SIZE (1 << ARENA_BITS) +#define ARENA_SIZE_MASK (ARENA_SIZE - 1) #ifdef WITH_MEMORY_LIMITS #define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE) #endif /* - * Size of the pools used for small blocks. Should be a power of 2, - * between 1K and SYSTEM_PAGE_SIZE, that is: 1k, 2k, 4k. + * Size of the pools used for small blocks. Must be a power of 2. */ -#define POOL_SIZE SYSTEM_PAGE_SIZE /* must be 2^N */ -#define POOL_SIZE_MASK SYSTEM_PAGE_SIZE_MASK +#ifdef USE_LARGE_POOLS +#define POOL_BITS 14 /* 16 KiB */ +#else +#define POOL_BITS 12 /* 4 KiB */ +#endif +#define POOL_SIZE (1 << POOL_BITS) +#define POOL_SIZE_MASK (POOL_SIZE - 1) + +#if !WITH_PYMALLOC_RADIX_TREE +#if POOL_SIZE != SYSTEM_PAGE_SIZE +# error "pool size must be equal to system page size" +#endif +#endif #define MAX_POOLS_IN_ARENA (ARENA_SIZE / POOL_SIZE) #if MAX_POOLS_IN_ARENA * POOL_SIZE != ARENA_SIZE @@ -1233,6 +1265,264 @@ _Py_GetAllocatedBlocks(void) return n; } +#if WITH_PYMALLOC_RADIX_TREE +/*==========================================================================*/ +/* radix tree for tracking arena usage + + bit allocation for keys + + 64-bit pointers and 2^20 arena size: + 16 -> ignored (POINTER_BITS - ADDRESS_BITS) + 10 -> MAP_TOP + 10 -> MAP_MID + 8 -> MAP_BOT + 20 -> ideal aligned arena + ---- + 64 + + 32-bit pointers and 2^18 arena size: + 14 -> MAP_BOT + 18 -> ideal aligned arena + ---- + 32 + +*/ + +#if SIZEOF_VOID_P == 8 + +/* number of bits in a pointer */ +#define POINTER_BITS 64 + +/* Current 64-bit processors are limited to 48-bit physical addresses. For + * now, the top 17 bits of addresses will all be equal to bit 2**47. If that + * changes in the future, this must be adjusted upwards. + */ +#define ADDRESS_BITS 48 + +/* use the top and mid layers of the radix tree */ +#define USE_INTERIOR_NODES + +#elif SIZEOF_VOID_P == 4 + +#define POINTER_BITS 32 +#define ADDRESS_BITS 32 + +#else + + /* Currently this code works for 64-bit or 32-bit pointers only. */ +#error "obmalloc radix tree requires 64-bit or 32-bit pointers." + +#endif /* SIZEOF_VOID_P */ + +/* arena_coverage_t members require this to be true */ +#if ARENA_BITS >= 32 +# error "arena size must be < 2^32" +#endif + +#ifdef USE_INTERIOR_NODES +/* number of bits used for MAP_TOP and MAP_MID nodes */ +#define INTERIOR_BITS ((ADDRESS_BITS - ARENA_BITS + 2) / 3) +#else +#define INTERIOR_BITS 0 +#endif + +#define MAP_TOP_BITS INTERIOR_BITS +#define MAP_TOP_LENGTH (1 << MAP_TOP_BITS) +#define MAP_TOP_MASK (MAP_BOT_LENGTH - 1) + +#define MAP_MID_BITS INTERIOR_BITS +#define MAP_MID_LENGTH (1 << MAP_MID_BITS) +#define MAP_MID_MASK (MAP_MID_LENGTH - 1) + +#define MAP_BOT_BITS (ADDRESS_BITS - ARENA_BITS - 2*INTERIOR_BITS) +#define MAP_BOT_LENGTH (1 << MAP_BOT_BITS) +#define MAP_BOT_MASK (MAP_BOT_LENGTH - 1) + +#define MAP_BOT_SHIFT ARENA_BITS +#define MAP_MID_SHIFT (MAP_BOT_BITS + MAP_BOT_SHIFT) +#define MAP_TOP_SHIFT (MAP_MID_BITS + MAP_MID_SHIFT) + +#define AS_UINT(p) ((uintptr_t)(p)) +#define MAP_BOT_INDEX(p) ((AS_UINT(p) >> MAP_BOT_SHIFT) & MAP_BOT_MASK) +#define MAP_MID_INDEX(p) ((AS_UINT(p) >> MAP_MID_SHIFT) & MAP_MID_MASK) +#define MAP_TOP_INDEX(p) ((AS_UINT(p) >> MAP_TOP_SHIFT) & MAP_TOP_MASK) + +#if ADDRESS_BITS > POINTER_BITS +/* Return non-physical address bits of a pointer. Those bits should be same + * for all valid pointers if ADDRESS_BITS set correctly. Linux has support for + * 57-bit address space (Intel 5-level paging) but will not currently give + * those addresses to user space. + */ +#define HIGH_BITS(p) (AS_UINT(p) >> ADDRESS_BITS) +#else +#define HIGH_BITS(p) 0 +#endif + + +/* This is the leaf of the radix tree. See arena_map_mark_used() for the + * meaning of these members. */ +typedef struct { + int32_t tail_hi; + int32_t tail_lo; +} arena_coverage_t; + +typedef struct arena_map_bot { + /* The members tail_hi and tail_lo are accessed together. So, it + * better to have them as an array of structs, rather than two + * arrays. + */ + arena_coverage_t arenas[MAP_BOT_LENGTH]; +} arena_map_bot_t; + +#ifdef USE_INTERIOR_NODES +typedef struct arena_map_mid { + struct arena_map_bot *ptrs[MAP_MID_LENGTH]; +} arena_map_mid_t; + +typedef struct arena_map_top { + struct arena_map_mid *ptrs[MAP_TOP_LENGTH]; +} arena_map_top_t; +#endif + +/* The root of radix tree. Note that by initializing like this, the memory + * should be in the BSS. The OS will only memory map pages as the MAP_MID + * nodes get used (OS pages are demand loaded as needed). + */ +#ifdef USE_INTERIOR_NODES +static arena_map_top_t arena_map_root; +/* accounting for number of used interior nodes */ +static int arena_map_mid_count; +static int arena_map_bot_count; +#else +static arena_map_bot_t arena_map_root; +#endif + +/* Return a pointer to a bottom tree node, return NULL if it doesn't exist or + * it cannot be created */ +static arena_map_bot_t * +arena_map_get(block *p, int create) +{ +#ifdef USE_INTERIOR_NODES + /* sanity check that ADDRESS_BITS is correct */ + assert(HIGH_BITS(p) == HIGH_BITS(&arena_map_root)); + int i1 = MAP_TOP_INDEX(p); + if (arena_map_root.ptrs[i1] == NULL) { + if (!create) { + return NULL; + } + arena_map_mid_t *n = PyMem_RawCalloc(1, sizeof(arena_map_mid_t)); + if (n == NULL) { + return NULL; + } + arena_map_root.ptrs[i1] = n; + arena_map_mid_count++; + } + int i2 = MAP_MID_INDEX(p); + if (arena_map_root.ptrs[i1]->ptrs[i2] == NULL) { + if (!create) { + return NULL; + } + arena_map_bot_t *n = PyMem_RawCalloc(1, sizeof(arena_map_bot_t)); + if (n == NULL) { + return NULL; + } + arena_map_root.ptrs[i1]->ptrs[i2] = n; + arena_map_bot_count++; + } + return arena_map_root.ptrs[i1]->ptrs[i2]; +#else + return &arena_map_root; +#endif +} + + +/* The radix tree only tracks arenas. So, for 16 MiB arenas, we throw + * away 24 bits of the address. That reduces the space requirement of + * the tree compared to similar radix tree page-map schemes. In + * exchange for slashing the space requirement, it needs more + * computation to check an address. + * + * Tracking coverage is done by "ideal" arena address. It is easier to + * explain in decimal so let's say that the arena size is 100 bytes. + * Then, ideal addresses are 100, 200, 300, etc. For checking if a + * pointer address is inside an actual arena, we have to check two ideal + * arena addresses. E.g. if pointer is 357, we need to check 200 and + * 300. In the rare case that an arena is aligned in the ideal way + * (e.g. base address of arena is 200) then we only have to check one + * ideal address. + * + * The tree nodes for 200 and 300 both store the address of arena. + * There are two cases: the arena starts at a lower ideal arena and + * extends to this one, or the arena starts in this arena and extends to + * the next ideal arena. The tail_lo and tail_hi members correspond to + * these two cases. + */ + + +/* mark or unmark addresses covered by arena */ +static int +arena_map_mark_used(uintptr_t arena_base, int is_used) +{ + /* sanity check that ADDRESS_BITS is correct */ + assert(HIGH_BITS(arena_base) == HIGH_BITS(&arena_map_root)); + arena_map_bot_t *n_hi = arena_map_get((block *)arena_base, is_used); + if (n_hi == NULL) { + assert(is_used); /* otherwise node should already exist */ + return 0; /* failed to allocate space for node */ + } + int i3 = MAP_BOT_INDEX((block *)arena_base); + int32_t tail = (int32_t)(arena_base & ARENA_SIZE_MASK); + if (tail == 0) { + /* is ideal arena address */ + n_hi->arenas[i3].tail_hi = is_used ? -1 : 0; + } + else { + /* arena_base address is not ideal (aligned to arena size) and + * so it potentially covers two MAP_BOT nodes. Get the MAP_BOT node + * for the next arena. Note that it might be in different MAP_TOP + * and MAP_MID nodes as well so we need to call arena_map_get() + * again (do the full tree traversal). + */ + n_hi->arenas[i3].tail_hi = is_used ? tail : 0; + uintptr_t arena_base_next = arena_base + ARENA_SIZE; + /* If arena_base is a legit arena address, so is arena_base_next - 1 + * (last address in arena). If arena_base_next overflows then it + * must overflow to 0. However, that would mean arena_base was + * "ideal" and we should not be in this case. */ + assert(arena_base < arena_base_next); + arena_map_bot_t *n_lo = arena_map_get((block *)arena_base_next, is_used); + if (n_lo == NULL) { + assert(is_used); /* otherwise should already exist */ + n_hi->arenas[i3].tail_hi = 0; + return 0; /* failed to allocate space for node */ + } + int i3_next = MAP_BOT_INDEX(arena_base_next); + n_lo->arenas[i3_next].tail_lo = is_used ? tail : 0; + } + return 1; +} + +/* Return true if 'p' is a pointer inside an obmalloc arena. + * _PyObject_Free() calls this so it needs to be very fast. */ +static int +arena_map_is_used(block *p) +{ + arena_map_bot_t *n = arena_map_get(p, 0); + if (n == NULL) { + return 0; + } + int i3 = MAP_BOT_INDEX(p); + /* ARENA_BITS must be < 32 so that the tail is a non-negative int32_t. */ + int32_t hi = n->arenas[i3].tail_hi; + int32_t lo = n->arenas[i3].tail_lo; + int32_t tail = (int32_t)(AS_UINT(p) & ARENA_SIZE_MASK); + return (tail < lo) || (tail >= hi && hi != 0); +} + +/* end of radix tree logic */ +/*==========================================================================*/ +#endif /* WITH_PYMALLOC_RADIX_TREE */ + /* Allocate a new arena. If we run out of memory, return NULL. Else * allocate a new arena, and return the address of an arena_object @@ -1302,6 +1592,15 @@ new_arena(void) unused_arena_objects = arenaobj->nextarena; assert(arenaobj->address == 0); address = _PyObject_Arena.alloc(_PyObject_Arena.ctx, ARENA_SIZE); +#if WITH_PYMALLOC_RADIX_TREE + if (address != NULL) { + if (!arena_map_mark_used((uintptr_t)address, 1)) { + /* marking arena in radix tree failed, abort */ + _PyObject_Arena.free(_PyObject_Arena.ctx, address, ARENA_SIZE); + address = NULL; + } + } +#endif if (address == NULL) { /* The allocation failed: return NULL after putting the * arenaobj back. @@ -1332,6 +1631,17 @@ new_arena(void) } + +#if WITH_PYMALLOC_RADIX_TREE +/* Return true if and only if P is an address that was allocated by + pymalloc. When the radix tree is used, 'poolp' is unused. + */ +static bool +address_in_range(void *p, poolp pool) +{ + return arena_map_is_used(p); +} +#else /* address_in_range(P, POOL) @@ -1423,6 +1733,7 @@ address_in_range(void *p, poolp pool) arenas[arenaindex].address != 0; } +#endif /* !WITH_PYMALLOC_RADIX_TREE */ /*==========================================================================*/ @@ -1768,6 +2079,11 @@ insert_to_freepool(poolp pool) ao->nextarena = unused_arena_objects; unused_arena_objects = ao; +#if WITH_PYMALLOC_RADIX_TREE + /* mark arena region as not under control of obmalloc */ + arena_map_mark_used(ao->address, 0); +#endif + /* Free the entire arena. */ _PyObject_Arena.free(_PyObject_Arena.ctx, (void *)ao->address, ARENA_SIZE); @@ -2711,6 +3027,12 @@ _PyObject_DebugMallocStats(FILE *out) (void)printone(out, "# arenas reclaimed", ntimes_arena_allocated - narenas); (void)printone(out, "# arenas highwater mark", narenas_highwater); (void)printone(out, "# arenas allocated current", narenas); +#ifdef USE_INTERIOR_NODES + (void)printone(out, "# arena map mid nodes", arena_map_mid_count); + (void)printone(out, "# arena map bot nodes", arena_map_bot_count); + fputc('\n', out); +#endif + PyOS_snprintf(buf, sizeof(buf), "%zu arenas * %d bytes/arena", @@ -2729,6 +3051,15 @@ _PyObject_DebugMallocStats(FILE *out) total += printone(out, "# bytes lost to pool headers", pool_header_bytes); total += printone(out, "# bytes lost to quantization", quantization); total += printone(out, "# bytes lost to arena alignment", arena_alignment); +#ifdef WITH_PYMALLOC_RADIX_TREE + total += printone(out, "# bytes lost to arena map root", sizeof(arena_map_root)); +#endif +#ifdef USE_INTERIOR_NODES + total += printone(out, "# bytes lost to arena map mid", + sizeof(arena_map_mid_t) * arena_map_mid_count); + total += printone(out, "# bytes lost to arena map bot", + sizeof(arena_map_bot_t) * arena_map_bot_count); +#endif (void)printone(out, "Total", total); return 1; } From webhook-mailer at python.org Mon Mar 29 23:25:37 2021 From: webhook-mailer at python.org (methane) Date: Tue, 30 Mar 2021 03:25:37 -0000 Subject: [Python-checkins] bpo-33164: blake2: Fix Coverity scan (GH-25060) Message-ID: https://github.com/python/cpython/commit/068ebf9729d440cef03e4c57e3db83c851146172 commit: 068ebf9729d440cef03e4c57e3db83c851146172 branch: master author: Inada Naoki committer: methane date: 2021-03-30T12:25:28+09:00 summary: bpo-33164: blake2: Fix Coverity scan (GH-25060) files: M Modules/_blake2/impl/blake2b-ref.c M Modules/_blake2/impl/blake2b.c M Modules/_blake2/impl/blake2s-ref.c M Modules/_blake2/impl/blake2s.c diff --git a/Modules/_blake2/impl/blake2b-ref.c b/Modules/_blake2/impl/blake2b-ref.c index 699f1a1da1dec..e58c43659d9cc 100644 --- a/Modules/_blake2/impl/blake2b-ref.c +++ b/Modules/_blake2/impl/blake2b-ref.c @@ -333,7 +333,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2b.c b/Modules/_blake2/impl/blake2b.c index 3d3e46506f2e7..c1068e8640546 100644 --- a/Modules/_blake2/impl/blake2b.c +++ b/Modules/_blake2/impl/blake2b.c @@ -388,7 +388,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2s-ref.c b/Modules/_blake2/impl/blake2s-ref.c index baf0b58351aef..ab86cc1b34e67 100644 --- a/Modules/_blake2/impl/blake2s-ref.c +++ b/Modules/_blake2/impl/blake2s-ref.c @@ -323,7 +323,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); diff --git a/Modules/_blake2/impl/blake2s.c b/Modules/_blake2/impl/blake2s.c index 3a04328ab8a4f..47514685b8f30 100644 --- a/Modules/_blake2/impl/blake2s.c +++ b/Modules/_blake2/impl/blake2s.c @@ -363,7 +363,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); From webhook-mailer at python.org Mon Mar 29 23:47:15 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 03:47:15 -0000 Subject: [Python-checkins] bpo-33164: blake2: Fix Coverity scan (GH-25060) Message-ID: https://github.com/python/cpython/commit/6af3a940ca827d9a59e34271e4c97d7ec7b56584 commit: 6af3a940ca827d9a59e34271e4c97d7ec7b56584 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T20:47:00-07:00 summary: bpo-33164: blake2: Fix Coverity scan (GH-25060) (cherry picked from commit 068ebf9729d440cef03e4c57e3db83c851146172) Co-authored-by: Inada Naoki files: M Modules/_blake2/impl/blake2b-ref.c M Modules/_blake2/impl/blake2b.c M Modules/_blake2/impl/blake2s-ref.c M Modules/_blake2/impl/blake2s.c diff --git a/Modules/_blake2/impl/blake2b-ref.c b/Modules/_blake2/impl/blake2b-ref.c index 699f1a1da1dec..e58c43659d9cc 100644 --- a/Modules/_blake2/impl/blake2b-ref.c +++ b/Modules/_blake2/impl/blake2b-ref.c @@ -333,7 +333,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2b.c b/Modules/_blake2/impl/blake2b.c index 3d3e46506f2e7..c1068e8640546 100644 --- a/Modules/_blake2/impl/blake2b.c +++ b/Modules/_blake2/impl/blake2b.c @@ -388,7 +388,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2s-ref.c b/Modules/_blake2/impl/blake2s-ref.c index baf0b58351aef..ab86cc1b34e67 100644 --- a/Modules/_blake2/impl/blake2s-ref.c +++ b/Modules/_blake2/impl/blake2s-ref.c @@ -323,7 +323,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); diff --git a/Modules/_blake2/impl/blake2s.c b/Modules/_blake2/impl/blake2s.c index 3a04328ab8a4f..47514685b8f30 100644 --- a/Modules/_blake2/impl/blake2s.c +++ b/Modules/_blake2/impl/blake2s.c @@ -363,7 +363,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); From webhook-mailer at python.org Tue Mar 30 00:36:48 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 04:36:48 -0000 Subject: [Python-checkins] bpo-33164: blake2: Fix Coverity scan (GH-25060) Message-ID: https://github.com/python/cpython/commit/05429c917c23f735b07ac4c60af20e57aad742fc commit: 05429c917c23f735b07ac4c60af20e57aad742fc branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-29T21:36:39-07:00 summary: bpo-33164: blake2: Fix Coverity scan (GH-25060) (cherry picked from commit 068ebf9729d440cef03e4c57e3db83c851146172) Co-authored-by: Inada Naoki files: M Modules/_blake2/impl/blake2b-ref.c M Modules/_blake2/impl/blake2b.c M Modules/_blake2/impl/blake2s-ref.c M Modules/_blake2/impl/blake2s.c diff --git a/Modules/_blake2/impl/blake2b-ref.c b/Modules/_blake2/impl/blake2b-ref.c index 699f1a1da1dec..e58c43659d9cc 100644 --- a/Modules/_blake2/impl/blake2b-ref.c +++ b/Modules/_blake2/impl/blake2b-ref.c @@ -333,7 +333,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2b.c b/Modules/_blake2/impl/blake2b.c index 3d3e46506f2e7..c1068e8640546 100644 --- a/Modules/_blake2/impl/blake2b.c +++ b/Modules/_blake2/impl/blake2b.c @@ -388,7 +388,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2s-ref.c b/Modules/_blake2/impl/blake2s-ref.c index baf0b58351aef..ab86cc1b34e67 100644 --- a/Modules/_blake2/impl/blake2s-ref.c +++ b/Modules/_blake2/impl/blake2s-ref.c @@ -323,7 +323,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); diff --git a/Modules/_blake2/impl/blake2s.c b/Modules/_blake2/impl/blake2s.c index 3a04328ab8a4f..47514685b8f30 100644 --- a/Modules/_blake2/impl/blake2s.c +++ b/Modules/_blake2/impl/blake2s.c @@ -363,7 +363,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); From webhook-mailer at python.org Tue Mar 30 02:22:44 2021 From: webhook-mailer at python.org (corona10) Date: Tue, 30 Mar 2021 06:22:44 -0000 Subject: [Python-checkins] bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) Message-ID: https://github.com/python/cpython/commit/dfeec347f21b86879ba8f27f567bb275b243f1bc commit: dfeec347f21b86879ba8f27f567bb275b243f1bc branch: master author: Zackery Spytz committer: corona10 date: 2021-03-30T15:22:34+09:00 summary: bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) files: M PC/winreg.c diff --git a/PC/winreg.c b/PC/winreg.c index fb488d8eb0296..004a89a5355f6 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1813,6 +1813,7 @@ winreg_SetValueEx_impl(PyObject *module, HKEY key, if (PySys_Audit("winreg.SetValue", "nunO", (Py_ssize_t)key, value_name, (Py_ssize_t)type, value) < 0) { + PyMem_Free(data); return NULL; } Py_BEGIN_ALLOW_THREADS From webhook-mailer at python.org Tue Mar 30 03:52:24 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 07:52:24 -0000 Subject: [Python-checkins] bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) Message-ID: https://github.com/python/cpython/commit/5486b105a4c5de840c24776c726eeac2a8dc973c commit: 5486b105a4c5de840c24776c726eeac2a8dc973c branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T00:52:13-07:00 summary: bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) (cherry picked from commit dfeec347f21b86879ba8f27f567bb275b243f1bc) Co-authored-by: Zackery Spytz files: M PC/winreg.c diff --git a/PC/winreg.c b/PC/winreg.c index caad18e045bcb..8c443311174da 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1782,6 +1782,7 @@ winreg_SetValueEx_impl(PyObject *module, HKEY key, if (PySys_Audit("winreg.SetValue", "nunO", (Py_ssize_t)key, value_name, (Py_ssize_t)type, value) < 0) { + PyMem_Free(data); return NULL; } Py_BEGIN_ALLOW_THREADS From webhook-mailer at python.org Tue Mar 30 03:52:24 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 07:52:24 -0000 Subject: [Python-checkins] bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) Message-ID: https://github.com/python/cpython/commit/f79577ddbd7c87b6cc1810e98ee4eaca7ae50699 commit: f79577ddbd7c87b6cc1810e98ee4eaca7ae50699 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T00:51:55-07:00 summary: bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) (cherry picked from commit dfeec347f21b86879ba8f27f567bb275b243f1bc) Co-authored-by: Zackery Spytz files: M PC/winreg.c diff --git a/PC/winreg.c b/PC/winreg.c index 01e3e9f14ba2f..fd1ccb7b83e80 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1788,6 +1788,7 @@ winreg_SetValueEx_impl(PyObject *module, HKEY key, if (PySys_Audit("winreg.SetValue", "nunO", (Py_ssize_t)key, value_name, (Py_ssize_t)type, value) < 0) { + PyMem_Free(data); return NULL; } Py_BEGIN_ALLOW_THREADS From webhook-mailer at python.org Tue Mar 30 04:37:45 2021 From: webhook-mailer at python.org (corona10) Date: Tue, 30 Mar 2021 08:37:45 -0000 Subject: [Python-checkins] bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode (GH-24476) Message-ID: https://github.com/python/cpython/commit/cf35e05f89bb008d6f4553f9875e0fe87fc02406 commit: cf35e05f89bb008d6f4553f9875e0fe87fc02406 branch: master author: Gr?gory Starck committer: corona10 date: 2021-03-30T17:37:37+09:00 summary: bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode (GH-24476) files: A Misc/NEWS.d/next/Library/2021-02-07-19-13-30.bpo-43125.AqNoMa.rst M Lib/email/base64mime.py M Lib/test/test_email/test_email.py diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py index 17f0818f6caa8..a7cc37365c6f9 100644 --- a/Lib/email/base64mime.py +++ b/Lib/email/base64mime.py @@ -84,7 +84,7 @@ def body_encode(s, maxlinelen=76, eol=NL): in an email. """ if not s: - return s + return "" encvec = [] max_unencoded = maxlinelen * 3 // 4 diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 044b93862a14e..720a63b4e48ff 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -4261,7 +4261,7 @@ def test_decode(self): def test_encode(self): eq = self.assertEqual - eq(base64mime.body_encode(b''), b'') + eq(base64mime.body_encode(b''), '') eq(base64mime.body_encode(b'hello'), 'aGVsbG8=\n') # Test the binary flag eq(base64mime.body_encode(b'hello\n'), 'aGVsbG8K\n') @@ -4292,7 +4292,6 @@ def test_header_encode(self): eq(he('hello\nworld'), '=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=') - class TestQuopri(unittest.TestCase): def setUp(self): # Set of characters (as byte integers) that don't need to be encoded diff --git a/Misc/NEWS.d/next/Library/2021-02-07-19-13-30.bpo-43125.AqNoMa.rst b/Misc/NEWS.d/next/Library/2021-02-07-19-13-30.bpo-43125.AqNoMa.rst new file mode 100644 index 0000000000000..4c4a5836d2595 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-02-07-19-13-30.bpo-43125.AqNoMa.rst @@ -0,0 +1 @@ +Return empty string if base64mime.body_encode receive empty bytes From webhook-mailer at python.org Tue Mar 30 04:58:20 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 08:58:20 -0000 Subject: [Python-checkins] [3.9] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) (GH-25088) Message-ID: https://github.com/python/cpython/commit/cd82d592063aa03dcc238dcc5222bd47ee0eb438 commit: cd82d592063aa03dcc238dcc5222bd47ee0eb438 branch: 3.9 author: Christian Heimes committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T01:58:06-07:00 summary: [3.9] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) (GH-25088) Signed-off-by: Christian Heimes Automerge-Triggered-By: GH:tiran. (cherry picked from commit a54fc683f237d8f0b6e999a63aa9b8c0a45b7fef) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml M .github/workflows/build.yml M .github/workflows/coverage.yml M .travis.yml M Mac/BuildScript/build-installer.py M PCbuild/get_externals.bat M PCbuild/python.props M PCbuild/readme.txt M Tools/ssl/multissltests.py diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 3feb85ae6561d..0fe754bb071ea 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -57,7 +57,7 @@ jobs: variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 2e94af35600cf..2d32e6d49bcc0 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -57,7 +57,7 @@ jobs: variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fa6033a9dc35..ce77250d7ff6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,7 +125,7 @@ jobs: needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout at v2 - name: Install Dependencies diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6092f41325ff2..79c63e936f23f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout at v2 - name: Install Dependencies diff --git a/.travis.yml b/.travis.yml index 5d9f4208e0431..02b2afa4816c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: env: global: - - OPENSSL=1.1.1f + - OPENSSL=1.1.1k - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" - CFLAGS="-I${OPENSSL_DIR}/include" diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 864661ec9e1b6..25a6a24f56494 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -242,9 +242,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1j", - url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", - checksum='cccaa064ed860a2b4d1303811bf5c682', + name="OpenSSL 1.1.1k", + url="https://www.openssl.org/source/openssl-1.1.1k.tar.gz", + checksum='c4e7d95f782b08116afa27b30393dd27', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst new file mode 100644 index 0000000000000..4de4905a6bb08 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst @@ -0,0 +1 @@ +Update macOS, Windows, and CI to OpenSSL 1.1.1k. diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 1e783846a2b90..203290fbadbe7 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ echo.Fetching external libraries... set libraries= set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1i +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1k set libraries=%libraries% sqlite-3.34.0.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0 @@ -77,7 +77,7 @@ echo.Fetching external binaries... set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1i +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1k if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index 3fa774816a753..5822ba13950f4 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -62,8 +62,8 @@ $(ExternalsDir)libffi\ $(ExternalsDir)libffi\$(ArchName)\ $(libffiOutDir)include - $(ExternalsDir)openssl-1.1.1i\ - $(ExternalsDir)openssl-bin-1.1.1i\$(ArchName)\ + $(ExternalsDir)openssl-1.1.1k\ + $(ExternalsDir)openssl-bin-1.1.1k\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.2.11\ diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 5a21c30af9487..3acd99aa10793 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -166,7 +166,7 @@ _lzma Homepage: http://tukaani.org/xz/ _ssl - Python wrapper for version 1.1.1i of the OpenSSL secure sockets + Python wrapper for version 1.1.1k of the OpenSSL secure sockets library, which is downloaded from our binaries repository at https://github.com/python/cpython-bin-deps. diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index 3818165a836fb..0db1b35804d41 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -48,8 +48,8 @@ ] OPENSSL_RECENT_VERSIONS = [ - "1.1.1g", - # "3.0.0-alpha2" + "1.1.1k", + # "3.0.0-alpha12" ] LIBRESSL_OLD_VERSIONS = [ From webhook-mailer at python.org Tue Mar 30 04:58:21 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 08:58:21 -0000 Subject: [Python-checkins] [3.8] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) (GH-25089) Message-ID: https://github.com/python/cpython/commit/9ac263091db4a8c7dedb577d01f544622a448744 commit: 9ac263091db4a8c7dedb577d01f544622a448744 branch: 3.8 author: Christian Heimes committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T01:58:12-07:00 summary: [3.8] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) (GH-25089) Signed-off-by: Christian Heimes Automerge-Triggered-By: GH:tiran. (cherry picked from commit a54fc683f237d8f0b6e999a63aa9b8c0a45b7fef) Co-authored-by: Christian Heimes files: A Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml M .github/workflows/build.yml M .github/workflows/coverage.yml M .travis.yml M Mac/BuildScript/build-installer.py M PCbuild/get_externals.bat M PCbuild/python.props M PCbuild/readme.txt M Tools/ssl/multissltests.py diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 3feb85ae6561d..0fe754bb071ea 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -57,7 +57,7 @@ jobs: variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 2e94af35600cf..2d32e6d49bcc0 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -57,7 +57,7 @@ jobs: variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20d3040770f6d..cafe3d18bc3e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,7 +118,7 @@ jobs: needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout at v2 - name: Install Dependencies diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bfb077b299474..5ec2e526ab840 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,7 +23,7 @@ jobs: name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout at v2 - name: Install Dependencies diff --git a/.travis.yml b/.travis.yml index 39a3cf7e92964..f347b258d5088 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: env: global: - - OPENSSL=1.1.1f + - OPENSSL=1.1.1k - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" - CFLAGS="-I${OPENSSL_DIR}/include" diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index f2717b614a74a..a2d9a5e7454d5 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -209,9 +209,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1j", - url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", - checksum='cccaa064ed860a2b4d1303811bf5c682', + name="OpenSSL 1.1.1k", + url="https://www.openssl.org/source/openssl-1.1.1k.tar.gz", + checksum='c4e7d95f782b08116afa27b30393dd27', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst new file mode 100644 index 0000000000000..4de4905a6bb08 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst @@ -0,0 +1 @@ +Update macOS, Windows, and CI to OpenSSL 1.1.1k. diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index a1d9a12a362e1..9f27319918559 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ echo.Fetching external libraries... set libraries= set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.3.0-rc0-r1 -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1i +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1k set libraries=%libraries% sqlite-3.34.0.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0 @@ -77,7 +77,7 @@ echo.Fetching external binaries... set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1i +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1k if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index 3fa774816a753..5822ba13950f4 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -62,8 +62,8 @@ $(ExternalsDir)libffi\ $(ExternalsDir)libffi\$(ArchName)\ $(libffiOutDir)include - $(ExternalsDir)openssl-1.1.1i\ - $(ExternalsDir)openssl-bin-1.1.1i\$(ArchName)\ + $(ExternalsDir)openssl-1.1.1k\ + $(ExternalsDir)openssl-bin-1.1.1k\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.2.11\ diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 0b2aa59ecefab..d2dbc50690db7 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -165,7 +165,7 @@ _lzma Homepage: http://tukaani.org/xz/ _ssl - Python wrapper for version 1.1.1i of the OpenSSL secure sockets + Python wrapper for version 1.1.1k of the OpenSSL secure sockets library, which is downloaded from our binaries repository at https://github.com/python/cpython-bin-deps. diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index 3818165a836fb..0db1b35804d41 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -48,8 +48,8 @@ ] OPENSSL_RECENT_VERSIONS = [ - "1.1.1g", - # "3.0.0-alpha2" + "1.1.1k", + # "3.0.0-alpha12" ] LIBRESSL_OLD_VERSIONS = [ From webhook-mailer at python.org Tue Mar 30 11:43:22 2021 From: webhook-mailer at python.org (brettcannon) Date: Tue, 30 Mar 2021 15:43:22 -0000 Subject: [Python-checkins] bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044) Message-ID: https://github.com/python/cpython/commit/a7ff6df60c05e1b69fca743573b1e118bebf121d commit: a7ff6df60c05e1b69fca743573b1e118bebf121d branch: master author: Brett Cannon committer: brettcannon date: 2021-03-30T08:43:03-07:00 summary: bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044) files: A Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst M Doc/reference/import.rst M Doc/whatsnew/3.10.rst M Lib/importlib/_bootstrap.py M Lib/importlib/_bootstrap_external.py M Lib/test/test_importlib/import_/test_path.py M Lib/test/test_importlib/test_api.py M Python/importlib.h M Python/importlib_external.h diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index b5ac21d481927..5d2169b4cba60 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -329,6 +329,10 @@ modules, and one that knows how to import modules from an :term:`import path` import machinery will try it only if the finder does not implement ``find_spec()``. +.. versionchanged:: 3.10 + Use of :meth:`~importlib.abc.MetaPathFinder.find_module` by the import system + now raises :exc:`ImportWarning`. + Loading ======= @@ -470,6 +474,9 @@ import machinery will create the new module itself. An :exc:`ImportError` is raised when ``exec_module()`` is defined but ``create_module()`` is not. +.. versionchanged:: 3.10 + Use of ``load_module()`` will raise :exc:`ImportWarning`. + Submodules ---------- @@ -896,6 +903,10 @@ a list containing the portion. exist on a path entry finder, the import system will always call ``find_loader()`` in preference to ``find_module()``. +.. versionchanged:: 3.10 + Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` by the import + system will raise :exc:`ImportWarning`. + Replacing the standard import system ==================================== diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 3a563c10282c8..e09cfb44276ab 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1028,6 +1028,15 @@ Deprecated :meth:`~importlib.abc.Loader.exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.) +* The use of :meth:`importlib.abc.MetaPathFinder.find_module` and + :meth:`importlib.abc.PathEntryFinder.find_module` by the import system now + trigger an :exc:`ImportWarning` as + :meth:`importlib.abc.MetaPathFinder.find_spec` and + :meth:`importlib.abc.PathEntryFinder.find_spec` + are preferred, respectively. You can use + :func:`importlib.util.spec_from_loader` to help in porting. + (Contributed by Brett Cannon in :issue:`42134`.) + * The import system now uses the ``__spec__`` attribute on modules before falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's ``__repr__()`` method. Removal of the use of ``module_repr()`` is scheduled diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index d5acb6545f8fa..ab52e778fda87 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -903,8 +903,9 @@ def _resolve_name(name, package, level): def _find_spec_legacy(finder, name, path): - # This would be a good place for a DeprecationWarning if - # we ended up going that route. + msg = (f"{_object_name(finder)}.find_spec() not found; " + "falling back to find_module()") + _warnings.warn(msg, ImportWarning) loader = finder.find_module(name, path) if loader is None: return None diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index dac881fa42f3e..bf7c2686037d7 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1324,6 +1324,9 @@ def _legacy_get_spec(cls, fullname, finder): if hasattr(finder, 'find_loader'): loader, portions = finder.find_loader(fullname) else: + msg = (f"{_bootstrap._object_name(finder)}.find_spec() not found; " + "falling back to find_module()") + _warnings.warn(msg, ImportWarning) loader = finder.find_module(fullname) portions = [] if loader is not None: diff --git a/Lib/test/test_importlib/import_/test_path.py b/Lib/test/test_importlib/import_/test_path.py index 18c81dda45c8c..c51aee22bb8dc 100644 --- a/Lib/test/test_importlib/import_/test_path.py +++ b/Lib/test/test_importlib/import_/test_path.py @@ -123,12 +123,16 @@ def find_module(self, fullname): failing_finder.to_return = None path = 'testing path' with util.import_state(path_importer_cache={path: failing_finder}): - self.assertIsNone( + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + self.assertIsNone( self.machinery.PathFinder.find_spec('whatever', [path])) success_finder = TestFinder() success_finder.to_return = __loader__ with util.import_state(path_importer_cache={path: success_finder}): - spec = self.machinery.PathFinder.find_spec('whatever', [path]) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + spec = self.machinery.PathFinder.find_spec('whatever', [path]) self.assertEqual(spec.loader, __loader__) def test_finder_with_find_loader(self): @@ -248,7 +252,9 @@ def find_module(fullname): with util.import_state(path=[Finder.path_location]+sys.path[:], path_hooks=[Finder]): - self.machinery.PathFinder.find_spec('importlib') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + self.machinery.PathFinder.find_spec('importlib') def test_finder_with_failing_find_module(self): # PathEntryFinder with find_module() defined should work. @@ -266,7 +272,9 @@ def find_module(fullname): with util.import_state(path=[Finder.path_location]+sys.path[:], path_hooks=[Finder]): - self.machinery.PathFinder.find_module('importlib') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + self.machinery.PathFinder.find_module('importlib') (Frozen_PEFTests, diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index 3f06a10ba9c5e..384ae9ca7a57a 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -151,6 +151,7 @@ def test_success(self): with test_util.import_state(meta_path=[self.FakeMetaFinder]): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) + warnings.simplefilter('ignore', ImportWarning) self.assertEqual((name, None), self.init.find_loader(name)) def test_success_path(self): @@ -161,6 +162,7 @@ def test_success_path(self): with test_util.import_state(meta_path=[self.FakeMetaFinder]): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) + warnings.simplefilter('ignore', ImportWarning) self.assertEqual((name, path), self.init.find_loader(name, path)) diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst new file mode 100644 index 0000000000000..72d13e37c937b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst @@ -0,0 +1 @@ +Calls to find_module() by the import system now raise ImportWarning. diff --git a/Python/importlib.h b/Python/importlib.h index f14126257e546..886b807aba0c0 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -1420,448 +1420,455 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 95,114,101,115,111,108,118,101,95,110,97,109,101,128,3,0, 0,115,12,0,0,0,16,2,12,1,8,1,8,1,20,1, 255,128,114,210,0,0,0,99,3,0,0,0,0,0,0,0, - 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, - 115,34,0,0,0,124,0,160,0,124,1,124,2,161,2,125, - 3,124,3,100,0,117,0,114,24,100,0,83,0,116,1,124, - 1,124,3,131,2,83,0,114,0,0,0,0,41,2,114,184, - 0,0,0,114,104,0,0,0,41,4,218,6,102,105,110,100, - 101,114,114,20,0,0,0,114,181,0,0,0,114,122,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 218,17,95,102,105,110,100,95,115,112,101,99,95,108,101,103, - 97,99,121,137,3,0,0,115,10,0,0,0,12,3,8,1, - 4,1,10,1,255,128,114,212,0,0,0,99,3,0,0,0, - 0,0,0,0,0,0,0,0,10,0,0,0,10,0,0,0, - 67,0,0,0,115,36,1,0,0,116,0,106,1,125,3,124, - 3,100,1,117,0,114,22,116,2,100,2,131,1,130,1,124, - 3,115,38,116,3,160,4,100,3,116,5,161,2,1,0,124, - 0,116,0,106,6,118,0,125,4,124,3,68,0,93,230,125, - 5,116,7,131,0,143,94,1,0,122,10,124,5,106,8,125, - 6,87,0,110,54,4,0,116,9,144,1,121,34,1,0,1, - 0,1,0,116,10,124,5,124,0,124,1,131,3,125,7,124, - 7,100,1,117,0,114,126,89,0,87,0,100,1,4,0,4, - 0,131,3,1,0,113,52,89,0,110,12,124,6,124,0,124, - 1,124,2,131,3,125,7,87,0,100,1,4,0,4,0,131, - 3,1,0,110,16,49,0,115,162,119,1,1,0,1,0,1, - 0,89,0,1,0,124,7,100,1,117,1,144,1,114,26,124, - 4,144,1,115,18,124,0,116,0,106,6,118,0,144,1,114, - 18,116,0,106,6,124,0,25,0,125,8,122,10,124,8,106, - 11,125,9,87,0,110,26,4,0,116,9,144,1,121,32,1, - 0,1,0,1,0,124,7,6,0,89,0,2,0,1,0,83, - 0,124,9,100,1,117,0,144,1,114,10,124,7,2,0,1, - 0,83,0,124,9,2,0,1,0,83,0,124,7,2,0,1, - 0,83,0,113,52,100,1,83,0,119,0,119,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,18,0,0,0,218,9,109, - 101,116,97,95,112,97,116,104,114,87,0,0,0,114,101,0, - 0,0,114,102,0,0,0,114,169,0,0,0,114,105,0,0, - 0,114,199,0,0,0,114,183,0,0,0,114,2,0,0,0, - 114,212,0,0,0,114,113,0,0,0,41,10,114,20,0,0, - 0,114,181,0,0,0,114,182,0,0,0,114,213,0,0,0, - 90,9,105,115,95,114,101,108,111,97,100,114,211,0,0,0, - 114,183,0,0,0,114,109,0,0,0,114,110,0,0,0,114, - 113,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6, - 0,0,0,218,10,95,102,105,110,100,95,115,112,101,99,146, - 3,0,0,115,66,0,0,0,6,2,8,1,8,2,4,3, - 12,1,10,5,8,1,8,1,2,1,10,1,14,1,12,1, - 8,1,16,1,4,255,12,3,30,128,10,1,18,2,10,1, - 2,1,10,1,14,1,12,4,10,2,8,1,8,2,8,2, - 2,239,4,19,2,243,2,244,255,128,114,214,0,0,0,99, - 3,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, - 5,0,0,0,67,0,0,0,115,110,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, - 82,116,0,124,1,116,1,131,2,115,70,116,2,100,4,131, - 1,130,1,124,1,115,82,116,6,100,5,131,1,130,1,124, - 0,115,106,124,2,100,2,107,2,114,102,116,5,100,6,131, - 1,130,1,100,7,83,0,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,25,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,50,0,0,0,114,3,0,0,0,218,10,86,97,108,117, - 101,69,114,114,111,114,114,87,0,0,0,169,3,114,20,0, - 0,0,114,208,0,0,0,114,209,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,6,0,0,0,218,13,95,115,97, - 110,105,116,121,95,99,104,101,99,107,193,3,0,0,115,26, - 0,0,0,10,2,18,1,8,1,8,1,8,1,10,1,8, - 1,4,1,8,1,12,2,8,1,8,255,255,128,114,220,0, - 0,0,122,16,78,111,32,109,111,100,117,108,101,32,110,97, - 109,101,100,32,122,4,123,33,114,125,99,2,0,0,0,0, - 0,0,0,0,0,0,0,9,0,0,0,8,0,0,0,67, - 0,0,0,115,22,1,0,0,100,0,125,2,124,0,160,0, - 100,1,161,1,100,2,25,0,125,3,124,3,114,128,124,3, - 116,1,106,2,118,1,114,42,116,3,124,1,124,3,131,2, - 1,0,124,0,116,1,106,2,118,0,114,62,116,1,106,2, - 124,0,25,0,83,0,116,1,106,2,124,3,25,0,125,4, - 122,10,124,4,106,4,125,2,87,0,110,44,4,0,116,5, - 144,1,121,20,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,116,9,124,0,124,2,131,2, - 125,6,124,6,100,0,117,0,114,164,116,8,116,6,160,7, - 124,0,161,1,124,0,100,4,141,2,130,1,116,10,124,6, - 131,1,125,7,124,3,144,1,114,14,116,1,106,2,124,3, - 25,0,125,4,124,0,160,0,100,1,161,1,100,5,25,0, - 125,8,122,18,116,11,124,4,124,8,124,7,131,3,1,0, - 87,0,124,7,83,0,4,0,116,5,144,1,121,18,1,0, - 1,0,1,0,100,6,124,3,155,2,100,7,124,8,155,2, - 157,4,125,5,116,12,160,13,124,5,116,14,161,2,1,0, - 89,0,124,7,83,0,124,7,83,0,119,0,119,0,41,8, - 78,114,141,0,0,0,114,25,0,0,0,122,23,59,32,123, - 33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,99, - 107,97,103,101,114,19,0,0,0,233,2,0,0,0,122,27, - 67,97,110,110,111,116,32,115,101,116,32,97,110,32,97,116, - 116,114,105,98,117,116,101,32,111,110,32,122,18,32,102,111, - 114,32,99,104,105,108,100,32,109,111,100,117,108,101,32,41, - 15,114,142,0,0,0,114,18,0,0,0,114,105,0,0,0, - 114,74,0,0,0,114,154,0,0,0,114,2,0,0,0,218, - 8,95,69,82,82,95,77,83,71,114,50,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,214,0,0,0,114,173,0,0,0,114,12,0, + 0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,0, + 115,60,0,0,0,116,0,124,0,131,1,155,0,100,1,157, + 2,125,3,116,1,160,2,124,3,116,3,161,2,1,0,124, + 0,160,4,124,1,124,2,161,2,125,4,124,4,100,0,117, + 0,114,50,100,0,83,0,116,5,124,1,124,4,131,2,83, + 0,41,2,78,122,53,46,102,105,110,100,95,115,112,101,99, + 40,41,32,110,111,116,32,102,111,117,110,100,59,32,102,97, + 108,108,105,110,103,32,98,97,99,107,32,116,111,32,102,105, + 110,100,95,109,111,100,117,108,101,40,41,41,6,114,7,0, 0,0,114,101,0,0,0,114,102,0,0,0,114,169,0,0, - 0,41,9,114,20,0,0,0,218,7,105,109,112,111,114,116, - 95,114,181,0,0,0,114,143,0,0,0,90,13,112,97,114, - 101,110,116,95,109,111,100,117,108,101,114,108,0,0,0,114, - 109,0,0,0,114,110,0,0,0,90,5,99,104,105,108,100, + 0,114,184,0,0,0,114,104,0,0,0,41,5,218,6,102, + 105,110,100,101,114,114,20,0,0,0,114,181,0,0,0,114, + 108,0,0,0,114,122,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,6,0,0,0,218,17,95,102,105,110,100,95, + 115,112,101,99,95,108,101,103,97,99,121,137,3,0,0,115, + 14,0,0,0,14,1,12,2,12,1,8,1,4,1,10,1, + 255,128,114,212,0,0,0,99,3,0,0,0,0,0,0,0, + 0,0,0,0,10,0,0,0,10,0,0,0,67,0,0,0, + 115,36,1,0,0,116,0,106,1,125,3,124,3,100,1,117, + 0,114,22,116,2,100,2,131,1,130,1,124,3,115,38,116, + 3,160,4,100,3,116,5,161,2,1,0,124,0,116,0,106, + 6,118,0,125,4,124,3,68,0,93,230,125,5,116,7,131, + 0,143,94,1,0,122,10,124,5,106,8,125,6,87,0,110, + 54,4,0,116,9,144,1,121,34,1,0,1,0,1,0,116, + 10,124,5,124,0,124,1,131,3,125,7,124,7,100,1,117, + 0,114,126,89,0,87,0,100,1,4,0,4,0,131,3,1, + 0,113,52,89,0,110,12,124,6,124,0,124,1,124,2,131, + 3,125,7,87,0,100,1,4,0,4,0,131,3,1,0,110, + 16,49,0,115,162,119,1,1,0,1,0,1,0,89,0,1, + 0,124,7,100,1,117,1,144,1,114,26,124,4,144,1,115, + 18,124,0,116,0,106,6,118,0,144,1,114,18,116,0,106, + 6,124,0,25,0,125,8,122,10,124,8,106,11,125,9,87, + 0,110,26,4,0,116,9,144,1,121,32,1,0,1,0,1, + 0,124,7,6,0,89,0,2,0,1,0,83,0,124,9,100, + 1,117,0,144,1,114,10,124,7,2,0,1,0,83,0,124, + 9,2,0,1,0,83,0,124,7,2,0,1,0,83,0,113, + 52,100,1,83,0,119,0,119,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,18,0,0,0,218,9,109,101,116,97,95, + 112,97,116,104,114,87,0,0,0,114,101,0,0,0,114,102, + 0,0,0,114,169,0,0,0,114,105,0,0,0,114,199,0, + 0,0,114,183,0,0,0,114,2,0,0,0,114,212,0,0, + 0,114,113,0,0,0,41,10,114,20,0,0,0,114,181,0, + 0,0,114,182,0,0,0,114,213,0,0,0,90,9,105,115, + 95,114,101,108,111,97,100,114,211,0,0,0,114,183,0,0, + 0,114,109,0,0,0,114,110,0,0,0,114,113,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,6,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,212,3,0,0,115,60,0,0, - 0,4,1,14,1,4,1,10,1,10,1,10,2,10,1,10, - 1,2,1,10,1,14,1,16,1,14,1,10,1,8,1,18, - 1,8,2,6,1,10,2,14,1,2,1,14,1,4,4,14, - 253,16,1,14,1,8,1,2,253,2,242,255,128,114,225,0, - 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,4, - 0,0,0,8,0,0,0,67,0,0,0,115,128,0,0,0, - 116,0,124,0,131,1,143,62,1,0,116,1,106,2,160,3, - 124,0,116,4,161,2,125,2,124,2,116,4,117,0,114,56, - 116,5,124,0,124,1,131,2,87,0,2,0,100,1,4,0, - 4,0,131,3,1,0,83,0,87,0,100,1,4,0,4,0, - 131,3,1,0,110,16,49,0,115,76,119,1,1,0,1,0, - 1,0,89,0,1,0,124,2,100,1,117,0,114,116,100,2, - 160,6,124,0,161,1,125,3,116,7,124,3,124,0,100,3, - 141,2,130,1,116,8,124,0,131,1,1,0,124,2,83,0, - 41,4,122,25,70,105,110,100,32,97,110,100,32,108,111,97, - 100,32,116,104,101,32,109,111,100,117,108,101,46,78,122,40, - 105,109,112,111,114,116,32,111,102,32,123,125,32,104,97,108, - 116,101,100,59,32,78,111,110,101,32,105,110,32,115,121,115, - 46,109,111,100,117,108,101,115,114,19,0,0,0,41,9,114, - 57,0,0,0,114,18,0,0,0,114,105,0,0,0,114,38, - 0,0,0,218,14,95,78,69,69,68,83,95,76,79,65,68, - 73,78,71,114,225,0,0,0,114,50,0,0,0,114,223,0, - 0,0,114,72,0,0,0,41,4,114,20,0,0,0,114,224, - 0,0,0,114,110,0,0,0,114,82,0,0,0,114,5,0, - 0,0,114,5,0,0,0,114,6,0,0,0,218,14,95,102, - 105,110,100,95,97,110,100,95,108,111,97,100,247,3,0,0, - 115,28,0,0,0,10,2,14,1,8,1,24,1,14,255,16, - 128,8,3,2,1,6,1,2,255,12,2,8,2,4,1,255, - 128,114,227,0,0,0,114,25,0,0,0,99,3,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0, - 67,0,0,0,115,42,0,0,0,116,0,124,0,124,1,124, - 2,131,3,1,0,124,2,100,1,107,4,114,32,116,1,124, - 0,124,1,124,2,131,3,125,0,116,2,124,0,116,3,131, - 2,83,0,41,3,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,25,0,0, - 0,78,41,4,114,220,0,0,0,114,210,0,0,0,114,227, - 0,0,0,218,11,95,103,99,100,95,105,109,112,111,114,116, - 114,219,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 6,0,0,0,114,228,0,0,0,7,4,0,0,115,10,0, - 0,0,12,9,8,1,12,1,10,1,255,128,114,228,0,0, - 0,169,1,218,9,114,101,99,117,114,115,105,118,101,99,3, - 0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,11, - 0,0,0,67,0,0,0,115,218,0,0,0,124,1,68,0, - 93,206,125,4,116,0,124,4,116,1,131,2,115,64,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,124,4,100,5, - 107,2,114,106,124,3,115,104,116,5,124,0,100,6,131,2, - 114,104,116,6,124,0,124,0,106,7,124,2,100,7,100,8, - 141,4,1,0,113,4,116,5,124,0,124,4,131,2,115,210, - 100,9,160,8,124,0,106,2,124,4,161,2,125,6,122,14, - 116,9,124,2,124,6,131,2,1,0,87,0,113,4,4,0, - 116,10,121,216,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,117,1,114,200,87,0,89,0,100,10,125,7, - 126,7,113,4,130,0,100,10,125,7,126,7,119,1,113,4, - 124,0,83,0,119,0,41,11,122,238,70,105,103,117,114,101, - 32,111,117,116,32,119,104,97,116,32,95,95,105,109,112,111, - 114,116,95,95,32,115,104,111,117,108,100,32,114,101,116,117, - 114,110,46,10,10,32,32,32,32,84,104,101,32,105,109,112, - 111,114,116,95,32,112,97,114,97,109,101,116,101,114,32,105, - 115,32,97,32,99,97,108,108,97,98,108,101,32,119,104,105, - 99,104,32,116,97,107,101,115,32,116,104,101,32,110,97,109, - 101,32,111,102,32,109,111,100,117,108,101,32,116,111,10,32, - 32,32,32,105,109,112,111,114,116,46,32,73,116,32,105,115, - 32,114,101,113,117,105,114,101,100,32,116,111,32,100,101,99, - 111,117,112,108,101,32,116,104,101,32,102,117,110,99,116,105, - 111,110,32,102,114,111,109,32,97,115,115,117,109,105,110,103, - 32,105,109,112,111,114,116,108,105,98,39,115,10,32,32,32, - 32,105,109,112,111,114,116,32,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,32,105,115,32,100,101,115,105,114,101, - 100,46,10,10,32,32,32,32,122,8,46,95,95,97,108,108, - 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39, - 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117, - 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250, - 1,42,218,7,95,95,97,108,108,95,95,84,114,229,0,0, - 0,114,205,0,0,0,78,41,16,114,215,0,0,0,114,216, - 0,0,0,114,9,0,0,0,114,217,0,0,0,114,3,0, - 0,0,114,11,0,0,0,218,16,95,104,97,110,100,108,101, - 95,102,114,111,109,108,105,115,116,114,232,0,0,0,114,50, - 0,0,0,114,74,0,0,0,114,223,0,0,0,114,20,0, - 0,0,114,18,0,0,0,114,105,0,0,0,114,38,0,0, - 0,114,226,0,0,0,41,8,114,110,0,0,0,218,8,102, - 114,111,109,108,105,115,116,114,224,0,0,0,114,230,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,5,0,0,0, - 114,5,0,0,0,114,6,0,0,0,114,233,0,0,0,22, - 4,0,0,115,58,0,0,0,8,10,10,1,4,1,12,1, - 4,2,10,1,8,1,8,255,8,2,14,1,10,1,2,1, - 6,255,2,128,10,2,14,1,2,1,14,1,14,1,10,4, - 16,1,2,255,12,2,2,1,8,128,2,245,4,12,2,248, - 255,128,114,233,0,0,0,99,1,0,0,0,0,0,0,0, - 0,0,0,0,3,0,0,0,6,0,0,0,67,0,0,0, - 115,146,0,0,0,124,0,160,0,100,1,161,1,125,1,124, - 0,160,0,100,2,161,1,125,2,124,1,100,3,117,1,114, - 82,124,2,100,3,117,1,114,78,124,1,124,2,106,1,107, - 3,114,78,116,2,106,3,100,4,124,1,155,2,100,5,124, - 2,106,1,155,2,100,6,157,5,116,4,100,7,100,8,141, - 3,1,0,124,1,83,0,124,2,100,3,117,1,114,96,124, - 2,106,1,83,0,116,2,106,3,100,9,116,4,100,7,100, - 8,141,3,1,0,124,0,100,10,25,0,125,1,100,11,124, - 0,118,1,114,142,124,1,160,5,100,12,161,1,100,13,25, - 0,125,1,124,1,83,0,41,14,122,167,67,97,108,99,117, - 108,97,116,101,32,119,104,97,116,32,95,95,112,97,99,107, - 97,103,101,95,95,32,115,104,111,117,108,100,32,98,101,46, - 10,10,32,32,32,32,95,95,112,97,99,107,97,103,101,95, - 95,32,105,115,32,110,111,116,32,103,117,97,114,97,110,116, - 101,101,100,32,116,111,32,98,101,32,100,101,102,105,110,101, - 100,32,111,114,32,99,111,117,108,100,32,98,101,32,115,101, - 116,32,116,111,32,78,111,110,101,10,32,32,32,32,116,111, - 32,114,101,112,114,101,115,101,110,116,32,116,104,97,116,32, - 105,116,115,32,112,114,111,112,101,114,32,118,97,108,117,101, - 32,105,115,32,117,110,107,110,111,119,110,46,10,10,32,32, - 32,32,114,158,0,0,0,114,113,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,9,0,0,0,114,154,0,0,0, - 114,141,0,0,0,114,25,0,0,0,41,6,114,38,0,0, - 0,114,143,0,0,0,114,101,0,0,0,114,102,0,0,0, - 114,169,0,0,0,114,142,0,0,0,41,3,218,7,103,108, - 111,98,97,108,115,114,208,0,0,0,114,109,0,0,0,114, - 5,0,0,0,114,5,0,0,0,114,6,0,0,0,218,17, - 95,99,97,108,99,95,95,95,112,97,99,107,97,103,101,95, - 95,59,4,0,0,115,44,0,0,0,10,7,10,1,8,1, - 18,1,6,1,2,1,4,255,4,1,6,255,4,2,6,254, - 4,3,8,1,6,1,6,2,4,2,6,254,8,3,8,1, - 14,1,4,1,255,128,114,239,0,0,0,114,5,0,0,0, - 99,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0, - 0,5,0,0,0,67,0,0,0,115,174,0,0,0,124,4, - 100,1,107,2,114,18,116,0,124,0,131,1,125,5,110,36, - 124,1,100,2,117,1,114,30,124,1,110,2,105,0,125,6, - 116,1,124,6,131,1,125,7,116,0,124,0,124,7,124,4, - 131,3,125,5,124,3,115,148,124,4,100,1,107,2,114,84, - 116,0,124,0,160,2,100,3,161,1,100,1,25,0,131,1, - 83,0,124,0,115,92,124,5,83,0,116,3,124,0,131,1, - 116,3,124,0,160,2,100,3,161,1,100,1,25,0,131,1, - 24,0,125,8,116,4,106,5,124,5,106,6,100,2,116,3, - 124,5,106,6,131,1,124,8,24,0,133,2,25,0,25,0, - 83,0,116,7,124,5,100,4,131,2,114,170,116,8,124,5, - 124,3,116,0,131,3,83,0,124,5,83,0,41,5,97,215, - 1,0,0,73,109,112,111,114,116,32,97,32,109,111,100,117, - 108,101,46,10,10,32,32,32,32,84,104,101,32,39,103,108, - 111,98,97,108,115,39,32,97,114,103,117,109,101,110,116,32, - 105,115,32,117,115,101,100,32,116,111,32,105,110,102,101,114, - 32,119,104,101,114,101,32,116,104,101,32,105,109,112,111,114, - 116,32,105,115,32,111,99,99,117,114,114,105,110,103,32,102, - 114,111,109,10,32,32,32,32,116,111,32,104,97,110,100,108, - 101,32,114,101,108,97,116,105,118,101,32,105,109,112,111,114, - 116,115,46,32,84,104,101,32,39,108,111,99,97,108,115,39, - 32,97,114,103,117,109,101,110,116,32,105,115,32,105,103,110, - 111,114,101,100,46,32,84,104,101,10,32,32,32,32,39,102, - 114,111,109,108,105,115,116,39,32,97,114,103,117,109,101,110, - 116,32,115,112,101,99,105,102,105,101,115,32,119,104,97,116, - 32,115,104,111,117,108,100,32,101,120,105,115,116,32,97,115, - 32,97,116,116,114,105,98,117,116,101,115,32,111,110,32,116, - 104,101,32,109,111,100,117,108,101,10,32,32,32,32,98,101, - 105,110,103,32,105,109,112,111,114,116,101,100,32,40,101,46, - 103,46,32,96,96,102,114,111,109,32,109,111,100,117,108,101, - 32,105,109,112,111,114,116,32,60,102,114,111,109,108,105,115, - 116,62,96,96,41,46,32,32,84,104,101,32,39,108,101,118, - 101,108,39,10,32,32,32,32,97,114,103,117,109,101,110,116, - 32,114,101,112,114,101,115,101,110,116,115,32,116,104,101,32, - 112,97,99,107,97,103,101,32,108,111,99,97,116,105,111,110, - 32,116,111,32,105,109,112,111,114,116,32,102,114,111,109,32, - 105,110,32,97,32,114,101,108,97,116,105,118,101,10,32,32, - 32,32,105,109,112,111,114,116,32,40,101,46,103,46,32,96, - 96,102,114,111,109,32,46,46,112,107,103,32,105,109,112,111, - 114,116,32,109,111,100,96,96,32,119,111,117,108,100,32,104, - 97,118,101,32,97,32,39,108,101,118,101,108,39,32,111,102, - 32,50,41,46,10,10,32,32,32,32,114,25,0,0,0,78, - 114,141,0,0,0,114,154,0,0,0,41,9,114,228,0,0, - 0,114,239,0,0,0,218,9,112,97,114,116,105,116,105,111, - 110,114,207,0,0,0,114,18,0,0,0,114,105,0,0,0, - 114,9,0,0,0,114,11,0,0,0,114,233,0,0,0,41, - 9,114,20,0,0,0,114,238,0,0,0,218,6,108,111,99, - 97,108,115,114,234,0,0,0,114,209,0,0,0,114,110,0, - 0,0,90,8,103,108,111,98,97,108,115,95,114,208,0,0, - 0,90,7,99,117,116,95,111,102,102,114,5,0,0,0,114, - 5,0,0,0,114,6,0,0,0,218,10,95,95,105,109,112, - 111,114,116,95,95,86,4,0,0,115,32,0,0,0,8,11, - 10,1,16,2,8,1,12,1,4,1,8,3,18,1,4,1, - 4,1,26,4,30,3,10,1,12,1,4,2,255,128,114,242, - 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0, - 0,116,0,160,1,124,0,161,1,125,1,124,1,100,0,117, - 0,114,30,116,2,100,1,124,0,23,0,131,1,130,1,116, - 3,124,1,131,1,83,0,41,2,78,122,25,110,111,32,98, - 117,105,108,116,45,105,110,32,109,111,100,117,108,101,32,110, - 97,109,101,100,32,41,4,114,175,0,0,0,114,183,0,0, - 0,114,87,0,0,0,114,173,0,0,0,41,2,114,20,0, - 0,0,114,109,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,6,0,0,0,218,18,95,98,117,105,108,116,105,110, - 95,102,114,111,109,95,110,97,109,101,123,4,0,0,115,10, - 0,0,0,10,1,8,1,12,1,8,1,255,128,114,243,0, - 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,10, - 0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,0, - 124,1,97,0,124,0,97,1,116,2,116,1,131,1,125,2, - 116,1,106,3,160,4,161,0,68,0,93,72,92,2,125,3, - 125,4,116,5,124,4,124,2,131,2,114,98,124,3,116,1, - 106,6,118,0,114,60,116,7,125,5,110,18,116,0,160,8, - 124,3,161,1,114,76,116,9,125,5,110,2,113,26,116,10, - 124,4,124,5,131,2,125,6,116,11,124,6,124,4,131,2, - 1,0,113,26,116,1,106,3,116,12,25,0,125,7,100,1, - 68,0,93,46,125,8,124,8,116,1,106,3,118,1,114,138, - 116,13,124,8,131,1,125,9,110,10,116,1,106,3,124,8, - 25,0,125,9,116,14,124,7,124,8,124,9,131,3,1,0, - 113,114,100,2,83,0,41,3,122,250,83,101,116,117,112,32, - 105,109,112,111,114,116,108,105,98,32,98,121,32,105,109,112, - 111,114,116,105,110,103,32,110,101,101,100,101,100,32,98,117, - 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97, - 110,100,32,105,110,106,101,99,116,105,110,103,32,116,104,101, - 109,10,32,32,32,32,105,110,116,111,32,116,104,101,32,103, - 108,111,98,97,108,32,110,97,109,101,115,112,97,99,101,46, - 10,10,32,32,32,32,65,115,32,115,121,115,32,105,115,32, - 110,101,101,100,101,100,32,102,111,114,32,115,121,115,46,109, - 111,100,117,108,101,115,32,97,99,99,101,115,115,32,97,110, - 100,32,95,105,109,112,32,105,115,32,110,101,101,100,101,100, - 32,116,111,32,108,111,97,100,32,98,117,105,108,116,45,105, - 110,10,32,32,32,32,109,111,100,117,108,101,115,44,32,116, - 104,111,115,101,32,116,119,111,32,109,111,100,117,108,101,115, - 32,109,117,115,116,32,98,101,32,101,120,112,108,105,99,105, - 116,108,121,32,112,97,115,115,101,100,32,105,110,46,10,10, - 32,32,32,32,41,3,114,26,0,0,0,114,101,0,0,0, - 114,71,0,0,0,78,41,15,114,64,0,0,0,114,18,0, - 0,0,114,3,0,0,0,114,105,0,0,0,218,5,105,116, - 101,109,115,114,215,0,0,0,114,86,0,0,0,114,175,0, - 0,0,114,98,0,0,0,114,192,0,0,0,114,155,0,0, - 0,114,161,0,0,0,114,9,0,0,0,114,243,0,0,0, - 114,12,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,20,0, - 0,0,114,110,0,0,0,114,122,0,0,0,114,109,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,5,0,0, - 0,114,5,0,0,0,114,6,0,0,0,218,6,95,115,101, - 116,117,112,130,4,0,0,115,42,0,0,0,4,9,4,1, - 8,3,18,1,10,1,10,1,6,1,10,1,6,1,2,2, - 10,1,10,1,2,128,10,3,8,1,10,1,10,1,10,2, - 14,1,4,251,255,128,114,247,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,124,0,124,1,131, - 2,1,0,116,1,106,2,160,3,116,4,161,1,1,0,116, - 1,106,2,160,3,116,5,161,1,1,0,100,1,83,0,41, - 2,122,48,73,110,115,116,97,108,108,32,105,109,112,111,114, - 116,101,114,115,32,102,111,114,32,98,117,105,108,116,105,110, - 32,97,110,100,32,102,114,111,122,101,110,32,109,111,100,117, - 108,101,115,78,41,6,114,247,0,0,0,114,18,0,0,0, - 114,213,0,0,0,114,132,0,0,0,114,175,0,0,0,114, - 192,0,0,0,41,2,114,245,0,0,0,114,246,0,0,0, - 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218, - 8,95,105,110,115,116,97,108,108,165,4,0,0,115,8,0, - 0,0,10,2,12,2,16,1,255,128,114,248,0,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 4,0,0,0,67,0,0,0,115,32,0,0,0,100,1,100, - 2,108,0,125,0,124,0,97,1,124,0,160,2,116,3,106, - 4,116,5,25,0,161,1,1,0,100,2,83,0,41,3,122, - 57,73,110,115,116,97,108,108,32,105,109,112,111,114,116,101, - 114,115,32,116,104,97,116,32,114,101,113,117,105,114,101,32, - 101,120,116,101,114,110,97,108,32,102,105,108,101,115,121,115, - 116,101,109,32,97,99,99,101,115,115,114,25,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,139, - 0,0,0,114,248,0,0,0,114,18,0,0,0,114,105,0, - 0,0,114,9,0,0,0,41,1,114,249,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,6,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,173,4,0,0,115,8, - 0,0,0,8,3,4,1,20,1,255,128,114,250,0,0,0, - 41,2,78,78,41,1,78,41,2,78,114,25,0,0,0,41, - 4,78,78,114,5,0,0,0,114,25,0,0,0,41,54,114, - 10,0,0,0,114,7,0,0,0,114,26,0,0,0,114,101, - 0,0,0,114,71,0,0,0,114,139,0,0,0,114,17,0, - 0,0,114,21,0,0,0,114,66,0,0,0,114,37,0,0, - 0,114,47,0,0,0,114,22,0,0,0,114,23,0,0,0, - 114,55,0,0,0,114,57,0,0,0,114,60,0,0,0,114, - 72,0,0,0,114,74,0,0,0,114,83,0,0,0,114,95, - 0,0,0,114,100,0,0,0,114,111,0,0,0,114,124,0, - 0,0,114,125,0,0,0,114,104,0,0,0,114,155,0,0, - 0,114,161,0,0,0,114,165,0,0,0,114,119,0,0,0, - 114,106,0,0,0,114,172,0,0,0,114,173,0,0,0,114, - 107,0,0,0,114,175,0,0,0,114,192,0,0,0,114,199, - 0,0,0,114,210,0,0,0,114,212,0,0,0,114,214,0, - 0,0,114,220,0,0,0,90,15,95,69,82,82,95,77,83, - 71,95,80,82,69,70,73,88,114,222,0,0,0,114,225,0, - 0,0,218,6,111,98,106,101,99,116,114,226,0,0,0,114, - 227,0,0,0,114,228,0,0,0,114,233,0,0,0,114,239, - 0,0,0,114,242,0,0,0,114,243,0,0,0,114,247,0, - 0,0,114,248,0,0,0,114,250,0,0,0,114,5,0,0, + 10,95,102,105,110,100,95,115,112,101,99,147,3,0,0,115, + 66,0,0,0,6,2,8,1,8,2,4,3,12,1,10,5, + 8,1,8,1,2,1,10,1,14,1,12,1,8,1,16,1, + 4,255,12,3,30,128,10,1,18,2,10,1,2,1,10,1, + 14,1,12,4,10,2,8,1,8,2,8,2,2,239,4,19, + 2,243,2,244,255,128,114,214,0,0,0,99,3,0,0,0, + 0,0,0,0,0,0,0,0,3,0,0,0,5,0,0,0, + 67,0,0,0,115,110,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,82,116,0,124, + 1,116,1,131,2,115,70,116,2,100,4,131,1,130,1,124, + 1,115,82,116,6,100,5,131,1,130,1,124,0,115,106,124, + 2,100,2,107,2,114,102,116,5,100,6,131,1,130,1,100, + 7,83,0,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,25,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,50,0,0, + 0,114,3,0,0,0,218,10,86,97,108,117,101,69,114,114, + 111,114,114,87,0,0,0,169,3,114,20,0,0,0,114,208, + 0,0,0,114,209,0,0,0,114,5,0,0,0,114,5,0, + 0,0,114,6,0,0,0,218,13,95,115,97,110,105,116,121, + 95,99,104,101,99,107,194,3,0,0,115,26,0,0,0,10, + 2,18,1,8,1,8,1,8,1,10,1,8,1,4,1,8, + 1,12,2,8,1,8,255,255,128,114,220,0,0,0,122,16, + 78,111,32,109,111,100,117,108,101,32,110,97,109,101,100,32, + 122,4,123,33,114,125,99,2,0,0,0,0,0,0,0,0, + 0,0,0,9,0,0,0,8,0,0,0,67,0,0,0,115, + 22,1,0,0,100,0,125,2,124,0,160,0,100,1,161,1, + 100,2,25,0,125,3,124,3,114,128,124,3,116,1,106,2, + 118,1,114,42,116,3,124,1,124,3,131,2,1,0,124,0, + 116,1,106,2,118,0,114,62,116,1,106,2,124,0,25,0, + 83,0,116,1,106,2,124,3,25,0,125,4,122,10,124,4, + 106,4,125,2,87,0,110,44,4,0,116,5,144,1,121,20, + 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,116,9,124,0,124,2,131,2,125,6,124,6, + 100,0,117,0,114,164,116,8,116,6,160,7,124,0,161,1, + 124,0,100,4,141,2,130,1,116,10,124,6,131,1,125,7, + 124,3,144,1,114,14,116,1,106,2,124,3,25,0,125,4, + 124,0,160,0,100,1,161,1,100,5,25,0,125,8,122,18, + 116,11,124,4,124,8,124,7,131,3,1,0,87,0,124,7, + 83,0,4,0,116,5,144,1,121,18,1,0,1,0,1,0, + 100,6,124,3,155,2,100,7,124,8,155,2,157,4,125,5, + 116,12,160,13,124,5,116,14,161,2,1,0,89,0,124,7, + 83,0,124,7,83,0,119,0,119,0,41,8,78,114,141,0, + 0,0,114,25,0,0,0,122,23,59,32,123,33,114,125,32, + 105,115,32,110,111,116,32,97,32,112,97,99,107,97,103,101, + 114,19,0,0,0,233,2,0,0,0,122,27,67,97,110,110, + 111,116,32,115,101,116,32,97,110,32,97,116,116,114,105,98, + 117,116,101,32,111,110,32,122,18,32,102,111,114,32,99,104, + 105,108,100,32,109,111,100,117,108,101,32,41,15,114,142,0, + 0,0,114,18,0,0,0,114,105,0,0,0,114,74,0,0, + 0,114,154,0,0,0,114,2,0,0,0,218,8,95,69,82, + 82,95,77,83,71,114,50,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, + 214,0,0,0,114,173,0,0,0,114,12,0,0,0,114,101, + 0,0,0,114,102,0,0,0,114,169,0,0,0,41,9,114, + 20,0,0,0,218,7,105,109,112,111,114,116,95,114,181,0, + 0,0,114,143,0,0,0,90,13,112,97,114,101,110,116,95, + 109,111,100,117,108,101,114,108,0,0,0,114,109,0,0,0, + 114,110,0,0,0,90,5,99,104,105,108,100,114,5,0,0, + 0,114,5,0,0,0,114,6,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,213,3,0,0,115,60,0,0,0,4,1,14, + 1,4,1,10,1,10,1,10,2,10,1,10,1,2,1,10, + 1,14,1,16,1,14,1,10,1,8,1,18,1,8,2,6, + 1,10,2,14,1,2,1,14,1,4,4,14,253,16,1,14, + 1,8,1,2,253,2,242,255,128,114,225,0,0,0,99,2, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,8, + 0,0,0,67,0,0,0,115,128,0,0,0,116,0,124,0, + 131,1,143,62,1,0,116,1,106,2,160,3,124,0,116,4, + 161,2,125,2,124,2,116,4,117,0,114,56,116,5,124,0, + 124,1,131,2,87,0,2,0,100,1,4,0,4,0,131,3, + 1,0,83,0,87,0,100,1,4,0,4,0,131,3,1,0, + 110,16,49,0,115,76,119,1,1,0,1,0,1,0,89,0, + 1,0,124,2,100,1,117,0,114,116,100,2,160,6,124,0, + 161,1,125,3,116,7,124,3,124,0,100,3,141,2,130,1, + 116,8,124,0,131,1,1,0,124,2,83,0,41,4,122,25, + 70,105,110,100,32,97,110,100,32,108,111,97,100,32,116,104, + 101,32,109,111,100,117,108,101,46,78,122,40,105,109,112,111, + 114,116,32,111,102,32,123,125,32,104,97,108,116,101,100,59, + 32,78,111,110,101,32,105,110,32,115,121,115,46,109,111,100, + 117,108,101,115,114,19,0,0,0,41,9,114,57,0,0,0, + 114,18,0,0,0,114,105,0,0,0,114,38,0,0,0,218, + 14,95,78,69,69,68,83,95,76,79,65,68,73,78,71,114, + 225,0,0,0,114,50,0,0,0,114,223,0,0,0,114,72, + 0,0,0,41,4,114,20,0,0,0,114,224,0,0,0,114, + 110,0,0,0,114,82,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,6,0,0,0,218,14,95,102,105,110,100,95, + 97,110,100,95,108,111,97,100,248,3,0,0,115,28,0,0, + 0,10,2,14,1,8,1,24,1,14,255,16,128,8,3,2, + 1,6,1,2,255,12,2,8,2,4,1,255,128,114,227,0, + 0,0,114,25,0,0,0,99,3,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,4,0,0,0,67,0,0,0, + 115,42,0,0,0,116,0,124,0,124,1,124,2,131,3,1, + 0,124,2,100,1,107,4,114,32,116,1,124,0,124,1,124, + 2,131,3,125,0,116,2,124,0,116,3,131,2,83,0,41, + 3,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,25,0,0,0,78,41,4, + 114,220,0,0,0,114,210,0,0,0,114,227,0,0,0,218, + 11,95,103,99,100,95,105,109,112,111,114,116,114,219,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0, - 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,106, - 0,0,0,4,0,8,22,4,9,4,1,4,1,4,3,8, - 3,8,8,4,8,4,2,16,3,14,4,14,77,14,21,8, - 16,8,37,8,17,14,11,8,8,8,11,8,12,8,19,14, - 26,16,101,10,26,14,45,8,72,8,17,8,17,8,30,8, - 36,8,45,14,15,14,77,14,82,8,13,8,9,10,9,8, - 47,4,16,8,1,8,2,6,32,8,3,10,16,14,15,8, - 37,10,27,8,37,8,7,8,35,12,8,255,128, + 114,228,0,0,0,8,4,0,0,115,10,0,0,0,12,9, + 8,1,12,1,10,1,255,128,114,228,0,0,0,169,1,218, + 9,114,101,99,117,114,115,105,118,101,99,3,0,0,0,0, + 0,0,0,1,0,0,0,8,0,0,0,11,0,0,0,67, + 0,0,0,115,218,0,0,0,124,1,68,0,93,206,125,4, + 116,0,124,4,116,1,131,2,115,64,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,124,4,100,5,107,2,114,106, + 124,3,115,104,116,5,124,0,100,6,131,2,114,104,116,6, + 124,0,124,0,106,7,124,2,100,7,100,8,141,4,1,0, + 113,4,116,5,124,0,124,4,131,2,115,210,100,9,160,8, + 124,0,106,2,124,4,161,2,125,6,122,14,116,9,124,2, + 124,6,131,2,1,0,87,0,113,4,4,0,116,10,121,216, + 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, + 117,1,114,200,87,0,89,0,100,10,125,7,126,7,113,4, + 130,0,100,10,125,7,126,7,119,1,113,4,124,0,83,0, + 119,0,41,11,122,238,70,105,103,117,114,101,32,111,117,116, + 32,119,104,97,116,32,95,95,105,109,112,111,114,116,95,95, + 32,115,104,111,117,108,100,32,114,101,116,117,114,110,46,10, + 10,32,32,32,32,84,104,101,32,105,109,112,111,114,116,95, + 32,112,97,114,97,109,101,116,101,114,32,105,115,32,97,32, + 99,97,108,108,97,98,108,101,32,119,104,105,99,104,32,116, + 97,107,101,115,32,116,104,101,32,110,97,109,101,32,111,102, + 32,109,111,100,117,108,101,32,116,111,10,32,32,32,32,105, + 109,112,111,114,116,46,32,73,116,32,105,115,32,114,101,113, + 117,105,114,101,100,32,116,111,32,100,101,99,111,117,112,108, + 101,32,116,104,101,32,102,117,110,99,116,105,111,110,32,102, + 114,111,109,32,97,115,115,117,109,105,110,103,32,105,109,112, + 111,114,116,108,105,98,39,115,10,32,32,32,32,105,109,112, + 111,114,116,32,105,109,112,108,101,109,101,110,116,97,116,105, + 111,110,32,105,115,32,100,101,115,105,114,101,100,46,10,10, + 32,32,32,32,122,8,46,95,95,97,108,108,95,95,122,13, + 96,96,102,114,111,109,32,108,105,115,116,39,39,122,8,73, + 116,101,109,32,105,110,32,122,18,32,109,117,115,116,32,98, + 101,32,115,116,114,44,32,110,111,116,32,250,1,42,218,7, + 95,95,97,108,108,95,95,84,114,229,0,0,0,114,205,0, + 0,0,78,41,16,114,215,0,0,0,114,216,0,0,0,114, + 9,0,0,0,114,217,0,0,0,114,3,0,0,0,114,11, + 0,0,0,218,16,95,104,97,110,100,108,101,95,102,114,111, + 109,108,105,115,116,114,232,0,0,0,114,50,0,0,0,114, + 74,0,0,0,114,223,0,0,0,114,20,0,0,0,114,18, + 0,0,0,114,105,0,0,0,114,38,0,0,0,114,226,0, + 0,0,41,8,114,110,0,0,0,218,8,102,114,111,109,108, + 105,115,116,114,224,0,0,0,114,230,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,5,0,0,0,114,5,0,0, + 0,114,6,0,0,0,114,233,0,0,0,23,4,0,0,115, + 58,0,0,0,8,10,10,1,4,1,12,1,4,2,10,1, + 8,1,8,255,8,2,14,1,10,1,2,1,6,255,2,128, + 10,2,14,1,2,1,14,1,14,1,10,4,16,1,2,255, + 12,2,2,1,8,128,2,245,4,12,2,248,255,128,114,233, + 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,6,0,0,0,67,0,0,0,115,146,0,0, + 0,124,0,160,0,100,1,161,1,125,1,124,0,160,0,100, + 2,161,1,125,2,124,1,100,3,117,1,114,82,124,2,100, + 3,117,1,114,78,124,1,124,2,106,1,107,3,114,78,116, + 2,106,3,100,4,124,1,155,2,100,5,124,2,106,1,155, + 2,100,6,157,5,116,4,100,7,100,8,141,3,1,0,124, + 1,83,0,124,2,100,3,117,1,114,96,124,2,106,1,83, + 0,116,2,106,3,100,9,116,4,100,7,100,8,141,3,1, + 0,124,0,100,10,25,0,125,1,100,11,124,0,118,1,114, + 142,124,1,160,5,100,12,161,1,100,13,25,0,125,1,124, + 1,83,0,41,14,122,167,67,97,108,99,117,108,97,116,101, + 32,119,104,97,116,32,95,95,112,97,99,107,97,103,101,95, + 95,32,115,104,111,117,108,100,32,98,101,46,10,10,32,32, + 32,32,95,95,112,97,99,107,97,103,101,95,95,32,105,115, + 32,110,111,116,32,103,117,97,114,97,110,116,101,101,100,32, + 116,111,32,98,101,32,100,101,102,105,110,101,100,32,111,114, + 32,99,111,117,108,100,32,98,101,32,115,101,116,32,116,111, + 32,78,111,110,101,10,32,32,32,32,116,111,32,114,101,112, + 114,101,115,101,110,116,32,116,104,97,116,32,105,116,115,32, + 112,114,111,112,101,114,32,118,97,108,117,101,32,105,115,32, + 117,110,107,110,111,119,110,46,10,10,32,32,32,32,114,158, + 0,0,0,114,113,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,9,0,0,0,114,154,0,0,0,114,141,0,0, + 0,114,25,0,0,0,41,6,114,38,0,0,0,114,143,0, + 0,0,114,101,0,0,0,114,102,0,0,0,114,169,0,0, + 0,114,142,0,0,0,41,3,218,7,103,108,111,98,97,108, + 115,114,208,0,0,0,114,109,0,0,0,114,5,0,0,0, + 114,5,0,0,0,114,6,0,0,0,218,17,95,99,97,108, + 99,95,95,95,112,97,99,107,97,103,101,95,95,60,4,0, + 0,115,44,0,0,0,10,7,10,1,8,1,18,1,6,1, + 2,1,4,255,4,1,6,255,4,2,6,254,4,3,8,1, + 6,1,6,2,4,2,6,254,8,3,8,1,14,1,4,1, + 255,128,114,239,0,0,0,114,5,0,0,0,99,5,0,0, + 0,0,0,0,0,0,0,0,0,9,0,0,0,5,0,0, + 0,67,0,0,0,115,174,0,0,0,124,4,100,1,107,2, + 114,18,116,0,124,0,131,1,125,5,110,36,124,1,100,2, + 117,1,114,30,124,1,110,2,105,0,125,6,116,1,124,6, + 131,1,125,7,116,0,124,0,124,7,124,4,131,3,125,5, + 124,3,115,148,124,4,100,1,107,2,114,84,116,0,124,0, + 160,2,100,3,161,1,100,1,25,0,131,1,83,0,124,0, + 115,92,124,5,83,0,116,3,124,0,131,1,116,3,124,0, + 160,2,100,3,161,1,100,1,25,0,131,1,24,0,125,8, + 116,4,106,5,124,5,106,6,100,2,116,3,124,5,106,6, + 131,1,124,8,24,0,133,2,25,0,25,0,83,0,116,7, + 124,5,100,4,131,2,114,170,116,8,124,5,124,3,116,0, + 131,3,83,0,124,5,83,0,41,5,97,215,1,0,0,73, + 109,112,111,114,116,32,97,32,109,111,100,117,108,101,46,10, + 10,32,32,32,32,84,104,101,32,39,103,108,111,98,97,108, + 115,39,32,97,114,103,117,109,101,110,116,32,105,115,32,117, + 115,101,100,32,116,111,32,105,110,102,101,114,32,119,104,101, + 114,101,32,116,104,101,32,105,109,112,111,114,116,32,105,115, + 32,111,99,99,117,114,114,105,110,103,32,102,114,111,109,10, + 32,32,32,32,116,111,32,104,97,110,100,108,101,32,114,101, + 108,97,116,105,118,101,32,105,109,112,111,114,116,115,46,32, + 84,104,101,32,39,108,111,99,97,108,115,39,32,97,114,103, + 117,109,101,110,116,32,105,115,32,105,103,110,111,114,101,100, + 46,32,84,104,101,10,32,32,32,32,39,102,114,111,109,108, + 105,115,116,39,32,97,114,103,117,109,101,110,116,32,115,112, + 101,99,105,102,105,101,115,32,119,104,97,116,32,115,104,111, + 117,108,100,32,101,120,105,115,116,32,97,115,32,97,116,116, + 114,105,98,117,116,101,115,32,111,110,32,116,104,101,32,109, + 111,100,117,108,101,10,32,32,32,32,98,101,105,110,103,32, + 105,109,112,111,114,116,101,100,32,40,101,46,103,46,32,96, + 96,102,114,111,109,32,109,111,100,117,108,101,32,105,109,112, + 111,114,116,32,60,102,114,111,109,108,105,115,116,62,96,96, + 41,46,32,32,84,104,101,32,39,108,101,118,101,108,39,10, + 32,32,32,32,97,114,103,117,109,101,110,116,32,114,101,112, + 114,101,115,101,110,116,115,32,116,104,101,32,112,97,99,107, + 97,103,101,32,108,111,99,97,116,105,111,110,32,116,111,32, + 105,109,112,111,114,116,32,102,114,111,109,32,105,110,32,97, + 32,114,101,108,97,116,105,118,101,10,32,32,32,32,105,109, + 112,111,114,116,32,40,101,46,103,46,32,96,96,102,114,111, + 109,32,46,46,112,107,103,32,105,109,112,111,114,116,32,109, + 111,100,96,96,32,119,111,117,108,100,32,104,97,118,101,32, + 97,32,39,108,101,118,101,108,39,32,111,102,32,50,41,46, + 10,10,32,32,32,32,114,25,0,0,0,78,114,141,0,0, + 0,114,154,0,0,0,41,9,114,228,0,0,0,114,239,0, + 0,0,218,9,112,97,114,116,105,116,105,111,110,114,207,0, + 0,0,114,18,0,0,0,114,105,0,0,0,114,9,0,0, + 0,114,11,0,0,0,114,233,0,0,0,41,9,114,20,0, + 0,0,114,238,0,0,0,218,6,108,111,99,97,108,115,114, + 234,0,0,0,114,209,0,0,0,114,110,0,0,0,90,8, + 103,108,111,98,97,108,115,95,114,208,0,0,0,90,7,99, + 117,116,95,111,102,102,114,5,0,0,0,114,5,0,0,0, + 114,6,0,0,0,218,10,95,95,105,109,112,111,114,116,95, + 95,87,4,0,0,115,32,0,0,0,8,11,10,1,16,2, + 8,1,12,1,4,1,8,3,18,1,4,1,4,1,26,4, + 30,3,10,1,12,1,4,2,255,128,114,242,0,0,0,99, + 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,67,0,0,0,115,38,0,0,0,116,0,160, + 1,124,0,161,1,125,1,124,1,100,0,117,0,114,30,116, + 2,100,1,124,0,23,0,131,1,130,1,116,3,124,1,131, + 1,83,0,41,2,78,122,25,110,111,32,98,117,105,108,116, + 45,105,110,32,109,111,100,117,108,101,32,110,97,109,101,100, + 32,41,4,114,175,0,0,0,114,183,0,0,0,114,87,0, + 0,0,114,173,0,0,0,41,2,114,20,0,0,0,114,109, + 0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,0, + 0,0,218,18,95,98,117,105,108,116,105,110,95,102,114,111, + 109,95,110,97,109,101,124,4,0,0,115,10,0,0,0,10, + 1,8,1,12,1,8,1,255,128,114,243,0,0,0,99,2, + 0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,5, + 0,0,0,67,0,0,0,115,166,0,0,0,124,1,97,0, + 124,0,97,1,116,2,116,1,131,1,125,2,116,1,106,3, + 160,4,161,0,68,0,93,72,92,2,125,3,125,4,116,5, + 124,4,124,2,131,2,114,98,124,3,116,1,106,6,118,0, + 114,60,116,7,125,5,110,18,116,0,160,8,124,3,161,1, + 114,76,116,9,125,5,110,2,113,26,116,10,124,4,124,5, + 131,2,125,6,116,11,124,6,124,4,131,2,1,0,113,26, + 116,1,106,3,116,12,25,0,125,7,100,1,68,0,93,46, + 125,8,124,8,116,1,106,3,118,1,114,138,116,13,124,8, + 131,1,125,9,110,10,116,1,106,3,124,8,25,0,125,9, + 116,14,124,7,124,8,124,9,131,3,1,0,113,114,100,2, + 83,0,41,3,122,250,83,101,116,117,112,32,105,109,112,111, + 114,116,108,105,98,32,98,121,32,105,109,112,111,114,116,105, + 110,103,32,110,101,101,100,101,100,32,98,117,105,108,116,45, + 105,110,32,109,111,100,117,108,101,115,32,97,110,100,32,105, + 110,106,101,99,116,105,110,103,32,116,104,101,109,10,32,32, + 32,32,105,110,116,111,32,116,104,101,32,103,108,111,98,97, + 108,32,110,97,109,101,115,112,97,99,101,46,10,10,32,32, + 32,32,65,115,32,115,121,115,32,105,115,32,110,101,101,100, + 101,100,32,102,111,114,32,115,121,115,46,109,111,100,117,108, + 101,115,32,97,99,99,101,115,115,32,97,110,100,32,95,105, + 109,112,32,105,115,32,110,101,101,100,101,100,32,116,111,32, + 108,111,97,100,32,98,117,105,108,116,45,105,110,10,32,32, + 32,32,109,111,100,117,108,101,115,44,32,116,104,111,115,101, + 32,116,119,111,32,109,111,100,117,108,101,115,32,109,117,115, + 116,32,98,101,32,101,120,112,108,105,99,105,116,108,121,32, + 112,97,115,115,101,100,32,105,110,46,10,10,32,32,32,32, + 41,3,114,26,0,0,0,114,101,0,0,0,114,71,0,0, + 0,78,41,15,114,64,0,0,0,114,18,0,0,0,114,3, + 0,0,0,114,105,0,0,0,218,5,105,116,101,109,115,114, + 215,0,0,0,114,86,0,0,0,114,175,0,0,0,114,98, + 0,0,0,114,192,0,0,0,114,155,0,0,0,114,161,0, + 0,0,114,9,0,0,0,114,243,0,0,0,114,12,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,20,0,0,0,114,110, + 0,0,0,114,122,0,0,0,114,109,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,5,0,0,0,114,5,0, + 0,0,114,6,0,0,0,218,6,95,115,101,116,117,112,131, + 4,0,0,115,42,0,0,0,4,9,4,1,8,3,18,1, + 10,1,10,1,6,1,10,1,6,1,2,2,10,1,10,1, + 2,128,10,3,8,1,10,1,10,1,10,2,14,1,4,251, + 255,128,114,247,0,0,0,99,2,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,38,0,0,0,116,0,124,0,124,1,131,2,1,0,116, + 1,106,2,160,3,116,4,161,1,1,0,116,1,106,2,160, + 3,116,5,161,1,1,0,100,1,83,0,41,2,122,48,73, + 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115, + 32,102,111,114,32,98,117,105,108,116,105,110,32,97,110,100, + 32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,78, + 41,6,114,247,0,0,0,114,18,0,0,0,114,213,0,0, + 0,114,132,0,0,0,114,175,0,0,0,114,192,0,0,0, + 41,2,114,245,0,0,0,114,246,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,6,0,0,0,218,8,95,105,110, + 115,116,97,108,108,166,4,0,0,115,8,0,0,0,10,2, + 12,2,16,1,255,128,114,248,0,0,0,99,0,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0, + 67,0,0,0,115,32,0,0,0,100,1,100,2,108,0,125, + 0,124,0,97,1,124,0,160,2,116,3,106,4,116,5,25, + 0,161,1,1,0,100,2,83,0,41,3,122,57,73,110,115, + 116,97,108,108,32,105,109,112,111,114,116,101,114,115,32,116, + 104,97,116,32,114,101,113,117,105,114,101,32,101,120,116,101, + 114,110,97,108,32,102,105,108,101,115,121,115,116,101,109,32, + 97,99,99,101,115,115,114,25,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,139,0,0,0,114, + 248,0,0,0,114,18,0,0,0,114,105,0,0,0,114,9, + 0,0,0,41,1,114,249,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,6,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,174,4,0,0,115,8,0,0,0,8, + 3,4,1,20,1,255,128,114,250,0,0,0,41,2,78,78, + 41,1,78,41,2,78,114,25,0,0,0,41,4,78,78,114, + 5,0,0,0,114,25,0,0,0,41,54,114,10,0,0,0, + 114,7,0,0,0,114,26,0,0,0,114,101,0,0,0,114, + 71,0,0,0,114,139,0,0,0,114,17,0,0,0,114,21, + 0,0,0,114,66,0,0,0,114,37,0,0,0,114,47,0, + 0,0,114,22,0,0,0,114,23,0,0,0,114,55,0,0, + 0,114,57,0,0,0,114,60,0,0,0,114,72,0,0,0, + 114,74,0,0,0,114,83,0,0,0,114,95,0,0,0,114, + 100,0,0,0,114,111,0,0,0,114,124,0,0,0,114,125, + 0,0,0,114,104,0,0,0,114,155,0,0,0,114,161,0, + 0,0,114,165,0,0,0,114,119,0,0,0,114,106,0,0, + 0,114,172,0,0,0,114,173,0,0,0,114,107,0,0,0, + 114,175,0,0,0,114,192,0,0,0,114,199,0,0,0,114, + 210,0,0,0,114,212,0,0,0,114,214,0,0,0,114,220, + 0,0,0,90,15,95,69,82,82,95,77,83,71,95,80,82, + 69,70,73,88,114,222,0,0,0,114,225,0,0,0,218,6, + 111,98,106,101,99,116,114,226,0,0,0,114,227,0,0,0, + 114,228,0,0,0,114,233,0,0,0,114,239,0,0,0,114, + 242,0,0,0,114,243,0,0,0,114,247,0,0,0,114,248, + 0,0,0,114,250,0,0,0,114,5,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,6,0,0,0,218,8,60,109, + 111,100,117,108,101,62,1,0,0,0,115,106,0,0,0,4, + 0,8,22,4,9,4,1,4,1,4,3,8,3,8,8,4, + 8,4,2,16,3,14,4,14,77,14,21,8,16,8,37,8, + 17,14,11,8,8,8,11,8,12,8,19,14,26,16,101,10, + 26,14,45,8,72,8,17,8,17,8,30,8,36,8,45,14, + 15,14,77,14,82,8,13,8,9,10,10,8,47,4,16,8, + 1,8,2,6,32,8,3,10,16,14,15,8,37,10,27,8, + 37,8,7,8,35,12,8,255,128, }; diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 934eebaf3a66e..9b5c720578ad7 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -2158,522 +2158,530 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 1,4,1,2,253,2,250,255,128,122,31,80,97,116,104,70, 105,110,100,101,114,46,95,112,97,116,104,95,105,109,112,111, 114,116,101,114,95,99,97,99,104,101,99,3,0,0,0,0, - 0,0,0,0,0,0,0,6,0,0,0,4,0,0,0,67, - 0,0,0,115,82,0,0,0,116,0,124,2,100,1,131,2, + 0,0,0,0,0,0,0,7,0,0,0,4,0,0,0,67, + 0,0,0,115,110,0,0,0,116,0,124,2,100,1,131,2, 114,26,124,2,160,1,124,1,161,1,92,2,125,3,125,4, - 110,14,124,2,160,2,124,1,161,1,125,3,103,0,125,4, - 124,3,100,0,117,1,114,60,116,3,160,4,124,1,124,3, - 161,2,83,0,116,3,160,5,124,1,100,0,161,2,125,5, - 124,4,124,5,95,6,124,5,83,0,41,2,78,114,148,0, - 0,0,41,7,114,140,0,0,0,114,148,0,0,0,114,217, - 0,0,0,114,146,0,0,0,114,212,0,0,0,114,194,0, - 0,0,114,189,0,0,0,41,6,114,209,0,0,0,114,150, + 110,42,116,2,160,3,124,2,161,1,155,0,100,2,157,2, + 125,5,116,4,160,5,124,5,116,6,161,2,1,0,124,2, + 160,7,124,1,161,1,125,3,103,0,125,4,124,3,100,0, + 117,1,114,88,116,2,160,8,124,1,124,3,161,2,83,0, + 116,2,160,9,124,1,100,0,161,2,125,6,124,4,124,6, + 95,10,124,6,83,0,41,3,78,114,148,0,0,0,122,53, + 46,102,105,110,100,95,115,112,101,99,40,41,32,110,111,116, + 32,102,111,117,110,100,59,32,102,97,108,108,105,110,103,32, + 98,97,99,107,32,116,111,32,102,105,110,100,95,109,111,100, + 117,108,101,40,41,41,11,114,140,0,0,0,114,148,0,0, + 0,114,146,0,0,0,90,12,95,111,98,106,101,99,116,95, + 110,97,109,101,114,88,0,0,0,114,89,0,0,0,114,149, + 0,0,0,114,217,0,0,0,114,212,0,0,0,114,194,0, + 0,0,114,189,0,0,0,41,7,114,209,0,0,0,114,150, 0,0,0,114,68,1,0,0,114,151,0,0,0,114,152,0, - 0,0,114,198,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,218,16,95,108,101,103,97,99,121,95, - 103,101,116,95,115,112,101,99,40,5,0,0,115,20,0,0, - 0,10,4,16,1,10,2,4,1,8,1,12,1,12,1,6, - 1,4,1,255,128,122,27,80,97,116,104,70,105,110,100,101, - 114,46,95,108,101,103,97,99,121,95,103,101,116,95,115,112, - 101,99,78,99,4,0,0,0,0,0,0,0,0,0,0,0, - 9,0,0,0,5,0,0,0,67,0,0,0,115,166,0,0, - 0,103,0,125,4,124,2,68,0,93,134,125,5,116,0,124, - 5,116,1,116,2,102,2,131,2,115,28,113,8,124,0,160, - 3,124,5,161,1,125,6,124,6,100,1,117,1,114,142,116, - 4,124,6,100,2,131,2,114,70,124,6,160,5,124,1,124, - 3,161,2,125,7,110,12,124,0,160,6,124,1,124,6,161, - 2,125,7,124,7,100,1,117,0,114,92,113,8,124,7,106, - 7,100,1,117,1,114,110,124,7,2,0,1,0,83,0,124, - 7,106,8,125,8,124,8,100,1,117,0,114,132,116,9,100, - 3,131,1,130,1,124,4,160,10,124,8,161,1,1,0,113, - 8,116,11,160,12,124,1,100,1,161,2,125,7,124,4,124, - 7,95,8,124,7,83,0,41,4,122,63,70,105,110,100,32, - 116,104,101,32,108,111,97,100,101,114,32,111,114,32,110,97, - 109,101,115,112,97,99,101,95,112,97,116,104,32,102,111,114, - 32,116,104,105,115,32,109,111,100,117,108,101,47,112,97,99, - 107,97,103,101,32,110,97,109,101,46,78,114,214,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,172,0,0,0,114,97,0,0, - 0,218,5,98,121,116,101,115,114,73,1,0,0,114,140,0, - 0,0,114,214,0,0,0,114,74,1,0,0,114,151,0,0, - 0,114,189,0,0,0,114,129,0,0,0,114,178,0,0,0, - 114,146,0,0,0,114,194,0,0,0,41,9,114,209,0,0, - 0,114,150,0,0,0,114,58,0,0,0,114,213,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,68,1,0,0,114,198,0,0, - 0,114,152,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,218,9,95,103,101,116,95,115,112,101,99, - 55,5,0,0,115,44,0,0,0,4,5,8,1,14,1,2, - 1,10,1,8,1,10,1,14,1,12,2,8,1,2,1,10, - 1,8,1,6,1,8,1,8,1,10,5,2,128,12,2,6, - 1,4,1,255,128,122,20,80,97,116,104,70,105,110,100,101, - 114,46,95,103,101,116,95,115,112,101,99,99,4,0,0,0, - 0,0,0,0,0,0,0,0,6,0,0,0,5,0,0,0, - 67,0,0,0,115,94,0,0,0,124,2,100,1,117,0,114, - 14,116,0,106,1,125,2,124,0,160,2,124,1,124,2,124, - 3,161,3,125,4,124,4,100,1,117,0,114,40,100,1,83, - 0,124,4,106,3,100,1,117,0,114,90,124,4,106,4,125, - 5,124,5,114,86,100,1,124,4,95,5,116,6,124,1,124, - 5,124,0,106,2,131,3,124,4,95,4,124,4,83,0,100, - 1,83,0,124,4,83,0,41,2,122,141,84,114,121,32,116, - 111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,111, - 114,32,39,102,117,108,108,110,97,109,101,39,32,111,110,32, - 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, - 104,39,46,10,10,32,32,32,32,32,32,32,32,84,104,101, - 32,115,101,97,114,99,104,32,105,115,32,98,97,115,101,100, - 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111, - 107,115,32,97,110,100,32,115,121,115,46,112,97,116,104,95, - 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, - 32,32,32,32,32,32,32,32,78,41,7,114,16,0,0,0, - 114,58,0,0,0,114,77,1,0,0,114,151,0,0,0,114, - 189,0,0,0,114,192,0,0,0,114,33,1,0,0,41,6, - 114,209,0,0,0,114,150,0,0,0,114,58,0,0,0,114, - 213,0,0,0,114,198,0,0,0,114,76,1,0,0,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,214,0, - 0,0,87,5,0,0,115,28,0,0,0,8,6,6,1,14, - 1,8,1,4,1,10,1,6,1,4,1,6,3,16,1,4, - 1,4,2,4,2,255,128,122,20,80,97,116,104,70,105,110, - 100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, - 0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0, - 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124, - 1,124,2,161,2,125,3,124,3,100,1,117,0,114,24,100, - 1,83,0,124,3,106,1,83,0,41,2,122,170,102,105,110, - 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32, - 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, - 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46, - 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32, - 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95, - 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, - 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, - 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, - 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, - 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,114,215,0,0,0,114,216,0, - 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,217,0,0,0,111,5,0,0,115,10,0,0,0,12, - 8,8,1,4,1,6,1,255,128,122,22,80,97,116,104,70, - 105,110,100,101,114,46,102,105,110,100,95,109,111,100,117,108, - 101,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0, - 0,0,4,0,0,0,79,0,0,0,115,28,0,0,0,100, - 1,100,2,108,0,109,1,125,2,1,0,124,2,106,2,124, - 0,105,0,124,1,164,1,142,1,83,0,41,4,97,32,1, - 0,0,10,32,32,32,32,32,32,32,32,70,105,110,100,32, - 100,105,115,116,114,105,98,117,116,105,111,110,115,46,10,10, - 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,97, - 110,32,105,116,101,114,97,98,108,101,32,111,102,32,97,108, - 108,32,68,105,115,116,114,105,98,117,116,105,111,110,32,105, - 110,115,116,97,110,99,101,115,32,99,97,112,97,98,108,101, - 32,111,102,10,32,32,32,32,32,32,32,32,108,111,97,100, - 105,110,103,32,116,104,101,32,109,101,116,97,100,97,116,97, - 32,102,111,114,32,112,97,99,107,97,103,101,115,32,109,97, - 116,99,104,105,110,103,32,96,96,99,111,110,116,101,120,116, - 46,110,97,109,101,96,96,10,32,32,32,32,32,32,32,32, - 40,111,114,32,97,108,108,32,110,97,109,101,115,32,105,102, - 32,96,96,78,111,110,101,96,96,32,105,110,100,105,99,97, - 116,101,100,41,32,97,108,111,110,103,32,116,104,101,32,112, - 97,116,104,115,32,105,110,32,116,104,101,32,108,105,115,116, - 10,32,32,32,32,32,32,32,32,111,102,32,100,105,114,101, - 99,116,111,114,105,101,115,32,96,96,99,111,110,116,101,120, - 116,46,112,97,116,104,96,96,46,10,32,32,32,32,32,32, - 32,32,114,0,0,0,0,41,1,218,18,77,101,116,97,100, - 97,116,97,80,97,116,104,70,105,110,100,101,114,78,41,3, - 90,18,105,109,112,111,114,116,108,105,98,46,109,101,116,97, - 100,97,116,97,114,78,1,0,0,218,18,102,105,110,100,95, - 100,105,115,116,114,105,98,117,116,105,111,110,115,41,3,114, - 131,0,0,0,114,132,0,0,0,114,78,1,0,0,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,114,79,1, - 0,0,124,5,0,0,115,6,0,0,0,12,10,16,1,255, - 128,122,29,80,97,116,104,70,105,110,100,101,114,46,102,105, - 110,100,95,100,105,115,116,114,105,98,117,116,105,111,110,115, - 41,1,78,41,2,78,78,41,1,78,41,14,114,137,0,0, - 0,114,136,0,0,0,114,138,0,0,0,114,139,0,0,0, - 114,220,0,0,0,114,64,1,0,0,114,70,1,0,0,114, - 221,0,0,0,114,73,1,0,0,114,74,1,0,0,114,77, - 1,0,0,114,214,0,0,0,114,217,0,0,0,114,79,1, - 0,0,114,7,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,63,1,0,0,247,4,0,0,115, - 38,0,0,0,8,0,4,2,2,2,10,1,2,9,10,1, - 2,12,10,1,2,21,10,1,2,14,12,1,2,31,12,1, - 2,23,12,1,2,12,14,1,255,128,114,63,1,0,0,99, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,64,0,0,0,115,90,0,0,0,101,0,90, - 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, - 4,100,4,100,5,132,0,90,5,101,6,90,7,100,6,100, - 7,132,0,90,8,100,8,100,9,132,0,90,9,100,19,100, - 11,100,12,132,1,90,10,100,13,100,14,132,0,90,11,101, - 12,100,15,100,16,132,0,131,1,90,13,100,17,100,18,132, - 0,90,14,100,10,83,0,41,20,218,10,70,105,108,101,70, - 105,110,100,101,114,122,172,70,105,108,101,45,98,97,115,101, - 100,32,102,105,110,100,101,114,46,10,10,32,32,32,32,73, - 110,116,101,114,97,99,116,105,111,110,115,32,119,105,116,104, - 32,116,104,101,32,102,105,108,101,32,115,121,115,116,101,109, - 32,97,114,101,32,99,97,99,104,101,100,32,102,111,114,32, - 112,101,114,102,111,114,109,97,110,99,101,44,32,98,101,105, - 110,103,10,32,32,32,32,114,101,102,114,101,115,104,101,100, - 32,119,104,101,110,32,116,104,101,32,100,105,114,101,99,116, - 111,114,121,32,116,104,101,32,102,105,110,100,101,114,32,105, - 115,32,104,97,110,100,108,105,110,103,32,104,97,115,32,98, - 101,101,110,32,109,111,100,105,102,105,101,100,46,10,10,32, - 32,32,32,99,2,0,0,0,0,0,0,0,0,0,0,0, - 5,0,0,0,6,0,0,0,7,0,0,0,115,84,0,0, - 0,103,0,125,3,124,2,68,0,93,32,92,2,137,0,125, - 4,124,3,160,0,135,0,102,1,100,1,100,2,132,8,124, - 4,68,0,131,1,161,1,1,0,113,8,124,3,124,0,95, - 1,124,1,112,54,100,3,124,0,95,2,100,4,124,0,95, - 3,116,4,131,0,124,0,95,5,116,4,131,0,124,0,95, - 6,100,5,83,0,41,6,122,154,73,110,105,116,105,97,108, - 105,122,101,32,119,105,116,104,32,116,104,101,32,112,97,116, - 104,32,116,111,32,115,101,97,114,99,104,32,111,110,32,97, - 110,100,32,97,32,118,97,114,105,97,98,108,101,32,110,117, - 109,98,101,114,32,111,102,10,32,32,32,32,32,32,32,32, - 50,45,116,117,112,108,101,115,32,99,111,110,116,97,105,110, - 105,110,103,32,116,104,101,32,108,111,97,100,101,114,32,97, - 110,100,32,116,104,101,32,102,105,108,101,32,115,117,102,102, - 105,120,101,115,32,116,104,101,32,108,111,97,100,101,114,10, - 32,32,32,32,32,32,32,32,114,101,99,111,103,110,105,122, - 101,115,46,99,1,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,3,0,0,0,51,0,0,0,115,22,0,0, - 0,124,0,93,14,125,1,124,1,136,0,102,2,86,0,1, - 0,113,2,100,0,83,0,114,121,0,0,0,114,7,0,0, - 0,114,29,1,0,0,169,1,114,151,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,9,0,0,0,153,5,0,0, - 114,14,0,0,0,122,38,70,105,108,101,70,105,110,100,101, - 114,46,95,95,105,110,105,116,95,95,46,60,108,111,99,97, - 108,115,62,46,60,103,101,110,101,120,112,114,62,114,86,0, - 0,0,114,116,0,0,0,78,41,7,114,178,0,0,0,218, - 8,95,108,111,97,100,101,114,115,114,58,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,130,0,0,0,114,58,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,200,0,0,0,114,7,0,0, - 0,114,81,1,0,0,114,8,0,0,0,114,223,0,0,0, - 147,5,0,0,115,18,0,0,0,4,4,12,1,26,1,6, - 1,10,2,6,1,8,1,12,1,255,128,122,19,70,105,108, - 101,70,105,110,100,101,114,46,95,95,105,110,105,116,95,95, - 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, - 0,2,0,0,0,67,0,0,0,115,10,0,0,0,100,1, - 124,0,95,0,100,2,83,0,41,3,122,31,73,110,118,97, - 108,105,100,97,116,101,32,116,104,101,32,100,105,114,101,99, - 116,111,114,121,32,109,116,105,109,101,46,114,116,0,0,0, - 78,41,1,114,83,1,0,0,114,8,1,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,64,1,0, - 0,161,5,0,0,114,69,0,0,0,122,28,70,105,108,101, - 70,105,110,100,101,114,46,105,110,118,97,108,105,100,97,116, - 101,95,99,97,99,104,101,115,99,2,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, - 0,115,42,0,0,0,124,0,160,0,124,1,161,1,125,2, - 124,2,100,1,117,0,114,26,100,1,103,0,102,2,83,0, - 124,2,106,1,124,2,106,2,112,38,103,0,102,2,83,0, - 41,2,122,197,84,114,121,32,116,111,32,102,105,110,100,32, - 97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,101, - 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108, - 101,44,32,111,114,32,116,104,101,32,110,97,109,101,115,112, - 97,99,101,10,32,32,32,32,32,32,32,32,112,97,99,107, - 97,103,101,32,112,111,114,116,105,111,110,115,46,32,82,101, - 116,117,114,110,115,32,40,108,111,97,100,101,114,44,32,108, - 105,115,116,45,111,102,45,112,111,114,116,105,111,110,115,41, - 46,10,10,32,32,32,32,32,32,32,32,84,104,105,115,32, - 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99, - 97,116,101,100,46,32,32,85,115,101,32,102,105,110,100,95, - 115,112,101,99,40,41,32,105,110,115,116,101,97,100,46,10, - 10,32,32,32,32,32,32,32,32,78,41,3,114,214,0,0, - 0,114,151,0,0,0,114,189,0,0,0,41,3,114,130,0, - 0,0,114,150,0,0,0,114,198,0,0,0,114,7,0,0, - 0,114,7,0,0,0,114,8,0,0,0,114,148,0,0,0, - 167,5,0,0,115,10,0,0,0,10,7,8,1,8,1,16, - 1,255,128,122,22,70,105,108,101,70,105,110,100,101,114,46, - 102,105,110,100,95,108,111,97,100,101,114,99,6,0,0,0, - 0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0, - 67,0,0,0,115,26,0,0,0,124,1,124,2,124,3,131, - 2,125,6,116,0,124,2,124,3,124,6,124,4,100,1,141, - 4,83,0,41,2,78,114,188,0,0,0,41,1,114,201,0, - 0,0,41,7,114,130,0,0,0,114,199,0,0,0,114,150, - 0,0,0,114,58,0,0,0,90,4,115,109,115,108,114,213, - 0,0,0,114,151,0,0,0,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,77,1,0,0,179,5,0,0, - 115,10,0,0,0,10,1,8,1,2,1,6,255,255,128,122, - 20,70,105,108,101,70,105,110,100,101,114,46,95,103,101,116, - 95,115,112,101,99,78,99,3,0,0,0,0,0,0,0,0, - 0,0,0,14,0,0,0,8,0,0,0,67,0,0,0,115, - 100,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,20, - 4,0,116,6,144,1,121,98,1,0,1,0,1,0,100,4, - 125,5,89,0,124,5,124,0,106,7,107,3,114,88,124,0, - 160,8,161,0,1,0,124,5,124,0,95,7,116,9,131,0, - 114,110,124,0,106,10,125,6,124,4,160,11,161,0,125,7, - 110,10,124,0,106,12,125,6,124,4,125,7,124,7,124,6, - 118,0,114,214,116,13,124,0,106,2,124,4,131,2,125,8, - 124,0,106,14,68,0,93,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,204,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,146,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, - 118,0,144,1,114,50,116,15,124,12,131,1,144,1,114,50, - 124,0,160,16,124,10,124,1,124,12,100,8,124,2,161,5, - 2,0,1,0,83,0,113,220,124,3,144,1,114,94,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,119,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,86,0,0, - 0,114,45,0,0,0,114,116,0,0,0,114,223,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,55,0,0,0,114,63,0,0,0, - 114,58,0,0,0,114,19,0,0,0,114,70,0,0,0,114, - 22,1,0,0,114,64,0,0,0,114,83,1,0,0,218,11, - 95,102,105,108,108,95,99,97,99,104,101,114,22,0,0,0, - 114,86,1,0,0,114,117,0,0,0,114,85,1,0,0,114, - 54,0,0,0,114,82,1,0,0,114,68,0,0,0,114,77, - 1,0,0,114,71,0,0,0,114,146,0,0,0,114,160,0, - 0,0,114,194,0,0,0,114,189,0,0,0,41,14,114,130, - 0,0,0,114,150,0,0,0,114,213,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,180,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,30,1, - 0,0,114,199,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,198,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,214,0,0,0,184,5,0,0,115,80, - 0,0,0,4,5,14,1,2,1,24,1,14,1,6,1,10, - 1,8,1,6,1,6,2,6,1,10,1,6,2,4,1,8, - 2,12,1,14,1,8,1,10,1,8,1,24,1,2,255,8, - 5,14,2,16,1,16,1,14,1,10,1,10,1,4,1,8, - 255,2,128,6,2,12,1,12,1,8,1,4,1,4,1,2, - 219,255,128,122,20,70,105,108,101,70,105,110,100,101,114,46, - 102,105,110,100,95,115,112,101,99,99,1,0,0,0,0,0, - 0,0,0,0,0,0,9,0,0,0,10,0,0,0,67,0, - 0,0,115,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,24,4,0,116,4,116,5,116,6,102,3,121, - 188,1,0,1,0,1,0,103,0,125,2,89,0,116,7,106, - 8,160,9,100,1,161,1,115,78,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,130,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,88,124,3,124,0,95,11,116, - 7,106,8,160,9,116,16,161,1,114,184,100,4,100,5,132, - 0,124,2,68,0,131,1,124,0,95,17,100,6,83,0,100, - 6,83,0,119,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,15,0, - 0,0,114,86,0,0,0,114,76,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0, - 0,83,0,0,0,115,20,0,0,0,104,0,124,0,93,12, - 125,1,124,1,160,0,161,0,146,2,113,4,83,0,114,7, - 0,0,0,41,1,114,117,0,0,0,41,2,114,5,0,0, - 0,90,2,102,110,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,114,13,0,0,0,5,6,0,0,115,4,0, - 0,0,20,0,255,128,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,58,0,0,0,114,19,0,0,0,90,7, - 108,105,115,116,100,105,114,114,70,0,0,0,114,71,1,0, - 0,218,15,80,101,114,109,105,115,115,105,111,110,69,114,114, - 111,114,218,18,78,111,116,65,68,105,114,101,99,116,111,114, - 121,69,114,114,111,114,114,16,0,0,0,114,26,0,0,0, - 114,27,0,0,0,114,84,1,0,0,114,85,1,0,0,114, - 112,0,0,0,114,77,0,0,0,114,117,0,0,0,218,3, - 97,100,100,114,28,0,0,0,114,86,1,0,0,41,9,114, - 130,0,0,0,114,58,0,0,0,90,8,99,111,110,116,101, - 110,116,115,90,21,108,111,119,101,114,95,115,117,102,102,105, - 120,95,99,111,110,116,101,110,116,115,114,56,1,0,0,114, - 128,0,0,0,114,40,1,0,0,114,30,1,0,0,90,8, - 110,101,119,95,110,97,109,101,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,88,1,0,0,232,5,0,0, - 115,40,0,0,0,6,2,2,1,22,1,18,1,6,3,12, - 3,12,1,6,7,8,1,16,1,4,1,18,1,4,2,12, - 1,6,1,12,1,20,1,4,255,2,233,255,128,122,22,70, - 105,108,101,70,105,110,100,101,114,46,95,102,105,108,108,95, - 99,97,99,104,101,99,1,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,7,0,0,0,115,18, - 0,0,0,135,0,135,1,102,2,100,1,100,2,132,8,125, - 2,124,2,83,0,41,4,97,20,1,0,0,65,32,99,108, - 97,115,115,32,109,101,116,104,111,100,32,119,104,105,99,104, - 32,114,101,116,117,114,110,115,32,97,32,99,108,111,115,117, - 114,101,32,116,111,32,117,115,101,32,111,110,32,115,121,115, - 46,112,97,116,104,95,104,111,111,107,10,32,32,32,32,32, - 32,32,32,119,104,105,99,104,32,119,105,108,108,32,114,101, - 116,117,114,110,32,97,110,32,105,110,115,116,97,110,99,101, - 32,117,115,105,110,103,32,116,104,101,32,115,112,101,99,105, - 102,105,101,100,32,108,111,97,100,101,114,115,32,97,110,100, - 32,116,104,101,32,112,97,116,104,10,32,32,32,32,32,32, - 32,32,99,97,108,108,101,100,32,111,110,32,116,104,101,32, - 99,108,111,115,117,114,101,46,10,10,32,32,32,32,32,32, - 32,32,73,102,32,116,104,101,32,112,97,116,104,32,99,97, - 108,108,101,100,32,111,110,32,116,104,101,32,99,108,111,115, - 117,114,101,32,105,115,32,110,111,116,32,97,32,100,105,114, - 101,99,116,111,114,121,44,32,73,109,112,111,114,116,69,114, - 114,111,114,32,105,115,10,32,32,32,32,32,32,32,32,114, - 97,105,115,101,100,46,10,10,32,32,32,32,32,32,32,32, - 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, - 0,4,0,0,0,19,0,0,0,115,36,0,0,0,116,0, - 124,0,131,1,115,20,116,1,100,1,124,0,100,2,141,2, - 130,1,136,0,124,0,103,1,136,1,162,1,82,0,142,0, - 83,0,41,4,122,45,80,97,116,104,32,104,111,111,107,32, - 102,111,114,32,105,109,112,111,114,116,108,105,98,46,109,97, - 99,104,105,110,101,114,121,46,70,105,108,101,70,105,110,100, - 101,114,46,122,30,111,110,108,121,32,100,105,114,101,99,116, - 111,114,105,101,115,32,97,114,101,32,115,117,112,112,111,114, - 116,101,100,114,62,0,0,0,78,41,2,114,71,0,0,0, - 114,129,0,0,0,114,62,0,0,0,169,2,114,209,0,0, - 0,114,87,1,0,0,114,7,0,0,0,114,8,0,0,0, - 218,24,112,97,116,104,95,104,111,111,107,95,102,111,114,95, - 70,105,108,101,70,105,110,100,101,114,17,6,0,0,115,8, - 0,0,0,8,2,12,1,16,1,255,128,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,78,114,7,0,0,0,41,3,114,209,0,0,0, - 114,87,1,0,0,114,93,1,0,0,114,7,0,0,0,114, - 92,1,0,0,114,8,0,0,0,218,9,112,97,116,104,95, - 104,111,111,107,7,6,0,0,115,6,0,0,0,14,10,4, - 6,255,128,122,20,70,105,108,101,70,105,110,100,101,114,46, - 112,97,116,104,95,104,111,111,107,99,1,0,0,0,0,0, - 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, - 0,0,114,53,1,0,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,77, - 0,0,0,114,58,0,0,0,114,8,1,0,0,114,7,0, - 0,0,114,7,0,0,0,114,8,0,0,0,114,54,1,0, - 0,25,6,0,0,114,47,1,0,0,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,137,0,0,0,114,136,0,0,0,114,138, - 0,0,0,114,139,0,0,0,114,223,0,0,0,114,64,1, - 0,0,114,154,0,0,0,114,217,0,0,0,114,148,0,0, - 0,114,77,1,0,0,114,214,0,0,0,114,88,1,0,0, - 114,221,0,0,0,114,94,1,0,0,114,54,1,0,0,114, - 7,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,80,1,0,0,138,5,0,0,115,26,0,0, - 0,8,0,4,2,8,7,8,14,4,4,8,2,8,12,10, - 5,8,48,2,31,10,1,12,17,255,128,114,80,1,0,0, - 99,4,0,0,0,0,0,0,0,0,0,0,0,6,0,0, - 0,8,0,0,0,67,0,0,0,115,144,0,0,0,124,0, - 160,0,100,1,161,1,125,4,124,0,160,0,100,2,161,1, - 125,5,124,4,115,66,124,5,114,36,124,5,106,1,125,4, - 110,30,124,2,124,3,107,2,114,56,116,2,124,1,124,2, - 131,2,125,4,110,10,116,3,124,1,124,2,131,2,125,4, - 124,5,115,84,116,4,124,1,124,2,124,4,100,3,141,3, - 125,5,122,38,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,100,0,83,0,4,0,116,5,121,142, - 1,0,1,0,1,0,89,0,100,0,83,0,119,0,41,6, - 78,218,10,95,95,108,111,97,100,101,114,95,95,218,8,95, - 95,115,112,101,99,95,95,114,81,1,0,0,90,8,95,95, - 102,105,108,101,95,95,90,10,95,95,99,97,99,104,101,100, - 95,95,41,6,218,3,103,101,116,114,151,0,0,0,114,27, - 1,0,0,114,21,1,0,0,114,201,0,0,0,218,9,69, - 120,99,101,112,116,105,111,110,41,6,90,2,110,115,114,128, - 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,151,0,0,0,114,198,0, - 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,218,14,95,102,105,120,95,117,112,95,109,111,100,117,108, - 101,31,6,0,0,115,38,0,0,0,10,2,10,1,4,1, - 4,1,8,1,8,1,12,1,10,2,4,1,14,1,2,1, - 8,1,8,1,8,1,14,1,12,1,6,2,2,254,255,128, - 114,99,1,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38, - 0,0,0,116,0,116,1,160,2,161,0,102,2,125,0,116, - 3,116,4,102,2,125,1,116,5,116,6,102,2,125,2,124, - 0,124,1,124,2,103,3,83,0,41,2,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,78,41,7,114, - 17,1,0,0,114,174,0,0,0,218,18,101,120,116,101,110, - 115,105,111,110,95,115,117,102,102,105,120,101,115,114,21,1, - 0,0,114,113,0,0,0,114,27,1,0,0,114,101,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,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 114,195,0,0,0,54,6,0,0,115,10,0,0,0,12,5, - 8,1,8,1,10,1,255,128,114,195,0,0,0,99,1,0, - 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0, - 0,0,67,0,0,0,115,8,0,0,0,124,0,97,0,100, - 0,83,0,114,121,0,0,0,41,1,114,146,0,0,0,41, - 1,218,17,95,98,111,111,116,115,116,114,97,112,95,109,111, - 100,117,108,101,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,218,21,95,115,101,116,95,98,111,111,116,115,116, - 114,97,112,95,109,111,100,117,108,101,65,6,0,0,115,4, - 0,0,0,8,2,255,128,114,102,1,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0, - 0,67,0,0,0,115,50,0,0,0,116,0,124,0,131,1, - 1,0,116,1,131,0,125,1,116,2,106,3,160,4,116,5, - 106,6,124,1,142,0,103,1,161,1,1,0,116,2,106,7, - 160,8,116,9,161,1,1,0,100,1,83,0,41,2,122,41, - 73,110,115,116,97,108,108,32,116,104,101,32,112,97,116,104, - 45,98,97,115,101,100,32,105,109,112,111,114,116,32,99,111, - 109,112,111,110,101,110,116,115,46,78,41,10,114,102,1,0, - 0,114,195,0,0,0,114,16,0,0,0,114,69,1,0,0, - 114,178,0,0,0,114,80,1,0,0,114,94,1,0,0,218, - 9,109,101,116,97,95,112,97,116,104,114,197,0,0,0,114, - 63,1,0,0,41,2,114,101,1,0,0,90,17,115,117,112, - 112,111,114,116,101,100,95,108,111,97,100,101,114,115,114,7, - 0,0,0,114,7,0,0,0,114,8,0,0,0,218,8,95, - 105,110,115,116,97,108,108,70,6,0,0,115,10,0,0,0, - 8,2,6,1,20,1,16,1,255,128,114,104,1,0,0,41, - 1,114,75,0,0,0,41,1,78,41,3,78,78,78,41,2, - 114,0,0,0,0,114,0,0,0,0,41,1,84,41,1,78, - 41,1,78,41,83,114,139,0,0,0,114,146,0,0,0,114, - 174,0,0,0,114,79,0,0,0,114,16,0,0,0,114,88, - 0,0,0,114,171,0,0,0,114,26,0,0,0,114,218,0, - 0,0,90,2,110,116,114,19,0,0,0,114,203,0,0,0, - 90,5,112,111,115,105,120,114,48,0,0,0,218,3,97,108, - 108,114,51,0,0,0,114,52,0,0,0,114,73,0,0,0, - 114,29,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,28,0,0, - 0,114,30,0,0,0,114,22,0,0,0,114,37,0,0,0, - 114,43,0,0,0,114,46,0,0,0,114,54,0,0,0,114, - 61,0,0,0,114,63,0,0,0,114,67,0,0,0,114,68, - 0,0,0,114,71,0,0,0,114,74,0,0,0,114,84,0, - 0,0,218,4,116,121,112,101,218,8,95,95,99,111,100,101, - 95,95,114,173,0,0,0,114,35,0,0,0,114,159,0,0, - 0,114,34,0,0,0,114,40,0,0,0,114,251,0,0,0, - 114,104,0,0,0,114,100,0,0,0,114,113,0,0,0,114, - 197,0,0,0,114,100,1,0,0,114,219,0,0,0,114,101, - 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,109,0,0,0,114,114, - 0,0,0,114,120,0,0,0,114,124,0,0,0,114,126,0, - 0,0,114,147,0,0,0,114,154,0,0,0,114,163,0,0, - 0,114,167,0,0,0,114,169,0,0,0,114,176,0,0,0, - 114,181,0,0,0,114,182,0,0,0,114,187,0,0,0,218, - 6,111,98,106,101,99,116,114,196,0,0,0,114,201,0,0, - 0,114,202,0,0,0,114,222,0,0,0,114,236,0,0,0, - 114,254,0,0,0,114,21,1,0,0,114,27,1,0,0,114, - 17,1,0,0,114,33,1,0,0,114,59,1,0,0,114,63, - 1,0,0,114,80,1,0,0,114,99,1,0,0,114,195,0, - 0,0,114,102,1,0,0,114,104,1,0,0,114,7,0,0, + 0,0,114,153,0,0,0,114,198,0,0,0,114,7,0,0, + 0,114,7,0,0,0,114,8,0,0,0,218,16,95,108,101, + 103,97,99,121,95,103,101,116,95,115,112,101,99,40,5,0, + 0,115,24,0,0,0,10,4,16,1,16,2,12,2,10,1, + 4,1,8,1,12,1,12,1,6,1,4,1,255,128,122,27, + 80,97,116,104,70,105,110,100,101,114,46,95,108,101,103,97, + 99,121,95,103,101,116,95,115,112,101,99,78,99,4,0,0, + 0,0,0,0,0,0,0,0,0,9,0,0,0,5,0,0, + 0,67,0,0,0,115,166,0,0,0,103,0,125,4,124,2, + 68,0,93,134,125,5,116,0,124,5,116,1,116,2,102,2, + 131,2,115,28,113,8,124,0,160,3,124,5,161,1,125,6, + 124,6,100,1,117,1,114,142,116,4,124,6,100,2,131,2, + 114,70,124,6,160,5,124,1,124,3,161,2,125,7,110,12, + 124,0,160,6,124,1,124,6,161,2,125,7,124,7,100,1, + 117,0,114,92,113,8,124,7,106,7,100,1,117,1,114,110, + 124,7,2,0,1,0,83,0,124,7,106,8,125,8,124,8, + 100,1,117,0,114,132,116,9,100,3,131,1,130,1,124,4, + 160,10,124,8,161,1,1,0,113,8,116,11,160,12,124,1, + 100,1,161,2,125,7,124,4,124,7,95,8,124,7,83,0, + 41,4,122,63,70,105,110,100,32,116,104,101,32,108,111,97, + 100,101,114,32,111,114,32,110,97,109,101,115,112,97,99,101, + 95,112,97,116,104,32,102,111,114,32,116,104,105,115,32,109, + 111,100,117,108,101,47,112,97,99,107,97,103,101,32,110,97, + 109,101,46,78,114,214,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,172,0,0,0,114,97,0,0,0,218,5,98,121,116,101, + 115,114,73,1,0,0,114,140,0,0,0,114,214,0,0,0, + 114,74,1,0,0,114,151,0,0,0,114,189,0,0,0,114, + 129,0,0,0,114,178,0,0,0,114,146,0,0,0,114,194, + 0,0,0,41,9,114,209,0,0,0,114,150,0,0,0,114, + 58,0,0,0,114,213,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,68,1,0,0,114,198,0,0,0,114,152,0,0,0,114, + 7,0,0,0,114,7,0,0,0,114,8,0,0,0,218,9, + 95,103,101,116,95,115,112,101,99,58,5,0,0,115,44,0, + 0,0,4,5,8,1,14,1,2,1,10,1,8,1,10,1, + 14,1,12,2,8,1,2,1,10,1,8,1,6,1,8,1, + 8,1,10,5,2,128,12,2,6,1,4,1,255,128,122,20, + 80,97,116,104,70,105,110,100,101,114,46,95,103,101,116,95, + 115,112,101,99,99,4,0,0,0,0,0,0,0,0,0,0, + 0,6,0,0,0,5,0,0,0,67,0,0,0,115,94,0, + 0,0,124,2,100,1,117,0,114,14,116,0,106,1,125,2, + 124,0,160,2,124,1,124,2,124,3,161,3,125,4,124,4, + 100,1,117,0,114,40,100,1,83,0,124,4,106,3,100,1, + 117,0,114,90,124,4,106,4,125,5,124,5,114,86,100,1, + 124,4,95,5,116,6,124,1,124,5,124,0,106,2,131,3, + 124,4,95,4,124,4,83,0,100,1,83,0,124,4,83,0, + 41,2,122,141,84,114,121,32,116,111,32,102,105,110,100,32, + 97,32,115,112,101,99,32,102,111,114,32,39,102,117,108,108, + 110,97,109,101,39,32,111,110,32,115,121,115,46,112,97,116, + 104,32,111,114,32,39,112,97,116,104,39,46,10,10,32,32, + 32,32,32,32,32,32,84,104,101,32,115,101,97,114,99,104, + 32,105,115,32,98,97,115,101,100,32,111,110,32,115,121,115, + 46,112,97,116,104,95,104,111,111,107,115,32,97,110,100,32, + 115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101, + 114,95,99,97,99,104,101,46,10,32,32,32,32,32,32,32, + 32,78,41,7,114,16,0,0,0,114,58,0,0,0,114,77, + 1,0,0,114,151,0,0,0,114,189,0,0,0,114,192,0, + 0,0,114,33,1,0,0,41,6,114,209,0,0,0,114,150, + 0,0,0,114,58,0,0,0,114,213,0,0,0,114,198,0, + 0,0,114,76,1,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,214,0,0,0,90,5,0,0,115, + 28,0,0,0,8,6,6,1,14,1,8,1,4,1,10,1, + 6,1,4,1,6,3,16,1,4,1,4,2,4,2,255,128, + 122,20,80,97,116,104,70,105,110,100,101,114,46,102,105,110, + 100,95,115,112,101,99,99,3,0,0,0,0,0,0,0,0, + 0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115, + 30,0,0,0,124,0,160,0,124,1,124,2,161,2,125,3, + 124,3,100,1,117,0,114,24,100,1,83,0,124,3,106,1, + 83,0,41,2,122,170,102,105,110,100,32,116,104,101,32,109, + 111,100,117,108,101,32,111,110,32,115,121,115,46,112,97,116, + 104,32,111,114,32,39,112,97,116,104,39,32,98,97,115,101, + 100,32,111,110,32,115,121,115,46,112,97,116,104,95,104,111, + 111,107,115,32,97,110,100,10,32,32,32,32,32,32,32,32, + 115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101, + 114,95,99,97,99,104,101,46,10,10,32,32,32,32,32,32, + 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, + 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115, + 101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,110, + 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32, + 78,114,215,0,0,0,114,216,0,0,0,114,7,0,0,0, + 114,7,0,0,0,114,8,0,0,0,114,217,0,0,0,114, + 5,0,0,115,10,0,0,0,12,8,8,1,4,1,6,1, + 255,128,122,22,80,97,116,104,70,105,110,100,101,114,46,102, + 105,110,100,95,109,111,100,117,108,101,99,0,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,79, + 0,0,0,115,28,0,0,0,100,1,100,2,108,0,109,1, + 125,2,1,0,124,2,106,2,124,0,105,0,124,1,164,1, + 142,1,83,0,41,4,97,32,1,0,0,10,32,32,32,32, + 32,32,32,32,70,105,110,100,32,100,105,115,116,114,105,98, + 117,116,105,111,110,115,46,10,10,32,32,32,32,32,32,32, + 32,82,101,116,117,114,110,32,97,110,32,105,116,101,114,97, + 98,108,101,32,111,102,32,97,108,108,32,68,105,115,116,114, + 105,98,117,116,105,111,110,32,105,110,115,116,97,110,99,101, + 115,32,99,97,112,97,98,108,101,32,111,102,10,32,32,32, + 32,32,32,32,32,108,111,97,100,105,110,103,32,116,104,101, + 32,109,101,116,97,100,97,116,97,32,102,111,114,32,112,97, + 99,107,97,103,101,115,32,109,97,116,99,104,105,110,103,32, + 96,96,99,111,110,116,101,120,116,46,110,97,109,101,96,96, + 10,32,32,32,32,32,32,32,32,40,111,114,32,97,108,108, + 32,110,97,109,101,115,32,105,102,32,96,96,78,111,110,101, + 96,96,32,105,110,100,105,99,97,116,101,100,41,32,97,108, + 111,110,103,32,116,104,101,32,112,97,116,104,115,32,105,110, + 32,116,104,101,32,108,105,115,116,10,32,32,32,32,32,32, + 32,32,111,102,32,100,105,114,101,99,116,111,114,105,101,115, + 32,96,96,99,111,110,116,101,120,116,46,112,97,116,104,96, + 96,46,10,32,32,32,32,32,32,32,32,114,0,0,0,0, + 41,1,218,18,77,101,116,97,100,97,116,97,80,97,116,104, + 70,105,110,100,101,114,78,41,3,90,18,105,109,112,111,114, + 116,108,105,98,46,109,101,116,97,100,97,116,97,114,78,1, + 0,0,218,18,102,105,110,100,95,100,105,115,116,114,105,98, + 117,116,105,111,110,115,41,3,114,131,0,0,0,114,132,0, + 0,0,114,78,1,0,0,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,114,79,1,0,0,127,5,0,0,115, + 6,0,0,0,12,10,16,1,255,128,122,29,80,97,116,104, + 70,105,110,100,101,114,46,102,105,110,100,95,100,105,115,116, + 114,105,98,117,116,105,111,110,115,41,1,78,41,2,78,78, + 41,1,78,41,14,114,137,0,0,0,114,136,0,0,0,114, + 138,0,0,0,114,139,0,0,0,114,220,0,0,0,114,64, + 1,0,0,114,70,1,0,0,114,221,0,0,0,114,73,1, + 0,0,114,74,1,0,0,114,77,1,0,0,114,214,0,0, + 0,114,217,0,0,0,114,79,1,0,0,114,7,0,0,0, + 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, + 63,1,0,0,247,4,0,0,115,38,0,0,0,8,0,4, + 2,2,2,10,1,2,9,10,1,2,12,10,1,2,21,10, + 1,2,17,12,1,2,31,12,1,2,23,12,1,2,12,14, + 1,255,128,114,63,1,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, + 0,115,90,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, + 90,5,101,6,90,7,100,6,100,7,132,0,90,8,100,8, + 100,9,132,0,90,9,100,19,100,11,100,12,132,1,90,10, + 100,13,100,14,132,0,90,11,101,12,100,15,100,16,132,0, + 131,1,90,13,100,17,100,18,132,0,90,14,100,10,83,0, + 41,20,218,10,70,105,108,101,70,105,110,100,101,114,122,172, + 70,105,108,101,45,98,97,115,101,100,32,102,105,110,100,101, + 114,46,10,10,32,32,32,32,73,110,116,101,114,97,99,116, + 105,111,110,115,32,119,105,116,104,32,116,104,101,32,102,105, + 108,101,32,115,121,115,116,101,109,32,97,114,101,32,99,97, + 99,104,101,100,32,102,111,114,32,112,101,114,102,111,114,109, + 97,110,99,101,44,32,98,101,105,110,103,10,32,32,32,32, + 114,101,102,114,101,115,104,101,100,32,119,104,101,110,32,116, + 104,101,32,100,105,114,101,99,116,111,114,121,32,116,104,101, + 32,102,105,110,100,101,114,32,105,115,32,104,97,110,100,108, + 105,110,103,32,104,97,115,32,98,101,101,110,32,109,111,100, + 105,102,105,101,100,46,10,10,32,32,32,32,99,2,0,0, + 0,0,0,0,0,0,0,0,0,5,0,0,0,6,0,0, + 0,7,0,0,0,115,84,0,0,0,103,0,125,3,124,2, + 68,0,93,32,92,2,137,0,125,4,124,3,160,0,135,0, + 102,1,100,1,100,2,132,8,124,4,68,0,131,1,161,1, + 1,0,113,8,124,3,124,0,95,1,124,1,112,54,100,3, + 124,0,95,2,100,4,124,0,95,3,116,4,131,0,124,0, + 95,5,116,4,131,0,124,0,95,6,100,5,83,0,41,6, + 122,154,73,110,105,116,105,97,108,105,122,101,32,119,105,116, + 104,32,116,104,101,32,112,97,116,104,32,116,111,32,115,101, + 97,114,99,104,32,111,110,32,97,110,100,32,97,32,118,97, + 114,105,97,98,108,101,32,110,117,109,98,101,114,32,111,102, + 10,32,32,32,32,32,32,32,32,50,45,116,117,112,108,101, + 115,32,99,111,110,116,97,105,110,105,110,103,32,116,104,101, + 32,108,111,97,100,101,114,32,97,110,100,32,116,104,101,32, + 102,105,108,101,32,115,117,102,102,105,120,101,115,32,116,104, + 101,32,108,111,97,100,101,114,10,32,32,32,32,32,32,32, + 32,114,101,99,111,103,110,105,122,101,115,46,99,1,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0, + 0,51,0,0,0,115,22,0,0,0,124,0,93,14,125,1, + 124,1,136,0,102,2,86,0,1,0,113,2,100,0,83,0, + 114,121,0,0,0,114,7,0,0,0,114,29,1,0,0,169, + 1,114,151,0,0,0,114,7,0,0,0,114,8,0,0,0, + 114,9,0,0,0,156,5,0,0,114,14,0,0,0,122,38, + 70,105,108,101,70,105,110,100,101,114,46,95,95,105,110,105, + 116,95,95,46,60,108,111,99,97,108,115,62,46,60,103,101, + 110,101,120,112,114,62,114,86,0,0,0,114,116,0,0,0, + 78,41,7,114,178,0,0,0,218,8,95,108,111,97,100,101, + 114,115,114,58,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,130,0, + 0,0,114,58,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,200,0,0,0,114,7,0,0,0,114,81,1,0,0,114, + 8,0,0,0,114,223,0,0,0,150,5,0,0,115,18,0, + 0,0,4,4,12,1,26,1,6,1,10,2,6,1,8,1, + 12,1,255,128,122,19,70,105,108,101,70,105,110,100,101,114, + 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0, + 0,0,115,10,0,0,0,100,1,124,0,95,0,100,2,83, + 0,41,3,122,31,73,110,118,97,108,105,100,97,116,101,32, + 116,104,101,32,100,105,114,101,99,116,111,114,121,32,109,116, + 105,109,101,46,114,116,0,0,0,78,41,1,114,83,1,0, + 0,114,8,1,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,64,1,0,0,164,5,0,0,114,69, + 0,0,0,122,28,70,105,108,101,70,105,110,100,101,114,46, + 105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,101, + 115,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,3,0,0,0,67,0,0,0,115,42,0,0,0,124, + 0,160,0,124,1,161,1,125,2,124,2,100,1,117,0,114, + 26,100,1,103,0,102,2,83,0,124,2,106,1,124,2,106, + 2,112,38,103,0,102,2,83,0,41,2,122,197,84,114,121, + 32,116,111,32,102,105,110,100,32,97,32,108,111,97,100,101, + 114,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102, + 105,101,100,32,109,111,100,117,108,101,44,32,111,114,32,116, + 104,101,32,110,97,109,101,115,112,97,99,101,10,32,32,32, + 32,32,32,32,32,112,97,99,107,97,103,101,32,112,111,114, + 116,105,111,110,115,46,32,82,101,116,117,114,110,115,32,40, + 108,111,97,100,101,114,44,32,108,105,115,116,45,111,102,45, + 112,111,114,116,105,111,110,115,41,46,10,10,32,32,32,32, + 32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,32, + 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, + 85,115,101,32,102,105,110,100,95,115,112,101,99,40,41,32, + 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32, + 32,32,78,41,3,114,214,0,0,0,114,151,0,0,0,114, + 189,0,0,0,41,3,114,130,0,0,0,114,150,0,0,0, + 114,198,0,0,0,114,7,0,0,0,114,7,0,0,0,114, + 8,0,0,0,114,148,0,0,0,170,5,0,0,115,10,0, + 0,0,10,7,8,1,8,1,16,1,255,128,122,22,70,105, + 108,101,70,105,110,100,101,114,46,102,105,110,100,95,108,111, + 97,100,101,114,99,6,0,0,0,0,0,0,0,0,0,0, + 0,7,0,0,0,6,0,0,0,67,0,0,0,115,26,0, + 0,0,124,1,124,2,124,3,131,2,125,6,116,0,124,2, + 124,3,124,6,124,4,100,1,141,4,83,0,41,2,78,114, + 188,0,0,0,41,1,114,201,0,0,0,41,7,114,130,0, + 0,0,114,199,0,0,0,114,150,0,0,0,114,58,0,0, + 0,90,4,115,109,115,108,114,213,0,0,0,114,151,0,0, 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,172, - 0,0,0,4,0,4,22,8,3,8,1,8,1,8,1,8, - 1,10,3,4,1,8,1,10,1,8,2,4,3,10,1,6, - 2,22,2,8,1,10,1,14,1,4,4,4,1,2,1,2, - 1,4,255,8,4,6,16,8,3,8,5,8,5,8,6,8, - 6,8,12,8,10,8,9,8,5,8,7,10,9,10,22,0, - 127,16,25,12,1,4,2,4,1,6,2,6,1,10,1,8, - 2,6,2,8,2,16,2,8,71,8,40,8,19,8,12,8, - 12,8,31,8,17,8,33,8,28,10,24,10,13,10,10,8, - 11,6,14,4,3,2,1,12,255,14,68,14,64,16,30,0, - 127,14,17,18,50,18,45,18,25,14,53,14,63,14,49,0, - 127,14,20,0,127,10,22,8,23,8,11,12,5,255,128, + 114,77,1,0,0,182,5,0,0,115,10,0,0,0,10,1, + 8,1,2,1,6,255,255,128,122,20,70,105,108,101,70,105, + 110,100,101,114,46,95,103,101,116,95,115,112,101,99,78,99, + 3,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0, + 8,0,0,0,67,0,0,0,115,100,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,20,4,0,116,6,144,1,121, + 98,1,0,1,0,1,0,100,4,125,5,89,0,124,5,124, + 0,106,7,107,3,114,88,124,0,160,8,161,0,1,0,124, + 5,124,0,95,7,116,9,131,0,114,110,124,0,106,10,125, + 6,124,4,160,11,161,0,125,7,110,10,124,0,106,12,125, + 6,124,4,125,7,124,7,124,6,118,0,114,214,116,13,124, + 0,106,2,124,4,131,2,125,8,124,0,106,14,68,0,93, + 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, + 204,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,146,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,118,0,144,1,114,50,116, + 15,124,12,131,1,144,1,114,50,124,0,160,16,124,10,124, + 1,124,12,100,8,124,2,161,5,2,0,1,0,83,0,113, + 220,124,3,144,1,114,94,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,119, + 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,86,0,0,0,114,45,0,0,0,114, + 116,0,0,0,114,223,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, + 55,0,0,0,114,63,0,0,0,114,58,0,0,0,114,19, + 0,0,0,114,70,0,0,0,114,22,1,0,0,114,64,0, + 0,0,114,83,1,0,0,218,11,95,102,105,108,108,95,99, + 97,99,104,101,114,22,0,0,0,114,86,1,0,0,114,117, + 0,0,0,114,85,1,0,0,114,54,0,0,0,114,82,1, + 0,0,114,68,0,0,0,114,77,1,0,0,114,71,0,0, + 0,114,146,0,0,0,114,160,0,0,0,114,194,0,0,0, + 114,189,0,0,0,41,14,114,130,0,0,0,114,150,0,0, + 0,114,213,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,180,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,30,1,0,0,114,199,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,198,0,0,0,114, + 7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,214, + 0,0,0,187,5,0,0,115,80,0,0,0,4,5,14,1, + 2,1,24,1,14,1,6,1,10,1,8,1,6,1,6,2, + 6,1,10,1,6,2,4,1,8,2,12,1,14,1,8,1, + 10,1,8,1,24,1,2,255,8,5,14,2,16,1,16,1, + 14,1,10,1,10,1,4,1,8,255,2,128,6,2,12,1, + 12,1,8,1,4,1,4,1,2,219,255,128,122,20,70,105, + 108,101,70,105,110,100,101,114,46,102,105,110,100,95,115,112, + 101,99,99,1,0,0,0,0,0,0,0,0,0,0,0,9, + 0,0,0,10,0,0,0,67,0,0,0,115,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,24,4,0, + 116,4,116,5,116,6,102,3,121,188,1,0,1,0,1,0, + 103,0,125,2,89,0,116,7,106,8,160,9,100,1,161,1, + 115,78,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,130, + 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,88,124,3,124,0,95,11,116,7,106,8,160,9,116,16, + 161,1,114,184,100,4,100,5,132,0,124,2,68,0,131,1, + 124,0,95,17,100,6,83,0,100,6,83,0,119,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,15,0,0,0,114,86,0,0,0, + 114,76,0,0,0,99,1,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,83,0,0,0,115,20, + 0,0,0,104,0,124,0,93,12,125,1,124,1,160,0,161, + 0,146,2,113,4,83,0,114,7,0,0,0,41,1,114,117, + 0,0,0,41,2,114,5,0,0,0,90,2,102,110,114,7, + 0,0,0,114,7,0,0,0,114,8,0,0,0,114,13,0, + 0,0,8,6,0,0,115,4,0,0,0,20,0,255,128,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,58,0, + 0,0,114,19,0,0,0,90,7,108,105,115,116,100,105,114, + 114,70,0,0,0,114,71,1,0,0,218,15,80,101,114,109, + 105,115,115,105,111,110,69,114,114,111,114,218,18,78,111,116, + 65,68,105,114,101,99,116,111,114,121,69,114,114,111,114,114, + 16,0,0,0,114,26,0,0,0,114,27,0,0,0,114,84, + 1,0,0,114,85,1,0,0,114,112,0,0,0,114,77,0, + 0,0,114,117,0,0,0,218,3,97,100,100,114,28,0,0, + 0,114,86,1,0,0,41,9,114,130,0,0,0,114,58,0, + 0,0,90,8,99,111,110,116,101,110,116,115,90,21,108,111, + 119,101,114,95,115,117,102,102,105,120,95,99,111,110,116,101, + 110,116,115,114,56,1,0,0,114,128,0,0,0,114,40,1, + 0,0,114,30,1,0,0,90,8,110,101,119,95,110,97,109, + 101,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, + 114,88,1,0,0,235,5,0,0,115,40,0,0,0,6,2, + 2,1,22,1,18,1,6,3,12,3,12,1,6,7,8,1, + 16,1,4,1,18,1,4,2,12,1,6,1,12,1,20,1, + 4,255,2,233,255,128,122,22,70,105,108,101,70,105,110,100, + 101,114,46,95,102,105,108,108,95,99,97,99,104,101,99,1, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3, + 0,0,0,7,0,0,0,115,18,0,0,0,135,0,135,1, + 102,2,100,1,100,2,132,8,125,2,124,2,83,0,41,4, + 97,20,1,0,0,65,32,99,108,97,115,115,32,109,101,116, + 104,111,100,32,119,104,105,99,104,32,114,101,116,117,114,110, + 115,32,97,32,99,108,111,115,117,114,101,32,116,111,32,117, + 115,101,32,111,110,32,115,121,115,46,112,97,116,104,95,104, + 111,111,107,10,32,32,32,32,32,32,32,32,119,104,105,99, + 104,32,119,105,108,108,32,114,101,116,117,114,110,32,97,110, + 32,105,110,115,116,97,110,99,101,32,117,115,105,110,103,32, + 116,104,101,32,115,112,101,99,105,102,105,101,100,32,108,111, + 97,100,101,114,115,32,97,110,100,32,116,104,101,32,112,97, + 116,104,10,32,32,32,32,32,32,32,32,99,97,108,108,101, + 100,32,111,110,32,116,104,101,32,99,108,111,115,117,114,101, + 46,10,10,32,32,32,32,32,32,32,32,73,102,32,116,104, + 101,32,112,97,116,104,32,99,97,108,108,101,100,32,111,110, + 32,116,104,101,32,99,108,111,115,117,114,101,32,105,115,32, + 110,111,116,32,97,32,100,105,114,101,99,116,111,114,121,44, + 32,73,109,112,111,114,116,69,114,114,111,114,32,105,115,10, + 32,32,32,32,32,32,32,32,114,97,105,115,101,100,46,10, + 10,32,32,32,32,32,32,32,32,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,4,0,0,0,19,0, + 0,0,115,36,0,0,0,116,0,124,0,131,1,115,20,116, + 1,100,1,124,0,100,2,141,2,130,1,136,0,124,0,103, + 1,136,1,162,1,82,0,142,0,83,0,41,4,122,45,80, + 97,116,104,32,104,111,111,107,32,102,111,114,32,105,109,112, + 111,114,116,108,105,98,46,109,97,99,104,105,110,101,114,121, + 46,70,105,108,101,70,105,110,100,101,114,46,122,30,111,110, + 108,121,32,100,105,114,101,99,116,111,114,105,101,115,32,97, + 114,101,32,115,117,112,112,111,114,116,101,100,114,62,0,0, + 0,78,41,2,114,71,0,0,0,114,129,0,0,0,114,62, + 0,0,0,169,2,114,209,0,0,0,114,87,1,0,0,114, + 7,0,0,0,114,8,0,0,0,218,24,112,97,116,104,95, + 104,111,111,107,95,102,111,114,95,70,105,108,101,70,105,110, + 100,101,114,20,6,0,0,115,8,0,0,0,8,2,12,1, + 16,1,255,128,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,78,114,7,0, + 0,0,41,3,114,209,0,0,0,114,87,1,0,0,114,93, + 1,0,0,114,7,0,0,0,114,92,1,0,0,114,8,0, + 0,0,218,9,112,97,116,104,95,104,111,111,107,10,6,0, + 0,115,6,0,0,0,14,10,4,6,255,128,122,20,70,105, + 108,101,70,105,110,100,101,114,46,112,97,116,104,95,104,111, + 111,107,99,1,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,114,53,1,0,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,77,0,0,0,114,58,0,0, + 0,114,8,1,0,0,114,7,0,0,0,114,7,0,0,0, + 114,8,0,0,0,114,54,1,0,0,28,6,0,0,114,47, + 1,0,0,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,137,0, + 0,0,114,136,0,0,0,114,138,0,0,0,114,139,0,0, + 0,114,223,0,0,0,114,64,1,0,0,114,154,0,0,0, + 114,217,0,0,0,114,148,0,0,0,114,77,1,0,0,114, + 214,0,0,0,114,88,1,0,0,114,221,0,0,0,114,94, + 1,0,0,114,54,1,0,0,114,7,0,0,0,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,114,80,1,0, + 0,141,5,0,0,115,26,0,0,0,8,0,4,2,8,7, + 8,14,4,4,8,2,8,12,10,5,8,48,2,31,10,1, + 12,17,255,128,114,80,1,0,0,99,4,0,0,0,0,0, + 0,0,0,0,0,0,6,0,0,0,8,0,0,0,67,0, + 0,0,115,144,0,0,0,124,0,160,0,100,1,161,1,125, + 4,124,0,160,0,100,2,161,1,125,5,124,4,115,66,124, + 5,114,36,124,5,106,1,125,4,110,30,124,2,124,3,107, + 2,114,56,116,2,124,1,124,2,131,2,125,4,110,10,116, + 3,124,1,124,2,131,2,125,4,124,5,115,84,116,4,124, + 1,124,2,124,4,100,3,141,3,125,5,122,38,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,100, + 0,83,0,4,0,116,5,121,142,1,0,1,0,1,0,89, + 0,100,0,83,0,119,0,41,6,78,218,10,95,95,108,111, + 97,100,101,114,95,95,218,8,95,95,115,112,101,99,95,95, + 114,81,1,0,0,90,8,95,95,102,105,108,101,95,95,90, + 10,95,95,99,97,99,104,101,100,95,95,41,6,218,3,103, + 101,116,114,151,0,0,0,114,27,1,0,0,114,21,1,0, + 0,114,201,0,0,0,218,9,69,120,99,101,112,116,105,111, + 110,41,6,90,2,110,115,114,128,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,151,0,0,0,114,198,0,0,0,114,7,0,0,0, + 114,7,0,0,0,114,8,0,0,0,218,14,95,102,105,120, + 95,117,112,95,109,111,100,117,108,101,34,6,0,0,115,38, + 0,0,0,10,2,10,1,4,1,4,1,8,1,8,1,12, + 1,10,2,4,1,14,1,2,1,8,1,8,1,8,1,14, + 1,12,1,6,2,2,254,255,128,114,99,1,0,0,99,0, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3, + 0,0,0,67,0,0,0,115,38,0,0,0,116,0,116,1, + 160,2,161,0,102,2,125,0,116,3,116,4,102,2,125,1, + 116,5,116,6,102,2,125,2,124,0,124,1,124,2,103,3, + 83,0,41,2,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,78,41,7,114,17,1,0,0,114,174,0, + 0,0,218,18,101,120,116,101,110,115,105,111,110,95,115,117, + 102,102,105,120,101,115,114,21,1,0,0,114,113,0,0,0, + 114,27,1,0,0,114,101,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,7,0,0,0,114, + 7,0,0,0,114,8,0,0,0,114,195,0,0,0,57,6, + 0,0,115,10,0,0,0,12,5,8,1,8,1,10,1,255, + 128,114,195,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,1,0,0,0,1,0,0,0,67,0,0,0,115, + 8,0,0,0,124,0,97,0,100,0,83,0,114,121,0,0, + 0,41,1,114,146,0,0,0,41,1,218,17,95,98,111,111, + 116,115,116,114,97,112,95,109,111,100,117,108,101,114,7,0, + 0,0,114,7,0,0,0,114,8,0,0,0,218,21,95,115, + 101,116,95,98,111,111,116,115,116,114,97,112,95,109,111,100, + 117,108,101,68,6,0,0,115,4,0,0,0,8,2,255,128, + 114,102,1,0,0,99,1,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,50, + 0,0,0,116,0,124,0,131,1,1,0,116,1,131,0,125, + 1,116,2,106,3,160,4,116,5,106,6,124,1,142,0,103, + 1,161,1,1,0,116,2,106,7,160,8,116,9,161,1,1, + 0,100,1,83,0,41,2,122,41,73,110,115,116,97,108,108, + 32,116,104,101,32,112,97,116,104,45,98,97,115,101,100,32, + 105,109,112,111,114,116,32,99,111,109,112,111,110,101,110,116, + 115,46,78,41,10,114,102,1,0,0,114,195,0,0,0,114, + 16,0,0,0,114,69,1,0,0,114,178,0,0,0,114,80, + 1,0,0,114,94,1,0,0,218,9,109,101,116,97,95,112, + 97,116,104,114,197,0,0,0,114,63,1,0,0,41,2,114, + 101,1,0,0,90,17,115,117,112,112,111,114,116,101,100,95, + 108,111,97,100,101,114,115,114,7,0,0,0,114,7,0,0, + 0,114,8,0,0,0,218,8,95,105,110,115,116,97,108,108, + 73,6,0,0,115,10,0,0,0,8,2,6,1,20,1,16, + 1,255,128,114,104,1,0,0,41,1,114,75,0,0,0,41, + 1,78,41,3,78,78,78,41,2,114,0,0,0,0,114,0, + 0,0,0,41,1,84,41,1,78,41,1,78,41,83,114,139, + 0,0,0,114,146,0,0,0,114,174,0,0,0,114,79,0, + 0,0,114,16,0,0,0,114,88,0,0,0,114,171,0,0, + 0,114,26,0,0,0,114,218,0,0,0,90,2,110,116,114, + 19,0,0,0,114,203,0,0,0,90,5,112,111,115,105,120, + 114,48,0,0,0,218,3,97,108,108,114,51,0,0,0,114, + 52,0,0,0,114,73,0,0,0,114,29,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,28,0,0,0,114,30,0,0,0,114, + 22,0,0,0,114,37,0,0,0,114,43,0,0,0,114,46, + 0,0,0,114,54,0,0,0,114,61,0,0,0,114,63,0, + 0,0,114,67,0,0,0,114,68,0,0,0,114,71,0,0, + 0,114,74,0,0,0,114,84,0,0,0,218,4,116,121,112, + 101,218,8,95,95,99,111,100,101,95,95,114,173,0,0,0, + 114,35,0,0,0,114,159,0,0,0,114,34,0,0,0,114, + 40,0,0,0,114,251,0,0,0,114,104,0,0,0,114,100, + 0,0,0,114,113,0,0,0,114,197,0,0,0,114,100,1, + 0,0,114,219,0,0,0,114,101,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,109,0,0,0,114,114,0,0,0,114,120,0,0, + 0,114,124,0,0,0,114,126,0,0,0,114,147,0,0,0, + 114,154,0,0,0,114,163,0,0,0,114,167,0,0,0,114, + 169,0,0,0,114,176,0,0,0,114,181,0,0,0,114,182, + 0,0,0,114,187,0,0,0,218,6,111,98,106,101,99,116, + 114,196,0,0,0,114,201,0,0,0,114,202,0,0,0,114, + 222,0,0,0,114,236,0,0,0,114,254,0,0,0,114,21, + 1,0,0,114,27,1,0,0,114,17,1,0,0,114,33,1, + 0,0,114,59,1,0,0,114,63,1,0,0,114,80,1,0, + 0,114,99,1,0,0,114,195,0,0,0,114,102,1,0,0, + 114,104,1,0,0,114,7,0,0,0,114,7,0,0,0,114, + 7,0,0,0,114,8,0,0,0,218,8,60,109,111,100,117, + 108,101,62,1,0,0,0,115,172,0,0,0,4,0,4,22, + 8,3,8,1,8,1,8,1,8,1,10,3,4,1,8,1, + 10,1,8,2,4,3,10,1,6,2,22,2,8,1,10,1, + 14,1,4,4,4,1,2,1,2,1,4,255,8,4,6,16, + 8,3,8,5,8,5,8,6,8,6,8,12,8,10,8,9, + 8,5,8,7,10,9,10,22,0,127,16,25,12,1,4,2, + 4,1,6,2,6,1,10,1,8,2,6,2,8,2,16,2, + 8,71,8,40,8,19,8,12,8,12,8,31,8,17,8,33, + 8,28,10,24,10,13,10,10,8,11,6,14,4,3,2,1, + 12,255,14,68,14,64,16,30,0,127,14,17,18,50,18,45, + 18,25,14,53,14,63,14,49,0,127,14,23,0,127,10,22, + 8,23,8,11,12,5,255,128, }; From webhook-mailer at python.org Tue Mar 30 12:11:30 2021 From: webhook-mailer at python.org (pitrou) Date: Tue, 30 Mar 2021 16:11:30 -0000 Subject: [Python-checkins] bpo-41369: Finish updating the vendored libmpdec to version 2.5.1 (GH-24962) Message-ID: https://github.com/python/cpython/commit/73b20ae2fb7a5c1374aa5c3719f64c53d29fa0d2 commit: 73b20ae2fb7a5c1374aa5c3719f64c53d29fa0d2 branch: master author: Antoine Pitrou committer: pitrou date: 2021-03-30T18:11:06+02:00 summary: bpo-41369: Finish updating the vendored libmpdec to version 2.5.1 (GH-24962) Complete the update to libmpdec-2.5.1. Co-authored-by: Stefan Krah files: A Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst A Modules/_decimal/libmpdec/bench.c A Modules/_decimal/libmpdec/bench_full.c A Modules/_decimal/libmpdec/examples/README.txt A Modules/_decimal/libmpdec/examples/compare.c A Modules/_decimal/libmpdec/examples/div.c A Modules/_decimal/libmpdec/examples/divmod.c A Modules/_decimal/libmpdec/examples/multiply.c A Modules/_decimal/libmpdec/examples/pow.c A Modules/_decimal/libmpdec/examples/powmod.c A Modules/_decimal/libmpdec/examples/shift.c A Modules/_decimal/libmpdec/examples/sqrt.c A Modules/_decimal/libmpdec/mpsignal.c D Modules/_decimal/libmpdec/vccompat.h M Modules/_decimal/_decimal.c M Modules/_decimal/libmpdec/README.txt M Modules/_decimal/libmpdec/constants.c M Modules/_decimal/libmpdec/context.c M Modules/_decimal/libmpdec/crt.c M Modules/_decimal/libmpdec/crt.h M Modules/_decimal/libmpdec/io.c M Modules/_decimal/libmpdec/mpalloc.c M Modules/_decimal/libmpdec/mpalloc.h M Modules/_decimal/libmpdec/mpdecimal.c M Modules/_decimal/libmpdec/mpdecimal.h M Modules/_decimal/libmpdec/typearith.h M setup.py diff --git a/Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst b/Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst new file mode 100644 index 0000000000000..6a85e8259cef4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst @@ -0,0 +1,2 @@ +Finish updating the vendored libmpdec to version 2.5.1. Patch by Stefan +Krah. diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 83e237d02bf5a..9a4329f494f31 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -3293,7 +3293,7 @@ dec_format(PyObject *dec, PyObject *args) } else { size_t n = strlen(spec.dot); - if (n > 1 || (n == 1 && !isascii((uchar)spec.dot[0]))) { + if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) { /* fix locale dependent non-ascii characters */ dot = dotsep_as_utf8(spec.dot); if (dot == NULL) { @@ -3302,7 +3302,7 @@ dec_format(PyObject *dec, PyObject *args) spec.dot = PyBytes_AS_STRING(dot); } n = strlen(spec.sep); - if (n > 1 || (n == 1 && !isascii((uchar)spec.sep[0]))) { + if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) { /* fix locale dependent non-ascii characters */ sep = dotsep_as_utf8(spec.sep); if (sep == NULL) { diff --git a/Modules/_decimal/libmpdec/README.txt b/Modules/_decimal/libmpdec/README.txt index dc97820a6eb0c..c1d481dee7645 100644 --- a/Modules/_decimal/libmpdec/README.txt +++ b/Modules/_decimal/libmpdec/README.txt @@ -29,7 +29,6 @@ Files required for the Python _decimal module Visual Studio only: ~~~~~~~~~~~~~~~~~~~ - vccompat.h -> snprintf <==> sprintf_s and similar things. vcdiv64.asm -> Double word division used in typearith.h. VS 2008 does not allow inline asm for x64. Also, it does not provide an intrinsic for double word division. diff --git a/Modules/_decimal/libmpdec/bench.c b/Modules/_decimal/libmpdec/bench.c new file mode 100644 index 0000000000000..09138f4ce9c03 --- /dev/null +++ b/Modules/_decimal/libmpdec/bench.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include "mpdecimal.h" + +#include +#include +#include +#include + + +static void +err_exit(const char *msg) +{ + fprintf(stderr, "%s\n", msg); + exit(1); +} + +static mpd_t * +new_mpd(void) +{ + mpd_t *x = mpd_qnew(); + if (x == NULL) { + err_exit("out of memory"); + } + + return x; +} + +/* Nonsense version of escape-time algorithm for calculating a mandelbrot + * set. Just for benchmarking. */ +static void +color_point(mpd_t *x0, mpd_t *y0, long maxiter, mpd_context_t *ctx) +{ + mpd_t *x, *y, *sq_x, *sq_y; + mpd_t *two; + + x = new_mpd(); + y = new_mpd(); + mpd_set_u32(x, 0, ctx); + mpd_set_u32(y, 0, ctx); + + sq_x = new_mpd(); + sq_y = new_mpd(); + mpd_set_u32(sq_x, 0, ctx); + mpd_set_u32(sq_y, 0, ctx); + + two = new_mpd(); + mpd_set_u32(two, 2, ctx); + + for (long i = 0; i < maxiter; i++) { + mpd_mul(y, x, y, ctx); + mpd_mul(y, y, two, ctx); + mpd_add(y, y, y0, ctx); + + mpd_sub(x, sq_x, sq_y, ctx); + mpd_add(x, x, x0, ctx); + + mpd_mul(sq_x, x, x, ctx); + mpd_mul(sq_y, y, y, ctx); + } + + mpd_copy(x0, x, ctx); + + mpd_del(two); + mpd_del(sq_y); + mpd_del(sq_x); + mpd_del(y); + mpd_del(x); +} + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *x0, *y0; + uint32_t prec = 19; + long iter = 10000000; + clock_t start_clock, end_clock; + + if (argc != 3) { + err_exit("usage: bench prec iter\n"); + } + prec = strtoul(argv[1], NULL, 10); + iter = strtol(argv[2], NULL, 10); + + mpd_init(&ctx, prec); + /* no more MPD_MINALLOC changes after here */ + + x0 = new_mpd(); + y0 = new_mpd(); + mpd_set_string(x0, "0.222", &ctx); + mpd_set_string(y0, "0.333", &ctx); + if (ctx.status & MPD_Errors) { + mpd_del(y0); + mpd_del(x0); + err_exit("unexpected error during conversion"); + } + + start_clock = clock(); + color_point(x0, y0, iter, &ctx); + end_clock = clock(); + + mpd_print(x0); + fprintf(stderr, "time: %f\n\n", (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + mpd_del(y0); + mpd_del(x0); + + return 0; +} diff --git a/Modules/_decimal/libmpdec/bench_full.c b/Modules/_decimal/libmpdec/bench_full.c new file mode 100644 index 0000000000000..6ab73917e1c32 --- /dev/null +++ b/Modules/_decimal/libmpdec/bench_full.c @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include "mpdecimal.h" + +#include +#include +#include +#include + + +static void +err_exit(const char *msg) +{ + fprintf(stderr, "%s\n", msg); + exit(1); +} + +static mpd_t * +new_mpd(void) +{ + mpd_t *x = mpd_qnew(); + if (x == NULL) { + err_exit("out of memory"); + } + + return x; +} + +/* + * Example from: http://en.wikipedia.org/wiki/Mandelbrot_set + * + * Escape time algorithm for drawing the set: + * + * Point x0, y0 is deemed to be in the Mandelbrot set if the return + * value is maxiter. Lower return values indicate how quickly points + * escaped and can be used for coloring. + */ +static int +color_point(const mpd_t *x0, const mpd_t *y0, const long maxiter, mpd_context_t *ctx) +{ + mpd_t *x, *y, *sq_x, *sq_y; + mpd_t *two, *four, *c; + long i; + + x = new_mpd(); + y = new_mpd(); + mpd_set_u32(x, 0, ctx); + mpd_set_u32(y, 0, ctx); + + sq_x = new_mpd(); + sq_y = new_mpd(); + mpd_set_u32(sq_x, 0, ctx); + mpd_set_u32(sq_y, 0, ctx); + + two = new_mpd(); + four = new_mpd(); + mpd_set_u32(two, 2, ctx); + mpd_set_u32(four, 4, ctx); + + c = new_mpd(); + mpd_set_u32(c, 0, ctx); + + for (i = 0; i < maxiter && mpd_cmp(c, four, ctx) <= 0; i++) { + mpd_mul(y, x, y, ctx); + mpd_mul(y, y, two, ctx); + mpd_add(y, y, y0, ctx); + + mpd_sub(x, sq_x, sq_y, ctx); + mpd_add(x, x, x0, ctx); + + mpd_mul(sq_x, x, x, ctx); + mpd_mul(sq_y, y, y, ctx); + mpd_add(c, sq_x, sq_y, ctx); + } + + mpd_del(c); + mpd_del(four); + mpd_del(two); + mpd_del(sq_y); + mpd_del(sq_x); + mpd_del(y); + mpd_del(x); + + return i; +} + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *x0, *y0; + mpd_t *sqrt_2, *xstep, *ystep; + mpd_ssize_t prec = 19; + + long iter = 1000; + int points[40][80]; + int i, j; + clock_t start_clock, end_clock; + + + if (argc != 3) { + fprintf(stderr, "usage: ./bench prec iter\n"); + exit(1); + } + prec = strtoll(argv[1], NULL, 10); + iter = strtol(argv[2], NULL, 10); + + mpd_init(&ctx, prec); + /* no more MPD_MINALLOC changes after here */ + + sqrt_2 = new_mpd(); + xstep = new_mpd(); + ystep = new_mpd(); + x0 = new_mpd(); + y0 = new_mpd(); + + mpd_set_u32(sqrt_2, 2, &ctx); + mpd_sqrt(sqrt_2, sqrt_2, &ctx); + mpd_div_u32(xstep, sqrt_2, 40, &ctx); + mpd_div_u32(ystep, sqrt_2, 20, &ctx); + + start_clock = clock(); + mpd_copy(y0, sqrt_2, &ctx); + for (i = 0; i < 40; i++) { + mpd_copy(x0, sqrt_2, &ctx); + mpd_set_negative(x0); + for (j = 0; j < 80; j++) { + points[i][j] = color_point(x0, y0, iter, &ctx); + mpd_add(x0, x0, xstep, &ctx); + } + mpd_sub(y0, y0, ystep, &ctx); + } + end_clock = clock(); + +#ifdef BENCH_VERBOSE + for (i = 0; i < 40; i++) { + for (j = 0; j < 80; j++) { + if (points[i][j] == iter) { + putchar('*'); + } + else if (points[i][j] >= 10) { + putchar('+'); + } + else if (points[i][j] >= 5) { + putchar('.'); + } + else { + putchar(' '); + } + } + putchar('\n'); + } + putchar('\n'); +#else + (void)points; /* suppress gcc warning */ +#endif + + printf("time: %f\n\n", (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + mpd_del(y0); + mpd_del(x0); + mpd_del(ystep); + mpd_del(xstep); + mpd_del(sqrt_2); + + return 0; +} diff --git a/Modules/_decimal/libmpdec/constants.c b/Modules/_decimal/libmpdec/constants.c index 4c4de622bc601..ed074fa81c6d2 100644 --- a/Modules/_decimal/libmpdec/constants.c +++ b/Modules/_decimal/libmpdec/constants.c @@ -27,6 +27,7 @@ #include "mpdecimal.h" +#include "basearith.h" #include "constants.h" @@ -111,7 +112,7 @@ #error "CONFIG_64 or CONFIG_32 must be defined." #endif -const char *mpd_round_string[MPD_ROUND_GUARD] = { +const char * const mpd_round_string[MPD_ROUND_GUARD] = { "ROUND_UP", /* round away from 0 */ "ROUND_DOWN", /* round toward 0 (truncate) */ "ROUND_CEILING", /* round toward +infinity */ @@ -123,7 +124,7 @@ const char *mpd_round_string[MPD_ROUND_GUARD] = { "ROUND_TRUNC", /* truncate, but set infinity */ }; -const char *mpd_clamp_string[MPD_CLAMP_GUARD] = { +const char * const mpd_clamp_string[MPD_CLAMP_GUARD] = { "CLAMP_DEFAULT", "CLAMP_IEEE_754" }; diff --git a/Modules/_decimal/libmpdec/context.c b/Modules/_decimal/libmpdec/context.c index 9cbc20509595d..172794b67d800 100644 --- a/Modules/_decimal/libmpdec/context.c +++ b/Modules/_decimal/libmpdec/context.c @@ -235,12 +235,12 @@ mpd_qsetround(mpd_context_t *ctx, int round) } int -mpd_qsettraps(mpd_context_t *ctx, uint32_t traps) +mpd_qsettraps(mpd_context_t *ctx, uint32_t flags) { - if (traps > MPD_Max_status) { + if (flags > MPD_Max_status) { return 0; } - ctx->traps = traps; + ctx->traps = flags; return 1; } diff --git a/Modules/_decimal/libmpdec/crt.c b/Modules/_decimal/libmpdec/crt.c index 613274ee0c5b5..babcce41bf67c 100644 --- a/Modules/_decimal/libmpdec/crt.c +++ b/Modules/_decimal/libmpdec/crt.c @@ -33,8 +33,8 @@ #include "constants.h" #include "crt.h" #include "numbertheory.h" -#include "umodarith.h" #include "typearith.h" +#include "umodarith.h" /* Bignum: Chinese Remainder Theorem, extends the maximum transform length. */ @@ -62,17 +62,17 @@ static inline void _crt_add3(mpd_uint_t w[3], mpd_uint_t v[3]) { mpd_uint_t carry; - mpd_uint_t s; - s = w[0] + v[0]; - carry = (s < w[0]); - w[0] = s; + w[0] = w[0] + v[0]; + carry = (w[0] < v[0]); + + w[1] = w[1] + v[1]; + if (w[1] < v[1]) w[2]++; - s = w[1] + (v[1] + carry); - carry = (s < w[1]); - w[1] = s; + w[1] = w[1] + carry; + if (w[1] < carry) w[2]++; - w[2] = w[2] + (v[2] + carry); + w[2] += v[2]; } /* Divide 3 words in u by v, store result in w, return remainder. */ diff --git a/Modules/_decimal/libmpdec/crt.h b/Modules/_decimal/libmpdec/crt.h index 15a347d4cb31e..ed66753c2510b 100644 --- a/Modules/_decimal/libmpdec/crt.h +++ b/Modules/_decimal/libmpdec/crt.h @@ -37,7 +37,7 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) -void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t nmemb); +void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t rsize); MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */ diff --git a/Modules/_decimal/libmpdec/examples/README.txt b/Modules/_decimal/libmpdec/examples/README.txt new file mode 100644 index 0000000000000..69615b45f9821 --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/README.txt @@ -0,0 +1,8 @@ + + +This directory contains a number of examples. In order to compile, run +(for example): + +gcc -Wall -W -O2 -o powmod powmod.c -lmpdec -lm + + diff --git a/Modules/_decimal/libmpdec/examples/compare.c b/Modules/_decimal/libmpdec/examples/compare.c new file mode 100644 index 0000000000000..9051773e116de --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/compare.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "compare: usage: ./compare x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_compare(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/div.c b/Modules/_decimal/libmpdec/examples/div.c new file mode 100644 index 0000000000000..b76037d2a64c6 --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/div.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "div: usage: ./div x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_div(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/divmod.c b/Modules/_decimal/libmpdec/examples/divmod.c new file mode 100644 index 0000000000000..1f2b48306d6d0 --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/divmod.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *q, *r; + char *qs, *rs; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "divmod: usage: ./divmod x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + q = mpd_new(&ctx); + r = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_divmod(q, r, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + qs = mpd_to_sci(q, 1); + rs = mpd_to_sci(r, 1); + + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s %s\n", qs, rs, status_str); + + mpd_del(q); + mpd_del(r); + mpd_del(a); + mpd_del(b); + mpd_free(qs); + mpd_free(rs); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/multiply.c b/Modules/_decimal/libmpdec/examples/multiply.c new file mode 100644 index 0000000000000..7f2687d15f827 --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/multiply.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "multiply: usage: ./multiply x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_mul(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/pow.c b/Modules/_decimal/libmpdec/examples/pow.c new file mode 100644 index 0000000000000..628c143427357 --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/pow.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "pow: usage: ./pow x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_pow(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/powmod.c b/Modules/_decimal/libmpdec/examples/powmod.c new file mode 100644 index 0000000000000..b422fdbbb955d --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/powmod.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b, *c; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 4) { + fprintf(stderr, "powmod: usage: ./powmod x y z\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + c = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + mpd_set_string(c, argv[3], &ctx); + + start_clock = clock(); + mpd_powmod(result, a, b, c, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(c); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/shift.c b/Modules/_decimal/libmpdec/examples/shift.c new file mode 100644 index 0000000000000..6d54e108ca87f --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/shift.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "shift: usage: ./shift x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_shift(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/vccompat.h b/Modules/_decimal/libmpdec/examples/sqrt.c similarity index 62% rename from Modules/_decimal/libmpdec/vccompat.h rename to Modules/_decimal/libmpdec/examples/sqrt.c index e2e1c42cc0250..d8272789b18c2 100644 --- a/Modules/_decimal/libmpdec/vccompat.h +++ b/Modules/_decimal/libmpdec/examples/sqrt.c @@ -26,31 +26,49 @@ */ -#ifndef LIBMPDEC_VCCOMPAT_H_ -#define LIBMPDEC_VCCOMPAT_H_ - - -/* Visual C fixes: no snprintf ... */ -#ifdef _MSC_VER - #ifndef __cplusplus - #undef inline - #define inline __inline - #endif - #undef random - #define random rand - #undef srandom - #define srandom srand - #undef snprintf - #define snprintf sprintf_s - #define HAVE_SNPRINTF - #undef strncasecmp - #define strncasecmp _strnicmp - #undef strcasecmp - #define strcasecmp _stricmp - #undef strtoll - #define strtoll _strtoi64 - #define strdup _strdup -#endif - - -#endif /* LIBMPDEC_VCCOMPAT_H_ */ +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 2) { + fprintf(stderr, "sqrt: usage: ./sqrt x\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + + start_clock = clock(); + mpd_sqrt(result, a, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c index 9513a68e3782d..e7bd6aee17005 100644 --- a/Modules/_decimal/libmpdec/io.c +++ b/Modules/_decimal/libmpdec/io.c @@ -37,17 +37,17 @@ #include #include -#include "typearith.h" #include "io.h" +#include "typearith.h" /* This file contains functions for decimal <-> string conversions, including PEP-3101 formatting for numeric types. */ -/* Disable warning that is part of -Wextra since gcc 7.0. */ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif @@ -155,13 +155,13 @@ scan_dpoint_exp(const char *s, const char **dpoint, const char **exp, s++; break; default: - if (!isdigit((uchar)*s)) + if (!isdigit((unsigned char)*s)) return NULL; if (coeff == NULL && *exp == NULL) { if (*s == '0') { - if (!isdigit((uchar)*(s+1))) + if (!isdigit((unsigned char)*(s+1))) if (!(*(s+1) == '.' && - isdigit((uchar)*(s+2)))) + isdigit((unsigned char)*(s+2)))) coeff = s; } else { @@ -187,7 +187,7 @@ scan_payload(const char *s, const char **end) s++; coeff = s; - while (isdigit((uchar)*s)) + while (isdigit((unsigned char)*s)) s++; *end = s; @@ -689,8 +689,8 @@ mpd_to_eng_size(char **res, const mpd_t *dec, int fmt) static int _mpd_copy_utf8(char dest[5], const char *s) { - const uchar *cp = (const uchar *)s; - uchar lb, ub; + const unsigned char *cp = (const unsigned char *)s; + unsigned char lb, ub; int count, i; @@ -843,7 +843,7 @@ mpd_parse_fmt_str(mpd_spec_t *spec, const char *fmt, int caps) } /* minimum width */ - if (isdigit((uchar)*cp)) { + if (isdigit((unsigned char)*cp)) { if (*cp == '0') { return 0; } @@ -865,7 +865,7 @@ mpd_parse_fmt_str(mpd_spec_t *spec, const char *fmt, int caps) /* fraction digits or significant digits */ if (*cp == '.') { cp++; - if (!isdigit((uchar)*cp)) { + if (!isdigit((unsigned char)*cp)) { return 0; } errno = 0; @@ -1105,9 +1105,9 @@ _mpd_apply_lconv(mpd_mbstr_t *result, const mpd_spec_t *spec, uint32_t *status) sign = dp++; } /* integer part */ - assert(isdigit((uchar)*dp)); + assert(isdigit((unsigned char)*dp)); intpart = dp++; - while (isdigit((uchar)*dp)) { + while (isdigit((unsigned char)*dp)) { dp++; } n_int = (mpd_ssize_t)(dp-intpart); @@ -1262,8 +1262,8 @@ mpd_qformat_spec(const mpd_t *dec, const mpd_spec_t *spec, return NULL; } - if (isupper((uchar)type)) { - type = (char)tolower((uchar)type); + if (isupper((unsigned char)type)) { + type = (char)tolower((unsigned char)type); flags |= MPD_FMT_UPPER; } if (spec->sign == ' ') { diff --git a/Modules/_decimal/libmpdec/mpalloc.c b/Modules/_decimal/libmpdec/mpalloc.c index eb5ee7a807b33..5871d5c0f5351 100644 --- a/Modules/_decimal/libmpdec/mpalloc.c +++ b/Modules/_decimal/libmpdec/mpalloc.c @@ -61,13 +61,6 @@ mpd_callocfunc_em(size_t nmemb, size_t size) size_t req; mpd_size_t overflow; -#if MPD_SIZE_MAX < SIZE_MAX - /* full_coverage test only */ - if (nmemb > MPD_SIZE_MAX || size > MPD_SIZE_MAX) { - return NULL; - } -#endif - req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size, &overflow); if (overflow) { diff --git a/Modules/_decimal/libmpdec/mpalloc.h b/Modules/_decimal/libmpdec/mpalloc.h index 186808457b25c..2265004421824 100644 --- a/Modules/_decimal/libmpdec/mpalloc.h +++ b/Modules/_decimal/libmpdec/mpalloc.h @@ -39,12 +39,12 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) -int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status); +int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); +int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); +int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); -int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t size); -int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t size); +int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t nwords); +int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t nwords); MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */ diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index f0e4d7f343a43..f1626df46ed46 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -64,7 +64,7 @@ #if defined(_MSC_VER) #define ALWAYS_INLINE __forceinline -#elif defined(__IBMC__) || defined(LEGACY_COMPILER) +#elif defined (__IBMC__) || defined(LEGACY_COMPILER) #define ALWAYS_INLINE #undef inline #define inline @@ -4843,7 +4843,7 @@ _mpd_qln(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status) { mpd_context_t varcontext, maxcontext; - mpd_t *z = (mpd_t *) result; + mpd_t *z = result; MPD_NEW_STATIC(v,0,0,0,0); MPD_NEW_STATIC(vtmp,0,0,0,0); MPD_NEW_STATIC(tmp,0,0,0,0); @@ -6368,7 +6368,7 @@ _mpd_qpow_int(mpd_t *result, const mpd_t *base, const mpd_t *exp, mpd_context_t workctx; MPD_NEW_STATIC(tbase,0,0,0,0); MPD_NEW_STATIC(texp,0,0,0,0); - mpd_ssize_t n; + mpd_uint_t n; mpd_workcontext(&workctx, ctx); @@ -8090,7 +8090,6 @@ mpd_sizeinbase(const mpd_t *a, uint32_t base) } digits = a->digits+a->exp; - assert(digits > 0); #ifdef CONFIG_64 /* ceil(2711437152599294 / log10(2)) + 4 == 2**53 */ diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index 9c9f1ca443402..24c280b00ebcd 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -40,6 +40,7 @@ #include #include #include + #define MPD_UINT8_C(x) (static_cast(x)) extern "C" { #else #include @@ -47,6 +48,7 @@ extern "C" { #include #include #include + #define MPD_UINT8_C(x) ((uint8_t)x) #endif @@ -62,7 +64,6 @@ extern "C" { #endif #if defined(_MSC_VER) - #include "vccompat.h" #define EXTINLINE extern inline #else #define EXTINLINE @@ -74,25 +75,15 @@ extern "C" { MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) -#if !defined(LEGACY_COMPILER) - #if !defined(UINT64_MAX) - /* The following #error is just a warning. If the compiler indeed does - * not have uint64_t, it is perfectly safe to comment out the #error. */ - #error "Warning: Compiler without uint64_t. Comment out this line." - #define LEGACY_COMPILER - #endif -#endif - - /******************************************************************************/ /* Version */ /******************************************************************************/ #define MPD_MAJOR_VERSION 2 #define MPD_MINOR_VERSION 5 -#define MPD_MICRO_VERSION 0 +#define MPD_MICRO_VERSION 1 -#define MPD_VERSION "2.5.0" +#define MPD_VERSION "2.5.1" #define MPD_VERSION_HEX ((MPD_MAJOR_VERSION << 24) | \ (MPD_MINOR_VERSION << 16) | \ @@ -162,6 +153,7 @@ typedef int64_t mpd_ssize_t; #define MPD_EXP_INF 2000000000000000001LL #define MPD_EXP_CLAMP (-4000000000000000001LL) #define MPD_MAXIMPORT 105263157894736842L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */ +#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */ /* conversion specifiers */ #define PRI_mpd_uint_t PRIu64 @@ -203,9 +195,10 @@ typedef int32_t mpd_ssize_t; #define MPD_MAX_EMAX 425000000L /* ELIMIT-1 */ #define MPD_MIN_EMIN (-425000000L) /* -EMAX */ #define MPD_MIN_ETINY (MPD_MIN_EMIN-(MPD_MAX_PREC-1)) -#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */ -#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */ -#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */ +#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */ +#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */ +#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */ +#define MPD_IEEE_CONTEXT_MAX_BITS 256 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */ /* conversion specifiers */ #define PRI_mpd_uint_t PRIu32 @@ -242,8 +235,8 @@ enum { enum { MPD_CLAMP_DEFAULT, MPD_CLAMP_IEEE_754, MPD_CLAMP_GUARD }; -extern const char *mpd_round_string[MPD_ROUND_GUARD]; -extern const char *mpd_clamp_string[MPD_CLAMP_GUARD]; +extern const char * const mpd_round_string[MPD_ROUND_GUARD]; +extern const char * const mpd_clamp_string[MPD_CLAMP_GUARD]; typedef struct mpd_context_t { @@ -300,7 +293,6 @@ typedef struct mpd_context_t { #define MPD_Insufficient_storage MPD_Malloc_error /* IEEE 754 interchange format contexts */ -#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */ #define MPD_DECIMAL32 32 #define MPD_DECIMAL64 64 #define MPD_DECIMAL128 128 @@ -345,16 +337,16 @@ void mpd_addstatus_raise(mpd_context_t *ctx, uint32_t flags); /******************************************************************************/ /* mpd_t flags */ -#define MPD_POS ((uint8_t)0) -#define MPD_NEG ((uint8_t)1) -#define MPD_INF ((uint8_t)2) -#define MPD_NAN ((uint8_t)4) -#define MPD_SNAN ((uint8_t)8) +#define MPD_POS MPD_UINT8_C(0) +#define MPD_NEG MPD_UINT8_C(1) +#define MPD_INF MPD_UINT8_C(2) +#define MPD_NAN MPD_UINT8_C(4) +#define MPD_SNAN MPD_UINT8_C(8) #define MPD_SPECIAL (MPD_INF|MPD_NAN|MPD_SNAN) -#define MPD_STATIC ((uint8_t)16) -#define MPD_STATIC_DATA ((uint8_t)32) -#define MPD_SHARED_DATA ((uint8_t)64) -#define MPD_CONST_DATA ((uint8_t)128) +#define MPD_STATIC MPD_UINT8_C(16) +#define MPD_STATIC_DATA MPD_UINT8_C(32) +#define MPD_SHARED_DATA MPD_UINT8_C(64) +#define MPD_CONST_DATA MPD_UINT8_C(128) #define MPD_DATAFLAGS (MPD_STATIC_DATA|MPD_SHARED_DATA|MPD_CONST_DATA) /* mpd_t */ @@ -368,9 +360,6 @@ typedef struct mpd_t { } mpd_t; -typedef unsigned char uchar; - - /******************************************************************************/ /* Triple */ /******************************************************************************/ @@ -442,7 +431,7 @@ void mpd_qset_string_exact(mpd_t *dec, const char *s, uint32_t *status); /* set to NaN with error flags */ void mpd_seterror(mpd_t *result, uint32_t flags, uint32_t *status); /* set a special with sign and type */ -void mpd_setspecial(mpd_t *dec, uint8_t sign, uint8_t type); +void mpd_setspecial(mpd_t *result, uint8_t sign, uint8_t type); /* set coefficient to zero or all nines */ void mpd_zerocoeff(mpd_t *result); void mpd_qmaxcoeff(mpd_t *result, const mpd_context_t *ctx, uint32_t *status); @@ -835,16 +824,16 @@ 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); +mpd_t *mpd_qnew_size(mpd_ssize_t nwords); EXTINLINE void mpd_del(mpd_t *dec); 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 int mpd_qresize(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); +EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t nwords, 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); +int mpd_resize(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx); +int mpd_resize_zero(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx); MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */ diff --git a/Modules/_decimal/libmpdec/mpsignal.c b/Modules/_decimal/libmpdec/mpsignal.c new file mode 100644 index 0000000000000..fc2af48f4f379 --- /dev/null +++ b/Modules/_decimal/libmpdec/mpsignal.c @@ -0,0 +1,967 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include "mpdecimal.h" + +#include +#include + + +/* Signaling wrappers for the quiet functions in mpdecimal.c. */ + + +char * +mpd_format(const mpd_t *dec, const char *fmt, mpd_context_t *ctx) +{ + char *ret; + uint32_t status = 0; + ret = mpd_qformat(dec, fmt, ctx, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +void +mpd_import_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen, + uint8_t srcsign, uint32_t base, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qimport_u16(result, srcdata, srclen, srcsign, base, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_import_u32(mpd_t *result, const uint32_t *srcdata, size_t srclen, + uint8_t srcsign, uint32_t base, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qimport_u32(result, srcdata, srclen, srcsign, base, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +size_t +mpd_export_u16(uint16_t **rdata, size_t rlen, uint32_t base, const mpd_t *src, + mpd_context_t *ctx) +{ + size_t n; + uint32_t status = 0; + n = mpd_qexport_u16(rdata, rlen, base, src, &status); + mpd_addstatus_raise(ctx, status); + return n; +} + +size_t +mpd_export_u32(uint32_t **rdata, size_t rlen, uint32_t base, const mpd_t *src, + mpd_context_t *ctx) +{ + size_t n; + uint32_t status = 0; + n = mpd_qexport_u32(rdata, rlen, base, src, &status); + mpd_addstatus_raise(ctx, status); + return n; +} + +void +mpd_finalize(mpd_t *result, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qfinalize(result, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +int +mpd_check_nan(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (mpd_qcheck_nan(result, a, ctx, &status)) { + mpd_addstatus_raise(ctx, status); + return 1; + } + return 0; +} + +int +mpd_check_nans(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (mpd_qcheck_nans(result, a, b, ctx, &status)) { + mpd_addstatus_raise(ctx, status); + return 1; + } + return 0; +} + +void +mpd_set_string(mpd_t *result, const char *s, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_string(result, s, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_maxcoeff(mpd_t *result, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmaxcoeff(result, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +/* set static mpd from signed integer */ +void +mpd_sset_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_ssize(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sset_i32(mpd_t *result, int32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_i32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifdef CONFIG_64 +void +mpd_sset_i64(mpd_t *result, int64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_i64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* set static mpd from unsigned integer */ +void +mpd_sset_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_uint(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sset_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_u32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifdef CONFIG_64 +void +mpd_sset_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_u64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* set mpd from signed integer */ +void +mpd_set_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_ssize(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_set_i32(mpd_t *result, int32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_i32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_set_i64(mpd_t *result, int64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_i64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* set mpd from unsigned integer */ +void +mpd_set_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_uint(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_set_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_u32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_set_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_u64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* convert mpd to signed integer */ +mpd_ssize_t +mpd_get_ssize(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_ssize_t ret; + + ret = mpd_qget_ssize(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +int32_t +mpd_get_i32(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + int32_t ret; + + ret = mpd_qget_i32(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +#ifndef LEGACY_COMPILER +int64_t +mpd_get_i64(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + int64_t ret; + + ret = mpd_qget_i64(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} +#endif + +mpd_uint_t +mpd_get_uint(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_uint_t ret; + + ret = mpd_qget_uint(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +mpd_uint_t +mpd_abs_uint(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_uint_t ret; + + ret = mpd_qabs_uint(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +uint32_t +mpd_get_u32(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + uint32_t ret; + + ret = mpd_qget_u32(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +#ifndef LEGACY_COMPILER +uint64_t +mpd_get_u64(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + uint64_t ret; + + ret = mpd_qget_u64(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} +#endif + +void +mpd_and(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qand(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_copy(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy(result, a, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_canonical(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + mpd_copy(result, a, ctx); +} + +void +mpd_copy_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy_abs(result, a, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_copy_negate(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy_negate(result, a, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_copy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy_sign(result, a, b, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_invert(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qinvert(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_logb(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qlogb(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_or(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qor(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rotate(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrotate(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_scaleb(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qscaleb(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_shiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qshiftl(result, a, n, &status); + mpd_addstatus_raise(ctx, status); +} + +mpd_uint_t +mpd_shiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_uint_t rnd; + + rnd = mpd_qshiftr(result, a, n, &status); + mpd_addstatus_raise(ctx, status); + return rnd; +} + +void +mpd_shiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qshiftn(result, a, n, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_shift(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qshift(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_xor(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qxor(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qabs(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +int +mpd_cmp(const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + int c; + c = mpd_qcmp(a, b, &status); + mpd_addstatus_raise(ctx, status); + return c; +} + +int +mpd_compare(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + int c; + c = mpd_qcompare(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); + return c; +} + +int +mpd_compare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + int c; + c = mpd_qcompare_signal(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); + return c; +} + +void +mpd_add(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sub(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_add_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_add_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_add_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_add_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_sub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sub_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_sub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sub_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_div(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv(q, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_div_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_div_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_div_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_div_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_divmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdivmod(q, r, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_divint(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdivint(q, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_exp(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qexp(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_fma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, + mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qfma(result, a, b, c, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_ln(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qln(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_log10(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qlog10(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_max(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmax(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_max_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmax_mag(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_min(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmin(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_min_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmin_mag(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qminus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_mul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_next_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qnext_minus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_next_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qnext_plus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_next_toward(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qnext_toward(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qplus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_pow(mpd_t *result, const mpd_t *base, const mpd_t *exp, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qpow(result, base, exp, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_powmod(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_t *mod, + mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qpowmod(result, base, exp, mod, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_quantize(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qquantize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrescale(result, a, exp, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_reduce(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qreduce(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rem(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrem(r, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rem_near(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrem_near(r, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_round_to_intx(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qround_to_intx(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_round_to_int(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qround_to_int(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_trunc(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qtrunc(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_floor(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qfloor(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_ceil(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qceil(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sqrt(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsqrt(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_invroot(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qinvroot(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} diff --git a/Modules/_decimal/libmpdec/typearith.h b/Modules/_decimal/libmpdec/typearith.h index 47961788d7641..dd3776453d098 100644 --- a/Modules/_decimal/libmpdec/typearith.h +++ b/Modules/_decimal/libmpdec/typearith.h @@ -638,10 +638,10 @@ add_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow) static inline mpd_size_t mul_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow) { - mpd_uint_t lo; + mpd_uint_t hi, lo; - _mpd_mul_words((mpd_uint_t *)overflow, &lo, (mpd_uint_t)a, - (mpd_uint_t)b); + _mpd_mul_words(&hi, &lo, (mpd_uint_t)a, (mpd_uint_t)b); + *overflow = (mpd_size_t)hi; return lo; } diff --git a/setup.py b/setup.py index a7d00841d0559..e3fbd78bc08b8 100644 --- a/setup.py +++ b/setup.py @@ -2290,7 +2290,7 @@ def detect_decimal(self): undef_macros = [] if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): include_dirs = [] - libraries = [':libmpdec.so.2'] + libraries = ['mpdec'] sources = ['_decimal/_decimal.c'] depends = ['_decimal/docstrings.h'] else: From webhook-mailer at python.org Tue Mar 30 17:11:50 2021 From: webhook-mailer at python.org (serhiy-storchaka) Date: Tue, 30 Mar 2021 21:11:50 -0000 Subject: [Python-checkins] bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) Message-ID: https://github.com/python/cpython/commit/51a85ddce8b336addcb61b96f04c9c5edef07296 commit: 51a85ddce8b336addcb61b96f04c9c5edef07296 branch: master author: Alex Preng?re <2138730+alexprengere at users.noreply.github.com> committer: serhiy-storchaka date: 2021-03-31T00:11:29+03:00 summary: bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) files: A Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst M Lib/test/test_xml_etree.py M Lib/xml/etree/ElementTree.py M Misc/ACKS diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index fcb1f7fdfbbde..553529a300170 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -330,6 +330,9 @@ def test_simpleops(self): elem.extend([e]) self.serialize_check(elem, '') elem.remove(e) + elem.extend(iter([e])) + self.serialize_check(elem, '') + elem.remove(e) element = ET.Element("tag", key="value") self.serialize_check(element, '') # 1 diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 168418e466c45..99246800b9866 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -252,7 +252,7 @@ def extend(self, elements): """ for element in elements: self._assert_is_element(element) - self._children.extend(elements) + self._children.append(element) def insert(self, index, subelement): """Insert *subelement* at position *index*.""" diff --git a/Misc/ACKS b/Misc/ACKS index 5d3f75a4165b1..42f0efdd536dd 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1381,6 +1381,7 @@ Matheus Vieira Portela Davin Potts Guillaume Pratte Florian Preinstorfer +Alex Preng?re Amrit Prem Paul Prescod Donovan Preston diff --git a/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst new file mode 100644 index 0000000000000..0b8dffb2312e4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst @@ -0,0 +1,2 @@ +Fix ``ElementTree.extend`` not working on iterators when using the +Python implementation From webhook-mailer at python.org Tue Mar 30 17:33:03 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 21:33:03 -0000 Subject: [Python-checkins] bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) Message-ID: https://github.com/python/cpython/commit/c1079cde2a7676892a9b98703903206b7d26ed1f commit: c1079cde2a7676892a9b98703903206b7d26ed1f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T14:32:55-07:00 summary: bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) (cherry picked from commit 51a85ddce8b336addcb61b96f04c9c5edef07296) Co-authored-by: Alex Preng?re <2138730+alexprengere at users.noreply.github.com> files: A Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst M Lib/test/test_xml_etree.py M Lib/xml/etree/ElementTree.py M Misc/ACKS diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 341a3c7cd7660..d41ff4fd077e6 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -314,6 +314,9 @@ def test_simpleops(self): elem.extend([e]) self.serialize_check(elem, '') elem.remove(e) + elem.extend(iter([e])) + self.serialize_check(elem, '') + elem.remove(e) element = ET.Element("tag", key="value") self.serialize_check(element, '') # 1 diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 598b569ea958b..f8538dfb2b62d 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -245,7 +245,7 @@ def extend(self, elements): """ for element in elements: self._assert_is_element(element) - self._children.extend(elements) + self._children.append(element) def insert(self, index, subelement): """Insert *subelement* at position *index*.""" diff --git a/Misc/ACKS b/Misc/ACKS index e181c6171169e..39aa954a7b449 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1334,6 +1334,7 @@ Matheus Vieira Portela Davin Potts Guillaume Pratte Florian Preinstorfer +Alex Preng?re Amrit Prem Paul Prescod Donovan Preston diff --git a/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst new file mode 100644 index 0000000000000..0b8dffb2312e4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst @@ -0,0 +1,2 @@ +Fix ``ElementTree.extend`` not working on iterators when using the +Python implementation From webhook-mailer at python.org Tue Mar 30 17:36:34 2021 From: webhook-mailer at python.org (miss-islington) Date: Tue, 30 Mar 2021 21:36:34 -0000 Subject: [Python-checkins] bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) Message-ID: https://github.com/python/cpython/commit/b500bd8e672d15c6dfa24568a3264fdc0f3e0c01 commit: b500bd8e672d15c6dfa24568a3264fdc0f3e0c01 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T14:36:25-07:00 summary: bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) (cherry picked from commit 51a85ddce8b336addcb61b96f04c9c5edef07296) Co-authored-by: Alex Preng?re <2138730+alexprengere at users.noreply.github.com> files: A Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst M Lib/test/test_xml_etree.py M Lib/xml/etree/ElementTree.py M Misc/ACKS diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 5632b8b503cf3..bfc0d054ba8b7 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -312,6 +312,9 @@ def test_simpleops(self): elem.extend([e]) self.serialize_check(elem, '') elem.remove(e) + elem.extend(iter([e])) + self.serialize_check(elem, '') + elem.remove(e) element = ET.Element("tag", key="value") self.serialize_check(element, '') # 1 diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 7a269001d6e18..ac82ed8041995 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -252,7 +252,7 @@ def extend(self, elements): """ for element in elements: self._assert_is_element(element) - self._children.extend(elements) + self._children.append(element) def insert(self, index, subelement): """Insert *subelement* at position *index*.""" diff --git a/Misc/ACKS b/Misc/ACKS index 73d35c2d86bdc..4f7c92c9dc0f6 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1363,6 +1363,7 @@ Matheus Vieira Portela Davin Potts Guillaume Pratte Florian Preinstorfer +Alex Preng?re Amrit Prem Paul Prescod Donovan Preston diff --git a/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst new file mode 100644 index 0000000000000..0b8dffb2312e4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst @@ -0,0 +1,2 @@ +Fix ``ElementTree.extend`` not working on iterators when using the +Python implementation From webhook-mailer at python.org Wed Mar 31 00:17:41 2021 From: webhook-mailer at python.org (ethanfurman) Date: Wed, 31 Mar 2021 04:17:41 -0000 Subject: [Python-checkins] bpo-40066: Enum: modify `repr()` and `str()` (GH-22392) Message-ID: https://github.com/python/cpython/commit/b775106d940e3d77c8af7967545bb9a5b7b162df commit: b775106d940e3d77c8af7967545bb9a5b7b162df branch: master author: Ethan Furman committer: ethanfurman date: 2021-03-30T21:17:26-07:00 summary: bpo-40066: Enum: modify `repr()` and `str()` (GH-22392) * Enum: streamline repr() and str(); improve docs - repr() is now ``enum_class.member_name`` - stdlib global enums are ``module_name.member_name`` - str() is now ``member_name`` - add HOW-TO section for ``Enum`` - change main documentation to be an API reference files: A Doc/howto/enum.rst A Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst A Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst M Doc/howto/index.rst M Doc/library/enum.rst M Doc/library/http.rst M Doc/library/socket.rst M Doc/library/ssl.rst M Doc/whatsnew/3.10.rst M Lib/enum.py M Lib/inspect.py M Lib/plistlib.py M Lib/re.py M Lib/test/test_enum.py M Lib/test/test_pydoc.py M Lib/test/test_signal.py M Lib/test/test_socket.py M Lib/test/test_ssl.py M Lib/test/test_unicode.py diff --git a/Doc/howto/enum.rst b/Doc/howto/enum.rst new file mode 100644 index 0000000000000..9ece93e660504 --- /dev/null +++ b/Doc/howto/enum.rst @@ -0,0 +1,1416 @@ +========== +Enum HOWTO +========== + +:Author: Ethan Furman + +.. _enum-basic-tutorial: + +.. currentmodule:: enum + +Basic Enum Tutorial +------------------- + +An :class:`Enum` is a set of symbolic names bound to unique values. They are +similar to global variables, but they offer a more useful :func:`repr()`, +grouping, type-safety, and a few other features. + +They are most useful when you have a variable that can take one of a limited +selection of values. For example, the days of the week:: + + >>> from enum import Enum + >>> class Weekday(Enum): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 3 + ... THURSDAY = 4 + ... FRIDAY = 5 + ... SATURDAY = 6 + ... SUNDAY = 7 + +As you can see, creating an :class:`Enum` is as simple as writing a class that +inherits from :class:`Enum` itself. + +.. note:: Case of Enum Members + + Because Enums are used to represent constants we recommend using + UPPER_CASE names for members, and will be using that style in our examples. + +Depending on the nature of the enum a member's value may or may not be +important, but either way that value can be used to get the corresponding +member:: + + >>> Weekday(3) + Weekday.WEDNESDAY + +As you can see, the ``repr()`` of a member shows the enum name and the +member name. The ``str()`` on a member shows only its name:: + + >>> print(Weekday.THURSDAY) + THURSDAY + +The *type* of an enumeration member is the enum it belongs to:: + + >>> type(Weekday.MONDAY) + + >>> isinstance(Weekday.FRIDAY, Weekday) + True + +Enum members have an attribute that contains just their :attr:`name`:: + + >>> print(Weekday.TUESDAY.name) + TUESDAY + +Likewise, they have an attribute for their :attr:`value`:: + + + >>> Weekday.WEDNESDAY.value + 3 + +Unlike many languages that treat enumerations solely as name/value pairs, +Python Enums can have behavior added. For example, :class:`datetime.date` +has two methods for returning the weekday: :meth:`weekday` and :meth:`isoweekday`. +The difference is that one of them counts from 0-6 and the other from 1-7. +Rather than keep track of that ourselves we can add a method to the :class:`Weekday` +enum to extract the day from the :class:`date` instance and return the matching +enum member:: + + @classmethod + def from_date(cls, date): + return cls(date.isoweekday()) + +The complete :class:`Weekday` enum now looks like this:: + + >>> class Weekday(Enum): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 3 + ... THURSDAY = 4 + ... FRIDAY = 5 + ... SATURDAY = 6 + ... SUNDAY = 7 + ... # + ... @classmethod + ... def from_date(cls, date): + ... return cls(date.isoweekday()) + +Now we can find out what today is! Observe:: + + >>> from datetime import date + >>> Weekday.from_date(date.today()) + Weekday.TUESDAY + +Of course, if you're reading this on some other day, you'll see that day instead. + +This :class:`Weekday` enum is great if our variable only needs one day, but +what if we need several? Maybe we're writing a function to plot chores during +a week, and don't want to use a :class:`list` -- we could use a different type +of :class:`Enum`:: + + >>> from enum import Flag + >>> class Weekday(Flag): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 4 + ... THURSDAY = 8 + ... FRIDAY = 16 + ... SATURDAY = 32 + ... SUNDAY = 64 + +We've changed two things: we're inherited from :class:`Flag`, and the values are +all powers of 2. + +Just like the original :class:`Weekday` enum above, we can have a single selection:: + + >>> first_week_day = Weekday.MONDAY + >>> first_week_day + Weekday.MONDAY + +But :class:`Flag` also allows us to combine several members into a single +variable:: + + >>> weekend = Weekday.SATURDAY | Weekday.SUNDAY + >>> weekend + Weekday.SATURDAY|Weekday.SUNDAY + +You can even iterate over a :class:`Flag` variable:: + + >>> for day in weekend: + ... print(day) + SATURDAY + SUNDAY + +Okay, let's get some chores set up:: + + >>> chores_for_ethan = { + ... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday.FRIDAY, + ... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY, + ... 'answer SO questions': Weekday.SATURDAY, + ... } + +And a function to display the chores for a given day:: + + >>> def show_chores(chores, day): + ... for chore, days in chores.items(): + ... if day in days: + ... print(chore) + >>> show_chores(chores_for_ethan, Weekday.SATURDAY) + answer SO questions + +In cases where the actual values of the members do not matter, you can save +yourself some work and use :func:`auto()` for the values:: + + >>> from enum import auto + >>> class Weekday(Flag): + ... MONDAY = auto() + ... TUESDAY = auto() + ... WEDNESDAY = auto() + ... THURSDAY = auto() + ... FRIDAY = auto() + ... SATURDAY = auto() + ... SUNDAY = auto() + + +.. _enum-advanced-tutorial: + +Programmatic access to enumeration members and their attributes +--------------------------------------------------------------- + +Sometimes it's useful to access members in enumerations programmatically (i.e. +situations where ``Color.RED`` won't do because the exact color is not known +at program-writing time). ``Enum`` allows such access:: + + >>> Color(1) + Color.RED + >>> Color(3) + Color.BLUE + +If you want to access enum members by *name*, use item access:: + + >>> Color['RED'] + Color.RED + >>> Color['GREEN'] + Color.GREEN + +If you have an enum member and need its :attr:`name` or :attr:`value`:: + + >>> member = Color.RED + >>> member.name + 'RED' + >>> member.value + 1 + + +Duplicating enum members and values +----------------------------------- + +Having two enum members with the same name is invalid:: + + >>> class Shape(Enum): + ... SQUARE = 2 + ... SQUARE = 3 + ... + Traceback (most recent call last): + ... + TypeError: 'SQUARE' already defined as: 2 + +However, an enum member can have other names associated with it. Given two +entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` +is an alias for the member ``A``. By-value lookup of the value of ``A`` will +return the member ``A``. By-name lookup of ``A`` will return the member ``A``. +By-name lookup of ``B`` will also return the member ``A``:: + + >>> class Shape(Enum): + ... SQUARE = 2 + ... DIAMOND = 1 + ... CIRCLE = 3 + ... ALIAS_FOR_SQUARE = 2 + ... + >>> Shape.SQUARE + Shape.SQUARE + >>> Shape.ALIAS_FOR_SQUARE + Shape.SQUARE + >>> Shape(2) + Shape.SQUARE + +.. note:: + + Attempting to create a member with the same name as an already + defined attribute (another member, a method, etc.) or attempting to create + an attribute with the same name as a member is not allowed. + + +Ensuring unique enumeration values +---------------------------------- + +By default, enumerations allow multiple names as aliases for the same value. +When this behavior isn't desired, you can use the :func:`unique` decorator:: + + >>> from enum import Enum, unique + >>> @unique + ... class Mistake(Enum): + ... ONE = 1 + ... TWO = 2 + ... THREE = 3 + ... FOUR = 3 + ... + Traceback (most recent call last): + ... + ValueError: duplicate values found in : FOUR -> THREE + + +Using automatic values +---------------------- + +If the exact value is unimportant you can use :class:`auto`:: + + >>> from enum import Enum, auto + >>> class Color(Enum): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> [member.value for member in Color] + [1, 2, 3] + +The values are chosen by :func:`_generate_next_value_`, which can be +overridden:: + + >>> class AutoName(Enum): + ... def _generate_next_value_(name, start, count, last_values): + ... return name + ... + >>> class Ordinal(AutoName): + ... NORTH = auto() + ... SOUTH = auto() + ... EAST = auto() + ... WEST = auto() + ... + >>> [member.value for member in Color] + ['NORTH', 'SOUTH', 'EAST', 'WEST'] + +.. note:: + + The :meth:`_generate_next_value_` method must be defined before any members. + +Iteration +--------- + +Iterating over the members of an enum does not provide the aliases:: + + >>> list(Shape) + [Shape.SQUARE, Shape.DIAMOND, Shape.CIRCLE] + +The special attribute ``__members__`` is a read-only ordered mapping of names +to members. It includes all names defined in the enumeration, including the +aliases:: + + >>> for name, member in Shape.__members__.items(): + ... name, member + ... + ('SQUARE', Shape.SQUARE) + ('DIAMOND', Shape.DIAMOND) + ('CIRCLE', Shape.CIRCLE) + ('ALIAS_FOR_SQUARE', Shape.SQUARE) + +The ``__members__`` attribute can be used for detailed programmatic access to +the enumeration members. For example, finding all the aliases:: + + >>> [name for name, member in Shape.__members__.items() if member.name != name] + ['ALIAS_FOR_SQUARE'] + + +Comparisons +----------- + +Enumeration members are compared by identity:: + + >>> Color.RED is Color.RED + True + >>> Color.RED is Color.BLUE + False + >>> Color.RED is not Color.BLUE + True + +Ordered comparisons between enumeration values are *not* supported. Enum +members are not integers (but see `IntEnum`_ below):: + + >>> Color.RED < Color.BLUE + Traceback (most recent call last): + File "", line 1, in + TypeError: '<' not supported between instances of 'Color' and 'Color' + +Equality comparisons are defined though:: + + >>> Color.BLUE == Color.RED + False + >>> Color.BLUE != Color.RED + True + >>> Color.BLUE == Color.BLUE + True + +Comparisons against non-enumeration values will always compare not equal +(again, :class:`IntEnum` was explicitly designed to behave differently, see +below):: + + >>> Color.BLUE == 2 + False + + +Allowed members and attributes of enumerations +---------------------------------------------- + +Most of the examples above use integers for enumeration values. Using integers is +short and handy (and provided by default by the `Functional API`_), but not +strictly enforced. In the vast majority of use-cases, one doesn't care what +the actual value of an enumeration is. But if the value *is* important, +enumerations can have arbitrary values. + +Enumerations are Python classes, and can have methods and special methods as +usual. If we have this enumeration:: + + >>> class Mood(Enum): + ... FUNKY = 1 + ... HAPPY = 3 + ... + ... def describe(self): + ... # self is the member here + ... return self.name, self.value + ... + ... def __str__(self): + ... return 'my custom str! {0}'.format(self.value) + ... + ... @classmethod + ... def favorite_mood(cls): + ... # cls here is the enumeration + ... return cls.HAPPY + ... + +Then:: + + >>> Mood.favorite_mood() + Mood.HAPPY + >>> Mood.HAPPY.describe() + ('HAPPY', 3) + >>> str(Mood.FUNKY) + 'my custom str! 1' + +The rules for what is allowed are as follows: names that start and end with +a single underscore are reserved by enum and cannot be used; all other +attributes defined within an enumeration will become members of this +enumeration, with the exception of special methods (:meth:`__str__`, +:meth:`__add__`, etc.), descriptors (methods are also descriptors), and +variable names listed in :attr:`_ignore_`. + +Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then +any value(s) given to the enum member will be passed into those methods. +See `Planet`_ for an example. + + +Restricted Enum subclassing +--------------------------- + +A new :class:`Enum` class must have one base enum class, up to one concrete +data type, and as many :class:`object`-based mixin classes as needed. The +order of these base classes is:: + + class EnumName([mix-in, ...,] [data-type,] base-enum): + pass + +Also, subclassing an enumeration is allowed only if the enumeration does not define +any members. So this is forbidden:: + + >>> class MoreColor(Color): + ... PINK = 17 + ... + Traceback (most recent call last): + ... + TypeError: MoreColor: cannot extend enumeration 'Color' + +But this is allowed:: + + >>> class Foo(Enum): + ... def some_behavior(self): + ... pass + ... + >>> class Bar(Foo): + ... HAPPY = 1 + ... SAD = 2 + ... + +Allowing subclassing of enums that define members would lead to a violation of +some important invariants of types and instances. On the other hand, it makes +sense to allow sharing some common behavior between a group of enumerations. +(See `OrderedEnum`_ for an example.) + + +Pickling +-------- + +Enumerations can be pickled and unpickled:: + + >>> from test.test_enum import Fruit + >>> from pickle import dumps, loads + >>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO)) + True + +The usual restrictions for pickling apply: picklable enums must be defined in +the top level of a module, since unpickling requires them to be importable +from that module. + +.. note:: + + With pickle protocol version 4 it is possible to easily pickle enums + nested in other classes. + +It is possible to modify how enum members are pickled/unpickled by defining +:meth:`__reduce_ex__` in the enumeration class. + + +Functional API +-------------- + +The :class:`Enum` class is callable, providing the following functional API:: + + >>> Animal = Enum('Animal', 'ANT BEE CAT DOG') + >>> Animal + + >>> Animal.ANT + Animal.ANT + >>> Animal.ANT.value + 1 + >>> list(Animal) + [Animal.ANT, Animal.BEE, Animal.CAT, Animal.DOG] + +The semantics of this API resemble :class:`~collections.namedtuple`. The first +argument of the call to :class:`Enum` is the name of the enumeration. + +The second argument is the *source* of enumeration member names. It can be a +whitespace-separated string of names, a sequence of names, a sequence of +2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to +values. The last two options enable assigning arbitrary values to +enumerations; the others auto-assign increasing integers starting with 1 (use +the ``start`` parameter to specify a different starting value). A +new class derived from :class:`Enum` is returned. In other words, the above +assignment to :class:`Animal` is equivalent to:: + + >>> class Animal(Enum): + ... ANT = 1 + ... BEE = 2 + ... CAT = 3 + ... DOG = 4 + ... + +The reason for defaulting to ``1`` as the starting number and not ``0`` is +that ``0`` is ``False`` in a boolean sense, but by default enum members all +evaluate to ``True``. + +Pickling enums created with the functional API can be tricky as frame stack +implementation details are used to try and figure out which module the +enumeration is being created in (e.g. it will fail if you use a utility +function in separate module, and also may not work on IronPython or Jython). +The solution is to specify the module name explicitly as follows:: + + >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__) + +.. warning:: + + If ``module`` is not supplied, and Enum cannot determine what it is, + the new Enum members will not be unpicklable; to keep errors closer to + the source, pickling will be disabled. + +The new pickle protocol 4 also, in some circumstances, relies on +:attr:`~definition.__qualname__` being set to the location where pickle will be able +to find the class. For example, if the class was made available in class +SomeData in the global scope:: + + >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal') + +The complete signature is:: + + Enum( + value='NewEnumName', + names=<...>, + *, + module='...', + qualname='...', + type=, + start=1, + ) + +:value: What the new enum class will record as its name. + +:names: The enum members. This can be a whitespace or comma separated string + (values will start at 1 unless otherwise specified):: + + 'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE' + + or an iterator of names:: + + ['RED', 'GREEN', 'BLUE'] + + or an iterator of (name, value) pairs:: + + [('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)] + + or a mapping:: + + {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42} + +:module: name of module where new enum class can be found. + +:qualname: where in module new enum class can be found. + +:type: type to mix in to new enum class. + +:start: number to start counting at if only names are passed in. + +.. versionchanged:: 3.5 + The *start* parameter was added. + + +Derived Enumerations +-------------------- + +IntEnum +^^^^^^^ + +The first variation of :class:`Enum` that is provided is also a subclass of +:class:`int`. Members of an :class:`IntEnum` can be compared to integers; +by extension, integer enumerations of different types can also be compared +to each other:: + + >>> from enum import IntEnum + >>> class Shape(IntEnum): + ... CIRCLE = 1 + ... SQUARE = 2 + ... + >>> class Request(IntEnum): + ... POST = 1 + ... GET = 2 + ... + >>> Shape == 1 + False + >>> Shape.CIRCLE == 1 + True + >>> Shape.CIRCLE == Request.POST + True + +However, they still can't be compared to standard :class:`Enum` enumerations:: + + >>> class Shape(IntEnum): + ... CIRCLE = 1 + ... SQUARE = 2 + ... + >>> class Color(Enum): + ... RED = 1 + ... GREEN = 2 + ... + >>> Shape.CIRCLE == Color.RED + False + +:class:`IntEnum` values behave like integers in other ways you'd expect:: + + >>> int(Shape.CIRCLE) + 1 + >>> ['a', 'b', 'c'][Shape.CIRCLE] + 'b' + >>> [i for i in range(Shape.SQUARE)] + [0, 1] + + +StrEnum +^^^^^^^ + +The second variation of :class:`Enum` that is provided is also a subclass of +:class:`str`. Members of a :class:`StrEnum` can be compared to strings; +by extension, string enumerations of different types can also be compared +to each other. :class:`StrEnum` exists to help avoid the problem of getting +an incorrect member:: + + >>> from enum import StrEnum + >>> class Directions(StrEnum): + ... NORTH = 'north', # notice the trailing comma + ... SOUTH = 'south' + +Before :class:`StrEnum`, ``Directions.NORTH`` would have been the :class:`tuple` +``('north',)``. + +.. versionadded:: 3.10 + + +IntFlag +^^^^^^^ + +The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based +on :class:`int`. The difference being :class:`IntFlag` members can be combined +using the bitwise operators (&, \|, ^, ~) and the result is still an +:class:`IntFlag` member, if possible. However, as the name implies, :class:`IntFlag` +members also subclass :class:`int` and can be used wherever an :class:`int` is +used. + +.. note:: + + Any operation on an :class:`IntFlag` member besides the bit-wise operations will + lose the :class:`IntFlag` membership. + + Bit-wise operations that result in invalid :class:`IntFlag` values will lose the + :class:`IntFlag` membership. See :class:`FlagBoundary` for + details. + +.. versionadded:: 3.6 +.. versionchanged:: 3.10 + +Sample :class:`IntFlag` class:: + + >>> from enum import IntFlag + >>> class Perm(IntFlag): + ... R = 4 + ... W = 2 + ... X = 1 + ... + >>> Perm.R | Perm.W + Perm.R|Perm.W + >>> Perm.R + Perm.W + 6 + >>> RW = Perm.R | Perm.W + >>> Perm.R in RW + True + +It is also possible to name the combinations:: + + >>> class Perm(IntFlag): + ... R = 4 + ... W = 2 + ... X = 1 + ... RWX = 7 + >>> Perm.RWX + Perm.RWX + >>> ~Perm.RWX + Perm(0) + >>> Perm(7) + Perm.RWX + +.. note:: + + Named combinations are considered aliases. Aliases do not show up during + iteration, but can be returned from by-value lookups. + +.. versionchanged:: 3.10 + +Another important difference between :class:`IntFlag` and :class:`Enum` is that +if no flags are set (the value is 0), its boolean evaluation is :data:`False`:: + + >>> Perm.R & Perm.X + Perm(0) + >>> bool(Perm.R & Perm.X) + False + +Because :class:`IntFlag` members are also subclasses of :class:`int` they can +be combined with them (but may lose :class:`IntFlag` membership:: + + >>> Perm.X | 4 + Perm.R|Perm.X + + >>> Perm.X | 8 + 9 + +.. note:: + + The negation operator, ``~``, always returns an :class:`IntFlag` member with a + positive value:: + + >>> (~Perm.X).value == (Perm.R|Perm.W).value == 6 + True + +:class:`IntFlag` members can also be iterated over:: + + >>> list(RW) + [Perm.R, Perm.W] + +.. versionadded:: 3.10 + + +Flag +^^^^ + +The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` +members can be combined using the bitwise operators (&, \|, ^, ~). Unlike +:class:`IntFlag`, they cannot be combined with, nor compared against, any +other :class:`Flag` enumeration, nor :class:`int`. While it is possible to +specify the values directly it is recommended to use :class:`auto` as the +value and let :class:`Flag` select an appropriate value. + +.. versionadded:: 3.6 + +Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no +flags being set, the boolean evaluation is :data:`False`:: + + >>> from enum import Flag, auto + >>> class Color(Flag): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> Color.RED & Color.GREEN + Color(0) + >>> bool(Color.RED & Color.GREEN) + False + +Individual flags should have values that are powers of two (1, 2, 4, 8, ...), +while combinations of flags won't:: + + >>> class Color(Flag): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... WHITE = RED | BLUE | GREEN + ... + >>> Color.WHITE + Color.WHITE + +Giving a name to the "no flags set" condition does not change its boolean +value:: + + >>> class Color(Flag): + ... BLACK = 0 + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> Color.BLACK + Color.BLACK + >>> bool(Color.BLACK) + False + +:class:`Flag` members can also be iterated over:: + + >>> purple = Color.RED | Color.BLUE + >>> list(purple) + [Color.RED, Color.BLUE] + +.. versionadded:: 3.10 + +.. note:: + + For the majority of new code, :class:`Enum` and :class:`Flag` are strongly + recommended, since :class:`IntEnum` and :class:`IntFlag` break some + semantic promises of an enumeration (by being comparable to integers, and + thus by transitivity to other unrelated enumerations). :class:`IntEnum` + and :class:`IntFlag` should be used only in cases where :class:`Enum` and + :class:`Flag` will not do; for example, when integer constants are replaced + with enumerations, or for interoperability with other systems. + + +Others +^^^^^^ + +While :class:`IntEnum` is part of the :mod:`enum` module, it would be very +simple to implement independently:: + + class IntEnum(int, Enum): + pass + +This demonstrates how similar derived enumerations can be defined; for example +a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`. + +Some rules: + +1. When subclassing :class:`Enum`, mix-in types must appear before + :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum` + example above. +2. While :class:`Enum` can have members of any type, once you mix in an + additional type, all the members must have values of that type, e.g. + :class:`int` above. This restriction does not apply to mix-ins which only + add methods and don't specify another type. +3. When another data type is mixed in, the :attr:`value` attribute is *not the + same* as the enum member itself, although it is equivalent and will compare + equal. +4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's + :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as + `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type. +5. :ref:`Formatted string literals `, :meth:`str.format`, + and :func:`format` will use the mixed-in type's :meth:`__format__` + unless :meth:`__str__` or :meth:`__format__` is overridden in the subclass, + in which case the overridden methods or :class:`Enum` methods will be used. + Use the !s and !r format codes to force usage of the :class:`Enum` class's + :meth:`__str__` and :meth:`__repr__` methods. + +When to use :meth:`__new__` vs. :meth:`__init__` +------------------------------------------------ + +:meth:`__new__` must be used whenever you want to customize the actual value of +the :class:`Enum` member. Any other modifications may go in either +:meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred. + +For example, if you want to pass several items to the constructor, but only +want one of them to be the value:: + + >>> class Coordinate(bytes, Enum): + ... """ + ... Coordinate with binary codes that can be indexed by the int code. + ... """ + ... def __new__(cls, value, label, unit): + ... obj = bytes.__new__(cls, [value]) + ... obj._value_ = value + ... obj.label = label + ... obj.unit = unit + ... return obj + ... PX = (0, 'P.X', 'km') + ... PY = (1, 'P.Y', 'km') + ... VX = (2, 'V.X', 'km/s') + ... VY = (3, 'V.Y', 'km/s') + ... + + >>> print(Coordinate['PY']) + PY + + >>> print(Coordinate(3)) + VY + + +Finer Points +^^^^^^^^^^^^ + +Supported ``__dunder__`` names +"""""""""""""""""""""""""""""" + +:attr:`__members__` is a read-only ordered mapping of ``member_name``:``member`` +items. It is only available on the class. + +:meth:`__new__`, if specified, must create and return the enum members; it is +also a very good idea to set the member's :attr:`_value_` appropriately. Once +all the members are created it is no longer used. + + +Supported ``_sunder_`` names +"""""""""""""""""""""""""""" + +- ``_name_`` -- name of the member +- ``_value_`` -- value of the member; can be set / modified in ``__new__`` + +- ``_missing_`` -- a lookup function used when a value is not found; may be + overridden +- ``_ignore_`` -- a list of names, either as a :class:`list` or a :class:`str`, + that will not be transformed into members, and will be removed from the final + class +- ``_order_`` -- used in Python 2/3 code to ensure member order is consistent + (class attribute, removed during class creation) +- ``_generate_next_value_`` -- used by the `Functional API`_ and by + :class:`auto` to get an appropriate value for an enum member; may be + overridden + +.. note:: + + For standard :class:`Enum` classes the next value chosen is the last value seen + incremented by one. + + For :class:`Flag` classes the next value chosen will be the next highest + power-of-two, regardless of the last value seen. + +.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_`` +.. versionadded:: 3.7 ``_ignore_`` + +To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute can +be provided. It will be checked against the actual order of the enumeration +and raise an error if the two do not match:: + + >>> class Color(Enum): + ... _order_ = 'RED GREEN BLUE' + ... RED = 1 + ... BLUE = 3 + ... GREEN = 2 + ... + Traceback (most recent call last): + ... + TypeError: member order does not match _order_: + ['RED', 'BLUE', 'GREEN'] + ['RED', 'GREEN', 'BLUE'] + +.. note:: + + In Python 2 code the :attr:`_order_` attribute is necessary as definition + order is lost before it can be recorded. + + +_Private__names +""""""""""""""" + +Private names are not converted to enum members, but remain normal attributes. + +.. versionchanged:: 3.10 + + +``Enum`` member type +"""""""""""""""""""" + +Enum members are instances of their enum class, and are normally accessed as +``EnumClass.member``. In Python versions ``3.5`` to ``3.9`` you could access +members from other members -- this practice was discouraged, and in ``3.12`` +:class:`Enum` will return to not allowing it, while in ``3.10`` and ``3.11`` +it will raise a :exc:`DeprecationWarning`:: + + >>> class FieldTypes(Enum): + ... name = 0 + ... value = 1 + ... size = 2 + ... + >>> FieldTypes.value.size # doctest: +SKIP + DeprecationWarning: accessing one member from another is not supported, + and will be disabled in 3.12 + + +.. versionchanged:: 3.5 +.. versionchanged:: 3.10 + + +Creating members that are mixed with other data types +""""""""""""""""""""""""""""""""""""""""""""""""""""" + +When subclassing other data types, such as :class:`int` or :class:`str`, with +an :class:`Enum`, all values after the `=` are passed to that data type's +constructor. For example:: + + >>> class MyEnum(IntEnum): + ... example = '11', 16 # '11' will be interpreted as a hexadecimal + ... # number + >>> MyEnum.example.value + 17 + + +Boolean value of ``Enum`` classes and members +""""""""""""""""""""""""""""""""""""""""""""" + +Enum classes that are mixed with non-:class:`Enum` types (such as +:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in +type's rules; otherwise, all members evaluate as :data:`True`. To make your +own enum's boolean evaluation depend on the member's value add the following to +your class:: + + def __bool__(self): + return bool(self.value) + +Plain :class:`Enum` classes always evaluate as :data:`True`. + + +``Enum`` classes with methods +""""""""""""""""""""""""""""" + +If you give your enum subclass extra methods, like the `Planet`_ +class above, those methods will show up in a :func:`dir` of the member, +but not of the class:: + + >>> dir(Planet) + ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] + >>> dir(Planet.EARTH) + ['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] + + +Combining members of ``Flag`` +""""""""""""""""""""""""""""" + +Iterating over a combination of :class:`Flag` members will only return the members that +are comprised of a single bit:: + + >>> class Color(Flag): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + ... MAGENTA = RED | BLUE + ... YELLOW = RED | GREEN + ... CYAN = GREEN | BLUE + ... + >>> Color(3) # named combination + Color.YELLOW + >>> Color(7) # not named combination + Color.RED|Color.GREEN|Color.BLUE + +``StrEnum`` and :meth:`str.__str__` +""""""""""""""""""""""""""""""""""" + +An important difference between :class:`StrEnum` and other Enums is the +:meth:`__str__` method; because :class:`StrEnum` members are strings, some +parts of Python will read the string data directly, while others will call +:meth:`str()`. To make those two operations have the same result, +:meth:`StrEnum.__str__` will be the same as :meth:`str.__str__` so that +``str(StrEnum.member) == StrEnum.member`` is true. + +``Flag`` and ``IntFlag`` minutia +"""""""""""""""""""""""""""""""" + +Using the following snippet for our examples:: + + >>> class Color(IntFlag): + ... BLACK = 0 + ... RED = 1 + ... GREEN = 2 + ... BLUE = 4 + ... PURPLE = RED | BLUE + ... WHITE = RED | GREEN | BLUE + ... + +the following are true: + +- single-bit flags are canonical +- multi-bit and zero-bit flags are aliases +- only canonical flags are returned during iteration:: + + >>> list(Color.WHITE) + [Color.RED, Color.GREEN, Color.BLUE] + +- negating a flag or flag set returns a new flag/flag set with the + corresponding positive integer value:: + + >>> Color.BLUE + Color.BLUE + + >>> ~Color.BLUE + Color.RED|Color.GREEN + +- names of pseudo-flags are constructed from their members' names:: + + >>> (Color.RED | Color.GREEN).name + 'RED|GREEN' + +- multi-bit flags, aka aliases, can be returned from operations:: + + >>> Color.RED | Color.BLUE + Color.PURPLE + + >>> Color(7) # or Color(-1) + Color.WHITE + + >>> Color(0) + Color.BLACK + +- membership / containment checking has changed slightly -- zero valued flags + are never considered to be contained:: + + >>> Color.BLACK in Color.WHITE + False + + otherwise, if all bits of one flag are in the other flag, True is returned:: + + >>> Color.PURPLE in Color.WHITE + True + +There is a new boundary mechanism that controls how out-of-range / invalid +bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``: + + * STRICT --> raises an exception when presented with invalid values + * CONFORM --> discards any invalid bits + * EJECT --> lose Flag status and become a normal int with the given value + * KEEP --> keep the extra bits + - keeps Flag status and extra bits + - extra bits do not show up in iteration + - extra bits do show up in repr() and str() + +The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``EJECT``, +and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an +example of when ``KEEP`` is needed). + + +.. _enum-class-differences: + +How are Enums different? +------------------------ + +Enums have a custom metaclass that affects many aspects of both derived :class:`Enum` +classes and their instances (members). + + +Enum Classes +^^^^^^^^^^^^ + +The :class:`EnumType` metaclass is responsible for providing the +:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that +allow one to do things with an :class:`Enum` class that fail on a typical +class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumType` is +responsible for ensuring that various other methods on the final :class:`Enum` +class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`, +:meth:`__str__` and :meth:`__repr__`). + + +Enum Members (aka instances) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The most interesting thing about enum members is that they are singletons. +:class:`EnumType` creates them all while it is creating the enum class itself, +and then puts a custom :meth:`__new__` in place to ensure that no new ones are +ever instantiated by returning only the existing member instances. + + +.. _enum-cookbook: + + +While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and +:class:`IntFlag` are expected to cover the majority of use-cases, they cannot +cover them all. Here are recipes for some different types of enumerations +that can be used directly, or as examples for creating one's own. + + +Omitting values +^^^^^^^^^^^^^^^ + +In many use-cases one doesn't care what the actual value of an enumeration +is. There are several ways to define this type of simple enumeration: + +- use instances of :class:`auto` for the value +- use instances of :class:`object` as the value +- use a descriptive string as the value +- use a tuple as the value and a custom :meth:`__new__` to replace the + tuple with an :class:`int` value + +Using any of these methods signifies to the user that these values are not +important, and also enables one to add, remove, or reorder members without +having to renumber the remaining members. + + +Using :class:`auto` +""""""""""""""""""" + +Using :class:`auto` would look like:: + + >>> class Color(Enum): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> Color.GREEN + + + +Using :class:`object` +""""""""""""""""""""" + +Using :class:`object` would look like:: + + >>> class Color(Enum): + ... RED = object() + ... GREEN = object() + ... BLUE = object() + ... + >>> Color.GREEN + + + +Using a descriptive string +"""""""""""""""""""""""""" + +Using a string as the value would look like:: + + >>> class Color(Enum): + ... RED = 'stop' + ... GREEN = 'go' + ... BLUE = 'too fast!' + ... + >>> Color.GREEN + + >>> Color.GREEN.value + 'go' + + +Using a custom :meth:`__new__` +"""""""""""""""""""""""""""""" + +Using an auto-numbering :meth:`__new__` would look like:: + + >>> class AutoNumber(Enum): + ... def __new__(cls): + ... value = len(cls.__members__) + 1 + ... obj = object.__new__(cls) + ... obj._value_ = value + ... return obj + ... + >>> class Color(AutoNumber): + ... RED = () + ... GREEN = () + ... BLUE = () + ... + >>> Color.GREEN + + >>> Color.GREEN.value + 2 + +To make a more general purpose ``AutoNumber``, add ``*args`` to the signature:: + + >>> class AutoNumber(Enum): + ... def __new__(cls, *args): # this is the only change from above + ... value = len(cls.__members__) + 1 + ... obj = object.__new__(cls) + ... obj._value_ = value + ... return obj + ... + +Then when you inherit from ``AutoNumber`` you can write your own ``__init__`` +to handle any extra arguments:: + + >>> class Swatch(AutoNumber): + ... def __init__(self, pantone='unknown'): + ... self.pantone = pantone + ... AUBURN = '3497' + ... SEA_GREEN = '1246' + ... BLEACHED_CORAL = () # New color, no Pantone code yet! + ... + >>> Swatch.SEA_GREEN + + >>> Swatch.SEA_GREEN.pantone + '1246' + >>> Swatch.BLEACHED_CORAL.pantone + 'unknown' + +.. note:: + + The :meth:`__new__` method, if defined, is used during creation of the Enum + members; it is then replaced by Enum's :meth:`__new__` which is used after + class creation for lookup of existing members. + + +OrderedEnum +^^^^^^^^^^^ + +An ordered enumeration that is not based on :class:`IntEnum` and so maintains +the normal :class:`Enum` invariants (such as not being comparable to other +enumerations):: + + >>> class OrderedEnum(Enum): + ... def __ge__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value >= other.value + ... return NotImplemented + ... def __gt__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value > other.value + ... return NotImplemented + ... def __le__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value <= other.value + ... return NotImplemented + ... def __lt__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value < other.value + ... return NotImplemented + ... + >>> class Grade(OrderedEnum): + ... A = 5 + ... B = 4 + ... C = 3 + ... D = 2 + ... F = 1 + ... + >>> Grade.C < Grade.A + True + + +DuplicateFreeEnum +^^^^^^^^^^^^^^^^^ + +Raises an error if a duplicate member name is found instead of creating an +alias:: + + >>> class DuplicateFreeEnum(Enum): + ... def __init__(self, *args): + ... cls = self.__class__ + ... if any(self.value == e.value for e in cls): + ... a = self.name + ... e = cls(self.value).name + ... raise ValueError( + ... "aliases not allowed in DuplicateFreeEnum: %r --> %r" + ... % (a, e)) + ... + >>> class Color(DuplicateFreeEnum): + ... RED = 1 + ... GREEN = 2 + ... BLUE = 3 + ... GRENE = 2 + ... + Traceback (most recent call last): + ... + ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN' + +.. note:: + + This is a useful example for subclassing Enum to add or change other + behaviors as well as disallowing aliases. If the only desired change is + disallowing aliases, the :func:`unique` decorator can be used instead. + + +Planet +^^^^^^ + +If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member +will be passed to those methods:: + + >>> class Planet(Enum): + ... MERCURY = (3.303e+23, 2.4397e6) + ... VENUS = (4.869e+24, 6.0518e6) + ... EARTH = (5.976e+24, 6.37814e6) + ... MARS = (6.421e+23, 3.3972e6) + ... JUPITER = (1.9e+27, 7.1492e7) + ... SATURN = (5.688e+26, 6.0268e7) + ... URANUS = (8.686e+25, 2.5559e7) + ... NEPTUNE = (1.024e+26, 2.4746e7) + ... def __init__(self, mass, radius): + ... self.mass = mass # in kilograms + ... self.radius = radius # in meters + ... @property + ... def surface_gravity(self): + ... # universal gravitational constant (m3 kg-1 s-2) + ... G = 6.67300E-11 + ... return G * self.mass / (self.radius * self.radius) + ... + >>> Planet.EARTH.value + (5.976e+24, 6378140.0) + >>> Planet.EARTH.surface_gravity + 9.802652743337129 + +.. _enum-time-period: + +TimePeriod +^^^^^^^^^^ + +An example to show the :attr:`_ignore_` attribute in use:: + + >>> from datetime import timedelta + >>> class Period(timedelta, Enum): + ... "different lengths of time" + ... _ignore_ = 'Period i' + ... Period = vars() + ... for i in range(367): + ... Period['day_%d' % i] = i + ... + >>> list(Period)[:2] + [Period.day_0, Period.day_1] + >>> list(Period)[-2:] + [Period.day_365, Period.day_366] + + +Conforming input to Flag +^^^^^^^^^^^^^^^^^^^^^^^^ + +Creating a :class:`Flag` enum that is more resilient out-of-bounds results to +mathematical operations, you can use the :attr:`FlagBoundary.CONFORM` setting:: + + >>> from enum import Flag, CONFORM, auto + >>> class Weekday(Flag, boundary=CONFORM): + ... MONDAY = auto() + ... TUESDAY = auto() + ... WEDNESDAY = auto() + ... THURSDAY = auto() + ... FRIDAY = auto() + ... SATURDAY = auto() + ... SUNDAY = auto() + >>> today = Weekday.TUESDAY + >>> Weekday(today + 22) # what day is three weeks from tomorrow? + >>> Weekday.WEDNESDAY + + +.. _enumtype-examples: + +Subclassing EnumType +-------------------- + +While most enum needs can be met by customizing :class:`Enum` subclasses, +either with class decorators or custom functions, :class:`EnumType` can be +subclassed to provide a different Enum experience. + diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst index 593341cc2b8a1..e0dacd224d82e 100644 --- a/Doc/howto/index.rst +++ b/Doc/howto/index.rst @@ -17,6 +17,7 @@ Currently, the HOWTOs are: cporting.rst curses.rst descriptor.rst + enum.rst functional.rst logging.rst logging-cookbook.rst diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 73b77cbc671cd..3a6b2aa2c50cd 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -13,1368 +13,612 @@ **Source code:** :source:`Lib/enum.py` ----------------- - -An enumeration is a set of symbolic names (members) bound to unique, -constant values. Within an enumeration, the members can be compared -by identity, and the enumeration itself can be iterated over. - -.. note:: Case of Enum Members +.. sidebar:: Important - Because Enums are used to represent constants we recommend using - UPPER_CASE names for enum members, and will be using that style - in our examples. + This page contains the API reference information. For tutorial + information and discussion of more advanced topics, see + * :ref:`Basic Tutorial ` + * :ref:`Advanced Tutorial ` + * :ref:`Enum Cookbook ` -Module Contents ---------------- - -This module defines four enumeration classes that can be used to define unique -sets of names and values: :class:`Enum`, :class:`IntEnum`, :class:`Flag`, and -:class:`IntFlag`. It also defines one decorator, :func:`unique`, and one -helper, :class:`auto`. - -.. class:: Enum - - Base class for creating enumerated constants. See section - `Functional API`_ for an alternate construction syntax. - -.. class:: IntEnum - - Base class for creating enumerated constants that are also - subclasses of :class:`int`. - -.. class:: StrEnum - - Base class for creating enumerated constants that are also - subclasses of :class:`str`. - -.. class:: IntFlag - - Base class for creating enumerated constants that can be combined using - the bitwise operators without losing their :class:`IntFlag` membership. - :class:`IntFlag` members are also subclasses of :class:`int`. - -.. class:: Flag - - Base class for creating enumerated constants that can be combined using - the bitwise operations without losing their :class:`Flag` membership. - -.. function:: unique - :noindex: - - Enum class decorator that ensures only one name is bound to any one value. - -.. class:: auto - - Instances are replaced with an appropriate value for Enum members. - :class:`StrEnum` defaults to the lower-cased version of the member name, - while other Enums default to 1 and increase from there. - -.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto`` -.. versionadded:: 3.10 ``StrEnum`` - -Creating an Enum ---------------- -Enumerations are created using the :keyword:`class` syntax, which makes them -easy to read and write. An alternative creation method is described in -`Functional API`_. To define an enumeration, subclass :class:`Enum` as -follows:: - - >>> from enum import Enum - >>> class Color(Enum): - ... RED = 1 - ... GREEN = 2 - ... BLUE = 3 - ... - -.. note:: Enum member values - - Member values can be anything: :class:`int`, :class:`str`, etc.. If - the exact value is unimportant you may use :class:`auto` instances and an - appropriate value will be chosen for you. Care must be taken if you mix - :class:`auto` with other values. +An enumeration: -.. note:: Nomenclature - - - The class :class:`Color` is an *enumeration* (or *enum*) - - The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are - *enumeration members* (or *enum members*) and are functionally constants. - - The enum members have *names* and *values* (the name of - :attr:`Color.RED` is ``RED``, the value of :attr:`Color.BLUE` is - ``3``, etc.) - -.. note:: - - Even though we use the :keyword:`class` syntax to create Enums, Enums - are not normal Python classes. See `How are Enums different?`_ for - more details. - -Enumeration members have human readable string representations:: - - >>> print(Color.RED) - Color.RED - -...while their ``repr`` has more information:: - - >>> print(repr(Color.RED)) - - -The *type* of an enumeration member is the enumeration it belongs to:: - - >>> type(Color.RED) - - >>> isinstance(Color.GREEN, Color) - True - -Enum members also have a property that contains just their item name:: - - >>> print(Color.RED.name) - RED - -Enumerations support iteration, in definition order:: - - >>> class Shake(Enum): - ... VANILLA = 7 - ... CHOCOLATE = 4 - ... COOKIES = 9 - ... MINT = 3 - ... - >>> for shake in Shake: - ... print(shake) - ... - Shake.VANILLA - Shake.CHOCOLATE - Shake.COOKIES - Shake.MINT - -Enumeration members are hashable, so they can be used in dictionaries and sets:: - - >>> apples = {} - >>> apples[Color.RED] = 'red delicious' - >>> apples[Color.GREEN] = 'granny smith' - >>> apples == {Color.RED: 'red delicious', Color.GREEN: 'granny smith'} - True +* is a set of symbolic names (members) bound to unique values +* can be iterated over to return its members in definition order +* uses :meth:`call` syntax to return members by value +* uses :meth:`index` syntax to return members by name +Enumerations are created either by using the :keyword:`class` syntax, or by +using function-call syntax:: -Programmatic access to enumeration members and their attributes ---------------------------------------------------------------- + >>> from enum import Enum -Sometimes it's useful to access members in enumerations programmatically (i.e. -situations where ``Color.RED`` won't do because the exact color is not known -at program-writing time). ``Enum`` allows such access:: + >>> # class syntax + >>> class Color(Enum): + ... RED = 1 + ... GREEN = 2 + ... BLUE = 3 - >>> Color(1) - - >>> Color(3) - + >>> # functional syntax + >>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE']) -If you want to access enum members by *name*, use item access:: +Even though we can use the :keyword:`class` syntax to create Enums, Enums +are not normal Python classes. See +:ref:`How are Enums different? ` for more details. - >>> Color['RED'] - - >>> Color['GREEN'] - - -If you have an enum member and need its :attr:`name` or :attr:`value`:: - - >>> member = Color.RED - >>> member.name - 'RED' - >>> member.value - 1 - - -Duplicating enum members and values ------------------------------------ - -Having two enum members with the same name is invalid:: - - >>> class Shape(Enum): - ... SQUARE = 2 - ... SQUARE = 3 - ... - Traceback (most recent call last): - ... - TypeError: 'SQUARE' already defined as: 2 - -However, two enum members are allowed to have the same value. Given two members -A and B with the same value (and A defined first), B is an alias to A. By-value -lookup of the value of A and B will return A. By-name lookup of B will also -return A:: - - >>> class Shape(Enum): - ... SQUARE = 2 - ... DIAMOND = 1 - ... CIRCLE = 3 - ... ALIAS_FOR_SQUARE = 2 - ... - >>> Shape.SQUARE - - >>> Shape.ALIAS_FOR_SQUARE - - >>> Shape(2) - - -.. note:: - - Attempting to create a member with the same name as an already - defined attribute (another member, a method, etc.) or attempting to create - an attribute with the same name as a member is not allowed. - - -Ensuring unique enumeration values ----------------------------------- - -By default, enumerations allow multiple names as aliases for the same value. -When this behavior isn't desired, the following decorator can be used to -ensure each value is used only once in the enumeration: - -.. decorator:: unique - -A :keyword:`class` decorator specifically for enumerations. It searches an -enumeration's :attr:`__members__` gathering any aliases it finds; if any are -found :exc:`ValueError` is raised with the details:: - - >>> from enum import Enum, unique - >>> @unique - ... class Mistake(Enum): - ... ONE = 1 - ... TWO = 2 - ... THREE = 3 - ... FOUR = 3 - ... - Traceback (most recent call last): - ... - ValueError: duplicate values found in : FOUR -> THREE - - -Using automatic values ----------------------- - -If the exact value is unimportant you can use :class:`auto`:: - - >>> from enum import Enum, auto - >>> class Color(Enum): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> list(Color) - [, , ] - -The values are chosen by :func:`_generate_next_value_`, which can be -overridden:: - - >>> class AutoName(Enum): - ... def _generate_next_value_(name, start, count, last_values): - ... return name - ... - >>> class Ordinal(AutoName): - ... NORTH = auto() - ... SOUTH = auto() - ... EAST = auto() - ... WEST = auto() - ... - >>> list(Ordinal) - [, , , ] - -.. note:: - - The goal of the default :meth:`_generate_next_value_` method is to provide - the next :class:`int` in sequence with the last :class:`int` provided, but - the way it does this is an implementation detail and may change. - -.. note:: - - The :meth:`_generate_next_value_` method must be defined before any members. - -Iteration ---------- - -Iterating over the members of an enum does not provide the aliases:: - - >>> list(Shape) - [, , ] - -The special attribute ``__members__`` is a read-only ordered mapping of names -to members. It includes all names defined in the enumeration, including the -aliases:: - - >>> for name, member in Shape.__members__.items(): - ... name, member - ... - ('SQUARE', ) - ('DIAMOND', ) - ('CIRCLE', ) - ('ALIAS_FOR_SQUARE', ) - -The ``__members__`` attribute can be used for detailed programmatic access to -the enumeration members. For example, finding all the aliases:: - - >>> [name for name, member in Shape.__members__.items() if member.name != name] - ['ALIAS_FOR_SQUARE'] +.. note:: Nomenclature + - The class :class:`Color` is an *enumeration* (or *enum*) + - The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are + *enumeration members* (or *enum members*) and are functionally constants. + - The enum members have *names* and *values* (the name of + :attr:`Color.RED` is ``RED``, the value of :attr:`Color.BLUE` is + ``3``, etc.) -Comparisons ------------ -Enumeration members are compared by identity:: +Module Contents +--------------- - >>> Color.RED is Color.RED - True - >>> Color.RED is Color.BLUE - False - >>> Color.RED is not Color.BLUE - True + :class:`EnumType` -Ordered comparisons between enumeration values are *not* supported. Enum -members are not integers (but see `IntEnum`_ below):: - - >>> Color.RED < Color.BLUE - Traceback (most recent call last): - File "", line 1, in - TypeError: '<' not supported between instances of 'Color' and 'Color' - -Equality comparisons are defined though:: - - >>> Color.BLUE == Color.RED - False - >>> Color.BLUE != Color.RED - True - >>> Color.BLUE == Color.BLUE - True + The ``type`` for Enum and its subclasses. -Comparisons against non-enumeration values will always compare not equal -(again, :class:`IntEnum` was explicitly designed to behave differently, see -below):: + :class:`Enum` - >>> Color.BLUE == 2 - False + Base class for creating enumerated constants. + :class:`IntEnum` -Allowed members and attributes of enumerations ----------------------------------------------- + Base class for creating enumerated constants that are also + subclasses of :class:`int`. -The examples above use integers for enumeration values. Using integers is -short and handy (and provided by default by the `Functional API`_), but not -strictly enforced. In the vast majority of use-cases, one doesn't care what -the actual value of an enumeration is. But if the value *is* important, -enumerations can have arbitrary values. + :class:`StrEnum` -Enumerations are Python classes, and can have methods and special methods as -usual. If we have this enumeration:: + Base class for creating enumerated constants that are also + subclasses of :class:`str`. - >>> class Mood(Enum): - ... FUNKY = 1 - ... HAPPY = 3 - ... - ... def describe(self): - ... # self is the member here - ... return self.name, self.value - ... - ... def __str__(self): - ... return 'my custom str! {0}'.format(self.value) - ... - ... @classmethod - ... def favorite_mood(cls): - ... # cls here is the enumeration - ... return cls.HAPPY - ... + :class:`Flag` -Then:: + Base class for creating enumerated constants that can be combined using + the bitwise operations without losing their :class:`Flag` membership. - >>> Mood.favorite_mood() - - >>> Mood.HAPPY.describe() - ('HAPPY', 3) - >>> str(Mood.FUNKY) - 'my custom str! 1' - -The rules for what is allowed are as follows: names that start and end with -a single underscore are reserved by enum and cannot be used; all other -attributes defined within an enumeration will become members of this -enumeration, with the exception of special methods (:meth:`__str__`, -:meth:`__add__`, etc.), descriptors (methods are also descriptors), and -variable names listed in :attr:`_ignore_`. - -Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then -any value(s) given to the enum member will be passed into those methods. -See `Planet`_ for an example. - - -Restricted Enum subclassing ---------------------------- - -A new :class:`Enum` class must have one base Enum class, up to one concrete -data type, and as many :class:`object`-based mixin classes as needed. The -order of these base classes is:: - - class EnumName([mix-in, ...,] [data-type,] base-enum): - pass - -Also, subclassing an enumeration is allowed only if the enumeration does not define -any members. So this is forbidden:: - - >>> class MoreColor(Color): - ... PINK = 17 - ... - Traceback (most recent call last): - ... - TypeError: MoreColor: cannot extend enumeration 'Color' - -But this is allowed:: - - >>> class Foo(Enum): - ... def some_behavior(self): - ... pass - ... - >>> class Bar(Foo): - ... HAPPY = 1 - ... SAD = 2 - ... - -Allowing subclassing of enums that define members would lead to a violation of -some important invariants of types and instances. On the other hand, it makes -sense to allow sharing some common behavior between a group of enumerations. -(See `OrderedEnum`_ for an example.) - - -Pickling --------- - -Enumerations can be pickled and unpickled:: - - >>> from test.test_enum import Fruit - >>> from pickle import dumps, loads - >>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO)) - True - -The usual restrictions for pickling apply: picklable enums must be defined in -the top level of a module, since unpickling requires them to be importable -from that module. + :class:`IntFlag` -.. note:: + Base class for creating enumerated constants that can be combined using + the bitwise operators without losing their :class:`IntFlag` membership. + :class:`IntFlag` members are also subclasses of :class:`int`. - With pickle protocol version 4 it is possible to easily pickle enums - nested in other classes. + :class:`FlagBoundary` -It is possible to modify how Enum members are pickled/unpickled by defining -:meth:`__reduce_ex__` in the enumeration class. + An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and + ``KEEP`` which allows for more fine-grained control over how invalid values + are dealt with in an enumeration. + :class:`auto` -Functional API --------------- + Instances are replaced with an appropriate value for Enum members. + :class:`StrEnum` defaults to the lower-cased version of the member name, + while other Enums default to 1 and increase from there. -The :class:`Enum` class is callable, providing the following functional API:: + :func:`global_enum` - >>> Animal = Enum('Animal', 'ANT BEE CAT DOG') - >>> Animal - - >>> Animal.ANT - - >>> Animal.ANT.value - 1 - >>> list(Animal) - [, , , ] + :class:`Enum` class decorator to apply the appropriate global `__repr__`, + and export its members into the global name space. -The semantics of this API resemble :class:`~collections.namedtuple`. The first -argument of the call to :class:`Enum` is the name of the enumeration. + :func:`property` -The second argument is the *source* of enumeration member names. It can be a -whitespace-separated string of names, a sequence of names, a sequence of -2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to -values. The last two options enable assigning arbitrary values to -enumerations; the others auto-assign increasing integers starting with 1 (use -the ``start`` parameter to specify a different starting value). A -new class derived from :class:`Enum` is returned. In other words, the above -assignment to :class:`Animal` is equivalent to:: + Allows :class:`Enum` members to have attributes without conflicting with + other members' names. - >>> class Animal(Enum): - ... ANT = 1 - ... BEE = 2 - ... CAT = 3 - ... DOG = 4 - ... + :func:`unique` -The reason for defaulting to ``1`` as the starting number and not ``0`` is -that ``0`` is ``False`` in a boolean sense, but enum members all evaluate -to ``True``. + Enum class decorator that ensures only one name is bound to any one value. -Pickling enums created with the functional API can be tricky as frame stack -implementation details are used to try and figure out which module the -enumeration is being created in (e.g. it will fail if you use a utility -function in separate module, and also may not work on IronPython or Jython). -The solution is to specify the module name explicitly as follows:: - >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__) +.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto`` +.. versionadded:: 3.10 ``StrEnum`` -.. warning:: - If ``module`` is not supplied, and Enum cannot determine what it is, - the new Enum members will not be unpicklable; to keep errors closer to - the source, pickling will be disabled. +Data Types +---------- -The new pickle protocol 4 also, in some circumstances, relies on -:attr:`~definition.__qualname__` being set to the location where pickle will be able -to find the class. For example, if the class was made available in class -SomeData in the global scope:: - >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal') +.. class:: EnumType -The complete signature is:: + *EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible + to subclass *EnumType* -- see :ref:`Subclassing EnumType ` + for details. - Enum(value='NewEnumName', names=<...>, *, module='...', qualname='...', type=, start=1) + .. method:: EnumType.__contains__(cls, member) -:value: What the new Enum class will record as its name. + Returns ``True`` if member belongs to the ``cls``:: -:names: The Enum members. This can be a whitespace or comma separated string - (values will start at 1 unless otherwise specified):: + >>> some_var = Color.RED + >>> some_var in Color + True - 'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE' + .. method:: EnumType.__dir__(cls) - or an iterator of names:: + Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the + names of the members in *cls*:: - ['RED', 'GREEN', 'BLUE'] + >>> dir(Color) + ['BLUE', 'GREEN', 'RED', '__class__', '__doc__', '__members__', '__module__'] - or an iterator of (name, value) pairs:: + .. method:: EnumType.__getattr__(cls, name) - [('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)] + Returns the Enum member in *cls* matching *name*, or raises an :exc:`AttributeError`:: - or a mapping:: + >>> Color.GREEN + Color.GREEN - {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42} + .. method:: EnumType.__getitem__(cls, name) -:module: name of module where new Enum class can be found. + Returns the Enum member in *cls* matching *name*, or raises an :exc:`KeyError`:: -:qualname: where in module new Enum class can be found. + >>> Color['BLUE'] + Color.BLUE -:type: type to mix in to new Enum class. + .. method:: EnumType.__iter__(cls) -:start: number to start counting at if only names are passed in. + Returns each member in *cls* in definition order:: -.. versionchanged:: 3.5 - The *start* parameter was added. + >>> list(Color) + [Color.RED, Color.GREEN, Color.BLUE] + .. method:: EnumType.__len__(cls) -Derived Enumerations --------------------- + Returns the number of member in *cls*:: -IntEnum -^^^^^^^ + >>> len(Color) + 3 -The first variation of :class:`Enum` that is provided is also a subclass of -:class:`int`. Members of an :class:`IntEnum` can be compared to integers; -by extension, integer enumerations of different types can also be compared -to each other:: + .. method:: EnumType.__reversed__(cls) - >>> from enum import IntEnum - >>> class Shape(IntEnum): - ... CIRCLE = 1 - ... SQUARE = 2 - ... - >>> class Request(IntEnum): - ... POST = 1 - ... GET = 2 - ... - >>> Shape == 1 - False - >>> Shape.CIRCLE == 1 - True - >>> Shape.CIRCLE == Request.POST - True + Returns each member in *cls* in reverse definition order:: -However, they still can't be compared to standard :class:`Enum` enumerations:: + >>> list(reversed(Color)) + [Color.BLUE, Color.GREEN, Color.RED] - >>> class Shape(IntEnum): - ... CIRCLE = 1 - ... SQUARE = 2 - ... - >>> class Color(Enum): - ... RED = 1 - ... GREEN = 2 - ... - >>> Shape.CIRCLE == Color.RED - False -:class:`IntEnum` values behave like integers in other ways you'd expect:: +.. class:: Enum - >>> int(Shape.CIRCLE) - 1 - >>> ['a', 'b', 'c'][Shape.CIRCLE] - 'b' - >>> [i for i in range(Shape.SQUARE)] - [0, 1] + *Enum* is the base class for all *enum* enumerations. + .. attribute:: Enum.name -StrEnum -^^^^^^^ + The name used to define the ``Enum`` member:: -The second variation of :class:`Enum` that is provided is also a subclass of -:class:`str`. Members of a :class:`StrEnum` can be compared to strings; -by extension, string enumerations of different types can also be compared -to each other. :class:`StrEnum` exists to help avoid the problem of getting -an incorrect member:: + >>> Color.BLUE.name + 'BLUE' - >>> from enum import StrEnum - >>> class Directions(StrEnum): - ... NORTH = 'north', # notice the trailing comma - ... SOUTH = 'south' + .. attribute:: Enum.value -Before :class:`StrEnum`, ``Directions.NORTH`` would have been the :class:`tuple` -``('north',)``. + The value given to the ``Enum`` member:: -.. note:: + >>> Color.RED.value + 1 - Unlike other Enum's, ``str(StrEnum.member)`` will return the value of the - member instead of the usual ``"EnumClass.member"``. + .. note:: Enum member values -.. versionadded:: 3.10 + Member values can be anything: :class:`int`, :class:`str`, etc.. If + the exact value is unimportant you may use :class:`auto` instances and an + appropriate value will be chosen for you. Care must be taken if you mix + :class:`auto` with other values. + .. attribute:: Enum._ignore_ -IntFlag -^^^^^^^ + ``_ignore_`` is only used during creation and is removed from the + enumeration once that is complete. -The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based -on :class:`int`. The difference being :class:`IntFlag` members can be combined -using the bitwise operators (&, \|, ^, ~) and the result is still an -:class:`IntFlag` member, if possible. However, as the name implies, :class:`IntFlag` -members also subclass :class:`int` and can be used wherever an :class:`int` is -used. + ``_ignore_`` is a list of names that will not become members, and whose + names will also be removed from the completed enumeration. See + :ref:`TimePeriod ` for an example. -.. note:: + .. method:: Enum.__call__(cls, value, names=None, \*, module=None, qualname=None, type=None, start=1, boundary=None) - Any operation on an :class:`IntFlag` member besides the bit-wise operations will - lose the :class:`IntFlag` membership. + This method is called in two different ways: -.. note:: + * to look up an existing member: - Bit-wise operations that result in invalid :class:`IntFlag` values will lose the - :class:`IntFlag` membership. - -.. versionadded:: 3.6 -.. versionchanged:: 3.10 - -Sample :class:`IntFlag` class:: - - >>> from enum import IntFlag - >>> class Perm(IntFlag): - ... R = 4 - ... W = 2 - ... X = 1 - ... - >>> Perm.R | Perm.W - - >>> Perm.R + Perm.W - 6 - >>> RW = Perm.R | Perm.W - >>> Perm.R in RW - True - -It is also possible to name the combinations:: - - >>> class Perm(IntFlag): - ... R = 4 - ... W = 2 - ... X = 1 - ... RWX = 7 - >>> Perm.RWX - - >>> ~Perm.RWX - - >>> Perm(7) - + :cls: The enum class being called. + :value: The value to lookup. + + * to use the ``cls`` enum to create a new enum: + + :cls: The enum class being called. + :value: The name of the new Enum to create. + :names: The names/values of the members for the new Enum. + :module: The name of the module the new Enum is created in. + :qualname: The actual location in the module where this Enum can be found. + :type: A mix-in type for the new Enum. + :start: The first integer value for the Enum (used by :class:`auto`) + :boundary: How to handle out-of-range values from bit operations (:class:`Flag` only) + + .. method:: Enum.__dir__(self) + + Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and + any public methods defined on *self.__class__*:: + + >>> from datetime import date + >>> class Weekday(Enum): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 3 + ... THURSDAY = 4 + ... FRIDAY = 5 + ... SATURDAY = 6 + ... SUNDAY = 7 + ... @classmethod + ... def today(cls): + ... print('today is %s' % cls(date.today.isoweekday).naem) + >>> dir(Weekday.SATURDAY) + ['__class__', '__doc__', '__module__', 'name', 'today', 'value'] + + .. method:: Enum._generate_next_value_(name, start, count, last_values) + + :name: The name of the member being defined (e.g. 'RED'). + :start: The start value for the Enum; the default is 1. + :count: The number of members currently defined, not including this one. + :last_values: A list of the previous values. + + A *staticmethod* that is used to determine the next value returned by + :class:`auto`:: + + >>> from enum import auto + >>> class PowersOfThree(Enum): + ... @staticmethod + ... def _generate_next_value_(name, start, count, last_values): + ... return (count + 1) * 3 + ... FIRST = auto() + ... SECOND = auto() + >>> PowersOfThree.SECOND.value + 6 + + .. method:: Enum._missing_(cls, value) + + A *classmethod* for looking up values not found in *cls*. By default it + does nothing, but can be overridden to implement custom search behavior:: + + >>> from enum import StrEnum + >>> class Build(StrEnum): + ... DEBUG = auto() + ... OPTIMIZED = auto() + ... @classmethod + ... def _missing_(cls, value): + ... value = value.lower() + ... for member in cls: + ... if member.value == value: + ... return member + ... return None + >>> Build.DEBUG.value + 'debug' + >>> Build('deBUG') + Build.DEBUG + + .. method:: Enum.__repr__(self) + + Returns the string used for *repr()* calls. By default, returns the + *Enum* name and the member name, but can be overridden:: + + >>> class OldStyle(Enum): + ... RETRO = auto() + ... OLD_SCHOOl = auto() + ... YESTERYEAR = auto() + ... def __repr__(self): + ... cls_name = self.__class__.__name__ + ... return f'<{cls_name}.{self.name}: {self.value}>' + >>> OldStyle.RETRO + + + .. method:: Enum.__str__(self) + + Returns the string used for *str()* calls. By default, returns the + member name, but can be overridden:: + + >>> class OldStyle(Enum): + ... RETRO = auto() + ... OLD_SCHOOl = auto() + ... YESTERYEAR = auto() + ... def __str__(self): + ... cls_name = self.__class__.__name__ + ... return f'{cls_name}.{self.name}' + >>> OldStyle.RETRO + OldStyle.RETRO .. note:: - Named combinations are considered aliases. Aliases do not show up during - iteration, but can be returned from by-value lookups. - -.. versionchanged:: 3.10 - -Another important difference between :class:`IntFlag` and :class:`Enum` is that -if no flags are set (the value is 0), its boolean evaluation is :data:`False`:: - - >>> Perm.R & Perm.X - - >>> bool(Perm.R & Perm.X) - False + Using :class:`auto` with :class:`Enum` results in integers of increasing value, + starting with ``1``. -Because :class:`IntFlag` members are also subclasses of :class:`int` they can -be combined with them (but may lose :class:`IntFlag` membership:: - >>> Perm.X | 4 - +.. class:: IntEnum - >>> Perm.X | 8 - 9 + *IntEnum* is the same as *Enum*, but its members are also integers and can be + used anywhere that an integer can be used. If any integer operation is performed + with an *IntEnum* member, the resulting value loses its enumeration status. + + >>> from enum import IntEnum + >>> class Numbers(IntEnum): + ... ONE = 1 + ... TWO = 2 + ... THREE = 3 + >>> Numbers.THREE + Numbers.THREE + >>> Numbers.ONE + Numbers.TWO + 3 + >>> Numbers.THREE + 5 + 8 + >>> Numbers.THREE == 3 + True .. note:: - The negation operator, ``~``, always returns an :class:`IntFlag` member with a - positive value:: - - >>> (~Perm.X).value == (Perm.R|Perm.W).value == 6 - True - -:class:`IntFlag` members can also be iterated over:: - - >>> list(RW) - [, ] - -.. versionadded:: 3.10 - - -Flag -^^^^ + Using :class:`auto` with :class:`IntEnum` results in integers of increasing value, + starting with ``1``. -The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` -members can be combined using the bitwise operators (&, \|, ^, ~). Unlike -:class:`IntFlag`, they cannot be combined with, nor compared against, any -other :class:`Flag` enumeration, nor :class:`int`. While it is possible to -specify the values directly it is recommended to use :class:`auto` as the -value and let :class:`Flag` select an appropriate value. -.. versionadded:: 3.6 - -Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no -flags being set, the boolean evaluation is :data:`False`:: - - >>> from enum import Flag, auto - >>> class Color(Flag): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> Color.RED & Color.GREEN - - >>> bool(Color.RED & Color.GREEN) - False - -Individual flags should have values that are powers of two (1, 2, 4, 8, ...), -while combinations of flags won't:: - - >>> class Color(Flag): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... WHITE = RED | BLUE | GREEN - ... - >>> Color.WHITE - - -Giving a name to the "no flags set" condition does not change its boolean -value:: - - >>> class Color(Flag): - ... BLACK = 0 - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> Color.BLACK - - >>> bool(Color.BLACK) - False - -:class:`Flag` members can also be iterated over:: - - >>> purple = Color.RED | Color.BLUE - >>> list(purple) - [, ] - -.. versionadded:: 3.10 - -.. note:: +.. class:: StrEnum - For the majority of new code, :class:`Enum` and :class:`Flag` are strongly - recommended, since :class:`IntEnum` and :class:`IntFlag` break some - semantic promises of an enumeration (by being comparable to integers, and - thus by transitivity to other unrelated enumerations). :class:`IntEnum` - and :class:`IntFlag` should be used only in cases where :class:`Enum` and - :class:`Flag` will not do; for example, when integer constants are replaced - with enumerations, or for interoperability with other systems. - - -Others -^^^^^^ - -While :class:`IntEnum` is part of the :mod:`enum` module, it would be very -simple to implement independently:: - - class IntEnum(int, Enum): - pass - -This demonstrates how similar derived enumerations can be defined; for example -a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`. - -Some rules: - -1. When subclassing :class:`Enum`, mix-in types must appear before - :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum` - example above. -2. While :class:`Enum` can have members of any type, once you mix in an - additional type, all the members must have values of that type, e.g. - :class:`int` above. This restriction does not apply to mix-ins which only - add methods and don't specify another type. -3. When another data type is mixed in, the :attr:`value` attribute is *not the - same* as the enum member itself, although it is equivalent and will compare - equal. -4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's - :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as - `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type. -5. :ref:`Formatted string literals `, :meth:`str.format`, - and :func:`format` will use the mixed-in type's :meth:`__format__` - unless :meth:`__str__` or :meth:`__format__` is overridden in the subclass, - in which case the overridden methods or :class:`Enum` methods will be used. - Use the !s and !r format codes to force usage of the :class:`Enum` class's - :meth:`__str__` and :meth:`__repr__` methods. - -When to use :meth:`__new__` vs. :meth:`__init__` ------------------------------------------------- - -:meth:`__new__` must be used whenever you want to customize the actual value of -the :class:`Enum` member. Any other modifications may go in either -:meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred. - -For example, if you want to pass several items to the constructor, but only -want one of them to be the value:: - - >>> class Coordinate(bytes, Enum): - ... """ - ... Coordinate with binary codes that can be indexed by the int code. - ... """ - ... def __new__(cls, value, label, unit): - ... obj = bytes.__new__(cls, [value]) - ... obj._value_ = value - ... obj.label = label - ... obj.unit = unit - ... return obj - ... PX = (0, 'P.X', 'km') - ... PY = (1, 'P.Y', 'km') - ... VX = (2, 'V.X', 'km/s') - ... VY = (3, 'V.Y', 'km/s') - ... - - >>> print(Coordinate['PY']) - Coordinate.PY - - >>> print(Coordinate(3)) - Coordinate.VY - -Interesting examples --------------------- - -While :class:`Enum`, :class:`IntEnum`, :class:`IntFlag`, and :class:`Flag` are -expected to cover the majority of use-cases, they cannot cover them all. Here -are recipes for some different types of enumerations that can be used directly, -or as examples for creating one's own. - - -Omitting values -^^^^^^^^^^^^^^^ - -In many use-cases one doesn't care what the actual value of an enumeration -is. There are several ways to define this type of simple enumeration: - -- use instances of :class:`auto` for the value -- use instances of :class:`object` as the value -- use a descriptive string as the value -- use a tuple as the value and a custom :meth:`__new__` to replace the - tuple with an :class:`int` value - -Using any of these methods signifies to the user that these values are not -important, and also enables one to add, remove, or reorder members without -having to renumber the remaining members. - -Whichever method you choose, you should provide a :meth:`repr` that also hides -the (unimportant) value:: - - >>> class NoValue(Enum): - ... def __repr__(self): - ... return '<%s.%s>' % (self.__class__.__name__, self.name) - ... - - -Using :class:`auto` -""""""""""""""""""" - -Using :class:`auto` would look like:: - - >>> class Color(NoValue): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> Color.GREEN - - - -Using :class:`object` -""""""""""""""""""""" - -Using :class:`object` would look like:: - - >>> class Color(NoValue): - ... RED = object() - ... GREEN = object() - ... BLUE = object() - ... - >>> Color.GREEN - - - -Using a descriptive string -"""""""""""""""""""""""""" - -Using a string as the value would look like:: - - >>> class Color(NoValue): - ... RED = 'stop' - ... GREEN = 'go' - ... BLUE = 'too fast!' - ... - >>> Color.GREEN - - >>> Color.GREEN.value - 'go' - - -Using a custom :meth:`__new__` -"""""""""""""""""""""""""""""" - -Using an auto-numbering :meth:`__new__` would look like:: - - >>> class AutoNumber(NoValue): - ... def __new__(cls): - ... value = len(cls.__members__) + 1 - ... obj = object.__new__(cls) - ... obj._value_ = value - ... return obj - ... - >>> class Color(AutoNumber): - ... RED = () - ... GREEN = () - ... BLUE = () - ... - >>> Color.GREEN - - >>> Color.GREEN.value - 2 - -To make a more general purpose ``AutoNumber``, add ``*args`` to the signature:: - - >>> class AutoNumber(NoValue): - ... def __new__(cls, *args): # this is the only change from above - ... value = len(cls.__members__) + 1 - ... obj = object.__new__(cls) - ... obj._value_ = value - ... return obj - ... - -Then when you inherit from ``AutoNumber`` you can write your own ``__init__`` -to handle any extra arguments:: - - >>> class Swatch(AutoNumber): - ... def __init__(self, pantone='unknown'): - ... self.pantone = pantone - ... AUBURN = '3497' - ... SEA_GREEN = '1246' - ... BLEACHED_CORAL = () # New color, no Pantone code yet! - ... - >>> Swatch.SEA_GREEN - - >>> Swatch.SEA_GREEN.pantone - '1246' - >>> Swatch.BLEACHED_CORAL.pantone - 'unknown' + *StrEnum* is the same as *Enum*, but its members are also strings and can be used + in most of the same places that a string can be used. The result of any string + operation performed on or with a *StrEnum* member is not part of the enumeration. -.. note:: + .. note:: There are places in the stdlib that check for an exact :class:`str` + instead of a :class:`str` subclass (i.e. ``type(unknown) == str`` + instead of ``isinstance(str, unknown)``), and in those locations you + will need to use ``str(StrEnum.member)``. - The :meth:`__new__` method, if defined, is used during creation of the Enum - members; it is then replaced by Enum's :meth:`__new__` which is used after - class creation for lookup of existing members. - - -OrderedEnum -^^^^^^^^^^^ - -An ordered enumeration that is not based on :class:`IntEnum` and so maintains -the normal :class:`Enum` invariants (such as not being comparable to other -enumerations):: - - >>> class OrderedEnum(Enum): - ... def __ge__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value >= other.value - ... return NotImplemented - ... def __gt__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value > other.value - ... return NotImplemented - ... def __le__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value <= other.value - ... return NotImplemented - ... def __lt__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value < other.value - ... return NotImplemented - ... - >>> class Grade(OrderedEnum): - ... A = 5 - ... B = 4 - ... C = 3 - ... D = 2 - ... F = 1 - ... - >>> Grade.C < Grade.A - True - - -DuplicateFreeEnum -^^^^^^^^^^^^^^^^^ - -Raises an error if a duplicate member name is found instead of creating an -alias:: - - >>> class DuplicateFreeEnum(Enum): - ... def __init__(self, *args): - ... cls = self.__class__ - ... if any(self.value == e.value for e in cls): - ... a = self.name - ... e = cls(self.value).name - ... raise ValueError( - ... "aliases not allowed in DuplicateFreeEnum: %r --> %r" - ... % (a, e)) - ... - >>> class Color(DuplicateFreeEnum): - ... RED = 1 - ... GREEN = 2 - ... BLUE = 3 - ... GRENE = 2 - ... - Traceback (most recent call last): - ... - ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN' .. note:: - This is a useful example for subclassing Enum to add or change other - behaviors as well as disallowing aliases. If the only desired change is - disallowing aliases, the :func:`unique` decorator can be used instead. - - -Planet -^^^^^^ - -If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member -will be passed to those methods:: - - >>> class Planet(Enum): - ... MERCURY = (3.303e+23, 2.4397e6) - ... VENUS = (4.869e+24, 6.0518e6) - ... EARTH = (5.976e+24, 6.37814e6) - ... MARS = (6.421e+23, 3.3972e6) - ... JUPITER = (1.9e+27, 7.1492e7) - ... SATURN = (5.688e+26, 6.0268e7) - ... URANUS = (8.686e+25, 2.5559e7) - ... NEPTUNE = (1.024e+26, 2.4746e7) - ... def __init__(self, mass, radius): - ... self.mass = mass # in kilograms - ... self.radius = radius # in meters - ... @property - ... def surface_gravity(self): - ... # universal gravitational constant (m3 kg-1 s-2) - ... G = 6.67300E-11 - ... return G * self.mass / (self.radius * self.radius) - ... - >>> Planet.EARTH.value - (5.976e+24, 6378140.0) - >>> Planet.EARTH.surface_gravity - 9.802652743337129 + Using :class:`auto` with :class:`StrEnum` results in values of the member name, + lower-cased. -TimePeriod -^^^^^^^^^^ +.. class:: Flag -An example to show the :attr:`_ignore_` attribute in use:: + *Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), + ``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are members + of the enumeration. - >>> from datetime import timedelta - >>> class Period(timedelta, Enum): - ... "different lengths of time" - ... _ignore_ = 'Period i' - ... Period = vars() - ... for i in range(367): - ... Period['day_%d' % i] = i - ... - >>> list(Period)[:2] - [, ] - >>> list(Period)[-2:] - [, ] + .. method:: __contains__(self, value) + Returns *True* if value is in self:: -How are Enums different? ------------------------- + >>> from enum import Flag, auto + >>> class Color(Flag): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> purple = Color.RED | Color.BLUE + >>> white = Color.RED | Color.GREEN | Color.BLUE + >>> Color.GREEN in purple + False + >>> Color.GREEN in white + True + >>> purple in white + True + >>> white in purple + False -Enums have a custom metaclass that affects many aspects of both derived Enum -classes and their instances (members). + .. method:: __iter__(self): + Returns all contained members:: -Enum Classes -^^^^^^^^^^^^ + >>> list(Color.RED) + [Color.RED] + >>> list(purple) + [Color.RED, Color.BLUE] -The :class:`EnumMeta` metaclass is responsible for providing the -:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that -allow one to do things with an :class:`Enum` class that fail on a typical -class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumMeta` is -responsible for ensuring that various other methods on the final :class:`Enum` -class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`, -:meth:`__str__` and :meth:`__repr__`). + .. method:: __len__(self): + Returns number of members in flag:: -Enum Members (aka instances) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + >>> len(Color.GREEN) + 1 + >>> len(white) + 3 -The most interesting thing about Enum members is that they are singletons. -:class:`EnumMeta` creates them all while it is creating the :class:`Enum` -class itself, and then puts a custom :meth:`__new__` in place to ensure -that no new ones are ever instantiated by returning only the existing -member instances. + .. method:: __bool__(self): + Returns *True* if any members in flag, *False* otherwise:: -Finer Points -^^^^^^^^^^^^ + >>> bool(Color.GREEN) + True + >>> bool(white) + True + >>> black = Color(0) + >>> bool(black) + False -Supported ``__dunder__`` names -"""""""""""""""""""""""""""""" + .. method:: __or__(self, other) -:attr:`__members__` is a read-only ordered mapping of ``member_name``:``member`` -items. It is only available on the class. + Returns current flag binary or'ed with other:: -:meth:`__new__`, if specified, must create and return the enum members; it is -also a very good idea to set the member's :attr:`_value_` appropriately. Once -all the members are created it is no longer used. + >>> Color.RED | Color.GREEN + Color.RED|Color.GREEN + .. method:: __and__(self, other) -Supported ``_sunder_`` names -"""""""""""""""""""""""""""" + Returns current flag binary and'ed with other:: -- ``_name_`` -- name of the member -- ``_value_`` -- value of the member; can be set / modified in ``__new__`` - -- ``_missing_`` -- a lookup function used when a value is not found; may be - overridden -- ``_ignore_`` -- a list of names, either as a :class:`list` or a :class:`str`, - that will not be transformed into members, and will be removed from the final - class -- ``_order_`` -- used in Python 2/3 code to ensure member order is consistent - (class attribute, removed during class creation) -- ``_generate_next_value_`` -- used by the `Functional API`_ and by - :class:`auto` to get an appropriate value for an enum member; may be - overridden + >>> purple & white + Color.RED|Color.BLUE + >>> purple & Color.GREEN + 0x0 -.. note:: + .. method:: __xor__(self, other) - For standard :class:`Enum` classes the next value chosen is the last value seen - incremented by one. + Returns current flag binary xor'ed with other:: - For :class:`Flag`-type classes the next value chosen will be the next highest - power-of-two, regardless of the last value seen. + >>> purple ^ white + Color.GREEN + >>> purple ^ Color.GREEN + Color.RED|Color.GREEN|Color.BLUE -.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_`` -.. versionadded:: 3.7 ``_ignore_`` + .. method:: __invert__(self): -To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute can -be provided. It will be checked against the actual order of the enumeration -and raise an error if the two do not match:: + Returns all the flags in *type(self)* that are not in self:: - >>> class Color(Enum): - ... _order_ = 'RED GREEN BLUE' - ... RED = 1 - ... BLUE = 3 - ... GREEN = 2 - ... - Traceback (most recent call last): - ... - TypeError: member order does not match _order_: - ['RED', 'BLUE', 'GREEN'] - ['RED', 'GREEN', 'BLUE'] + >>> ~white + 0x0 + >>> ~purple + Color.GREEN + >>> ~Color.RED + Color.GREEN|Color.BLUE .. note:: - In Python 2 code the :attr:`_order_` attribute is necessary as definition - order is lost before it can be recorded. - - -_Private__names -""""""""""""""" - -Private names are not converted to Enum members, but remain normal attributes. - -.. versionchanged:: 3.10 - - -``Enum`` member type -"""""""""""""""""""" + Using :class:`auto` with :class:`Flag` results in integers that are powers + of two, starting with ``1``. -:class:`Enum` members are instances of their :class:`Enum` class, and are -normally accessed as ``EnumClass.member``. In Python versions ``3.5`` to -``3.9`` you could access members from other members -- this practice was -discouraged, and in ``3.12`` :class:`Enum` will return to not allowing it, -while in ``3.10`` and ``3.11`` it will raise a :exc:`DeprecationWarning`:: - >>> class FieldTypes(Enum): - ... name = 0 - ... value = 1 - ... size = 2 - ... - >>> FieldTypes.value.size # doctest: +SKIP - DeprecationWarning: accessing one member from another is not supported, - and will be disabled in 3.12 - - -.. versionchanged:: 3.5 -.. versionchanged:: 3.10 - - -Creating members that are mixed with other data types -""""""""""""""""""""""""""""""""""""""""""""""""""""" - -When subclassing other data types, such as :class:`int` or :class:`str`, with -an :class:`Enum`, all values after the `=` are passed to that data type's -constructor. For example:: +.. class:: IntFlag - >>> class MyEnum(IntEnum): - ... example = '11', 16 # '11' will be interpreted as a hexadecimal - ... # number - >>> MyEnum.example - + *IntFlag* is the same as *Flag*, but its members are also integers and can be + used anywhere that an integer can be used. + >>> from enum import IntFlag, auto + >>> class Color(IntFlag): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> Color.RED & 2 + 0x0 + >>> Color.RED | 2 + Color.RED|Color.GREEN -Boolean value of ``Enum`` classes and members -""""""""""""""""""""""""""""""""""""""""""""" + If any integer operation is performed with an *IntFlag* member, the result is + not an *IntFlag*:: -:class:`Enum` members that are mixed with non-:class:`Enum` types (such as -:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in -type's rules; otherwise, all members evaluate as :data:`True`. To make your -own Enum's boolean evaluation depend on the member's value add the following to -your class:: + >>> Color.RED + 2 + 3 - def __bool__(self): - return bool(self.value) + If a *Flag* operation is performed with an *IntFlag* member and: -:class:`Enum` classes always evaluate as :data:`True`. + * the result is a valid *IntFlag*: an *IntFlag* is returned + * the result is not a valid *IntFlag*: the result depends on the *FlagBoundary* setting +.. note:: -``Enum`` classes with methods -""""""""""""""""""""""""""""" + Using :class:`auto` with :class:`IntFlag` results in integers that are powers + of two, starting with ``1``. -If you give your :class:`Enum` subclass extra methods, like the `Planet`_ -class above, those methods will show up in a :func:`dir` of the member, -but not of the class:: +.. class:: FlagBoundary - >>> dir(Planet) - ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] - >>> dir(Planet.EARTH) - ['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] + *FlagBoundary* controls how out-of-range values are handled in *Flag* and its + subclasses. + .. attribute:: STRICT -Combining members of ``Flag`` -""""""""""""""""""""""""""""" + Out-of-range values cause a :exc:`ValueError` to be raised. This is the + default for :class:`Flag`:: -Iterating over a combination of Flag members will only return the members that -are comprised of a single bit:: + >>> from enum import STRICT + >>> class StrictFlag(Flag, boundary=STRICT): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> StrictFlag(2**2 + 2**4) + Traceback (most recent call last): + ... + ValueError: StrictFlag: invalid value: 20 + given 0b0 10100 + allowed 0b0 00111 - >>> class Color(Flag): - ... RED = auto() - ... GREEN = auto() - ... BLUE = auto() - ... MAGENTA = RED | BLUE - ... YELLOW = RED | GREEN - ... CYAN = GREEN | BLUE - ... - >>> Color(3) - - >>> Color(7) - + .. attribute:: CONFORM -``StrEnum`` and :meth:`str.__str__` -""""""""""""""""""""""""""""""""""" + Out-of-range values have invalid values removed, leaving a valid *Flag* + value:: -An important difference between :class:`StrEnum` and other Enums is the -:meth:`__str__` method; because :class:`StrEnum` members are strings, some -parts of Python will read the string data directly, while others will call -:meth:`str()`. To make those two operations have the same result, -:meth:`StrEnum.__str__` will be the same as :meth:`str.__str__` so that -``str(StrEnum.member) == StrEnum.member`` is true. + >>> from enum import CONFORM + >>> class ConformFlag(Flag, boundary=CONFORM): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> ConformFlag(2**2 + 2**4) + ConformFlag.BLUE -``Flag`` and ``IntFlag`` minutia -"""""""""""""""""""""""""""""""" + .. attribute:: EJECT -The code sample:: + Out-of-range values lose their *Flag* membership and revert to :class:`int`. + This is the default for :class:`IntFlag`:: - >>> class Color(IntFlag): - ... BLACK = 0 - ... RED = 1 - ... GREEN = 2 - ... BLUE = 4 - ... PURPLE = RED | BLUE - ... WHITE = RED | GREEN | BLUE - ... + >>> from enum import EJECT + >>> class EjectFlag(Flag, boundary=EJECT): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> EjectFlag(2**2 + 2**4) + 20 -- single-bit flags are canonical -- multi-bit and zero-bit flags are aliases -- only canonical flags are returned during iteration:: + .. attribute:: KEEP - >>> list(Color.WHITE) - [, , ] + Out-of-range values are kept, and the *Flag* membership is kept. This is + used for some stdlib flags: -- negating a flag or flag set returns a new flag/flag set with the - corresponding positive integer value:: + >>> from enum import KEEP + >>> class KeepFlag(Flag, boundary=KEEP): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> KeepFlag(2**2 + 2**4) + KeepFlag.BLUE|0x10 - >>> Color.GREEN - - >>> ~Color.GREEN - +Utilites and Decorators +----------------------- -- names of pseudo-flags are constructed from their members' names:: +.. class:: auto - >>> (Color.RED | Color.GREEN).name - 'RED|GREEN' + *auto* can be used in place of a value. If used, the *Enum* machinery will + call an *Enum*'s :meth:`_generate_next_value_` to get an appropriate value. + For *Enum* and *IntEnum* that appropriate value will be the last value plus + one; for *Flag* and *IntFlag* it will be the first power-of-two greater + than the last value; for *StrEnum* it will be the lower-cased version of the + member's name. -- multi-bit flags, aka aliases, can be returned from operations:: + ``_generate_next_value_`` can be overridden to customize the values used by + *auto*. - >>> Color.RED | Color.BLUE - +.. decorator:: global_enum - >>> Color(7) # or Color(-1) - + A :keyword:`class` decorator specifically for enumerations. It replaces the + :meth:`__repr__` method with one that shows *module_name*.*member_name*. It + also injects the members, and their aliases, into the the global namespace + they were defined in. -- membership / containment checking has changed slightly -- zero valued flags - are never considered to be contained:: - >>> Color.BLACK in Color.WHITE - False +.. decorator:: property - otherwise, if all bits of one flag are in the other flag, True is returned:: + A decorator similar to the built-in *property*, but specifically for + enumerations. It allows member attributes to have the same names as members + themselves. - >>> Color.PURPLE in Color.WHITE - True + .. note:: the *property* and the member must be defined in separate classes; + for example, the *value* and *name* attributes are defined in the + *Enum* class, and *Enum* subclasses can define members with the + names ``value`` and ``name``. -There is a new boundary mechanism that controls how out-of-range / invalid -bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``: +.. decorator:: unique - * STRICT --> raises an exception when presented with invalid values - * CONFORM --> discards any invalid bits - * EJECT --> lose Flag status and become a normal int with the given value - * KEEP --> keep the extra bits - - keeps Flag status and extra bits - - extra bits do not show up in iteration - - extra bits do show up in repr() and str() + A :keyword:`class` decorator specifically for enumerations. It searches an + enumeration's :attr:`__members__`, gathering any aliases it finds; if any are + found :exc:`ValueError` is raised with the details:: + + >>> from enum import Enum, unique + >>> @unique + ... class Mistake(Enum): + ... ONE = 1 + ... TWO = 2 + ... THREE = 3 + ... FOUR = 3 + ... + Traceback (most recent call last): + ... + ValueError: duplicate values found in : FOUR -> THREE -The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``DISCARD``, -and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an -example of when ``KEEP`` is needed). diff --git a/Doc/library/http.rst b/Doc/library/http.rst index 14ee73363e62e..1569d504c7f92 100644 --- a/Doc/library/http.rst +++ b/Doc/library/http.rst @@ -35,7 +35,7 @@ associated messages through the :class:`http.HTTPStatus` enum: >>> from http import HTTPStatus >>> HTTPStatus.OK - + HTTPStatus.OK >>> HTTPStatus.OK == 200 True >>> HTTPStatus.OK.value @@ -45,7 +45,7 @@ associated messages through the :class:`http.HTTPStatus` enum: >>> HTTPStatus.OK.description 'Request fulfilled, document follows' >>> list(HTTPStatus) - [, , ...] + [HTTPStatus.CONTINUE, HTTPStatus.SWITCHING_PROTOCOLS, ...] .. _http-status-codes: diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 31d804ce294a8..30b3c5e24eefc 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -785,9 +785,9 @@ The :mod:`socket` module also offers various network-related services: system if IPv6 isn't enabled):: >>> socket.getaddrinfo("example.org", 80, proto=socket.IPPROTO_TCP) - [(, , + [(socket.AF_INET6, socket.SOCK_STREAM, 6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)), - (, , + (socket.AF_INET, socket.SOCK_STREAM, 6, '', ('93.184.216.34', 80))] .. versionchanged:: 3.2 diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index c0789ee5cfc0e..93331681266de 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -2062,7 +2062,7 @@ to speed up repeated connections from the same clients. :attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags: >>> ssl.create_default_context().verify_flags # doctest: +SKIP - + ssl.VERIFY_X509_TRUSTED_FIRST .. attribute:: SSLContext.verify_mode @@ -2074,7 +2074,7 @@ to speed up repeated connections from the same clients. :attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum: >>> ssl.create_default_context().verify_mode - + ssl.CERT_REQUIRED .. index:: single: certificates diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index e09cfb44276ab..ea2834bc76145 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -716,6 +716,14 @@ encodings :func:`encodings.normalize_encoding` now ignores non-ASCII characters. (Contributed by Hai Shi in :issue:`39337`.) +enum +---- + +:class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and +:func:`__str__` now returns ``member_name``. Stdlib enums available as +module constants have a :func:`repr` of ``module_name.member_name``. +(Contributed by Ethan Furman in :issue:`40066`.) + gc -- diff --git a/Lib/enum.py b/Lib/enum.py index 84c7b0dc2afbe..f31779baa0d65 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -4,17 +4,18 @@ __all__ = [ - 'EnumMeta', + 'EnumType', 'EnumMeta', 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag', 'auto', 'unique', 'property', 'FlagBoundary', 'STRICT', 'CONFORM', 'EJECT', 'KEEP', + 'global_flag_repr', 'global_enum_repr', 'global_enum', ] # Dummy value for Enum and Flag as there are explicit checks for them # before they have been created. -# This is also why there are checks in EnumMeta like `if Enum is not None` +# This is also why there are checks in EnumType like `if Enum is not None` Enum = Flag = EJECT = None def _is_descriptor(obj): @@ -285,7 +286,7 @@ class _EnumDict(dict): """ Track enum member order and ensure member names are not reused. - EnumMeta will use the names found in self._member_names as the + EnumType will use the names found in self._member_names as the enumeration member names. """ def __init__(self): @@ -321,7 +322,8 @@ def __setitem__(self, key, value): # check if members already defined as auto() if self._auto_called: raise TypeError("_generate_next_value_ must be defined before members") - setattr(self, '_generate_next_value', value) + _gnv = value.__func__ if isinstance(value, staticmethod) else value + setattr(self, '_generate_next_value', _gnv) elif key == '_ignore_': if isinstance(value, str): value = value.replace(',',' ').split() @@ -368,7 +370,7 @@ def update(self, members, **more_members): self[name] = value -class EnumMeta(type): +class EnumType(type): """ Metaclass for Enum """ @@ -756,9 +758,9 @@ def _convert_(cls, name, module, filter, source=None, boundary=None): # module; # also, replace the __reduce_ex__ method so unpickling works in # previous Python versions - module_globals = vars(sys.modules[module]) + module_globals = sys.modules[module].__dict__ if source: - source = vars(source) + source = source.__dict__ else: source = module_globals # _value2member_map_ is populated in the same order every time @@ -776,7 +778,7 @@ def _convert_(cls, name, module, filter, source=None, boundary=None): members.sort(key=lambda t: t[0]) cls = cls(name, members, module=module, boundary=boundary or KEEP) cls.__reduce_ex__ = _reduce_ex_by_name - module_globals.update(cls.__members__) + global_enum(cls) module_globals[name] = cls return cls @@ -881,9 +883,10 @@ def _find_new_(classdict, member_type, first_enum): else: use_args = True return __new__, save_new, use_args +EnumMeta = EnumType -class Enum(metaclass=EnumMeta): +class Enum(metaclass=EnumType): """ Generic enumeration. @@ -958,11 +961,10 @@ def _missing_(cls, value): return None def __repr__(self): - return "<%s.%s: %r>" % ( - self.__class__.__name__, self._name_, self._value_) + return "%s.%s" % ( self.__class__.__name__, self._name_) def __str__(self): - return "%s.%s" % (self.__class__.__name__, self._name_) + return "%s" % (self._name_, ) def __dir__(self): """ @@ -1220,19 +1222,28 @@ def __len__(self): return self._value_.bit_count() def __repr__(self): - cls = self.__class__ - if self._name_ is not None: - return '<%s.%s: %r>' % (cls.__name__, self._name_, self._value_) + cls_name = self.__class__.__name__ + if self._name_ is None: + return "0x%x" % (self._value_, ) + if _is_single_bit(self._value_): + return '%s.%s' % (cls_name, self._name_) + if self._boundary_ is not FlagBoundary.KEEP: + return '%s.' % cls_name + ('|%s.' % cls_name).join(self.name.split('|')) else: - # only zero is unnamed by default - return '<%s: %r>' % (cls.__name__, self._value_) + name = [] + for n in self._name_.split('|'): + if n.startswith('0'): + name.append(n) + else: + name.append('%s.%s' % (cls_name, n)) + return '|'.join(name) def __str__(self): cls = self.__class__ - if self._name_ is not None: - return '%s.%s' % (cls.__name__, self._name_) + if self._name_ is None: + return '%s(%x)' % (cls.__name__, self._value_) else: - return '%s(%s)' % (cls.__name__, self._value_) + return self._name_ def __bool__(self): return bool(self._value_) @@ -1329,3 +1340,38 @@ def _power_of_two(value): if value < 1: return False return value == 2 ** _high_bit(value) + +def global_enum_repr(self): + return '%s.%s' % (self.__class__.__module__, self._name_) + +def global_flag_repr(self): + module = self.__class__.__module__ + cls_name = self.__class__.__name__ + if self._name_ is None: + return "%x" % (module, cls_name, self._value_) + if _is_single_bit(self): + return '%s.%s' % (module, self._name_) + if self._boundary_ is not FlagBoundary.KEEP: + return module + module.join(self.name.split('|')) + else: + name = [] + for n in self._name_.split('|'): + if n.startswith('0'): + name.append(n) + else: + name.append('%s.%s' % (module, n)) + return '|'.join(name) + + +def global_enum(cls): + """ + decorator that makes the repr() of an enum member reference its module + instead of its class; also exports all members to the enum's module's + global namespace + """ + if issubclass(cls, Flag): + cls.__repr__ = global_flag_repr + else: + cls.__repr__ = global_enum_repr + sys.modules[cls.__module__].__dict__.update(cls.__members__) + return cls diff --git a/Lib/inspect.py b/Lib/inspect.py index 1f2cdebd899f8..d6d2ce6461777 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2455,9 +2455,6 @@ class _ParameterKind(enum.IntEnum): KEYWORD_ONLY = 3 VAR_KEYWORD = 4 - def __str__(self): - return self._name_ - @property def description(self): return _PARAM_NAME_MAPPING[self] diff --git a/Lib/plistlib.py b/Lib/plistlib.py index 2eeebe4c9a424..5772efdfe6710 100644 --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -61,8 +61,7 @@ from xml.parsers.expat import ParserCreate -PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__) -globals().update(PlistFormat.__members__) +PlistFormat = enum.global_enum(enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)) class UID: diff --git a/Lib/re.py b/Lib/re.py index a39ff047c26b2..5e40c7b9bb17d 100644 --- a/Lib/re.py +++ b/Lib/re.py @@ -142,6 +142,7 @@ __version__ = "2.2.1" + at enum.global_enum class RegexFlag(enum.IntFlag, boundary=enum.KEEP): ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale" IGNORECASE = I = sre_compile.SRE_FLAG_IGNORECASE # ignore case @@ -154,22 +155,6 @@ class RegexFlag(enum.IntFlag, boundary=enum.KEEP): TEMPLATE = T = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation - def __repr__(self): - res = '' - if self._name_: - member_names = self._name_.split('|') - constant = None - if member_names[-1].startswith('0x'): - constant = member_names.pop() - res = 're.' + '|re.'.join(member_names) - if constant: - res += '|%s' % constant - return res - - __str__ = object.__str__ - -globals().update(RegexFlag.__members__) - # sre exception error = sre_compile.error diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 69392e01faacd..6002cd85622cf 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -7,7 +7,7 @@ import unittest import threading from collections import OrderedDict -from enum import Enum, IntEnum, StrEnum, EnumMeta, Flag, IntFlag, unique, auto +from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto from enum import STRICT, CONFORM, EJECT, KEEP from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL @@ -262,11 +262,8 @@ def test_enum(self): self.assertIn(e, Season) self.assertIs(type(e), Season) self.assertIsInstance(e, Season) - self.assertEqual(str(e), 'Season.' + season) - self.assertEqual( - repr(e), - ''.format(season, i), - ) + self.assertEqual(str(e), season) + self.assertEqual(repr(e), 'Season.{0}'.format(season)) def test_value_name(self): Season = self.Season @@ -440,7 +437,7 @@ def red(self): def test_reserved__sunder_(self): with self.assertRaisesRegex( ValueError, - "_sunder_ names, such as '_bad_', are reserved", + '_sunder_ names, such as ._bad_., are reserved', ): class Bad(Enum): _bad_ = 1 @@ -488,7 +485,7 @@ class EnumWithFormatOverride(Enum): two = 2.0 def __format__(self, spec): return 'Format!!' - self.assertEqual(str(EnumWithFormatOverride.one), 'EnumWithFormatOverride.one') + self.assertEqual(str(EnumWithFormatOverride.one), 'one') self.assertEqual('{}'.format(EnumWithFormatOverride.one), 'Format!!') def test_str_and_format_override_enum(self): @@ -528,7 +525,7 @@ class TestFloat(float, Enum): two = 2.0 def __format__(self, spec): return 'TestFloat success!' - self.assertEqual(str(TestFloat.one), 'TestFloat.one') + self.assertEqual(str(TestFloat.one), 'one') self.assertEqual('{}'.format(TestFloat.one), 'TestFloat success!') def assertFormatIsValue(self, spec, member): @@ -614,6 +611,8 @@ class MyEnum(HexInt, enum.Enum): A = 1 B = 2 C = 3 + def __repr__(self): + return '<%s.%s: %r>' % (self.__class__.__name__, self._name_, self._value_) self.assertEqual(repr(MyEnum.A), '') def test_too_many_data_types(self): @@ -1959,7 +1958,7 @@ class Color(MaxMixin, Enum): self.assertEqual(Color.GREEN.value, 2) self.assertEqual(Color.BLUE.value, 3) self.assertEqual(Color.MAX, 3) - self.assertEqual(str(Color.BLUE), 'Color.BLUE') + self.assertEqual(str(Color.BLUE), 'BLUE') class Color(MaxMixin, StrMixin, Enum): RED = auto() GREEN = auto() @@ -2330,64 +2329,62 @@ class Color(Flag): def test_str(self): Perm = self.Perm - self.assertEqual(str(Perm.R), 'Perm.R') - self.assertEqual(str(Perm.W), 'Perm.W') - self.assertEqual(str(Perm.X), 'Perm.X') - self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W') - self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X') + self.assertEqual(str(Perm.R), 'R') + self.assertEqual(str(Perm.W), 'W') + self.assertEqual(str(Perm.X), 'X') + self.assertEqual(str(Perm.R | Perm.W), 'R|W') + self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'R|W|X') self.assertEqual(str(Perm(0)), 'Perm(0)') - self.assertEqual(str(~Perm.R), 'Perm.W|X') - self.assertEqual(str(~Perm.W), 'Perm.R|X') - self.assertEqual(str(~Perm.X), 'Perm.R|W') - self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(str(~Perm.R), 'W|X') + self.assertEqual(str(~Perm.W), 'R|X') + self.assertEqual(str(~Perm.X), 'R|W') + self.assertEqual(str(~(Perm.R | Perm.W)), 'X') self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)') - self.assertEqual(str(Perm(~0)), 'Perm.R|W|X') + self.assertEqual(str(Perm(~0)), 'R|W|X') Open = self.Open - self.assertEqual(str(Open.RO), 'Open.RO') - self.assertEqual(str(Open.WO), 'Open.WO') - self.assertEqual(str(Open.AC), 'Open.AC') - self.assertEqual(str(Open.RO | Open.CE), 'Open.CE') - self.assertEqual(str(Open.WO | Open.CE), 'Open.WO|CE') - self.assertEqual(str(~Open.RO), 'Open.WO|RW|CE') - self.assertEqual(str(~Open.WO), 'Open.RW|CE') - self.assertEqual(str(~Open.AC), 'Open.CE') - self.assertEqual(str(~Open.CE), 'Open.AC') - self.assertEqual(str(~(Open.RO | Open.CE)), 'Open.AC') - self.assertEqual(str(~(Open.WO | Open.CE)), 'Open.RW') + self.assertEqual(str(Open.RO), 'RO') + self.assertEqual(str(Open.WO), 'WO') + self.assertEqual(str(Open.AC), 'AC') + self.assertEqual(str(Open.RO | Open.CE), 'CE') + self.assertEqual(str(Open.WO | Open.CE), 'WO|CE') + self.assertEqual(str(~Open.RO), 'WO|RW|CE') + self.assertEqual(str(~Open.WO), 'RW|CE') + self.assertEqual(str(~Open.AC), 'CE') + self.assertEqual(str(~(Open.RO | Open.CE)), 'AC') + self.assertEqual(str(~(Open.WO | Open.CE)), 'RW') def test_repr(self): Perm = self.Perm - self.assertEqual(repr(Perm.R), '') - self.assertEqual(repr(Perm.W), '') - self.assertEqual(repr(Perm.X), '') - self.assertEqual(repr(Perm.R | Perm.W), '') - self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '') - self.assertEqual(repr(Perm(0)), '') - self.assertEqual(repr(~Perm.R), '') - self.assertEqual(repr(~Perm.W), '') - self.assertEqual(repr(~Perm.X), '') - self.assertEqual(repr(~(Perm.R | Perm.W)), '') - self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '') - self.assertEqual(repr(Perm(~0)), '') + self.assertEqual(repr(Perm.R), 'Perm.R') + self.assertEqual(repr(Perm.W), 'Perm.W') + self.assertEqual(repr(Perm.X), 'Perm.X') + self.assertEqual(repr(Perm.R | Perm.W), 'Perm.R|Perm.W') + self.assertEqual(repr(Perm.R | Perm.W | Perm.X), 'Perm.R|Perm.W|Perm.X') + self.assertEqual(repr(Perm(0)), '0x0') + self.assertEqual(repr(~Perm.R), 'Perm.W|Perm.X') + self.assertEqual(repr(~Perm.W), 'Perm.R|Perm.X') + self.assertEqual(repr(~Perm.X), 'Perm.R|Perm.W') + self.assertEqual(repr(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '0x0') + self.assertEqual(repr(Perm(~0)), 'Perm.R|Perm.W|Perm.X') Open = self.Open - self.assertEqual(repr(Open.RO), '') - self.assertEqual(repr(Open.WO), '') - self.assertEqual(repr(Open.AC), '') - self.assertEqual(repr(Open.RO | Open.CE), '') - self.assertEqual(repr(Open.WO | Open.CE), '') - self.assertEqual(repr(~Open.RO), '') - self.assertEqual(repr(~Open.WO), '') - self.assertEqual(repr(~Open.AC), '') - self.assertEqual(repr(~Open.CE), '') - self.assertEqual(repr(~(Open.RO | Open.CE)), '') - self.assertEqual(repr(~(Open.WO | Open.CE)), '') + self.assertEqual(repr(Open.RO), 'Open.RO') + self.assertEqual(repr(Open.WO), 'Open.WO') + self.assertEqual(repr(Open.AC), 'Open.AC') + self.assertEqual(repr(Open.RO | Open.CE), 'Open.CE') + self.assertEqual(repr(Open.WO | Open.CE), 'Open.WO|Open.CE') + self.assertEqual(repr(~Open.RO), 'Open.WO|Open.RW|Open.CE') + self.assertEqual(repr(~Open.WO), 'Open.RW|Open.CE') + self.assertEqual(repr(~Open.AC), 'Open.CE') + self.assertEqual(repr(~(Open.RO | Open.CE)), 'Open.AC') + self.assertEqual(repr(~(Open.WO | Open.CE)), 'Open.RW') def test_format(self): Perm = self.Perm - self.assertEqual(format(Perm.R, ''), 'Perm.R') - self.assertEqual(format(Perm.R | Perm.X, ''), 'Perm.R|X') + self.assertEqual(format(Perm.R, ''), 'R') + self.assertEqual(format(Perm.R | Perm.X, ''), 'R|X') def test_or(self): Perm = self.Perm @@ -2707,7 +2704,7 @@ class Color(AllMixin, Flag): self.assertEqual(Color.GREEN.value, 2) self.assertEqual(Color.BLUE.value, 4) self.assertEqual(Color.ALL.value, 7) - self.assertEqual(str(Color.BLUE), 'Color.BLUE') + self.assertEqual(str(Color.BLUE), 'BLUE') class Color(AllMixin, StrMixin, Flag): RED = auto() GREEN = auto() @@ -2850,77 +2847,70 @@ def test_type(self): def test_str(self): Perm = self.Perm - self.assertEqual(str(Perm.R), 'Perm.R') - self.assertEqual(str(Perm.W), 'Perm.W') - self.assertEqual(str(Perm.X), 'Perm.X') - self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W') - self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X') + self.assertEqual(str(Perm.R), 'R') + self.assertEqual(str(Perm.W), 'W') + self.assertEqual(str(Perm.X), 'X') + self.assertEqual(str(Perm.R | Perm.W), 'R|W') + self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'R|W|X') self.assertEqual(str(Perm.R | 8), '12') self.assertEqual(str(Perm(0)), 'Perm(0)') self.assertEqual(str(Perm(8)), '8') - self.assertEqual(str(~Perm.R), 'Perm.W|X') - self.assertEqual(str(~Perm.W), 'Perm.R|X') - self.assertEqual(str(~Perm.X), 'Perm.R|W') - self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(str(~Perm.R), 'W|X') + self.assertEqual(str(~Perm.W), 'R|X') + self.assertEqual(str(~Perm.X), 'R|W') + self.assertEqual(str(~(Perm.R | Perm.W)), 'X') self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)') self.assertEqual(str(~(Perm.R | 8)), '-13') - self.assertEqual(str(Perm(~0)), 'Perm.R|W|X') + self.assertEqual(str(Perm(~0)), 'R|W|X') self.assertEqual(str(Perm(~8)), '-9') Open = self.Open - self.assertEqual(str(Open.RO), 'Open.RO') - self.assertEqual(str(Open.WO), 'Open.WO') - self.assertEqual(str(Open.AC), 'Open.AC') - self.assertEqual(str(Open.RO | Open.CE), 'Open.CE') - self.assertEqual(str(Open.WO | Open.CE), 'Open.WO|CE') + self.assertEqual(str(Open.RO), 'RO') + self.assertEqual(str(Open.WO), 'WO') + self.assertEqual(str(Open.AC), 'AC') + self.assertEqual(str(Open.RO | Open.CE), 'CE') + self.assertEqual(str(Open.WO | Open.CE), 'WO|CE') self.assertEqual(str(Open(4)), '4') - self.assertEqual(str(~Open.RO), 'Open.WO|RW|CE') - self.assertEqual(str(~Open.WO), 'Open.RW|CE') - self.assertEqual(str(~Open.AC), 'Open.CE') - self.assertEqual(str(~Open.CE), 'Open.AC') - self.assertEqual(str(~(Open.RO | Open.CE)), 'Open.AC') - self.assertEqual(str(~(Open.WO | Open.CE)), 'Open.RW') + self.assertEqual(str(~Open.RO), 'WO|RW|CE') + self.assertEqual(str(~Open.WO), 'RW|CE') + self.assertEqual(str(~Open.AC), 'CE') + self.assertEqual(str(~(Open.RO | Open.CE)), 'AC') + self.assertEqual(str(~(Open.WO | Open.CE)), 'RW') self.assertEqual(str(Open(~4)), '-5') - Skip = self.Skip - self.assertEqual(str(Skip(~4)), 'Skip.FIRST|SECOND|EIGHTH') - def test_repr(self): Perm = self.Perm - self.assertEqual(repr(Perm.R), '') - self.assertEqual(repr(Perm.W), '') - self.assertEqual(repr(Perm.X), '') - self.assertEqual(repr(Perm.R | Perm.W), '') - self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '') + self.assertEqual(repr(Perm.R), 'Perm.R') + self.assertEqual(repr(Perm.W), 'Perm.W') + self.assertEqual(repr(Perm.X), 'Perm.X') + self.assertEqual(repr(Perm.R | Perm.W), 'Perm.R|Perm.W') + self.assertEqual(repr(Perm.R | Perm.W | Perm.X), 'Perm.R|Perm.W|Perm.X') self.assertEqual(repr(Perm.R | 8), '12') - self.assertEqual(repr(Perm(0)), '') + self.assertEqual(repr(Perm(0)), '0x0') self.assertEqual(repr(Perm(8)), '8') - self.assertEqual(repr(~Perm.R), '') - self.assertEqual(repr(~Perm.W), '') - self.assertEqual(repr(~Perm.X), '') - self.assertEqual(repr(~(Perm.R | Perm.W)), '') - self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '') + self.assertEqual(repr(~Perm.R), 'Perm.W|Perm.X') + self.assertEqual(repr(~Perm.W), 'Perm.R|Perm.X') + self.assertEqual(repr(~Perm.X), 'Perm.R|Perm.W') + self.assertEqual(repr(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '0x0') self.assertEqual(repr(~(Perm.R | 8)), '-13') - self.assertEqual(repr(Perm(~0)), '') + self.assertEqual(repr(Perm(~0)), 'Perm.R|Perm.W|Perm.X') self.assertEqual(repr(Perm(~8)), '-9') Open = self.Open - self.assertEqual(repr(Open.RO), '') - self.assertEqual(repr(Open.WO), '') - self.assertEqual(repr(Open.AC), '') - self.assertEqual(repr(Open.RO | Open.CE), '') - self.assertEqual(repr(Open.WO | Open.CE), '') + self.assertEqual(repr(Open.RO), 'Open.RO') + self.assertEqual(repr(Open.WO), 'Open.WO') + self.assertEqual(repr(Open.AC), 'Open.AC') + self.assertEqual(repr(Open.RO | Open.CE), 'Open.CE') + self.assertEqual(repr(Open.WO | Open.CE), 'Open.WO|Open.CE') self.assertEqual(repr(Open(4)), '4') - self.assertEqual(repr(~Open.RO), '') - self.assertEqual(repr(~Open.WO), '') - self.assertEqual(repr(~Open.AC), '') - self.assertEqual(repr(~(Open.RO | Open.CE)), '') - self.assertEqual(repr(~(Open.WO | Open.CE)), '') + self.assertEqual(repr(~Open.RO), 'Open.WO|Open.RW|Open.CE') + self.assertEqual(repr(~Open.WO), 'Open.RW|Open.CE') + self.assertEqual(repr(~Open.AC), 'Open.CE') + self.assertEqual(repr(~(Open.RO | Open.CE)), 'Open.AC') + self.assertEqual(repr(~(Open.WO | Open.CE)), 'Open.RW') self.assertEqual(repr(Open(~4)), '-5') - Skip = self.Skip - self.assertEqual(repr(Skip(~4)), '') - def test_format(self): Perm = self.Perm self.assertEqual(format(Perm.R, ''), '4') @@ -3252,7 +3242,7 @@ class Color(AllMixin, IntFlag): self.assertEqual(Color.GREEN.value, 2) self.assertEqual(Color.BLUE.value, 4) self.assertEqual(Color.ALL.value, 7) - self.assertEqual(str(Color.BLUE), 'Color.BLUE') + self.assertEqual(str(Color.BLUE), 'BLUE') class Color(AllMixin, StrMixin, IntFlag): RED = auto() GREEN = auto() @@ -3374,6 +3364,8 @@ class Sillier(IntEnum): value = 4 +class TestEnumTypeSubclassing(unittest.TestCase): + pass expected_help_output_with_docs = """\ Help on class Color in module %s: @@ -3390,11 +3382,11 @@ class Color(enum.Enum) |\x20\x20 | Data and other attributes defined here: |\x20\x20 - | blue = + | blue = Color.blue |\x20\x20 - | green = + | green = Color.green |\x20\x20 - | red = + | red = Color.red |\x20\x20 | ---------------------------------------------------------------------- | Data descriptors inherited from enum.Enum: @@ -3406,7 +3398,7 @@ class Color(enum.Enum) | The value of the Enum member. |\x20\x20 | ---------------------------------------------------------------------- - | Readonly properties inherited from enum.EnumMeta: + | Readonly properties inherited from enum.EnumType: |\x20\x20 | __members__ | Returns a mapping of member name->value. @@ -3427,11 +3419,11 @@ class Color(enum.Enum) |\x20\x20 | Data and other attributes defined here: |\x20\x20 - | blue = + | blue = Color.blue |\x20\x20 - | green = + | green = Color.green |\x20\x20 - | red = + | red = Color.red |\x20\x20 | ---------------------------------------------------------------------- | Data descriptors inherited from enum.Enum: @@ -3441,7 +3433,7 @@ class Color(enum.Enum) | value |\x20\x20 | ---------------------------------------------------------------------- - | Data descriptors inherited from enum.EnumMeta: + | Data descriptors inherited from enum.EnumType: |\x20\x20 | __members__""" @@ -3468,7 +3460,7 @@ def test_pydoc(self): def test_inspect_getmembers(self): values = dict(( - ('__class__', EnumMeta), + ('__class__', EnumType), ('__doc__', 'An enumeration.'), ('__members__', self.Color.__members__), ('__module__', __name__), @@ -3495,11 +3487,11 @@ def test_inspect_classify_class_attrs(self): from inspect import Attribute values = [ Attribute(name='__class__', kind='data', - defining_class=object, object=EnumMeta), + defining_class=object, object=EnumType), Attribute(name='__doc__', kind='data', defining_class=self.Color, object='An enumeration.'), Attribute(name='__members__', kind='property', - defining_class=EnumMeta, object=EnumMeta.__members__), + defining_class=EnumType, object=EnumType.__members__), Attribute(name='__module__', kind='data', defining_class=self.Color, object=__name__), Attribute(name='blue', kind='data', @@ -3589,6 +3581,45 @@ def test_convert_raise(self): ('test.test_enum', '__main__')[__name__=='__main__'], filter=lambda x: x.startswith('CONVERT_TEST_')) + def test_convert_repr_and_str(self): + module = ('test.test_enum', '__main__')[__name__=='__main__'] + test_type = enum.IntEnum._convert_( + 'UnittestConvert', + module, + filter=lambda x: x.startswith('CONVERT_TEST_')) + self.assertEqual(repr(test_type.CONVERT_TEST_NAME_A), '%s.CONVERT_TEST_NAME_A' % module) + self.assertEqual(str(test_type.CONVERT_TEST_NAME_A), 'CONVERT_TEST_NAME_A') + self.assertEqual(format(test_type.CONVERT_TEST_NAME_A), '5') + +# global names for StrEnum._convert_ test +CONVERT_STR_TEST_2 = 'goodbye' +CONVERT_STR_TEST_1 = 'hello' + +class TestStrEnumConvert(unittest.TestCase): + + def test_convert(self): + test_type = enum.StrEnum._convert_( + 'UnittestConvert', + ('test.test_enum', '__main__')[__name__=='__main__'], + filter=lambda x: x.startswith('CONVERT_STR_')) + # Ensure that test_type has all of the desired names and values. + self.assertEqual(test_type.CONVERT_STR_TEST_1, 'hello') + self.assertEqual(test_type.CONVERT_STR_TEST_2, 'goodbye') + # Ensure that test_type only picked up names matching the filter. + self.assertEqual([name for name in dir(test_type) + if name[0:2] not in ('CO', '__')], + [], msg='Names other than CONVERT_STR_* found.') + + def test_convert_repr_and_str(self): + module = ('test.test_enum', '__main__')[__name__=='__main__'] + test_type = enum.StrEnum._convert_( + 'UnittestConvert', + module, + filter=lambda x: x.startswith('CONVERT_STR_')) + self.assertEqual(repr(test_type.CONVERT_STR_TEST_1), '%s.CONVERT_STR_TEST_1' % module) + self.assertEqual(str(test_type.CONVERT_STR_TEST_2), 'goodbye') + self.assertEqual(format(test_type.CONVERT_STR_TEST_1), 'hello') + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 3bc0e9e6b53b1..61575b522a66b 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -453,7 +453,7 @@ class BinaryInteger(enum.IntEnum): zero = 0 one = 1 doc = pydoc.render_doc(BinaryInteger) - self.assertIn('', doc) + self.assertIn('BinaryInteger.zero', doc) def test_mixed_case_module_names_are_lower_cased(self): # issue16484 diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index f973d4fe08be3..8f943bedce395 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -872,7 +872,7 @@ def handler(signum, frame): %s - blocked = %s + blocked = %r signum = signal.SIGALRM # child: block and wait the signal diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index bc280306b15d1..f91e00059daaa 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1518,9 +1518,9 @@ def testGetaddrinfo(self): infos = socket.getaddrinfo(HOST, 80, socket.AF_INET, socket.SOCK_STREAM) for family, type, _, _, _ in infos: self.assertEqual(family, socket.AF_INET) - self.assertEqual(str(family), 'AddressFamily.AF_INET') + self.assertEqual(str(family), 'AF_INET') self.assertEqual(type, socket.SOCK_STREAM) - self.assertEqual(str(type), 'SocketKind.SOCK_STREAM') + self.assertEqual(str(type), 'SOCK_STREAM') infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM) for _, socktype, _, _, _ in infos: self.assertEqual(socktype, socket.SOCK_STREAM) @@ -1793,8 +1793,8 @@ def test_str_for_enums(self): # Make sure that the AF_* and SOCK_* constants have enum-like string # reprs. with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - self.assertEqual(str(s.family), 'AddressFamily.AF_INET') - self.assertEqual(str(s.type), 'SocketKind.SOCK_STREAM') + self.assertEqual(str(s.family), 'AF_INET') + self.assertEqual(str(s.type), 'SOCK_STREAM') def test_socket_consistent_sock_type(self): SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index fa77406bca82a..4ef1fb8d63bb2 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -381,7 +381,7 @@ def test_str_for_enums(self): # Make sure that the PROTOCOL_* constants have enum-like string # reprs. proto = ssl.PROTOCOL_TLS - self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_TLS') + self.assertEqual(str(proto), 'PROTOCOL_TLS') ctx = ssl.SSLContext(proto) self.assertIs(ctx.protocol, proto) diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 42c77f0f4e868..d47cf28782dd7 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1467,18 +1467,18 @@ class Str(str, enum.Enum): ABC = 'abc' # Testing Unicode formatting strings... self.assertEqual("%s, %s" % (Str.ABC, Str.ABC), - 'Str.ABC, Str.ABC') + 'ABC, ABC') self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" % (Str.ABC, Str.ABC, Int.IDES, Int.IDES, Int.IDES, Float.PI, Float.PI), - 'Str.ABC, Str.ABC, 15, 15, 15, 3.141593, 3.14') + 'ABC, ABC, 15, 15, 15, 3.141593, 3.14') # formatting jobs delegated from the string implementation: self.assertEqual('...%(foo)s...' % {'foo':Str.ABC}, - '...Str.ABC...') + '...ABC...') self.assertEqual('...%(foo)s...' % {'foo':Int.IDES}, - '...Int.IDES...') + '...IDES...') self.assertEqual('...%(foo)i...' % {'foo':Int.IDES}, '...15...') self.assertEqual('...%(foo)d...' % {'foo':Int.IDES}, diff --git a/Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst b/Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst new file mode 100644 index 0000000000000..6d2c68e2353dd --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst @@ -0,0 +1,4 @@ +Enum's `repr()` and `str()` have changed: `repr()` is now *EnumClass.MemberName* +and `str()` is *MemberName*. Additionally, stdlib Enum's whose contents are +available as module attributes, such as `RegexFlag.IGNORECASE`, have their +`repr()` as *module.name*, e.g. `re.IGNORECASE`. diff --git a/Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst b/Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst new file mode 100644 index 0000000000000..11903f8b9e93d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst @@ -0,0 +1,3 @@ +Enum: adjust ``repr()`` to show only enum and member name (not value, nor +angle brackets) and ``str()`` to show only member name. Update and improve +documentation to match. From webhook-mailer at python.org Wed Mar 31 01:19:48 2021 From: webhook-mailer at python.org (terryjreedy) Date: Wed, 31 Mar 2021 05:19:48 -0000 Subject: [Python-checkins] bpo-42225: IDLE - document two unix-related problems. (#25078) Message-ID: https://github.com/python/cpython/commit/1b4a9c7956d5dc64f8002f62bf0faae2d1892f90 commit: 1b4a9c7956d5dc64f8002f62bf0faae2d1892f90 branch: master author: Terry Jan Reedy committer: terryjreedy date: 2021-03-31T01:19:38-04:00 summary: bpo-42225: IDLE - document two unix-related problems. (#25078) 1. Bad IP masquerade rules can prevent startup. 2. X cannot handle some complex colored chars. files: A Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 2b9bd4b5daaa7..6ef15653eacb5 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -670,8 +670,16 @@ IDLE uses a socket to communicate between the IDLE GUI process and the user code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says 'RESTART'). If the user process fails to connect to the GUI process, it -displays a ``Tk`` error box with a 'cannot connect' message that directs the -user here. It then exits. +usually displays a ``Tk`` error box with a 'cannot connect' message +that directs the user here. It then exits. + +One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system's network setup. +When IDLE is started from a terminal, one will see a message starting +with ``** Invalid host:``. +The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``. +One can diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one +terminal window and ``tcplisten `` in another. A common cause of failure is a user-written file with the same name as a standard library module, such as *random.py* and *tkinter.py*. When such a @@ -709,6 +717,13 @@ If IDLE quits with no message, and it was not started from a console, try starting it from a console or terminal (``python -m idlelib``) and see if this results in an error message. +On Unix-based systems with tcl/tk older than ``8.6.11`` (see +``About IDLE``) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better. + Running user code ^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 924042d25b7ba..e80384b777522 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -5,7 +5,7 @@ - IDLE — Python 3.10.0a5 documentation + IDLE — Python 3.10.0a6 documentation @@ -18,7 +18,7 @@ @@ -71,7 +71,7 @@

Navigation

  • - 3.10.0a5 Documentation » + 3.10.0a6 Documentation »
  • @@ -632,8 +632,15 @@

    Startup failureTk error box with a ?cannot connect? message that directs the -user here. It then exits.

    +usually displays a Tk error box with a ?cannot connect? message +that directs the user here. It then exits.

    +

    One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system?s network setup. +When IDLE is started from a terminal, one will see a message starting +with ** Invalid host:. +The valid value is 127.0.0.1 (idlelib.rpc.LOCALHOST). +One can diagnose with tcpconnect -irv 127.0.0.1 6543 in one +terminal window and tcplisten <same args> in another.

    A common cause of failure is a user-written file with the same name as a standard library module, such as random.py and tkinter.py. When such a file is located in the same directory as a file that is about to be run, @@ -664,6 +671,12 @@

    Startup failurepython -m idlelib) and see if this results in an error message.

    +

    On Unix-based systems with tcl/tk older than 8.6.11 (see +About IDLE) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better.

    Running user code?

    @@ -958,7 +971,7 @@

    Navigation

  • - 3.10.0a5 Documentation » + 3.10.0a6 Documentation »
  • @@ -990,7 +1003,7 @@

    Navigation



    - Last updated on Feb 23, 2021. + Last updated on Mar 29, 2021. Found a bug?
    diff --git a/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst new file mode 100644 index 0000000000000..59fb08bdf9ebe --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst @@ -0,0 +1,2 @@ +Document that IDLE can fail on Unix either from misconfigured IP masquerage +rules or failure displaying complex colored (non-ascii) characters. From webhook-mailer at python.org Wed Mar 31 01:26:16 2021 From: webhook-mailer at python.org (methane) Date: Wed, 31 Mar 2021 05:26:16 -0000 Subject: [Python-checkins] bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103) Message-ID: https://github.com/python/cpython/commit/ff3c9739bd69aa8b58007e63c9e40e6708b4761e commit: ff3c9739bd69aa8b58007e63c9e40e6708b4761e branch: master author: Inada Naoki committer: methane date: 2021-03-31T14:26:08+09:00 summary: bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103) It make `encoding="locale"` usable everywhere `encoding=None` is allowed. files: M Lib/_pyio.py M Lib/test/test_io.py M Modules/_io/_iomodule.c diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 0f182d4240206..ba0b0a29b5013 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -221,7 +221,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None, raise ValueError("can't have read/write/append mode at once") if not (creating or reading or writing or appending): raise ValueError("must have exactly one of read/write/append mode") - if binary and encoding is not None: + if binary and encoding is not None and encoding != "locale": raise ValueError("binary mode doesn't take an encoding argument") if binary and errors is not None: raise ValueError("binary mode doesn't take an errors argument") diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index c731302a9f22f..6a9ce39f08eb5 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -531,6 +531,17 @@ class UnseekableWriter(self.MockUnseekableIO): self.assertRaises(OSError, obj.truncate) self.assertRaises(OSError, obj.truncate, 0) + def test_open_binmode_encoding(self): + """open() raises ValueError when encoding is specified in bin mode""" + self.assertRaises(ValueError, self.open, os_helper.TESTFN, + "wb", encoding="utf-8") + + # encoding=None and encoding="locale" is allowed. + with self.open(os_helper.TESTFN, "wb", encoding=None): + pass + with self.open(os_helper.TESTFN, "wb", encoding="locale"): + pass + def test_open_handles_NUL_chars(self): fn_with_NUL = 'foo\0bar' self.assertRaises(ValueError, self.open, fn_with_NUL, 'w') diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 652c2ce5b0d61..c627ca257fd5e 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -346,7 +346,8 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, goto error; } - if (binary && encoding != NULL) { + if (binary && encoding != NULL + && strcmp(encoding, "locale") != 0) { PyErr_SetString(PyExc_ValueError, "binary mode doesn't take an encoding argument"); goto error; From webhook-mailer at python.org Wed Mar 31 01:40:22 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 31 Mar 2021 05:40:22 -0000 Subject: [Python-checkins] bpo-42225: IDLE - document two unix-related problems. (GH-25078) Message-ID: https://github.com/python/cpython/commit/e92923b028024290a0e621b6b90e3221767d14d4 commit: e92923b028024290a0e621b6b90e3221767d14d4 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T22:40:09-07:00 summary: bpo-42225: IDLE - document two unix-related problems. (GH-25078) 1. Bad IP masquerade rules can prevent startup. 2. X cannot handle some complex colored chars. (cherry picked from commit 1b4a9c7956d5dc64f8002f62bf0faae2d1892f90) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 2b9bd4b5daaa7..6ef15653eacb5 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -670,8 +670,16 @@ IDLE uses a socket to communicate between the IDLE GUI process and the user code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says 'RESTART'). If the user process fails to connect to the GUI process, it -displays a ``Tk`` error box with a 'cannot connect' message that directs the -user here. It then exits. +usually displays a ``Tk`` error box with a 'cannot connect' message +that directs the user here. It then exits. + +One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system's network setup. +When IDLE is started from a terminal, one will see a message starting +with ``** Invalid host:``. +The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``. +One can diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one +terminal window and ``tcplisten `` in another. A common cause of failure is a user-written file with the same name as a standard library module, such as *random.py* and *tkinter.py*. When such a @@ -709,6 +717,13 @@ If IDLE quits with no message, and it was not started from a console, try starting it from a console or terminal (``python -m idlelib``) and see if this results in an error message. +On Unix-based systems with tcl/tk older than ``8.6.11`` (see +``About IDLE``) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better. + Running user code ^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 924042d25b7ba..e80384b777522 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -5,7 +5,7 @@ - IDLE — Python 3.10.0a5 documentation + IDLE — Python 3.10.0a6 documentation @@ -18,7 +18,7 @@ @@ -71,7 +71,7 @@

    Navigation

  • - 3.10.0a5 Documentation » + 3.10.0a6 Documentation »
  • @@ -632,8 +632,15 @@

    Startup failureTk error box with a ?cannot connect? message that directs the -user here. It then exits.

    +usually displays a Tk error box with a ?cannot connect? message +that directs the user here. It then exits.

    +

    One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system?s network setup. +When IDLE is started from a terminal, one will see a message starting +with ** Invalid host:. +The valid value is 127.0.0.1 (idlelib.rpc.LOCALHOST). +One can diagnose with tcpconnect -irv 127.0.0.1 6543 in one +terminal window and tcplisten <same args> in another.

    A common cause of failure is a user-written file with the same name as a standard library module, such as random.py and tkinter.py. When such a file is located in the same directory as a file that is about to be run, @@ -664,6 +671,12 @@

    Startup failurepython -m idlelib) and see if this results in an error message.

    +

    On Unix-based systems with tcl/tk older than 8.6.11 (see +About IDLE) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better.

    Running user code?

    @@ -958,7 +971,7 @@

    Navigation

  • - 3.10.0a5 Documentation » + 3.10.0a6 Documentation »
  • @@ -990,7 +1003,7 @@

    Navigation



    - Last updated on Feb 23, 2021. + Last updated on Mar 29, 2021. Found a bug?
    diff --git a/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst new file mode 100644 index 0000000000000..59fb08bdf9ebe --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst @@ -0,0 +1,2 @@ +Document that IDLE can fail on Unix either from misconfigured IP masquerage +rules or failure displaying complex colored (non-ascii) characters. From webhook-mailer at python.org Wed Mar 31 01:44:35 2021 From: webhook-mailer at python.org (miss-islington) Date: Wed, 31 Mar 2021 05:44:35 -0000 Subject: [Python-checkins] bpo-42225: IDLE - document two unix-related problems. (GH-25078) Message-ID: https://github.com/python/cpython/commit/84694c3e7adadc97d7d8cee938fe84bbeb961387 commit: 84694c3e7adadc97d7d8cee938fe84bbeb961387 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-30T22:44:26-07:00 summary: bpo-42225: IDLE - document two unix-related problems. (GH-25078) 1. Bad IP masquerade rules can prevent startup. 2. X cannot handle some complex colored chars. (cherry picked from commit 1b4a9c7956d5dc64f8002f62bf0faae2d1892f90) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst M Doc/library/idle.rst M Lib/idlelib/help.html diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 2b9bd4b5daaa7..6ef15653eacb5 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -670,8 +670,16 @@ IDLE uses a socket to communicate between the IDLE GUI process and the user code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says 'RESTART'). If the user process fails to connect to the GUI process, it -displays a ``Tk`` error box with a 'cannot connect' message that directs the -user here. It then exits. +usually displays a ``Tk`` error box with a 'cannot connect' message +that directs the user here. It then exits. + +One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system's network setup. +When IDLE is started from a terminal, one will see a message starting +with ``** Invalid host:``. +The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``. +One can diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one +terminal window and ``tcplisten `` in another. A common cause of failure is a user-written file with the same name as a standard library module, such as *random.py* and *tkinter.py*. When such a @@ -709,6 +717,13 @@ If IDLE quits with no message, and it was not started from a console, try starting it from a console or terminal (``python -m idlelib``) and see if this results in an error message. +On Unix-based systems with tcl/tk older than ``8.6.11`` (see +``About IDLE``) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better. + Running user code ^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 924042d25b7ba..e80384b777522 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -5,7 +5,7 @@ - IDLE — Python 3.10.0a5 documentation + IDLE — Python 3.10.0a6 documentation @@ -18,7 +18,7 @@ @@ -71,7 +71,7 @@

    Navigation

  • - 3.10.0a5 Documentation » + 3.10.0a6 Documentation »
  • @@ -632,8 +632,15 @@

    Startup failureTk error box with a ?cannot connect? message that directs the -user here. It then exits.

    +usually displays a Tk error box with a ?cannot connect? message +that directs the user here. It then exits.

    +

    One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system?s network setup. +When IDLE is started from a terminal, one will see a message starting +with ** Invalid host:. +The valid value is 127.0.0.1 (idlelib.rpc.LOCALHOST). +One can diagnose with tcpconnect -irv 127.0.0.1 6543 in one +terminal window and tcplisten <same args> in another.

    A common cause of failure is a user-written file with the same name as a standard library module, such as random.py and tkinter.py. When such a file is located in the same directory as a file that is about to be run, @@ -664,6 +671,12 @@

    Startup failurepython -m idlelib) and see if this results in an error message.

    +

    On Unix-based systems with tcl/tk older than 8.6.11 (see +About IDLE) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better.

    Running user code?

    @@ -958,7 +971,7 @@

    Navigation

  • - 3.10.0a5 Documentation » + 3.10.0a6 Documentation »
  • @@ -990,7 +1003,7 @@

    Navigation



    - Last updated on Feb 23, 2021. + Last updated on Mar 29, 2021. Found a bug?
    diff --git a/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst new file mode 100644 index 0000000000000..59fb08bdf9ebe --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst @@ -0,0 +1,2 @@ +Document that IDLE can fail on Unix either from misconfigured IP masquerage +rules or failure displaying complex colored (non-ascii) characters. From webhook-mailer at python.org Wed Mar 31 05:49:48 2021 From: webhook-mailer at python.org (methane) Date: Wed, 31 Mar 2021 09:49:48 -0000 Subject: [Python-checkins] Revert "bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)" (#25108) Message-ID: https://github.com/python/cpython/commit/cfa176685a5e788bafc7749d7a93f43ea3e4de9f commit: cfa176685a5e788bafc7749d7a93f43ea3e4de9f branch: master author: Inada Naoki committer: methane date: 2021-03-31T18:49:41+09:00 summary: Revert "bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)" (#25108) This reverts commit ff3c9739bd69aa8b58007e63c9e40e6708b4761e. files: M Lib/_pyio.py M Lib/test/test_io.py M Modules/_io/_iomodule.c diff --git a/Lib/_pyio.py b/Lib/_pyio.py index ba0b0a29b5013..0f182d4240206 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -221,7 +221,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None, raise ValueError("can't have read/write/append mode at once") if not (creating or reading or writing or appending): raise ValueError("must have exactly one of read/write/append mode") - if binary and encoding is not None and encoding != "locale": + if binary and encoding is not None: raise ValueError("binary mode doesn't take an encoding argument") if binary and errors is not None: raise ValueError("binary mode doesn't take an errors argument") diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 6a9ce39f08eb5..c731302a9f22f 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -531,17 +531,6 @@ class UnseekableWriter(self.MockUnseekableIO): self.assertRaises(OSError, obj.truncate) self.assertRaises(OSError, obj.truncate, 0) - def test_open_binmode_encoding(self): - """open() raises ValueError when encoding is specified in bin mode""" - self.assertRaises(ValueError, self.open, os_helper.TESTFN, - "wb", encoding="utf-8") - - # encoding=None and encoding="locale" is allowed. - with self.open(os_helper.TESTFN, "wb", encoding=None): - pass - with self.open(os_helper.TESTFN, "wb", encoding="locale"): - pass - def test_open_handles_NUL_chars(self): fn_with_NUL = 'foo\0bar' self.assertRaises(ValueError, self.open, fn_with_NUL, 'w') diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index c627ca257fd5e..652c2ce5b0d61 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -346,8 +346,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, goto error; } - if (binary && encoding != NULL - && strcmp(encoding, "locale") != 0) { + if (binary && encoding != NULL) { PyErr_SetString(PyExc_ValueError, "binary mode doesn't take an encoding argument"); goto error; From webhook-mailer at python.org Wed Mar 31 06:12:44 2021 From: webhook-mailer at python.org (ambv) Date: Wed, 31 Mar 2021 10:12:44 -0000 Subject: [Python-checkins] bpo-43179: Generalise alignment for optimised string routines (GH-24624) Message-ID: https://github.com/python/cpython/commit/dec075754960dd85972ce5170df76e862f966132 commit: dec075754960dd85972ce5170df76e862f966132 branch: master author: Jessica Clarke committer: ambv date: 2021-03-31T12:12:39+02:00 summary: bpo-43179: Generalise alignment for optimised string routines (GH-24624) * Remove m68k-specific hack from ascii_decode On m68k, alignments of primitives is more relaxed, with 4-byte and 8-byte types only requiring 2-byte alignment, thus using sizeof(size_t) does not work. Instead, use the portable alternative. Note that this is a minimal fix that only relaxes the assertion and the condition for when to use the optimised version remains overly strict. Such issues will be fixed tree-wide in the next commit. NB: In C11 we could use _Alignof(size_t) instead, but for compatibility we use autoconf. * Optimise string routines for architectures with non-natural alignment C only requires that sizeof(x) is a multiple of alignof(x), not that the two are equal. Thus anywhere where we optimise based on alignment we should be using alignof(x) not sizeof(x). This is more annoying than it would be in C11 where we could just use _Alignof(x) (and alignof(x) in C++11), but since we still require only C99 we must plumb the information all the way from autoconf through the various typedefs and defines. files: M Objects/bytes_methods.c M Objects/stringlib/codecs.h M Objects/stringlib/find_max_char.h M Objects/unicodeobject.c M PC/pyconfig.h M configure M configure.ac M pyconfig.h.in diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index 1512086e6131f..994fb8a73c6cd 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -115,15 +115,14 @@ _Py_bytes_isascii(const char *cptr, Py_ssize_t len) { const char *p = cptr; const char *end = p + len; - const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); while (p < end) { /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Help allocation */ const char *_p = p; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & ASCII_CHAR_MASK) { Py_RETURN_FALSE; diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index b6ca404b1a2d7..b17cda18f54b3 100644 --- a/Objects/stringlib/codecs.h +++ b/Objects/stringlib/codecs.h @@ -26,7 +26,6 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end, { Py_UCS4 ch; const char *s = *inptr; - const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); STRINGLIB_CHAR *p = dest + *outpos; while (s < end) { @@ -40,11 +39,11 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end, First, check if we can do an aligned read, as most CPUs have a penalty for unaligned reads. */ - if (_Py_IS_ALIGNED(s, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(s, ALIGNOF_SIZE_T)) { /* Help register allocation */ const char *_s = s; STRINGLIB_CHAR *_p = p; - while (_s < aligned_end) { + while (_s + SIZEOF_SIZE_T <= end) { /* Read a whole size_t at a time (either 4 or 8 bytes), and do a fast unrolled copy if it only contains ASCII characters. */ @@ -496,8 +495,6 @@ STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e, int native_ordering) { Py_UCS4 ch; - const unsigned char *aligned_end = - (const unsigned char *) _Py_ALIGN_DOWN(e, SIZEOF_LONG); const unsigned char *q = *inptr; STRINGLIB_CHAR *p = dest + *outpos; /* Offsets from q for retrieving byte pairs in the right order. */ @@ -512,10 +509,10 @@ STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e, Py_UCS4 ch2; /* First check for possible aligned read of a C 'long'. Unaligned reads are more expensive, better to defer to another iteration. */ - if (_Py_IS_ALIGNED(q, SIZEOF_LONG)) { + if (_Py_IS_ALIGNED(q, ALIGNOF_LONG)) { /* Fast path for runs of in-range non-surrogate chars. */ const unsigned char *_q = q; - while (_q < aligned_end) { + while (_q + SIZEOF_LONG <= e) { unsigned long block = * (const unsigned long *) _q; if (native_ordering) { /* Can use buffer directly */ diff --git a/Objects/stringlib/find_max_char.h b/Objects/stringlib/find_max_char.h index 3319a46461451..b9ffdfc2e352c 100644 --- a/Objects/stringlib/find_max_char.h +++ b/Objects/stringlib/find_max_char.h @@ -20,14 +20,12 @@ Py_LOCAL_INLINE(Py_UCS4) STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end) { const unsigned char *p = (const unsigned char *) begin; - const unsigned char *aligned_end = - (const unsigned char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); while (p < end) { - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Help register allocation */ const unsigned char *_p = p; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & UCS1_ASCII_CHAR_MASK) return 255; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a7a3151547099..f6bf505b7fc74 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5070,25 +5070,16 @@ static Py_ssize_t ascii_decode(const char *start, const char *end, Py_UCS1 *dest) { const char *p = start; - const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); - - /* - * Issue #17237: m68k is a bit different from most architectures in - * that objects do not use "natural alignment" - for example, int and - * long are only aligned at 2-byte boundaries. Therefore the assert() - * won't work; also, tests have shown that skipping the "optimised - * version" will even speed up m68k. - */ -#if !defined(__m68k__) + #if SIZEOF_SIZE_T <= SIZEOF_VOID_P - assert(_Py_IS_ALIGNED(dest, SIZEOF_SIZE_T)); - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + assert(_Py_IS_ALIGNED(dest, ALIGNOF_SIZE_T)); + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Fast path, see in STRINGLIB(utf8_decode) for an explanation. */ /* Help allocation */ const char *_p = p; Py_UCS1 * q = dest; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & ASCII_CHAR_MASK) break; @@ -5104,15 +5095,14 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest) } return p - start; } -#endif #endif while (p < end) { /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Help allocation */ const char *_p = p; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & ASCII_CHAR_MASK) break; diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 00a65b223da17..103e647ac8321 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -289,6 +289,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 8 # define SIZEOF_SIZE_T 8 +# define ALIGNOF_SIZE_T 8 /* configure.ac defines HAVE_LARGEFILE_SUPPORT iff sizeof(off_t) > sizeof(long), and sizeof(long long) >= sizeof(off_t). On Win64 the second condition is not true, but if fpos_t replaces off_t @@ -303,6 +304,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 4 # define SIZEOF_SIZE_T 4 +# define ALIGNOF_SIZE_T 4 /* MS VS2005 changes time_t to a 64-bit type on all platforms */ # if defined(_MSC_VER) && _MSC_VER >= 1400 # define SIZEOF_TIME_T 8 @@ -321,6 +323,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONG 4 +#define ALIGNOF_LONG 4 #define SIZEOF_LONG_LONG 8 #define SIZEOF_DOUBLE 8 #define SIZEOF_FLOAT 4 diff --git a/configure b/configure index 6ba109b3754c7..34a19a11a89c6 100755 --- a/configure +++ b/configure @@ -8644,7 +8644,7 @@ $as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h fi -# Sizes of various common basic types +# Sizes and alignments of various common basic types # ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects @@ -8712,6 +8712,41 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5 +$as_echo_n "checking alignment of long... " >&6; } +if ${ac_cv_alignof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long" "$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; long y; } ac__type_alignof_;"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of long +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5 +$as_echo "$ac_cv_alignof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define ALIGNOF_LONG $ac_cv_alignof_long +_ACEOF + + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. @@ -8943,6 +8978,41 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of size_t" >&5 +$as_echo_n "checking alignment of size_t... " >&6; } +if ${ac_cv_alignof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_size_t" "$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; size_t y; } ac__type_alignof_;"; then : + +else + if test "$ac_cv_type_size_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of size_t +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_size_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_size_t" >&5 +$as_echo "$ac_cv_alignof_size_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define ALIGNOF_SIZE_T $ac_cv_alignof_size_t +_ACEOF + + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. diff --git a/configure.ac b/configure.ac index 0db7e60f31747..8b3ab1e16f6af 100644 --- a/configure.ac +++ b/configure.ac @@ -2354,10 +2354,11 @@ AC_CHECK_TYPE(ssize_t, AC_CHECK_TYPE(__uint128_t, AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t]),,) -# Sizes of various common basic types +# Sizes and alignments of various common basic types # ANSI C requires sizeof(char) == 1, so no need to check it AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) +AC_CHECK_ALIGNOF(long) AC_CHECK_SIZEOF(long long, 8) AC_CHECK_SIZEOF(void *, 4) AC_CHECK_SIZEOF(short, 2) @@ -2365,6 +2366,7 @@ AC_CHECK_SIZEOF(float, 4) AC_CHECK_SIZEOF(double, 8) AC_CHECK_SIZEOF(fpos_t, 4) AC_CHECK_SIZEOF(size_t, 4) +AC_CHECK_ALIGNOF(size_t) AC_CHECK_SIZEOF(pid_t, 4) AC_CHECK_SIZEOF(uintptr_t) diff --git a/pyconfig.h.in b/pyconfig.h.in index b65004ee2e88a..9b713ac93e75e 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -16,6 +16,12 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS +/* The normal alignment of `long', in bytes. */ +#undef ALIGNOF_LONG + +/* The normal alignment of `size_t', in bytes. */ +#undef ALIGNOF_SIZE_T + /* Alternative SOABI used in debug build to load C extensions built in release mode */ #undef ALT_SOABI From webhook-mailer at python.org Wed Mar 31 06:23:01 2021 From: webhook-mailer at python.org (ambv) Date: Wed, 31 Mar 2021 10:23:01 -0000 Subject: [Python-checkins] Document GH-24624 Message-ID: https://github.com/python/cpython/commit/027d2cf1e5e2512888340b4cd5d2f1b5a3e8af94 commit: 027d2cf1e5e2512888340b4cd5d2f1b5a3e8af94 branch: master author: ?ukasz Langa committer: ambv date: 2021-03-31T12:22:37+02:00 summary: Document GH-24624 files: A Misc/NEWS.d/next/Build/2021-03-31-12-20-23.bpo-43179.Qbe1OD.rst diff --git a/Misc/NEWS.d/next/Build/2021-03-31-12-20-23.bpo-43179.Qbe1OD.rst b/Misc/NEWS.d/next/Build/2021-03-31-12-20-23.bpo-43179.Qbe1OD.rst new file mode 100644 index 0000000000000..2d22d47208215 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-31-12-20-23.bpo-43179.Qbe1OD.rst @@ -0,0 +1,3 @@ +Introduce and correctly use ALIGNOF_X in place of SIZEOF_X for +alignment-related code in optimized string routines. Patch by Jessica +Clarke. \ No newline at end of file From webhook-mailer at python.org Wed Mar 31 07:01:55 2021 From: webhook-mailer at python.org (ambv) Date: Wed, 31 Mar 2021 11:01:55 -0000 Subject: [Python-checkins] bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (#25110) Message-ID: https://github.com/python/cpython/commit/f3ab670fea75ebe177e3412a5ebe39263cd428e3 commit: f3ab670fea75ebe177e3412a5ebe39263cd428e3 branch: master author: Victor Stinner committer: ambv date: 2021-03-31T13:01:46+02:00 summary: bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (#25110) Skip the test if setlocale() fails. files: A Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst M Lib/test/test_locale.py diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index bd08c4f3007fc..4bb4c5541d077 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -564,7 +564,13 @@ def test_getsetlocale_issue1813(self): loc = locale.getlocale(locale.LC_CTYPE) if verbose: print('testing with %a' % (loc,), end=' ', flush=True) - locale.setlocale(locale.LC_CTYPE, loc) + try: + locale.setlocale(locale.LC_CTYPE, loc) + except locale.Error as exc: + # bpo-37945: setlocale(LC_CTYPE) fails with getlocale(LC_CTYPE) + # and the tr_TR locale on Windows. getlocale() builds a locale + # which is not recognize by setlocale(). + self.skipTest(f"setlocale(LC_CTYPE, {loc!r}) failed: {exc!r}") self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) def test_invalid_locale_format_in_localetuple(self): diff --git a/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst b/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst new file mode 100644 index 0000000000000..e1c95f63bf7c7 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst @@ -0,0 +1,2 @@ +Fix test_getsetlocale_issue1813() of test_locale: skip the test if +``setlocale()`` fails. Patch by Victor Stinner. From webhook-mailer at python.org Wed Mar 31 07:52:23 2021 From: webhook-mailer at python.org (ambv) Date: Wed, 31 Mar 2021 11:52:23 -0000 Subject: [Python-checkins] bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (GH-25110) (GH-25112) Message-ID: https://github.com/python/cpython/commit/fabdd25fe505c08da064425ea4d099fd2cef39d3 commit: fabdd25fe505c08da064425ea4d099fd2cef39d3 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ambv date: 2021-03-31T13:52:14+02:00 summary: bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (GH-25110) (GH-25112) Skip the test if setlocale() fails. (cherry picked from commit f3ab670fea75ebe177e3412a5ebe39263cd428e3) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst M Lib/test/test_locale.py diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index 2863d200e25c2..375a1e4028631 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -563,7 +563,13 @@ def test_getsetlocale_issue1813(self): loc = locale.getlocale(locale.LC_CTYPE) if verbose: print('testing with %a' % (loc,), end=' ', flush=True) - locale.setlocale(locale.LC_CTYPE, loc) + try: + locale.setlocale(locale.LC_CTYPE, loc) + except locale.Error as exc: + # bpo-37945: setlocale(LC_CTYPE) fails with getlocale(LC_CTYPE) + # and the tr_TR locale on Windows. getlocale() builds a locale + # which is not recognize by setlocale(). + self.skipTest(f"setlocale(LC_CTYPE, {loc!r}) failed: {exc!r}") self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) def test_invalid_locale_format_in_localetuple(self): diff --git a/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst b/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst new file mode 100644 index 0000000000000..e1c95f63bf7c7 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst @@ -0,0 +1,2 @@ +Fix test_getsetlocale_issue1813() of test_locale: skip the test if +``setlocale()`` fails. Patch by Victor Stinner. From webhook-mailer at python.org Wed Mar 31 07:52:35 2021 From: webhook-mailer at python.org (ambv) Date: Wed, 31 Mar 2021 11:52:35 -0000 Subject: [Python-checkins] bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (GH-25110) (GH-25113) Message-ID: https://github.com/python/cpython/commit/e143eea4b56ac7ae611e5bcc41eedbc572aa41c3 commit: e143eea4b56ac7ae611e5bcc41eedbc572aa41c3 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: ambv date: 2021-03-31T13:52:31+02:00 summary: bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (GH-25110) (GH-25113) Skip the test if setlocale() fails. (cherry picked from commit f3ab670fea75ebe177e3412a5ebe39263cd428e3) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst M Lib/test/test_locale.py diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index c5d8e269d6318..39091c04f494a 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -564,7 +564,13 @@ def test_getsetlocale_issue1813(self): loc = locale.getlocale(locale.LC_CTYPE) if verbose: print('testing with %a' % (loc,), end=' ', flush=True) - locale.setlocale(locale.LC_CTYPE, loc) + try: + locale.setlocale(locale.LC_CTYPE, loc) + except locale.Error as exc: + # bpo-37945: setlocale(LC_CTYPE) fails with getlocale(LC_CTYPE) + # and the tr_TR locale on Windows. getlocale() builds a locale + # which is not recognize by setlocale(). + self.skipTest(f"setlocale(LC_CTYPE, {loc!r}) failed: {exc!r}") self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) def test_invalid_locale_format_in_localetuple(self): diff --git a/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst b/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst new file mode 100644 index 0000000000000..e1c95f63bf7c7 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-03-31-11-38-42.bpo-37945.HTUYhv.rst @@ -0,0 +1,2 @@ +Fix test_getsetlocale_issue1813() of test_locale: skip the test if +``setlocale()`` fails. Patch by Victor Stinner. From webhook-mailer at python.org Wed Mar 31 08:31:46 2021 From: webhook-mailer at python.org (JulienPalard) Date: Wed, 31 Mar 2021 12:31:46 -0000 Subject: [Python-checkins] Disambiguate that -m also terminates the option list in the manpage. (GH-25100) Message-ID: https://github.com/python/cpython/commit/202b54644245afadf124d8043688a95d4d9c456d commit: 202b54644245afadf124d8043688a95d4d9c456d branch: master author: Julien Palard committer: JulienPalard date: 2021-03-31T14:31:38+02:00 summary: Disambiguate that -m also terminates the option list in the manpage. (GH-25100) files: M Misc/python.man diff --git a/Misc/python.man b/Misc/python.man index 225376574a26a..3ea1801c644ca 100644 --- a/Misc/python.man +++ b/Misc/python.man @@ -165,7 +165,8 @@ Searches .I sys.path for the named module and runs the corresponding .I .py -file as a script. +file as a script. This terminates the option list (following options +are passed as arguments to the module). .TP .B \-O Remove assert statements and any code conditional on the value of From webhook-mailer at python.org Wed Mar 31 12:20:13 2021 From: webhook-mailer at python.org (ethanfurman) Date: Wed, 31 Mar 2021 16:20:13 -0000 Subject: [Python-checkins] Enum: add (re)import of Flag for doctests (GH-25118) Message-ID: https://github.com/python/cpython/commit/49aec1a185bb2087fc4d846bd38d9150a357cfbd commit: 49aec1a185bb2087fc4d846bd38d9150a357cfbd branch: master author: Ethan Furman committer: ethanfurman date: 2021-03-31T09:20:08-07:00 summary: Enum: add (re)import of Flag for doctests (GH-25118) Fix issue with CI doctest forgetting that ``Flag`` had already been imported. files: M Doc/library/enum.rst diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 3a6b2aa2c50cd..bc88303b789de 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -518,7 +518,7 @@ Data Types Out-of-range values cause a :exc:`ValueError` to be raised. This is the default for :class:`Flag`:: - >>> from enum import STRICT + >>> from enum import Flag, STRICT >>> class StrictFlag(Flag, boundary=STRICT): ... RED = auto() ... GREEN = auto() @@ -535,7 +535,7 @@ Data Types Out-of-range values have invalid values removed, leaving a valid *Flag* value:: - >>> from enum import CONFORM + >>> from enum import Flag, CONFORM >>> class ConformFlag(Flag, boundary=CONFORM): ... RED = auto() ... GREEN = auto() @@ -548,7 +548,7 @@ Data Types Out-of-range values lose their *Flag* membership and revert to :class:`int`. This is the default for :class:`IntFlag`:: - >>> from enum import EJECT + >>> from enum import Flag, EJECT >>> class EjectFlag(Flag, boundary=EJECT): ... RED = auto() ... GREEN = auto() @@ -561,7 +561,7 @@ Data Types Out-of-range values are kept, and the *Flag* membership is kept. This is used for some stdlib flags: - >>> from enum import KEEP + >>> from enum import Flag, KEEP >>> class KeepFlag(Flag, boundary=KEEP): ... RED = auto() ... GREEN = auto() From webhook-mailer at python.org Wed Mar 31 20:10:40 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 01 Apr 2021 00:10:40 -0000 Subject: [Python-checkins] bpo-42840: Document providing kwargs to type. (GH-24173) Message-ID: https://github.com/python/cpython/commit/b3c1e2c493e67f84b1034ac6c49492a459b0736d commit: b3c1e2c493e67f84b1034ac6c49492a459b0736d branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-31T17:10:36-07:00 summary: bpo-42840: Document providing kwargs to type. (GH-24173) Co-authored-by: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com> (cherry picked from commit 72fcd14a82369ed32a5846d76f50e3026cf4eec2) Co-authored-by: Erik Soma files: M Doc/library/functions.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 990fc10c8cc97..ef51782205b45 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1675,7 +1675,7 @@ are always available. They are listed here in alphabetical order. .. class:: type(object) - type(name, bases, dict) + type(name, bases, dict, **kwds) .. index:: object: type @@ -1704,6 +1704,13 @@ are always available. They are listed here in alphabetical order. See also :ref:`bltin-type-objects`. + Keyword arguments provided to the three argument form are passed to the + appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) + in the same way that keywords in a class + definition (besides *metaclass*) would. + + See also :ref:`class-customization`. + .. versionchanged:: 3.6 Subclasses of :class:`type` which don't override ``type.__new__`` may no longer use the one-argument form to get the type of an object. From webhook-mailer at python.org Wed Mar 31 20:10:42 2021 From: webhook-mailer at python.org (miss-islington) Date: Thu, 01 Apr 2021 00:10:42 -0000 Subject: [Python-checkins] Fix grammar in enum documentation. (GH-24689) Message-ID: https://github.com/python/cpython/commit/a2fb286b8632127a37f5bb6e63e334e8356161b9 commit: a2fb286b8632127a37f5bb6e63e334e8356161b9 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: miss-islington <31488909+miss-islington at users.noreply.github.com> date: 2021-03-31T17:10:37-07:00 summary: Fix grammar in enum documentation. (GH-24689) There is an extra `s` in the singular word `method`. Reported in docs mailing list by Steven Nguyen. Automerge-Triggered-By: GH:Mariatta (cherry picked from commit f193874056fb185305084b79b32d2745ce9be7cf) Co-authored-by: Mariatta Wijaya files: M Doc/library/enum.rst diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index c7e2b109c3513..40499eb93a1ad 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -276,7 +276,7 @@ overridden:: .. note:: - The goal of the default :meth:`_generate_next_value_` methods is to provide + The goal of the default :meth:`_generate_next_value_` method is to provide the next :class:`int` in sequence with the last :class:`int` provided, but the way it does this is an implementation detail and may change. From webhook-mailer at python.org Wed Mar 31 20:28:36 2021 From: webhook-mailer at python.org (vstinner) Date: Thu, 01 Apr 2021 00:28:36 -0000 Subject: [Python-checkins] bpo-42955: Add _overlapped to sys.stdlib_module_names (GH-25122) Message-ID: https://github.com/python/cpython/commit/ad493edf5791e7abb2588852e876b8584945c653 commit: ad493edf5791e7abb2588852e876b8584945c653 branch: master author: Victor Stinner committer: vstinner date: 2021-04-01T02:28:23+02:00 summary: bpo-42955: Add _overlapped to sys.stdlib_module_names (GH-25122) files: M Python/stdlib_module_names.h M Tools/scripts/generate_stdlib_module_names.py diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h index 980438545ac2f..b09b8dc7a394a 100644 --- a/Python/stdlib_module_names.h +++ b/Python/stdlib_module_names.h @@ -52,6 +52,7 @@ static const char* _Py_stdlib_module_names[] = { "_opcode", "_operator", "_osx_support", +"_overlapped", "_pickle", "_posixshmem", "_posixsubprocess", diff --git a/Tools/scripts/generate_stdlib_module_names.py b/Tools/scripts/generate_stdlib_module_names.py index 046b9eb1d2df6..716a6d4b7a07f 100644 --- a/Tools/scripts/generate_stdlib_module_names.py +++ b/Tools/scripts/generate_stdlib_module_names.py @@ -42,6 +42,7 @@ # Windows extension modules WINDOWS_MODULES = ( '_msi', + '_overlapped', '_testconsole', '_winapi', 'msvcrt', From webhook-mailer at python.org Wed Mar 31 22:23:23 2021 From: webhook-mailer at python.org (methane) Date: Thu, 01 Apr 2021 02:23:23 -0000 Subject: [Python-checkins] bpo-43651: Fix EncodingWarning in test_file and test_file_eintr (GH-25109) Message-ID: https://github.com/python/cpython/commit/55f31be44b7e3ee24a67134f99543512a9b630e4 commit: 55f31be44b7e3ee24a67134f99543512a9b630e4 branch: master author: Inada Naoki committer: methane date: 2021-04-01T11:23:03+09:00 summary: bpo-43651: Fix EncodingWarning in test_file and test_file_eintr (GH-25109) files: M Lib/test/test_file.py M Lib/test/test_file_eintr.py diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index 149767591d9eb..fbfba64759a1e 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -52,7 +52,7 @@ def testReadinto_text(self): # verify readinto refuses text files a = array('b', b'x'*10) self.f.close() - self.f = self.open(TESTFN, 'r') + self.f = self.open(TESTFN, encoding="utf-8") if hasattr(self.f, "readinto"): self.assertRaises(TypeError, self.f.readinto, a) diff --git a/Lib/test/test_file_eintr.py b/Lib/test/test_file_eintr.py index f1efd266ffb62..01408d838a83c 100644 --- a/Lib/test/test_file_eintr.py +++ b/Lib/test/test_file_eintr.py @@ -213,7 +213,7 @@ class TestTextIOSignalInterrupt(TestFileIOSignalInterrupt): def _generate_infile_setup_code(self): """Returns the infile = ... line of code to make a TextIOWrapper.""" return ('import %s as io ;' - 'infile = io.open(sys.stdin.fileno(), "rt", newline=None) ;' + 'infile = io.open(sys.stdin.fileno(), encoding="utf-8", newline=None) ;' 'assert isinstance(infile, io.TextIOWrapper)' % self.modname) From webhook-mailer at python.org Wed Mar 31 22:25:11 2021 From: webhook-mailer at python.org (methane) Date: Thu, 01 Apr 2021 02:25:11 -0000 Subject: [Python-checkins] bpo-43651: Fix EncodingWarning in test_io (GH-25097) Message-ID: https://github.com/python/cpython/commit/58cffba1874f0e9a9731b25a3e11a011bfbbf95f commit: 58cffba1874f0e9a9731b25a3e11a011bfbbf95f branch: master author: Inada Naoki committer: methane date: 2021-04-01T11:25:04+09:00 summary: bpo-43651: Fix EncodingWarning in test_io (GH-25097) files: M Lib/test/test_io.py diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index c731302a9f22f..d493b19525af3 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -407,10 +407,12 @@ def large_file_ops(self, f): def test_invalid_operations(self): # Try writing on a file opened in read mode and vice-versa. exc = self.UnsupportedOperation - for mode in ("w", "wb"): - with self.open(os_helper.TESTFN, mode) as fp: - self.assertRaises(exc, fp.read) - self.assertRaises(exc, fp.readline) + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as fp: + self.assertRaises(exc, fp.read) + self.assertRaises(exc, fp.readline) + with self.open(os_helper.TESTFN, "wb") as fp: + self.assertRaises(exc, fp.read) + self.assertRaises(exc, fp.readline) with self.open(os_helper.TESTFN, "wb", buffering=0) as fp: self.assertRaises(exc, fp.read) self.assertRaises(exc, fp.readline) @@ -420,7 +422,7 @@ def test_invalid_operations(self): with self.open(os_helper.TESTFN, "rb") as fp: self.assertRaises(exc, fp.write, b"blah") self.assertRaises(exc, fp.writelines, [b"blah\n"]) - with self.open(os_helper.TESTFN, "r") as fp: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as fp: self.assertRaises(exc, fp.write, "blah") self.assertRaises(exc, fp.writelines, ["blah\n"]) # Non-zero seeking from current or end pos @@ -533,12 +535,12 @@ class UnseekableWriter(self.MockUnseekableIO): def test_open_handles_NUL_chars(self): fn_with_NUL = 'foo\0bar' - self.assertRaises(ValueError, self.open, fn_with_NUL, 'w') + self.assertRaises(ValueError, self.open, fn_with_NUL, 'w', encoding="utf-8") bytes_fn = bytes(fn_with_NUL, 'ascii') with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - self.assertRaises(ValueError, self.open, bytes_fn, 'w') + self.assertRaises(ValueError, self.open, bytes_fn, 'w', encoding="utf-8") def test_raw_file_io(self): with self.open(os_helper.TESTFN, "wb", buffering=0) as f: @@ -575,7 +577,7 @@ def test_readline(self): self.assertEqual(f.readline(), b"foo\x00bar\n") self.assertEqual(f.readline(None), b"another line") self.assertRaises(TypeError, f.readline, 5.3) - with self.open(os_helper.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: self.assertRaises(TypeError, f.readline, 5.3) def test_readline_nonsizeable(self): @@ -638,7 +640,7 @@ def test_append_mode_tell(self): self.assertEqual(f.tell(), 3) with self.open(os_helper.TESTFN, "ab") as f: self.assertEqual(f.tell(), 3) - with self.open(os_helper.TESTFN, "a") as f: + with self.open(os_helper.TESTFN, "a", encoding="utf-8") as f: self.assertGreater(f.tell(), 0) def test_destructor(self): @@ -730,13 +732,13 @@ def check(f): def test_closefd(self): self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'w', - closefd=False) + encoding="utf-8", closefd=False) def test_read_closed(self): - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: f.write("egg\n") - with self.open(os_helper.TESTFN, "r") as f: - file = self.open(f.fileno(), "r", closefd=False) + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: + file = self.open(f.fileno(), "r", encoding="utf-8", closefd=False) self.assertEqual(file.read(), "egg\n") file.seek(0) file.close() @@ -749,14 +751,15 @@ def test_read_closed(self): def test_no_closefd_with_filename(self): # can't use closefd in combination with a file name - self.assertRaises(ValueError, self.open, os_helper.TESTFN, "r", closefd=False) + self.assertRaises(ValueError, self.open, os_helper.TESTFN, "r", + encoding="utf-8", closefd=False) def test_closefd_attr(self): with self.open(os_helper.TESTFN, "wb") as f: f.write(b"egg\n") - with self.open(os_helper.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: self.assertEqual(f.buffer.raw.closefd, True) - file = self.open(f.fileno(), "r", closefd=False) + file = self.open(f.fileno(), "r", encoding="utf-8", closefd=False) self.assertEqual(file.buffer.raw.closefd, False) def test_garbage_collection(self): @@ -821,11 +824,11 @@ def test_flush_error_on_close(self): self.check_flush_error_on_close(fd, 'wb', closefd=False) os.close(fd) # text io - self.check_flush_error_on_close(os_helper.TESTFN, 'w') + self.check_flush_error_on_close(os_helper.TESTFN, 'w', encoding="utf-8") fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) - self.check_flush_error_on_close(fd, 'w') + self.check_flush_error_on_close(fd, 'w', encoding="utf-8") fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) - self.check_flush_error_on_close(fd, 'w', closefd=False) + self.check_flush_error_on_close(fd, 'w', encoding="utf-8", closefd=False) os.close(fd) def test_multi_close(self): @@ -860,12 +863,12 @@ def test_types_have_dict(self): self.assertTrue(hasattr(obj, "__dict__")) def test_opener(self): - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: f.write("egg\n") fd = os.open(os_helper.TESTFN, os.O_RDONLY) def opener(path, flags): return fd - with self.open("non-existent", "r", opener=opener) as f: + with self.open("non-existent", "r", encoding="utf-8", opener=opener) as f: self.assertEqual(f.read(), "egg\n") def test_bad_opener_negative_1(self): @@ -899,12 +902,12 @@ def test_fileio_closefd(self): def test_nonbuffered_textio(self): with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): - self.open(os_helper.TESTFN, 'w', buffering=0) + self.open(os_helper.TESTFN, 'w', encoding="utf-8", buffering=0) def test_invalid_newline(self): with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): - self.open(os_helper.TESTFN, 'w', newline='invalid') + self.open(os_helper.TESTFN, 'w', encoding="utf-8", newline='invalid') def test_buffered_readinto_mixin(self): # Test the implementation provided by BufferedIOBase @@ -921,31 +924,31 @@ def read(self, size): def test_fspath_support(self): def check_path_succeeds(path): - with self.open(path, "w") as f: + with self.open(path, "w", encoding="utf-8") as f: f.write("egg\n") - with self.open(path, "r") as f: + with self.open(path, "r", encoding="utf-8") as f: self.assertEqual(f.read(), "egg\n") check_path_succeeds(FakePath(os_helper.TESTFN)) check_path_succeeds(FakePath(os.fsencode(os_helper.TESTFN))) - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: bad_path = FakePath(f.fileno()) with self.assertRaises(TypeError): - self.open(bad_path, 'w') + self.open(bad_path, 'w', encoding="utf-8") bad_path = FakePath(None) with self.assertRaises(TypeError): - self.open(bad_path, 'w') + self.open(bad_path, 'w', encoding="utf-8") bad_path = FakePath(FloatingPointError) with self.assertRaises(FloatingPointError): - self.open(bad_path, 'w') + self.open(bad_path, 'w', encoding="utf-8") # ensure that refcounting is correct with some error conditions with self.assertRaisesRegex(ValueError, 'read/write/append mode'): - self.open(FakePath(os_helper.TESTFN), 'rwxa') + self.open(FakePath(os_helper.TESTFN), 'rwxa', encoding="utf-8") def test_RawIOBase_readall(self): # Exercise the default unlimited RawIOBase.read() and readall() @@ -2590,7 +2593,7 @@ def tearDown(self): def test_constructor(self): r = self.BytesIO(b"\xc3\xa9\n\n") b = self.BufferedReader(r, 1000) - t = self.TextIOWrapper(b) + t = self.TextIOWrapper(b, encoding="utf-8") t.__init__(b, encoding="latin-1", newline="\r\n") self.assertEqual(t.encoding, "latin-1") self.assertEqual(t.line_buffering, False) @@ -2609,7 +2612,7 @@ def test_uninitialized(self): self.assertRaisesRegex((ValueError, AttributeError), 'uninitialized|has no attribute', t.read, 0) - t.__init__(self.MockRawIO()) + t.__init__(self.MockRawIO(), encoding="utf-8") self.assertEqual(t.read(0), '') def test_non_text_encoding_codecs_are_rejected(self): @@ -2624,7 +2627,7 @@ def test_non_text_encoding_codecs_are_rejected(self): def test_detach(self): r = self.BytesIO() b = self.BufferedWriter(r) - t = self.TextIOWrapper(b) + t = self.TextIOWrapper(b, encoding="ascii") self.assertIs(t.detach(), b) t = self.TextIOWrapper(b, encoding="ascii") @@ -2664,7 +2667,7 @@ def test_repr(self): def test_recursive_repr(self): # Issue #25455 raw = self.BytesIO() - t = self.TextIOWrapper(raw) + t = self.TextIOWrapper(raw, encoding="utf-8") with support.swap_attr(raw, 'name', t): try: repr(t) # Should not crash @@ -2674,7 +2677,7 @@ def test_recursive_repr(self): def test_line_buffering(self): r = self.BytesIO() b = self.BufferedWriter(r, 1000) - t = self.TextIOWrapper(b, newline="\n", line_buffering=True) + t = self.TextIOWrapper(b, encoding="utf-8", newline="\n", line_buffering=True) t.write("X") self.assertEqual(r.getvalue(), b"") # No flush happened t.write("Y\nZ") @@ -2685,7 +2688,7 @@ def test_line_buffering(self): def test_reconfigure_line_buffering(self): r = self.BytesIO() b = self.BufferedWriter(r, 1000) - t = self.TextIOWrapper(b, newline="\n", line_buffering=False) + t = self.TextIOWrapper(b, encoding="utf-8", newline="\n", line_buffering=False) t.write("AB\nC") self.assertEqual(r.getvalue(), b"") @@ -2722,7 +2725,9 @@ def test_default_encoding(self): current_locale_encoding = locale.getpreferredencoding(False) b = self.BytesIO() - t = self.TextIOWrapper(b) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", EncodingWarning) + t = self.TextIOWrapper(b) self.assertEqual(t.encoding, current_locale_encoding) finally: os.environ.clear() @@ -2735,16 +2740,18 @@ def test_device_encoding(self): import _testcapi b = self.BytesIO() b.fileno = lambda: _testcapi.INT_MAX + 1 - self.assertRaises(OverflowError, self.TextIOWrapper, b) + self.assertRaises(OverflowError, self.TextIOWrapper, b, encoding="locale") b.fileno = lambda: _testcapi.UINT_MAX + 1 - self.assertRaises(OverflowError, self.TextIOWrapper, b) + self.assertRaises(OverflowError, self.TextIOWrapper, b, encoding="locale") def test_encoding(self): # Check the encoding attribute is always set, and valid b = self.BytesIO() t = self.TextIOWrapper(b, encoding="utf-8") self.assertEqual(t.encoding, "utf-8") - t = self.TextIOWrapper(b) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", EncodingWarning) + t = self.TextIOWrapper(b) self.assertIsNotNone(t.encoding) codecs.lookup(t.encoding) @@ -2909,7 +2916,7 @@ def test_error_through_destructor(self): rawio = self.CloseFailureIO() with support.catch_unraisable_exception() as cm: with self.assertRaises(AttributeError): - self.TextIOWrapper(rawio).xyzzy + self.TextIOWrapper(rawio, encoding="utf-8").xyzzy if not IOBASE_EMITS_UNRAISABLE: self.assertIsNone(cm.unraisable) @@ -3116,11 +3123,11 @@ def test_unreadable(self): class UnReadable(self.BytesIO): def readable(self): return False - txt = self.TextIOWrapper(UnReadable()) + txt = self.TextIOWrapper(UnReadable(), encoding="utf-8") self.assertRaises(OSError, txt.read) def test_read_one_by_one(self): - txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB")) + txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB"), encoding="utf-8") reads = "" while True: c = txt.read(1) @@ -3130,7 +3137,7 @@ def test_read_one_by_one(self): self.assertEqual(reads, "AA\nBB") def test_readlines(self): - txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC")) + txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC"), encoding="utf-8") self.assertEqual(txt.readlines(), ["AA\n", "BB\n", "CC"]) txt.seek(0) self.assertEqual(txt.readlines(None), ["AA\n", "BB\n", "CC"]) @@ -3140,7 +3147,7 @@ def test_readlines(self): # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128. def test_read_by_chunk(self): # make sure "\r\n" straddles 128 char boundary. - txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB")) + txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB"), encoding="utf-8") reads = "" while True: c = txt.read(128) @@ -3152,7 +3159,7 @@ def test_read_by_chunk(self): def test_writelines(self): l = ['ab', 'cd', 'ef'] buf = self.BytesIO() - txt = self.TextIOWrapper(buf) + txt = self.TextIOWrapper(buf, encoding="utf-8") txt.writelines(l) txt.flush() self.assertEqual(buf.getvalue(), b'abcdef') @@ -3160,13 +3167,13 @@ def test_writelines(self): def test_writelines_userlist(self): l = UserList(['ab', 'cd', 'ef']) buf = self.BytesIO() - txt = self.TextIOWrapper(buf) + txt = self.TextIOWrapper(buf, encoding="utf-8") txt.writelines(l) txt.flush() self.assertEqual(buf.getvalue(), b'abcdef') def test_writelines_error(self): - txt = self.TextIOWrapper(self.BytesIO()) + txt = self.TextIOWrapper(self.BytesIO(), encoding="utf-8") self.assertRaises(TypeError, txt.writelines, [1, 2, 3]) self.assertRaises(TypeError, txt.writelines, None) self.assertRaises(TypeError, txt.writelines, b'abc') @@ -3274,16 +3281,16 @@ def test_seek_append_bom(self): self.assertEqual(f.read(), 'aaaxxx'.encode(charset)) def test_errors_property(self): - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: self.assertEqual(f.errors, "strict") - with self.open(os_helper.TESTFN, "w", errors="replace") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8", errors="replace") as f: self.assertEqual(f.errors, "replace") @support.no_tracing def test_threads_write(self): # Issue6750: concurrent writes could duplicate data event = threading.Event() - with self.open(os_helper.TESTFN, "w", buffering=1) as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8", buffering=1) as f: def run(n): text = "Thread%03d\n" % n event.wait() @@ -3292,7 +3299,7 @@ def run(n): for x in range(20)] with threading_helper.start_threads(threads, event.set): time.sleep(0.02) - with self.open(os_helper.TESTFN) as f: + with self.open(os_helper.TESTFN, encoding="utf-8") as f: content = f.read() for n in range(20): self.assertEqual(content.count("Thread%03d\n" % n), 1) @@ -3363,7 +3370,7 @@ def test_multi_close(self): self.assertRaises(ValueError, txt.flush) def test_unseekable(self): - txt = self.TextIOWrapper(self.MockUnseekableIO(self.testdata)) + txt = self.TextIOWrapper(self.MockUnseekableIO(self.testdata), encoding="utf-8") self.assertRaises(self.UnsupportedOperation, txt.tell) self.assertRaises(self.UnsupportedOperation, txt.seek, 0) @@ -3452,11 +3459,11 @@ def test_reconfigure_write_through(self): def test_read_nonbytes(self): # Issue #17106 # Crash when underlying read() returns non-bytes - t = self.TextIOWrapper(self.StringIO('a')) + t = self.TextIOWrapper(self.StringIO('a'), encoding="utf-8") self.assertRaises(TypeError, t.read, 1) - t = self.TextIOWrapper(self.StringIO('a')) + t = self.TextIOWrapper(self.StringIO('a'), encoding="utf-8") self.assertRaises(TypeError, t.readline) - t = self.TextIOWrapper(self.StringIO('a')) + t = self.TextIOWrapper(self.StringIO('a'), encoding="utf-8") self.assertRaises(TypeError, t.read) def test_illegal_encoder(self): @@ -3724,7 +3731,7 @@ class CTextIOWrapperTest(TextIOWrapperTest): def test_initialization(self): r = self.BytesIO(b"\xc3\xa9\n\n") b = self.BufferedReader(r, 1000) - t = self.TextIOWrapper(b) + t = self.TextIOWrapper(b, encoding="utf-8") self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') self.assertRaises(ValueError, t.read) @@ -3948,7 +3955,7 @@ def test_attributes(self): f.close() with warnings_helper.check_warnings(('', DeprecationWarning)): - f = self.open(os_helper.TESTFN, "U") + f = self.open(os_helper.TESTFN, "U", encoding="utf-8") self.assertEqual(f.name, os_helper.TESTFN) self.assertEqual(f.buffer.name, os_helper.TESTFN) self.assertEqual(f.buffer.raw.name, os_helper.TESTFN) @@ -3957,7 +3964,7 @@ def test_attributes(self): self.assertEqual(f.buffer.raw.mode, "rb") f.close() - f = self.open(os_helper.TESTFN, "w+") + f = self.open(os_helper.TESTFN, "w+", encoding="utf-8") self.assertEqual(f.mode, "w+") self.assertEqual(f.buffer.mode, "rb+") # Does it really matter? self.assertEqual(f.buffer.raw.mode, "rb+") @@ -3974,7 +3981,7 @@ def test_open_pipe_with_append(self): # bpo-27805: Ignore ESPIPE from lseek() in open(). r, w = os.pipe() self.addCleanup(os.close, r) - f = self.open(w, 'a') + f = self.open(w, 'a', encoding="utf-8") self.addCleanup(f.close) # Check that the file is marked non-seekable. On Windows, however, lseek # somehow succeeds on pipes. @@ -3999,6 +4006,8 @@ def test_io_after_close(self): {"mode": "w+", "buffering": 2}, {"mode": "w+b", "buffering": 0}, ]: + if "b" not in kwargs["mode"]: + kwargs["encoding"] = "utf-8" f = self.open(os_helper.TESTFN, **kwargs) f.close() self.assertRaises(ValueError, f.flush) @@ -4059,7 +4068,7 @@ def _check_abc_inheritance(self, abcmodule): self.assertNotIsInstance(f, abcmodule.RawIOBase) self.assertIsInstance(f, abcmodule.BufferedIOBase) self.assertNotIsInstance(f, abcmodule.TextIOBase) - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: self.assertIsInstance(f, abcmodule.IOBase) self.assertNotIsInstance(f, abcmodule.RawIOBase) self.assertNotIsInstance(f, abcmodule.BufferedIOBase) @@ -4085,7 +4094,7 @@ def _check_warn_on_dealloc(self, *args, **kwargs): def test_warn_on_dealloc(self): self._check_warn_on_dealloc(os_helper.TESTFN, "wb", buffering=0) self._check_warn_on_dealloc(os_helper.TESTFN, "wb") - self._check_warn_on_dealloc(os_helper.TESTFN, "w") + self._check_warn_on_dealloc(os_helper.TESTFN, "w", encoding="utf-8") def _check_warn_on_dealloc_fd(self, *args, **kwargs): fds = [] @@ -4109,7 +4118,7 @@ def cleanup_fds(): def test_warn_on_dealloc_fd(self): self._check_warn_on_dealloc_fd("rb", buffering=0) self._check_warn_on_dealloc_fd("rb") - self._check_warn_on_dealloc_fd("r") + self._check_warn_on_dealloc_fd("r", encoding="utf-8") def test_pickling(self): @@ -4125,6 +4134,8 @@ def test_pickling(self): {"mode": "w+b"}, {"mode": "w+b", "buffering": 0}, ]: + if "b" not in kwargs["mode"]: + kwargs["encoding"] = "utf-8" for protocol in range(pickle.HIGHEST_PROTOCOL + 1): with self.open(os_helper.TESTFN, **kwargs) as f: self.assertRaises(TypeError, pickle.dumps, f, protocol) @@ -4189,9 +4200,9 @@ def _test_nonblock_pipe_write(self, bufsize): def test_create_fail(self): # 'x' mode fails if file is existing - with self.open(os_helper.TESTFN, 'w'): + with self.open(os_helper.TESTFN, 'w', encoding="utf-8"): pass - self.assertRaises(FileExistsError, self.open, os_helper.TESTFN, 'x') + self.assertRaises(FileExistsError, self.open, os_helper.TESTFN, 'x', encoding="utf-8") def test_create_writes(self): # 'x' mode opens for writing @@ -4202,7 +4213,7 @@ def test_create_writes(self): def test_open_allargs(self): # there used to be a buffer overflow in the parser for rawmode - self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'rwax+') + self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'rwax+', encoding="utf-8") def test_check_encoding_errors(self): # bpo-37388: open() and TextIOWrapper must check encoding and errors @@ -4474,7 +4485,7 @@ def test_interrupted_read_retry_buffered(self): def test_interrupted_read_retry_text(self): self.check_interrupted_read_retry(lambda x: x, - mode="r") + mode="r", encoding="latin1") def check_interrupted_write_retry(self, item, **fdopen_kwargs): """Check that a buffered write, when it gets interrupted (either From webhook-mailer at python.org Wed Mar 31 23:46:44 2021 From: webhook-mailer at python.org (tim-one) Date: Thu, 01 Apr 2021 03:46:44 -0000 Subject: [Python-checkins] When printing stats, move radix tree info to its own section. (GH-25125) Message-ID: https://github.com/python/cpython/commit/078a3433ebe4c211cd93c84cd9c2148c3aa23238 commit: 078a3433ebe4c211cd93c84cd9c2148c3aa23238 branch: master author: Tim Peters committer: tim-one date: 2021-03-31T22:46:31-05:00 summary: When printing stats, move radix tree info to its own section. (GH-25125) When printing stats, move radix tree info to its own section. Restore that the breakdown of bytes in arenas exactly accounts for the total of arena bytes allocated. Add an assert so that invariant doesn't break again. files: M Objects/obmalloc.c diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 76ff6f9c99bc9..c1c12797aba11 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -3027,12 +3027,6 @@ _PyObject_DebugMallocStats(FILE *out) (void)printone(out, "# arenas reclaimed", ntimes_arena_allocated - narenas); (void)printone(out, "# arenas highwater mark", narenas_highwater); (void)printone(out, "# arenas allocated current", narenas); -#ifdef USE_INTERIOR_NODES - (void)printone(out, "# arena map mid nodes", arena_map_mid_count); - (void)printone(out, "# arena map bot nodes", arena_map_bot_count); - fputc('\n', out); -#endif - PyOS_snprintf(buf, sizeof(buf), "%zu arenas * %d bytes/arena", @@ -3041,6 +3035,7 @@ _PyObject_DebugMallocStats(FILE *out) fputc('\n', out); + /* Account for what all of those arena bytes are being used for. */ total = printone(out, "# bytes in allocated blocks", allocated_bytes); total += printone(out, "# bytes in available blocks", available_bytes); @@ -3051,16 +3046,26 @@ _PyObject_DebugMallocStats(FILE *out) total += printone(out, "# bytes lost to pool headers", pool_header_bytes); total += printone(out, "# bytes lost to quantization", quantization); total += printone(out, "# bytes lost to arena alignment", arena_alignment); -#ifdef WITH_PYMALLOC_RADIX_TREE - total += printone(out, "# bytes lost to arena map root", sizeof(arena_map_root)); + (void)printone(out, "Total", total); + assert(narenas * ARENA_SIZE == total); + +#if WITH_PYMALLOC_RADIX_TREE + fputs("\narena map counts\n", out); +#ifdef USE_INTERIOR_NODES + (void)printone(out, "# arena map mid nodes", arena_map_mid_count); + (void)printone(out, "# arena map bot nodes", arena_map_bot_count); + fputc('\n', out); #endif + total = printone(out, "# bytes lost to arena map root", sizeof(arena_map_root)); #ifdef USE_INTERIOR_NODES total += printone(out, "# bytes lost to arena map mid", sizeof(arena_map_mid_t) * arena_map_mid_count); total += printone(out, "# bytes lost to arena map bot", sizeof(arena_map_bot_t) * arena_map_bot_count); -#endif (void)printone(out, "Total", total); +#endif +#endif + return 1; }